diff options
Diffstat (limited to 'src/mess/drivers/enterp.c')
-rw-r--r-- | src/mess/drivers/enterp.c | 46 |
1 files changed, 19 insertions, 27 deletions
diff --git a/src/mess/drivers/enterp.c b/src/mess/drivers/enterp.c index ad36f8b2ceb..eb1d0a306ec 100644 --- a/src/mess/drivers/enterp.c +++ b/src/mess/drivers/enterp.c @@ -98,27 +98,25 @@ static void enterprise_update_memory_page(address_space &space, offs_t page, int /* EP specific handling of dave register write */ -static WRITE8_DEVICE_HANDLER( enterprise_dave_reg_write ) +WRITE8_MEMBER(ep_state::enterprise_dave_reg_write) { - ep_state *ep = space.machine().driver_data<ep_state>(); - switch (offset) { case 0x10: case 0x11: case 0x12: case 0x13: - enterprise_update_memory_page(space.machine().device("maincpu")->memory().space(AS_PROGRAM), offset - 0x0f, data); + enterprise_update_memory_page(machine().device("maincpu")->memory().space(AS_PROGRAM), offset - 0x0f, data); break; case 0x15: - ep->keyboard_line = data & 15; + keyboard_line = data & 15; break; } } -static READ8_DEVICE_HANDLER( enterprise_dave_reg_read ) +READ8_MEMBER(ep_state::enterprise_dave_reg_read) { static const char *const keynames[] = { @@ -126,30 +124,28 @@ static READ8_DEVICE_HANDLER( enterprise_dave_reg_read ) "LINE5", "LINE6", "LINE7", "LINE8", "LINE9" }; - ep_state *ep = space.machine().driver_data<ep_state>(); - switch (offset) { case 0x015: /* read keyboard line */ - dave_set_reg(device, 0x015, space.machine().root_device().ioport(keynames[ep->keyboard_line])->read()); + dave_set_reg(machine().device("custom"), 0x015, machine().root_device().ioport(keynames[keyboard_line])->read()); break; case 0x016: { int ExternalJoystickInputs; - int ExternalJoystickPortInput = space.machine().root_device().ioport("JOY1")->read(); + int ExternalJoystickPortInput = machine().root_device().ioport("JOY1")->read(); - if (ep->keyboard_line <= 4) + if (keyboard_line <= 4) { - ExternalJoystickInputs = ExternalJoystickPortInput>>(4-(ep->keyboard_line)); + ExternalJoystickInputs = ExternalJoystickPortInput>>(4-(keyboard_line)); } else { ExternalJoystickInputs = 1; } - dave_set_reg(device, 0x016, (0x0fe | (ExternalJoystickInputs & 0x01))); + dave_set_reg(machine().device("custom"), 0x016, (0x0fe | (ExternalJoystickInputs & 0x01))); } break; @@ -164,8 +160,8 @@ to Enterprise. But these functions make it nice and easy to see whats going on. */ static const dave_interface enterprise_dave_interface = { - DEVCB_HANDLER(enterprise_dave_reg_read), - DEVCB_HANDLER(enterprise_dave_reg_write), + DEVCB_DRIVER_MEMBER(ep_state,enterprise_dave_reg_read), + DEVCB_DRIVER_MEMBER(ep_state,enterprise_dave_reg_write), DEVCB_CPU_INPUT_LINE("maincpu", 0) }; @@ -180,24 +176,20 @@ void ep_state::machine_reset() FLOPPY/EXDOS ***************************************************************************/ -static WRITE_LINE_DEVICE_HANDLER( enterp_wd1770_intrq_w ) +WRITE_LINE_MEMBER(ep_state::enterp_wd1770_intrq_w) { - ep_state *ep = device->machine().driver_data<ep_state>(); - if (state) - ep->exdos_card_value |= 0x02; + exdos_card_value |= 0x02; else - ep->exdos_card_value &= ~0x02; + exdos_card_value &= ~0x02; } -static WRITE_LINE_DEVICE_HANDLER( enterp_wd1770_drq_w ) +WRITE_LINE_MEMBER(ep_state::enterp_wd1770_drq_w) { - ep_state *ep = device->machine().driver_data<ep_state>(); - if (state) - ep->exdos_card_value |= 0x80; + exdos_card_value |= 0x80; else - ep->exdos_card_value &= ~0x80; + exdos_card_value &= ~0x80; } @@ -417,8 +409,8 @@ INPUT_PORTS_END static const wd17xx_interface enterp_wd1770_interface = { DEVCB_NULL, - DEVCB_LINE(enterp_wd1770_intrq_w), - DEVCB_LINE(enterp_wd1770_drq_w), + DEVCB_DRIVER_LINE_MEMBER(ep_state,enterp_wd1770_intrq_w), + DEVCB_DRIVER_LINE_MEMBER(ep_state,enterp_wd1770_drq_w), {FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3} }; |