trunk/src/mame/drivers/exzisus.c
| r243527 | r243528 | |
| 46 | 46 | |
| 47 | 47 | ***************************************************************************/ |
| 48 | 48 | |
| 49 | | WRITE8_MEMBER(exzisus_state::exzisus_cpua_bankswitch_w) |
| 49 | WRITE8_MEMBER(exzisus_state::cpua_bankswitch_w) |
| 50 | 50 | { |
| 51 | | UINT8 *RAM = memregion("cpua")->base(); |
| 52 | | |
| 53 | 51 | if ( (data & 0x0f) != m_cpua_bank ) |
| 54 | 52 | { |
| 55 | 53 | m_cpua_bank = data & 0x0f; |
| 56 | 54 | if (m_cpua_bank >= 2) |
| 57 | 55 | { |
| 58 | | membank("bank2")->set_base(&RAM[ 0x10000 + ( (m_cpua_bank - 2) * 0x4000 ) ] ); |
| 56 | membank("bank2")->set_entry(m_cpua_bank - 2); |
| 59 | 57 | } |
| 60 | 58 | } |
| 61 | 59 | |
| 62 | 60 | flip_screen_set(data & 0x40); |
| 63 | 61 | } |
| 64 | 62 | |
| 65 | | WRITE8_MEMBER(exzisus_state::exzisus_cpub_bankswitch_w) |
| 63 | WRITE8_MEMBER(exzisus_state::cpub_bankswitch_w) |
| 66 | 64 | { |
| 67 | | UINT8 *RAM = memregion("cpub")->base(); |
| 68 | | |
| 69 | 65 | if ( (data & 0x0f) != m_cpub_bank ) |
| 70 | 66 | { |
| 71 | 67 | m_cpub_bank = data & 0x0f; |
| 72 | 68 | if (m_cpub_bank >= 2) |
| 73 | 69 | { |
| 74 | | membank("bank1")->set_base(&RAM[ 0x10000 + ( (m_cpub_bank - 2) * 0x4000 ) ] ); |
| 70 | membank("bank1")->set_entry(m_cpub_bank - 2); |
| 75 | 71 | } |
| 76 | 72 | } |
| 77 | 73 | |
| 78 | 74 | flip_screen_set(data & 0x40); |
| 79 | 75 | } |
| 80 | 76 | |
| 81 | | WRITE8_MEMBER(exzisus_state::exzisus_coincounter_w) |
| 77 | WRITE8_MEMBER(exzisus_state::coincounter_w) |
| 82 | 78 | { |
| 83 | 79 | coin_lockout_w(machine(), 0,~data & 0x01); |
| 84 | 80 | coin_lockout_w(machine(), 1,~data & 0x02); |
| r243527 | r243528 | |
| 86 | 82 | coin_counter_w(machine(), 1,data & 0x08); |
| 87 | 83 | } |
| 88 | 84 | |
| 89 | | READ8_MEMBER(exzisus_state::exzisus_sharedram_ab_r) |
| 90 | | { |
| 91 | | return m_sharedram_ab[offset]; |
| 92 | | } |
| 93 | | |
| 94 | | READ8_MEMBER(exzisus_state::exzisus_sharedram_ac_r) |
| 95 | | { |
| 96 | | return m_sharedram_ac[offset]; |
| 97 | | } |
| 98 | | |
| 99 | | WRITE8_MEMBER(exzisus_state::exzisus_sharedram_ab_w) |
| 100 | | { |
| 101 | | m_sharedram_ab[offset] = data; |
| 102 | | } |
| 103 | | |
| 104 | | WRITE8_MEMBER(exzisus_state::exzisus_sharedram_ac_w) |
| 105 | | { |
| 106 | | m_sharedram_ac[offset] = data; |
| 107 | | } |
| 108 | | |
| 109 | 85 | // is it ok that cpub_reset refers to cpuc? |
| 110 | | WRITE8_MEMBER(exzisus_state::exzisus_cpub_reset_w) |
| 86 | WRITE8_MEMBER(exzisus_state::cpub_reset_w) |
| 111 | 87 | { |
| 112 | 88 | m_cpuc->set_input_line(INPUT_LINE_RESET, PULSE_LINE); |
| 113 | 89 | } |
| 114 | 90 | |
| 115 | 91 | #if 0 |
| 116 | | // without exzisus_cpub_reset_w, the following patch would be needed for |
| 92 | // without cpub_reset_w, the following patch would be needed for |
| 117 | 93 | // the RAM check to work |
| 118 | 94 | DRIVER_INIT_MEMBER(exzisus_state,exzisus) |
| 119 | 95 | { |
| r243527 | r243528 | |
| 137 | 113 | static ADDRESS_MAP_START( cpua_map, AS_PROGRAM, 8, exzisus_state ) |
| 138 | 114 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 139 | 115 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank2") |
| 140 | | AM_RANGE(0xc000, 0xc5ff) AM_READWRITE(exzisus_objectram_1_r, exzisus_objectram_1_w) AM_SHARE("objectram1") |
| 141 | | AM_RANGE(0xc600, 0xdfff) AM_READWRITE(exzisus_videoram_1_r, exzisus_videoram_1_w) AM_SHARE("videoram1") |
| 142 | | AM_RANGE(0xe000, 0xefff) AM_READWRITE(exzisus_sharedram_ac_r, exzisus_sharedram_ac_w) AM_SHARE("sharedram_ac") |
| 143 | | AM_RANGE(0xf400, 0xf400) AM_WRITE(exzisus_cpua_bankswitch_w) |
| 144 | | AM_RANGE(0xf404, 0xf404) AM_WRITE(exzisus_cpub_reset_w) // ?? |
| 145 | | AM_RANGE(0xf800, 0xffff) AM_READWRITE(exzisus_sharedram_ab_r, exzisus_sharedram_ab_w) AM_SHARE("sharedram_ab") |
| 116 | AM_RANGE(0xc000, 0xc5ff) AM_RAM AM_SHARE("objectram1") |
| 117 | AM_RANGE(0xc600, 0xdfff) AM_RAM AM_SHARE("videoram1") |
| 118 | AM_RANGE(0xe000, 0xefff) AM_RAM AM_SHARE("sharedram_ac") |
| 119 | AM_RANGE(0xf400, 0xf400) AM_WRITE(cpua_bankswitch_w) |
| 120 | AM_RANGE(0xf404, 0xf404) AM_WRITE(cpub_reset_w) // ?? |
| 121 | AM_RANGE(0xf800, 0xffff) AM_RAM AM_SHARE("sharedram_ab") |
| 146 | 122 | ADDRESS_MAP_END |
| 147 | 123 | |
| 148 | 124 | static ADDRESS_MAP_START( cpub_map, AS_PROGRAM, 8, exzisus_state ) |
| 149 | 125 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 150 | 126 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") |
| 151 | | AM_RANGE(0xc000, 0xc5ff) AM_READWRITE(exzisus_objectram_0_r, exzisus_objectram_0_w) AM_SHARE("objectram0") |
| 152 | | AM_RANGE(0xc600, 0xdfff) AM_READWRITE(exzisus_videoram_0_r, exzisus_videoram_0_w) AM_SHARE("videoram0") |
| 127 | AM_RANGE(0xc000, 0xc5ff) AM_RAM AM_SHARE("objectram0") |
| 128 | AM_RANGE(0xc600, 0xdfff) AM_RAM AM_SHARE("videoram0") |
| 153 | 129 | AM_RANGE(0xe000, 0xefff) AM_RAM |
| 154 | 130 | AM_RANGE(0xf000, 0xf000) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, master_port_w) |
| 155 | 131 | AM_RANGE(0xf001, 0xf001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w) |
| 156 | 132 | AM_RANGE(0xf400, 0xf400) AM_READ_PORT("P1") |
| 157 | | AM_RANGE(0xf400, 0xf400) AM_WRITE(exzisus_cpub_bankswitch_w) |
| 133 | AM_RANGE(0xf400, 0xf400) AM_WRITE(cpub_bankswitch_w) |
| 158 | 134 | AM_RANGE(0xf401, 0xf401) AM_READ_PORT("P2") |
| 159 | 135 | AM_RANGE(0xf402, 0xf402) AM_READ_PORT("SYSTEM") |
| 160 | | AM_RANGE(0xf402, 0xf402) AM_WRITE(exzisus_coincounter_w) |
| 136 | AM_RANGE(0xf402, 0xf402) AM_WRITE(coincounter_w) |
| 161 | 137 | AM_RANGE(0xf404, 0xf404) AM_READ_PORT("DSWA") |
| 162 | 138 | AM_RANGE(0xf404, 0xf404) AM_WRITENOP // ?? |
| 163 | 139 | AM_RANGE(0xf405, 0xf405) AM_READ_PORT("DSWB") |
| 164 | | AM_RANGE(0xf800, 0xffff) AM_READWRITE(exzisus_sharedram_ab_r, exzisus_sharedram_ab_w) |
| 140 | AM_RANGE(0xf800, 0xffff) AM_RAM AM_SHARE("sharedram_ab") |
| 165 | 141 | ADDRESS_MAP_END |
| 166 | 142 | |
| 167 | 143 | static ADDRESS_MAP_START( cpuc_map, AS_PROGRAM, 8, exzisus_state ) |
| 168 | 144 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 169 | | AM_RANGE(0x8000, 0x85ff) AM_READWRITE(exzisus_objectram_1_r, exzisus_objectram_1_w) |
| 170 | | AM_RANGE(0x8600, 0x9fff) AM_READWRITE(exzisus_videoram_1_r, exzisus_videoram_1_w) |
| 171 | | AM_RANGE(0xa000, 0xafff) AM_READWRITE(exzisus_sharedram_ac_r, exzisus_sharedram_ac_w) |
| 145 | AM_RANGE(0x8000, 0x85ff) AM_RAM AM_SHARE("objectram1") |
| 146 | AM_RANGE(0x8600, 0x9fff) AM_RAM AM_SHARE("videoram1") |
| 147 | AM_RANGE(0xa000, 0xafff) AM_RAM AM_SHARE("sharedram_ac") |
| 172 | 148 | AM_RANGE(0xb000, 0xbfff) AM_RAM |
| 173 | 149 | ADDRESS_MAP_END |
| 174 | 150 | |
| r243527 | r243528 | |
| 234 | 210 | |
| 235 | 211 | ***************************************************************************/ |
| 236 | 212 | |
| 213 | void exzisus_state::machine_start() |
| 214 | { |
| 215 | membank("bank1")->configure_entries(0, 16, memregion("cpub")->base() + 0x10000, 0x4000); |
| 216 | membank("bank2")->configure_entries(0, 16, memregion("cpua")->base() + 0x10000, 0x4000); |
| 217 | |
| 218 | save_item(NAME(m_cpua_bank)); |
| 219 | save_item(NAME(m_cpub_bank)); |
| 220 | } |
| 221 | |
| 237 | 222 | static const gfx_layout charlayout = |
| 238 | 223 | { |
| 239 | 224 | 8, 8, |
| r243527 | r243528 | |
| 279 | 264 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 280 | 265 | MCFG_SCREEN_SIZE(32*8, 32*8) |
| 281 | 266 | MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) |
| 282 | | MCFG_SCREEN_UPDATE_DRIVER(exzisus_state, screen_update_exzisus) |
| 267 | MCFG_SCREEN_UPDATE_DRIVER(exzisus_state, screen_update) |
| 283 | 268 | MCFG_SCREEN_PALETTE("palette") |
| 284 | 269 | |
| 285 | 270 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", exzisus) |
| r243527 | r243528 | |
| 424 | 409 | ROM_LOAD( "b23-05.16l", 0x00800, 0x00400, CRC(87f0f69a) SHA1(37df6fd56245fab9beaabfd86fd8f95d7c42c2a5) ) |
| 425 | 410 | ROM_END |
| 426 | 411 | |
| 427 | | GAME( 1987, exzisus, 0, exzisus, exzisus, driver_device, 0, ROT0, "Taito Corporation", "Exzisus (Japan, dedicated)", 0 ) |
| 428 | | GAME( 1987, exzisusa, exzisus, exzisus, exzisus, driver_device, 0, ROT0, "Taito Corporation", "Exzisus (Japan, conversion)", 0 ) |
| 429 | | GAME( 1987, exzisust, exzisus, exzisus, exzisus, driver_device, 0, ROT0, "Taito Corporation (TAD license)", "Exzisus (TAD license)", 0 ) |
| 412 | GAME( 1987, exzisus, 0, exzisus, exzisus, driver_device, 0, ROT0, "Taito Corporation", "Exzisus (Japan, dedicated)", GAME_SUPPORTS_SAVE ) |
| 413 | GAME( 1987, exzisusa, exzisus, exzisus, exzisus, driver_device, 0, ROT0, "Taito Corporation", "Exzisus (Japan, conversion)", GAME_SUPPORTS_SAVE ) |
| 414 | GAME( 1987, exzisust, exzisus, exzisus, exzisus, driver_device, 0, ROT0, "Taito Corporation (TAD license)", "Exzisus (TAD license)", GAME_SUPPORTS_SAVE ) |
trunk/src/mame/includes/exzisus.h
| r243527 | r243528 | |
| 3 | 3 | public: |
| 4 | 4 | exzisus_state(const machine_config &mconfig, device_type type, const char *tag) |
| 5 | 5 | : driver_device(mconfig, type, tag), |
| 6 | m_cpuc(*this, "cpuc"), |
| 7 | m_gfxdecode(*this, "gfxdecode"), |
| 8 | m_palette(*this, "palette"), |
| 6 | 9 | m_objectram1(*this, "objectram1"), |
| 7 | 10 | m_videoram1(*this, "videoram1"), |
| 8 | 11 | m_sharedram_ac(*this, "sharedram_ac"), |
| 9 | 12 | m_sharedram_ab(*this, "sharedram_ab"), |
| 10 | 13 | m_objectram0(*this, "objectram0"), |
| 11 | | m_videoram0(*this, "videoram0"), |
| 12 | | m_cpuc(*this, "cpuc"), |
| 13 | | m_gfxdecode(*this, "gfxdecode"), |
| 14 | | m_palette(*this, "palette") { } |
| 14 | m_videoram0(*this, "videoram0") { } |
| 15 | 15 | |
| 16 | required_device<cpu_device> m_cpuc; |
| 17 | required_device<gfxdecode_device> m_gfxdecode; |
| 18 | required_device<palette_device> m_palette; |
| 19 | |
| 16 | 20 | required_shared_ptr<UINT8> m_objectram1; |
| 17 | 21 | required_shared_ptr<UINT8> m_videoram1; |
| 18 | 22 | required_shared_ptr<UINT8> m_sharedram_ac; |
| 19 | 23 | required_shared_ptr<UINT8> m_sharedram_ab; |
| 20 | 24 | required_shared_ptr<UINT8> m_objectram0; |
| 21 | 25 | required_shared_ptr<UINT8> m_videoram0; |
| 22 | | required_device<cpu_device> m_cpuc; |
| 23 | | required_device<gfxdecode_device> m_gfxdecode; |
| 24 | | required_device<palette_device> m_palette; |
| 25 | 26 | |
| 26 | 27 | int m_cpua_bank; |
| 27 | 28 | int m_cpub_bank; |
| 28 | 29 | |
| 29 | | DECLARE_WRITE8_MEMBER(exzisus_cpua_bankswitch_w); |
| 30 | | DECLARE_WRITE8_MEMBER(exzisus_cpub_bankswitch_w); |
| 31 | | DECLARE_WRITE8_MEMBER(exzisus_coincounter_w); |
| 32 | | DECLARE_READ8_MEMBER(exzisus_sharedram_ab_r); |
| 33 | | DECLARE_READ8_MEMBER(exzisus_sharedram_ac_r); |
| 34 | | DECLARE_WRITE8_MEMBER(exzisus_sharedram_ab_w); |
| 35 | | DECLARE_WRITE8_MEMBER(exzisus_sharedram_ac_w); |
| 36 | | DECLARE_WRITE8_MEMBER(exzisus_cpub_reset_w); |
| 37 | | DECLARE_READ8_MEMBER(exzisus_videoram_0_r); |
| 38 | | DECLARE_READ8_MEMBER(exzisus_videoram_1_r); |
| 39 | | DECLARE_READ8_MEMBER(exzisus_objectram_0_r); |
| 40 | | DECLARE_READ8_MEMBER(exzisus_objectram_1_r); |
| 41 | | DECLARE_WRITE8_MEMBER(exzisus_videoram_0_w); |
| 42 | | DECLARE_WRITE8_MEMBER(exzisus_videoram_1_w); |
| 43 | | DECLARE_WRITE8_MEMBER(exzisus_objectram_0_w); |
| 44 | | DECLARE_WRITE8_MEMBER(exzisus_objectram_1_w); |
| 45 | | UINT32 screen_update_exzisus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 30 | DECLARE_WRITE8_MEMBER(cpua_bankswitch_w); |
| 31 | DECLARE_WRITE8_MEMBER(cpub_bankswitch_w); |
| 32 | DECLARE_WRITE8_MEMBER(coincounter_w); |
| 33 | DECLARE_WRITE8_MEMBER(cpub_reset_w); |
| 34 | |
| 35 | virtual void machine_start(); |
| 36 | |
| 37 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 46 | 38 | }; |