diff options
Diffstat (limited to 'src/mame/drivers/bishi.c')
-rw-r--r-- | src/mame/drivers/bishi.c | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/src/mame/drivers/bishi.c b/src/mame/drivers/bishi.c index f70c72f7ee7..70f7a9c0586 100644 --- a/src/mame/drivers/bishi.c +++ b/src/mame/drivers/bishi.c @@ -89,24 +89,21 @@ Notes: #include "sound/ymz280b.h" #include "includes/bishi.h" -static READ16_HANDLER( control_r ) +READ16_MEMBER(bishi_state::control_r) { - bishi_state *state = space->machine().driver_data<bishi_state>(); - return state->m_cur_control; + return m_cur_control; } -static WRITE16_HANDLER( control_w ) +WRITE16_MEMBER(bishi_state::control_w) { // bit 8 = interrupt gate - bishi_state *state = space->machine().driver_data<bishi_state>(); - COMBINE_DATA(&state->m_cur_control); + COMBINE_DATA(&m_cur_control); } -static WRITE16_HANDLER( control2_w ) +WRITE16_MEMBER(bishi_state::control2_w) { // bit 12 = part of the banking calculation for the K056832 ROM readback - bishi_state *state = space->machine().driver_data<bishi_state>(); - COMBINE_DATA(&state->m_cur_control2); + COMBINE_DATA(&m_cur_control2); } static TIMER_DEVICE_CALLBACK( bishi_scanline ) @@ -125,34 +122,33 @@ static TIMER_DEVICE_CALLBACK( bishi_scanline ) } /* compensate for a bug in the ram/rom test */ -static READ16_HANDLER( bishi_mirror_r ) +READ16_MEMBER(bishi_state::bishi_mirror_r) { - return space->machine().generic.paletteram.u16[offset]; + return machine().generic.paletteram.u16[offset]; } -static READ16_HANDLER( bishi_K056832_rom_r ) +READ16_MEMBER(bishi_state::bishi_K056832_rom_r) { - bishi_state *state = space->machine().driver_data<bishi_state>(); UINT16 ouroffs; ouroffs = (offset >> 1) * 8; if (offset & 1) ouroffs++; - if (state->m_cur_control2 & 0x1000) + if (m_cur_control2 & 0x1000) ouroffs += 4; - return k056832_bishi_rom_word_r(state->m_k056832, ouroffs, mem_mask); + return k056832_bishi_rom_word_r(m_k056832, ouroffs, mem_mask); } static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, bishi_state ) AM_RANGE(0x000000, 0x0fffff) AM_ROM AM_RANGE(0x400000, 0x407fff) AM_RAM // Work RAM - AM_RANGE(0x800000, 0x800001) AM_READWRITE_LEGACY(control_r, control_w) + AM_RANGE(0x800000, 0x800001) AM_READWRITE(control_r, control_w) AM_RANGE(0x800004, 0x800005) AM_READ_PORT("DSW") AM_RANGE(0x800006, 0x800007) AM_READ_PORT("SYSTEM") AM_RANGE(0x800008, 0x800009) AM_READ_PORT("INPUTS") - AM_RANGE(0x810000, 0x810003) AM_WRITE_LEGACY(control2_w) // bank switch for K056832 character ROM test + AM_RANGE(0x810000, 0x810003) AM_WRITE(control2_w) // bank switch for K056832 character ROM test AM_RANGE(0x820000, 0x820001) AM_WRITENOP // lamps (see lamp test in service menu) AM_RANGE(0x830000, 0x83003f) AM_DEVWRITE_LEGACY("k056832", k056832_word_w) AM_RANGE(0x840000, 0x840007) AM_DEVWRITE_LEGACY("k056832", k056832_b_word_w) // VSCCS @@ -161,8 +157,8 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, bishi_state ) AM_RANGE(0x880000, 0x880003) AM_DEVREADWRITE8_LEGACY("ymz", ymz280b_r, ymz280b_w, 0xff00) AM_RANGE(0xa00000, 0xa01fff) AM_DEVREADWRITE_LEGACY("k056832", k056832_ram_word_r, k056832_ram_word_w) // Graphic planes AM_RANGE(0xb00000, 0xb03fff) AM_RAM_WRITE_LEGACY(paletteram16_xbgr_word_be_w) AM_BASE_GENERIC(paletteram) - AM_RANGE(0xb04000, 0xb047ff) AM_READ_LEGACY(bishi_mirror_r) // bug in the ram/rom test? - AM_RANGE(0xc00000, 0xc01fff) AM_READ_LEGACY(bishi_K056832_rom_r) + AM_RANGE(0xb04000, 0xb047ff) AM_READ(bishi_mirror_r) // bug in the ram/rom test? + AM_RANGE(0xc00000, 0xc01fff) AM_READ(bishi_K056832_rom_r) ADDRESS_MAP_END static INPUT_PORTS_START( bishi ) |