summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/snes_ctrl/bcbattle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/snes_ctrl/bcbattle.cpp')
-rw-r--r--src/devices/bus/snes_ctrl/bcbattle.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/devices/bus/snes_ctrl/bcbattle.cpp b/src/devices/bus/snes_ctrl/bcbattle.cpp
index 4c0b17ef6ce..ae9c6f2f8b8 100644
--- a/src/devices/bus/snes_ctrl/bcbattle.cpp
+++ b/src/devices/bus/snes_ctrl/bcbattle.cpp
@@ -82,6 +82,7 @@ snes_bcbattle_device::snes_bcbattle_device(const machine_config &mconfig, const
device_t(mconfig, SNES_BARCODE_BATTLER, tag, owner, clock),
device_snes_control_port_interface(mconfig, *this),
m_reader(*this, "battler"),
+ m_maincpu(*this, ":maincpu"),
m_pending_code(0), m_new_code(0), m_transmitting(0), m_cur_bit(0), m_cur_byte(0),
battler_timer(nullptr),
m_strobe(0), m_idx(0)
@@ -99,7 +100,7 @@ void snes_bcbattle_device::device_start()
// proper emulation would have the standalone unit acknowledging that a new barcode has been scanned
// and sending the proper serial bits, instead of our read_current_bit() function!
battler_timer = timer_alloc(TIMER_BATTLER);
- battler_timer->adjust(attotime::zero, 0, machine().device<cpu_device>("maincpu")->cycles_to_attotime(1000));
+ battler_timer->adjust(attotime::zero, 0, m_maincpu->cycles_to_attotime(1000));
save_item(NAME(m_current_barcode));
save_item(NAME(m_new_code));