summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/eolith.c
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2012-04-04 15:08:19 +0000
committer Miodrag Milanovic <mmicko@gmail.com>2012-04-04 15:08:19 +0000
commit7dabd8b524510582d7f6ee96f430395d2f60cb78 (patch)
tree9641ea5111636c5963ac77e7130ace2773ddd1a3 /src/mame/drivers/eolith.c
parent62d9c8ba4fd4be6fc3225e8a3850526db7d78357 (diff)
MAME going modern part 5 (no whatsnew)
Tomorrow and next days just bug fixing from my side, no big changes
Diffstat (limited to 'src/mame/drivers/eolith.c')
-rw-r--r--src/mame/drivers/eolith.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/mame/drivers/eolith.c b/src/mame/drivers/eolith.c
index 3e1f7fc925b..20311eb3f17 100644
--- a/src/mame/drivers/eolith.c
+++ b/src/mame/drivers/eolith.c
@@ -100,7 +100,7 @@ static const eeprom_interface eeprom_interface_93C66 =
-static READ32_HANDLER( eolith_custom_r )
+READ32_MEMBER(eolith_state::eolith_custom_r)
{
/*
bit 3 = eeprom bit
@@ -110,37 +110,36 @@ static READ32_HANDLER( eolith_custom_r )
bit 8 = ???
bit 9 = ???
*/
- eolith_speedup_read(space);
+ eolith_speedup_read(&space);
- return (input_port_read(space->machine(), "IN0") & ~0x300) | (space->machine().rand() & 0x300);
+ return (input_port_read(machine(), "IN0") & ~0x300) | (machine().rand() & 0x300);
}
-static WRITE32_HANDLER( systemcontrol_w )
+WRITE32_MEMBER(eolith_state::systemcontrol_w)
{
- eolith_state *state = space->machine().driver_data<eolith_state>();
- state->m_buffer = (data & 0x80) >> 7;
- coin_counter_w(space->machine(), 0, data & state->m_coin_counter_bit);
- set_led_status(space->machine(), 0, data & 1);
+ m_buffer = (data & 0x80) >> 7;
+ coin_counter_w(machine(), 0, data & m_coin_counter_bit);
+ set_led_status(machine(), 0, data & 1);
- input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
+ input_port_write(machine(), "EEPROMOUT", data, 0xff);
// bit 0x100 and 0x040 ?
}
-static READ32_HANDLER( hidctch3_pen1_r )
+READ32_MEMBER(eolith_state::hidctch3_pen1_r)
{
//320 x 240
- int xpos = input_port_read(space->machine(), "PEN_X_P1");
- int ypos = input_port_read(space->machine(), "PEN_Y_P1");
+ int xpos = input_port_read(machine(), "PEN_X_P1");
+ int ypos = input_port_read(machine(), "PEN_Y_P1");
return xpos + (ypos*168*2);
}
-static READ32_HANDLER( hidctch3_pen2_r )
+READ32_MEMBER(eolith_state::hidctch3_pen2_r)
{
//320 x 240
- int xpos = input_port_read(space->machine(), "PEN_X_P2");
- int ypos = input_port_read(space->machine(), "PEN_Y_P2");
+ int xpos = input_port_read(machine(), "PEN_X_P2");
+ int ypos = input_port_read(machine(), "PEN_Y_P2");
return xpos + (ypos*168*2);
}
@@ -149,8 +148,8 @@ static ADDRESS_MAP_START( eolith_map, AS_PROGRAM, 32, eolith_state )
AM_RANGE(0x00000000, 0x001fffff) AM_RAM // fort2b wants ram here
AM_RANGE(0x40000000, 0x401fffff) AM_RAM
AM_RANGE(0x90000000, 0x9003ffff) AM_READWRITE_LEGACY(eolith_vram_r, eolith_vram_w)
- AM_RANGE(0xfc000000, 0xfc000003) AM_READ_LEGACY(eolith_custom_r)
- AM_RANGE(0xfc400000, 0xfc400003) AM_WRITE_LEGACY(systemcontrol_w)
+ AM_RANGE(0xfc000000, 0xfc000003) AM_READ(eolith_custom_r)
+ AM_RANGE(0xfc400000, 0xfc400003) AM_WRITE(systemcontrol_w)
AM_RANGE(0xfc800000, 0xfc800003) AM_WRITENOP // sound latch
AM_RANGE(0xfca00000, 0xfca00003) AM_READ_PORT("DSW1")
AM_RANGE(0xfcc00000, 0xfcc0005b) AM_WRITENOP // crt registers ?
@@ -1331,11 +1330,12 @@ static DRIVER_INIT( hidctch3 )
// It is not clear why the first reads are needed too
- machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfce00000, 0xfce00003, FUNC(hidctch3_pen1_r));
- machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfce80000, 0xfce80003, FUNC(hidctch3_pen1_r));
+ eolith_state *state = machine.driver_data<eolith_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xfce00000, 0xfce00003, read32_delegate(FUNC(eolith_state::hidctch3_pen1_r),state));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xfce80000, 0xfce80003, read32_delegate(FUNC(eolith_state::hidctch3_pen1_r),state));
- machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfcf00000, 0xfcf00003, FUNC(hidctch3_pen2_r));
- machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfcf80000, 0xfcf80003, FUNC(hidctch3_pen2_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xfcf00000, 0xfcf00003, read32_delegate(FUNC(eolith_state::hidctch3_pen2_r),state));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xfcf80000, 0xfcf80003, read32_delegate(FUNC(eolith_state::hidctch3_pen2_r),state));
init_eolith_speedup(machine);
}