dotrikun: eat_cycles clamps to 0, adjust_icount does do what i intended

This commit is contained in:
hap 2016-08-19 17:17:40 +02:00
parent be2ab5b645
commit 3e07660290
2 changed files with 9 additions and 12 deletions

View File

@ -47,8 +47,7 @@ public:
required_shared_ptr<UINT8> m_vram;
UINT8 m_vram_latch;
UINT8 m_fg_color;
UINT8 m_bg_color;
UINT8 m_color;
DECLARE_WRITE8_MEMBER(vram_w);
DECLARE_WRITE8_MEMBER(color_w);
@ -78,8 +77,7 @@ WRITE8_MEMBER(dotrikun_state::color_w)
// d3-d5: bg palette
// d6,d7: N/C
m_screen->update_now();
m_fg_color = data & 7;
m_bg_color = data >> 3 & 7;
m_color = data & 0x3f;
}
@ -92,11 +90,11 @@ UINT32 dotrikun_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap
if ((x & 7) == 0)
{
// on vram fetch(every 8 pixels during active display), z80 is stalled for 2 clocks
m_maincpu->eat_cycles(2);
m_maincpu->adjust_icount(-2);
m_vram_latch = m_vram[x >> 3 | y >> 1 << 4];
}
bitmap.pix16(y, x) = (m_vram_latch >> (~x & 7) & 1) ? m_fg_color : m_bg_color;
bitmap.pix16(y, x) = (m_vram_latch >> (~x & 7) & 1) ? m_color & 7 : m_color >> 3;
}
}
@ -155,14 +153,13 @@ INTERRUPT_GEN_MEMBER(dotrikun_state::interrupt)
void dotrikun_state::machine_start()
{
save_item(NAME(m_vram_latch));
save_item(NAME(m_fg_color));
save_item(NAME(m_bg_color));
save_item(NAME(m_color));
}
void dotrikun_state::machine_reset()
{
m_vram_latch = 0;
m_fg_color = m_bg_color = 0;
m_color = 0;
}
static MACHINE_CONFIG_START( dotrikun, dotrikun_state )

View File

@ -2601,7 +2601,7 @@ static INPUT_PORTS_START( sag )
PORT_START("IN.1") // D3
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_16WAY PORT_NAME("P1 Button 2")
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL PORT_16WAY PORT_NAME("P2 Button 4")
PORT_BIT( 0x04, 0x04, IPT_SPECIAL ) PORT_CONDITION("DPLAYSW", 0x03, EQUALS, 0x01) // 1 player
PORT_BIT( 0x04, 0x04, IPT_SPECIAL ) PORT_CONDITION("FAKE", 0x03, EQUALS, 0x01) // 1 player
PORT_START("IN.2") // D4
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_16WAY PORT_NAME("P1 Button 3")
@ -2613,7 +2613,7 @@ static INPUT_PORTS_START( sag )
PORT_START("IN.3") // D5
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_16WAY PORT_NAME("P1 Button 4")
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL PORT_16WAY PORT_NAME("P2 Button 2")
PORT_BIT( 0x04, 0x04, IPT_SPECIAL ) PORT_CONDITION("DPLAYSW", 0x03, EQUALS, 0x00) // demo
PORT_BIT( 0x04, 0x04, IPT_SPECIAL ) PORT_CONDITION("FAKE", 0x03, EQUALS, 0x00) // demo
PORT_START("IN.4") // D6
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P1 Button 5")
@ -2625,7 +2625,7 @@ static INPUT_PORTS_START( sag )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL PORT_NAME("P2 Button 6")
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL PORT_NAME("P2 Button 7")
PORT_START("DPLAYSW") // shared D3/D5
PORT_START("FAKE") // shared D3/D5
PORT_CONFNAME( 0x03, 0x01, "Players" )
PORT_CONFSETTING( 0x00, "Demo" )
PORT_CONFSETTING( 0x01, "1" )