trunk/src/mame/machine/bonzeadv.c
| r21156 | r21157 | |
| 302 | 302 | level08 |
| 303 | 303 | }; |
| 304 | 304 | |
| 305 | | static void WriteLevelData( running_machine &machine ) |
| 305 | void asuka_state::WriteLevelData() |
| 306 | 306 | { |
| 307 | | asuka_state *state = machine.driver_data<asuka_state>(); |
| 308 | 307 | int i; |
| 309 | 308 | |
| 310 | 309 | for (i = 0; i < 13; i++) |
| 311 | 310 | { |
| 312 | | UINT16 v = CLEV[state->m_current_round][i]; |
| 311 | UINT16 v = CLEV[m_current_round][i]; |
| 313 | 312 | |
| 314 | | state->m_cval[2 * i + 0] = v & 0xff; |
| 315 | | state->m_cval[2 * i + 1] = v >> 8; |
| 313 | m_cval[2 * i + 0] = v & 0xff; |
| 314 | m_cval[2 * i + 1] = v >> 8; |
| 316 | 315 | } |
| 317 | 316 | } |
| 318 | 317 | |
| 319 | | static void WriteRestartPos( running_machine &machine, int level ) |
| 318 | void asuka_state::WriteRestartPos(int level ) |
| 320 | 319 | { |
| 321 | 320 | /* |
| 322 | 321 | Cval0/1 = scroll x position |
| r21156 | r21157 | |
| 328 | 327 | on the map, which is then given to the C-Chip in order |
| 329 | 328 | for the restart position to be returned. |
| 330 | 329 | */ |
| 330 | int x = m_cval[0] + 256 * m_cval[1] + m_cval[4] + 256 * m_cval[5]; |
| 331 | int y = m_cval[2] + 256 * m_cval[3] + m_cval[6] + 256 * m_cval[7]; |
| 331 | 332 | |
| 332 | | asuka_state *state = machine.driver_data<asuka_state>(); |
| 333 | | int x = state->m_cval[0] + 256 * state->m_cval[1] + state->m_cval[4] + 256 * state->m_cval[5]; |
| 334 | | int y = state->m_cval[2] + 256 * state->m_cval[3] + state->m_cval[6] + 256 * state->m_cval[7]; |
| 335 | | |
| 336 | 333 | const struct cchip_mapping* thisLevel = levelData[level]; |
| 337 | 334 | |
| 338 | 335 | while (thisLevel->xmin != 0xff) |
| r21156 | r21157 | |
| 340 | 337 | if (x >= thisLevel->xmin && x < thisLevel->xmax && |
| 341 | 338 | y >= thisLevel->ymin && y < thisLevel->ymax) |
| 342 | 339 | { |
| 343 | | state->m_cval[0] = thisLevel->sx & 0xff; |
| 344 | | state->m_cval[1] = thisLevel->sx >> 8; |
| 345 | | state->m_cval[2] = thisLevel->sy & 0xff; |
| 346 | | state->m_cval[3] = thisLevel->sy >> 8; |
| 347 | | state->m_cval[4] = thisLevel->px & 0xff; |
| 348 | | state->m_cval[5] = thisLevel->px >> 8; |
| 349 | | state->m_cval[6] = thisLevel->py & 0xff; |
| 350 | | state->m_cval[7] = thisLevel->py >> 8; |
| 340 | m_cval[0] = thisLevel->sx & 0xff; |
| 341 | m_cval[1] = thisLevel->sx >> 8; |
| 342 | m_cval[2] = thisLevel->sy & 0xff; |
| 343 | m_cval[3] = thisLevel->sy >> 8; |
| 344 | m_cval[4] = thisLevel->px & 0xff; |
| 345 | m_cval[5] = thisLevel->px >> 8; |
| 346 | m_cval[6] = thisLevel->py & 0xff; |
| 347 | m_cval[7] = thisLevel->py >> 8; |
| 351 | 348 | |
| 352 | 349 | // Restart position found ok |
| 353 | | state->m_restart_status = 0; |
| 350 | m_restart_status = 0; |
| 354 | 351 | |
| 355 | 352 | return; |
| 356 | 353 | } |
| r21156 | r21157 | |
| 359 | 356 | } |
| 360 | 357 | |
| 361 | 358 | // No restart position found for this position (cval0-7 confirmed unchanged in this case) |
| 362 | | state->m_restart_status = 0xff; |
| 359 | m_restart_status = 0xff; |
| 363 | 360 | } |
| 364 | 361 | |
| 365 | 362 | |
| r21156 | r21157 | |
| 369 | 366 | * |
| 370 | 367 | *************************************/ |
| 371 | 368 | |
| 372 | | WRITE16_HANDLER( bonzeadv_cchip_ctrl_w ) |
| 369 | WRITE16_MEMBER(asuka_state::bonzeadv_cchip_ctrl_w) |
| 373 | 370 | { |
| 374 | 371 | /* value 2 is written here */ |
| 375 | 372 | } |
| 376 | 373 | |
| 377 | | WRITE16_HANDLER( bonzeadv_cchip_bank_w ) |
| 374 | WRITE16_MEMBER(asuka_state::bonzeadv_cchip_bank_w) |
| 378 | 375 | { |
| 379 | | asuka_state *state = space.machine().driver_data<asuka_state>(); |
| 380 | | state->m_current_bank = data & 7; |
| 376 | m_current_bank = data & 7; |
| 381 | 377 | } |
| 382 | 378 | |
| 383 | | WRITE16_HANDLER( bonzeadv_cchip_ram_w ) |
| 379 | WRITE16_MEMBER(asuka_state::bonzeadv_cchip_ram_w) |
| 384 | 380 | { |
| 385 | | asuka_state *state = space.machine().driver_data<asuka_state>(); |
| 386 | | |
| 387 | 381 | // if (space.device().safe_pc()!=0xa028) |
| 388 | 382 | // logerror("%08x: write %04x %04x cchip\n", space.device().safe_pc(), offset, data); |
| 389 | 383 | |
| 390 | | if (state->m_current_bank == 0) |
| 384 | if (m_current_bank == 0) |
| 391 | 385 | { |
| 392 | 386 | if (offset == 0x08) |
| 393 | 387 | { |
| 394 | | state->m_cc_port = data; |
| 388 | m_cc_port = data; |
| 395 | 389 | |
| 396 | | coin_lockout_w(space.machine(), 1, data & 0x80); |
| 397 | | coin_lockout_w(space.machine(), 0, data & 0x40); |
| 398 | | coin_counter_w(space.machine(), 1, data & 0x20); |
| 399 | | coin_counter_w(space.machine(), 0, data & 0x10); |
| 390 | coin_lockout_w(machine(), 1, data & 0x80); |
| 391 | coin_lockout_w(machine(), 0, data & 0x40); |
| 392 | coin_counter_w(machine(), 1, data & 0x20); |
| 393 | coin_counter_w(machine(), 0, data & 0x10); |
| 400 | 394 | } |
| 401 | 395 | |
| 402 | 396 | if (offset == 0x0e && data != 0x00) |
| 403 | 397 | { |
| 404 | | WriteRestartPos(space.machine(), state->m_current_round); |
| 398 | WriteRestartPos(m_current_round); |
| 405 | 399 | } |
| 406 | 400 | |
| 407 | 401 | if (offset == 0x0f && data != 0x00) |
| 408 | 402 | { |
| 409 | | WriteLevelData(space.machine()); |
| 403 | WriteLevelData(); |
| 410 | 404 | } |
| 411 | 405 | |
| 412 | 406 | if (offset == 0x10) |
| 413 | 407 | { |
| 414 | | state->m_current_round = data; |
| 408 | m_current_round = data; |
| 415 | 409 | } |
| 416 | 410 | |
| 417 | 411 | if (offset >= 0x11 && offset <= 0x2a) |
| 418 | 412 | { |
| 419 | | state->m_cval[offset - 0x11] = data; |
| 413 | m_cval[offset - 0x11] = data; |
| 420 | 414 | } |
| 421 | 415 | } |
| 422 | 416 | } |
| r21156 | r21157 | |
| 427 | 421 | * |
| 428 | 422 | *************************************/ |
| 429 | 423 | |
| 430 | | READ16_HANDLER( bonzeadv_cchip_ctrl_r ) |
| 424 | READ16_MEMBER(asuka_state::bonzeadv_cchip_ctrl_r) |
| 431 | 425 | { |
| 432 | 426 | /* |
| 433 | 427 | Bit 2 = Error signal |
| r21156 | r21157 | |
| 436 | 430 | return 0x01; /* Return 0x05 for C-Chip error */ |
| 437 | 431 | } |
| 438 | 432 | |
| 439 | | READ16_HANDLER( bonzeadv_cchip_ram_r ) |
| 433 | READ16_MEMBER(asuka_state::bonzeadv_cchip_ram_r) |
| 440 | 434 | { |
| 441 | | asuka_state *state = space.machine().driver_data<asuka_state>(); |
| 442 | | |
| 443 | 435 | // logerror("%08x: read %04x cchip\n", space.device().safe_pc(), offset); |
| 444 | 436 | |
| 445 | | if (state->m_current_bank == 0) |
| 437 | if (m_current_bank == 0) |
| 446 | 438 | { |
| 447 | 439 | switch (offset) |
| 448 | 440 | { |
| 449 | | case 0x03: return state->ioport("800007")->read(); /* STARTn + SERVICE1 */ |
| 450 | | case 0x04: return state->ioport("800009")->read(); /* COINn */ |
| 451 | | case 0x05: return state->ioport("80000B")->read(); /* Player controls + TILT */ |
| 452 | | case 0x06: return state->ioport("80000D")->read(); /* Player controls (cocktail) */ |
| 453 | | case 0x08: return state->m_cc_port; |
| 441 | case 0x03: return ioport("800007")->read(); /* STARTn + SERVICE1 */ |
| 442 | case 0x04: return ioport("800009")->read(); /* COINn */ |
| 443 | case 0x05: return ioport("80000B")->read(); /* Player controls + TILT */ |
| 444 | case 0x06: return ioport("80000D")->read(); /* Player controls (cocktail) */ |
| 445 | case 0x08: return m_cc_port; |
| 454 | 446 | } |
| 455 | 447 | |
| 456 | 448 | if (offset == 0x0e) |
| 457 | 449 | { |
| 458 | | return state->m_restart_status; /* 0xff signals error, 0 signals ok */ |
| 450 | return m_restart_status; /* 0xff signals error, 0 signals ok */ |
| 459 | 451 | } |
| 460 | 452 | |
| 461 | 453 | if (offset >= 0x11 && offset <= 0x2a) |
| 462 | 454 | { |
| 463 | | return state->m_cval[offset - 0x11]; |
| 455 | return m_cval[offset - 0x11]; |
| 464 | 456 | } |
| 465 | 457 | } |
| 466 | 458 | |
trunk/src/mame/video/fastfred.c
| r21156 | r21157 | |
| 113 | 113 | * |
| 114 | 114 | *************************************/ |
| 115 | 115 | |
| 116 | | WRITE8_HANDLER( fastfred_videoram_w ) |
| 117 | | { |
| 118 | | fastfred_state *state = space.machine().driver_data<fastfred_state>(); |
| 119 | | state->m_videoram[offset] = data; |
| 120 | | state->m_bg_tilemap->mark_tile_dirty(offset); |
| 116 | WRITE8_MEMBER(fastfred_state::fastfred_videoram_w ) |
| 117 | { |
| 118 | m_videoram[offset] = data; |
| 119 | m_bg_tilemap->mark_tile_dirty(offset); |
| 121 | 120 | } |
| 122 | 121 | |
| 123 | 122 | |
| 124 | | WRITE8_HANDLER( fastfred_attributes_w ) |
| 123 | WRITE8_MEMBER(fastfred_state::fastfred_attributes_w ) |
| 125 | 124 | { |
| 126 | | fastfred_state *state = space.machine().driver_data<fastfred_state>(); |
| 127 | | if (state->m_attributesram[offset] != data) |
| 125 | if (m_attributesram[offset] != data) |
| 128 | 126 | { |
| 129 | 127 | if (offset & 0x01) |
| 130 | 128 | { |
| r21156 | r21157 | |
| 132 | 130 | int i; |
| 133 | 131 | |
| 134 | 132 | for (i = offset / 2; i < 0x0400; i += 32) |
| 135 | | state->m_bg_tilemap->mark_tile_dirty(i); |
| 133 | m_bg_tilemap->mark_tile_dirty(i); |
| 136 | 134 | } |
| 137 | 135 | else |
| 138 | 136 | { |
| 139 | 137 | /* coloumn scroll */ |
| 140 | | state->m_bg_tilemap->set_scrolly(offset / 2, data); |
| 138 | m_bg_tilemap->set_scrolly(offset / 2, data); |
| 141 | 139 | } |
| 142 | 140 | |
| 143 | | state->m_attributesram[offset] = data; |
| 141 | m_attributesram[offset] = data; |
| 144 | 142 | } |
| 145 | 143 | } |
| 146 | 144 | |
| 147 | 145 | |
| 148 | | WRITE8_HANDLER( fastfred_charbank1_w ) |
| 146 | WRITE8_MEMBER(fastfred_state::fastfred_charbank1_w ) |
| 149 | 147 | { |
| 150 | | fastfred_state *state = space.machine().driver_data<fastfred_state>(); |
| 151 | | UINT16 new_data = (state->m_charbank & 0x0200) | ((data & 0x01) << 8); |
| 148 | UINT16 new_data = (m_charbank & 0x0200) | ((data & 0x01) << 8); |
| 152 | 149 | |
| 153 | | if (new_data != state->m_charbank) |
| 150 | if (new_data != m_charbank) |
| 154 | 151 | { |
| 155 | | state->m_bg_tilemap->mark_all_dirty(); |
| 152 | m_bg_tilemap->mark_all_dirty(); |
| 156 | 153 | |
| 157 | | state->m_charbank = new_data; |
| 154 | m_charbank = new_data; |
| 158 | 155 | } |
| 159 | 156 | } |
| 160 | 157 | |
| 161 | | WRITE8_HANDLER( fastfred_charbank2_w ) |
| 158 | WRITE8_MEMBER(fastfred_state::fastfred_charbank2_w ) |
| 162 | 159 | { |
| 163 | | fastfred_state *state = space.machine().driver_data<fastfred_state>(); |
| 164 | | UINT16 new_data = (state->m_charbank & 0x0100) | ((data & 0x01) << 9); |
| 160 | UINT16 new_data = (m_charbank & 0x0100) | ((data & 0x01) << 9); |
| 165 | 161 | |
| 166 | | if (new_data != state->m_charbank) |
| 162 | if (new_data != m_charbank) |
| 167 | 163 | { |
| 168 | | state->m_bg_tilemap->mark_all_dirty(); |
| 164 | m_bg_tilemap->mark_all_dirty(); |
| 169 | 165 | |
| 170 | | state->m_charbank = new_data; |
| 166 | m_charbank = new_data; |
| 171 | 167 | } |
| 172 | 168 | } |
| 173 | 169 | |
| 174 | 170 | |
| 175 | | WRITE8_HANDLER( fastfred_colorbank1_w ) |
| 171 | WRITE8_MEMBER(fastfred_state::fastfred_colorbank1_w ) |
| 176 | 172 | { |
| 177 | | fastfred_state *state = space.machine().driver_data<fastfred_state>(); |
| 178 | | UINT8 new_data = (state->m_colorbank & 0x10) | ((data & 0x01) << 3); |
| 173 | UINT8 new_data = (m_colorbank & 0x10) | ((data & 0x01) << 3); |
| 179 | 174 | |
| 180 | | if (new_data != state->m_colorbank) |
| 175 | if (new_data != m_colorbank) |
| 181 | 176 | { |
| 182 | | state->m_bg_tilemap->mark_all_dirty(); |
| 177 | m_bg_tilemap->mark_all_dirty(); |
| 183 | 178 | |
| 184 | | state->m_colorbank = new_data; |
| 179 | m_colorbank = new_data; |
| 185 | 180 | } |
| 186 | 181 | } |
| 187 | 182 | |
| 188 | | WRITE8_HANDLER( fastfred_colorbank2_w ) |
| 183 | WRITE8_MEMBER(fastfred_state::fastfred_colorbank2_w ) |
| 189 | 184 | { |
| 190 | | fastfred_state *state = space.machine().driver_data<fastfred_state>(); |
| 191 | | UINT8 new_data = (state->m_colorbank & 0x08) | ((data & 0x01) << 4); |
| 185 | UINT8 new_data = (m_colorbank & 0x08) | ((data & 0x01) << 4); |
| 192 | 186 | |
| 193 | | if (new_data != state->m_colorbank) |
| 187 | if (new_data != m_colorbank) |
| 194 | 188 | { |
| 195 | | state->m_bg_tilemap->mark_all_dirty(); |
| 189 | m_bg_tilemap->mark_all_dirty(); |
| 196 | 190 | |
| 197 | | state->m_colorbank = new_data; |
| 191 | m_colorbank = new_data; |
| 198 | 192 | } |
| 199 | 193 | } |
| 200 | 194 | |
| 201 | 195 | |
| 202 | 196 | |
| 203 | | WRITE8_HANDLER( fastfred_flip_screen_x_w ) |
| 197 | WRITE8_MEMBER(fastfred_state::fastfred_flip_screen_x_w ) |
| 204 | 198 | { |
| 205 | | fastfred_state *state = space.machine().driver_data<fastfred_state>(); |
| 206 | | if (state->flip_screen_x() != (data & 0x01)) |
| 199 | if (flip_screen_x() != (data & 0x01)) |
| 207 | 200 | { |
| 208 | | state->flip_screen_x_set(data & 0x01); |
| 201 | flip_screen_x_set(data & 0x01); |
| 209 | 202 | |
| 210 | | state->m_bg_tilemap->set_flip((state->flip_screen_x() ? TILEMAP_FLIPX : 0) | (state->flip_screen_y() ? TILEMAP_FLIPY : 0)); |
| 203 | m_bg_tilemap->set_flip((flip_screen_x() ? TILEMAP_FLIPX : 0) | (flip_screen_y() ? TILEMAP_FLIPY : 0)); |
| 211 | 204 | } |
| 212 | 205 | } |
| 213 | 206 | |
| 214 | | WRITE8_HANDLER( fastfred_flip_screen_y_w ) |
| 207 | WRITE8_MEMBER(fastfred_state::fastfred_flip_screen_y_w ) |
| 215 | 208 | { |
| 216 | | fastfred_state *state = space.machine().driver_data<fastfred_state>(); |
| 217 | | if (state->flip_screen_y() != (data & 0x01)) |
| 209 | if (flip_screen_y() != (data & 0x01)) |
| 218 | 210 | { |
| 219 | | state->flip_screen_y_set(data & 0x01); |
| 211 | flip_screen_y_set(data & 0x01); |
| 220 | 212 | |
| 221 | | state->m_bg_tilemap->set_flip((state->flip_screen_x() ? TILEMAP_FLIPX : 0) | (state->flip_screen_y() ? TILEMAP_FLIPY : 0)); |
| 213 | m_bg_tilemap->set_flip((flip_screen_x() ? TILEMAP_FLIPX : 0) | (flip_screen_y() ? TILEMAP_FLIPY : 0)); |
| 222 | 214 | } |
| 223 | 215 | } |
| 224 | 216 | |
| r21156 | r21157 | |
| 325 | 317 | SET_TILE_INFO_MEMBER(3, tile_index & 0x1ff, 0, 0); |
| 326 | 318 | } |
| 327 | 319 | |
| 328 | | WRITE8_HANDLER( imago_fg_videoram_w ) |
| 320 | WRITE8_MEMBER(fastfred_state::imago_fg_videoram_w ) |
| 329 | 321 | { |
| 330 | | fastfred_state *state = space.machine().driver_data<fastfred_state>(); |
| 331 | | state->m_imago_fg_videoram[offset] = data; |
| 332 | | state->m_fg_tilemap->mark_tile_dirty(offset); |
| 322 | m_imago_fg_videoram[offset] = data; |
| 323 | m_fg_tilemap->mark_tile_dirty(offset); |
| 333 | 324 | } |
| 334 | 325 | |
| 335 | | WRITE8_HANDLER( imago_charbank_w ) |
| 326 | WRITE8_MEMBER(fastfred_state::imago_charbank_w ) |
| 336 | 327 | { |
| 337 | | fastfred_state *state = space.machine().driver_data<fastfred_state>(); |
| 338 | | if( state->m_charbank != data ) |
| 328 | if( m_charbank != data ) |
| 339 | 329 | { |
| 340 | | state->m_charbank = data; |
| 341 | | state->m_bg_tilemap->mark_all_dirty(); |
| 330 | m_charbank = data; |
| 331 | m_bg_tilemap->mark_all_dirty(); |
| 342 | 332 | } |
| 343 | 333 | } |
| 344 | 334 | |
trunk/src/mame/drivers/fastfred.c
| r21156 | r21157 | |
| 173 | 173 | static ADDRESS_MAP_START( fastfred_map, AS_PROGRAM, 8, fastfred_state ) |
| 174 | 174 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 175 | 175 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 176 | | AM_RANGE(0xd000, 0xd3ff) AM_MIRROR(0x400) AM_RAM_WRITE_LEGACY(fastfred_videoram_w) AM_SHARE("videoram") |
| 177 | | AM_RANGE(0xd800, 0xd83f) AM_RAM_WRITE_LEGACY(fastfred_attributes_w) AM_SHARE("attributesram") |
| 176 | AM_RANGE(0xd000, 0xd3ff) AM_MIRROR(0x400) AM_RAM_WRITE(fastfred_videoram_w) AM_SHARE("videoram") |
| 177 | AM_RANGE(0xd800, 0xd83f) AM_RAM_WRITE(fastfred_attributes_w) AM_SHARE("attributesram") |
| 178 | 178 | AM_RANGE(0xd840, 0xd85f) AM_RAM AM_SHARE("spriteram") |
| 179 | 179 | AM_RANGE(0xd860, 0xdbff) AM_RAM // Unused, but initialized |
| 180 | 180 | AM_RANGE(0xe000, 0xe000) AM_READ_PORT("BUTTONS") AM_WRITEONLY AM_SHARE("bgcolor") |
| 181 | 181 | AM_RANGE(0xe800, 0xe800) AM_READ_PORT("JOYS") |
| 182 | 182 | AM_RANGE(0xf000, 0xf000) AM_READ_PORT("DSW") AM_WRITENOP |
| 183 | 183 | AM_RANGE(0xf001, 0xf001) AM_WRITE(nmi_mask_w) |
| 184 | | AM_RANGE(0xf002, 0xf002) AM_WRITE_LEGACY(fastfred_colorbank1_w) |
| 185 | | AM_RANGE(0xf003, 0xf003) AM_WRITE_LEGACY(fastfred_colorbank2_w) |
| 186 | | AM_RANGE(0xf004, 0xf004) AM_WRITE_LEGACY(fastfred_charbank1_w) |
| 187 | | AM_RANGE(0xf005, 0xf005) AM_WRITE_LEGACY(fastfred_charbank2_w) |
| 188 | | AM_RANGE(0xf006, 0xf006) AM_WRITE_LEGACY(fastfred_flip_screen_x_w) |
| 189 | | AM_RANGE(0xf007, 0xf007) AM_WRITE_LEGACY(fastfred_flip_screen_y_w) |
| 190 | | AM_RANGE(0xf116, 0xf116) AM_WRITE_LEGACY(fastfred_flip_screen_x_w) |
| 191 | | AM_RANGE(0xf117, 0xf117) AM_WRITE_LEGACY(fastfred_flip_screen_y_w) |
| 184 | AM_RANGE(0xf002, 0xf002) AM_WRITE(fastfred_colorbank1_w) |
| 185 | AM_RANGE(0xf003, 0xf003) AM_WRITE(fastfred_colorbank2_w) |
| 186 | AM_RANGE(0xf004, 0xf004) AM_WRITE(fastfred_charbank1_w) |
| 187 | AM_RANGE(0xf005, 0xf005) AM_WRITE(fastfred_charbank2_w) |
| 188 | AM_RANGE(0xf006, 0xf006) AM_WRITE(fastfred_flip_screen_x_w) |
| 189 | AM_RANGE(0xf007, 0xf007) AM_WRITE(fastfred_flip_screen_y_w) |
| 190 | AM_RANGE(0xf116, 0xf116) AM_WRITE(fastfred_flip_screen_x_w) |
| 191 | AM_RANGE(0xf117, 0xf117) AM_WRITE(fastfred_flip_screen_y_w) |
| 192 | 192 | AM_RANGE(0xf800, 0xf800) AM_READWRITE(watchdog_reset_r, soundlatch_byte_w) |
| 193 | 193 | ADDRESS_MAP_END |
| 194 | 194 | |
| r21156 | r21157 | |
| 196 | 196 | static ADDRESS_MAP_START( jumpcoas_map, AS_PROGRAM, 8, fastfred_state ) |
| 197 | 197 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 198 | 198 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 199 | | AM_RANGE(0xd000, 0xd03f) AM_RAM_WRITE_LEGACY(fastfred_attributes_w) AM_SHARE("attributesram") |
| 199 | AM_RANGE(0xd000, 0xd03f) AM_RAM_WRITE(fastfred_attributes_w) AM_SHARE("attributesram") |
| 200 | 200 | AM_RANGE(0xd040, 0xd05f) AM_RAM AM_SHARE("spriteram") |
| 201 | 201 | AM_RANGE(0xd060, 0xd3ff) AM_RAM |
| 202 | | AM_RANGE(0xd800, 0xdbff) AM_MIRROR(0x400) AM_RAM_WRITE_LEGACY(fastfred_videoram_w) AM_SHARE("videoram") |
| 202 | AM_RANGE(0xd800, 0xdbff) AM_MIRROR(0x400) AM_RAM_WRITE(fastfred_videoram_w) AM_SHARE("videoram") |
| 203 | 203 | AM_RANGE(0xe000, 0xe000) AM_WRITEONLY AM_SHARE("bgcolor") |
| 204 | 204 | AM_RANGE(0xe800, 0xe800) AM_READ_PORT("DSW1") |
| 205 | 205 | AM_RANGE(0xe801, 0xe801) AM_READ_PORT("DSW2") |
| r21156 | r21157 | |
| 207 | 207 | AM_RANGE(0xe803, 0xe803) AM_READ_PORT("JOYS") |
| 208 | 208 | AM_RANGE(0xf000, 0xf000) AM_WRITENOP // Unused, but initialized |
| 209 | 209 | AM_RANGE(0xf001, 0xf001) AM_WRITE(nmi_mask_w) |
| 210 | | AM_RANGE(0xf002, 0xf002) AM_WRITE_LEGACY(fastfred_colorbank1_w) |
| 211 | | AM_RANGE(0xf003, 0xf003) AM_WRITE_LEGACY(fastfred_colorbank2_w) |
| 212 | | AM_RANGE(0xf004, 0xf004) AM_WRITE_LEGACY(fastfred_charbank1_w) |
| 213 | | AM_RANGE(0xf005, 0xf005) AM_WRITE_LEGACY(fastfred_charbank2_w) |
| 214 | | AM_RANGE(0xf006, 0xf006) AM_WRITE_LEGACY(fastfred_flip_screen_x_w) |
| 215 | | AM_RANGE(0xf007, 0xf007) AM_WRITE_LEGACY(fastfred_flip_screen_y_w) |
| 216 | | AM_RANGE(0xf116, 0xf116) AM_WRITE_LEGACY(fastfred_flip_screen_x_w) |
| 217 | | AM_RANGE(0xf117, 0xf117) AM_WRITE_LEGACY(fastfred_flip_screen_y_w) |
| 210 | AM_RANGE(0xf002, 0xf002) AM_WRITE(fastfred_colorbank1_w) |
| 211 | AM_RANGE(0xf003, 0xf003) AM_WRITE(fastfred_colorbank2_w) |
| 212 | AM_RANGE(0xf004, 0xf004) AM_WRITE(fastfred_charbank1_w) |
| 213 | AM_RANGE(0xf005, 0xf005) AM_WRITE(fastfred_charbank2_w) |
| 214 | AM_RANGE(0xf006, 0xf006) AM_WRITE(fastfred_flip_screen_x_w) |
| 215 | AM_RANGE(0xf007, 0xf007) AM_WRITE(fastfred_flip_screen_y_w) |
| 216 | AM_RANGE(0xf116, 0xf116) AM_WRITE(fastfred_flip_screen_x_w) |
| 217 | AM_RANGE(0xf117, 0xf117) AM_WRITE(fastfred_flip_screen_y_w) |
| 218 | 218 | //AM_RANGE(0xf800, 0xf800) AM_READ(watchdog_reset_r) // Why doesn't this work??? |
| 219 | 219 | AM_RANGE(0xf800, 0xf801) AM_READNOP AM_DEVWRITE_LEGACY("ay8910.1", ay8910_address_data_w) |
| 220 | 220 | ADDRESS_MAP_END |
| r21156 | r21157 | |
| 227 | 227 | AM_RANGE(0xb000, 0xb3ff) AM_RAM // same fg videoram (which one of the 2 is really used?) |
| 228 | 228 | AM_RANGE(0xb800, 0xbfff) AM_RAM_WRITE(imago_sprites_dma_w) |
| 229 | 229 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 230 | | AM_RANGE(0xc800, 0xcbff) AM_RAM_WRITE_LEGACY(imago_fg_videoram_w) AM_SHARE("imago_fg_vram") |
| 231 | | AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE_LEGACY(fastfred_videoram_w) AM_SHARE("videoram") |
| 232 | | AM_RANGE(0xd800, 0xd83f) AM_RAM_WRITE_LEGACY(fastfred_attributes_w) AM_SHARE("attributesram") |
| 230 | AM_RANGE(0xc800, 0xcbff) AM_RAM_WRITE(imago_fg_videoram_w) AM_SHARE("imago_fg_vram") |
| 231 | AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(fastfred_videoram_w) AM_SHARE("videoram") |
| 232 | AM_RANGE(0xd800, 0xd83f) AM_RAM_WRITE(fastfred_attributes_w) AM_SHARE("attributesram") |
| 233 | 233 | AM_RANGE(0xd840, 0xd85f) AM_RAM AM_SHARE("spriteram") |
| 234 | 234 | AM_RANGE(0xd860, 0xd8ff) AM_RAM // Unused, but initialized |
| 235 | 235 | AM_RANGE(0xe000, 0xe000) AM_READ_PORT("BUTTONS") |
| 236 | 236 | AM_RANGE(0xe800, 0xe800) AM_READ_PORT("JOYS") |
| 237 | 237 | AM_RANGE(0xf000, 0xf000) AM_READ_PORT("DSW") AM_WRITENOP // writes 1 when level starts, 0 when game over |
| 238 | 238 | AM_RANGE(0xf001, 0xf001) AM_WRITE(nmi_mask_w) |
| 239 | | AM_RANGE(0xf002, 0xf002) AM_WRITE_LEGACY(fastfred_colorbank1_w) |
| 240 | | AM_RANGE(0xf003, 0xf003) AM_WRITE_LEGACY(fastfred_colorbank2_w) |
| 239 | AM_RANGE(0xf002, 0xf002) AM_WRITE(fastfred_colorbank1_w) |
| 240 | AM_RANGE(0xf003, 0xf003) AM_WRITE(fastfred_colorbank2_w) |
| 241 | 241 | AM_RANGE(0xf004, 0xf004) AM_WRITE(imago_dma_irq_w) |
| 242 | | AM_RANGE(0xf005, 0xf005) AM_WRITE_LEGACY(imago_charbank_w) |
| 243 | | AM_RANGE(0xf006, 0xf006) AM_WRITE_LEGACY(fastfred_flip_screen_x_w) |
| 244 | | AM_RANGE(0xf007, 0xf007) AM_WRITE_LEGACY(fastfred_flip_screen_y_w) |
| 242 | AM_RANGE(0xf005, 0xf005) AM_WRITE(imago_charbank_w) |
| 243 | AM_RANGE(0xf006, 0xf006) AM_WRITE(fastfred_flip_screen_x_w) |
| 244 | AM_RANGE(0xf007, 0xf007) AM_WRITE(fastfred_flip_screen_y_w) |
| 245 | 245 | AM_RANGE(0xf400, 0xf400) AM_WRITENOP // writes 0 or 2 |
| 246 | 246 | AM_RANGE(0xf401, 0xf401) AM_WRITE(imago_sprites_bank_w) |
| 247 | 247 | AM_RANGE(0xf800, 0xf800) AM_READNOP AM_WRITE(soundlatch_byte_w) |