mirror of
https://github.com/holub/mame
synced 2025-04-23 08:49:55 +03:00
zigzagb: Install handlers and banks using address map rather than hacking them in with DRIVER_INIT (nw)
This commit is contained in:
parent
00b999cbfa
commit
5c20d9d82b
@ -1656,6 +1656,28 @@ static ADDRESS_MAP_START( timefgtr_map, AS_PROGRAM, 8, galaxian_state )
|
||||
// AM_RANGE(0xfff8, 0xffff) AM_WRITENOP // sound related?
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( zigzag_map, AS_PROGRAM, 8, galaxian_state )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
AM_RANGE(0x0000, 0x1fff) AM_ROM
|
||||
AM_RANGE(0x2000, 0x2fff) AM_ROMBANK("bank1")
|
||||
AM_RANGE(0x3000, 0x3fff) AM_ROMBANK("bank2")
|
||||
AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0x0400) AM_RAM
|
||||
AM_RANGE(0x4800, 0x4fff) AM_WRITE(zigzag_ay8910_w)
|
||||
AM_RANGE(0x5000, 0x53ff) AM_MIRROR(0x0400) AM_RAM_WRITE(galaxian_videoram_w) AM_SHARE("videoram")
|
||||
AM_RANGE(0x5800, 0x58ff) AM_MIRROR(0x0700) AM_RAM_WRITE(galaxian_objram_w) AM_SHARE("spriteram")
|
||||
AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x07ff) AM_READ_PORT("IN0")
|
||||
AM_RANGE(0x6000, 0x6001) AM_MIRROR(0x07f8) AM_WRITE(start_lamp_w)
|
||||
AM_RANGE(0x6003, 0x6003) AM_MIRROR(0x07f8) AM_WRITE(coin_count_0_w)
|
||||
AM_RANGE(0x6800, 0x6800) AM_MIRROR(0x07ff) AM_READ_PORT("IN1")
|
||||
AM_RANGE(0x7000, 0x7000) AM_MIRROR(0x07ff) AM_READ_PORT("IN2")
|
||||
AM_RANGE(0x7001, 0x7001) AM_MIRROR(0x07f8) AM_WRITE(irq_enable_w)
|
||||
AM_RANGE(0x7002, 0x7002) AM_MIRROR(0x07f8) AM_WRITE(zigzag_bankswap_w)
|
||||
AM_RANGE(0x7004, 0x7004) AM_MIRROR(0x07f8) AM_WRITE(galaxian_stars_enable_w)
|
||||
AM_RANGE(0x7006, 0x7006) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_x_w)
|
||||
AM_RANGE(0x7007, 0x7007) AM_MIRROR(0x07f8) AM_WRITE(galaxian_flip_screen_y_w)
|
||||
AM_RANGE(0x7800, 0x7800) AM_MIRROR(0x07ff) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
/* map derived from schematics */
|
||||
#if 0
|
||||
@ -5656,7 +5678,7 @@ static MACHINE_CONFIG_DERIVED( zigzag, galaxian_base )
|
||||
|
||||
/* basic machine hardware */
|
||||
MCFG_CPU_MODIFY("maincpu")
|
||||
MCFG_CPU_PROGRAM_MAP(galaxian_map_base) /* no discrete sound */
|
||||
MCFG_CPU_PROGRAM_MAP(zigzag_map)
|
||||
|
||||
/* sound hardware */
|
||||
MCFG_SOUND_ADD("8910.0", AY8910, GALAXIAN_PIXEL_CLOCK/3/2) /* matches PCB video - unconfirmed */
|
||||
@ -6414,16 +6436,6 @@ void galaxian_state::common_init(galaxian_draw_bullet_func draw_bullet,galaxian_
|
||||
}
|
||||
|
||||
|
||||
void galaxian_state::unmap_galaxian_sound(offs_t base)
|
||||
{
|
||||
address_space &space = m_maincpu->space(AS_PROGRAM);
|
||||
|
||||
space.unmap_write(base + 0x0004, base + 0x0007, 0x07f8);
|
||||
space.unmap_write(base + 0x0800, base + 0x0fff);
|
||||
space.unmap_write(base + 0x1800, base + 0x1fff);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
@ -6688,28 +6700,11 @@ DRIVER_INIT_MEMBER(galaxian_state,zigzag)
|
||||
m_numspritegens = 2;
|
||||
|
||||
/* make ROMs 2 & 3 swappable */
|
||||
space.install_read_bank(0x2000, 0x2fff, "bank1");
|
||||
space.install_read_bank(0x3000, 0x3fff, "bank2");
|
||||
membank("bank1")->configure_entries(0, 2, memregion("maincpu")->base() + 0x2000, 0x1000);
|
||||
membank("bank2")->configure_entries(0, 2, memregion("maincpu")->base() + 0x2000, 0x1000);
|
||||
|
||||
/* also re-install the fixed ROM area as a bank in order to inform the memory system that
|
||||
the fixed area only extends to 0x1fff */
|
||||
space.install_read_bank(0x0000, 0x1fff, "bank3");
|
||||
membank("bank3")->set_base(memregion("maincpu")->base() + 0x0000);
|
||||
|
||||
/* handler for doing the swaps */
|
||||
space.install_write_handler(0x7002, 0x7002, 0, 0x07f8, 0, write8_delegate(FUNC(galaxian_state::zigzag_bankswap_w),this));
|
||||
zigzag_bankswap_w(space, 0, 0);
|
||||
|
||||
/* coin lockout disabled */
|
||||
space.unmap_write(0x6002, 0x6002, 0x7f8);
|
||||
|
||||
/* remove the galaxian sound hardware */
|
||||
unmap_galaxian_sound( 0x6000);
|
||||
|
||||
/* install our AY-8910 handler */
|
||||
space.install_write_handler(0x4800, 0x4fff, write8_delegate(FUNC(galaxian_state::zigzag_ay8910_w),this));
|
||||
}
|
||||
|
||||
|
||||
|
@ -327,7 +327,6 @@ public:
|
||||
void decode_anteater_gfx();
|
||||
void decode_losttomb_gfx();
|
||||
void decode_superbon();
|
||||
void unmap_galaxian_sound(offs_t base);
|
||||
void mshuttle_decode(const uint8_t convtable[8][16]);
|
||||
void common_init(galaxian_draw_bullet_func draw_bullet,galaxian_draw_background_func draw_background,
|
||||
galaxian_extend_tile_info_func extend_tile_info,galaxian_extend_sprite_info_func extend_sprite_info);
|
||||
|
Loading…
Reference in New Issue
Block a user