summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/machine/irobot.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/machine/irobot.cpp')
-rw-r--r--src/mame/machine/irobot.cpp34
1 files changed, 21 insertions, 13 deletions
diff --git a/src/mame/machine/irobot.cpp b/src/mame/machine/irobot.cpp
index 3bfb2152b4b..cf0881456b2 100644
--- a/src/mame/machine/irobot.cpp
+++ b/src/mame/machine/irobot.cpp
@@ -67,15 +67,15 @@ WRITE8_MEMBER(irobot_state::irobot_statwr_w)
logerror("write %2x ", data);
IR_CPU_STATE();
- m_combase = m_comRAM[data >> 7];
- m_combase_mb = m_comRAM[(data >> 7) ^ 1];
- m_bufsel = data & 0x02;
- if (((data & 0x01) == 0x01) && (m_vg_clear == 0))
+ m_combase = m_comRAM[BIT(data, 7)];
+ m_combase_mb = m_comRAM[BIT(data, 7) ^ 1];
+ m_bufsel = BIT(data, 1);
+ if (BIT(data, 0) && (m_vg_clear == 0))
irobot_poly_clear();
- m_vg_clear = data & 0x01;
+ m_vg_clear = BIT(data, 0);
- if ((data & 0x04) && !(m_statwr & 0x04))
+ if (BIT(data, 2) && !BIT(m_statwr, 2))
{
irobot_run_video();
#if IR_TIMING
@@ -88,8 +88,11 @@ WRITE8_MEMBER(irobot_state::irobot_statwr_w)
#endif
m_irvg_running=1;
}
- if ((data & 0x10) && !(m_statwr & 0x10))
+ if (BIT(data, 4) && !BIT(m_statwr, 4))
irmb_run();
+
+ m_novram->recall(!BIT(data, 6));
+
m_statwr = data;
}
@@ -160,6 +163,13 @@ TIMER_CALLBACK_MEMBER(irobot_state::scanline_callback)
machine().scheduler().timer_set(m_screen->time_until_pos(scanline), timer_expired_delegate(FUNC(irobot_state::scanline_callback),this), scanline);
}
+void irobot_state::machine_start()
+{
+ m_leds.resolve();
+ m_vg_clear = 0;
+ m_statwr = 0;
+}
+
void irobot_state::machine_reset()
{
uint8_t *MB = memregion("mathbox")->base();
@@ -172,17 +182,15 @@ void irobot_state::machine_reset()
m_irvg_vblank=0;
m_irvg_running = 0;
- m_irvg_timer = machine().device<timer_device>("irvg_timer");
m_irmb_running = 0;
- m_irmb_timer = machine().device<timer_device>("irmb_timer");
/* set an initial timer to go off on scanline 0 */
machine().scheduler().timer_set(m_screen->time_until_pos(0), timer_expired_delegate(FUNC(irobot_state::scanline_callback),this));
- irobot_rom_banksel_w(m_maincpu->space(AS_PROGRAM),0,0);
- irobot_out0_w(m_maincpu->space(AS_PROGRAM),0,0);
- m_combase = m_comRAM[0];
- m_combase_mb = m_comRAM[1];
+ address_space &space = machine().dummy_space();
+ irobot_rom_banksel_w(space, 0, 0);
+ irobot_out0_w(space, 0, 0);
+ irobot_statwr_w(space, 0, 0);
m_outx = 0;
}