summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author David Shah <davey1576@gmail.com>2018-01-14 17:13:39 +0000
committer David Shah <davey1576@gmail.com>2018-01-14 17:13:39 +0000
commit069364b70e5f2fd410113e08984605fef6b70ae8 (patch)
tree7066a6e64bbd25c105a8e52b7bbc341c1d927ea6
parentb783dfc797e142c99548fbce96e90fad8b5454eb (diff)
Reset behaviour tweaks
-rw-r--r--src/devices/video/ppu2c0x_vt.cpp10
-rw-r--r--src/mame/drivers/nes_vt.cpp8
2 files changed, 12 insertions, 6 deletions
diff --git a/src/devices/video/ppu2c0x_vt.cpp b/src/devices/video/ppu2c0x_vt.cpp
index 25ff75be59e..a9f02890832 100644
--- a/src/devices/video/ppu2c0x_vt.cpp
+++ b/src/devices/video/ppu2c0x_vt.cpp
@@ -40,10 +40,8 @@ READ8_MEMBER(ppu_vt03_device::palette_read)
void ppu_vt03_device::set_new_pen(int i)
{
- if(m_pal_mode == PAL_MODE_NEW_RGB) {
-
+ if(m_pal_mode == PAL_MODE_NEW_RGB) {
uint16_t rgbval = (m_newpal[i&0x7f] & 0xff) | ((m_newpal[(i&0x7f)+0x80] & 0xff)<<8);
- logerror ("pal %d rgb %04x\n",i,rgbval);
uint8_t blue = (rgbval & 0x001f) << 3;
uint8_t green = (rgbval & 0x3e0) >> 2;
uint8_t red = (rgbval & 0x7C00) >> 7;
@@ -110,12 +108,16 @@ void ppu_vt03_device::device_reset()
m_read_bg.resolve_safe(0);
m_read_sp.resolve_safe(0);
-
+ for (int i = 0;i < 0xff;i++)
+ m_newpal[i] = 0x0;
+ set_2010_reg(0x00);
+ set_2010_reg(0x80);
set_2010_reg(0x00);
// todo: what are the actual defaults for these?
for (int i = 0;i < 0x20;i++)
set_201x_reg(i, 0x00);
+
m_read_bg4_bg3 = 0;
m_va34 = 0;
diff --git a/src/mame/drivers/nes_vt.cpp b/src/mame/drivers/nes_vt.cpp
index 91e01c2865a..481d34badfd 100644
--- a/src/mame/drivers/nes_vt.cpp
+++ b/src/mame/drivers/nes_vt.cpp
@@ -326,10 +326,11 @@ void nes_vt_state::scanline_irq(int scanline, int vblank, int blanked)
{
m_timer_val--;
- if (m_timer_val < 0)
+ if (m_timer_val < 1)
{
if (m_timer_irq_enabled)
{
+ logerror("scanline_irq %d\n", scanline);
irqstate = 1;
}
}
@@ -399,7 +400,8 @@ void nes_vt_state::machine_reset()
m_timer_irq_enabled = 0;
m_timer_running = 0;
m_timer_val = 0;
-
+ m_vdma_ctrl = 0;
+
update_banks();
}
@@ -764,12 +766,14 @@ WRITE8_MEMBER(nes_vt_state::vt_hh_sprite_dma_w)
logerror("vthh dma start ctrl=%02x addr=%04x\n", m_vdma_ctrl, src_addr);
for (int i = 0; i < length; i++)
{
+
uint8_t spriteData = space.read_byte(src_addr + i);
if(dma_mode) {
space.write_byte(0x2007, spriteData);
} else {
space.write_byte(0x2004, spriteData);
}
+ if(((src_addr + i) & 0xFF) == length) break;
}
// should last (length * 4 - 1) CPU cycles.