summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author cracyc <cracyc@users.noreply.github.com>2018-04-22 20:13:37 -0500
committer cracyc <cracyc@users.noreply.github.com>2018-04-22 20:13:37 -0500
commit80d8edfcdd58771f2ba9c0f17868279982632c44 (patch)
treea650e749616b224c369e7e2ed982094e1295e8e2
parentaec47ff63953aada61a83ccbc7330f73bdd23e06 (diff)
pc9801: fix scrolling and avsdrv; add high exvram window (nw)
-rw-r--r--src/devices/bus/cbus/pc9801_86.cpp17
-rw-r--r--src/devices/bus/cbus/pc9801_86.h2
-rw-r--r--src/mame/drivers/pc9801.cpp1
-rw-r--r--src/mame/video/pc9801.cpp2
4 files changed, 10 insertions, 12 deletions
diff --git a/src/devices/bus/cbus/pc9801_86.cpp b/src/devices/bus/cbus/pc9801_86.cpp
index 094a50be752..111622b5a1c 100644
--- a/src/devices/bus/cbus/pc9801_86.cpp
+++ b/src/devices/bus/cbus/pc9801_86.cpp
@@ -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(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(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_head = m_tail = m_count = 0;
m_fmirq = m_pcmirq = false;
m_irq_rate = 0;
m_pcm_ctrl = m_pcm_mode = 0;
+ m_pcm_mute = 0;
+ m_pcm_clk = false;
memset(&m_queue[0], 0, QUEUE_SIZE);
}
@@ -234,15 +238,13 @@ READ8_MEMBER(pc9801_86_device::pcm_r)
{
case 1:
return ((queue_count() == QUEUE_SIZE) ? 0x80 : 0) |
- (!queue_count() ? 0x40 : 0);
+ (!queue_count() ? 0x40 : 0) | (m_pcm_clk ? 1 : 0);
case 2:
return m_pcm_ctrl | (m_pcmirq ? 0x10 : 0);
case 3:
return m_pcm_mode;
case 4:
return 0;
- case 5:
- return m_pcm_mute;
}
}
else // odd
@@ -263,10 +265,7 @@ WRITE8_MEMBER(pc9801_86_device::pcm_w)
break;
case 2:
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));
- else
- m_dac_timer->adjust(attotime::never);
+ m_dac_timer->adjust(attotime::from_ticks(divs[data & 7], rate), 0, attotime::from_ticks(divs[data & 7], rate));
if(data & 8)
m_head = m_tail = m_count = 0;
if(!(data & 0x10))
@@ -289,9 +288,6 @@ WRITE8_MEMBER(pc9801_86_device::pcm_w)
m_count++;
}
break;
- case 5:
- m_pcm_mute = data;
- break;
}
}
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;
+ m_pcm_clk = !m_pcm_clk;
if((m_pcm_ctrl & 0x40) || !(m_pcm_ctrl & 0x80) || !queue_count())
return;
diff --git a/src/devices/bus/cbus/pc9801_86.h b/src/devices/bus/cbus/pc9801_86.h
index 97f09328e2f..0b6ddff335a 100644
--- a/src/devices/bus/cbus/pc9801_86.h
+++ b/src/devices/bus/cbus/pc9801_86.h
@@ -55,7 +55,7 @@ private:
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;
- bool m_pcmirq, m_fmirq;
+ bool m_pcmirq, m_fmirq, m_pcm_clk;
required_device<ym2608_device> m_opna;
required_device<dac_word_interface> m_ldac;
required_device<dac_word_interface> m_rdac;
diff --git a/src/mame/drivers/pc9801.cpp b/src/mame/drivers/pc9801.cpp
index 06e7533d940..c285ffdddef 100644
--- a/src/mame/drivers/pc9801.cpp
+++ b/src/mame/drivers/pc9801.cpp
@@ -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(0x00f00000, 0x00f9ffff).ram().share("ext_gvram");
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));
}
diff --git a/src/mame/video/pc9801.cpp b/src/mame/video/pc9801.cpp
index b8b1fba704a..f3f0532cd3e 100644
--- a/src/mame/video/pc9801.cpp
+++ b/src/mame/video/pc9801.cpp
@@ -167,7 +167,7 @@ UPD7220_DRAW_TEXT_LINE_MEMBER( pc9801_state::hgdc_draw_text )
int res_x,res_y;
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))
continue;