diff --git a/src/emu/video/pc_vga.c b/src/emu/video/pc_vga.c index b11b41adbba..a64851206fe 100644 --- a/src/emu/video/pc_vga.c +++ b/src/emu/video/pc_vga.c @@ -54,7 +54,7 @@ static struct { - read8_space_func read_dipswitch; + read8_delegate read_dipswitch; struct pc_svga_interface svga_intf; UINT8 *memory; @@ -1614,19 +1614,19 @@ READ8_HANDLER( vga_port_03c0_r ) switch ((vga.miscellaneous_output>>2)&3) { case 3: - if (vga.read_dipswitch && vga.read_dipswitch(space, 0, mem_mask) & 0x01) + if (!vga.read_dipswitch.isnull() && vga.read_dipswitch(space, 0, mem_mask) & 0x01) data |= 0x10; break; case 2: - if (vga.read_dipswitch && vga.read_dipswitch(space, 0, mem_mask) & 0x02) + if (!vga.read_dipswitch.isnull() && vga.read_dipswitch(space, 0, mem_mask) & 0x02) data |= 0x10; break; case 1: - if (vga.read_dipswitch && vga.read_dipswitch(space, 0, mem_mask) & 0x04) + if (!vga.read_dipswitch.isnull() && vga.read_dipswitch(space, 0, mem_mask) & 0x04) data |= 0x10; break; case 0: - if (vga.read_dipswitch && vga.read_dipswitch(space, 0, mem_mask) & 0x08) + if (!vga.read_dipswitch.isnull() && vga.read_dipswitch(space, 0, mem_mask) & 0x08) data |= 0x10; break; } @@ -2017,7 +2017,7 @@ WRITE8_HANDLER(vga_mem_w) } } -void pc_vga_init(running_machine &machine, read8_space_func read_dipswitch, const struct pc_svga_interface *svga_intf) +void pc_vga_init(running_machine &machine, read8_delegate read_dipswitch, const struct pc_svga_interface *svga_intf) { memset(&vga, 0, sizeof(vga)); diff --git a/src/emu/video/pc_vga.h b/src/emu/video/pc_vga.h index a7c30d99727..ec3ad714f78 100644 --- a/src/emu/video/pc_vga.h +++ b/src/emu/video/pc_vga.h @@ -25,7 +25,7 @@ struct pc_svga_interface void (*choosevideomode)(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect, const UINT8 *sequencer, const UINT8 *crtc, int *width, int *height); }; -void pc_vga_init(running_machine &machine, read8_space_func read_dipswitch, const struct pc_svga_interface *svga_intf); +void pc_vga_init(running_machine &machine, read8_delegate read_dipswitch, const struct pc_svga_interface *svga_intf); void pc_vga_io_init(running_machine &machine, address_space &mem_space, offs_t mem_offset, address_space &io_space, offs_t port_offset); void pc_vga_gamtor_io_init(running_machine &machine, address_space &mem_space, offs_t mem_offset, address_space &io_space, offs_t port_offset); void pc_svga_trident_io_init(running_machine &machine, address_space &mem_space, offs_t mem_offset, address_space &io_space, offs_t port_offset); diff --git a/src/mame/drivers/calchase.c b/src/mame/drivers/calchase.c index c946f720c21..5be071b6882 100644 --- a/src/mame/drivers/calchase.c +++ b/src/mame/drivers/calchase.c @@ -175,6 +175,7 @@ public: DECLARE_DRIVER_INIT(calchase); virtual void machine_start(); virtual void machine_reset(); + DECLARE_READ8_MEMBER(vga_setting); }; @@ -804,7 +805,7 @@ static IRQ_CALLBACK(irq_callback) return pic8259_acknowledge( state->m_pic8259_1); } -static READ8_HANDLER( vga_setting ) { return 0xff; } // hard-code to color +READ8_MEMBER( calchase_state::vga_setting ) { return 0xff; } // hard-code to color void calchase_state::machine_start() { @@ -976,7 +977,7 @@ DRIVER_INIT_MEMBER(calchase_state,calchase) { m_bios_ram = auto_alloc_array(machine(), UINT32, 0x20000/4); - pc_vga_init(machine(), vga_setting, NULL); + pc_vga_init(machine(), read8_delegate(FUNC(calchase_state::vga_setting),this), NULL); pc_svga_trident_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000); init_pc_common(machine(), PCCOMMON_KEYBOARD_AT, calchase_set_keyb_int); diff --git a/src/mame/drivers/gamtor.c b/src/mame/drivers/gamtor.c index c51cff31a41..565907c30af 100644 --- a/src/mame/drivers/gamtor.c +++ b/src/mame/drivers/gamtor.c @@ -35,6 +35,7 @@ public: : driver_device(mconfig, type, tag){ } DECLARE_WRITE32_MEMBER(gamtor_unk_w); DECLARE_DRIVER_INIT(gaminator); + DECLARE_READ8_MEMBER(vga_setting); }; WRITE32_MEMBER(gaminator_state::gamtor_unk_w) @@ -1248,12 +1249,12 @@ ROM_START( llcharma ) ROM_LOAD( "llc_92_5.6-0", 0x0000, 0x2000000, CRC(c8c2a5d3) SHA1(ec23eff63871cc515ec58a894446d4d639d864e4) ) ROM_END -static READ8_HANDLER( vga_setting ) { return 0xff; } // hard-code to color +READ8_MEMBER(gaminator_state::vga_setting ) { return 0xff; } // hard-code to color DRIVER_INIT_MEMBER(gaminator_state,gaminator) { - pc_vga_init(machine(), vga_setting, NULL); + pc_vga_init(machine(), read8_delegate(FUNC(gaminator_state::vga_setting),this), NULL); pc_vga_gamtor_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0x44000000, machine().device("maincpu")->memory().space(AS_PROGRAM), 0x40000000); } diff --git a/src/mame/drivers/magtouch.c b/src/mame/drivers/magtouch.c index cab9e4c5e6b..4cc659d6149 100644 --- a/src/mame/drivers/magtouch.c +++ b/src/mame/drivers/magtouch.c @@ -100,6 +100,7 @@ public: DECLARE_WRITE_LINE_MEMBER(at_com_interrupt_1); DECLARE_DRIVER_INIT(magtouch); virtual void machine_start(); + DECLARE_READ8_MEMBER(vga_setting); }; @@ -196,7 +197,7 @@ static void magtouch_set_keyb_int(running_machine &machine, int state) pic8259_ir1_w(machine.device("pic8259_1"), state); } -static READ8_HANDLER( vga_setting ) { return 0xff; } // hard-code to color +READ8_MEMBER( magtouch_state::vga_setting ) { return 0xff; } // hard-code to color void magtouch_state::machine_start() { @@ -248,7 +249,7 @@ ROM_END DRIVER_INIT_MEMBER(magtouch_state,magtouch) { - pc_vga_init(machine(), vga_setting, NULL); + pc_vga_init(machine(), read8_delegate(FUNC(magtouch_state::vga_setting),this), NULL); pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000); } diff --git a/src/mame/drivers/midqslvr.c b/src/mame/drivers/midqslvr.c index d97dc908680..0e4a0c6c66f 100644 --- a/src/mame/drivers/midqslvr.c +++ b/src/mame/drivers/midqslvr.c @@ -98,6 +98,7 @@ public: DECLARE_WRITE_LINE_MEMBER(midqslvr_pic8259_1_set_int_line); virtual void machine_start(); virtual void machine_reset(); + DECLARE_READ8_MEMBER(vga_setting); }; @@ -652,7 +653,7 @@ static void ide_interrupt(device_t *device, int state) pic8259_ir6_w(drvstate->m_pic8259_2, state); } -static READ8_HANDLER( vga_setting ) { return 0xff; } // hard-code to color +READ8_MEMBER( midqslvr_state::vga_setting ) { return 0xff; } // hard-code to color void midqslvr_state::machine_start() { @@ -671,7 +672,7 @@ void midqslvr_state::machine_start() intel82439tx_init(machine()); kbdc8042_init(machine(), &at8042); - pc_vga_init(machine(), vga_setting, NULL); + pc_vga_init(machine(), read8_delegate(FUNC(midqslvr_state::vga_setting),this), NULL); pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000); } diff --git a/src/mame/drivers/pangofun.c b/src/mame/drivers/pangofun.c index 9ffe986dc93..1c5f701cb0a 100644 --- a/src/mame/drivers/pangofun.c +++ b/src/mame/drivers/pangofun.c @@ -107,6 +107,7 @@ public: DECLARE_DRIVER_INIT(pangofun); virtual void machine_start(); + DECLARE_READ8_MEMBER(vga_setting); }; @@ -164,7 +165,7 @@ static void pangofun_set_keyb_int(running_machine &machine, int state) pic8259_ir1_w(machine.device("pic8259_1"), state); } -static READ8_HANDLER( vga_setting ) { return 0xff; } // hard-code to color +READ8_MEMBER(pangofun_state::vga_setting ) { return 0xff; } // hard-code to color static void set_gate_a20(running_machine &machine, int a20) { @@ -243,7 +244,7 @@ ROM_END DRIVER_INIT_MEMBER(pangofun_state,pangofun) { - pc_vga_init(machine(), vga_setting, NULL); + pc_vga_init(machine(), read8_delegate(FUNC(pangofun_state::vga_setting),this), NULL); pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000); } diff --git a/src/mame/drivers/pcat_dyn.c b/src/mame/drivers/pcat_dyn.c index d49afd76d74..75e28f2318a 100644 --- a/src/mame/drivers/pcat_dyn.c +++ b/src/mame/drivers/pcat_dyn.c @@ -45,6 +45,7 @@ public: DECLARE_DRIVER_INIT(pcat_dyn); virtual void machine_start(); + DECLARE_READ8_MEMBER(vga_setting); }; @@ -109,7 +110,7 @@ static void pcat_dyn_set_keyb_int(running_machine &machine, int state) pic8259_ir1_w(machine.device("pic8259_1"), state); } -static READ8_HANDLER( vga_setting ) { return 0xff; } // hard-code to color +READ8_MEMBER(pcat_dyn_state::vga_setting ) { return 0xff; } // hard-code to color static void set_gate_a20(running_machine &machine, int a20) { @@ -196,7 +197,7 @@ ROM_END DRIVER_INIT_MEMBER(pcat_dyn_state,pcat_dyn) { - pc_vga_init(machine(), vga_setting, NULL); + pc_vga_init(machine(), read8_delegate(FUNC(pcat_dyn_state::vga_setting),this), NULL); pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000); } diff --git a/src/mame/drivers/pcat_nit.c b/src/mame/drivers/pcat_nit.c index b7d86696d7e..aa608a40f57 100644 --- a/src/mame/drivers/pcat_nit.c +++ b/src/mame/drivers/pcat_nit.c @@ -112,6 +112,7 @@ public: DECLARE_WRITE_LINE_MEMBER(at_com_interrupt_1); DECLARE_DRIVER_INIT(pcat_nit); virtual void machine_start(); + DECLARE_READ8_MEMBER(vga_setting); }; WRITE_LINE_MEMBER(pcat_nit_state::microtouch_out) @@ -227,7 +228,7 @@ static void streetg2_set_keyb_int(running_machine &machine, int state) pic8259_ir1_w(machine.device("pic8259_1"), state); } -static READ8_HANDLER( vga_setting ) { return 0xff; } // hard-code to color +READ8_MEMBER(pcat_nit_state::vga_setting ) { return 0xff; } // hard-code to color void pcat_nit_state::machine_start() { @@ -426,7 +427,7 @@ DRIVER_INIT_MEMBER(pcat_nit_state,pcat_nit) m_banked_nvram = auto_alloc_array(machine(), UINT8, 0x2000); machine().device("nvram")->set_base(m_banked_nvram, 0x2000); - pc_vga_init(machine(), vga_setting, NULL); + pc_vga_init(machine(), read8_delegate(FUNC(pcat_nit_state::vga_setting),this), NULL); pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000); } diff --git a/src/mame/drivers/photoply.c b/src/mame/drivers/photoply.c index adf61d86cbb..7f4f7785092 100644 --- a/src/mame/drivers/photoply.c +++ b/src/mame/drivers/photoply.c @@ -53,6 +53,7 @@ public: DECLARE_WRITE_LINE_MEMBER(at_pit8254_out2_changed); DECLARE_DRIVER_INIT(photoply); virtual void machine_start(); + DECLARE_READ8_MEMBER(vga_setting); }; @@ -335,7 +336,7 @@ static GFXDECODE_START( photoply ) //there's also a 8x16 entry (just after the 8x8) GFXDECODE_END -static READ8_HANDLER( vga_setting ) { return 0xff; } // hard-code to color +READ8_MEMBER(photoply_state::vga_setting ) { return 0xff; } // hard-code to color static MACHINE_CONFIG_START( photoply, photoply_state ) /* basic machine hardware */ @@ -377,7 +378,7 @@ ROM_END DRIVER_INIT_MEMBER(photoply_state,photoply) { - pc_vga_init(machine(), vga_setting, NULL); + pc_vga_init(machine(), read8_delegate(FUNC(photoply_state::vga_setting),this), NULL); pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000); } diff --git a/src/mame/drivers/pntnpuzl.c b/src/mame/drivers/pntnpuzl.c index a7c7e136b19..2f7624fd723 100644 --- a/src/mame/drivers/pntnpuzl.c +++ b/src/mame/drivers/pntnpuzl.c @@ -153,6 +153,7 @@ public: DECLARE_READ16_MEMBER(pntnpuzl_eeprom_r); DECLARE_WRITE16_MEMBER(pntnpuzl_eeprom_w); DECLARE_DRIVER_INIT(pip); + DECLARE_READ8_MEMBER(vga_setting); }; @@ -356,7 +357,7 @@ static INPUT_PORTS_START( pntnpuzl ) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_D) INPUT_PORTS_END -static READ8_HANDLER( vga_setting ) { return 0xff; } // hard-code to color +READ8_MEMBER(pntnpuzl_state::vga_setting ) { return 0xff; } // hard-code to color static MACHINE_CONFIG_START( pntnpuzl, pntnpuzl_state ) MCFG_CPU_ADD("maincpu", M68000, 12000000)//?? @@ -384,7 +385,7 @@ DRIVER_INIT_MEMBER(pntnpuzl_state,pip) // UINT16 *rom = (UINT16 *)machine().root_device().memregion("maincpu")->base(); // rom[0x2696/2] = 0x4e71; // rom[0x26a0/2] = 0x4e71; - pc_vga_init(machine(), vga_setting, NULL); + pc_vga_init(machine(), read8_delegate(FUNC(pntnpuzl_state::vga_setting),this), NULL); pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0x3a0000, machine().device("maincpu")->memory().space(AS_PROGRAM), 0x3c0000); } diff --git a/src/mame/drivers/queen.c b/src/mame/drivers/queen.c index 48f5e8e5a97..195a9a71f2c 100644 --- a/src/mame/drivers/queen.c +++ b/src/mame/drivers/queen.c @@ -636,7 +636,7 @@ static void ide_interrupt(device_t *device, int state) pic8259_ir6_w(drvstate->m_pic8259_2, state); } -static READ8_HANDLER( vga_setting ) { return 0xff; } // hard-code to color +READ8_MEMBER(queen_state::vga_setting ) { return 0xff; } // hard-code to color void queen_state::machine_start() { @@ -655,7 +655,7 @@ void queen_state::machine_start() intel82439tx_init(machine()); kbdc8042_init(machine(), &at8042); - pc_vga_init(machine(), ::vga_setting, NULL); + pc_vga_init(machine(), read8_delegate(FUNC(queen_state::vga_setting),this), NULL); pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000); } diff --git a/src/mame/drivers/savquest.c b/src/mame/drivers/savquest.c index 4627cf1ab6d..9dd6767b9f6 100644 --- a/src/mame/drivers/savquest.c +++ b/src/mame/drivers/savquest.c @@ -94,6 +94,7 @@ public: DECLARE_WRITE_LINE_MEMBER(savquest_pic8259_1_set_int_line); virtual void machine_start(); virtual void machine_reset(); + DECLARE_READ8_MEMBER(vga_setting); }; // Intel 82439TX System Controller (MXTC) @@ -516,7 +517,7 @@ static void ide_interrupt(device_t *device, int state) pic8259_ir6_w(drvstate->m_pic8259_2, state); } -static READ8_HANDLER( vga_setting ) { return 0xff; } // hard-code to color +READ8_MEMBER(savquest_state::vga_setting ) { return 0xff; } // hard-code to color void savquest_state::machine_start() { @@ -528,7 +529,7 @@ void savquest_state::machine_start() intel82439tx_init(machine()); kbdc8042_init(machine(), &at8042); - pc_vga_init(machine(), vga_setting, NULL); + pc_vga_init(machine(), read8_delegate(FUNC(savquest_state::vga_setting),this), NULL); pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000); } diff --git a/src/mame/drivers/su2000.c b/src/mame/drivers/su2000.c index e124ab1504c..ba12ea043e7 100644 --- a/src/mame/drivers/su2000.c +++ b/src/mame/drivers/su2000.c @@ -81,6 +81,7 @@ public: DECLARE_READ8_MEMBER(get_slave_ack); virtual void machine_start(); virtual void machine_reset(); + DECLARE_READ8_MEMBER(vga_setting); }; @@ -169,7 +170,7 @@ static void ide_interrupt(device_t *device, int state) * *************************************************************/ -static READ8_HANDLER( vga_setting ) +READ8_MEMBER(su2000_state::vga_setting ) { /* TODO */ return 0xff; @@ -286,7 +287,7 @@ void su2000_state::machine_start() kbdc8042_init(machine(), &at8042); - pc_vga_init(machine(), vga_setting, NULL); + pc_vga_init(machine(), read8_delegate(FUNC(su2000_state::vga_setting),this), NULL); pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000); } diff --git a/src/mame/drivers/taitowlf.c b/src/mame/drivers/taitowlf.c index 2e5914a9a61..ec7d0031c6e 100644 --- a/src/mame/drivers/taitowlf.c +++ b/src/mame/drivers/taitowlf.c @@ -83,6 +83,7 @@ public: virtual void machine_reset(); virtual void palette_init(); UINT32 screen_update_taitowlf(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + DECLARE_READ8_MEMBER(vga_setting); }; #if !ENABLE_VGA @@ -696,7 +697,7 @@ static void taitowlf_set_keyb_int(running_machine &machine, int state) } #if ENABLE_VGA -static READ8_HANDLER( vga_setting ) { return 0xff; } // hard-code to color +READ8_MEMBER(taitowlf_state::vga_setting ) { return 0xff; } // hard-code to color #endif DRIVER_INIT_MEMBER(taitowlf_state,taitowlf) @@ -709,7 +710,7 @@ DRIVER_INIT_MEMBER(taitowlf_state,taitowlf) kbdc8042_init(machine(), &at8042); #if ENABLE_VGA - pc_vga_init(machine(), vga_setting, NULL); + pc_vga_init(machine(), read8_delegate(FUNC(taitowlf_state::vga_setting),this), NULL); pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000); #endif } diff --git a/src/mame/drivers/voyager.c b/src/mame/drivers/voyager.c index bee83776fc1..2e9c7922b49 100644 --- a/src/mame/drivers/voyager.c +++ b/src/mame/drivers/voyager.c @@ -69,6 +69,7 @@ public: DECLARE_DRIVER_INIT(voyager); virtual void machine_start(); virtual void machine_reset(); + DECLARE_READ8_MEMBER(vga_setting); }; @@ -650,7 +651,7 @@ static IRQ_CALLBACK(irq_callback) return pic8259_acknowledge( state->m_pic8259_1); } -static READ8_HANDLER( vga_setting ) { return 0xff; } // hard-code to color +READ8_MEMBER(voyager_state::vga_setting ) { return 0xff; } // hard-code to color void voyager_state::machine_start() { @@ -800,7 +801,7 @@ DRIVER_INIT_MEMBER(voyager_state,voyager) { m_bios_ram = auto_alloc_array(machine(), UINT32, 0x20000/4); - pc_vga_init(machine(), vga_setting, NULL); + pc_vga_init(machine(), read8_delegate(FUNC(voyager_state::vga_setting),this), NULL); pc_svga_trident_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000); init_pc_common(machine(), PCCOMMON_KEYBOARD_AT, voyager_set_keyb_int); diff --git a/src/mame/drivers/xtom3d.c b/src/mame/drivers/xtom3d.c index 81e8a8cec30..1ca1da5a166 100644 --- a/src/mame/drivers/xtom3d.c +++ b/src/mame/drivers/xtom3d.c @@ -115,6 +115,7 @@ public: DECLARE_WRITE_LINE_MEMBER(xtom3d_pic8259_1_set_int_line); virtual void machine_start(); virtual void machine_reset(); + DECLARE_READ8_MEMBER(vga_setting); }; // Intel 82439TX System Controller (MXTC) @@ -644,7 +645,7 @@ static void ide_interrupt(device_t *device, int state) pic8259_ir6_w(drvstate->m_pic8259_2, state); } -static READ8_HANDLER( vga_setting ) { return 0xff; } // hard-code to color +READ8_MEMBER(xtom3d_state::vga_setting ) { return 0xff; } // hard-code to color void xtom3d_state::machine_start() { @@ -663,7 +664,7 @@ void xtom3d_state::machine_start() intel82439tx_init(machine()); kbdc8042_init(machine(), &at8042); - pc_vga_init(machine(), vga_setting, NULL); + pc_vga_init(machine(), read8_delegate(FUNC(xtom3d_state::vga_setting),this), NULL); pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000); } diff --git a/src/mess/drivers/indiana.c b/src/mess/drivers/indiana.c index 155eb4daf18..00342c9c372 100644 --- a/src/mess/drivers/indiana.c +++ b/src/mess/drivers/indiana.c @@ -22,6 +22,7 @@ public: : driver_device(mconfig, type, tag) { } DECLARE_DRIVER_INIT(indiana); virtual void machine_reset(); + DECLARE_READ8_MEMBER(indiana_vga_setting); }; @@ -76,14 +77,14 @@ static MACHINE_CONFIG_START( indiana, indiana_state ) MCFG_FRAGMENT_ADD( pcvideo_vga ) MACHINE_CONFIG_END -READ8_HANDLER( indiana_vga_setting ) +READ8_MEMBER(indiana_state::indiana_vga_setting) { return 0xff; // TODO } DRIVER_INIT_MEMBER(indiana_state,indiana) { - pc_vga_init(machine(), indiana_vga_setting, NULL); + pc_vga_init(machine(), read8_delegate(FUNC(indiana_state::indiana_vga_setting),this), NULL); pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0x7f7a0000, machine().device("maincpu")->memory().space(AS_PROGRAM), 0x7f600000); } diff --git a/src/mess/machine/pc.c b/src/mess/machine/pc.c index 12210292c42..a8175a900dd 100644 --- a/src/mess/machine/pc.c +++ b/src/mess/machine/pc.c @@ -1405,7 +1405,7 @@ DRIVER_INIT_MEMBER(pc_state,mc1502) mess_init_pc_common(machine(), 0, NULL, pc_set_irq_line); } -static READ8_HANDLER( input_port_0_r ) { return space.machine().root_device().ioport("IN0")->read(); } +READ8_MEMBER(pc_state::input_port_0_r ) { return machine().root_device().ioport("IN0")->read(); } DRIVER_INIT_MEMBER(pc_state,pc1640) { @@ -1421,7 +1421,7 @@ DRIVER_INIT_MEMBER(pc_state,pc_vga) { mess_init_pc_common(machine(), PCCOMMON_KEYBOARD_PC, pc_set_keyb_int, pc_set_irq_line); - pc_vga_init(machine(), ::input_port_0_r, NULL); + pc_vga_init(machine(), read8_delegate(FUNC(pc_state::input_port_0_r),this), NULL); pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000); } diff --git a/src/mess/video/cirrus.c b/src/mess/video/cirrus.c index b2e43c84069..c8ddcdadce3 100644 --- a/src/mess/video/cirrus.c +++ b/src/mess/video/cirrus.c @@ -162,7 +162,7 @@ const struct pc_svga_interface cirrus_svga_interface = void cirrus_device::device_start() { - pc_vga_init(machine(), NULL, &cirrus_svga_interface); + pc_vga_init(machine(), read8_delegate(), &cirrus_svga_interface); pc_vga_io_init(machine(), machine().device("ppc1")->memory().space(AS_PROGRAM), 0xC00A0000, machine().device("ppc1")->memory().space(AS_PROGRAM), 0x80000000); } diff --git a/src/mess/video/isa_svga_cirrus.c b/src/mess/video/isa_svga_cirrus.c index da4d8bc5f4a..2d23f0519ac 100644 --- a/src/mess/video/isa_svga_cirrus.c +++ b/src/mess/video/isa_svga_cirrus.c @@ -58,7 +58,7 @@ isa8_svga_cirrus_device::isa8_svga_cirrus_device(const machine_config &mconfig, //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- -static READ8_HANDLER( input_port_0_r ) { return 0xff; } //return space.machine().root_device().ioport("IN0")->read(); } +READ8_MEMBER(isa8_svga_cirrus_device::input_port_0_r ) { return 0xff; } //return space.machine().root_device().ioport("IN0")->read(); } void isa8_svga_cirrus_device::device_start() { @@ -66,7 +66,7 @@ void isa8_svga_cirrus_device::device_start() video_start_vga( machine() ); - pc_vga_init(machine(), input_port_0_r, NULL); + pc_vga_init(machine(), read8_delegate(FUNC(isa8_svga_cirrus_device::input_port_0_r),this), NULL); int i; for (i = 0; i < 0x100; i++) diff --git a/src/mess/video/isa_svga_cirrus.h b/src/mess/video/isa_svga_cirrus.h index e57a37f7b8e..d9647e8acd4 100644 --- a/src/mess/video/isa_svga_cirrus.h +++ b/src/mess/video/isa_svga_cirrus.h @@ -23,6 +23,8 @@ public: // optional information overrides virtual machine_config_constructor device_mconfig_additions() const; virtual const rom_entry *device_rom_region() const; + + DECLARE_READ8_MEMBER(input_port_0_r); protected: // device-level overrides virtual void device_start(); diff --git a/src/mess/video/isa_svga_s3.c b/src/mess/video/isa_svga_s3.c index 5e8f0166122..f0cc281ff54 100644 --- a/src/mess/video/isa_svga_s3.c +++ b/src/mess/video/isa_svga_s3.c @@ -58,7 +58,7 @@ isa16_svga_s3_device::isa16_svga_s3_device(const machine_config &mconfig, const //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- -static READ8_HANDLER( input_port_0_r ) { return 0xff; } //return space.machine().root_device().ioport("IN0")->read(); } +READ8_MEMBER(isa16_svga_s3_device::input_port_0_r ) { return 0xff; } //return space.machine().root_device().ioport("IN0")->read(); } void isa16_svga_s3_device::device_start() { @@ -66,7 +66,7 @@ void isa16_svga_s3_device::device_start() video_start_vga( machine() ); - pc_vga_init(machine(), input_port_0_r, NULL); + pc_vga_init(machine(), read8_delegate(FUNC(isa16_svga_s3_device::input_port_0_r),this), NULL); int i; for (i = 0; i < 0x100; i++) diff --git a/src/mess/video/isa_svga_s3.h b/src/mess/video/isa_svga_s3.h index d96b2164cd6..fad0f4da213 100644 --- a/src/mess/video/isa_svga_s3.h +++ b/src/mess/video/isa_svga_s3.h @@ -23,6 +23,8 @@ public: // optional information overrides virtual machine_config_constructor device_mconfig_additions() const; virtual const rom_entry *device_rom_region() const; + + DECLARE_READ8_MEMBER(input_port_0_r); protected: // device-level overrides virtual void device_start(); diff --git a/src/mess/video/isa_svga_tseng.c b/src/mess/video/isa_svga_tseng.c index 863ac977e90..97d81c7da20 100644 --- a/src/mess/video/isa_svga_tseng.c +++ b/src/mess/video/isa_svga_tseng.c @@ -57,7 +57,7 @@ isa8_svga_et4k_device::isa8_svga_et4k_device(const machine_config &mconfig, cons //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- -static READ8_HANDLER( input_port_0_r ) { return 0xff; } //return space.machine().root_device().ioport("IN0")->read(); } +READ8_MEMBER(isa8_svga_et4k_device::input_port_0_r ) { return 0xff; } //return space.machine().root_device().ioport("IN0")->read(); } void isa8_svga_et4k_device::device_start() { @@ -65,7 +65,7 @@ void isa8_svga_et4k_device::device_start() video_start_vga( machine() ); - pc_vga_init(machine(), input_port_0_r, NULL); + pc_vga_init(machine(), read8_delegate(FUNC(isa8_svga_et4k_device::input_port_0_r),this), NULL); int i; for (i = 0; i < 0x100; i++) diff --git a/src/mess/video/isa_svga_tseng.h b/src/mess/video/isa_svga_tseng.h index 101d0c2355c..8b44dfef46d 100644 --- a/src/mess/video/isa_svga_tseng.h +++ b/src/mess/video/isa_svga_tseng.h @@ -23,6 +23,8 @@ public: // optional information overrides virtual machine_config_constructor device_mconfig_additions() const; virtual const rom_entry *device_rom_region() const; + + DECLARE_READ8_MEMBER(input_port_0_r); protected: // device-level overrides virtual void device_start(); diff --git a/src/mess/video/isa_vga.c b/src/mess/video/isa_vga.c index 765555bcec4..4881c3bb814 100644 --- a/src/mess/video/isa_vga.c +++ b/src/mess/video/isa_vga.c @@ -57,7 +57,7 @@ isa8_vga_device::isa8_vga_device(const machine_config &mconfig, const char *tag, //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- -static READ8_HANDLER( input_port_0_r ) { return 0xff; } //return space.machine().root_device().ioport("IN0")->read(); } +READ8_MEMBER( isa8_vga_device::input_port_0_r ) { return 0xff; } //return space.machine().root_device().ioport("IN0")->read(); } void isa8_vga_device::device_start() { @@ -65,7 +65,7 @@ void isa8_vga_device::device_start() video_start_vga( machine() ); - pc_vga_init(machine(), input_port_0_r, NULL); + pc_vga_init(machine(), read8_delegate(FUNC(isa8_vga_device::input_port_0_r),this), NULL); int i; for (i = 0; i < 0x100; i++) diff --git a/src/mess/video/isa_vga.h b/src/mess/video/isa_vga.h index 15dd2d3714d..b88dfe91ff6 100644 --- a/src/mess/video/isa_vga.h +++ b/src/mess/video/isa_vga.h @@ -23,6 +23,8 @@ public: // optional information overrides virtual machine_config_constructor device_mconfig_additions() const; virtual const rom_entry *device_rom_region() const; + + DECLARE_READ8_MEMBER(input_port_0_r); protected: // device-level overrides virtual void device_start(); diff --git a/src/mess/video/isa_vga_ati.c b/src/mess/video/isa_vga_ati.c index 67f5dff6de7..5de56fda744 100644 --- a/src/mess/video/isa_vga_ati.c +++ b/src/mess/video/isa_vga_ati.c @@ -61,7 +61,7 @@ isa16_vga_gfxultra_device::isa16_vga_gfxultra_device(const machine_config &mconf //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- -static READ8_HANDLER( input_port_0_r ) { return 0xff; } //return space.machine().root_device().ioport("IN0")->read(); } +READ8_MEMBER(isa16_vga_gfxultra_device::input_port_0_r ) { return 0xff; } //return space.machine().root_device().ioport("IN0")->read(); } void isa16_vga_gfxultra_device::device_start() { @@ -69,7 +69,7 @@ void isa16_vga_gfxultra_device::device_start() video_start_vga( machine() ); - pc_vga_init(machine(), input_port_0_r, NULL); + pc_vga_init(machine(), read8_delegate(FUNC(isa16_vga_gfxultra_device::input_port_0_r),this), NULL); int i; for (i = 0; i < 0x100; i++) diff --git a/src/mess/video/isa_vga_ati.h b/src/mess/video/isa_vga_ati.h index 53f13da7c07..3af2af90024 100644 --- a/src/mess/video/isa_vga_ati.h +++ b/src/mess/video/isa_vga_ati.h @@ -30,6 +30,8 @@ public: // optional information overrides virtual machine_config_constructor device_mconfig_additions() const; virtual const rom_entry *device_rom_region() const; + + DECLARE_READ8_MEMBER(input_port_0_r); protected: // device-level overrides virtual void device_start();