mirror of
https://github.com/holub/mame
synced 2025-07-04 17:38:08 +03:00
pc9801: fix scrolling and avsdrv; add high exvram window (nw)
This commit is contained in:
parent
aec47ff639
commit
80d8edfcdd
@ -183,11 +183,15 @@ void pc9801_86_device::device_reset()
|
|||||||
install_device(port_base + 0x0088, port_base + 0x008f, read8_delegate(FUNC(pc9801_86_device::opn_r), this), write8_delegate(FUNC(pc9801_86_device::opn_w), this) );
|
install_device(port_base + 0x0088, port_base + 0x008f, read8_delegate(FUNC(pc9801_86_device::opn_r), this), write8_delegate(FUNC(pc9801_86_device::opn_w), this) );
|
||||||
install_device(0xa460, 0xa463, read8_delegate(FUNC(pc9801_86_device::id_r), this), write8_delegate(FUNC(pc9801_86_device::mask_w), this));
|
install_device(0xa460, 0xa463, read8_delegate(FUNC(pc9801_86_device::id_r), this), write8_delegate(FUNC(pc9801_86_device::mask_w), this));
|
||||||
install_device(0xa464, 0xa46f, read8_delegate(FUNC(pc9801_86_device::pcm_r), this), write8_delegate(FUNC(pc9801_86_device::pcm_w), this));
|
install_device(0xa464, 0xa46f, read8_delegate(FUNC(pc9801_86_device::pcm_r), this), write8_delegate(FUNC(pc9801_86_device::pcm_w), this));
|
||||||
|
install_device(0xa66c, 0xa66f, read8_delegate([this](address_space &s, offs_t o, u8 mm){ return o == 2 ? m_pcm_mute : 0xff; }, "pc9801_86_mute_r"),
|
||||||
|
write8_delegate([this](address_space &s, offs_t o, u8 d, u8 mm){ if(o == 2) m_pcm_mute = d; }, "pc9801_86_mute_w"));
|
||||||
m_mask = 0;
|
m_mask = 0;
|
||||||
m_head = m_tail = m_count = 0;
|
m_head = m_tail = m_count = 0;
|
||||||
m_fmirq = m_pcmirq = false;
|
m_fmirq = m_pcmirq = false;
|
||||||
m_irq_rate = 0;
|
m_irq_rate = 0;
|
||||||
m_pcm_ctrl = m_pcm_mode = 0;
|
m_pcm_ctrl = m_pcm_mode = 0;
|
||||||
|
m_pcm_mute = 0;
|
||||||
|
m_pcm_clk = false;
|
||||||
memset(&m_queue[0], 0, QUEUE_SIZE);
|
memset(&m_queue[0], 0, QUEUE_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -234,15 +238,13 @@ READ8_MEMBER(pc9801_86_device::pcm_r)
|
|||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
return ((queue_count() == QUEUE_SIZE) ? 0x80 : 0) |
|
return ((queue_count() == QUEUE_SIZE) ? 0x80 : 0) |
|
||||||
(!queue_count() ? 0x40 : 0);
|
(!queue_count() ? 0x40 : 0) | (m_pcm_clk ? 1 : 0);
|
||||||
case 2:
|
case 2:
|
||||||
return m_pcm_ctrl | (m_pcmirq ? 0x10 : 0);
|
return m_pcm_ctrl | (m_pcmirq ? 0x10 : 0);
|
||||||
case 3:
|
case 3:
|
||||||
return m_pcm_mode;
|
return m_pcm_mode;
|
||||||
case 4:
|
case 4:
|
||||||
return 0;
|
return 0;
|
||||||
case 5:
|
|
||||||
return m_pcm_mute;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // odd
|
else // odd
|
||||||
@ -263,10 +265,7 @@ WRITE8_MEMBER(pc9801_86_device::pcm_w)
|
|||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
m_pcm_ctrl = data & ~0x10;
|
m_pcm_ctrl = data & ~0x10;
|
||||||
if(data & 0x80)
|
m_dac_timer->adjust(attotime::from_ticks(divs[data & 7], rate), 0, attotime::from_ticks(divs[data & 7], rate));
|
||||||
m_dac_timer->adjust(attotime::from_ticks(divs[data & 7], rate), 0, attotime::from_ticks(divs[data & 7], rate));
|
|
||||||
else
|
|
||||||
m_dac_timer->adjust(attotime::never);
|
|
||||||
if(data & 8)
|
if(data & 8)
|
||||||
m_head = m_tail = m_count = 0;
|
m_head = m_tail = m_count = 0;
|
||||||
if(!(data & 0x10))
|
if(!(data & 0x10))
|
||||||
@ -289,9 +288,6 @@ WRITE8_MEMBER(pc9801_86_device::pcm_w)
|
|||||||
m_count++;
|
m_count++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 5:
|
|
||||||
m_pcm_mute = data;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // odd
|
else // odd
|
||||||
@ -317,6 +313,7 @@ void pc9801_86_device::device_timer(emu_timer& timer, device_timer_id id, int pa
|
|||||||
{
|
{
|
||||||
int16_t lsample, rsample;
|
int16_t lsample, rsample;
|
||||||
|
|
||||||
|
m_pcm_clk = !m_pcm_clk;
|
||||||
if((m_pcm_ctrl & 0x40) || !(m_pcm_ctrl & 0x80) || !queue_count())
|
if((m_pcm_ctrl & 0x40) || !(m_pcm_ctrl & 0x80) || !queue_count())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ private:
|
|||||||
|
|
||||||
uint8_t m_joy_sel, m_mask, m_pcm_mode, m_vol[7], m_pcm_ctrl, m_pcm_mute;
|
uint8_t m_joy_sel, m_mask, m_pcm_mode, m_vol[7], m_pcm_ctrl, m_pcm_mute;
|
||||||
uint16_t m_head, m_tail, m_count, m_irq_rate;
|
uint16_t m_head, m_tail, m_count, m_irq_rate;
|
||||||
bool m_pcmirq, m_fmirq;
|
bool m_pcmirq, m_fmirq, m_pcm_clk;
|
||||||
required_device<ym2608_device> m_opna;
|
required_device<ym2608_device> m_opna;
|
||||||
required_device<dac_word_interface> m_ldac;
|
required_device<dac_word_interface> m_ldac;
|
||||||
required_device<dac_word_interface> m_rdac;
|
required_device<dac_word_interface> m_rdac;
|
||||||
|
@ -1438,6 +1438,7 @@ void pc9801_state::pc9821_map(address_map &map)
|
|||||||
map(0x000e8000, 0x000fffff).m(m_ipl, FUNC(address_map_bank_device::amap16));
|
map(0x000e8000, 0x000fffff).m(m_ipl, FUNC(address_map_bank_device::amap16));
|
||||||
map(0x00f00000, 0x00f9ffff).ram().share("ext_gvram");
|
map(0x00f00000, 0x00f9ffff).ram().share("ext_gvram");
|
||||||
map(0xffee8000, 0xffefffff).m(m_ipl, FUNC(address_map_bank_device::amap16));
|
map(0xffee8000, 0xffefffff).m(m_ipl, FUNC(address_map_bank_device::amap16));
|
||||||
|
map(0xfff00000, 0xfff9ffff).ram().share("ext_gvram");
|
||||||
map(0xfffe8000, 0xffffffff).m(m_ipl, FUNC(address_map_bank_device::amap16));
|
map(0xfffe8000, 0xffffffff).m(m_ipl, FUNC(address_map_bank_device::amap16));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,7 +167,7 @@ UPD7220_DRAW_TEXT_LINE_MEMBER( pc9801_state::hgdc_draw_text )
|
|||||||
int res_x,res_y;
|
int res_x,res_y;
|
||||||
|
|
||||||
res_x = ((x+kanji_lr)*8+xi) * (m_video_ff[WIDTH40_REG]+1);
|
res_x = ((x+kanji_lr)*8+xi) * (m_video_ff[WIDTH40_REG]+1);
|
||||||
res_y = y+yi - (m_txt_scroll_reg[3] & 0xf);
|
res_y = y+yi - (m_txt_scroll_reg[3] % 20);
|
||||||
|
|
||||||
if(!m_screen->visible_area().contains(res_x, res_y))
|
if(!m_screen->visible_area().contains(res_x, res_y))
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user