diff options
Diffstat (limited to 'src/devices/cpu/lr35902/lr35902.h')
-rw-r--r-- | src/devices/cpu/lr35902/lr35902.h | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/src/devices/cpu/lr35902/lr35902.h b/src/devices/cpu/lr35902/lr35902.h index ab70377a21e..a15462080c8 100644 --- a/src/devices/cpu/lr35902/lr35902.h +++ b/src/devices/cpu/lr35902/lr35902.h @@ -5,23 +5,6 @@ #pragma once - -#define MCFG_LR35902_TIMER_CB(_devcb) \ - downcast<lr35902_cpu_device &>(*device).set_timer_cb(DEVCB_##_devcb); - -// The first release of this CPU has a bug where the programcounter -// is not incremented properly after an interrupt after the halt opcode. -// This was fixed in a newer revision. -#define MCFG_LR35902_HALT_BUG \ - downcast<lr35902_cpu_device &>(*device).set_halt_bug(true); - -// The GameBoy has a bug where OAM data gets corrupted if you inc/dec -// a 16-bit register in the $fe** region. -// note: oldval is in hiword, newval is in loword -#define MCFG_LR35902_INCDEC16_CB(_devcb) \ - downcast<lr35902_cpu_device &>(*device).set_incdec16_cb(DEVCB_##_devcb); - - enum { LR35902_PC=1, LR35902_SP, LR35902_A, LR35902_F, LR35902_B, LR35902_C, LR35902_D, LR35902_E, LR35902_H, LR35902_L, @@ -40,8 +23,16 @@ public: lr35902_cpu_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock); // configuration helpers - template<class Object> devcb_base &set_timer_cb(Object &&cb) { return m_timer_func.set_callback(std::forward<Object>(cb)); } - template<class Object> devcb_base &set_incdec16_cb(Object &&cb) { return m_incdec16_func.set_callback(std::forward<Object>(cb)); } + auto timer_cb() { return m_timer_func.bind(); } + + // The GameBoy has a bug where OAM data gets corrupted if you inc/dec + // a 16-bit register in the $fe** region. + // note: oldval is in hiword, newval is in loword + auto incdec16_cb() { return m_incdec16_func.bind(); } + + // The first release of this CPU has a bug where the programcounter + // is not incremented properly after an interrupt after the halt opcode. + // This was fixed in a newer revision. void set_halt_bug(bool has_halt_bug) { m_has_halt_bug = has_halt_bug; } uint8_t get_speed(); |