summaryrefslogtreecommitdiffstats
path: root/src/mame/drivers/fcombat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/fcombat.c')
-rw-r--r--src/mame/drivers/fcombat.c61
1 files changed, 27 insertions, 34 deletions
diff --git a/src/mame/drivers/fcombat.c b/src/mame/drivers/fcombat.c
index 77fa85727bb..68587b1db22 100644
--- a/src/mame/drivers/fcombat.c
+++ b/src/mame/drivers/fcombat.c
@@ -45,7 +45,7 @@ static INPUT_CHANGED( coin_inserted )
/* is it protection? */
-static READ8_HANDLER( fcombat_protection_r )
+READ8_MEMBER(fcombat_state::fcombat_protection_r)
{
/* Must match ONE of these values after a "and $3E" intruction :
@@ -59,59 +59,52 @@ static READ8_HANDLER( fcombat_protection_r )
/* same as exerion again */
-static READ8_HANDLER( fcombat_port01_r )
+READ8_MEMBER(fcombat_state::fcombat_port01_r)
{
- fcombat_state *state = space->machine().driver_data<fcombat_state>();
/* the cocktail flip bit muxes between ports 0 and 1 */
- return state->m_cocktail_flip ? input_port_read(space->machine(), "IN1") : input_port_read(space->machine(), "IN0");
+ return m_cocktail_flip ? input_port_read(machine(), "IN1") : input_port_read(machine(), "IN0");
}
//bg scrolls
-static WRITE8_HANDLER(e900_w)
+WRITE8_MEMBER(fcombat_state::e900_w)
{
- fcombat_state *state = space->machine().driver_data<fcombat_state>();
- state->m_fcombat_sh = data;
+ m_fcombat_sh = data;
}
-static WRITE8_HANDLER(ea00_w)
+WRITE8_MEMBER(fcombat_state::ea00_w)
{
- fcombat_state *state = space->machine().driver_data<fcombat_state>();
- state->m_fcombat_sv = (state->m_fcombat_sv & 0xff00) | data;
+ m_fcombat_sv = (m_fcombat_sv & 0xff00) | data;
}
-static WRITE8_HANDLER(eb00_w)
+WRITE8_MEMBER(fcombat_state::eb00_w)
{
- fcombat_state *state = space->machine().driver_data<fcombat_state>();
- state->m_fcombat_sv = (state->m_fcombat_sv & 0xff) | (data << 8);
+ m_fcombat_sv = (m_fcombat_sv & 0xff) | (data << 8);
}
// terrain info (ec00=x, ed00=y, return val in e300
-static WRITE8_HANDLER(ec00_w)
+WRITE8_MEMBER(fcombat_state::ec00_w)
{
- fcombat_state *state = space->machine().driver_data<fcombat_state>();
- state->m_tx = data;
+ m_tx = data;
}
-static WRITE8_HANDLER(ed00_w)
+WRITE8_MEMBER(fcombat_state::ed00_w)
{
- fcombat_state *state = space->machine().driver_data<fcombat_state>();
- state->m_ty = data;
+ m_ty = data;
}
-static READ8_HANDLER(e300_r)
+READ8_MEMBER(fcombat_state::e300_r)
{
- fcombat_state *state = space->machine().driver_data<fcombat_state>();
- int wx = (state->m_tx + state->m_fcombat_sh) / 16;
- int wy = (state->m_ty * 2 + state->m_fcombat_sv) / 16;
+ int wx = (m_tx + m_fcombat_sh) / 16;
+ int wy = (m_ty * 2 + m_fcombat_sv) / 16;
- return space->machine().region("user2")->base()[wx * 32 * 16 + wy];
+ return machine().region("user2")->base()[wx * 32 * 16 + wy];
}
-static WRITE8_HANDLER(ee00_w)
+WRITE8_MEMBER(fcombat_state::ee00_w)
{
}
@@ -121,18 +114,18 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, fcombat_state )
AM_RANGE(0xc000, 0xc7ff) AM_RAM
AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_BASE_SIZE(m_videoram, m_videoram_size)
AM_RANGE(0xd800, 0xd8ff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size)
- AM_RANGE(0xe000, 0xe000) AM_READ_LEGACY(fcombat_port01_r)
+ AM_RANGE(0xe000, 0xe000) AM_READ(fcombat_port01_r)
AM_RANGE(0xe100, 0xe100) AM_READ_PORT("DSW0")
AM_RANGE(0xe200, 0xe200) AM_READ_PORT("DSW1")
- AM_RANGE(0xe300, 0xe300) AM_READ_LEGACY(e300_r)
- AM_RANGE(0xe400, 0xe400) AM_READ_LEGACY(fcombat_protection_r) // protection?
+ AM_RANGE(0xe300, 0xe300) AM_READ(e300_r)
+ AM_RANGE(0xe400, 0xe400) AM_READ(fcombat_protection_r) // protection?
AM_RANGE(0xe800, 0xe800) AM_WRITE_LEGACY(fcombat_videoreg_w) // at least bit 0 for flip screen and joystick input multiplexor
- AM_RANGE(0xe900, 0xe900) AM_WRITE_LEGACY(e900_w)
- AM_RANGE(0xea00, 0xea00) AM_WRITE_LEGACY(ea00_w)
- AM_RANGE(0xeb00, 0xeb00) AM_WRITE_LEGACY(eb00_w)
- AM_RANGE(0xec00, 0xec00) AM_WRITE_LEGACY(ec00_w)
- AM_RANGE(0xed00, 0xed00) AM_WRITE_LEGACY(ed00_w)
- AM_RANGE(0xee00, 0xee00) AM_WRITE_LEGACY(ee00_w) // related to protection ? - doesn't seem to have any effect
+ AM_RANGE(0xe900, 0xe900) AM_WRITE(e900_w)
+ AM_RANGE(0xea00, 0xea00) AM_WRITE(ea00_w)
+ AM_RANGE(0xeb00, 0xeb00) AM_WRITE(eb00_w)
+ AM_RANGE(0xec00, 0xec00) AM_WRITE(ec00_w)
+ AM_RANGE(0xed00, 0xed00) AM_WRITE(ed00_w)
+ AM_RANGE(0xee00, 0xee00) AM_WRITE(ee00_w) // related to protection ? - doesn't seem to have any effect
AM_RANGE(0xef00, 0xef00) AM_WRITE_LEGACY(soundlatch_w)
ADDRESS_MAP_END