trunk/src/mame/drivers/system16.cpp
| r253700 | r253701 | |
| 1354 | 1354 | return 0xffff;//rand(); |
| 1355 | 1355 | } |
| 1356 | 1356 | |
| 1357 | WRITE16_MEMBER(segas1x_bootleg_state::ddcrewbl_spritebank_w) |
| 1358 | { |
| 1359 | // printf("banking write %08x: %04x (%04x %04x)\n", space.device().safe_pc(), offset*2, data&mem_mask, mem_mask); |
| 1360 | |
| 1361 | data &= mem_mask; |
| 1362 | // offset &= 0x7; |
| 1363 | offset += 4; |
| 1364 | |
| 1365 | int maxbanks = memregion("sprites")->bytes() / 0x40000; |
| 1366 | if (data >= maxbanks) |
| 1367 | data = 255; |
| 1368 | m_sprites->set_bank((offset) * 2 + 0, data * 2 + 0); |
| 1369 | m_sprites->set_bank((offset) * 2 + 1, data * 2 + 1); |
| 1370 | } |
| 1371 | |
| 1372 | |
| 1357 | 1373 | // todo: this |
| 1358 | | static ADDRESS_MAP_START( ddcrewbl_map, AS_PROGRAM, 16, segas1x_bootleg_state ) |
| 1359 | | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 1360 | | AM_RANGE(0x200000, 0x27ffff) AM_ROM |
| 1374 | static ADDRESS_MAP_START(ddcrewbl_map, AS_PROGRAM, 16, segas1x_bootleg_state) |
| 1375 | AM_RANGE(0x000000, 0x07ffff) AM_ROM // ok |
| 1376 | AM_RANGE(0x200000, 0x27ffff) AM_ROM // ok |
| 1361 | 1377 | |
| 1362 | 1378 | AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE(sys16_tileram_w) AM_SHARE("tileram") |
| 1363 | 1379 | AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE(sys16_textram_w) AM_SHARE("textram") |
| 1364 | | AM_RANGE(0x440000, 0x440fff) AM_RAM AM_SHARE("sprites") |
| 1365 | | // AM_RANGE(0xa00000, 0xa00001) AM_READ_PORT("COINAGE") |
| 1366 | | // AM_RANGE(0xa00002, 0xa00003) AM_READ_PORT("DSW1") |
| 1380 | AM_RANGE(0x440000, 0x440fff) AM_RAM AM_SHARE("sprites") // ok |
| 1367 | 1381 | |
| 1368 | | // AM_RANGE(0xa0000e, 0xa0000f) AM_WRITE(sys18_tilebank_w) |
| 1369 | | // AM_RANGE(0xa01000, 0xa01001) AM_READ_PORT("SERVICE") |
| 1370 | | // AM_RANGE(0xa01002, 0xa01003) AM_READ_PORT("P1") |
| 1371 | | // AM_RANGE(0xa01004, 0xa01005) AM_READ_PORT("P2") |
| 1372 | | // AM_RANGE(0xa01006, 0xa01007) AM_READ_PORT("P3") |
| 1382 | AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram") // ok |
| 1373 | 1383 | |
| 1374 | | AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram") |
| 1384 | AM_RANGE(0xC00000, 0xC00001) AM_WRITENOP // vdp leftovers maybe? |
| 1385 | AM_RANGE(0xC00004, 0xC00005) AM_WRITENOP |
| 1386 | AM_RANGE(0xC00006, 0xC00007) AM_WRITENOP |
| 1387 | |
| 1375 | 1388 | |
| 1376 | | AM_RANGE(0xC00000, 0xC00001) AM_WRITENOP |
| 1377 | | |
| 1378 | 1389 | AM_RANGE(0xC40000, 0xC40001) AM_READ(ddcrew_c41006_r) |
| 1379 | 1390 | AM_RANGE(0xC40002, 0xC40003) AM_READ(ddcrew_c41006_r) |
| 1380 | | |
| 1381 | | |
| 1382 | 1391 | AM_RANGE(0xC41000, 0xC41001) AM_READ(ddcrew_c41006_r) |
| 1392 | AM_RANGE(0xC41002, 0xC41003) AM_READ(ddcrew_c41006_r) |
| 1393 | AM_RANGE(0xC41004, 0xC41005) AM_READ(ddcrew_c41006_r) |
| 1383 | 1394 | AM_RANGE(0xC41006, 0xC41007) AM_READ(ddcrew_c41006_r) |
| 1384 | 1395 | |
| 1396 | |
| 1397 | |
| 1398 | AM_RANGE(0xC44000, 0xC44001) AM_WRITENOP |
| 1399 | |
| 1385 | 1400 | AM_RANGE(0xc46600, 0xc46601) AM_WRITE(sys18_refreshenable_w) |
| 1386 | | AM_RANGE(0xffc000, 0xffffff) AM_RAM |
| 1401 | |
| 1402 | AM_RANGE(0xC46038, 0xC4603f) AM_WRITE(ddcrewbl_spritebank_w) // ok |
| 1403 | |
| 1404 | AM_RANGE(0xC46000, 0xC46001) AM_WRITENOP |
| 1405 | AM_RANGE(0xC46010, 0xC46011) AM_WRITENOP |
| 1406 | AM_RANGE(0xC46020, 0xC46021) AM_WRITENOP |
| 1407 | |
| 1408 | AM_RANGE(0xC46040, 0xC46041) AM_WRITENOP |
| 1409 | AM_RANGE(0xC46050, 0xC46051) AM_WRITENOP |
| 1410 | |
| 1411 | AM_RANGE(0xC46060, 0xC46061) AM_WRITENOP |
| 1412 | AM_RANGE(0xC46062, 0xC46063) AM_WRITENOP |
| 1413 | AM_RANGE(0xC46064, 0xC46065) AM_WRITENOP |
| 1414 | |
| 1415 | AM_RANGE(0xC46070, 0xC46071) AM_WRITENOP |
| 1416 | |
| 1417 | AM_RANGE(0xffc000, 0xffffff) AM_RAM // ok |
| 1387 | 1418 | ADDRESS_MAP_END |
| 1388 | 1419 | |
| 1389 | 1420 | /************************************* |
| r253700 | r253701 | |
| 2472 | 2503 | MACHINE_CONFIG_END |
| 2473 | 2504 | |
| 2474 | 2505 | |
| 2506 | MACHINE_RESET_MEMBER(segas1x_bootleg_state,ddcrewbl) |
| 2507 | { |
| 2508 | // set up the initial banks for this game |
| 2509 | // because it doesn't appear to actually program banks 0-3. |
| 2510 | for (int i = 0; i < 4; i++) |
| 2511 | { |
| 2512 | m_sprites->set_bank((i)* 2 + 0, i * 2 + 0); |
| 2513 | m_sprites->set_bank((i)* 2 + 1, i * 2 + 1); |
| 2514 | } |
| 2515 | } |
| 2516 | |
| 2517 | |
| 2475 | 2518 | static MACHINE_CONFIG_START( ddcrewbl, segas1x_bootleg_state ) |
| 2476 | 2519 | |
| 2477 | 2520 | /* basic machine hardware */ |
| r253700 | r253701 | |
| 2494 | 2537 | MCFG_VIDEO_START_OVERRIDE(segas1x_bootleg_state,system18old) |
| 2495 | 2538 | |
| 2496 | 2539 | MCFG_BOOTLEG_SYS16B_SPRITES_ADD("sprites") |
| 2497 | | MCFG_BOOTLEG_SYS16B_SPRITES_XORIGIN(189-107) |
| 2540 | MCFG_BOOTLEG_SYS16B_SPRITES_XORIGIN(189-124) |
| 2498 | 2541 | |
| 2542 | MCFG_MACHINE_RESET_OVERRIDE(segas1x_bootleg_state,ddcrewbl) |
| 2543 | |
| 2499 | 2544 | MACHINE_CONFIG_END |
| 2500 | 2545 | |
| 2501 | 2546 | |
| r253700 | r253701 | |
| 3740 | 3785 | DRIVER_INIT_MEMBER(segas1x_bootleg_state,ddcrewbl) |
| 3741 | 3786 | { |
| 3742 | 3787 | DRIVER_INIT_CALL(common); |
| 3743 | | m_spritebank_type = 0; |
| 3744 | 3788 | } |
| 3745 | 3789 | |
| 3746 | 3790 | |
trunk/src/mame/video/system16.cpp
| r253700 | r253701 | |
| 34 | 34 | |
| 35 | 35 | void segas1x_bootleg_state::setup_system16_bootleg_spritebanking( ) |
| 36 | 36 | { |
| 37 | | if (m_spritebank_type == 1) |
| 37 | if (m_spritebank_type == 0) |
| 38 | 38 | { |
| 39 | | static const UINT8 default_banklist[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; |
| 40 | | int i; |
| 41 | | for (i = 0; i < 16; i++) |
| 42 | | m_sprites->set_bank(i, default_banklist[i]); |
| 43 | | } |
| 44 | | else |
| 45 | | { |
| 46 | 39 | static const UINT8 alternate_banklist[] = { 0,255,255,255, 255,255,255,3, 255,255,255,2, 255,1,0,255 }; |
| 47 | 40 | int i; |
| 48 | 41 | for (i = 0; i < 16; i++) |