diff options
Diffstat (limited to 'src/mame/drivers/halleys.cpp')
-rw-r--r-- | src/mame/drivers/halleys.cpp | 80 |
1 files changed, 41 insertions, 39 deletions
diff --git a/src/mame/drivers/halleys.cpp b/src/mame/drivers/halleys.cpp index d6517e6ac7d..48e0d38ba35 100644 --- a/src/mame/drivers/halleys.cpp +++ b/src/mame/drivers/halleys.cpp @@ -1633,45 +1633,47 @@ READ8_MEMBER(halleys_state::io_mirror_r) //************************************************************************** // Memory Maps -ADDRESS_MAP_START(halleys_state::halleys_map) - AM_RANGE(0x0000, 0x0fff) AM_READWRITE(blitter_r, blitter_w) AM_SHARE("blitter_ram") - AM_RANGE(0x1f00, 0x1fff) AM_WRITE(bgtile_w) // background tiles?(Ben Bero Beh only) - AM_RANGE(0x1000, 0xefff) AM_ROM - AM_RANGE(0xf000, 0xfeff) AM_RAM // work ram - - AM_RANGE(0xff00, 0xffbf) AM_RAM AM_SHARE("io_ram") // I/O write fall-through - - AM_RANGE(0xff66, 0xff66) AM_READ(collision_id_r) // HACK: collision detection bypass(Halley's Comet only) - AM_RANGE(0xff71, 0xff71) AM_READ(blitter_status_r) - AM_RANGE(0xff80, 0xff83) AM_READ(io_mirror_r) - AM_RANGE(0xff8a, 0xff8a) AM_WRITE(soundcommand_w) - AM_RANGE(0xff90, 0xff90) AM_READ_PORT("IN0") // coin/start - AM_RANGE(0xff91, 0xff91) AM_READ_PORT("IN1") // player 1 - AM_RANGE(0xff92, 0xff92) AM_READ_PORT("IN2") // player 2 - AM_RANGE(0xff93, 0xff93) AM_READ_PORT("IN3") // unused? - AM_RANGE(0xff94, 0xff94) AM_READ(coin_lockout_r) - AM_RANGE(0xff95, 0xff95) AM_READ_PORT("DSW1") // dipswitch 4 - AM_RANGE(0xff96, 0xff96) AM_READ_PORT("DSW2") // dipswitch 3 - AM_RANGE(0xff97, 0xff97) AM_READ_PORT("DSW3") // dipswitch 2 - AM_RANGE(0xff9c, 0xff9c) AM_WRITE(firq_ack_w) - - AM_RANGE(0xffc0, 0xffdf) AM_READWRITE(paletteram_r, paletteram_w) - AM_RANGE(0xffe0, 0xffff) AM_READ(vector_r) -ADDRESS_MAP_END - - -ADDRESS_MAP_START(halleys_state::sound_map) - AM_RANGE(0x0000, 0x3fff) AM_ROM - AM_RANGE(0x4000, 0x47ff) AM_RAM - AM_RANGE(0x4800, 0x4801) AM_DEVWRITE("ay2", ay8910_device, address_data_w) - AM_RANGE(0x4801, 0x4801) AM_DEVREAD("ay2", ay8910_device, data_r) - AM_RANGE(0x4802, 0x4803) AM_DEVWRITE("ay3", ay8910_device, address_data_w) - AM_RANGE(0x4803, 0x4803) AM_DEVREAD("ay3", ay8910_device, data_r) - AM_RANGE(0x4804, 0x4805) AM_DEVWRITE("ay4", ay8910_device, address_data_w) - AM_RANGE(0x4805, 0x4805) AM_DEVREAD("ay4", ay8910_device, data_r) - AM_RANGE(0x5000, 0x5000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) - AM_RANGE(0xe000, 0xefff) AM_ROM // space for diagnostic ROM -ADDRESS_MAP_END +void halleys_state::halleys_map(address_map &map) +{ + map(0x0000, 0x0fff).rw(this, FUNC(halleys_state::blitter_r), FUNC(halleys_state::blitter_w)).share("blitter_ram"); + map(0x1f00, 0x1fff).w(this, FUNC(halleys_state::bgtile_w)); // background tiles?(Ben Bero Beh only) + map(0x1000, 0xefff).rom(); + map(0xf000, 0xfeff).ram(); // work ram + + map(0xff00, 0xffbf).ram().share("io_ram"); // I/O write fall-through + + map(0xff66, 0xff66).r(this, FUNC(halleys_state::collision_id_r)); // HACK: collision detection bypass(Halley's Comet only) + map(0xff71, 0xff71).r(this, FUNC(halleys_state::blitter_status_r)); + map(0xff80, 0xff83).r(this, FUNC(halleys_state::io_mirror_r)); + map(0xff8a, 0xff8a).w(this, FUNC(halleys_state::soundcommand_w)); + map(0xff90, 0xff90).portr("IN0"); // coin/start + map(0xff91, 0xff91).portr("IN1"); // player 1 + map(0xff92, 0xff92).portr("IN2"); // player 2 + map(0xff93, 0xff93).portr("IN3"); // unused? + map(0xff94, 0xff94).r(this, FUNC(halleys_state::coin_lockout_r)); + map(0xff95, 0xff95).portr("DSW1"); // dipswitch 4 + map(0xff96, 0xff96).portr("DSW2"); // dipswitch 3 + map(0xff97, 0xff97).portr("DSW3"); // dipswitch 2 + map(0xff9c, 0xff9c).w(this, FUNC(halleys_state::firq_ack_w)); + + map(0xffc0, 0xffdf).rw(this, FUNC(halleys_state::paletteram_r), FUNC(halleys_state::paletteram_w)); + map(0xffe0, 0xffff).r(this, FUNC(halleys_state::vector_r)); +} + + +void halleys_state::sound_map(address_map &map) +{ + map(0x0000, 0x3fff).rom(); + map(0x4000, 0x47ff).ram(); + map(0x4800, 0x4801).w("ay2", FUNC(ay8910_device::address_data_w)); + map(0x4801, 0x4801).r("ay2", FUNC(ay8910_device::data_r)); + map(0x4802, 0x4803).w("ay3", FUNC(ay8910_device::address_data_w)); + map(0x4803, 0x4803).r("ay3", FUNC(ay8910_device::data_r)); + map(0x4804, 0x4805).w("ay4", FUNC(ay8910_device::address_data_w)); + map(0x4805, 0x4805).r("ay4", FUNC(ay8910_device::data_r)); + map(0x5000, 0x5000).r(m_soundlatch, FUNC(generic_latch_8_device::read)); + map(0xe000, 0xefff).rom(); // space for diagnostic ROM +} //************************************************************************** |