summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/jack.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/jack.c')
-rw-r--r--src/mame/drivers/jack.c37
1 files changed, 17 insertions, 20 deletions
diff --git a/src/mame/drivers/jack.c b/src/mame/drivers/jack.c
index 46ebb000146..95b3aa787fa 100644
--- a/src/mame/drivers/jack.c
+++ b/src/mame/drivers/jack.c
@@ -63,21 +63,19 @@ static READ8_DEVICE_HANDLER( timer_r )
}
-static WRITE8_HANDLER( jack_sh_command_w )
+WRITE8_MEMBER(jack_state::jack_sh_command_w)
{
- jack_state *state = space->machine().driver_data<jack_state>();
soundlatch_w(space, 0, data);
- device_set_input_line(state->m_audiocpu, 0, HOLD_LINE);
+ device_set_input_line(m_audiocpu, 0, HOLD_LINE);
}
/* these handlers are guessed, because otherwise you can't enter test mode */
-static WRITE8_HANDLER( joinem_misc_w )
+WRITE8_MEMBER(jack_state::joinem_misc_w)
{
- jack_state *state = space->machine().driver_data<jack_state>();
- flip_screen_set(space->machine(), data & 0x80);
- state->m_joinem_snd_bit = data & 1;
+ flip_screen_set(machine(), data & 0x80);
+ m_joinem_snd_bit = data & 1;
}
static CUSTOM_INPUT( sound_check_r )
@@ -95,34 +93,33 @@ static CUSTOM_INPUT( sound_check_r )
Super Triv questions read handler
*/
-static READ8_HANDLER( striv_question_r )
+READ8_MEMBER(jack_state::striv_question_r)
{
- jack_state *state = space->machine().driver_data<jack_state>();
// Set-up the remap table for every 16 bytes
if ((offset & 0xc00) == 0x800)
{
- state->m_remap_address[offset & 0x0f] = (offset & 0xf0) >> 4;
+ m_remap_address[offset & 0x0f] = (offset & 0xf0) >> 4;
}
// Select which rom to read and the high 5 bits of address
else if ((offset & 0xc00) == 0xc00)
{
- state->m_question_rom = offset & 7;
- state->m_question_address = (offset & 0xf8) << 7;
+ m_question_rom = offset & 7;
+ m_question_address = (offset & 0xf8) << 7;
}
// Read the actual byte from question roms
else
{
- UINT8 *ROM = space->machine().region("user1")->base();
+ UINT8 *ROM = machine().region("user1")->base();
int real_address;
- real_address = state->m_question_address | (offset & 0x3f0) | state->m_remap_address[offset & 0x0f];
+ real_address = m_question_address | (offset & 0x3f0) | m_remap_address[offset & 0x0f];
// Check if it wants to read from the upper 8 roms or not
if (offset & 0x400)
- real_address |= 0x8000 * (state->m_question_rom + 8);
+ real_address |= 0x8000 * (m_question_rom + 8);
else
- real_address |= 0x8000 * state->m_question_rom;
+ real_address |= 0x8000 * m_question_rom;
return ROM[real_address];
}
@@ -140,7 +137,7 @@ static ADDRESS_MAP_START( jack_map, AS_PROGRAM, 8, jack_state )
AM_RANGE(0x0000, 0x3fff) AM_ROM
AM_RANGE(0x4000, 0x5fff) AM_RAM
AM_RANGE(0xb000, 0xb07f) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size)
- AM_RANGE(0xb400, 0xb400) AM_WRITE_LEGACY(jack_sh_command_w)
+ AM_RANGE(0xb400, 0xb400) AM_WRITE(jack_sh_command_w)
AM_RANGE(0xb500, 0xb500) AM_READ_PORT("DSW1")
AM_RANGE(0xb501, 0xb501) AM_READ_PORT("DSW2")
AM_RANGE(0xb502, 0xb502) AM_READ_PORT("IN0")
@@ -158,14 +155,14 @@ static ADDRESS_MAP_START( joinem_map, AS_PROGRAM, 8, jack_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0x8fff) AM_RAM
AM_RANGE(0xb000, 0xb0ff) AM_RAM AM_BASE_SIZE(m_spriteram, m_spriteram_size)
- AM_RANGE(0xb400, 0xb400) AM_WRITE_LEGACY(jack_sh_command_w)
+ AM_RANGE(0xb400, 0xb400) AM_WRITE(jack_sh_command_w)
AM_RANGE(0xb500, 0xb500) AM_READ_PORT("DSW1")
AM_RANGE(0xb501, 0xb501) AM_READ_PORT("DSW2")
AM_RANGE(0xb502, 0xb502) AM_READ_PORT("IN0")
AM_RANGE(0xb503, 0xb503) AM_READ_PORT("IN1")
AM_RANGE(0xb504, 0xb504) AM_READ_PORT("IN2")
AM_RANGE(0xb506, 0xb507) AM_READWRITE_LEGACY(jack_flipscreen_r, jack_flipscreen_w)
- AM_RANGE(0xb700, 0xb700) AM_WRITE_LEGACY(joinem_misc_w)
+ AM_RANGE(0xb700, 0xb700) AM_WRITE(joinem_misc_w)
AM_RANGE(0xb800, 0xbbff) AM_RAM_WRITE_LEGACY(jack_videoram_w) AM_BASE(m_videoram)
AM_RANGE(0xbc00, 0xbfff) AM_RAM_WRITE_LEGACY(jack_colorram_w) AM_BASE(m_colorram)
ADDRESS_MAP_END
@@ -1415,7 +1412,7 @@ static DRIVER_INIT( striv )
}
// Set-up the weirdest questions read ever done
- machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc000, 0xcfff, FUNC(striv_question_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_handler(0xc000, 0xcfff, read8_delegate(FUNC(jack_state::striv_question_r),state));
// Nop out unused sprites writes
machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xb000, 0xb0ff);