diff options
Diffstat (limited to 'src/mame/drivers/redalert.cpp')
-rw-r--r-- | src/mame/drivers/redalert.cpp | 130 |
1 files changed, 67 insertions, 63 deletions
diff --git a/src/mame/drivers/redalert.cpp b/src/mame/drivers/redalert.cpp index 6595613c786..e14c8f494d6 100644 --- a/src/mame/drivers/redalert.cpp +++ b/src/mame/drivers/redalert.cpp @@ -152,69 +152,73 @@ READ8_MEMBER(redalert_state::panther_unk_r) * *************************************/ -ADDRESS_MAP_START(redalert_state::redalert_main_map) - AM_RANGE(0x0000, 0x1fff) AM_RAM - AM_RANGE(0x2000, 0x3fff) AM_RAM_WRITE(redalert_bitmap_videoram_w) AM_SHARE("bitmap_videoram") - AM_RANGE(0x4000, 0x4fff) AM_RAM AM_SHARE("charram") - AM_RANGE(0x5000, 0xbfff) AM_ROM - AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x0f8f) AM_READ_PORT("C000") AM_WRITENOP - AM_RANGE(0xc010, 0xc010) AM_MIRROR(0x0f8f) AM_READ_PORT("C010") AM_WRITENOP - AM_RANGE(0xc020, 0xc020) AM_MIRROR(0x0f8f) AM_READ_PORT("C020") AM_WRITENOP - AM_RANGE(0xc030, 0xc030) AM_MIRROR(0x0f8f) AM_READNOP AM_WRITE(redalert_audio_command_w) - AM_RANGE(0xc040, 0xc040) AM_MIRROR(0x0f8f) AM_READNOP AM_WRITEONLY AM_SHARE("video_control") - AM_RANGE(0xc050, 0xc050) AM_MIRROR(0x0f8f) AM_READNOP AM_WRITEONLY AM_SHARE("bitmap_color") - AM_RANGE(0xc060, 0xc060) AM_MIRROR(0x0f8f) AM_READNOP AM_WRITE(redalert_voice_command_w) - AM_RANGE(0xc070, 0xc070) AM_MIRROR(0x0f8f) AM_READWRITE(redalert_interrupt_clear_r, redalert_interrupt_clear_w) - AM_RANGE(0xf000, 0xffff) AM_ROM AM_REGION("maincpu", 0x8000) -ADDRESS_MAP_END - -ADDRESS_MAP_START(redalert_state::ww3_main_map) - AM_RANGE(0x0000, 0x1fff) AM_RAM - AM_RANGE(0x2000, 0x3fff) AM_RAM_WRITE(redalert_bitmap_videoram_w) AM_SHARE("bitmap_videoram") - AM_RANGE(0x4000, 0x4fff) AM_RAM AM_SHARE("charram") - AM_RANGE(0x5000, 0xbfff) AM_ROM - AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x0f8f) AM_READ_PORT("C000") AM_WRITENOP - AM_RANGE(0xc010, 0xc010) AM_MIRROR(0x0f8f) AM_READ_PORT("C010") AM_WRITENOP - AM_RANGE(0xc020, 0xc020) AM_MIRROR(0x0f8f) AM_READ_PORT("C020") AM_WRITENOP - AM_RANGE(0xc030, 0xc030) AM_MIRROR(0x0f8f) AM_READNOP AM_WRITE(redalert_audio_command_w) - AM_RANGE(0xc040, 0xc040) AM_MIRROR(0x0f8f) AM_READNOP AM_WRITEONLY AM_SHARE("video_control") - AM_RANGE(0xc050, 0xc050) AM_MIRROR(0x0f8f) AM_READNOP AM_WRITEONLY AM_SHARE("bitmap_color") - AM_RANGE(0xc070, 0xc070) AM_MIRROR(0x0f8f) AM_READWRITE(redalert_interrupt_clear_r, redalert_interrupt_clear_w) - AM_RANGE(0xf000, 0xffff) AM_ROM AM_REGION("maincpu", 0x8000) -ADDRESS_MAP_END - -ADDRESS_MAP_START(redalert_state::panther_main_map) - AM_RANGE(0x0000, 0x1fff) AM_RAM - AM_RANGE(0x2000, 0x3fff) AM_RAM_WRITE(redalert_bitmap_videoram_w) AM_SHARE("bitmap_videoram") - AM_RANGE(0x4000, 0x4fff) AM_RAM AM_SHARE("charram") - AM_RANGE(0x5000, 0xbfff) AM_ROM - AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x0f8f) AM_READ_PORT("C000") AM_WRITENOP - AM_RANGE(0xc010, 0xc010) AM_MIRROR(0x0f8f) AM_READ_PORT("C010") AM_WRITENOP - AM_RANGE(0xc020, 0xc020) AM_MIRROR(0x0f8f) AM_READ(panther_unk_r) /* vblank? */ - AM_RANGE(0xc030, 0xc030) AM_MIRROR(0x0f8f) AM_READNOP AM_WRITE(redalert_audio_command_w) - AM_RANGE(0xc040, 0xc040) AM_MIRROR(0x0f8f) AM_READNOP AM_WRITEONLY AM_SHARE("video_control") - AM_RANGE(0xc050, 0xc050) AM_MIRROR(0x0f8f) AM_READNOP AM_WRITEONLY AM_SHARE("bitmap_color") - AM_RANGE(0xc070, 0xc070) AM_MIRROR(0x0f8f) AM_READWRITE(panther_interrupt_clear_r, redalert_interrupt_clear_w) - AM_RANGE(0xf000, 0xffff) AM_ROM AM_REGION("maincpu", 0x8000) -ADDRESS_MAP_END - -ADDRESS_MAP_START(redalert_state::demoneye_main_map) - AM_RANGE(0x0000, 0x1fff) AM_RAM - AM_RANGE(0x2000, 0x3fff) AM_RAM_WRITE(redalert_bitmap_videoram_w) AM_SHARE("bitmap_videoram") - AM_RANGE(0x4000, 0x5fff) AM_RAM AM_SHARE("charram") - AM_RANGE(0x6000, 0xbfff) AM_ROM - AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x0f8f) AM_READ_PORT("C000") AM_WRITENOP - AM_RANGE(0xc010, 0xc010) AM_MIRROR(0x0f8f) AM_READ_PORT("C010") AM_WRITENOP - AM_RANGE(0xc020, 0xc020) AM_MIRROR(0x0f8f) AM_READ_PORT("C020") AM_WRITENOP - AM_RANGE(0xc030, 0xc030) AM_MIRROR(0x0f8f) AM_READNOP AM_WRITE(demoneye_audio_command_w) - AM_RANGE(0xc040, 0xc040) AM_MIRROR(0x0f8f) AM_READNOP AM_WRITEONLY AM_SHARE("video_control") - AM_RANGE(0xc050, 0xc050) AM_MIRROR(0x0f8f) AM_READNOP AM_WRITEONLY AM_SHARE("bitmap_color") - AM_RANGE(0xc060, 0xc060) AM_MIRROR(0x0f80) AM_NOP /* unknown */ - AM_RANGE(0xc061, 0xc061) AM_MIRROR(0x0f80) AM_NOP /* unknown */ - AM_RANGE(0xc062, 0xc062) AM_MIRROR(0x0f80) AM_NOP /* unknown */ - AM_RANGE(0xc070, 0xc070) AM_MIRROR(0x0f8f) AM_READWRITE(redalert_interrupt_clear_r, redalert_interrupt_clear_w) /* probably not correct */ - AM_RANGE(0xf000, 0xffff) AM_ROM AM_REGION("maincpu", 0x8000) -ADDRESS_MAP_END +void redalert_state::redalert_main_map(address_map &map) +{ + map(0x0000, 0x1fff).ram(); + map(0x2000, 0x3fff).ram().w(this, FUNC(redalert_state::redalert_bitmap_videoram_w)).share("bitmap_videoram"); + map(0x4000, 0x4fff).ram().share("charram"); + map(0x5000, 0xbfff).rom(); + map(0xc000, 0xc000).mirror(0x0f8f).portr("C000").nopw(); + map(0xc010, 0xc010).mirror(0x0f8f).portr("C010").nopw(); + map(0xc020, 0xc020).mirror(0x0f8f).portr("C020").nopw(); + map(0xc030, 0xc030).mirror(0x0f8f).nopr().w(this, FUNC(redalert_state::redalert_audio_command_w)); + map(0xc040, 0xc040).mirror(0x0f8f).nopr().writeonly().share("video_control"); + map(0xc050, 0xc050).mirror(0x0f8f).nopr().writeonly().share("bitmap_color"); + map(0xc060, 0xc060).mirror(0x0f8f).nopr().w(this, FUNC(redalert_state::redalert_voice_command_w)); + map(0xc070, 0xc070).mirror(0x0f8f).rw(this, FUNC(redalert_state::redalert_interrupt_clear_r), FUNC(redalert_state::redalert_interrupt_clear_w)); + map(0xf000, 0xffff).rom().region("maincpu", 0x8000); +} + +void redalert_state::ww3_main_map(address_map &map) +{ + map(0x0000, 0x1fff).ram(); + map(0x2000, 0x3fff).ram().w(this, FUNC(redalert_state::redalert_bitmap_videoram_w)).share("bitmap_videoram"); + map(0x4000, 0x4fff).ram().share("charram"); + map(0x5000, 0xbfff).rom(); + map(0xc000, 0xc000).mirror(0x0f8f).portr("C000").nopw(); + map(0xc010, 0xc010).mirror(0x0f8f).portr("C010").nopw(); + map(0xc020, 0xc020).mirror(0x0f8f).portr("C020").nopw(); + map(0xc030, 0xc030).mirror(0x0f8f).nopr().w(this, FUNC(redalert_state::redalert_audio_command_w)); + map(0xc040, 0xc040).mirror(0x0f8f).nopr().writeonly().share("video_control"); + map(0xc050, 0xc050).mirror(0x0f8f).nopr().writeonly().share("bitmap_color"); + map(0xc070, 0xc070).mirror(0x0f8f).rw(this, FUNC(redalert_state::redalert_interrupt_clear_r), FUNC(redalert_state::redalert_interrupt_clear_w)); + map(0xf000, 0xffff).rom().region("maincpu", 0x8000); +} + +void redalert_state::panther_main_map(address_map &map) +{ + map(0x0000, 0x1fff).ram(); + map(0x2000, 0x3fff).ram().w(this, FUNC(redalert_state::redalert_bitmap_videoram_w)).share("bitmap_videoram"); + map(0x4000, 0x4fff).ram().share("charram"); + map(0x5000, 0xbfff).rom(); + map(0xc000, 0xc000).mirror(0x0f8f).portr("C000").nopw(); + map(0xc010, 0xc010).mirror(0x0f8f).portr("C010").nopw(); + map(0xc020, 0xc020).mirror(0x0f8f).r(this, FUNC(redalert_state::panther_unk_r)); /* vblank? */ + map(0xc030, 0xc030).mirror(0x0f8f).nopr().w(this, FUNC(redalert_state::redalert_audio_command_w)); + map(0xc040, 0xc040).mirror(0x0f8f).nopr().writeonly().share("video_control"); + map(0xc050, 0xc050).mirror(0x0f8f).nopr().writeonly().share("bitmap_color"); + map(0xc070, 0xc070).mirror(0x0f8f).rw(this, FUNC(redalert_state::panther_interrupt_clear_r), FUNC(redalert_state::redalert_interrupt_clear_w)); + map(0xf000, 0xffff).rom().region("maincpu", 0x8000); +} + +void redalert_state::demoneye_main_map(address_map &map) +{ + map(0x0000, 0x1fff).ram(); + map(0x2000, 0x3fff).ram().w(this, FUNC(redalert_state::redalert_bitmap_videoram_w)).share("bitmap_videoram"); + map(0x4000, 0x5fff).ram().share("charram"); + map(0x6000, 0xbfff).rom(); + map(0xc000, 0xc000).mirror(0x0f8f).portr("C000").nopw(); + map(0xc010, 0xc010).mirror(0x0f8f).portr("C010").nopw(); + map(0xc020, 0xc020).mirror(0x0f8f).portr("C020").nopw(); + map(0xc030, 0xc030).mirror(0x0f8f).nopr().w(this, FUNC(redalert_state::demoneye_audio_command_w)); + map(0xc040, 0xc040).mirror(0x0f8f).nopr().writeonly().share("video_control"); + map(0xc050, 0xc050).mirror(0x0f8f).nopr().writeonly().share("bitmap_color"); + map(0xc060, 0xc060).mirror(0x0f80).noprw(); /* unknown */ + map(0xc061, 0xc061).mirror(0x0f80).noprw(); /* unknown */ + map(0xc062, 0xc062).mirror(0x0f80).noprw(); /* unknown */ + map(0xc070, 0xc070).mirror(0x0f8f).rw(this, FUNC(redalert_state::redalert_interrupt_clear_r), FUNC(redalert_state::redalert_interrupt_clear_w)); /* probably not correct */ + map(0xf000, 0xffff).rom().region("maincpu", 0x8000); +} |