src/mame/video/segaic16.c
| r7972 | r7973 | |
| 366 | 366 | |
| 367 | 367 | |
| 368 | 368 | |
| 369 | | /************************************* |
| 370 | | * |
| 371 | | * Type definitions |
| 372 | | * |
| 373 | | *************************************/ |
| 374 | 369 | |
| 375 | | struct palette_info |
| 376 | | { |
| 377 | | INT32 entries; /* number of entries (not counting shadows) */ |
| 378 | | UINT8 normal[32]; /* RGB translations for normal pixels */ |
| 379 | | UINT8 shadow[32]; /* RGB translations for shadowed pixels */ |
| 380 | | UINT8 hilight[32]; /* RGB translations for hilighted pixels */ |
| 381 | | }; |
| 382 | 370 | |
| 383 | 371 | |
| 384 | | struct tilemap_callback_info |
| 385 | | { |
| 386 | | UINT16 * rambase; /* base of RAM for this tilemap page */ |
| 387 | | const UINT8 * bank; /* pointer to bank array */ |
| 388 | | UINT16 banksize; /* size of banks */ |
| 389 | | }; |
| 390 | | |
| 391 | | |
| 392 | | struct tilemap_info |
| 393 | | { |
| 394 | | UINT8 index; /* index of this structure */ |
| 395 | | UINT8 type; /* type of tilemap (see segaic16.h for details) */ |
| 396 | | UINT8 numpages; /* number of allocated pages */ |
| 397 | | UINT8 flip; /* screen flip? */ |
| 398 | | UINT8 rowscroll, colscroll; /* are rowscroll/colscroll enabled (if external enables are used) */ |
| 399 | | UINT8 bank[8]; /* indexes of the tile banks */ |
| 400 | | UINT16 banksize; /* number of tiles per bank */ |
| 401 | | UINT16 latched_xscroll[4]; /* latched X scroll values */ |
| 402 | | UINT16 latched_yscroll[4]; /* latched Y scroll values */ |
| 403 | | UINT16 latched_pageselect[4]; /* latched page select values */ |
| 404 | | INT32 xoffs; /* X scroll offset */ |
| 405 | | tilemap_t * tilemaps[16]; /* up to 16 tilemap pages */ |
| 406 | | tilemap_t * textmap; /* a single text tilemap */ |
| 407 | | struct tilemap_callback_info tmap_info[16]; /* callback info for 16 tilemap pages */ |
| 408 | | struct tilemap_callback_info textmap_info; /* callback info for a single textmap page */ |
| 409 | | void (*reset)(running_machine *machine, struct tilemap_info *info);/* reset callback */ |
| 410 | | void (*draw_layer)(running_machine *machine, struct tilemap_info *info, bitmap_t *bitmap, const rectangle *cliprect, int which, int flags, int priority); |
| 411 | | UINT16 * textram; /* pointer to textram pointer */ |
| 412 | | UINT16 * tileram; /* pointer to tileram pointer */ |
| 413 | | }; |
| 414 | | |
| 415 | | |
| 416 | | struct sprite_info |
| 417 | | { |
| 418 | | UINT8 index; /* index of this structure */ |
| 419 | | UINT8 type; /* type of sprite system (see segaic16.h for details) */ |
| 420 | | UINT8 flip; /* screen flip? */ |
| 421 | | UINT8 shadow; /* shadow or hilight? */ |
| 422 | | UINT8 bank[16]; /* banking redirection */ |
| 423 | | UINT16 colorbase; /* base color index */ |
| 424 | | INT32 ramsize; /* size of sprite RAM */ |
| 425 | | INT32 xoffs; /* X scroll offset */ |
| 426 | | void (*draw)(running_machine *machine, struct sprite_info *info, bitmap_t *bitmap, const rectangle *cliprect); |
| 427 | | UINT16 * spriteram; /* pointer to spriteram pointer */ |
| 428 | | UINT16 * buffer; /* buffered spriteram for those that use it */ |
| 429 | | }; |
| 430 | | |
| 431 | | |
| 432 | | struct road_info |
| 433 | | { |
| 434 | | UINT8 index; /* index of this structure */ |
| 435 | | UINT8 type; /* type of road system (see segaic16.h for details) */ |
| 436 | | UINT8 control; /* control register value */ |
| 437 | | UINT16 colorbase1; /* color base for road ROM data */ |
| 438 | | UINT16 colorbase2; /* color base for road background data */ |
| 439 | | UINT16 colorbase3; /* color base for sky data */ |
| 440 | | INT32 xoffs; /* X scroll offset */ |
| 441 | | void (*draw)(struct road_info *info, bitmap_t *bitmap, const rectangle *cliprect, int priority); |
| 442 | | UINT16 * roadram; /* pointer to roadram pointer */ |
| 443 | | UINT16 * buffer; /* buffered roadram pointer */ |
| 444 | | UINT8 * gfx; /* expanded road graphics */ |
| 445 | | }; |
| 446 | | |
| 447 | | |
| 448 | | struct rotate_info |
| 449 | | { |
| 450 | | UINT8 index; /* index of this structure */ |
| 451 | | UINT8 type; /* type of rotate system (see segaic16.h for details) */ |
| 452 | | UINT16 colorbase; /* base color index */ |
| 453 | | INT32 ramsize; /* size of rotate RAM */ |
| 454 | | UINT16 * rotateram; /* pointer to rotateram pointer */ |
| 455 | | UINT16 * buffer; /* buffered data */ |
| 456 | | }; |
| 457 | | |
| 458 | | |
| 459 | | |
| 460 | 372 | /************************************* |
| 461 | 373 | * |
| 462 | 374 | * Globals |
| r7972 | r7973 | |
| 466 | 378 | UINT8 segaic16_display_enable; |
| 467 | 379 | UINT16 *segaic16_tileram_0; |
| 468 | 380 | UINT16 *segaic16_textram_0; |
| 469 | | UINT16 *segaic16_spriteram_0; |
| 470 | | UINT16 *segaic16_spriteram_1; |
| 471 | 381 | UINT16 *segaic16_roadram_0; |
| 472 | 382 | UINT16 *segaic16_rotateram_0; |
| 473 | 383 | UINT16 *segaic16_paletteram; |
| r7972 | r7973 | |
| 480 | 390 | * |
| 481 | 391 | *************************************/ |
| 482 | 392 | |
| 483 | | static struct palette_info palette; |
| 484 | | static struct tilemap_info bg_tilemap[SEGAIC16_MAX_TILEMAPS]; |
| 485 | | static struct sprite_info sprites[SEGAIC16_MAX_SPRITES]; |
| 486 | | static struct road_info road[SEGAIC16_MAX_ROADS]; |
| 487 | | static struct rotate_info rotate[SEGAIC16_MAX_ROTATE]; |
| 393 | struct palette_info palette; |
| 394 | struct rotate_info rotate[SEGAIC16_MAX_ROTATE]; |
| 395 | struct tilemap_info bg_tilemap[SEGAIC16_MAX_TILEMAPS]; |
| 396 | struct road_info road[SEGAIC16_MAX_ROADS]; |
| 488 | 397 | |
| 489 | 398 | |
| 399 | |
| 490 | 400 | /************************************* |
| 491 | 401 | * |
| 492 | 402 | * Misc functions |
| r7972 | r7973 | |
| 1452 | 1362 | |
| 1453 | 1363 | |
| 1454 | 1364 | |
| 1455 | | /******************************************************************************************* |
| 1456 | | * |
| 1457 | | * Hang On-style sprites |
| 1458 | | * |
| 1459 | | * Offs Bits Usage |
| 1460 | | * +0 bbbbbbbb -------- Bottom scanline of sprite - 1 |
| 1461 | | * +0 -------- tttttttt Top scanline of sprite - 1 |
| 1462 | | * +2 bbbb---- -------- Sprite bank |
| 1463 | | * +2 -------x xxxxxxxx X position of sprite (position $BD is screen position 0) |
| 1464 | | * +4 pppppppp pppppppp Signed 16-bit pitch value between scanlines |
| 1465 | | * +6 -ooooooo oooooooo Offset within selected sprite bank |
| 1466 | | * +6 f------- -------- Horizontal flip: read the data backwards if set |
| 1467 | | * +8 --cccccc -------- Sprite color palette |
| 1468 | | * +8 -------- zzzzzz-- Zoom factor |
| 1469 | | * +8 -------- ------pp Sprite priority |
| 1470 | | * +E dddddddd dddddddd Scratch space for current address |
| 1471 | | * |
| 1472 | | * Special notes: |
| 1473 | | * |
| 1474 | | * There is an interaction between the horizonal flip bit and the offset. |
| 1475 | | * The offset is maintained as a 16-bit value, even though only the lower |
| 1476 | | * 15 bits are used for the address. The top bit is used to control flipping. |
| 1477 | | * This means that if the low 15 bits overflow during rendering, the sprite |
| 1478 | | * data will be read backwards after the overflow. This is important to |
| 1479 | | * emulate correctly as many games make use of this feature to render sprites |
| 1480 | | * at the beginning of a bank. |
| 1481 | | * |
| 1482 | | *******************************************************************************************/ |
| 1483 | 1365 | |
| 1484 | | #define hangon_draw_pixel() \ |
| 1485 | | /* only draw if onscreen, not 0 or 15 */ \ |
| 1486 | | if (pix != 0 && pix != 15) \ |
| 1487 | | { \ |
| 1488 | | /* are we high enough priority to be visible? */ \ |
| 1489 | | if (sprpri > pri[x]) \ |
| 1490 | | { \ |
| 1491 | | /* shadow/hilight mode? */ \ |
| 1492 | | if (color == info->colorbase + (0x3f << 4)) \ |
| 1493 | | dest[x] += info->shadow ? palette.entries*2 : palette.entries; \ |
| 1494 | | \ |
| 1495 | | /* regular draw */ \ |
| 1496 | | else \ |
| 1497 | | dest[x] = pix | color; \ |
| 1498 | | } \ |
| 1499 | | \ |
| 1500 | | /* always mark priority so no one else draws here */ \ |
| 1501 | | pri[x] = 0xff; \ |
| 1502 | | } \ |
| 1503 | 1366 | |
| 1504 | | static void segaic16_sprites_hangon_draw(running_machine *machine, struct sprite_info *info, bitmap_t *bitmap, const rectangle *cliprect) |
| 1505 | | { |
| 1506 | | UINT8 numbanks = memory_region_length(machine, "gfx2") / 0x10000; |
| 1507 | | const UINT16 *spritebase = (const UINT16 *)memory_region(machine, "gfx2"); |
| 1508 | | const UINT8 *zoom = (const UINT8 *)memory_region(machine, "proms"); |
| 1509 | | UINT16 *data; |
| 1510 | | |
| 1511 | | /* first scan forward to find the end of the list */ |
| 1512 | | for (data = info->spriteram; data < info->spriteram + info->ramsize/2; data += 8) |
| 1513 | | if ((data[0] >> 8) > 0xf0) |
| 1514 | | break; |
| 1515 | | |
| 1516 | | /* now scan backwards and render the sprites in order */ |
| 1517 | | for (data -= 8; data >= info->spriteram; data -= 8) |
| 1518 | | { |
| 1519 | | int bottom = (data[0] >> 8) + 1; |
| 1520 | | int top = (data[0] & 0xff) + 1; |
| 1521 | | int bank = info->bank[(data[1] >> 12) & 0xf]; |
| 1522 | | int xpos = (data[1] & 0x1ff) - 0xbd; |
| 1523 | | int pitch = (INT16)data[2]; |
| 1524 | | UINT16 addr = data[3]; |
| 1525 | | int color = info->colorbase + (((data[4] >> 8) & 0x3f) << 4); |
| 1526 | | int vzoom = (data[4] >> 2) & 0x3f; |
| 1527 | | int hzoom = vzoom << 1; |
| 1528 | | int sprpri = 1 << ((data[4] >> 0) & 0x3); |
| 1529 | | int x, y, pix, zaddr, zmask; |
| 1530 | | const UINT16 *spritedata; |
| 1531 | | |
| 1532 | | /* initialize the end address to the start address */ |
| 1533 | | data[7] = addr; |
| 1534 | | |
| 1535 | | /* if hidden, or top greater than/equal to bottom, or invalid bank, punt */ |
| 1536 | | if ((top >= bottom) || bank == 255) |
| 1537 | | continue; |
| 1538 | | |
| 1539 | | /* clamp to within the memory region size */ |
| 1540 | | if (numbanks) |
| 1541 | | bank %= numbanks; |
| 1542 | | spritedata = spritebase + 0x8000 * bank; |
| 1543 | | |
| 1544 | | /* determine the starting zoom address and mask */ |
| 1545 | | zaddr = (vzoom & 0x38) << 5; |
| 1546 | | zmask = 1 << (vzoom & 7); |
| 1547 | | |
| 1548 | | /* loop from top to bottom */ |
| 1549 | | for (y = top; y < bottom; y++) |
| 1550 | | { |
| 1551 | | /* advance a row */ |
| 1552 | | addr += pitch; |
| 1553 | | |
| 1554 | | /* if the zoom bit says so, add pitch a second time */ |
| 1555 | | if (zoom[zaddr++] & zmask) |
| 1556 | | addr += pitch; |
| 1557 | | |
| 1558 | | /* skip drawing if not within the cliprect */ |
| 1559 | | if (y >= cliprect->min_y && y <= cliprect->max_y) |
| 1560 | | { |
| 1561 | | UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0); |
| 1562 | | UINT8 *pri = BITMAP_ADDR8(machine->priority_bitmap, y, 0); |
| 1563 | | int xacc = 0x00; |
| 1564 | | |
| 1565 | | /* note that the System 16A sprites have a design flaw that allows the address */ |
| 1566 | | /* to carry into the flip flag, which is the topmost bit -- it is very important */ |
| 1567 | | /* to emulate this as the games compensate for it */ |
| 1568 | | |
| 1569 | | /* non-flipped case */ |
| 1570 | | if (!(addr & 0x8000)) |
| 1571 | | { |
| 1572 | | /* start at the word before because we preincrement below */ |
| 1573 | | data[7] = addr - 1; |
| 1574 | | for (x = xpos; x <= cliprect->max_x; ) |
| 1575 | | { |
| 1576 | | UINT16 pixels = spritedata[++data[7] & 0x7fff]; |
| 1577 | | |
| 1578 | | /* draw four pixels */ |
| 1579 | | pix = (pixels >> 12) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) hangon_draw_pixel(); x++; } |
| 1580 | | pix = (pixels >> 8) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) hangon_draw_pixel(); x++; } |
| 1581 | | pix = (pixels >> 4) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) hangon_draw_pixel(); x++; } |
| 1582 | | pix = (pixels >> 0) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) hangon_draw_pixel(); x++; } |
| 1583 | | |
| 1584 | | /* stop if the last pixel in the group was 0xf */ |
| 1585 | | if (pix == 15) |
| 1586 | | break; |
| 1587 | | } |
| 1588 | | } |
| 1589 | | |
| 1590 | | /* flipped case */ |
| 1591 | | else |
| 1592 | | { |
| 1593 | | /* start at the word after because we predecrement below */ |
| 1594 | | data[7] = addr + 1; |
| 1595 | | for (x = xpos; x <= cliprect->max_x; ) |
| 1596 | | { |
| 1597 | | UINT16 pixels = spritedata[--data[7] & 0x7fff]; |
| 1598 | | |
| 1599 | | /* draw four pixels */ |
| 1600 | | pix = (pixels >> 0) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) hangon_draw_pixel(); x++; } |
| 1601 | | pix = (pixels >> 4) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) hangon_draw_pixel(); x++; } |
| 1602 | | pix = (pixels >> 8) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) hangon_draw_pixel(); x++; } |
| 1603 | | pix = (pixels >> 12) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) hangon_draw_pixel(); x++; } |
| 1604 | | |
| 1605 | | /* stop if the last pixel in the group was 0xf */ |
| 1606 | | if (pix == 15) |
| 1607 | | break; |
| 1608 | | } |
| 1609 | | } |
| 1610 | | } |
| 1611 | | } |
| 1612 | | } |
| 1613 | | } |
| 1614 | | |
| 1615 | | |
| 1616 | | |
| 1617 | 1367 | /******************************************************************************************* |
| 1618 | 1368 | * |
| 1619 | | * Space Harrier-style sprites |
| 1620 | | * |
| 1621 | | * Offs Bits Usage |
| 1622 | | * +0 bbbbbbbb -------- Bottom scanline of sprite - 1 |
| 1623 | | * +0 -------- tttttttt Top scanline of sprite - 1 |
| 1624 | | * +2 bbbb---- -------- Sprite bank |
| 1625 | | * +2 -------x xxxxxxxx X position of sprite (position $BD is screen position 0) |
| 1626 | | * +4 s------- -------- Sprite shadow enable (0=enable, 1=disable) |
| 1627 | | * +4 -p------ -------- Sprite priority |
| 1628 | | * +4 --cccccc -------- Sprite color palette |
| 1629 | | * +4 -------- -ppppppp Signed 7-bit pitch value between scanlines |
| 1630 | | * +6 f------- -------- Horizontal flip: read the data backwards if set |
| 1631 | | * +6 -ooooooo oooooooo Offset within selected sprite bank |
| 1632 | | * +8 --zzzzzz -------- Horizontal zoom factor |
| 1633 | | * +8 -------- --zzzzzz Vertical zoom factor |
| 1634 | | * +E dddddddd dddddddd Scratch space for current address |
| 1635 | | * |
| 1636 | | * Special notes: |
| 1637 | | * |
| 1638 | | * There is an interaction between the horizonal flip bit and the offset. |
| 1639 | | * The offset is maintained as a 16-bit value, even though only the lower |
| 1640 | | * 15 bits are used for the address. The top bit is used to control flipping. |
| 1641 | | * This means that if the low 15 bits overflow during rendering, the sprite |
| 1642 | | * data will be read backwards after the overflow. This is important to |
| 1643 | | * emulate correctly as many games make use of this feature to render sprites |
| 1644 | | * at the beginning of a bank. |
| 1645 | | * |
| 1646 | | *******************************************************************************************/ |
| 1647 | | |
| 1648 | | #define sharrier_draw_pixel() \ |
| 1649 | | /* only draw if onscreen, not 0 or 15 */ \ |
| 1650 | | if (pix != 0 && pix != 15) \ |
| 1651 | | { \ |
| 1652 | | /* are we high enough priority to be visible? */ \ |
| 1653 | | if (sprpri > pri[x]) \ |
| 1654 | | { \ |
| 1655 | | /* shadow/hilight mode? */ \ |
| 1656 | | if (shadow && pix == 0xa) \ |
| 1657 | | dest[x] += (segaic16_paletteram[dest[x]] & 0x8000) ? palette.entries*2 : palette.entries; \ |
| 1658 | | \ |
| 1659 | | /* regular draw */ \ |
| 1660 | | else \ |
| 1661 | | dest[x] = pix | color; \ |
| 1662 | | } \ |
| 1663 | | \ |
| 1664 | | /* always mark priority so no one else draws here */ \ |
| 1665 | | pri[x] = 0xff; \ |
| 1666 | | } \ |
| 1667 | | |
| 1668 | | static void segaic16_sprites_sharrier_draw(running_machine *machine, struct sprite_info *info, bitmap_t *bitmap, const rectangle *cliprect) |
| 1669 | | { |
| 1670 | | UINT8 numbanks = memory_region_length(machine, "gfx2") / 0x20000; |
| 1671 | | const UINT32 *spritebase = (const UINT32 *)memory_region(machine, "gfx2"); |
| 1672 | | const UINT8 *zoom = (const UINT8 *)memory_region(machine, "proms"); |
| 1673 | | UINT16 *data; |
| 1674 | | |
| 1675 | | /* first scan forward to find the end of the list */ |
| 1676 | | for (data = info->spriteram; data < info->spriteram + info->ramsize/2; data += 8) |
| 1677 | | if ((data[0] >> 8) > 0xf0) |
| 1678 | | break; |
| 1679 | | |
| 1680 | | /* now scan backwards and render the sprites in order */ |
| 1681 | | for (data -= 8; data >= info->spriteram; data -= 8) |
| 1682 | | { |
| 1683 | | int bottom = (data[0] >> 8) + 1; |
| 1684 | | int top = (data[0] & 0xff) + 1; |
| 1685 | | int bank = info->bank[(data[1] >> 12) & 0x7]; |
| 1686 | | int xpos = (data[1] & 0x1ff) - 0xbd; |
| 1687 | | int shadow = (~data[2] >> 15) & 1; |
| 1688 | | int sprpri = ((data[2] >> 14) & 1) ? (1<<3) : (1<<1); |
| 1689 | | int color = info->colorbase + (((data[2] >> 8) & 0x3f) << 4); |
| 1690 | | int pitch = (INT16)(data[2] << 9) >> 9; |
| 1691 | | UINT16 addr = data[3]; |
| 1692 | | int hzoom = ((data[4] >> 8) & 0x3f) << 1; |
| 1693 | | int vzoom = (data[4] >> 0) & 0x3f; |
| 1694 | | int x, y, pix, zaddr, zmask; |
| 1695 | | const UINT32 *spritedata; |
| 1696 | | |
| 1697 | | /* initialize the end address to the start address */ |
| 1698 | | data[7] = addr; |
| 1699 | | |
| 1700 | | /* if hidden, or top greater than/equal to bottom, or invalid bank, punt */ |
| 1701 | | if ((top >= bottom) || bank == 255) |
| 1702 | | continue; |
| 1703 | | |
| 1704 | | /* clamp to within the memory region size */ |
| 1705 | | if (numbanks) |
| 1706 | | bank %= numbanks; |
| 1707 | | spritedata = spritebase + 0x8000 * bank; |
| 1708 | | |
| 1709 | | /* determine the starting zoom address and mask */ |
| 1710 | | zaddr = (vzoom & 0x38) << 5; |
| 1711 | | zmask = 1 << (vzoom & 7); |
| 1712 | | |
| 1713 | | /* loop from top to bottom */ |
| 1714 | | for (y = top; y < bottom; y++) |
| 1715 | | { |
| 1716 | | /* advance a row */ |
| 1717 | | addr += pitch; |
| 1718 | | |
| 1719 | | /* if the zoom bit says so, add pitch a second time */ |
| 1720 | | if (zoom[zaddr++] & zmask) |
| 1721 | | addr += pitch; |
| 1722 | | |
| 1723 | | /* skip drawing if not within the cliprect */ |
| 1724 | | if (y >= cliprect->min_y && y <= cliprect->max_y) |
| 1725 | | { |
| 1726 | | UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0); |
| 1727 | | UINT8 *pri = BITMAP_ADDR8(machine->priority_bitmap, y, 0); |
| 1728 | | int xacc = 0x00; |
| 1729 | | |
| 1730 | | /* note that the System 16A sprites have a design flaw that allows the address */ |
| 1731 | | /* to carry into the flip flag, which is the topmost bit -- it is very important */ |
| 1732 | | /* to emulate this as the games compensate for it */ |
| 1733 | | |
| 1734 | | /* non-flipped case */ |
| 1735 | | if (!(addr & 0x8000)) |
| 1736 | | { |
| 1737 | | /* start at the word before because we preincrement below */ |
| 1738 | | data[7] = addr - 1; |
| 1739 | | for (x = xpos; x <= cliprect->max_x; ) |
| 1740 | | { |
| 1741 | | UINT32 pixels = spritedata[++data[7] & 0x7fff]; |
| 1742 | | |
| 1743 | | /* draw 8 pixels */ |
| 1744 | | pix = (pixels >> 28) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; } |
| 1745 | | pix = (pixels >> 24) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; } |
| 1746 | | pix = (pixels >> 20) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; } |
| 1747 | | pix = (pixels >> 16) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; } |
| 1748 | | pix = (pixels >> 12) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; } |
| 1749 | | pix = (pixels >> 8) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; } |
| 1750 | | pix = (pixels >> 4) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; } |
| 1751 | | pix = (pixels >> 0) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; } |
| 1752 | | |
| 1753 | | /* stop if the last pixel in the group was 0xf */ |
| 1754 | | if (pix == 15) |
| 1755 | | break; |
| 1756 | | } |
| 1757 | | } |
| 1758 | | |
| 1759 | | /* flipped case */ |
| 1760 | | else |
| 1761 | | { |
| 1762 | | /* start at the word after because we predecrement below */ |
| 1763 | | data[7] = addr + 1; |
| 1764 | | for (x = xpos; x <= cliprect->max_x; ) |
| 1765 | | { |
| 1766 | | UINT32 pixels = spritedata[--data[7] & 0x7fff]; |
| 1767 | | |
| 1768 | | /* draw 8 pixels */ |
| 1769 | | pix = (pixels >> 0) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; } |
| 1770 | | pix = (pixels >> 4) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; } |
| 1771 | | pix = (pixels >> 8) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; } |
| 1772 | | pix = (pixels >> 12) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; } |
| 1773 | | pix = (pixels >> 16) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; } |
| 1774 | | pix = (pixels >> 20) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; } |
| 1775 | | pix = (pixels >> 24) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; } |
| 1776 | | pix = (pixels >> 28) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; } |
| 1777 | | |
| 1778 | | /* stop if the last pixel in the group was 0xf */ |
| 1779 | | if (pix == 15) |
| 1780 | | break; |
| 1781 | | } |
| 1782 | | } |
| 1783 | | } |
| 1784 | | } |
| 1785 | | } |
| 1786 | | } |
| 1787 | | |
| 1788 | | |
| 1789 | | |
| 1790 | | /******************************************************************************************* |
| 1791 | | * |
| 1792 | | * System 16A-style sprites |
| 1793 | | * |
| 1794 | | * Offs Bits Usage |
| 1795 | | * +0 bbbbbbbb -------- Bottom scanline of sprite - 1 |
| 1796 | | * +0 -------- tttttttt Top scanline of sprite - 1 |
| 1797 | | * +2 -------x xxxxxxxx X position of sprite (position $BD is screen position 0) |
| 1798 | | * +4 pppppppp pppppppp Signed 16-bit pitch value between scanlines |
| 1799 | | * +6 -ooooooo oooooooo Offset within selected sprite bank |
| 1800 | | * +6 f------- -------- Horizontal flip: read the data backwards if set |
| 1801 | | * +8 --cccccc -------- Sprite color palette |
| 1802 | | * +8 -------- -bbb---- Sprite bank |
| 1803 | | * +8 -------- ------pp Sprite priority |
| 1804 | | * +E dddddddd dddddddd Scratch space for current address |
| 1805 | | * |
| 1806 | | * Special notes: |
| 1807 | | * |
| 1808 | | * There is an interaction between the horizonal flip bit and the offset. |
| 1809 | | * The offset is maintained as a 16-bit value, even though only the lower |
| 1810 | | * 15 bits are used for the address. The top bit is used to control flipping. |
| 1811 | | * This means that if the low 15 bits overflow during rendering, the sprite |
| 1812 | | * data will be read backwards after the overflow. This is important to |
| 1813 | | * emulate correctly as many games make use of this feature to render sprites |
| 1814 | | * at the beginning of a bank. |
| 1815 | | * |
| 1816 | | *******************************************************************************************/ |
| 1817 | | |
| 1818 | | #define system16a_draw_pixel() \ |
| 1819 | | /* only draw if onscreen, not 0 or 15 */ \ |
| 1820 | | if (x >= cliprect->min_x && x <= cliprect->max_x && pix != 0 && pix != 15) \ |
| 1821 | | { \ |
| 1822 | | /* are we high enough priority to be visible? */ \ |
| 1823 | | if (sprpri > pri[x]) \ |
| 1824 | | { \ |
| 1825 | | /* shadow/hilight mode? */ \ |
| 1826 | | if (color == info->colorbase + (0x3f << 4)) \ |
| 1827 | | dest[x] += (segaic16_paletteram[dest[x]] & 0x8000) ? palette.entries*2 : palette.entries; \ |
| 1828 | | \ |
| 1829 | | /* regular draw */ \ |
| 1830 | | else \ |
| 1831 | | dest[x] = pix | color; \ |
| 1832 | | } \ |
| 1833 | | \ |
| 1834 | | /* always mark priority so no one else draws here */ \ |
| 1835 | | pri[x] = 0xff; \ |
| 1836 | | } \ |
| 1837 | | |
| 1838 | | static void segaic16_sprites_16a_draw(running_machine *machine, struct sprite_info *info, bitmap_t *bitmap, const rectangle *cliprect) |
| 1839 | | { |
| 1840 | | UINT8 numbanks = memory_region_length(machine, "gfx2") / 0x10000; |
| 1841 | | const UINT16 *spritebase = (const UINT16 *)memory_region(machine, "gfx2"); |
| 1842 | | UINT16 *data; |
| 1843 | | |
| 1844 | | /* first scan forward to find the end of the list */ |
| 1845 | | for (data = info->spriteram; data < info->spriteram + info->ramsize/2; data += 8) |
| 1846 | | if ((data[0] >> 8) > 0xf0) |
| 1847 | | break; |
| 1848 | | |
| 1849 | | /* now scan backwards and render the sprites in order */ |
| 1850 | | for (data -= 8; data >= info->spriteram; data -= 8) |
| 1851 | | { |
| 1852 | | int bottom = (data[0] >> 8) + 1; |
| 1853 | | int top = (data[0] & 0xff) + 1; |
| 1854 | | int xpos = (data[1] & 0x1ff) - 0xbd; |
| 1855 | | int pitch = (INT16)data[2]; |
| 1856 | | UINT16 addr = data[3]; |
| 1857 | | int color = info->colorbase + (((data[4] >> 8) & 0x3f) << 4); |
| 1858 | | int bank = info->bank[(data[4] >> 4) & 0x7]; |
| 1859 | | int sprpri = 1 << ((data[4] >> 0) & 0x3); |
| 1860 | | const UINT16 *spritedata; |
| 1861 | | int x, y, pix, xdelta = 1; |
| 1862 | | |
| 1863 | | /* initialize the end address to the start address */ |
| 1864 | | data[7] = addr; |
| 1865 | | |
| 1866 | | /* if hidden, or top greater than/equal to bottom, or invalid bank, punt */ |
| 1867 | | if ((top >= bottom) || bank == 255) |
| 1868 | | continue; |
| 1869 | | |
| 1870 | | /* clamp to within the memory region size */ |
| 1871 | | if (numbanks) |
| 1872 | | bank %= numbanks; |
| 1873 | | spritedata = spritebase + 0x8000 * bank; |
| 1874 | | |
| 1875 | | /* adjust positions for screen flipping */ |
| 1876 | | if (info->flip) |
| 1877 | | { |
| 1878 | | int temp = top; |
| 1879 | | top = 224 - bottom; |
| 1880 | | bottom = 224 - temp; |
| 1881 | | xpos = 320 - xpos; |
| 1882 | | xdelta = -1; |
| 1883 | | } |
| 1884 | | |
| 1885 | | /* loop from top to bottom */ |
| 1886 | | for (y = top; y < bottom; y++) |
| 1887 | | { |
| 1888 | | /* advance a row */ |
| 1889 | | addr += pitch; |
| 1890 | | |
| 1891 | | /* skip drawing if not within the cliprect */ |
| 1892 | | if (y >= cliprect->min_y && y <= cliprect->max_y) |
| 1893 | | { |
| 1894 | | UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0); |
| 1895 | | UINT8 *pri = BITMAP_ADDR8(machine->priority_bitmap, y, 0); |
| 1896 | | |
| 1897 | | /* note that the System 16A sprites have a design flaw that allows the address */ |
| 1898 | | /* to carry into the flip flag, which is the topmost bit -- it is very important */ |
| 1899 | | /* to emulate this as the games compensate for it */ |
| 1900 | | |
| 1901 | | /* non-flipped case */ |
| 1902 | | if (!(addr & 0x8000)) |
| 1903 | | { |
| 1904 | | /* start at the word before because we preincrement below */ |
| 1905 | | data[7] = addr - 1; |
| 1906 | | for (x = xpos; ((xpos - x) & 0x1ff) != 1; ) |
| 1907 | | { |
| 1908 | | UINT16 pixels = spritedata[++data[7] & 0x7fff]; |
| 1909 | | |
| 1910 | | /* draw four pixels */ |
| 1911 | | pix = (pixels >> 12) & 0xf; system16a_draw_pixel(); x += xdelta; |
| 1912 | | pix = (pixels >> 8) & 0xf; system16a_draw_pixel(); x += xdelta; |
| 1913 | | pix = (pixels >> 4) & 0xf; system16a_draw_pixel(); x += xdelta; |
| 1914 | | pix = (pixels >> 0) & 0xf; system16a_draw_pixel(); x += xdelta; |
| 1915 | | |
| 1916 | | /* stop if the last pixel in the group was 0xf */ |
| 1917 | | if (pix == 15) |
| 1918 | | break; |
| 1919 | | } |
| 1920 | | } |
| 1921 | | |
| 1922 | | /* flipped case */ |
| 1923 | | else |
| 1924 | | { |
| 1925 | | /* start at the word after because we predecrement below */ |
| 1926 | | data[7] = addr + 1; |
| 1927 | | for (x = xpos; ((xpos - x) & 0x1ff) != 1; ) |
| 1928 | | { |
| 1929 | | UINT16 pixels = spritedata[--data[7] & 0x7fff]; |
| 1930 | | |
| 1931 | | /* draw four pixels */ |
| 1932 | | pix = (pixels >> 0) & 0xf; system16a_draw_pixel(); x += xdelta; |
| 1933 | | pix = (pixels >> 4) & 0xf; system16a_draw_pixel(); x += xdelta; |
| 1934 | | pix = (pixels >> 8) & 0xf; system16a_draw_pixel(); x += xdelta; |
| 1935 | | pix = (pixels >> 12) & 0xf; system16a_draw_pixel(); x += xdelta; |
| 1936 | | |
| 1937 | | /* stop if the last pixel in the group was 0xf */ |
| 1938 | | if (pix == 15) |
| 1939 | | break; |
| 1940 | | } |
| 1941 | | } |
| 1942 | | } |
| 1943 | | } |
| 1944 | | } |
| 1945 | | } |
| 1946 | | |
| 1947 | | |
| 1948 | | |
| 1949 | | /******************************************************************************************* |
| 1950 | | * |
| 1951 | | * System 16B-style sprites |
| 1952 | | * |
| 1953 | | * Offs Bits Usage |
| 1954 | | * +0 bbbbbbbb -------- Bottom scanline of sprite - 1 |
| 1955 | | * +0 -------- tttttttt Top scanline of sprite - 1 |
| 1956 | | * +2 -------x xxxxxxxx X position of sprite (position $BD is screen position 0) |
| 1957 | | * +4 e------- -------- Signify end of sprite list |
| 1958 | | * +4 -h------ -------- Hide this sprite |
| 1959 | | * +4 -------f -------- Horizontal flip: read the data backwards if set |
| 1960 | | * +4 -------- pppppppp Signed 8-bit pitch value between scanlines |
| 1961 | | * +6 oooooooo oooooooo Offset within selected sprite bank |
| 1962 | | * +8 ----bbbb -------- Sprite bank |
| 1963 | | * +8 -------- pp------ Sprite priority, relative to tilemaps |
| 1964 | | * +8 -------- --cccccc Sprite color palette |
| 1965 | | * +A ------vv vvv----- Vertical zoom factor (0 = full size, 0x10 = half size) |
| 1966 | | * +A -------- ---hhhhh Horizontal zoom factor (0 = full size, 0x10 = half size) |
| 1967 | | * +E dddddddd dddddddd Scratch space for current address |
| 1968 | | * |
| 1969 | | * Note that the zooming described below is 100% accurate to the real board. |
| 1970 | | * |
| 1971 | | *******************************************************************************************/ |
| 1972 | | |
| 1973 | | #define system16b_draw_pixel() \ |
| 1974 | | /* only draw if onscreen, not 0 or 15 */ \ |
| 1975 | | if (x >= cliprect->min_x && x <= cliprect->max_x && pix != 0 && pix != 15) \ |
| 1976 | | { \ |
| 1977 | | /* are we high enough priority to be visible? */ \ |
| 1978 | | if (sprpri > pri[x]) \ |
| 1979 | | { \ |
| 1980 | | /* shadow/hilight mode? */ \ |
| 1981 | | if (color == info->colorbase + (0x3f << 4)) \ |
| 1982 | | { \ |
| 1983 | | /* we have to check this for System 18 so that we don't */ \ |
| 1984 | | /* attempt to shadow VDP pixels */ \ |
| 1985 | | if (dest[x] < palette.entries) \ |
| 1986 | | dest[x] += (segaic16_paletteram[dest[x]] & 0x8000) ? palette.entries*2 : palette.entries; \ |
| 1987 | | } \ |
| 1988 | | \ |
| 1989 | | /* regular draw */ \ |
| 1990 | | else \ |
| 1991 | | dest[x] = pix | color; \ |
| 1992 | | } \ |
| 1993 | | \ |
| 1994 | | /* always mark priority so no one else draws here */ \ |
| 1995 | | pri[x] = 0xff; \ |
| 1996 | | } \ |
| 1997 | | |
| 1998 | | static void segaic16_sprites_16b_draw(running_machine *machine, struct sprite_info *info, bitmap_t *bitmap, const rectangle *cliprect) |
| 1999 | | { |
| 2000 | | UINT8 numbanks; |
| 2001 | | const UINT16 *spritebase; |
| 2002 | | UINT16 *data; |
| 2003 | | |
| 2004 | | spritebase = (const UINT16 *)memory_region(machine, "gfx2"); |
| 2005 | | if (!spritebase) |
| 2006 | | return; |
| 2007 | | |
| 2008 | | numbanks = memory_region_length(machine, "gfx2") / 0x20000; |
| 2009 | | |
| 2010 | | /* first scan forward to find the end of the list */ |
| 2011 | | for (data = info->spriteram; data < info->spriteram + info->ramsize/2; data += 8) |
| 2012 | | if (data[2] & 0x8000) |
| 2013 | | break; |
| 2014 | | |
| 2015 | | /* now scan backwards and render the sprites in order */ |
| 2016 | | for (data -= 8; data >= info->spriteram; data -= 8) |
| 2017 | | { |
| 2018 | | int bottom = data[0] >> 8; |
| 2019 | | int top = data[0] & 0xff; |
| 2020 | | int xpos = (data[1] & 0x1ff); |
| 2021 | | int hide = data[2] & 0x4000; |
| 2022 | | int flip = data[2] & 0x100; |
| 2023 | | int pitch = (INT8)(data[2] & 0xff); |
| 2024 | | UINT16 addr = data[3]; |
| 2025 | | int bank = info->bank[(data[4] >> 8) & 0xf]; |
| 2026 | | int sprpri = 1 << ((data[4] >> 6) & 0x3); |
| 2027 | | int color = info->colorbase + ((data[4] & 0x3f) << 4); |
| 2028 | | int vzoom = (data[5] >> 5) & 0x1f; |
| 2029 | | int hzoom = data[5] & 0x1f; |
| 2030 | | const UINT16 *spritedata; |
| 2031 | | int x, y, pix, xdelta = 1; |
| 2032 | | |
| 2033 | | /* some bootlegs have offset sprites */ |
| 2034 | | xpos += info->xoffs; |
| 2035 | | xpos &= 0x1ff; |
| 2036 | | |
| 2037 | | /* originals all have this offset */ |
| 2038 | | xpos -= 0xb8; |
| 2039 | | |
| 2040 | | /* initialize the end address to the start address */ |
| 2041 | | data[7] = addr; |
| 2042 | | |
| 2043 | | /* if hidden, or top greater than/equal to bottom, or invalid bank, punt */ |
| 2044 | | if (hide || (top >= bottom) || bank == 255) |
| 2045 | | continue; |
| 2046 | | |
| 2047 | | /* clamp to within the memory region size */ |
| 2048 | | if (numbanks) |
| 2049 | | bank %= numbanks; |
| 2050 | | spritedata = spritebase + 0x10000 * bank; |
| 2051 | | |
| 2052 | | /* reset the yzoom counter */ |
| 2053 | | data[5] &= 0x03ff; |
| 2054 | | |
| 2055 | | /* adjust positions for screen flipping */ |
| 2056 | | if (info->flip) |
| 2057 | | { |
| 2058 | | int temp = top; |
| 2059 | | top = 224 - bottom; |
| 2060 | | bottom = 224 - temp; |
| 2061 | | xpos = 320 - xpos; |
| 2062 | | xdelta = -1; |
| 2063 | | } |
| 2064 | | |
| 2065 | | /* loop from top to bottom */ |
| 2066 | | for (y = top; y < bottom; y++) |
| 2067 | | { |
| 2068 | | /* advance a row */ |
| 2069 | | addr += pitch; |
| 2070 | | |
| 2071 | | /* accumulate zoom factors; if we carry into the high bit, skip an extra row */ |
| 2072 | | data[5] += vzoom << 10; |
| 2073 | | if (data[5] & 0x8000) |
| 2074 | | { |
| 2075 | | addr += pitch; |
| 2076 | | data[5] &= ~0x8000; |
| 2077 | | } |
| 2078 | | |
| 2079 | | /* skip drawing if not within the cliprect */ |
| 2080 | | if (y >= cliprect->min_y && y <= cliprect->max_y) |
| 2081 | | { |
| 2082 | | UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0); |
| 2083 | | UINT8 *pri = BITMAP_ADDR8(machine->priority_bitmap, y, 0); |
| 2084 | | int xacc; |
| 2085 | | |
| 2086 | | /* compute the initial X zoom accumulator; this is verified on the real PCB */ |
| 2087 | | xacc = 4 * hzoom; |
| 2088 | | |
| 2089 | | /* non-flipped case */ |
| 2090 | | if (!flip) |
| 2091 | | { |
| 2092 | | /* start at the word before because we preincrement below */ |
| 2093 | | data[7] = addr - 1; |
| 2094 | | for (x = xpos; ((xpos - x) & 0x1ff) != 1; ) |
| 2095 | | { |
| 2096 | | UINT16 pixels = spritedata[++data[7]]; |
| 2097 | | |
| 2098 | | /* draw four pixels */ |
| 2099 | | pix = (pixels >> 12) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { system16b_draw_pixel(); x += xdelta; } |
| 2100 | | pix = (pixels >> 8) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { system16b_draw_pixel(); x += xdelta; } |
| 2101 | | pix = (pixels >> 4) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { system16b_draw_pixel(); x += xdelta; } |
| 2102 | | pix = (pixels >> 0) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { system16b_draw_pixel(); x += xdelta; } |
| 2103 | | |
| 2104 | | /* stop if the last pixel in the group was 0xf */ |
| 2105 | | if (pix == 15) |
| 2106 | | break; |
| 2107 | | } |
| 2108 | | } |
| 2109 | | |
| 2110 | | /* flipped case */ |
| 2111 | | else |
| 2112 | | { |
| 2113 | | /* start at the word after because we predecrement below */ |
| 2114 | | data[7] = addr + 1; |
| 2115 | | for (x = xpos; ((xpos - x) & 0x1ff) != 1; ) |
| 2116 | | { |
| 2117 | | UINT16 pixels = spritedata[--data[7]]; |
| 2118 | | |
| 2119 | | /* draw four pixels */ |
| 2120 | | pix = (pixels >> 0) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { system16b_draw_pixel(); x += xdelta; } |
| 2121 | | pix = (pixels >> 4) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { system16b_draw_pixel(); x += xdelta; } |
| 2122 | | pix = (pixels >> 8) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { system16b_draw_pixel(); x += xdelta; } |
| 2123 | | pix = (pixels >> 12) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { system16b_draw_pixel(); x += xdelta; } |
| 2124 | | |
| 2125 | | /* stop if the last pixel in the group was 0xf */ |
| 2126 | | if (pix == 15) |
| 2127 | | break; |
| 2128 | | } |
| 2129 | | } |
| 2130 | | } |
| 2131 | | } |
| 2132 | | } |
| 2133 | | } |
| 2134 | | |
| 2135 | | |
| 2136 | | /******************************************************************************************* |
| 2137 | | * |
| 2138 | | * The Y-board variant has different mixing properties. The sprite implementation itself |
| 2139 | | * is identical, however. |
| 2140 | | * |
| 2141 | | *******************************************************************************************/ |
| 2142 | | |
| 2143 | | #define yboard_16b_draw_pixel() \ |
| 2144 | | /* only draw if onscreen, not 0 or 15 */ \ |
| 2145 | | if (x >= cliprect->min_x && x <= cliprect->max_x && pix != 0 && pix != 15) \ |
| 2146 | | { \ |
| 2147 | | /* are we high enough priority to be visible? */ \ |
| 2148 | | if ((sprpri & 0x1f) < (pri[x] & 0x1f)) \ |
| 2149 | | { \ |
| 2150 | | /* shadow/hilight mode? */ \ |
| 2151 | | if (pix == 14) \ |
| 2152 | | dest[x] += (segaic16_paletteram[dest[x]] & 0x8000) ? palette.entries*2 : palette.entries; \ |
| 2153 | | \ |
| 2154 | | /* regular draw */ \ |
| 2155 | | else \ |
| 2156 | | dest[x] = pix | color; \ |
| 2157 | | } \ |
| 2158 | | \ |
| 2159 | | /* always mark priority so no one else draws here */ \ |
| 2160 | | pri[x] = 0; \ |
| 2161 | | } \ |
| 2162 | | |
| 2163 | | static void segaic16_sprites_yboard_16b_draw(running_machine *machine, struct sprite_info *info, bitmap_t *bitmap, const rectangle *cliprect) |
| 2164 | | { |
| 2165 | | UINT8 numbanks = memory_region_length(machine, "gfx2") / 0x20000; |
| 2166 | | const UINT16 *spritebase = (const UINT16 *)memory_region(machine, "gfx2"); |
| 2167 | | UINT16 *data; |
| 2168 | | |
| 2169 | | /* first scan forward to find the end of the list */ |
| 2170 | | for (data = info->spriteram; data < info->spriteram + info->ramsize/2; data += 8) |
| 2171 | | if (data[2] & 0x8000) |
| 2172 | | break; |
| 2173 | | |
| 2174 | | /* now scan backwards and render the sprites in order */ |
| 2175 | | for (data -= 8; data >= info->spriteram; data -= 8) |
| 2176 | | { |
| 2177 | | int bottom = data[0] >> 8; |
| 2178 | | int top = data[0] & 0xff; |
| 2179 | | int xpos = (data[1] & 0x1ff) - 0xb8; |
| 2180 | | int sprpri = (data[1] >> 8) & 0x1e; // 0x00 = high, 0x7f = low -- 0x71 = ship in gforce, 0x31 = strike fighter logo |
| 2181 | | int hide = data[2] & 0x4000; |
| 2182 | | int flip = data[2] & 0x100; |
| 2183 | | int pitch = (INT8)(data[2] & 0xff); |
| 2184 | | UINT16 addr = data[3]; |
| 2185 | | int bank = info->bank[(data[4] >> 8) & 0xf]; |
| 2186 | | int color = info->colorbase + ((data[4] & 0x7f) << 4); |
| 2187 | | int vzoom = (data[5] >> 5) & 0x1f; |
| 2188 | | int hzoom = data[5] & 0x1f; |
| 2189 | | const UINT16 *spritedata; |
| 2190 | | int x, y, pix, xdelta = 1; |
| 2191 | | |
| 2192 | | /* initialize the end address to the start address */ |
| 2193 | | data[7] = addr; |
| 2194 | | |
| 2195 | | /* if hidden, or top greater than/equal to bottom, or invalid bank, punt */ |
| 2196 | | if (hide || (top >= bottom) || bank == 255) |
| 2197 | | continue; |
| 2198 | | |
| 2199 | | /* clamp to within the memory region size */ |
| 2200 | | if (numbanks) |
| 2201 | | bank %= numbanks; |
| 2202 | | spritedata = spritebase + 0x10000 * bank; |
| 2203 | | |
| 2204 | | /* reset the yzoom counter */ |
| 2205 | | data[5] &= 0x03ff; |
| 2206 | | |
| 2207 | | /* adjust positions for screen flipping */ |
| 2208 | | if (info->flip) |
| 2209 | | { |
| 2210 | | int temp = top; |
| 2211 | | top = 224 - bottom; |
| 2212 | | bottom = 224 - temp; |
| 2213 | | xpos = 320 - xpos; |
| 2214 | | xdelta = -1; |
| 2215 | | } |
| 2216 | | |
| 2217 | | /* loop from top to bottom */ |
| 2218 | | for (y = top; y < bottom; y++) |
| 2219 | | { |
| 2220 | | /* advance a row */ |
| 2221 | | addr += pitch; |
| 2222 | | |
| 2223 | | /* accumulate zoom factors; if we carry into the high bit, skip an extra row */ |
| 2224 | | data[5] += vzoom << 10; |
| 2225 | | if (data[5] & 0x8000) |
| 2226 | | { |
| 2227 | | addr += pitch; |
| 2228 | | data[5] &= ~0x8000; |
| 2229 | | } |
| 2230 | | |
| 2231 | | /* skip drawing if not within the cliprect */ |
| 2232 | | if (y >= cliprect->min_y && y <= cliprect->max_y) |
| 2233 | | { |
| 2234 | | UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0); |
| 2235 | | UINT8 *pri = BITMAP_ADDR8(machine->priority_bitmap, y, 0); |
| 2236 | | int xacc; |
| 2237 | | |
| 2238 | | /* compute the initial X zoom accumulator; this is verified on the real PCB */ |
| 2239 | | xacc = 4 * hzoom; |
| 2240 | | |
| 2241 | | /* non-flipped case */ |
| 2242 | | if (!flip) |
| 2243 | | { |
| 2244 | | /* start at the word before because we preincrement below */ |
| 2245 | | data[7] = addr - 1; |
| 2246 | | for (x = xpos; ((xpos - x) & 0x1ff) != 1; ) |
| 2247 | | { |
| 2248 | | UINT16 pixels = spritedata[++data[7]]; |
| 2249 | | |
| 2250 | | /* draw four pixels */ |
| 2251 | | pix = (pixels >> 12) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { yboard_16b_draw_pixel(); x += xdelta; } |
| 2252 | | pix = (pixels >> 8) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { yboard_16b_draw_pixel(); x += xdelta; } |
| 2253 | | pix = (pixels >> 4) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { yboard_16b_draw_pixel(); x += xdelta; } |
| 2254 | | pix = (pixels >> 0) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { yboard_16b_draw_pixel(); x += xdelta; } |
| 2255 | | |
| 2256 | | /* stop if the last pixel in the group was 0xf */ |
| 2257 | | if (pix == 15) |
| 2258 | | break; |
| 2259 | | } |
| 2260 | | } |
| 2261 | | |
| 2262 | | /* flipped case */ |
| 2263 | | else |
| 2264 | | { |
| 2265 | | /* start at the word after because we predecrement below */ |
| 2266 | | data[7] = addr + 1; |
| 2267 | | for (x = xpos; ((xpos - x) & 0x1ff) != 1; ) |
| 2268 | | { |
| 2269 | | UINT16 pixels = spritedata[--data[7]]; |
| 2270 | | |
| 2271 | | /* draw four pixels */ |
| 2272 | | pix = (pixels >> 0) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { yboard_16b_draw_pixel(); x += xdelta; } |
| 2273 | | pix = (pixels >> 4) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { yboard_16b_draw_pixel(); x += xdelta; } |
| 2274 | | pix = (pixels >> 8) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { yboard_16b_draw_pixel(); x += xdelta; } |
| 2275 | | pix = (pixels >> 12) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { yboard_16b_draw_pixel(); x += xdelta; } |
| 2276 | | |
| 2277 | | /* stop if the last pixel in the group was 0xf */ |
| 2278 | | if (pix == 15) |
| 2279 | | break; |
| 2280 | | } |
| 2281 | | } |
| 2282 | | } |
| 2283 | | } |
| 2284 | | } |
| 2285 | | } |
| 2286 | | |
| 2287 | | |
| 2288 | | |
| 2289 | | /******************************************************************************************* |
| 2290 | | * |
| 2291 | | * Out Run/X-Board-style sprites |
| 2292 | | * |
| 2293 | | * Offs Bits Usage |
| 2294 | | * +0 e------- -------- Signify end of sprite list |
| 2295 | | * +0 -h-h---- -------- Hide this sprite if either bit is set |
| 2296 | | * +0 ----bbb- -------- Sprite bank |
| 2297 | | * +0 -------t tttttttt Top scanline of sprite + 256 |
| 2298 | | * +2 oooooooo oooooooo Offset within selected sprite bank |
| 2299 | | * +4 ppppppp- -------- Signed 7-bit pitch value between scanlines |
| 2300 | | * +4 -------x xxxxxxxx X position of sprite (position $BE is screen position 0) |
| 2301 | | * +6 -s------ -------- Enable shadows |
| 2302 | | * +6 --pp---- -------- Sprite priority, relative to tilemaps |
| 2303 | | * +6 ------vv vvvvvvvv Vertical zoom factor (0x200 = full size, 0x100 = half size, 0x300 = 2x size) |
| 2304 | | * +8 y------- -------- Render from top-to-bottom (1) or bottom-to-top (0) on screen |
| 2305 | | * +8 -f------ -------- Horizontal flip: read the data backwards if set |
| 2306 | | * +8 --x----- -------- Render from left-to-right (1) or right-to-left (0) on screen |
| 2307 | | * +8 ------hh hhhhhhhh Horizontal zoom factor (0x200 = full size, 0x100 = half size, 0x300 = 2x size) |
| 2308 | | * +E dddddddd dddddddd Scratch space for current address |
| 2309 | | * |
| 2310 | | * Out Run only: |
| 2311 | | * +A hhhhhhhh -------- Height in scanlines - 1 |
| 2312 | | * +A -------- -ccccccc Sprite color palette |
| 2313 | | * |
| 2314 | | * X-Board only: |
| 2315 | | * +A ----hhhh hhhhhhhh Height in scanlines - 1 |
| 2316 | | * +C -------- cccccccc Sprite color palette |
| 2317 | | * |
| 2318 | | *******************************************************************************************/ |
| 2319 | | |
| 2320 | | #define outrun_draw_pixel() \ |
| 2321 | | /* only draw if onscreen, not 0 or 15 */ \ |
| 2322 | | if (x >= cliprect->min_x && x <= cliprect->max_x && pix != 0 && pix != 15) \ |
| 2323 | | { \ |
| 2324 | | /* are we high enough priority to be visible? */ \ |
| 2325 | | if (sprpri > pri[x]) \ |
| 2326 | | { \ |
| 2327 | | /* shadow/hilight mode? */ \ |
| 2328 | | if (shadow && pix == 0xa) \ |
| 2329 | | dest[x] += (segaic16_paletteram[dest[x]] & 0x8000) ? palette.entries*2 : palette.entries; \ |
| 2330 | | \ |
| 2331 | | /* regular draw */ \ |
| 2332 | | else \ |
| 2333 | | dest[x] = pix | color; \ |
| 2334 | | } \ |
| 2335 | | \ |
| 2336 | | /* always mark priority so no one else draws here */ \ |
| 2337 | | pri[x] = 0xff; \ |
| 2338 | | } \ |
| 2339 | | |
| 2340 | | static void segaic16_sprites_outrun_draw(running_machine *machine, struct sprite_info *info, bitmap_t *bitmap, const rectangle *cliprect) |
| 2341 | | { |
| 2342 | | UINT8 numbanks = memory_region_length(machine, "gfx2") / 0x40000; |
| 2343 | | const UINT32 *spritebase = (const UINT32 *)memory_region(machine, "gfx2"); |
| 2344 | | UINT16 *data; |
| 2345 | | |
| 2346 | | /* first scan forward to find the end of the list */ |
| 2347 | | for (data = info->buffer; data < info->buffer + info->ramsize/2; data += 8) |
| 2348 | | if (data[0] & 0x8000) |
| 2349 | | break; |
| 2350 | | |
| 2351 | | /* now scan backwards and render the sprites in order */ |
| 2352 | | for (data -= 8; data >= info->buffer; data -= 8) |
| 2353 | | { |
| 2354 | | int hide = (data[0] & 0x5000); |
| 2355 | | int bank = (data[0] >> 9) & 7; |
| 2356 | | int top = (data[0] & 0x1ff) - 0x100; |
| 2357 | | UINT16 addr = data[1]; |
| 2358 | | int pitch = (INT16)((data[2] >> 1) | ((data[4] & 0x1000) << 3)) >> 8; |
| 2359 | | int xpos = data[2] & 0x1ff; |
| 2360 | | int shadow = (data[3] >> 14) & 1; |
| 2361 | | int sprpri = 1 << ((data[3] >> 12) & 3); |
| 2362 | | int vzoom = data[3] & 0x7ff; |
| 2363 | | int ydelta = (data[4] & 0x8000) ? 1 : -1; |
| 2364 | | int flip = (~data[4] >> 14) & 1; |
| 2365 | | int xdelta = (data[4] & 0x2000) ? 1 : -1; |
| 2366 | | int hzoom = data[4] & 0x7ff; |
| 2367 | | int height = ((info->type == SEGAIC16_SPRITES_OUTRUN) ? (data[5] >> 8) : (data[5] & 0xfff)) + 1; |
| 2368 | | int color = info->colorbase + (((info->type == SEGAIC16_SPRITES_OUTRUN) ? (data[5] & 0x7f) : (data[6] & 0xff)) << 4); |
| 2369 | | int x, y, ytarget, yacc = 0, pix; |
| 2370 | | const UINT32 *spritedata; |
| 2371 | | |
| 2372 | | /* adjust X coordinate */ |
| 2373 | | /* note: the threshhold below is a guess. If it is too high, rachero will draw garbage */ |
| 2374 | | /* If it is too low, smgp won't draw the bottom part of the road */ |
| 2375 | | if (xpos < 0x80 && xdelta < 0) |
| 2376 | | xpos += 0x200; |
| 2377 | | xpos -= 0xbe; |
| 2378 | | |
| 2379 | | /* initialize the end address to the start address */ |
| 2380 | | data[7] = addr; |
| 2381 | | |
| 2382 | | /* if hidden, or top greater than/equal to bottom, or invalid bank, punt */ |
| 2383 | | if (hide || height == 0) |
| 2384 | | continue; |
| 2385 | | |
| 2386 | | /* clamp to within the memory region size */ |
| 2387 | | if (numbanks) |
| 2388 | | bank %= numbanks; |
| 2389 | | spritedata = spritebase + 0x10000 * bank; |
| 2390 | | |
| 2391 | | /* clamp to a maximum of 8x (not 100% confirmed) */ |
| 2392 | | if (vzoom < 0x40) vzoom = 0x40; |
| 2393 | | if (hzoom < 0x40) hzoom = 0x40; |
| 2394 | | |
| 2395 | | /* loop from top to bottom */ |
| 2396 | | ytarget = top + ydelta * height; |
| 2397 | | for (y = top; y != ytarget; y += ydelta) |
| 2398 | | { |
| 2399 | | /* skip drawing if not within the cliprect */ |
| 2400 | | if (y >= cliprect->min_y && y <= cliprect->max_y) |
| 2401 | | { |
| 2402 | | UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0); |
| 2403 | | UINT8 *pri = BITMAP_ADDR8(machine->priority_bitmap, y, 0); |
| 2404 | | int xacc = 0; |
| 2405 | | |
| 2406 | | /* non-flipped case */ |
| 2407 | | if (!flip) |
| 2408 | | { |
| 2409 | | /* start at the word before because we preincrement below */ |
| 2410 | | data[7] = addr - 1; |
| 2411 | | for (x = xpos; (xdelta > 0 && x <= cliprect->max_x) || (xdelta < 0 && x >= cliprect->min_x); ) |
| 2412 | | { |
| 2413 | | UINT32 pixels = spritedata[++data[7]]; |
| 2414 | | |
| 2415 | | /* draw four pixels */ |
| 2416 | | pix = (pixels >> 28) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200; |
| 2417 | | pix = (pixels >> 24) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200; |
| 2418 | | pix = (pixels >> 20) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200; |
| 2419 | | pix = (pixels >> 16) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200; |
| 2420 | | pix = (pixels >> 12) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200; |
| 2421 | | pix = (pixels >> 8) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200; |
| 2422 | | pix = (pixels >> 4) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200; |
| 2423 | | pix = (pixels >> 0) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200; |
| 2424 | | |
| 2425 | | /* stop if the second-to-last pixel in the group was 0xf */ |
| 2426 | | if ((pixels & 0x000000f0) == 0x000000f0) |
| 2427 | | break; |
| 2428 | | } |
| 2429 | | } |
| 2430 | | |
| 2431 | | /* flipped case */ |
| 2432 | | else |
| 2433 | | { |
| 2434 | | /* start at the word after because we predecrement below */ |
| 2435 | | data[7] = addr + 1; |
| 2436 | | for (x = xpos; (xdelta > 0 && x <= cliprect->max_x) || (xdelta < 0 && x >= cliprect->min_x); ) |
| 2437 | | { |
| 2438 | | UINT32 pixels = spritedata[--data[7]]; |
| 2439 | | |
| 2440 | | /* draw four pixels */ |
| 2441 | | pix = (pixels >> 0) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200; |
| 2442 | | pix = (pixels >> 4) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200; |
| 2443 | | pix = (pixels >> 8) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200; |
| 2444 | | pix = (pixels >> 12) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200; |
| 2445 | | pix = (pixels >> 16) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200; |
| 2446 | | pix = (pixels >> 20) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200; |
| 2447 | | pix = (pixels >> 24) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200; |
| 2448 | | pix = (pixels >> 28) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200; |
| 2449 | | |
| 2450 | | /* stop if the second-to-last pixel in the group was 0xf */ |
| 2451 | | if ((pixels & 0x0f000000) == 0x0f000000) |
| 2452 | | break; |
| 2453 | | } |
| 2454 | | } |
| 2455 | | } |
| 2456 | | |
| 2457 | | /* accumulate zoom factors; if we carry into the high bit, skip an extra row */ |
| 2458 | | yacc += vzoom; |
| 2459 | | addr += pitch * (yacc >> 9); |
| 2460 | | yacc &= 0x1ff; |
| 2461 | | } |
| 2462 | | } |
| 2463 | | } |
| 2464 | | |
| 2465 | | |
| 2466 | | |
| 2467 | | /******************************************************************************************* |
| 2468 | | * |
| 2469 | | * Y-Board-style sprites |
| 2470 | | * |
| 2471 | | * Offs Bits Usage |
| 2472 | | * +0 e------- -------- Signify end of sprite list |
| 2473 | | * +0 -----iii iiiiiiii Address of indirection table (/16) |
| 2474 | | * +2 bbbb---- -------- Upper 4 bits of bank index |
| 2475 | | * +2 ----xxxx xxxxxxxx X position of sprite (position $600 is screen position 0) |
| 2476 | | * +4 bbbb---- -------- Lower 4 bits of bank index |
| 2477 | | * +4 ----yyyy yyyyyyyy Y position of sprite (position $600 is screen position 0) |
| 2478 | | * +6 oooooooo oooooooo Offset within selected sprite bank |
| 2479 | | * +8 hhhhhhhh hhhhhhhh Height of sprite |
| 2480 | | * +A -y------ -------- Render from top-to-bottom (1) or bottom-to-top (0) on screen |
| 2481 | | * +A --f----- -------- Horizontal flip: read the data backwards if set |
| 2482 | | * +A ---x---- -------- Render from left-to-right (1) or right-to-left (0) on screen |
| 2483 | | * +A -----zzz zzzzzzzz Zoom factor |
| 2484 | | * +C -ccc---- -------- Sprite color |
| 2485 | | * +C ----rrrr -------- Sprite priority |
| 2486 | | * +C -------- pppppppp Signed 8-bit pitch value between scanlines |
| 2487 | | * +E ----nnnn nnnnnnnn Index of next sprite |
| 2488 | | * |
| 2489 | | * In addition to these parameters, the sprite area is clipped using scanline extents |
| 2490 | | * stored for every pair of scanlines in the rotation RAM. It's a bit of a cheat for us |
| 2491 | | * to poke our nose into the rotation structure, but there are no known cases of Y-board |
| 2492 | | * sprites without rotation RAM. |
| 2493 | | * |
| 2494 | | *******************************************************************************************/ |
| 2495 | | |
| 2496 | | #define yboard_draw_pixel() \ |
| 2497 | | /* only draw if onscreen */ \ |
| 2498 | | if (x >= minx && x <= maxx && ind < 0x1fe) \ |
| 2499 | | dest[x] = ind | colorpri; \ |
| 2500 | | |
| 2501 | | static void segaic16_sprites_yboard_draw(running_machine *machine, struct sprite_info *info, bitmap_t *bitmap, const rectangle *cliprect) |
| 2502 | | { |
| 2503 | | UINT8 numbanks = memory_region_length(machine, "gfx1") / 0x80000; |
| 2504 | | const UINT64 *spritebase = (const UINT64 *)memory_region(machine, "gfx1"); |
| 2505 | | const UINT16 *rotatebase = rotate[0].buffer ? rotate[0].buffer : rotate[0].rotateram; |
| 2506 | | UINT8 visited[0x1000]; |
| 2507 | | UINT16 *data; |
| 2508 | | int next = 0; |
| 2509 | | int y; |
| 2510 | | |
| 2511 | | /* reset the visited list */ |
| 2512 | | memset(visited, 0, sizeof(visited)); |
| 2513 | | |
| 2514 | | /* clear out any scanlines we might be using */ |
| 2515 | | for (y = cliprect->min_y; y <= cliprect->max_y; y++) |
| 2516 | | if (!(rotatebase[y & ~1] & 0xc000)) |
| 2517 | | memset(BITMAP_ADDR16(bitmap, y, cliprect->min_x), 0xff, (cliprect->max_x - cliprect->min_x + 1) * sizeof(UINT16)); |
| 2518 | | |
| 2519 | | /* now scan backwards and render the sprites in order */ |
| 2520 | | for (data = info->spriteram; !(data[0] & 0x8000) && !visited[next]; data = info->spriteram + next * 8) |
| 2521 | | { |
| 2522 | | int hide = (data[0] & 0x5000); |
| 2523 | | UINT16 *indirect = info->spriteram + ((data[0] & 0x7ff) << 4); |
| 2524 | | int bank = ((data[1] >> 8) & 0x10) | ((data[2] >> 12) & 0x0f); |
| 2525 | | int xpos = (data[1] & 0xfff) - 0x600; |
| 2526 | | int top = (data[2] & 0xfff) - 0x600; |
| 2527 | | UINT16 addr = data[3]; |
| 2528 | | int height = data[4]; |
| 2529 | | int ydelta = (data[5] & 0x4000) ? 1 : -1; |
| 2530 | | int flip = (~data[5] >> 13) & 1; |
| 2531 | | int xdelta = (data[5] & 0x1000) ? 1 : -1; |
| 2532 | | int zoom = data[5] & 0x7ff; |
| 2533 | | int colorpri= (data[6] << 1) & 0xfe00; |
| 2534 | | int pitch = (INT8)data[6]; |
| 2535 | | int x, y, ytarget, yacc = 0, pix, ind; |
| 2536 | | const UINT64 *spritedata; |
| 2537 | | UINT16 offs; |
| 2538 | | |
| 2539 | | /* note that we've visited this entry and get the offset of the next one */ |
| 2540 | | visited[next] = 1; |
| 2541 | | next = data[7] & 0xfff; |
| 2542 | | |
| 2543 | | /* if hidden, or top greater than/equal to bottom, or invalid bank, punt */ |
| 2544 | | if (hide || height == 0) |
| 2545 | | continue; |
| 2546 | | |
| 2547 | | /* clamp to within the memory region size */ |
| 2548 | | if (numbanks) |
| 2549 | | bank %= numbanks; |
| 2550 | | spritedata = spritebase + 0x10000 * bank; |
| 2551 | | |
| 2552 | | /* clamp to a maximum of 8x (not 100% confirmed) */ |
| 2553 | | if (zoom == 0) zoom = 1; |
| 2554 | | |
| 2555 | | /* loop from top to bottom */ |
| 2556 | | ytarget = top + ydelta * height; |
| 2557 | | for (y = top; y != ytarget; y += ydelta) |
| 2558 | | { |
| 2559 | | /* skip drawing if not within the cliprect */ |
| 2560 | | if (y >= cliprect->min_y && y <= cliprect->max_y) |
| 2561 | | { |
| 2562 | | UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0); |
| 2563 | | int minx = rotatebase[y & ~1]; |
| 2564 | | int maxx = rotatebase[y | 1]; |
| 2565 | | int xacc = 0; |
| 2566 | | |
| 2567 | | /* bit 0x8000 from rotate RAM means that Y is above the top of the screen */ |
| 2568 | | if ((minx & 0x8000) && ydelta < 0) |
| 2569 | | break; |
| 2570 | | |
| 2571 | | /* bit 0x4000 from rotate RAM means that Y is below the bottom of the screen */ |
| 2572 | | if ((minx & 0x4000) && ydelta > 0) |
| 2573 | | break; |
| 2574 | | |
| 2575 | | /* if either bit is set, skip the rest for this scanline */ |
| 2576 | | if (!(minx & 0xc000)) |
| 2577 | | { |
| 2578 | | /* clamp min/max to the cliprect */ |
| 2579 | | minx -= 0x600; |
| 2580 | | maxx -= 0x600; |
| 2581 | | if (minx < cliprect->min_x) |
| 2582 | | minx = cliprect->min_x; |
| 2583 | | if (maxx > cliprect->max_x) |
| 2584 | | maxx = cliprect->max_x; |
| 2585 | | |
| 2586 | | /* non-flipped case */ |
| 2587 | | if (!flip) |
| 2588 | | { |
| 2589 | | /* start at the word before because we preincrement below */ |
| 2590 | | offs = addr - 1; |
| 2591 | | for (x = xpos; (xdelta > 0 && x <= maxx) || (xdelta < 0 && x >= minx); ) |
| 2592 | | { |
| 2593 | | UINT64 pixels = spritedata[++offs]; |
| 2594 | | |
| 2595 | | /* draw four pixels */ |
| 2596 | | pix = (pixels >> 60) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 2597 | | pix = (pixels >> 56) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 2598 | | pix = (pixels >> 52) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 2599 | | pix = (pixels >> 48) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 2600 | | pix = (pixels >> 44) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 2601 | | pix = (pixels >> 40) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 2602 | | pix = (pixels >> 36) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 2603 | | pix = (pixels >> 32) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 2604 | | pix = (pixels >> 28) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 2605 | | pix = (pixels >> 24) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 2606 | | pix = (pixels >> 20) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 2607 | | pix = (pixels >> 16) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 2608 | | pix = (pixels >> 12) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 2609 | | pix = (pixels >> 8) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 2610 | | pix = (pixels >> 4) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 2611 | | pix = (pixels >> 0) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 2612 | | |
| 2613 | | /* stop if the second-to-last pixel in the group was 0xf */ |
| 2614 | | if (pix == 0x0f) |
| 2615 | | break; |
| 2616 | | } |
| 2617 | | } |
| 2618 | | |
| 2619 | | /* flipped case */ |
| 2620 | | else |
| 2621 | | { |
| 2622 | | /* start at the word after because we predecrement below */ |
| 2623 | | offs = addr + 1; |
| 2624 | | for (x = xpos; (xdelta > 0 && x <= maxx) || (xdelta < 0 && x >= minx); ) |
| 2625 | | { |
| 2626 | | UINT64 pixels = spritedata[--offs]; |
| 2627 | | |
| 2628 | | /* draw four pixels */ |
| 2629 | | pix = (pixels >> 0) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 2630 | | pix = (pixels >> 4) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 2631 | | pix = (pixels >> 8) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 2632 | | pix = (pixels >> 12) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 2633 | | pix = (pixels >> 16) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 2634 | | pix = (pixels >> 20) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 2635 | | pix = (pixels >> 24) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 2636 | | pix = (pixels >> 28) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 2637 | | pix = (pixels >> 32) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 2638 | | pix = (pixels >> 36) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 2639 | | pix = (pixels >> 40) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 2640 | | pix = (pixels >> 44) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 2641 | | pix = (pixels >> 48) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 2642 | | pix = (pixels >> 52) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 2643 | | pix = (pixels >> 56) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 2644 | | pix = (pixels >> 60) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 2645 | | |
| 2646 | | /* stop if the second-to-last pixel in the group was 0xf */ |
| 2647 | | if (pix == 0x0f) |
| 2648 | | break; |
| 2649 | | } |
| 2650 | | } |
| 2651 | | } |
| 2652 | | } |
| 2653 | | |
| 2654 | | /* accumulate zoom factors; if we carry into the high bit, skip an extra row */ |
| 2655 | | yacc += zoom; |
| 2656 | | addr += pitch * (yacc >> 9); |
| 2657 | | yacc &= 0x1ff; |
| 2658 | | } |
| 2659 | | } |
| 2660 | | } |
| 2661 | | |
| 2662 | | /* bootlegs */ |
| 2663 | | |
| 2664 | | /* |
| 2665 | | |
| 2666 | | the system16a bootleg sprite hardware differs in subtle ways on a per game basis |
| 2667 | | with each game having the words swapped around. |
| 2668 | | |
| 2669 | | there are also some subtle, but important changes when compared to the original |
| 2670 | | system16a sprites, mainly the increment of the address not happening until |
| 2671 | | the end of the loop |
| 2672 | | |
| 2673 | | */ |
| 2674 | | |
| 2675 | | /* ignores the sprite priority until we understand priority better on the bootlegs */ |
| 2676 | | #define system16a_bootleg_draw_pixel() \ |
| 2677 | | /* only draw if onscreen, not 0 or 15 */ \ |
| 2678 | | if (x >= cliprect->min_x && x <= cliprect->max_x && pix != 0 && pix != 15) \ |
| 2679 | | { \ |
| 2680 | | /* are we high enough priority to be visible? */ \ |
| 2681 | | if (sprpri || 1) \ |
| 2682 | | { \ |
| 2683 | | /* shadow/hilight mode? */ \ |
| 2684 | | if (color == info->colorbase + (0x3f << 4)) \ |
| 2685 | | dest[x] += (segaic16_paletteram[dest[x]] & 0x8000) ? palette.entries*2 : palette.entries; \ |
| 2686 | | \ |
| 2687 | | /* regular draw */ \ |
| 2688 | | else \ |
| 2689 | | dest[x] = pix | color; \ |
| 2690 | | } \ |
| 2691 | | \ |
| 2692 | | /* always mark priority so no one else draws here */ \ |
| 2693 | | pri[x] = 0xff; \ |
| 2694 | | } \ |
| 2695 | | |
| 2696 | | |
| 2697 | | /* make this an actual function */ |
| 2698 | | #define system16a_bootleg_draw_core() \ |
| 2699 | | { \ |
| 2700 | | const UINT16 *spritedata; \ |
| 2701 | | int x, y, pix, xdelta = 1; \ |
| 2702 | | \ |
| 2703 | | xpos += info->xoffs; \ |
| 2704 | | xpos &= 0x1ff; \ |
| 2705 | | \ |
| 2706 | | xpos -= 0xbd; \ |
| 2707 | | \ |
| 2708 | | /* initialize the end address to the start address */ \ |
| 2709 | | data[7] = addr; \ |
| 2710 | | \ |
| 2711 | | /* if hidden, or top greater than/equal to bottom, or invalid bank, punt */ \ |
| 2712 | | if ((top >= bottom) || bank == 255) \ |
| 2713 | | continue; \ |
| 2714 | | \ |
| 2715 | | /* clamp to within the memory region size */ \ |
| 2716 | | if (numbanks) \ |
| 2717 | | bank %= numbanks; \ |
| 2718 | | spritedata = spritebase + 0x8000 * bank; \ |
| 2719 | | \ |
| 2720 | | /* adjust positions for screen flipping */ \ |
| 2721 | | if (info->flip) \ |
| 2722 | | { \ |
| 2723 | | int temp = top; \ |
| 2724 | | top = 224 - bottom; \ |
| 2725 | | bottom = 224 - temp; \ |
| 2726 | | xpos = 320 - xpos; \ |
| 2727 | | xdelta = -1; \ |
| 2728 | | } \ |
| 2729 | | \ |
| 2730 | | /* loop from top to bottom */ \ |
| 2731 | | for (y = top; y < bottom; y++) \ |
| 2732 | | { \ |
| 2733 | | \ |
| 2734 | | /* skip drawing if not within the cliprect */ \ |
| 2735 | | if (y >= cliprect->min_y && y <= cliprect->max_y) \ |
| 2736 | | { \ |
| 2737 | | UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0); \ |
| 2738 | | UINT8 *pri = BITMAP_ADDR8(machine->priority_bitmap, y, 0); \ |
| 2739 | | \ |
| 2740 | | /* note that the System 16A sprites have a design flaw that allows the address */ \ |
| 2741 | | /* to carry into the flip flag, which is the topmost bit -- it is very important */ \ |
| 2742 | | /* to emulate this as the games compensate for it */ \ |
| 2743 | | \ |
| 2744 | | /* non-flipped case */ \ |
| 2745 | | if (!(addr & 0x8000)) \ |
| 2746 | | { \ |
| 2747 | | /* start at the word before because we preincrement below */ \ |
| 2748 | | data[7] = addr - 1; \ |
| 2749 | | for (x = xpos; ((xpos - x) & 0x1ff) != 1; ) \ |
| 2750 | | { \ |
| 2751 | | UINT16 pixels = spritedata[++data[7] & 0x7fff]; \ |
| 2752 | | \ |
| 2753 | | /* draw four pixels */ \ |
| 2754 | | pix = (pixels >> 12) & 0xf; system16a_bootleg_draw_pixel(); x += xdelta; \ |
| 2755 | | pix = (pixels >> 8) & 0xf; system16a_bootleg_draw_pixel(); x += xdelta; \ |
| 2756 | | pix = (pixels >> 4) & 0xf; system16a_bootleg_draw_pixel(); x += xdelta; \ |
| 2757 | | pix = (pixels >> 0) & 0xf; system16a_bootleg_draw_pixel(); x += xdelta; \ |
| 2758 | | \ |
| 2759 | | /* stop if the last pixel in the group was 0xf */ \ |
| 2760 | | if (pix == 15) \ |
| 2761 | | break; \ |
| 2762 | | } \ |
| 2763 | | } \ |
| 2764 | | \ |
| 2765 | | /* flipped case */ \ |
| 2766 | | else \ |
| 2767 | | { \ |
| 2768 | | /* start at the word after because we predecrement below */ \ |
| 2769 | | data[7] = addr + 1; \ |
| 2770 | | for (x = xpos; ((xpos - x) & 0x1ff) != 1; ) \ |
| 2771 | | { \ |
| 2772 | | UINT16 pixels = spritedata[--data[7] & 0x7fff]; \ |
| 2773 | | \ |
| 2774 | | /* draw four pixels */ \ |
| 2775 | | pix = (pixels >> 0) & 0xf; system16a_bootleg_draw_pixel(); x += xdelta; \ |
| 2776 | | pix = (pixels >> 4) & 0xf; system16a_bootleg_draw_pixel(); x += xdelta; \ |
| 2777 | | pix = (pixels >> 8) & 0xf; system16a_bootleg_draw_pixel(); x += xdelta; \ |
| 2778 | | pix = (pixels >> 12) & 0xf; system16a_bootleg_draw_pixel(); x += xdelta; \ |
| 2779 | | \ |
| 2780 | | /* stop if the last pixel in the group was 0xf */ \ |
| 2781 | | if (pix == 15) \ |
| 2782 | | break; \ |
| 2783 | | } \ |
| 2784 | | } \ |
| 2785 | | } \ |
| 2786 | | \ |
| 2787 | | /* advance a row - must be done at the end on the bootlegs! */ \ |
| 2788 | | addr += pitch; \ |
| 2789 | | } \ |
| 2790 | | } \ |
| 2791 | | |
| 2792 | | |
| 2793 | | |
| 2794 | | static void segaic16_sprites_16a_bootleg_wb3bl_draw(running_machine *machine, struct sprite_info *info, bitmap_t *bitmap, const rectangle *cliprect) |
| 2795 | | { |
| 2796 | | UINT8 numbanks = memory_region_length(machine, "gfx2") / 0x10000; |
| 2797 | | const UINT16 *spritebase = (const UINT16 *)memory_region(machine, "gfx2"); |
| 2798 | | UINT16 *data; |
| 2799 | | |
| 2800 | | for (data = info->spriteram; data < info->spriteram+ info->ramsize/2; data += 8) |
| 2801 | | { |
| 2802 | | int bottom = (data[4] >> 8); |
| 2803 | | int top = (data[4] & 0xff); |
| 2804 | | int xpos = (data[0]); |
| 2805 | | int pitch = (INT16)data[5]; |
| 2806 | | UINT16 addr = data[1]; |
| 2807 | | int color = info->colorbase + (((data[6] >> 8) & 0x3f) << 4); |
| 2808 | | int bank = info->bank[(data[6] >> 4) & 0x7]; |
| 2809 | | int sprpri = 1 << ((data[6] >> 0) & 0x3); |
| 2810 | | |
| 2811 | | system16a_bootleg_draw_core(); |
| 2812 | | } |
| 2813 | | } |
| 2814 | | |
| 2815 | | /* 4 player passing shot is different to this.. */ |
| 2816 | | static void segaic16_sprites_16a_bootleg_passhtb_draw(running_machine *machine, struct sprite_info *info, bitmap_t *bitmap, const rectangle *cliprect) |
| 2817 | | { |
| 2818 | | UINT8 numbanks = memory_region_length(machine, "gfx2") / 0x10000; |
| 2819 | | const UINT16 *spritebase = (const UINT16 *)memory_region(machine, "gfx2"); |
| 2820 | | UINT16 *data; |
| 2821 | | |
| 2822 | | for (data = info->spriteram; data < info->spriteram+ info->ramsize/2; data += 8) |
| 2823 | | { |
| 2824 | | int bottom = (data[1] >> 8)-1; |
| 2825 | | int top = (data[1] & 0xff)-1; |
| 2826 | | int xpos = (data[0]); |
| 2827 | | int pitch = (INT16)data[3]; |
| 2828 | | UINT16 addr = data[2]; |
| 2829 | | int color = info->colorbase + (((data[5] >> 8) & 0x3f) << 4); |
| 2830 | | int bank = info->bank[(data[5] >> 4) & 0x7]; |
| 2831 | | int sprpri = 1 << ((data[5] >> 0) & 0x3); |
| 2832 | | |
| 2833 | | system16a_bootleg_draw_core(); |
| 2834 | | } |
| 2835 | | } |
| 2836 | | |
| 2837 | | static void segaic16_sprites_16a_bootleg_shinobld_draw(running_machine *machine, struct sprite_info *info, bitmap_t *bitmap, const rectangle *cliprect) |
| 2838 | | { |
| 2839 | | UINT8 numbanks = memory_region_length(machine, "gfx2") / 0x10000; |
| 2840 | | const UINT16 *spritebase = (const UINT16 *)memory_region(machine, "gfx2"); |
| 2841 | | UINT16 *data; |
| 2842 | | |
| 2843 | | for (data = info->spriteram; data < info->spriteram+ info->ramsize/2; data += 8) |
| 2844 | | { |
| 2845 | | int bottom = (data[0] >> 8)-1; |
| 2846 | | int top = (data[0] & 0xff)-1; |
| 2847 | | int xpos = (data[1]); |
| 2848 | | int pitch = (INT16)data[2]; |
| 2849 | | UINT16 addr = data[3]; |
| 2850 | | int color = info->colorbase + (((data[4] >> 8) & 0x3f) << 4); |
| 2851 | | int bank = info->bank[(data[4] >> 4) & 0x7]; |
| 2852 | | int sprpri = 1 << ((data[4] >> 0) & 0x3); |
| 2853 | | |
| 2854 | | system16a_bootleg_draw_core(); |
| 2855 | | } |
| 2856 | | } |
| 2857 | | |
| 2858 | | /************************************* |
| 2859 | | * |
| 2860 | | * General sprite initialization |
| 2861 | | * |
| 2862 | | *************************************/ |
| 2863 | | |
| 2864 | | void segaic16_sprites_init(running_machine *machine, int which, int type, int colorbase, int xoffs) |
| 2865 | | { |
| 2866 | | struct sprite_info *info = &sprites[which]; |
| 2867 | | int i, buffer = 0; |
| 2868 | | |
| 2869 | | /* reset the sprite info */ |
| 2870 | | memset(info, 0, sizeof(*info)); |
| 2871 | | info->index = which; |
| 2872 | | info->type = type; |
| 2873 | | for (i = 0; i < 16; i++) |
| 2874 | | info->bank[i] = i; |
| 2875 | | info->colorbase = colorbase; |
| 2876 | | |
| 2877 | | /* some bootlegs have offset sprites */ |
| 2878 | | info->xoffs = xoffs; |
| 2879 | | |
| 2880 | | /* set up based on which sprite system */ |
| 2881 | | switch (which) |
| 2882 | | { |
| 2883 | | case 0: |
| 2884 | | info->spriteram = segaic16_spriteram_0; |
| 2885 | | break; |
| 2886 | | |
| 2887 | | case 1: |
| 2888 | | info->spriteram = segaic16_spriteram_1; |
| 2889 | | break; |
| 2890 | | |
| 2891 | | default: |
| 2892 | | fatalerror("Invalid sprite index specified in segaic16_sprites_init"); |
| 2893 | | } |
| 2894 | | |
| 2895 | | /* determine the parameters of the sprites */ |
| 2896 | | switch (type) |
| 2897 | | { |
| 2898 | | case SEGAIC16_SPRITES_HANGON: |
| 2899 | | info->draw = segaic16_sprites_hangon_draw; |
| 2900 | | info->ramsize = 0x800; |
| 2901 | | break; |
| 2902 | | |
| 2903 | | case SEGAIC16_SPRITES_16A: |
| 2904 | | info->draw = segaic16_sprites_16a_draw; |
| 2905 | | info->ramsize = 0x800; |
| 2906 | | break; |
| 2907 | | |
| 2908 | | case SEGAIC16_SPRITES_16B: |
| 2909 | | info->draw = segaic16_sprites_16b_draw; |
| 2910 | | info->ramsize = 0x800; |
| 2911 | | break; |
| 2912 | | |
| 2913 | | case SEGAIC16_SPRITES_SHARRIER: |
| 2914 | | info->draw = segaic16_sprites_sharrier_draw; |
| 2915 | | info->ramsize = 0x1000; |
| 2916 | | break; |
| 2917 | | |
| 2918 | | case SEGAIC16_SPRITES_OUTRUN: |
| 2919 | | case SEGAIC16_SPRITES_XBOARD: |
| 2920 | | info->draw = segaic16_sprites_outrun_draw; |
| 2921 | | info->ramsize = 0x1000; |
| 2922 | | buffer = 1; |
| 2923 | | break; |
| 2924 | | |
| 2925 | | case SEGAIC16_SPRITES_YBOARD: |
| 2926 | | info->draw = segaic16_sprites_yboard_draw; |
| 2927 | | info->ramsize = 0x10000; |
| 2928 | | break; |
| 2929 | | |
| 2930 | | case SEGAIC16_SPRITES_YBOARD_16B: |
| 2931 | | info->draw = segaic16_sprites_yboard_16b_draw; |
| 2932 | | info->ramsize = 0x800; |
| 2933 | | break; |
| 2934 | | |
| 2935 | | case SEGAIC16_SPRITES_16A_BOOTLEG_WB3BL: |
| 2936 | | info->draw = segaic16_sprites_16a_bootleg_wb3bl_draw; |
| 2937 | | info->ramsize = 0x800; |
| 2938 | | break; |
| 2939 | | |
| 2940 | | case SEGAIC16_SPRITES_16A_BOOTLEG_PASSHTBL: |
| 2941 | | info->draw = segaic16_sprites_16a_bootleg_passhtb_draw; |
| 2942 | | info->ramsize = 0x800; |
| 2943 | | break; |
| 2944 | | |
| 2945 | | case SEGAIC16_SPRITES_16A_BOOTLEG_SHINOBLD: |
| 2946 | | info->draw = segaic16_sprites_16a_bootleg_shinobld_draw; |
| 2947 | | info->ramsize = 0x800; |
| 2948 | | break; |
| 2949 | | |
| 2950 | | default: |
| 2951 | | fatalerror("Invalid sprite system specified in segaic16_sprites_init"); |
| 2952 | | } |
| 2953 | | |
| 2954 | | /* if the sprites need buffering, allocate memory for the buffer */ |
| 2955 | | if (buffer) |
| 2956 | | info->buffer = auto_alloc_array(machine, UINT16, info->ramsize/2); |
| 2957 | | |
| 2958 | | state_save_register_item(machine, "segaic16_sp", NULL, which, info->flip); |
| 2959 | | state_save_register_item(machine, "segaic16_sp", NULL, which, info->shadow); |
| 2960 | | state_save_register_item_array(machine, "segaic16_sp", NULL, which, info->bank); |
| 2961 | | state_save_register_item(machine, "segaic16_sp", NULL, which, info->colorbase); |
| 2962 | | state_save_register_item(machine, "segaic16_sp", NULL, which, info->xoffs); |
| 2963 | | |
| 2964 | | if (buffer) |
| 2965 | | state_save_register_item_pointer(machine, "segaic16_sp", NULL, which, ((UINT8 *) info->buffer), info->ramsize); |
| 2966 | | } |
| 2967 | | |
| 2968 | | |
| 2969 | | |
| 2970 | | /************************************* |
| 2971 | | * |
| 2972 | | * General sprite drawing |
| 2973 | | * |
| 2974 | | *************************************/ |
| 2975 | | |
| 2976 | | void segaic16_sprites_draw(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int which) |
| 2977 | | { |
| 2978 | | struct sprite_info *info = &sprites[which]; |
| 2979 | | (*info->draw)(screen->machine, info, bitmap, cliprect); |
| 2980 | | } |
| 2981 | | |
| 2982 | | |
| 2983 | | |
| 2984 | | /************************************* |
| 2985 | | * |
| 2986 | | * General sprite banking |
| 2987 | | * |
| 2988 | | *************************************/ |
| 2989 | | |
| 2990 | | void segaic16_sprites_set_bank(running_machine *machine, int which, int banknum, int offset) |
| 2991 | | { |
| 2992 | | struct sprite_info *info = &sprites[which]; |
| 2993 | | |
| 2994 | | if (info->bank[banknum] != offset) |
| 2995 | | { |
| 2996 | | running_device *screen = machine->primary_screen; |
| 2997 | | video_screen_update_partial(screen, video_screen_get_vpos(screen)); |
| 2998 | | info->bank[banknum] = offset; |
| 2999 | | } |
| 3000 | | } |
| 3001 | | |
| 3002 | | |
| 3003 | | |
| 3004 | | /************************************* |
| 3005 | | * |
| 3006 | | * General sprite screen flipping |
| 3007 | | * |
| 3008 | | *************************************/ |
| 3009 | | |
| 3010 | | void segaic16_sprites_set_flip(running_machine *machine, int which, int flip) |
| 3011 | | { |
| 3012 | | struct sprite_info *info = &sprites[which]; |
| 3013 | | |
| 3014 | | flip = (flip != 0); |
| 3015 | | if (info->flip != flip) |
| 3016 | | { |
| 3017 | | running_device *screen = machine->primary_screen; |
| 3018 | | video_screen_update_partial(screen, video_screen_get_vpos(screen)); |
| 3019 | | info->flip = flip; |
| 3020 | | } |
| 3021 | | } |
| 3022 | | |
| 3023 | | |
| 3024 | | |
| 3025 | | /************************************* |
| 3026 | | * |
| 3027 | | * General sprite shadows |
| 3028 | | * |
| 3029 | | *************************************/ |
| 3030 | | |
| 3031 | | void segaic16_sprites_set_shadow(running_machine *machine, int which, int shadow) |
| 3032 | | { |
| 3033 | | struct sprite_info *info = &sprites[which]; |
| 3034 | | |
| 3035 | | shadow = (shadow != 0); |
| 3036 | | if (info->shadow != shadow) |
| 3037 | | { |
| 3038 | | running_device *screen = machine->primary_screen; |
| 3039 | | video_screen_update_partial(screen, video_screen_get_vpos(screen)); |
| 3040 | | info->shadow = shadow; |
| 3041 | | } |
| 3042 | | } |
| 3043 | | |
| 3044 | | |
| 3045 | | |
| 3046 | | /************************************* |
| 3047 | | * |
| 3048 | | * General sprite buffer control |
| 3049 | | * |
| 3050 | | *************************************/ |
| 3051 | | |
| 3052 | | static void segaic16_sprites_buffer(struct sprite_info *info) |
| 3053 | | { |
| 3054 | | if (info->buffer) |
| 3055 | | { |
| 3056 | | UINT32 *src = (UINT32 *)info->spriteram; |
| 3057 | | UINT32 *dst = (UINT32 *)info->buffer; |
| 3058 | | int i; |
| 3059 | | |
| 3060 | | /* swap the halves of the sprite RAM */ |
| 3061 | | for (i = 0; i < info->ramsize/4; i++) |
| 3062 | | { |
| 3063 | | UINT32 temp = *src; |
| 3064 | | *src++ = *dst; |
| 3065 | | *dst++ = temp; |
| 3066 | | } |
| 3067 | | |
| 3068 | | /* hack for thunderblade */ |
| 3069 | | *info->spriteram = 0xffff; |
| 3070 | | } |
| 3071 | | |
| 3072 | | /* we will render the sprites when the video update happens */ |
| 3073 | | } |
| 3074 | | |
| 3075 | | |
| 3076 | | WRITE16_HANDLER( segaic16_sprites_draw_0_w ) |
| 3077 | | { |
| 3078 | | segaic16_sprites_buffer(&sprites[0]); |
| 3079 | | } |
| 3080 | | |
| 3081 | | |
| 3082 | | WRITE16_HANDLER( segaic16_sprites_draw_1_w ) |
| 3083 | | { |
| 3084 | | segaic16_sprites_buffer(&sprites[1]); |
| 3085 | | } |
| 3086 | | |
| 3087 | | |
| 3088 | | |
| 3089 | | /******************************************************************************************* |
| 3090 | | * |
| 3091 | 1369 | * Hang On/Space Harrier-style road chip |
| 3092 | 1370 | * |
| 3093 | 1371 | * Road RAM: |
src/mame/video/sega16sp.c
| r0 | r7973 | |
| 1 | #include "emu.h" |
| 2 | #include "segaic16.h" |
| 3 | |
| 4 | |
| 5 | UINT16 *segaic16_spriteram_0; |
| 6 | UINT16 *segaic16_spriteram_1; |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | /***************************************************************************** |
| 12 | INLINE FUNCTIONS |
| 13 | *****************************************************************************/ |
| 14 | |
| 15 | INLINE sega16sp_state *get_safe_token( running_device *device ) |
| 16 | { |
| 17 | assert(device != NULL); |
| 18 | assert(device->token != NULL); |
| 19 | assert(device->type == SEGA16SP); |
| 20 | |
| 21 | return (sega16sp_state *)device->token; |
| 22 | } |
| 23 | |
| 24 | INLINE const sega16sp_interface *get_interface( running_device *device ) |
| 25 | { |
| 26 | assert(device != NULL); |
| 27 | assert((device->type == SEGA16SP)); |
| 28 | return (const sega16sp_interface *) device->baseconfig().static_config; |
| 29 | } |
| 30 | |
| 31 | /******************************************************************************************* |
| 32 | * |
| 33 | * Hang On-style sprites |
| 34 | * |
| 35 | * Offs Bits Usage |
| 36 | * +0 bbbbbbbb -------- Bottom scanline of sprite - 1 |
| 37 | * +0 -------- tttttttt Top scanline of sprite - 1 |
| 38 | * +2 bbbb---- -------- Sprite bank |
| 39 | * +2 -------x xxxxxxxx X position of sprite (position $BD is screen position 0) |
| 40 | * +4 pppppppp pppppppp Signed 16-bit pitch value between scanlines |
| 41 | * +6 -ooooooo oooooooo Offset within selected sprite bank |
| 42 | * +6 f------- -------- Horizontal flip: read the data backwards if set |
| 43 | * +8 --cccccc -------- Sprite color palette |
| 44 | * +8 -------- zzzzzz-- Zoom factor |
| 45 | * +8 -------- ------pp Sprite priority |
| 46 | * +E dddddddd dddddddd Scratch space for current address |
| 47 | * |
| 48 | * Special notes: |
| 49 | * |
| 50 | * There is an interaction between the horizonal flip bit and the offset. |
| 51 | * The offset is maintained as a 16-bit value, even though only the lower |
| 52 | * 15 bits are used for the address. The top bit is used to control flipping. |
| 53 | * This means that if the low 15 bits overflow during rendering, the sprite |
| 54 | * data will be read backwards after the overflow. This is important to |
| 55 | * emulate correctly as many games make use of this feature to render sprites |
| 56 | * at the beginning of a bank. |
| 57 | * |
| 58 | *******************************************************************************************/ |
| 59 | |
| 60 | #define hangon_draw_pixel() \ |
| 61 | /* only draw if onscreen, not 0 or 15 */ \ |
| 62 | if (pix != 0 && pix != 15) \ |
| 63 | { \ |
| 64 | /* are we high enough priority to be visible? */ \ |
| 65 | if (sprpri > pri[x]) \ |
| 66 | { \ |
| 67 | /* shadow/hilight mode? */ \ |
| 68 | if (color == sega16sp->colorbase + (0x3f << 4)) \ |
| 69 | dest[x] += sega16sp->shadow ? palette.entries*2 : palette.entries; \ |
| 70 | \ |
| 71 | /* regular draw */ \ |
| 72 | else \ |
| 73 | dest[x] = pix | color; \ |
| 74 | } \ |
| 75 | \ |
| 76 | /* always mark priority so no one else draws here */ \ |
| 77 | pri[x] = 0xff; \ |
| 78 | } \ |
| 79 | |
| 80 | void segaic16_sprites_hangon_draw(running_machine *machine, running_device *device, bitmap_t *bitmap, const rectangle *cliprect) |
| 81 | { |
| 82 | UINT8 numbanks = memory_region_length(machine, "gfx2") / 0x10000; |
| 83 | const UINT16 *spritebase = (const UINT16 *)memory_region(machine, "gfx2"); |
| 84 | const UINT8 *zoom = (const UINT8 *)memory_region(machine, "proms"); |
| 85 | sega16sp_state *sega16sp = get_safe_token(device); |
| 86 | UINT16* data = sega16sp->spriteram; |
| 87 | |
| 88 | /* first scan forward to find the end of the list */ |
| 89 | for (data = sega16sp->spriteram; data < sega16sp->spriteram + sega16sp->ramsize/2; data += 8) |
| 90 | if ((data[0] >> 8) > 0xf0) |
| 91 | break; |
| 92 | |
| 93 | /* now scan backwards and render the sprites in order */ |
| 94 | for (data -= 8; data >= sega16sp->spriteram; data -= 8) |
| 95 | { |
| 96 | int bottom = (data[0] >> 8) + 1; |
| 97 | int top = (data[0] & 0xff) + 1; |
| 98 | int bank = sega16sp->bank[(data[1] >> 12) & 0xf]; |
| 99 | int xpos = (data[1] & 0x1ff) - 0xbd; |
| 100 | int pitch = (INT16)data[2]; |
| 101 | UINT16 addr = data[3]; |
| 102 | int color = sega16sp->colorbase + (((data[4] >> 8) & 0x3f) << 4); |
| 103 | int vzoom = (data[4] >> 2) & 0x3f; |
| 104 | int hzoom = vzoom << 1; |
| 105 | int sprpri = 1 << ((data[4] >> 0) & 0x3); |
| 106 | int x, y, pix, zaddr, zmask; |
| 107 | const UINT16 *spritedata; |
| 108 | |
| 109 | /* initialize the end address to the start address */ |
| 110 | data[7] = addr; |
| 111 | |
| 112 | /* if hidden, or top greater than/equal to bottom, or invalid bank, punt */ |
| 113 | if ((top >= bottom) || bank == 255) |
| 114 | continue; |
| 115 | |
| 116 | /* clamp to within the memory region size */ |
| 117 | if (numbanks) |
| 118 | bank %= numbanks; |
| 119 | spritedata = spritebase + 0x8000 * bank; |
| 120 | |
| 121 | /* determine the starting zoom address and mask */ |
| 122 | zaddr = (vzoom & 0x38) << 5; |
| 123 | zmask = 1 << (vzoom & 7); |
| 124 | |
| 125 | /* loop from top to bottom */ |
| 126 | for (y = top; y < bottom; y++) |
| 127 | { |
| 128 | /* advance a row */ |
| 129 | addr += pitch; |
| 130 | |
| 131 | /* if the zoom bit says so, add pitch a second time */ |
| 132 | if (zoom[zaddr++] & zmask) |
| 133 | addr += pitch; |
| 134 | |
| 135 | /* skip drawing if not within the cliprect */ |
| 136 | if (y >= cliprect->min_y && y <= cliprect->max_y) |
| 137 | { |
| 138 | UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0); |
| 139 | UINT8 *pri = BITMAP_ADDR8(machine->priority_bitmap, y, 0); |
| 140 | int xacc = 0x00; |
| 141 | |
| 142 | /* note that the System 16A sprites have a design flaw that allows the address */ |
| 143 | /* to carry into the flip flag, which is the topmost bit -- it is very important */ |
| 144 | /* to emulate this as the games compensate for it */ |
| 145 | |
| 146 | /* non-flipped case */ |
| 147 | if (!(addr & 0x8000)) |
| 148 | { |
| 149 | /* start at the word before because we preincrement below */ |
| 150 | data[7] = addr - 1; |
| 151 | for (x = xpos; x <= cliprect->max_x; ) |
| 152 | { |
| 153 | UINT16 pixels = spritedata[++data[7] & 0x7fff]; |
| 154 | |
| 155 | /* draw four pixels */ |
| 156 | pix = (pixels >> 12) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) hangon_draw_pixel(); x++; } |
| 157 | pix = (pixels >> 8) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) hangon_draw_pixel(); x++; } |
| 158 | pix = (pixels >> 4) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) hangon_draw_pixel(); x++; } |
| 159 | pix = (pixels >> 0) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) hangon_draw_pixel(); x++; } |
| 160 | |
| 161 | /* stop if the last pixel in the group was 0xf */ |
| 162 | if (pix == 15) |
| 163 | break; |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | /* flipped case */ |
| 168 | else |
| 169 | { |
| 170 | /* start at the word after because we predecrement below */ |
| 171 | data[7] = addr + 1; |
| 172 | for (x = xpos; x <= cliprect->max_x; ) |
| 173 | { |
| 174 | UINT16 pixels = spritedata[--data[7] & 0x7fff]; |
| 175 | |
| 176 | /* draw four pixels */ |
| 177 | pix = (pixels >> 0) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) hangon_draw_pixel(); x++; } |
| 178 | pix = (pixels >> 4) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) hangon_draw_pixel(); x++; } |
| 179 | pix = (pixels >> 8) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) hangon_draw_pixel(); x++; } |
| 180 | pix = (pixels >> 12) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) hangon_draw_pixel(); x++; } |
| 181 | |
| 182 | /* stop if the last pixel in the group was 0xf */ |
| 183 | if (pix == 15) |
| 184 | break; |
| 185 | } |
| 186 | } |
| 187 | } |
| 188 | } |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | |
| 193 | |
| 194 | /******************************************************************************************* |
| 195 | * |
| 196 | * Space Harrier-style sprites |
| 197 | * |
| 198 | * Offs Bits Usage |
| 199 | * +0 bbbbbbbb -------- Bottom scanline of sprite - 1 |
| 200 | * +0 -------- tttttttt Top scanline of sprite - 1 |
| 201 | * +2 bbbb---- -------- Sprite bank |
| 202 | * +2 -------x xxxxxxxx X position of sprite (position $BD is screen position 0) |
| 203 | * +4 s------- -------- Sprite shadow enable (0=enable, 1=disable) |
| 204 | * +4 -p------ -------- Sprite priority |
| 205 | * +4 --cccccc -------- Sprite color palette |
| 206 | * +4 -------- -ppppppp Signed 7-bit pitch value between scanlines |
| 207 | * +6 f------- -------- Horizontal flip: read the data backwards if set |
| 208 | * +6 -ooooooo oooooooo Offset within selected sprite bank |
| 209 | * +8 --zzzzzz -------- Horizontal zoom factor |
| 210 | * +8 -------- --zzzzzz Vertical zoom factor |
| 211 | * +E dddddddd dddddddd Scratch space for current address |
| 212 | * |
| 213 | * Special notes: |
| 214 | * |
| 215 | * There is an interaction between the horizonal flip bit and the offset. |
| 216 | * The offset is maintained as a 16-bit value, even though only the lower |
| 217 | * 15 bits are used for the address. The top bit is used to control flipping. |
| 218 | * This means that if the low 15 bits overflow during rendering, the sprite |
| 219 | * data will be read backwards after the overflow. This is important to |
| 220 | * emulate correctly as many games make use of this feature to render sprites |
| 221 | * at the beginning of a bank. |
| 222 | * |
| 223 | *******************************************************************************************/ |
| 224 | |
| 225 | #define sharrier_draw_pixel() \ |
| 226 | /* only draw if onscreen, not 0 or 15 */ \ |
| 227 | if (pix != 0 && pix != 15) \ |
| 228 | { \ |
| 229 | /* are we high enough priority to be visible? */ \ |
| 230 | if (sprpri > pri[x]) \ |
| 231 | { \ |
| 232 | /* shadow/hilight mode? */ \ |
| 233 | if (shadow && pix == 0xa) \ |
| 234 | dest[x] += (segaic16_paletteram[dest[x]] & 0x8000) ? palette.entries*2 : palette.entries; \ |
| 235 | \ |
| 236 | /* regular draw */ \ |
| 237 | else \ |
| 238 | dest[x] = pix | color; \ |
| 239 | } \ |
| 240 | \ |
| 241 | /* always mark priority so no one else draws here */ \ |
| 242 | pri[x] = 0xff; \ |
| 243 | } \ |
| 244 | |
| 245 | void segaic16_sprites_sharrier_draw(running_machine *machine, running_device *device, bitmap_t *bitmap, const rectangle *cliprect) |
| 246 | { |
| 247 | UINT8 numbanks = memory_region_length(machine, "gfx2") / 0x20000; |
| 248 | const UINT32 *spritebase = (const UINT32 *)memory_region(machine, "gfx2"); |
| 249 | const UINT8 *zoom = (const UINT8 *)memory_region(machine, "proms"); |
| 250 | sega16sp_state *sega16sp = get_safe_token(device); |
| 251 | UINT16* data = sega16sp->spriteram; |
| 252 | |
| 253 | /* first scan forward to find the end of the list */ |
| 254 | for (data = sega16sp->spriteram; data < sega16sp->spriteram + sega16sp->ramsize/2; data += 8) |
| 255 | if ((data[0] >> 8) > 0xf0) |
| 256 | break; |
| 257 | |
| 258 | /* now scan backwards and render the sprites in order */ |
| 259 | for (data -= 8; data >= sega16sp->spriteram; data -= 8) |
| 260 | { |
| 261 | int bottom = (data[0] >> 8) + 1; |
| 262 | int top = (data[0] & 0xff) + 1; |
| 263 | int bank = sega16sp->bank[(data[1] >> 12) & 0x7]; |
| 264 | int xpos = (data[1] & 0x1ff) - 0xbd; |
| 265 | int shadow = (~data[2] >> 15) & 1; |
| 266 | int sprpri = ((data[2] >> 14) & 1) ? (1<<3) : (1<<1); |
| 267 | int color = sega16sp->colorbase + (((data[2] >> 8) & 0x3f) << 4); |
| 268 | int pitch = (INT16)(data[2] << 9) >> 9; |
| 269 | UINT16 addr = data[3]; |
| 270 | int hzoom = ((data[4] >> 8) & 0x3f) << 1; |
| 271 | int vzoom = (data[4] >> 0) & 0x3f; |
| 272 | int x, y, pix, zaddr, zmask; |
| 273 | const UINT32 *spritedata; |
| 274 | |
| 275 | /* initialize the end address to the start address */ |
| 276 | data[7] = addr; |
| 277 | |
| 278 | /* if hidden, or top greater than/equal to bottom, or invalid bank, punt */ |
| 279 | if ((top >= bottom) || bank == 255) |
| 280 | continue; |
| 281 | |
| 282 | /* clamp to within the memory region size */ |
| 283 | if (numbanks) |
| 284 | bank %= numbanks; |
| 285 | spritedata = spritebase + 0x8000 * bank; |
| 286 | |
| 287 | /* determine the starting zoom address and mask */ |
| 288 | zaddr = (vzoom & 0x38) << 5; |
| 289 | zmask = 1 << (vzoom & 7); |
| 290 | |
| 291 | /* loop from top to bottom */ |
| 292 | for (y = top; y < bottom; y++) |
| 293 | { |
| 294 | /* advance a row */ |
| 295 | addr += pitch; |
| 296 | |
| 297 | /* if the zoom bit says so, add pitch a second time */ |
| 298 | if (zoom[zaddr++] & zmask) |
| 299 | addr += pitch; |
| 300 | |
| 301 | /* skip drawing if not within the cliprect */ |
| 302 | if (y >= cliprect->min_y && y <= cliprect->max_y) |
| 303 | { |
| 304 | UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0); |
| 305 | UINT8 *pri = BITMAP_ADDR8(machine->priority_bitmap, y, 0); |
| 306 | int xacc = 0x00; |
| 307 | |
| 308 | /* note that the System 16A sprites have a design flaw that allows the address */ |
| 309 | /* to carry into the flip flag, which is the topmost bit -- it is very important */ |
| 310 | /* to emulate this as the games compensate for it */ |
| 311 | |
| 312 | /* non-flipped case */ |
| 313 | if (!(addr & 0x8000)) |
| 314 | { |
| 315 | /* start at the word before because we preincrement below */ |
| 316 | data[7] = addr - 1; |
| 317 | for (x = xpos; x <= cliprect->max_x; ) |
| 318 | { |
| 319 | UINT32 pixels = spritedata[++data[7] & 0x7fff]; |
| 320 | |
| 321 | /* draw 8 pixels */ |
| 322 | pix = (pixels >> 28) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; } |
| 323 | pix = (pixels >> 24) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; } |
| 324 | pix = (pixels >> 20) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; } |
| 325 | pix = (pixels >> 16) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; } |
| 326 | pix = (pixels >> 12) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; } |
| 327 | pix = (pixels >> 8) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; } |
| 328 | pix = (pixels >> 4) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; } |
| 329 | pix = (pixels >> 0) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; } |
| 330 | |
| 331 | /* stop if the last pixel in the group was 0xf */ |
| 332 | if (pix == 15) |
| 333 | break; |
| 334 | } |
| 335 | } |
| 336 | |
| 337 | /* flipped case */ |
| 338 | else |
| 339 | { |
| 340 | /* start at the word after because we predecrement below */ |
| 341 | data[7] = addr + 1; |
| 342 | for (x = xpos; x <= cliprect->max_x; ) |
| 343 | { |
| 344 | UINT32 pixels = spritedata[--data[7] & 0x7fff]; |
| 345 | |
| 346 | /* draw 8 pixels */ |
| 347 | pix = (pixels >> 0) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; } |
| 348 | pix = (pixels >> 4) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; } |
| 349 | pix = (pixels >> 8) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; } |
| 350 | pix = (pixels >> 12) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; } |
| 351 | pix = (pixels >> 16) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; } |
| 352 | pix = (pixels >> 20) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; } |
| 353 | pix = (pixels >> 24) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; } |
| 354 | pix = (pixels >> 28) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; } |
| 355 | |
| 356 | /* stop if the last pixel in the group was 0xf */ |
| 357 | if (pix == 15) |
| 358 | break; |
| 359 | } |
| 360 | } |
| 361 | } |
| 362 | } |
| 363 | } |
| 364 | } |
| 365 | |
| 366 | |
| 367 | |
| 368 | /******************************************************************************************* |
| 369 | * |
| 370 | * System 16A-style sprites |
| 371 | * |
| 372 | * Offs Bits Usage |
| 373 | * +0 bbbbbbbb -------- Bottom scanline of sprite - 1 |
| 374 | * +0 -------- tttttttt Top scanline of sprite - 1 |
| 375 | * +2 -------x xxxxxxxx X position of sprite (position $BD is screen position 0) |
| 376 | * +4 pppppppp pppppppp Signed 16-bit pitch value between scanlines |
| 377 | * +6 -ooooooo oooooooo Offset within selected sprite bank |
| 378 | * +6 f------- -------- Horizontal flip: read the data backwards if set |
| 379 | * +8 --cccccc -------- Sprite color palette |
| 380 | * +8 -------- -bbb---- Sprite bank |
| 381 | * +8 -------- ------pp Sprite priority |
| 382 | * +E dddddddd dddddddd Scratch space for current address |
| 383 | * |
| 384 | * Special notes: |
| 385 | * |
| 386 | * There is an interaction between the horizonal flip bit and the offset. |
| 387 | * The offset is maintained as a 16-bit value, even though only the lower |
| 388 | * 15 bits are used for the address. The top bit is used to control flipping. |
| 389 | * This means that if the low 15 bits overflow during rendering, the sprite |
| 390 | * data will be read backwards after the overflow. This is important to |
| 391 | * emulate correctly as many games make use of this feature to render sprites |
| 392 | * at the beginning of a bank. |
| 393 | * |
| 394 | *******************************************************************************************/ |
| 395 | |
| 396 | #define system16a_draw_pixel() \ |
| 397 | /* only draw if onscreen, not 0 or 15 */ \ |
| 398 | if (x >= cliprect->min_x && x <= cliprect->max_x && pix != 0 && pix != 15) \ |
| 399 | { \ |
| 400 | /* are we high enough priority to be visible? */ \ |
| 401 | if (sprpri > pri[x]) \ |
| 402 | { \ |
| 403 | /* shadow/hilight mode? */ \ |
| 404 | if (color == sega16sp->colorbase + (0x3f << 4)) \ |
| 405 | dest[x] += (segaic16_paletteram[dest[x]] & 0x8000) ? palette.entries*2 : palette.entries; \ |
| 406 | \ |
| 407 | /* regular draw */ \ |
| 408 | else \ |
| 409 | dest[x] = pix | color; \ |
| 410 | } \ |
| 411 | \ |
| 412 | /* always mark priority so no one else draws here */ \ |
| 413 | pri[x] = 0xff; \ |
| 414 | } \ |
| 415 | |
| 416 | void segaic16_sprites_16a_draw(running_machine *machine, running_device *device, bitmap_t *bitmap, const rectangle *cliprect) |
| 417 | { |
| 418 | UINT8 numbanks = memory_region_length(machine, "gfx2") / 0x10000; |
| 419 | const UINT16 *spritebase = (const UINT16 *)memory_region(machine, "gfx2"); |
| 420 | sega16sp_state *sega16sp = get_safe_token(device); |
| 421 | UINT16* data = sega16sp->spriteram; |
| 422 | |
| 423 | /* first scan forward to find the end of the list */ |
| 424 | for (data = sega16sp->spriteram; data < sega16sp->spriteram + sega16sp->ramsize/2; data += 8) |
| 425 | if ((data[0] >> 8) > 0xf0) |
| 426 | break; |
| 427 | |
| 428 | /* now scan backwards and render the sprites in order */ |
| 429 | for (data -= 8; data >= sega16sp->spriteram; data -= 8) |
| 430 | { |
| 431 | int bottom = (data[0] >> 8) + 1; |
| 432 | int top = (data[0] & 0xff) + 1; |
| 433 | int xpos = (data[1] & 0x1ff) - 0xbd; |
| 434 | int pitch = (INT16)data[2]; |
| 435 | UINT16 addr = data[3]; |
| 436 | int color = sega16sp->colorbase + (((data[4] >> 8) & 0x3f) << 4); |
| 437 | int bank = sega16sp->bank[(data[4] >> 4) & 0x7]; |
| 438 | int sprpri = 1 << ((data[4] >> 0) & 0x3); |
| 439 | const UINT16 *spritedata; |
| 440 | int x, y, pix, xdelta = 1; |
| 441 | |
| 442 | /* initialize the end address to the start address */ |
| 443 | data[7] = addr; |
| 444 | |
| 445 | /* if hidden, or top greater than/equal to bottom, or invalid bank, punt */ |
| 446 | if ((top >= bottom) || bank == 255) |
| 447 | continue; |
| 448 | |
| 449 | /* clamp to within the memory region size */ |
| 450 | if (numbanks) |
| 451 | bank %= numbanks; |
| 452 | spritedata = spritebase + 0x8000 * bank; |
| 453 | |
| 454 | /* adjust positions for screen flipping */ |
| 455 | if (sega16sp->flip) |
| 456 | { |
| 457 | int temp = top; |
| 458 | top = 224 - bottom; |
| 459 | bottom = 224 - temp; |
| 460 | xpos = 320 - xpos; |
| 461 | xdelta = -1; |
| 462 | } |
| 463 | |
| 464 | /* loop from top to bottom */ |
| 465 | for (y = top; y < bottom; y++) |
| 466 | { |
| 467 | /* advance a row */ |
| 468 | addr += pitch; |
| 469 | |
| 470 | /* skip drawing if not within the cliprect */ |
| 471 | if (y >= cliprect->min_y && y <= cliprect->max_y) |
| 472 | { |
| 473 | UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0); |
| 474 | UINT8 *pri = BITMAP_ADDR8(machine->priority_bitmap, y, 0); |
| 475 | |
| 476 | /* note that the System 16A sprites have a design flaw that allows the address */ |
| 477 | /* to carry into the flip flag, which is the topmost bit -- it is very important */ |
| 478 | /* to emulate this as the games compensate for it */ |
| 479 | |
| 480 | /* non-flipped case */ |
| 481 | if (!(addr & 0x8000)) |
| 482 | { |
| 483 | /* start at the word before because we preincrement below */ |
| 484 | data[7] = addr - 1; |
| 485 | for (x = xpos; ((xpos - x) & 0x1ff) != 1; ) |
| 486 | { |
| 487 | UINT16 pixels = spritedata[++data[7] & 0x7fff]; |
| 488 | |
| 489 | /* draw four pixels */ |
| 490 | pix = (pixels >> 12) & 0xf; system16a_draw_pixel(); x += xdelta; |
| 491 | pix = (pixels >> 8) & 0xf; system16a_draw_pixel(); x += xdelta; |
| 492 | pix = (pixels >> 4) & 0xf; system16a_draw_pixel(); x += xdelta; |
| 493 | pix = (pixels >> 0) & 0xf; system16a_draw_pixel(); x += xdelta; |
| 494 | |
| 495 | /* stop if the last pixel in the group was 0xf */ |
| 496 | if (pix == 15) |
| 497 | break; |
| 498 | } |
| 499 | } |
| 500 | |
| 501 | /* flipped case */ |
| 502 | else |
| 503 | { |
| 504 | /* start at the word after because we predecrement below */ |
| 505 | data[7] = addr + 1; |
| 506 | for (x = xpos; ((xpos - x) & 0x1ff) != 1; ) |
| 507 | { |
| 508 | UINT16 pixels = spritedata[--data[7] & 0x7fff]; |
| 509 | |
| 510 | /* draw four pixels */ |
| 511 | pix = (pixels >> 0) & 0xf; system16a_draw_pixel(); x += xdelta; |
| 512 | pix = (pixels >> 4) & 0xf; system16a_draw_pixel(); x += xdelta; |
| 513 | pix = (pixels >> 8) & 0xf; system16a_draw_pixel(); x += xdelta; |
| 514 | pix = (pixels >> 12) & 0xf; system16a_draw_pixel(); x += xdelta; |
| 515 | |
| 516 | /* stop if the last pixel in the group was 0xf */ |
| 517 | if (pix == 15) |
| 518 | break; |
| 519 | } |
| 520 | } |
| 521 | } |
| 522 | } |
| 523 | } |
| 524 | } |
| 525 | |
| 526 | |
| 527 | |
| 528 | /******************************************************************************************* |
| 529 | * |
| 530 | * System 16B-style sprites |
| 531 | * |
| 532 | * Offs Bits Usage |
| 533 | * +0 bbbbbbbb -------- Bottom scanline of sprite - 1 |
| 534 | * +0 -------- tttttttt Top scanline of sprite - 1 |
| 535 | * +2 -------x xxxxxxxx X position of sprite (position $BD is screen position 0) |
| 536 | * +4 e------- -------- Signify end of sprite list |
| 537 | * +4 -h------ -------- Hide this sprite |
| 538 | * +4 -------f -------- Horizontal flip: read the data backwards if set |
| 539 | * +4 -------- pppppppp Signed 8-bit pitch value between scanlines |
| 540 | * +6 oooooooo oooooooo Offset within selected sprite bank |
| 541 | * +8 ----bbbb -------- Sprite bank |
| 542 | * +8 -------- pp------ Sprite priority, relative to tilemaps |
| 543 | * +8 -------- --cccccc Sprite color palette |
| 544 | * +A ------vv vvv----- Vertical zoom factor (0 = full size, 0x10 = half size) |
| 545 | * +A -------- ---hhhhh Horizontal zoom factor (0 = full size, 0x10 = half size) |
| 546 | * +E dddddddd dddddddd Scratch space for current address |
| 547 | * |
| 548 | * Note that the zooming described below is 100% accurate to the real board. |
| 549 | * |
| 550 | *******************************************************************************************/ |
| 551 | |
| 552 | #define system16b_draw_pixel() \ |
| 553 | /* only draw if onscreen, not 0 or 15 */ \ |
| 554 | if (x >= cliprect->min_x && x <= cliprect->max_x && pix != 0 && pix != 15) \ |
| 555 | { \ |
| 556 | /* are we high enough priority to be visible? */ \ |
| 557 | if (sprpri > pri[x]) \ |
| 558 | { \ |
| 559 | /* shadow/hilight mode? */ \ |
| 560 | if (color == sega16sp->colorbase + (0x3f << 4)) \ |
| 561 | { \ |
| 562 | /* we have to check this for System 18 so that we don't */ \ |
| 563 | /* attempt to shadow VDP pixels */ \ |
| 564 | if (dest[x] < palette.entries) \ |
| 565 | dest[x] += (segaic16_paletteram[dest[x]] & 0x8000) ? palette.entries*2 : palette.entries; \ |
| 566 | } \ |
| 567 | \ |
| 568 | /* regular draw */ \ |
| 569 | else \ |
| 570 | dest[x] = pix | color; \ |
| 571 | } \ |
| 572 | \ |
| 573 | /* always mark priority so no one else draws here */ \ |
| 574 | pri[x] = 0xff; \ |
| 575 | } \ |
| 576 | |
| 577 | void segaic16_sprites_16b_draw(running_machine *machine, running_device *device, bitmap_t *bitmap, const rectangle *cliprect) |
| 578 | { |
| 579 | UINT8 numbanks; |
| 580 | const UINT16 *spritebase; |
| 581 | sega16sp_state *sega16sp = get_safe_token(device); |
| 582 | UINT16* data = sega16sp->spriteram; |
| 583 | |
| 584 | spritebase = (const UINT16 *)memory_region(machine, "gfx2"); |
| 585 | if (!spritebase) |
| 586 | return; |
| 587 | |
| 588 | numbanks = memory_region_length(machine, "gfx2") / 0x20000; |
| 589 | |
| 590 | /* first scan forward to find the end of the list */ |
| 591 | for (data = sega16sp->spriteram; data < sega16sp->spriteram + sega16sp->ramsize/2; data += 8) |
| 592 | if (data[2] & 0x8000) |
| 593 | break; |
| 594 | |
| 595 | /* now scan backwards and render the sprites in order */ |
| 596 | for (data -= 8; data >= sega16sp->spriteram; data -= 8) |
| 597 | { |
| 598 | int bottom = data[0] >> 8; |
| 599 | int top = data[0] & 0xff; |
| 600 | int xpos = (data[1] & 0x1ff); |
| 601 | int hide = data[2] & 0x4000; |
| 602 | int flip = data[2] & 0x100; |
| 603 | int pitch = (INT8)(data[2] & 0xff); |
| 604 | UINT16 addr = data[3]; |
| 605 | int bank = sega16sp->bank[(data[4] >> 8) & 0xf]; |
| 606 | int sprpri = 1 << ((data[4] >> 6) & 0x3); |
| 607 | int color = sega16sp->colorbase + ((data[4] & 0x3f) << 4); |
| 608 | int vzoom = (data[5] >> 5) & 0x1f; |
| 609 | int hzoom = data[5] & 0x1f; |
| 610 | const UINT16 *spritedata; |
| 611 | int x, y, pix, xdelta = 1; |
| 612 | |
| 613 | /* some bootlegs have offset sprites */ |
| 614 | xpos += sega16sp->xoffs; |
| 615 | xpos &= 0x1ff; |
| 616 | |
| 617 | /* originals all have this offset */ |
| 618 | xpos -= 0xb8; |
| 619 | |
| 620 | /* initialize the end address to the start address */ |
| 621 | data[7] = addr; |
| 622 | |
| 623 | /* if hidden, or top greater than/equal to bottom, or invalid bank, punt */ |
| 624 | if (hide || (top >= bottom) || bank == 255) |
| 625 | continue; |
| 626 | |
| 627 | /* clamp to within the memory region size */ |
| 628 | if (numbanks) |
| 629 | bank %= numbanks; |
| 630 | spritedata = spritebase + 0x10000 * bank; |
| 631 | |
| 632 | /* reset the yzoom counter */ |
| 633 | data[5] &= 0x03ff; |
| 634 | |
| 635 | /* adjust positions for screen flipping */ |
| 636 | if (sega16sp->flip) |
| 637 | { |
| 638 | int temp = top; |
| 639 | top = 224 - bottom; |
| 640 | bottom = 224 - temp; |
| 641 | xpos = 320 - xpos; |
| 642 | xdelta = -1; |
| 643 | } |
| 644 | |
| 645 | /* loop from top to bottom */ |
| 646 | for (y = top; y < bottom; y++) |
| 647 | { |
| 648 | /* advance a row */ |
| 649 | addr += pitch; |
| 650 | |
| 651 | /* accumulate zoom factors; if we carry into the high bit, skip an extra row */ |
| 652 | data[5] += vzoom << 10; |
| 653 | if (data[5] & 0x8000) |
| 654 | { |
| 655 | addr += pitch; |
| 656 | data[5] &= ~0x8000; |
| 657 | } |
| 658 | |
| 659 | /* skip drawing if not within the cliprect */ |
| 660 | if (y >= cliprect->min_y && y <= cliprect->max_y) |
| 661 | { |
| 662 | UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0); |
| 663 | UINT8 *pri = BITMAP_ADDR8(machine->priority_bitmap, y, 0); |
| 664 | int xacc; |
| 665 | |
| 666 | /* compute the initial X zoom accumulator; this is verified on the real PCB */ |
| 667 | xacc = 4 * hzoom; |
| 668 | |
| 669 | /* non-flipped case */ |
| 670 | if (!flip) |
| 671 | { |
| 672 | /* start at the word before because we preincrement below */ |
| 673 | data[7] = addr - 1; |
| 674 | for (x = xpos; ((xpos - x) & 0x1ff) != 1; ) |
| 675 | { |
| 676 | UINT16 pixels = spritedata[++data[7]]; |
| 677 | |
| 678 | /* draw four pixels */ |
| 679 | pix = (pixels >> 12) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { system16b_draw_pixel(); x += xdelta; } |
| 680 | pix = (pixels >> 8) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { system16b_draw_pixel(); x += xdelta; } |
| 681 | pix = (pixels >> 4) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { system16b_draw_pixel(); x += xdelta; } |
| 682 | pix = (pixels >> 0) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { system16b_draw_pixel(); x += xdelta; } |
| 683 | |
| 684 | /* stop if the last pixel in the group was 0xf */ |
| 685 | if (pix == 15) |
| 686 | break; |
| 687 | } |
| 688 | } |
| 689 | |
| 690 | /* flipped case */ |
| 691 | else |
| 692 | { |
| 693 | /* start at the word after because we predecrement below */ |
| 694 | data[7] = addr + 1; |
| 695 | for (x = xpos; ((xpos - x) & 0x1ff) != 1; ) |
| 696 | { |
| 697 | UINT16 pixels = spritedata[--data[7]]; |
| 698 | |
| 699 | /* draw four pixels */ |
| 700 | pix = (pixels >> 0) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { system16b_draw_pixel(); x += xdelta; } |
| 701 | pix = (pixels >> 4) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { system16b_draw_pixel(); x += xdelta; } |
| 702 | pix = (pixels >> 8) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { system16b_draw_pixel(); x += xdelta; } |
| 703 | pix = (pixels >> 12) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { system16b_draw_pixel(); x += xdelta; } |
| 704 | |
| 705 | /* stop if the last pixel in the group was 0xf */ |
| 706 | if (pix == 15) |
| 707 | break; |
| 708 | } |
| 709 | } |
| 710 | } |
| 711 | } |
| 712 | } |
| 713 | } |
| 714 | |
| 715 | |
| 716 | /******************************************************************************************* |
| 717 | * |
| 718 | * The Y-board variant has different mixing properties. The sprite implementation itself |
| 719 | * is identical, however. |
| 720 | * |
| 721 | *******************************************************************************************/ |
| 722 | |
| 723 | #define yboard_16b_draw_pixel() \ |
| 724 | /* only draw if onscreen, not 0 or 15 */ \ |
| 725 | if (x >= cliprect->min_x && x <= cliprect->max_x && pix != 0 && pix != 15) \ |
| 726 | { \ |
| 727 | /* are we high enough priority to be visible? */ \ |
| 728 | if ((sprpri & 0x1f) < (pri[x] & 0x1f)) \ |
| 729 | { \ |
| 730 | /* shadow/hilight mode? */ \ |
| 731 | if (pix == 14) \ |
| 732 | dest[x] += (segaic16_paletteram[dest[x]] & 0x8000) ? palette.entries*2 : palette.entries; \ |
| 733 | \ |
| 734 | /* regular draw */ \ |
| 735 | else \ |
| 736 | dest[x] = pix | color; \ |
| 737 | } \ |
| 738 | \ |
| 739 | /* always mark priority so no one else draws here */ \ |
| 740 | pri[x] = 0; \ |
| 741 | } \ |
| 742 | |
| 743 | void segaic16_sprites_yboard_16b_draw(running_machine *machine, running_device *device, bitmap_t *bitmap, const rectangle *cliprect) |
| 744 | { |
| 745 | UINT8 numbanks = memory_region_length(machine, "gfx2") / 0x20000; |
| 746 | const UINT16 *spritebase = (const UINT16 *)memory_region(machine, "gfx2"); |
| 747 | sega16sp_state *sega16sp = get_safe_token(device); |
| 748 | UINT16* data = sega16sp->spriteram; |
| 749 | |
| 750 | /* first scan forward to find the end of the list */ |
| 751 | for (data = sega16sp->spriteram; data < sega16sp->spriteram + sega16sp->ramsize/2; data += 8) |
| 752 | if (data[2] & 0x8000) |
| 753 | break; |
| 754 | |
| 755 | /* now scan backwards and render the sprites in order */ |
| 756 | for (data -= 8; data >= sega16sp->spriteram; data -= 8) |
| 757 | { |
| 758 | int bottom = data[0] >> 8; |
| 759 | int top = data[0] & 0xff; |
| 760 | int xpos = (data[1] & 0x1ff) - 0xb8; |
| 761 | int sprpri = (data[1] >> 8) & 0x1e; // 0x00 = high, 0x7f = low -- 0x71 = ship in gforce, 0x31 = strike fighter logo |
| 762 | int hide = data[2] & 0x4000; |
| 763 | int flip = data[2] & 0x100; |
| 764 | int pitch = (INT8)(data[2] & 0xff); |
| 765 | UINT16 addr = data[3]; |
| 766 | int bank = sega16sp->bank[(data[4] >> 8) & 0xf]; |
| 767 | int color = sega16sp->colorbase + ((data[4] & 0x7f) << 4); |
| 768 | int vzoom = (data[5] >> 5) & 0x1f; |
| 769 | int hzoom = data[5] & 0x1f; |
| 770 | const UINT16 *spritedata; |
| 771 | int x, y, pix, xdelta = 1; |
| 772 | |
| 773 | /* initialize the end address to the start address */ |
| 774 | data[7] = addr; |
| 775 | |
| 776 | /* if hidden, or top greater than/equal to bottom, or invalid bank, punt */ |
| 777 | if (hide || (top >= bottom) || bank == 255) |
| 778 | continue; |
| 779 | |
| 780 | /* clamp to within the memory region size */ |
| 781 | if (numbanks) |
| 782 | bank %= numbanks; |
| 783 | spritedata = spritebase + 0x10000 * bank; |
| 784 | |
| 785 | /* reset the yzoom counter */ |
| 786 | data[5] &= 0x03ff; |
| 787 | |
| 788 | /* adjust positions for screen flipping */ |
| 789 | if (sega16sp->flip) |
| 790 | { |
| 791 | int temp = top; |
| 792 | top = 224 - bottom; |
| 793 | bottom = 224 - temp; |
| 794 | xpos = 320 - xpos; |
| 795 | xdelta = -1; |
| 796 | } |
| 797 | |
| 798 | /* loop from top to bottom */ |
| 799 | for (y = top; y < bottom; y++) |
| 800 | { |
| 801 | /* advance a row */ |
| 802 | addr += pitch; |
| 803 | |
| 804 | /* accumulate zoom factors; if we carry into the high bit, skip an extra row */ |
| 805 | data[5] += vzoom << 10; |
| 806 | if (data[5] & 0x8000) |
| 807 | { |
| 808 | addr += pitch; |
| 809 | data[5] &= ~0x8000; |
| 810 | } |
| 811 | |
| 812 | /* skip drawing if not within the cliprect */ |
| 813 | if (y >= cliprect->min_y && y <= cliprect->max_y) |
| 814 | { |
| 815 | UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0); |
| 816 | UINT8 *pri = BITMAP_ADDR8(machine->priority_bitmap, y, 0); |
| 817 | int xacc; |
| 818 | |
| 819 | /* compute the initial X zoom accumulator; this is verified on the real PCB */ |
| 820 | xacc = 4 * hzoom; |
| 821 | |
| 822 | /* non-flipped case */ |
| 823 | if (!flip) |
| 824 | { |
| 825 | /* start at the word before because we preincrement below */ |
| 826 | data[7] = addr - 1; |
| 827 | for (x = xpos; ((xpos - x) & 0x1ff) != 1; ) |
| 828 | { |
| 829 | UINT16 pixels = spritedata[++data[7]]; |
| 830 | |
| 831 | /* draw four pixels */ |
| 832 | pix = (pixels >> 12) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { yboard_16b_draw_pixel(); x += xdelta; } |
| 833 | pix = (pixels >> 8) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { yboard_16b_draw_pixel(); x += xdelta; } |
| 834 | pix = (pixels >> 4) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { yboard_16b_draw_pixel(); x += xdelta; } |
| 835 | pix = (pixels >> 0) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { yboard_16b_draw_pixel(); x += xdelta; } |
| 836 | |
| 837 | /* stop if the last pixel in the group was 0xf */ |
| 838 | if (pix == 15) |
| 839 | break; |
| 840 | } |
| 841 | } |
| 842 | |
| 843 | /* flipped case */ |
| 844 | else |
| 845 | { |
| 846 | /* start at the word after because we predecrement below */ |
| 847 | data[7] = addr + 1; |
| 848 | for (x = xpos; ((xpos - x) & 0x1ff) != 1; ) |
| 849 | { |
| 850 | UINT16 pixels = spritedata[--data[7]]; |
| 851 | |
| 852 | /* draw four pixels */ |
| 853 | pix = (pixels >> 0) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { yboard_16b_draw_pixel(); x += xdelta; } |
| 854 | pix = (pixels >> 4) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { yboard_16b_draw_pixel(); x += xdelta; } |
| 855 | pix = (pixels >> 8) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { yboard_16b_draw_pixel(); x += xdelta; } |
| 856 | pix = (pixels >> 12) & 0xf; xacc = (xacc & 0x3f) + hzoom; if (xacc < 0x40) { yboard_16b_draw_pixel(); x += xdelta; } |
| 857 | |
| 858 | /* stop if the last pixel in the group was 0xf */ |
| 859 | if (pix == 15) |
| 860 | break; |
| 861 | } |
| 862 | } |
| 863 | } |
| 864 | } |
| 865 | } |
| 866 | } |
| 867 | |
| 868 | |
| 869 | |
| 870 | /******************************************************************************************* |
| 871 | * |
| 872 | * Out Run/X-Board-style sprites |
| 873 | * |
| 874 | * Offs Bits Usage |
| 875 | * +0 e------- -------- Signify end of sprite list |
| 876 | * +0 -h-h---- -------- Hide this sprite if either bit is set |
| 877 | * +0 ----bbb- -------- Sprite bank |
| 878 | * +0 -------t tttttttt Top scanline of sprite + 256 |
| 879 | * +2 oooooooo oooooooo Offset within selected sprite bank |
| 880 | * +4 ppppppp- -------- Signed 7-bit pitch value between scanlines |
| 881 | * +4 -------x xxxxxxxx X position of sprite (position $BE is screen position 0) |
| 882 | * +6 -s------ -------- Enable shadows |
| 883 | * +6 --pp---- -------- Sprite priority, relative to tilemaps |
| 884 | * +6 ------vv vvvvvvvv Vertical zoom factor (0x200 = full size, 0x100 = half size, 0x300 = 2x size) |
| 885 | * +8 y------- -------- Render from top-to-bottom (1) or bottom-to-top (0) on screen |
| 886 | * +8 -f------ -------- Horizontal flip: read the data backwards if set |
| 887 | * +8 --x----- -------- Render from left-to-right (1) or right-to-left (0) on screen |
| 888 | * +8 ------hh hhhhhhhh Horizontal zoom factor (0x200 = full size, 0x100 = half size, 0x300 = 2x size) |
| 889 | * +E dddddddd dddddddd Scratch space for current address |
| 890 | * |
| 891 | * Out Run only: |
| 892 | * +A hhhhhhhh -------- Height in scanlines - 1 |
| 893 | * +A -------- -ccccccc Sprite color palette |
| 894 | * |
| 895 | * X-Board only: |
| 896 | * +A ----hhhh hhhhhhhh Height in scanlines - 1 |
| 897 | * +C -------- cccccccc Sprite color palette |
| 898 | * |
| 899 | *******************************************************************************************/ |
| 900 | |
| 901 | #define outrun_draw_pixel() \ |
| 902 | /* only draw if onscreen, not 0 or 15 */ \ |
| 903 | if (x >= cliprect->min_x && x <= cliprect->max_x && pix != 0 && pix != 15) \ |
| 904 | { \ |
| 905 | /* are we high enough priority to be visible? */ \ |
| 906 | if (sprpri > pri[x]) \ |
| 907 | { \ |
| 908 | /* shadow/hilight mode? */ \ |
| 909 | if (shadow && pix == 0xa) \ |
| 910 | dest[x] += (segaic16_paletteram[dest[x]] & 0x8000) ? palette.entries*2 : palette.entries; \ |
| 911 | \ |
| 912 | /* regular draw */ \ |
| 913 | else \ |
| 914 | dest[x] = pix | color; \ |
| 915 | } \ |
| 916 | \ |
| 917 | /* always mark priority so no one else draws here */ \ |
| 918 | pri[x] = 0xff; \ |
| 919 | } \ |
| 920 | |
| 921 | static void segaic16_sprites_xboard_outrun_draw(running_machine *machine, running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int type) |
| 922 | { |
| 923 | UINT8 numbanks = memory_region_length(machine, "gfx2") / 0x40000; |
| 924 | const UINT32 *spritebase = (const UINT32 *)memory_region(machine, "gfx2"); |
| 925 | sega16sp_state *sega16sp = get_safe_token(device); |
| 926 | UINT16* data = sega16sp->spriteram; |
| 927 | |
| 928 | /* first scan forward to find the end of the list */ |
| 929 | for (data = sega16sp->buffer; data < sega16sp->buffer + sega16sp->ramsize/2; data += 8) |
| 930 | if (data[0] & 0x8000) |
| 931 | break; |
| 932 | |
| 933 | /* now scan backwards and render the sprites in order */ |
| 934 | for (data -= 8; data >= sega16sp->buffer; data -= 8) |
| 935 | { |
| 936 | int hide = (data[0] & 0x5000); |
| 937 | int bank = (data[0] >> 9) & 7; |
| 938 | int top = (data[0] & 0x1ff) - 0x100; |
| 939 | UINT16 addr = data[1]; |
| 940 | int pitch = (INT16)((data[2] >> 1) | ((data[4] & 0x1000) << 3)) >> 8; |
| 941 | int xpos = data[2] & 0x1ff; |
| 942 | int shadow = (data[3] >> 14) & 1; |
| 943 | int sprpri = 1 << ((data[3] >> 12) & 3); |
| 944 | int vzoom = data[3] & 0x7ff; |
| 945 | int ydelta = (data[4] & 0x8000) ? 1 : -1; |
| 946 | int flip = (~data[4] >> 14) & 1; |
| 947 | int xdelta = (data[4] & 0x2000) ? 1 : -1; |
| 948 | int hzoom = data[4] & 0x7ff; |
| 949 | int height = ((type == SEGAIC16_SPRITES_OUTRUN) ? (data[5] >> 8) : (data[5] & 0xfff)) + 1; |
| 950 | int color = sega16sp->colorbase + (((type == SEGAIC16_SPRITES_OUTRUN) ? (data[5] & 0x7f) : (data[6] & 0xff)) << 4); |
| 951 | int x, y, ytarget, yacc = 0, pix; |
| 952 | const UINT32 *spritedata; |
| 953 | |
| 954 | /* adjust X coordinate */ |
| 955 | /* note: the threshhold below is a guess. If it is too high, rachero will draw garbage */ |
| 956 | /* If it is too low, smgp won't draw the bottom part of the road */ |
| 957 | if (xpos < 0x80 && xdelta < 0) |
| 958 | xpos += 0x200; |
| 959 | xpos -= 0xbe; |
| 960 | |
| 961 | /* initialize the end address to the start address */ |
| 962 | data[7] = addr; |
| 963 | |
| 964 | /* if hidden, or top greater than/equal to bottom, or invalid bank, punt */ |
| 965 | if (hide || height == 0) |
| 966 | continue; |
| 967 | |
| 968 | /* clamp to within the memory region size */ |
| 969 | if (numbanks) |
| 970 | bank %= numbanks; |
| 971 | spritedata = spritebase + 0x10000 * bank; |
| 972 | |
| 973 | /* clamp to a maximum of 8x (not 100% confirmed) */ |
| 974 | if (vzoom < 0x40) vzoom = 0x40; |
| 975 | if (hzoom < 0x40) hzoom = 0x40; |
| 976 | |
| 977 | /* loop from top to bottom */ |
| 978 | ytarget = top + ydelta * height; |
| 979 | for (y = top; y != ytarget; y += ydelta) |
| 980 | { |
| 981 | /* skip drawing if not within the cliprect */ |
| 982 | if (y >= cliprect->min_y && y <= cliprect->max_y) |
| 983 | { |
| 984 | UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0); |
| 985 | UINT8 *pri = BITMAP_ADDR8(machine->priority_bitmap, y, 0); |
| 986 | int xacc = 0; |
| 987 | |
| 988 | /* non-flipped case */ |
| 989 | if (!flip) |
| 990 | { |
| 991 | /* start at the word before because we preincrement below */ |
| 992 | data[7] = addr - 1; |
| 993 | for (x = xpos; (xdelta > 0 && x <= cliprect->max_x) || (xdelta < 0 && x >= cliprect->min_x); ) |
| 994 | { |
| 995 | UINT32 pixels = spritedata[++data[7]]; |
| 996 | |
| 997 | /* draw four pixels */ |
| 998 | pix = (pixels >> 28) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200; |
| 999 | pix = (pixels >> 24) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200; |
| 1000 | pix = (pixels >> 20) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200; |
| 1001 | pix = (pixels >> 16) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200; |
| 1002 | pix = (pixels >> 12) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200; |
| 1003 | pix = (pixels >> 8) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200; |
| 1004 | pix = (pixels >> 4) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200; |
| 1005 | pix = (pixels >> 0) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200; |
| 1006 | |
| 1007 | /* stop if the second-to-last pixel in the group was 0xf */ |
| 1008 | if ((pixels & 0x000000f0) == 0x000000f0) |
| 1009 | break; |
| 1010 | } |
| 1011 | } |
| 1012 | |
| 1013 | /* flipped case */ |
| 1014 | else |
| 1015 | { |
| 1016 | /* start at the word after because we predecrement below */ |
| 1017 | data[7] = addr + 1; |
| 1018 | for (x = xpos; (xdelta > 0 && x <= cliprect->max_x) || (xdelta < 0 && x >= cliprect->min_x); ) |
| 1019 | { |
| 1020 | UINT32 pixels = spritedata[--data[7]]; |
| 1021 | |
| 1022 | /* draw four pixels */ |
| 1023 | pix = (pixels >> 0) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200; |
| 1024 | pix = (pixels >> 4) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200; |
| 1025 | pix = (pixels >> 8) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200; |
| 1026 | pix = (pixels >> 12) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200; |
| 1027 | pix = (pixels >> 16) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200; |
| 1028 | pix = (pixels >> 20) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200; |
| 1029 | pix = (pixels >> 24) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200; |
| 1030 | pix = (pixels >> 28) & 0xf; while (xacc < 0x200) { outrun_draw_pixel(); x += xdelta; xacc += hzoom; } xacc -= 0x200; |
| 1031 | |
| 1032 | /* stop if the second-to-last pixel in the group was 0xf */ |
| 1033 | if ((pixels & 0x0f000000) == 0x0f000000) |
| 1034 | break; |
| 1035 | } |
| 1036 | } |
| 1037 | } |
| 1038 | |
| 1039 | /* accumulate zoom factors; if we carry into the high bit, skip an extra row */ |
| 1040 | yacc += vzoom; |
| 1041 | addr += pitch * (yacc >> 9); |
| 1042 | yacc &= 0x1ff; |
| 1043 | } |
| 1044 | } |
| 1045 | } |
| 1046 | |
| 1047 | void segaic16_sprites_outrun_draw(running_machine *machine, running_device *device, bitmap_t *bitmap, const rectangle *cliprect) |
| 1048 | { |
| 1049 | segaic16_sprites_xboard_outrun_draw(machine, device, bitmap, cliprect, SEGAIC16_SPRITES_OUTRUN); |
| 1050 | } |
| 1051 | |
| 1052 | void segaic16_sprites_xboard_draw(running_machine *machine, running_device *device, bitmap_t *bitmap, const rectangle *cliprect) |
| 1053 | { |
| 1054 | segaic16_sprites_xboard_outrun_draw(machine, device, bitmap, cliprect, SEGAIC16_SPRITES_XBOARD); |
| 1055 | } |
| 1056 | |
| 1057 | |
| 1058 | /******************************************************************************************* |
| 1059 | * |
| 1060 | * Y-Board-style sprites |
| 1061 | * |
| 1062 | * Offs Bits Usage |
| 1063 | * +0 e------- -------- Signify end of sprite list |
| 1064 | * +0 -----iii iiiiiiii Address of indirection table (/16) |
| 1065 | * +2 bbbb---- -------- Upper 4 bits of bank index |
| 1066 | * +2 ----xxxx xxxxxxxx X position of sprite (position $600 is screen position 0) |
| 1067 | * +4 bbbb---- -------- Lower 4 bits of bank index |
| 1068 | * +4 ----yyyy yyyyyyyy Y position of sprite (position $600 is screen position 0) |
| 1069 | * +6 oooooooo oooooooo Offset within selected sprite bank |
| 1070 | * +8 hhhhhhhh hhhhhhhh Height of sprite |
| 1071 | * +A -y------ -------- Render from top-to-bottom (1) or bottom-to-top (0) on screen |
| 1072 | * +A --f----- -------- Horizontal flip: read the data backwards if set |
| 1073 | * +A ---x---- -------- Render from left-to-right (1) or right-to-left (0) on screen |
| 1074 | * +A -----zzz zzzzzzzz Zoom factor |
| 1075 | * +C -ccc---- -------- Sprite color |
| 1076 | * +C ----rrrr -------- Sprite priority |
| 1077 | * +C -------- pppppppp Signed 8-bit pitch value between scanlines |
| 1078 | * +E ----nnnn nnnnnnnn Index of next sprite |
| 1079 | * |
| 1080 | * In addition to these parameters, the sprite area is clipped using scanline extents |
| 1081 | * stored for every pair of scanlines in the rotation RAM. It's a bit of a cheat for us |
| 1082 | * to poke our nose into the rotation structure, but there are no known cases of Y-board |
| 1083 | * sprites without rotation RAM. |
| 1084 | * |
| 1085 | *******************************************************************************************/ |
| 1086 | |
| 1087 | #define yboard_draw_pixel() \ |
| 1088 | /* only draw if onscreen */ \ |
| 1089 | if (x >= minx && x <= maxx && ind < 0x1fe) \ |
| 1090 | dest[x] = ind | colorpri; \ |
| 1091 | |
| 1092 | void segaic16_sprites_yboard_draw(running_machine *machine, running_device *device, bitmap_t *bitmap, const rectangle *cliprect) |
| 1093 | { |
| 1094 | UINT8 numbanks = memory_region_length(machine, "gfx1") / 0x80000; |
| 1095 | const UINT64 *spritebase = (const UINT64 *)memory_region(machine, "gfx1"); |
| 1096 | const UINT16 *rotatebase = rotate[0].buffer ? rotate[0].buffer : rotate[0].rotateram; |
| 1097 | UINT8 visited[0x1000]; |
| 1098 | sega16sp_state *sega16sp = get_safe_token(device); |
| 1099 | int next = 0; |
| 1100 | int y; |
| 1101 | UINT16* data = sega16sp->spriteram; |
| 1102 | |
| 1103 | /* reset the visited list */ |
| 1104 | memset(visited, 0, sizeof(visited)); |
| 1105 | |
| 1106 | /* clear out any scanlines we might be using */ |
| 1107 | for (y = cliprect->min_y; y <= cliprect->max_y; y++) |
| 1108 | if (!(rotatebase[y & ~1] & 0xc000)) |
| 1109 | memset(BITMAP_ADDR16(bitmap, y, cliprect->min_x), 0xff, (cliprect->max_x - cliprect->min_x + 1) * sizeof(UINT16)); |
| 1110 | |
| 1111 | /* now scan backwards and render the sprites in order */ |
| 1112 | for (data = sega16sp->spriteram; !(data[0] & 0x8000) && !visited[next]; data = sega16sp->spriteram + next * 8) |
| 1113 | { |
| 1114 | int hide = (data[0] & 0x5000); |
| 1115 | UINT16 *indirect = sega16sp->spriteram + ((data[0] & 0x7ff) << 4); |
| 1116 | int bank = ((data[1] >> 8) & 0x10) | ((data[2] >> 12) & 0x0f); |
| 1117 | int xpos = (data[1] & 0xfff) - 0x600; |
| 1118 | int top = (data[2] & 0xfff) - 0x600; |
| 1119 | UINT16 addr = data[3]; |
| 1120 | int height = data[4]; |
| 1121 | int ydelta = (data[5] & 0x4000) ? 1 : -1; |
| 1122 | int flip = (~data[5] >> 13) & 1; |
| 1123 | int xdelta = (data[5] & 0x1000) ? 1 : -1; |
| 1124 | int zoom = data[5] & 0x7ff; |
| 1125 | int colorpri= (data[6] << 1) & 0xfe00; |
| 1126 | int pitch = (INT8)data[6]; |
| 1127 | int x, y, ytarget, yacc = 0, pix, ind; |
| 1128 | const UINT64 *spritedata; |
| 1129 | UINT16 offs; |
| 1130 | |
| 1131 | /* note that we've visited this entry and get the offset of the next one */ |
| 1132 | visited[next] = 1; |
| 1133 | next = data[7] & 0xfff; |
| 1134 | |
| 1135 | /* if hidden, or top greater than/equal to bottom, or invalid bank, punt */ |
| 1136 | if (hide || height == 0) |
| 1137 | continue; |
| 1138 | |
| 1139 | /* clamp to within the memory region size */ |
| 1140 | if (numbanks) |
| 1141 | bank %= numbanks; |
| 1142 | spritedata = spritebase + 0x10000 * bank; |
| 1143 | |
| 1144 | /* clamp to a maximum of 8x (not 100% confirmed) */ |
| 1145 | if (zoom == 0) zoom = 1; |
| 1146 | |
| 1147 | /* loop from top to bottom */ |
| 1148 | ytarget = top + ydelta * height; |
| 1149 | for (y = top; y != ytarget; y += ydelta) |
| 1150 | { |
| 1151 | /* skip drawing if not within the cliprect */ |
| 1152 | if (y >= cliprect->min_y && y <= cliprect->max_y) |
| 1153 | { |
| 1154 | UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0); |
| 1155 | int minx = rotatebase[y & ~1]; |
| 1156 | int maxx = rotatebase[y | 1]; |
| 1157 | int xacc = 0; |
| 1158 | |
| 1159 | /* bit 0x8000 from rotate RAM means that Y is above the top of the screen */ |
| 1160 | if ((minx & 0x8000) && ydelta < 0) |
| 1161 | break; |
| 1162 | |
| 1163 | /* bit 0x4000 from rotate RAM means that Y is below the bottom of the screen */ |
| 1164 | if ((minx & 0x4000) && ydelta > 0) |
| 1165 | break; |
| 1166 | |
| 1167 | /* if either bit is set, skip the rest for this scanline */ |
| 1168 | if (!(minx & 0xc000)) |
| 1169 | { |
| 1170 | /* clamp min/max to the cliprect */ |
| 1171 | minx -= 0x600; |
| 1172 | maxx -= 0x600; |
| 1173 | if (minx < cliprect->min_x) |
| 1174 | minx = cliprect->min_x; |
| 1175 | if (maxx > cliprect->max_x) |
| 1176 | maxx = cliprect->max_x; |
| 1177 | |
| 1178 | /* non-flipped case */ |
| 1179 | if (!flip) |
| 1180 | { |
| 1181 | /* start at the word before because we preincrement below */ |
| 1182 | offs = addr - 1; |
| 1183 | for (x = xpos; (xdelta > 0 && x <= maxx) || (xdelta < 0 && x >= minx); ) |
| 1184 | { |
| 1185 | UINT64 pixels = spritedata[++offs]; |
| 1186 | |
| 1187 | /* draw four pixels */ |
| 1188 | pix = (pixels >> 60) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 1189 | pix = (pixels >> 56) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 1190 | pix = (pixels >> 52) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 1191 | pix = (pixels >> 48) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 1192 | pix = (pixels >> 44) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 1193 | pix = (pixels >> 40) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 1194 | pix = (pixels >> 36) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 1195 | pix = (pixels >> 32) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 1196 | pix = (pixels >> 28) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 1197 | pix = (pixels >> 24) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 1198 | pix = (pixels >> 20) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 1199 | pix = (pixels >> 16) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 1200 | pix = (pixels >> 12) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 1201 | pix = (pixels >> 8) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 1202 | pix = (pixels >> 4) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 1203 | pix = (pixels >> 0) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 1204 | |
| 1205 | /* stop if the second-to-last pixel in the group was 0xf */ |
| 1206 | if (pix == 0x0f) |
| 1207 | break; |
| 1208 | } |
| 1209 | } |
| 1210 | |
| 1211 | /* flipped case */ |
| 1212 | else |
| 1213 | { |
| 1214 | /* start at the word after because we predecrement below */ |
| 1215 | offs = addr + 1; |
| 1216 | for (x = xpos; (xdelta > 0 && x <= maxx) || (xdelta < 0 && x >= minx); ) |
| 1217 | { |
| 1218 | UINT64 pixels = spritedata[--offs]; |
| 1219 | |
| 1220 | /* draw four pixels */ |
| 1221 | pix = (pixels >> 0) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 1222 | pix = (pixels >> 4) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 1223 | pix = (pixels >> 8) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 1224 | pix = (pixels >> 12) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 1225 | pix = (pixels >> 16) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 1226 | pix = (pixels >> 20) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 1227 | pix = (pixels >> 24) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 1228 | pix = (pixels >> 28) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 1229 | pix = (pixels >> 32) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 1230 | pix = (pixels >> 36) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 1231 | pix = (pixels >> 40) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 1232 | pix = (pixels >> 44) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 1233 | pix = (pixels >> 48) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 1234 | pix = (pixels >> 52) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 1235 | pix = (pixels >> 56) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 1236 | pix = (pixels >> 60) & 0xf; ind = indirect[pix]; while (xacc < 0x200) { yboard_draw_pixel(); x += xdelta; xacc += zoom; } xacc -= 0x200; |
| 1237 | |
| 1238 | /* stop if the second-to-last pixel in the group was 0xf */ |
| 1239 | if (pix == 0x0f) |
| 1240 | break; |
| 1241 | } |
| 1242 | } |
| 1243 | } |
| 1244 | } |
| 1245 | |
| 1246 | /* accumulate zoom factors; if we carry into the high bit, skip an extra row */ |
| 1247 | yacc += zoom; |
| 1248 | addr += pitch * (yacc >> 9); |
| 1249 | yacc &= 0x1ff; |
| 1250 | } |
| 1251 | } |
| 1252 | } |
| 1253 | |
| 1254 | /* bootlegs */ |
| 1255 | |
| 1256 | /* |
| 1257 | |
| 1258 | the system16a bootleg sprite hardware differs in subtle ways on a per game basis |
| 1259 | with each game having the words swapped around. |
| 1260 | |
| 1261 | there are also some subtle, but important changes when compared to the original |
| 1262 | system16a sprites, mainly the increment of the address not happening until |
| 1263 | the end of the loop |
| 1264 | |
| 1265 | */ |
| 1266 | |
| 1267 | /* ignores the sprite priority until we understand priority better on the bootlegs */ |
| 1268 | #define system16a_bootleg_draw_pixel() \ |
| 1269 | /* only draw if onscreen, not 0 or 15 */ \ |
| 1270 | if (x >= cliprect->min_x && x <= cliprect->max_x && pix != 0 && pix != 15) \ |
| 1271 | { \ |
| 1272 | /* are we high enough priority to be visible? */ \ |
| 1273 | if (sprpri || 1) \ |
| 1274 | { \ |
| 1275 | /* shadow/hilight mode? */ \ |
| 1276 | if (color == sega16sp->colorbase + (0x3f << 4)) \ |
| 1277 | dest[x] += (segaic16_paletteram[dest[x]] & 0x8000) ? palette.entries*2 : palette.entries; \ |
| 1278 | \ |
| 1279 | /* regular draw */ \ |
| 1280 | else \ |
| 1281 | dest[x] = pix | color; \ |
| 1282 | } \ |
| 1283 | \ |
| 1284 | /* always mark priority so no one else draws here */ \ |
| 1285 | pri[x] = 0xff; \ |
| 1286 | } \ |
| 1287 | |
| 1288 | |
| 1289 | /* make this an actual function */ |
| 1290 | #define system16a_bootleg_draw_core() \ |
| 1291 | { \ |
| 1292 | const UINT16 *spritedata; \ |
| 1293 | int x, y, pix, xdelta = 1; \ |
| 1294 | \ |
| 1295 | xpos += sega16sp->xoffs; \ |
| 1296 | xpos &= 0x1ff; \ |
| 1297 | \ |
| 1298 | xpos -= 0xbd; \ |
| 1299 | \ |
| 1300 | /* initialize the end address to the start address */ \ |
| 1301 | data[7] = addr; \ |
| 1302 | \ |
| 1303 | /* if hidden, or top greater than/equal to bottom, or invalid bank, punt */ \ |
| 1304 | if ((top >= bottom) || bank == 255) \ |
| 1305 | continue; \ |
| 1306 | \ |
| 1307 | /* clamp to within the memory region size */ \ |
| 1308 | if (numbanks) \ |
| 1309 | bank %= numbanks; \ |
| 1310 | spritedata = spritebase + 0x8000 * bank; \ |
| 1311 | \ |
| 1312 | /* adjust positions for screen flipping */ \ |
| 1313 | if (sega16sp->flip) \ |
| 1314 | { \ |
| 1315 | int temp = top; \ |
| 1316 | top = 224 - bottom; \ |
| 1317 | bottom = 224 - temp; \ |
| 1318 | xpos = 320 - xpos; \ |
| 1319 | xdelta = -1; \ |
| 1320 | } \ |
| 1321 | \ |
| 1322 | /* loop from top to bottom */ \ |
| 1323 | for (y = top; y < bottom; y++) \ |
| 1324 | { \ |
| 1325 | \ |
| 1326 | /* skip drawing if not within the cliprect */ \ |
| 1327 | if (y >= cliprect->min_y && y <= cliprect->max_y) \ |
| 1328 | { \ |
| 1329 | UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0); \ |
| 1330 | UINT8 *pri = BITMAP_ADDR8(machine->priority_bitmap, y, 0); \ |
| 1331 | \ |
| 1332 | /* note that the System 16A sprites have a design flaw that allows the address */ \ |
| 1333 | /* to carry into the flip flag, which is the topmost bit -- it is very important */ \ |
| 1334 | /* to emulate this as the games compensate for it */ \ |
| 1335 | \ |
| 1336 | /* non-flipped case */ \ |
| 1337 | if (!(addr & 0x8000)) \ |
| 1338 | { \ |
| 1339 | /* start at the word before because we preincrement below */ \ |
| 1340 | data[7] = addr - 1; \ |
| 1341 | for (x = xpos; ((xpos - x) & 0x1ff) != 1; ) \ |
| 1342 | { \ |
| 1343 | UINT16 pixels = spritedata[++data[7] & 0x7fff]; \ |
| 1344 | \ |
| 1345 | /* draw four pixels */ \ |
| 1346 | pix = (pixels >> 12) & 0xf; system16a_bootleg_draw_pixel(); x += xdelta; \ |
| 1347 | pix = (pixels >> 8) & 0xf; system16a_bootleg_draw_pixel(); x += xdelta; \ |
| 1348 | pix = (pixels >> 4) & 0xf; system16a_bootleg_draw_pixel(); x += xdelta; \ |
| 1349 | pix = (pixels >> 0) & 0xf; system16a_bootleg_draw_pixel(); x += xdelta; \ |
| 1350 | \ |
| 1351 | /* stop if the last pixel in the group was 0xf */ \ |
| 1352 | if (pix == 15) \ |
| 1353 | break; \ |
| 1354 | } \ |
| 1355 | } \ |
| 1356 | \ |
| 1357 | /* flipped case */ \ |
| 1358 | else \ |
| 1359 | { \ |
| 1360 | /* start at the word after because we predecrement below */ \ |
| 1361 | data[7] = addr + 1; \ |
| 1362 | for (x = xpos; ((xpos - x) & 0x1ff) != 1; ) \ |
| 1363 | { \ |
| 1364 | UINT16 pixels = spritedata[--data[7] & 0x7fff]; \ |
| 1365 | \ |
| 1366 | /* draw four pixels */ \ |
| 1367 | pix = (pixels >> 0) & 0xf; system16a_bootleg_draw_pixel(); x += xdelta; \ |
| 1368 | pix = (pixels >> 4) & 0xf; system16a_bootleg_draw_pixel(); x += xdelta; \ |
| 1369 | pix = (pixels >> 8) & 0xf; system16a_bootleg_draw_pixel(); x += xdelta; \ |
| 1370 | pix = (pixels >> 12) & 0xf; system16a_bootleg_draw_pixel(); x += xdelta; \ |
| 1371 | \ |
| 1372 | /* stop if the last pixel in the group was 0xf */ \ |
| 1373 | if (pix == 15) \ |
| 1374 | break; \ |
| 1375 | } \ |
| 1376 | } \ |
| 1377 | } \ |
| 1378 | \ |
| 1379 | /* advance a row - must be done at the end on the bootlegs! */ \ |
| 1380 | addr += pitch; \ |
| 1381 | } \ |
| 1382 | } \ |
| 1383 | |
| 1384 | |
| 1385 | |
| 1386 | void segaic16_sprites_16a_bootleg_wb3bl_draw(running_machine *machine, running_device *device, bitmap_t *bitmap, const rectangle *cliprect) |
| 1387 | { |
| 1388 | UINT8 numbanks = memory_region_length(machine, "gfx2") / 0x10000; |
| 1389 | const UINT16 *spritebase = (const UINT16 *)memory_region(machine, "gfx2"); |
| 1390 | sega16sp_state *sega16sp = get_safe_token(device); |
| 1391 | UINT16* data = sega16sp->spriteram; |
| 1392 | |
| 1393 | for (data = sega16sp->spriteram; data < sega16sp->spriteram+ sega16sp->ramsize/2; data += 8) |
| 1394 | { |
| 1395 | int bottom = (data[4] >> 8); |
| 1396 | int top = (data[4] & 0xff); |
| 1397 | int xpos = (data[0]); |
| 1398 | int pitch = (INT16)data[5]; |
| 1399 | UINT16 addr = data[1]; |
| 1400 | int color = sega16sp->colorbase + (((data[6] >> 8) & 0x3f) << 4); |
| 1401 | int bank = sega16sp->bank[(data[6] >> 4) & 0x7]; |
| 1402 | int sprpri = 1 << ((data[6] >> 0) & 0x3); |
| 1403 | |
| 1404 | system16a_bootleg_draw_core(); |
| 1405 | } |
| 1406 | } |
| 1407 | |
| 1408 | /* 4 player passing shot is different to this.. */ |
| 1409 | void segaic16_sprites_16a_bootleg_passhtb_draw(running_machine *machine, running_device *device, bitmap_t *bitmap, const rectangle *cliprect) |
| 1410 | { |
| 1411 | UINT8 numbanks = memory_region_length(machine, "gfx2") / 0x10000; |
| 1412 | const UINT16 *spritebase = (const UINT16 *)memory_region(machine, "gfx2"); |
| 1413 | sega16sp_state *sega16sp = get_safe_token(device); |
| 1414 | UINT16* data = sega16sp->spriteram; |
| 1415 | |
| 1416 | for (data = sega16sp->spriteram; data < sega16sp->spriteram+ sega16sp->ramsize/2; data += 8) |
| 1417 | { |
| 1418 | int bottom = (data[1] >> 8)-1; |
| 1419 | int top = (data[1] & 0xff)-1; |
| 1420 | int xpos = (data[0]); |
| 1421 | int pitch = (INT16)data[3]; |
| 1422 | UINT16 addr = data[2]; |
| 1423 | int color = sega16sp->colorbase + (((data[5] >> 8) & 0x3f) << 4); |
| 1424 | int bank = sega16sp->bank[(data[5] >> 4) & 0x7]; |
| 1425 | int sprpri = 1 << ((data[5] >> 0) & 0x3); |
| 1426 | |
| 1427 | system16a_bootleg_draw_core(); |
| 1428 | } |
| 1429 | } |
| 1430 | |
| 1431 | void segaic16_sprites_16a_bootleg_shinobld_draw(running_machine *machine, running_device *device, bitmap_t *bitmap, const rectangle *cliprect) |
| 1432 | { |
| 1433 | UINT8 numbanks = memory_region_length(machine, "gfx2") / 0x10000; |
| 1434 | const UINT16 *spritebase = (const UINT16 *)memory_region(machine, "gfx2"); |
| 1435 | sega16sp_state *sega16sp = get_safe_token(device); |
| 1436 | UINT16* data = sega16sp->spriteram; |
| 1437 | |
| 1438 | for (data = sega16sp->spriteram; data < sega16sp->spriteram+ sega16sp->ramsize/2; data += 8) |
| 1439 | { |
| 1440 | int bottom = (data[0] >> 8)-1; |
| 1441 | int top = (data[0] & 0xff)-1; |
| 1442 | int xpos = (data[1]); |
| 1443 | int pitch = (INT16)data[2]; |
| 1444 | UINT16 addr = data[3]; |
| 1445 | int color = sega16sp->colorbase + (((data[4] >> 8) & 0x3f) << 4); |
| 1446 | int bank = sega16sp->bank[(data[4] >> 4) & 0x7]; |
| 1447 | int sprpri = 1 << ((data[4] >> 0) & 0x3); |
| 1448 | |
| 1449 | system16a_bootleg_draw_core(); |
| 1450 | } |
| 1451 | } |
| 1452 | |
| 1453 | /************************************* |
| 1454 | * |
| 1455 | * General sprite drawing |
| 1456 | * |
| 1457 | *************************************/ |
| 1458 | |
| 1459 | void segaic16_sprites_draw(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int which) |
| 1460 | { |
| 1461 | running_device* device = 0; |
| 1462 | sega16sp_state *sega16sp; |
| 1463 | |
| 1464 | if (!which) |
| 1465 | device = devtag_get_device(screen->machine,"segaspr1"); |
| 1466 | else |
| 1467 | device = devtag_get_device(screen->machine,"segaspr2"); |
| 1468 | |
| 1469 | if (!device) |
| 1470 | fatalerror("segaic16_sprites_draw device not found\n"); |
| 1471 | |
| 1472 | sega16sp = get_safe_token(device); |
| 1473 | |
| 1474 | if (!sega16sp->which) |
| 1475 | sega16sp->spriteram = segaic16_spriteram_0; |
| 1476 | else |
| 1477 | sega16sp->spriteram = segaic16_spriteram_1; |
| 1478 | |
| 1479 | (*sega16sp->draw)(screen->machine, device, bitmap, cliprect); |
| 1480 | } |
| 1481 | |
| 1482 | |
| 1483 | |
| 1484 | /************************************* |
| 1485 | * |
| 1486 | * General sprite banking |
| 1487 | * |
| 1488 | *************************************/ |
| 1489 | |
| 1490 | void segaic16_sprites_set_bank(running_machine *machine, int which, int banknum, int offset) |
| 1491 | { |
| 1492 | running_device* device = 0; |
| 1493 | |
| 1494 | if (!which) |
| 1495 | device = devtag_get_device(machine,"segaspr1"); |
| 1496 | else |
| 1497 | device = devtag_get_device(machine,"segaspr2"); |
| 1498 | |
| 1499 | if (!device) |
| 1500 | fatalerror("segaic16_sprites_set_bank device not found\n"); |
| 1501 | |
| 1502 | sega16sp_state *sega16sp = get_safe_token(device); |
| 1503 | |
| 1504 | if (sega16sp->bank[banknum] != offset) |
| 1505 | { |
| 1506 | running_device *screen = machine->primary_screen; |
| 1507 | video_screen_update_partial(screen, video_screen_get_vpos(screen)); |
| 1508 | sega16sp->bank[banknum] = offset; |
| 1509 | } |
| 1510 | } |
| 1511 | |
| 1512 | |
| 1513 | |
| 1514 | /************************************* |
| 1515 | * |
| 1516 | * General sprite screen flipping |
| 1517 | * |
| 1518 | *************************************/ |
| 1519 | |
| 1520 | void segaic16_sprites_set_flip(running_machine *machine, int which, int flip) |
| 1521 | { |
| 1522 | running_device* device = 0; |
| 1523 | |
| 1524 | if (!which) |
| 1525 | device = devtag_get_device(machine,"segaspr1"); |
| 1526 | else |
| 1527 | device = devtag_get_device(machine,"segaspr2"); |
| 1528 | |
| 1529 | if (!device) |
| 1530 | fatalerror("segaic16_sprites_set_flip device not found\n"); |
| 1531 | |
| 1532 | sega16sp_state *sega16sp = get_safe_token(device); |
| 1533 | |
| 1534 | flip = (flip != 0); |
| 1535 | if (sega16sp->flip != flip) |
| 1536 | { |
| 1537 | running_device *screen = machine->primary_screen; |
| 1538 | video_screen_update_partial(screen, video_screen_get_vpos(screen)); |
| 1539 | sega16sp->flip = flip; |
| 1540 | } |
| 1541 | } |
| 1542 | |
| 1543 | |
| 1544 | |
| 1545 | /************************************* |
| 1546 | * |
| 1547 | * General sprite shadows |
| 1548 | * |
| 1549 | *************************************/ |
| 1550 | |
| 1551 | void segaic16_sprites_set_shadow(running_machine *machine, int which, int shadow) |
| 1552 | { |
| 1553 | running_device* device = 0; |
| 1554 | |
| 1555 | if (!which) |
| 1556 | device = devtag_get_device(machine,"segaspr1"); |
| 1557 | else |
| 1558 | device = devtag_get_device(machine,"segaspr2"); |
| 1559 | |
| 1560 | if (!device) |
| 1561 | fatalerror("segaic16_sprites_set_shadow device not found\n"); |
| 1562 | |
| 1563 | sega16sp_state *sega16sp = get_safe_token(device); |
| 1564 | |
| 1565 | shadow = (shadow != 0); |
| 1566 | if (sega16sp->shadow != shadow) |
| 1567 | { |
| 1568 | running_device *screen = machine->primary_screen; |
| 1569 | video_screen_update_partial(screen, video_screen_get_vpos(screen)); |
| 1570 | sega16sp->shadow = shadow; |
| 1571 | } |
| 1572 | } |
| 1573 | |
| 1574 | |
| 1575 | |
| 1576 | /************************************* |
| 1577 | * |
| 1578 | * General sprite buffer control |
| 1579 | * |
| 1580 | *************************************/ |
| 1581 | |
| 1582 | static void segaic16_sprites_buffer(running_device* device) |
| 1583 | { |
| 1584 | sega16sp_state *sega16sp = get_safe_token(device); |
| 1585 | |
| 1586 | if (!sega16sp->which) |
| 1587 | sega16sp->spriteram = segaic16_spriteram_0; |
| 1588 | else |
| 1589 | sega16sp->spriteram = segaic16_spriteram_1; |
| 1590 | |
| 1591 | |
| 1592 | if (sega16sp->buffer) |
| 1593 | { |
| 1594 | UINT32 *src = (UINT32 *)sega16sp->spriteram; |
| 1595 | UINT32 *dst = (UINT32 *)sega16sp->buffer; |
| 1596 | int i; |
| 1597 | |
| 1598 | /* swap the halves of the sprite RAM */ |
| 1599 | for (i = 0; i < sega16sp->ramsize/4; i++) |
| 1600 | { |
| 1601 | UINT32 temp = *src; |
| 1602 | *src++ = *dst; |
| 1603 | *dst++ = temp; |
| 1604 | } |
| 1605 | |
| 1606 | /* hack for thunderblade */ |
| 1607 | *sega16sp->spriteram = 0xffff; |
| 1608 | } |
| 1609 | |
| 1610 | /* we will render the sprites when the video update happens */ |
| 1611 | } |
| 1612 | |
| 1613 | |
| 1614 | WRITE16_HANDLER( segaic16_sprites_draw_0_w ) |
| 1615 | { |
| 1616 | running_device* device = 0; |
| 1617 | |
| 1618 | device = devtag_get_device(space->machine,"segaspr1"); |
| 1619 | |
| 1620 | if (!device) |
| 1621 | fatalerror("segaic16_sprites_draw_0_w device not found\n"); |
| 1622 | |
| 1623 | segaic16_sprites_buffer(device); |
| 1624 | } |
| 1625 | |
| 1626 | |
| 1627 | WRITE16_HANDLER( segaic16_sprites_draw_1_w ) |
| 1628 | { |
| 1629 | running_device* device = 0; |
| 1630 | |
| 1631 | device = devtag_get_device(space->machine,"segaspr2"); |
| 1632 | |
| 1633 | if (!device) |
| 1634 | fatalerror("segaic16_sprites_draw_1_w device not found\n"); |
| 1635 | |
| 1636 | if (device) |
| 1637 | segaic16_sprites_buffer(device); |
| 1638 | } |
| 1639 | |
| 1640 | |
| 1641 | /***************************************************************************** |
| 1642 | DEVICE INTERFACE |
| 1643 | *****************************************************************************/ |
| 1644 | |
| 1645 | static DEVICE_START( sega16sp ) |
| 1646 | { |
| 1647 | sega16sp_state *sega16sp = get_safe_token(device); |
| 1648 | const sega16sp_interface *intf = get_interface(device); |
| 1649 | int i; |
| 1650 | |
| 1651 | sega16sp->flip = 0; |
| 1652 | sega16sp->shadow = 0; |
| 1653 | |
| 1654 | for (i=0;i<16;i++) |
| 1655 | sega16sp->bank[i] = i;// intf->bank[i]; |
| 1656 | |
| 1657 | sega16sp->which = intf->which; |
| 1658 | sega16sp->colorbase = intf->colorbase; |
| 1659 | sega16sp->ramsize = intf->ramsize; |
| 1660 | sega16sp->xoffs = intf->xoffs; |
| 1661 | sega16sp->draw = intf->draw; |
| 1662 | |
| 1663 | if (intf->buffer) |
| 1664 | sega16sp->buffer = auto_alloc_array(device->machine, UINT16, sega16sp->ramsize/2); |
| 1665 | |
| 1666 | |
| 1667 | state_save_register_device_item(device, 0, sega16sp->flip); |
| 1668 | state_save_register_device_item(device, 0, sega16sp->shadow); |
| 1669 | state_save_register_device_item_array(device, 0, sega16sp->bank); |
| 1670 | state_save_register_device_item(device, 0, sega16sp->colorbase); |
| 1671 | state_save_register_device_item(device, 0, sega16sp->xoffs); |
| 1672 | |
| 1673 | if (intf->buffer) |
| 1674 | state_save_register_device_item_pointer(device, 0, ((UINT8 *) sega16sp->buffer), sega16sp->ramsize); |
| 1675 | |
| 1676 | |
| 1677 | } |
| 1678 | |
| 1679 | |
| 1680 | DEVICE_GET_INFO( sega16sp ) |
| 1681 | { |
| 1682 | switch (state) |
| 1683 | { |
| 1684 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 1685 | case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(sega16sp_state); break; |
| 1686 | case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_VIDEO; break; |
| 1687 | |
| 1688 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1689 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(sega16sp); break; |
| 1690 | case DEVINFO_FCT_STOP: /* Nothing */ break; |
| 1691 | case DEVINFO_FCT_RESET: /*info->reset = DEVICE_RESET_NAME(sega16sp);*/ break; |
| 1692 | |
| 1693 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1694 | case DEVINFO_STR_NAME: strcpy(info->s, "Sega System SH/HO/OR/16/18/X/Y Sprites"); break; |
| 1695 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Sega Video ICs"); break; |
| 1696 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; |
| 1697 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; |
| 1698 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MAME Team"); break; |
| 1699 | } |
| 1700 | } |
src/mame/drivers/pgm.c
| r7972 | r7973 | |
| 105 | 105 | it's the only game that needs IRQ4 and Puzzli2 explicitly doesn't want IRQ4 to be |
| 106 | 106 | active. |
| 107 | 107 | |
| 108 | | Some dumps are suspicious (orlegend super clones are missing roms, drgw3k sets |
| 108 | Some dumps are suspicious (orlegend super clones are missing roms, drgw3 sets |
| 109 | 109 | might not have the right protection rom) In many cases the external protection |
| 110 | 110 | data roms change with each revision of the game. |
| 111 | 111 | |
| r7972 | r7973 | |
| 147 | 147 | Oriental Legend |
| 148 | 148 | function: |
| 149 | 149 | |
| 150 | | ASIC 12 + ASIC 25 |
| 151 | | these seem to be used together |
| 152 | | ASIC 25 appears to perform some kind of bitswap operations |
| 150 | ASIC 25 + ASIC 12 |
| 151 | ASIC25 is a logic device (not MCU) which performs bitswap operations |
| 152 | ASIC12 is ... ? (rom overlays?) |
| 153 | |
| 153 | 154 | used by: |
| 154 | 155 | Dragon World 2 |
| 155 | 156 | |
| 156 | | ASIC 22 + ASIC 25 |
| 157 | | these seem to be used together, ASIC25 has an external software decrypted? data rom |
| 158 | | ASIC 22 might be an updated version of ASIC12 ? |
| 157 | ASIC 25 + ASIC 22 |
| 158 | ASIC25 is a logic device (not MCU) which performs bitswap operations, and connects to the ASIC22. It differs per region. |
| 159 | ASIC22 is an MCU and acts as an encrypted DMA device |
| 160 | |
| 161 | (ASIC22 can be swapped between games with no side-effects, ASIC25 can't) |
| 162 | |
| 159 | 163 | used by: |
| 160 | 164 | Dragon World 3 |
| 161 | 165 | The Killing Blade |
| 162 | 166 | |
| 163 | 167 | ASIC 25 + ASIC 28 |
| 168 | ASIC25 (see above) |
| 169 | ASIC28 acts as an encrypted DMA device (updated version of ASIC22 with different encryption etc.) |
| 170 | |
| 171 | used by: |
| 164 | 172 | Oriental Legend Super |
| 165 | 173 | |
| 166 | 174 | ASIC 27 (55857E): |
| 167 | 175 | performs a variety of calculations, quite complex, different per region, supplies region code |
| 176 | |
| 168 | 177 | used by: |
| 169 | | Knights of Valour 1 / Plus |
| 178 | Knights of Valour 1 / (Plus?) |
| 170 | 179 | Photo Y2k / Real and Fake |
| 171 | 180 | |
| 172 | 181 | ASIC 27A(55857F/55857G): |
| r7972 | r7973 | |
| 292 | 301 | #include "includes/pgm.h" |
| 293 | 302 | |
| 294 | 303 | UINT16 *pgm_mainram; |
| 304 | static void IGS022_reset(running_machine* machine); |
| 295 | 305 | |
| 296 | 306 | static WRITE16_HANDLER( pgm_videoram_w ) |
| 297 | 307 | { |
| r7972 | r7973 | |
| 1098 | 1108 | PORT_DIPSETTING( 0x0005, DEF_STR( World ) ) |
| 1099 | 1109 | INPUT_PORTS_END |
| 1100 | 1110 | |
| 1111 | static INPUT_PORTS_START( dw3 ) |
| 1112 | PORT_INCLUDE ( pgm ) |
| 1113 | |
| 1114 | PORT_MODIFY("Region") /* Region - supplied by protection device */ |
| 1115 | PORT_DIPNAME( 0x000f, 0x0006, DEF_STR( Region ) ) |
| 1116 | PORT_DIPSETTING( 0x0000, "0" ) |
| 1117 | PORT_DIPSETTING( 0x0001, "1" ) |
| 1118 | PORT_DIPSETTING( 0x0002, "2" ) |
| 1119 | PORT_DIPSETTING( 0x0003, "3" ) |
| 1120 | PORT_DIPSETTING( 0x0004, "4" ) |
| 1121 | PORT_DIPSETTING( 0x0005, "5" ) |
| 1122 | PORT_DIPSETTING( 0x0006, DEF_STR( World ) ) |
| 1123 | PORT_DIPSETTING( 0x0007, "7" ) |
| 1124 | |
| 1125 | INPUT_PORTS_END |
| 1126 | |
| 1127 | |
| 1101 | 1128 | static INPUT_PORTS_START( olds ) |
| 1102 | 1129 | PORT_INCLUDE ( pgm ) |
| 1103 | 1130 | |
| r7972 | r7973 | |
| 1397 | 1424 | |
| 1398 | 1425 | MACHINE_DRIVER_END |
| 1399 | 1426 | |
| 1427 | static MACHINE_RESET( dw3 ); |
| 1428 | |
| 1429 | static MACHINE_DRIVER_START( dw3 ) |
| 1430 | MDRV_IMPORT_FROM(pgm) |
| 1431 | |
| 1432 | MDRV_CPU_MODIFY("maincpu") |
| 1433 | MDRV_CPU_PROGRAM_MAP(killbld_mem) |
| 1434 | MDRV_CPU_VBLANK_INT_HACK(drgw_interrupt,2) // needs an extra IRQ, puzzli2 doesn't want this irq! |
| 1435 | |
| 1436 | MDRV_MACHINE_RESET(dw3) |
| 1437 | |
| 1438 | MACHINE_DRIVER_END |
| 1439 | |
| 1400 | 1440 | static MACHINE_RESET( olds ); |
| 1401 | 1441 | |
| 1402 | 1442 | static MACHINE_DRIVER_START( olds ) |
| r7972 | r7973 | |
| 1461 | 1501 | /* take note of "gfx2" needed for expanding the 32x32x5bpp data and |
| 1462 | 1502 | "gfx4" needed for expanding the Sprite Colour Data */ |
| 1463 | 1503 | |
| 1504 | #define ROM_LOAD16_WORD_SWAP_BIOS(bios,name,offset,length,hash) \ |
| 1505 | ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(bios+1)) /* Note '+1' */ |
| 1506 | |
| 1507 | #define PGM_68K_BIOS \ |
| 1508 | ROM_SYSTEM_BIOS( 0, "v2", "PGM Bios V2" ) \ |
| 1509 | ROM_LOAD16_WORD_SWAP_BIOS( 0, "pgm_p02s.u20", 0x00000, 0x020000, CRC(78c15fa2) SHA1(885a6558e022602cc6f482ac9667ba9f61e75092) ) /* Version 2 (Label: IGS | PGM P02S | 1P0792D1 | J992438 )*/ \ |
| 1510 | ROM_SYSTEM_BIOS( 1, "v1", "PGM Bios V1" ) \ |
| 1511 | ROM_LOAD16_WORD_SWAP_BIOS( 1, "pgm_p01s.u20", 0x00000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) /* Version 1 */ \ |
| 1512 | |
| 1513 | |
| 1514 | |
| 1464 | 1515 | /* The Bios - NOT A GAME */ |
| 1465 | 1516 | ROM_START( pgm ) |
| 1466 | 1517 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 1467 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x00000, 0x20000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) |
| 1518 | PGM_68K_BIOS |
| 1468 | 1519 | |
| 1469 | 1520 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| 1470 | 1521 | |
| r7972 | r7973 | |
| 1481 | 1532 | |
| 1482 | 1533 | ROM_START( orlegend ) |
| 1483 | 1534 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 1484 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) )// (BIOS) |
| 1535 | PGM_68K_BIOS |
| 1485 | 1536 | ROM_LOAD16_WORD_SWAP( "p0103.rom", 0x100000, 0x200000, CRC(d5e93543) SHA1(f081edc26514ca8354c13c7f6f89aba8e4d3e7d2) ) |
| 1486 | 1537 | |
| 1487 | 1538 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| r7972 | r7973 | |
| 1513 | 1564 | |
| 1514 | 1565 | ROM_START( orlegende ) |
| 1515 | 1566 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 1516 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) )// (BIOS) |
| 1567 | PGM_68K_BIOS |
| 1517 | 1568 | ROM_LOAD16_WORD_SWAP( "p0102.rom", 0x100000, 0x200000, CRC(4d0f6cc5) SHA1(8d41f0a712fb11a1da865f5159e5e27447b4388a) ) |
| 1518 | 1569 | |
| 1519 | 1570 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| r7972 | r7973 | |
| 1545 | 1596 | |
| 1546 | 1597 | ROM_START( orlegendc ) |
| 1547 | 1598 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 1548 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) )// (BIOS) |
| 1599 | PGM_68K_BIOS |
| 1549 | 1600 | ROM_LOAD16_WORD_SWAP( "p0101.160", 0x100000, 0x200000, CRC(b24f0c1e) SHA1(a2cf75d739681f091c24ef78ed6fc13aa8cfe0c6) ) |
| 1550 | 1601 | |
| 1551 | 1602 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| r7972 | r7973 | |
| 1577 | 1628 | |
| 1578 | 1629 | ROM_START( orlegendca ) |
| 1579 | 1630 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 1580 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) )// (BIOS) |
| 1631 | PGM_68K_BIOS |
| 1581 | 1632 | ROM_LOAD16_WORD_SWAP( "p0101.102", 0x100000, 0x200000, CRC(7a22e1cb) SHA1(4fe0fde00521b0915146334ea7213f3eb7e2affc) ) |
| 1582 | 1633 | |
| 1583 | 1634 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| r7972 | r7973 | |
| 1643 | 1694 | |
| 1644 | 1695 | ROM_START( orlegend111c ) |
| 1645 | 1696 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 1646 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) )// (BIOS) |
| 1697 | PGM_68K_BIOS |
| 1647 | 1698 | ROM_LOAD16_BYTE( "olv111ch.u6", 0x100001, 0x080000, CRC(5fb86373) SHA1(2fc58eff1f38754c75819fde666244b867ca4f05) ) |
| 1648 | 1699 | ROM_LOAD16_BYTE( "olv111ch.u9", 0x100000, 0x080000, CRC(83cf09c8) SHA1(959780b45326059517f3008a356657f4f3d2908f) ) |
| 1649 | 1700 | ROM_LOAD16_BYTE( "olv111ch.u7", 0x200001, 0x080000, CRC(6ee79faf) SHA1(039b4b07b8577f0d3022ae01210c00375624cb3c) ) |
| r7972 | r7973 | |
| 1711 | 1762 | |
| 1712 | 1763 | ROM_START( orlegend105k ) |
| 1713 | 1764 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 1714 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) )// (BIOS) |
| 1765 | PGM_68K_BIOS |
| 1715 | 1766 | ROM_LOAD16_BYTE( "olv105ko.u6", 0x100001, 0x080000, CRC(b86703fe) SHA1(a3529b45efd400ecd5e76f764b528ebce46e24ab) ) |
| 1716 | 1767 | ROM_LOAD16_BYTE( "olv105ko.u9", 0x100000, 0x080000, CRC(5a108e39) SHA1(2033f4fe3f2dfd725dac535324f58348b9ac3914) ) |
| 1717 | 1768 | ROM_LOAD16_BYTE( "olv105ko.u7", 0x200001, 0x080000, CRC(5712facc) SHA1(2d95ebd1703874e89ac3a206f8c1f0ece6e833e0) ) |
| r7972 | r7973 | |
| 1813 | 1864 | |
| 1814 | 1865 | ROM_START( drgw2 ) |
| 1815 | 1866 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 1816 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) )// (BIOS) |
| 1867 | PGM_68K_BIOS |
| 1817 | 1868 | ROM_LOAD16_WORD_SWAP( "v-110x.u2", 0x100000, 0x080000, CRC(1978106b) SHA1(af8a13d7783b755a58762c98bdc32cab845b2251) ) |
| 1818 | 1869 | |
| 1819 | 1870 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| r7972 | r7973 | |
| 1838 | 1889 | |
| 1839 | 1890 | ROM_START( drgw2c ) |
| 1840 | 1891 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 1841 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) )// (BIOS) |
| 1892 | PGM_68K_BIOS |
| 1842 | 1893 | ROM_LOAD16_WORD_SWAP( "v-100c.u2", 0x100000, 0x080000, CRC(67467981) SHA1(58af01a3871b6179fe42ff471cc39a2161940043) ) |
| 1843 | 1894 | |
| 1844 | 1895 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| r7972 | r7973 | |
| 1862 | 1913 | |
| 1863 | 1914 | ROM_START( drgw2j ) |
| 1864 | 1915 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 1865 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) )// (BIOS) |
| 1916 | PGM_68K_BIOS |
| 1866 | 1917 | ROM_LOAD16_WORD_SWAP( "v-100j.u2", 0x100000, 0x080000, CRC(f8f8393e) SHA1(ef0db668b4e4f661d4c1e95d57afe881bcdf13cc) ) |
| 1867 | 1918 | |
| 1868 | 1919 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| r7972 | r7973 | |
| 1884 | 1935 | ROM_LOAD( "pgm_m01s.rom", 0x000000, 0x200000, CRC(45ae7159) SHA1(d3ed3ff3464557fd0df6b069b2e431528b0ebfa8) ) // (BIOS) |
| 1885 | 1936 | ROM_END |
| 1886 | 1937 | |
| 1938 | |
| 1939 | |
| 1887 | 1940 | /* |
| 1888 | 1941 | |
| 1889 | | Dragon World 3 |
| 1890 | | Alta Co./IGS, 1998 |
| 1942 | Dragon World 3 (KOREA 106 Ver.) |
| 1943 | (c)1998 IGS |
| 1891 | 1944 | |
| 1892 | | Cart for IGS PGM system |
| 1945 | PGM system |
| 1946 | IGS PCB NO-0189 |
| 1947 | IGS PCB NO-0178 |
| 1893 | 1948 | |
| 1894 | | Top board of cart contains..... |
| 1895 | | 8MHz Xtal |
| 1896 | | 32.768kHz Xtal |
| 1897 | | UM6164 (RAM x 2) |
| 1898 | | MACH211 CPLD |
| 1899 | | IGS022 ASIC |
| 1900 | | IGS025 ASIC |
| 1901 | | 1x PAL |
| 1902 | | 2x 27C040 EPROMs (main 68k program) |
| 1903 | | 1x 27C512 EPROM (protection code?) |
| 1904 | | 1x 32MBit smt MASKROM (T0400) |
| 1905 | 1949 | |
| 1906 | | Bottom board contains..... |
| 1907 | | 4x 32MBit smt MASKROMs (A0400, A0401, B0400, M0400) |
| 1950 | DW3_V106.U12 [c3f6838b] |
| 1951 | DW3_V106.U13 [28284e22] |
| 1908 | 1952 | |
| 1953 | |
| 1909 | 1954 | */ |
| 1910 | 1955 | |
| 1911 | 1956 | ROM_START( drgw3 ) |
| 1912 | 1957 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 1913 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) |
| 1914 | | ROM_LOAD16_BYTE( "dw3_v100.u12", 0x100001, 0x080000, CRC(47243906) SHA1(9cd46e3cba97f049bcb238ceb6edf27a760ef831) ) |
| 1915 | | ROM_LOAD16_BYTE( "dw3_v100.u13", 0x100000, 0x080000, CRC(b7cded21) SHA1(c1ae2af2e42227503c81bbcd2bd6862aa416bd78) ) |
| 1958 | PGM_68K_BIOS |
| 1959 | ROM_LOAD16_BYTE( "dw3_v106.u12", 0x100001, 0x080000, CRC(c3f6838b) SHA1(c135b1d4dd62af308139d40d03c29be7508fb1e7) ) |
| 1960 | ROM_LOAD16_BYTE( "dw3_v106.u13", 0x100000, 0x080000, CRC(28284e22) SHA1(4643a69881ddb7383ca10f3eb2aa2cf41be39e9f) ) |
| 1916 | 1961 | |
| 1917 | 1962 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| 1918 | 1963 | |
| 1919 | | ROM_REGION( 0x010000, "user1", 0 ) /* Protection Data */ |
| 1920 | | ROM_LOAD( "dw3_v100.u15", 0x000000, 0x010000, CRC(03dc4fdf) SHA1(b329b04325d4f725231b1bb7862eedef2319b652) ) |
| 1964 | // ROM_REGION( 0x40000, "user2", 0 ) /* RAM dump - to be removed once the DMA is hooked up */ |
| 1965 | // ROM_LOAD16_WORD_SWAP( "dw3c_prot_ramdump", 0x0000, 0x4000, CRC(6b4fc08b) SHA1(61583637c2f1767df4bc637f922987c9510a584f) ) |
| 1921 | 1966 | |
| 1967 | ROM_REGION( 0x010000, "igs022data", 0 ) /* Protection Data - is it correct for this set? */ |
| 1968 | ROM_LOAD16_WORD_SWAP( "dw3_v100.u15", 0x000000, 0x010000, CRC(03dc4fdf) SHA1(b329b04325d4f725231b1bb7862eedef2319b652) ) |
| 1969 | |
| 1922 | 1970 | ROM_REGION( 0xc00000, "gfx1", 0 ) /* 8x8 Text Tiles + 32x32 BG Tiles */ |
| 1923 | 1971 | ROM_LOAD( "pgm_t01s.rom", 0x000000, 0x200000, CRC(1a7123a0) SHA1(cc567f577bfbf45427b54d6695b11b74f2578af3) ) // (BIOS) |
| 1924 | 1972 | ROM_LOAD( "dw3t0400.u18", 0x400000, 0x400000, CRC(b70f3357) SHA1(8733969d7d21f540f295a9f747a4bb8f0d325cf0) ) |
| r7972 | r7973 | |
| 1938 | 1986 | ROM_LOAD( "dw3m0400.u1", 0x400000, 0x400000, CRC(031eb9ce) SHA1(0673ec194732becc6648c2ae1396e894aa269f9a) ) |
| 1939 | 1987 | ROM_END |
| 1940 | 1988 | |
| 1989 | |
| 1990 | ROM_START( drgw3105 ) |
| 1991 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 1992 | PGM_68K_BIOS |
| 1993 | ROM_LOAD16_BYTE( "dw3_v105.u12", 0x100001, 0x080000, CRC(c5e24318) SHA1(c6954495bbc72c3985df75aecf6afd6826c8e30e) ) |
| 1994 | ROM_LOAD16_BYTE( "dw3_v105.u13", 0x100000, 0x080000, CRC(8d6c9d39) SHA1(cb79303ab551e91f07e11414db4254d5b161d415) ) |
| 1995 | //ROM_LOAD( "dw3c_prg.rom", 0x100000, 0x100000, CRC(e274cf03) SHA1(2ba532446bd5b5dbccf43a6d1b1f6b36842b2c8d) ) |
| 1996 | |
| 1997 | // ROM_REGION( 0x40000, "user2", 0 ) /* RAM dump - to be removed once the DMA is hooked up */ |
| 1998 | // ROM_LOAD16_WORD_SWAP( "dw3c_prot_ramdump", 0x0000, 0x4000, CRC(6b4fc08b) SHA1(61583637c2f1767df4bc637f922987c9510a584f) ) |
| 1999 | |
| 2000 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| 2001 | |
| 2002 | ROM_REGION( 0x010000, "igs022data", 0 ) /* Protection Data - is it correct for this set? */ |
| 2003 | ROM_LOAD16_WORD_SWAP( "dw3_v100.u15", 0x000000, 0x010000, CRC(03dc4fdf) SHA1(b329b04325d4f725231b1bb7862eedef2319b652) ) |
| 2004 | |
| 2005 | ROM_REGION( 0xc00000, "gfx1", 0 ) /* 8x8 Text Tiles + 32x32 BG Tiles */ |
| 2006 | ROM_LOAD( "pgm_t01s.rom", 0x000000, 0x200000, CRC(1a7123a0) SHA1(cc567f577bfbf45427b54d6695b11b74f2578af3) ) // (BIOS) |
| 2007 | ROM_LOAD( "dw3t0400.u18", 0x400000, 0x400000, CRC(b70f3357) SHA1(8733969d7d21f540f295a9f747a4bb8f0d325cf0) ) |
| 2008 | |
| 2009 | ROM_REGION( 0xc00000/5*8, "gfx2", ROMREGION_ERASEFF ) /* Region for 32x32 BG Tiles */ |
| 2010 | /* 32x32 Tile Data is put here for easier Decoding */ |
| 2011 | |
| 2012 | ROM_REGION( 0x1800000, "gfx3", 0 ) /* Sprite Colour Data */ |
| 2013 | ROM_LOAD( "dw3a0400.u9", 0x0000000, 0x400000, CRC(dd7bfd40) SHA1(fb7ec5bf89a413c5208716083762a725ff63f5db) ) // FIXED BITS (xxxxxxxx1xxxxxxx) |
| 2014 | ROM_LOAD( "dw3a0401.u10", 0x0400000, 0x400000, CRC(cab6557f) SHA1(1904dd86645eea27ac1ab8a2462b20f6531356f8) ) // FIXED BITS (xxxxxxxx1xxxxxxx) |
| 2015 | |
| 2016 | ROM_REGION( 0x1000000, "gfx4", 0 ) /* Sprite Masks + Colour Indexes */ |
| 2017 | ROM_LOAD( "dw3b0400.u13", 0x0000000, 0x400000, CRC(4bb87cc0) SHA1(71b2dc43fd11f7a6dffaba501e4e344b843583d8) ) // FIXED BITS (xxxxxxxx1xxxxxxx) |
| 2018 | |
| 2019 | ROM_REGION( 0x800000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ |
| 2020 | ROM_LOAD( "pgm_m01s.rom", 0x000000, 0x200000, CRC(45ae7159) SHA1(d3ed3ff3464557fd0df6b069b2e431528b0ebfa8) ) // (BIOS) |
| 2021 | ROM_LOAD( "dw3m0400.u1", 0x400000, 0x400000, CRC(031eb9ce) SHA1(0673ec194732becc6648c2ae1396e894aa269f9a) ) |
| 2022 | ROM_END |
| 1941 | 2023 | /* |
| 1942 | 2024 | |
| 1943 | | Dragon World 3 (KOREA 106 Ver.) |
| 1944 | | (c)1998 IGS |
| 2025 | Dragon World 3 |
| 2026 | Alta Co./IGS, 1998 |
| 1945 | 2027 | |
| 1946 | | PGM system |
| 1947 | | IGS PCB NO-0189 |
| 1948 | | IGS PCB NO-0178 |
| 2028 | Cart for IGS PGM system |
| 1949 | 2029 | |
| 2030 | Top board of cart contains..... |
| 2031 | 8MHz Xtal |
| 2032 | 32.768kHz Xtal |
| 2033 | UM6164 (RAM x 2) |
| 2034 | MACH211 CPLD |
| 2035 | IGS022 ASIC |
| 2036 | IGS025 ASIC |
| 2037 | 1x PAL |
| 2038 | 2x 27C040 EPROMs (main 68k program) |
| 2039 | 1x 27C512 EPROM (protection code?) |
| 2040 | 1x 32MBit smt MASKROM (T0400) |
| 1950 | 2041 | |
| 1951 | | DW3_V106.U12 [c3f6838b] |
| 1952 | | DW3_V106.U13 [28284e22] |
| 2042 | Bottom board contains..... |
| 2043 | 4x 32MBit smt MASKROMs (A0400, A0401, B0400, M0400) |
| 1953 | 2044 | |
| 1954 | | |
| 1955 | 2045 | */ |
| 1956 | 2046 | |
| 1957 | | ROM_START( drgw3k ) |
| 2047 | ROM_START( drgw3100 ) |
| 1958 | 2048 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 1959 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) |
| 1960 | | ROM_LOAD16_BYTE( "dw3_v106.u12", 0x100001, 0x080000, CRC(c3f6838b) SHA1(c135b1d4dd62af308139d40d03c29be7508fb1e7) ) |
| 1961 | | ROM_LOAD16_BYTE( "dw3_v106.u13", 0x100000, 0x080000, CRC(28284e22) SHA1(4643a69881ddb7383ca10f3eb2aa2cf41be39e9f) ) |
| 2049 | PGM_68K_BIOS |
| 2050 | ROM_LOAD16_BYTE( "dw3_v100.u12", 0x100001, 0x080000, CRC(47243906) SHA1(9cd46e3cba97f049bcb238ceb6edf27a760ef831) ) |
| 2051 | ROM_LOAD16_BYTE( "dw3_v100.u13", 0x100000, 0x080000, CRC(b7cded21) SHA1(c1ae2af2e42227503c81bbcd2bd6862aa416bd78) ) |
| 1962 | 2052 | |
| 1963 | 2053 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| 1964 | 2054 | |
| 1965 | | ROM_REGION( 0x010000, "user1", 0 ) /* Protection Data - is it correct for this set? */ |
| 1966 | | ROM_LOAD( "dw3_v100.u15", 0x000000, 0x010000, CRC(03dc4fdf) SHA1(b329b04325d4f725231b1bb7862eedef2319b652) ) |
| 2055 | // ROM_REGION( 0x40000, "user2", 0 ) /* RAM dump - to be removed once the DMA is hooked up */ |
| 2056 | // ROM_LOAD16_WORD_SWAP( "dw3c_prot_ramdump", 0x0000, 0x4000, CRC(6b4fc08b) SHA1(61583637c2f1767df4bc637f922987c9510a584f) ) |
| 1967 | 2057 | |
| 2058 | ROM_REGION( 0x010000, "igs022data", 0 ) /* Protection Data */ |
| 2059 | ROM_LOAD16_WORD_SWAP( "dw3_v100.u15", 0x000000, 0x010000, CRC(03dc4fdf) SHA1(b329b04325d4f725231b1bb7862eedef2319b652) ) |
| 2060 | |
| 1968 | 2061 | ROM_REGION( 0xc00000, "gfx1", 0 ) /* 8x8 Text Tiles + 32x32 BG Tiles */ |
| 1969 | 2062 | ROM_LOAD( "pgm_t01s.rom", 0x000000, 0x200000, CRC(1a7123a0) SHA1(cc567f577bfbf45427b54d6695b11b74f2578af3) ) // (BIOS) |
| 1970 | 2063 | ROM_LOAD( "dw3t0400.u18", 0x400000, 0x400000, CRC(b70f3357) SHA1(8733969d7d21f540f295a9f747a4bb8f0d325cf0) ) |
| r7972 | r7973 | |
| 1986 | 2079 | |
| 1987 | 2080 | ROM_START( kov ) |
| 1988 | 2081 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 1989 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) |
| 2082 | PGM_68K_BIOS |
| 1990 | 2083 | ROM_LOAD16_WORD_SWAP( "p0600.117", 0x100000, 0x400000, CRC(c4d19fe6) SHA1(14ef31539bfbc665e76c9703ee01b12228344052) ) |
| 1991 | 2084 | |
| 1992 | 2085 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| r7972 | r7973 | |
| 2018 | 2111 | |
| 2019 | 2112 | ROM_START( kov115 ) |
| 2020 | 2113 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 2021 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) )// (BIOS) |
| 2114 | PGM_68K_BIOS |
| 2022 | 2115 | ROM_LOAD16_WORD_SWAP( "p0600.115", 0x100000, 0x400000, CRC(527a2924) SHA1(7e3b166dddc5245d7b408e78437c16fd2986d1d9) ) |
| 2023 | 2116 | |
| 2024 | 2117 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| r7972 | r7973 | |
| 2081 | 2174 | |
| 2082 | 2175 | ROM_START( kov100 ) |
| 2083 | 2176 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 2084 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) )// (BIOS) |
| 2177 | PGM_68K_BIOS |
| 2085 | 2178 | ROM_LOAD16_BYTE( "sav111.u4", 0x100001, 0x080000, CRC(ae2f1b4e) SHA1(2ac9d84f5dee52f374941cfd68e2b98ecad436a8) ) |
| 2086 | 2179 | ROM_LOAD16_BYTE( "sav111.u7", 0x100000, 0x080000, CRC(95eedf0e) SHA1(582a54e9a1eda7ff73e20f0e69d2d50141772378) ) |
| 2087 | 2180 | ROM_LOAD16_BYTE( "sav111.u5", 0x200001, 0x080000, CRC(5fdd4aa8) SHA1(43c96e21ad4f11148e1e94a59c53780b2edd43ba) ) |
| r7972 | r7973 | |
| 2117 | 2210 | |
| 2118 | 2211 | ROM_START( kovplus ) |
| 2119 | 2212 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 2120 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) |
| 2213 | PGM_68K_BIOS |
| 2121 | 2214 | ROM_LOAD16_WORD_SWAP( "p0600.119", 0x100000, 0x400000, CRC(e4b0875d) SHA1(e8382e131b0e431406dc2a05cc1ef128302d987c) ) |
| 2122 | 2215 | |
| 2123 | 2216 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| r7972 | r7973 | |
| 2180 | 2273 | |
| 2181 | 2274 | ROM_START( kovplusa ) |
| 2182 | 2275 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 2183 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) |
| 2276 | PGM_68K_BIOS |
| 2184 | 2277 | ROM_LOAD16_BYTE( "v119.u3", 0x100001, 0x080000, CRC(6750388f) SHA1(869f4ad27f2992cc62baa9a78bf7984a43ec4cc5) ) |
| 2185 | 2278 | ROM_LOAD16_BYTE( "v119.u5", 0x100000, 0x080000, CRC(d4101ffd) SHA1(a327fd56eec65b07df9305cd93ef2c46bf8e40f3) ) |
| 2186 | 2279 | ROM_LOAD16_BYTE( "v119.u4", 0x200001, 0x080000, CRC(8200ece6) SHA1(97081d2e8aed2ac6fbe5951890aecea18af5ce2e) ) |
| r7972 | r7973 | |
| 2216 | 2309 | |
| 2217 | 2310 | ROM_START( kovsh ) |
| 2218 | 2311 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 2219 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) |
| 2312 | PGM_68K_BIOS |
| 2220 | 2313 | ROM_LOAD16_WORD_SWAP( "p0600.322", 0x100000, 0x400000, CRC(7c78e5f3) SHA1(9b1e4bd63fb1294ebeb539966842273c8dc7683b) ) |
| 2221 | 2314 | |
| 2222 | 2315 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| r7972 | r7973 | |
| 2252 | 2345 | |
| 2253 | 2346 | ROM_START( kovsh103 ) |
| 2254 | 2347 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 2255 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) |
| 2348 | PGM_68K_BIOS |
| 2256 | 2349 | ROM_LOAD16_WORD_SWAP( "p0600.103", 0x100000, 0x400000, CRC(f0b3da82) SHA1(4067beb69c049b51bce6154f4cf880600ca4de11) ) |
| 2257 | 2350 | |
| 2258 | 2351 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| r7972 | r7973 | |
| 2278 | 2371 | ROM_REGION( 0x1000000, "gfx4", 0 ) /* Sprite Masks + Colour Indexes */ |
| 2279 | 2372 | ROM_LOAD( "b0600.rom", 0x0000000, 0x0800000, CRC(7d3cd059) SHA1(00cf994b63337e0e4ebe96453daf45f24192af1c) ) |
| 2280 | 2373 | ROM_LOAD( "b0601.rom", 0x0800000, 0x0400000, CRC(a0bb1c2f) SHA1(0542348c6e27779e0a98de16f04f9c18158f2b28) ) |
| 2281 | | ROM_LOAD( "b0602.rom", 0x0c00000, 0x0100000, CRC(9df77934) SHA1(99a3fe337c13702c9aa2373bcd1bb1befd0e2a13) ) // tis dump had the same rom 4x bigger but with the data duplicated 4x, which is correct? |
| 2374 | ROM_LOAD( "b0602.rom", 0x0c00000, 0x0100000, CRC(9df77934) SHA1(99a3fe337c13702c9aa2373bcd1bb1befd0e2a13) ) // this dump had the same rom 4x bigger but with the data duplicated 4x, which is correct? |
| 2282 | 2375 | |
| 2283 | 2376 | ROM_REGION( 0x800000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ |
| 2284 | 2377 | ROM_LOAD( "pgm_m01s.rom", 0x000000, 0x200000, CRC(45ae7159) SHA1(d3ed3ff3464557fd0df6b069b2e431528b0ebfa8) ) // (BIOS) |
| r7972 | r7973 | |
| 2288 | 2381 | |
| 2289 | 2382 | ROM_START( photoy2k ) |
| 2290 | 2383 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 2291 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) |
| 2384 | PGM_68K_BIOS |
| 2292 | 2385 | ROM_LOAD16_WORD_SWAP( "v104.16m", 0x100000, 0x200000, CRC(e051070f) SHA1(a5a1a8dd7542a30632501af8d02fda07475fd9aa) ) |
| 2293 | 2386 | |
| 2294 | 2387 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| r7972 | r7973 | |
| 2353 | 2446 | |
| 2354 | 2447 | ROM_START( photoy2k102 ) |
| 2355 | 2448 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 2356 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) |
| 2449 | PGM_68K_BIOS |
| 2357 | 2450 | ROM_LOAD16_BYTE( "v102.u4", 0x100001, 0x080000, CRC(a65eda9f) SHA1(6307cacf4a262e781753eff14700a0455837780c) ) |
| 2358 | 2451 | ROM_LOAD16_BYTE( "v102.u6", 0x100000, 0x080000, CRC(b9ca5504) SHA1(058cf01316f233236ca9861349f515935283b75e) ) |
| 2359 | 2452 | ROM_LOAD16_BYTE( "v102.u5", 0x200001, 0x080000, CRC(9201621b) SHA1(1ca3ebe7eec40614bfa8b911657fa2b51f2c51a4) ) |
| r7972 | r7973 | |
| 2459 | 2552 | */ |
| 2460 | 2553 | |
| 2461 | 2554 | |
| 2555 | |
| 2556 | /* |
| 2557 | the text on the chip are |
| 2558 | ----------------- |
| 2559 | IGS |
| 2560 | PGM P0300 V109 |
| 2561 | 1A0577Y3 |
| 2562 | J982846 |
| 2563 | ----------------- |
| 2564 | */ |
| 2565 | |
| 2462 | 2566 | ROM_START( killbld ) |
| 2463 | 2567 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 2464 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) |
| 2465 | | ROM_LOAD16_WORD_SWAP( "kb.u9", 0x100000, 0x200000, BAD_DUMP CRC(43da77d7) SHA1(f99e89da4587d6c9e3c2ae66fa139830d893fdda) ) // not verified to be correct |
| 2568 | PGM_68K_BIOS |
| 2569 | ROM_LOAD16_WORD_SWAP( "p0300_v109.u9", 0x100000, 0x200000, CRC(2fcee215) SHA1(855281a9090bfdf3da9f4d50c121765131a13400) ) |
| 2466 | 2570 | |
| 2467 | | ROM_REGION( 0x4000, "user2", 0 ) /* dump of RAM shared with protection device, todo, emulate protection device instead! */ |
| 2468 | | ROM_LOAD( "kb.ram", 0x000000, 0x04000, CRC(6994c507) SHA1(8264c56709488b72282d6ddfce3a4b188c6cc109) ) |
| 2469 | | |
| 2470 | 2571 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| 2471 | 2572 | |
| 2472 | | ROM_REGION( 0x010000, "user1", 0 ) /* Protection Data */ |
| 2573 | ROM_REGION( 0x010000, "igs022data", 0 ) /* Protection Data */ |
| 2473 | 2574 | ROM_LOAD16_WORD_SWAP( "kb_u2.rom", 0x000000, 0x010000, CRC(de3eae63) SHA1(03af767ef764055bda528b5cc6a24b9e1218cca8) ) |
| 2474 | 2575 | |
| 2475 | 2576 | ROM_REGION( 0x800000, "gfx1", 0 ) /* 8x8 Text Tiles + 32x32 BG Tiles */ |
| r7972 | r7973 | |
| 2502 | 2603 | |
| 2503 | 2604 | ROM_START( killbld104 ) |
| 2504 | 2605 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 2505 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) |
| 2606 | PGM_68K_BIOS |
| 2506 | 2607 | ROM_LOAD16_BYTE( "kb_u3_v104.u3", 0x100001, 0x080000, CRC(6db1d719) SHA1(804002f014d275aaf0368fb7f904938fe4ac07ee) ) |
| 2507 | 2608 | ROM_LOAD16_BYTE( "kb_u6_v104.u6", 0x100000, 0x080000, CRC(31ecc978) SHA1(82666d534e4151775063af6d39f575faba0f1047) ) |
| 2508 | | ROM_LOAD16_BYTE( "kb_u4_v104.u4", 0x200001, 0x080000, CRC(1ed8b2e7) SHA1(331c037640cfc1fe743cd0e65a1156c470b3303e) ) // order? |
| 2509 | | ROM_LOAD16_BYTE( "kb_u5_v104.u5", 0x200000, 0x080000, CRC(a0bafc29) SHA1(b20db7c16353c6f87ed3c08c9d037b07336711f1) ) // order? |
| 2609 | ROM_LOAD16_BYTE( "kb_u4_v104.u4", 0x200001, 0x080000, CRC(1ed8b2e7) SHA1(331c037640cfc1fe743cd0e65a1156c470b3303e) ) |
| 2610 | ROM_LOAD16_BYTE( "kb_u5_v104.u5", 0x200000, 0x080000, CRC(a0bafc29) SHA1(b20db7c16353c6f87ed3c08c9d037b07336711f1) ) |
| 2510 | 2611 | |
| 2511 | | ROM_REGION( 0x4000, "user2", ROMREGION_ERASEFF ) |
| 2512 | | |
| 2513 | 2612 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| 2514 | 2613 | |
| 2515 | | ROM_REGION( 0x010000, "user1", 0 ) /* Protection Data */ |
| 2614 | ROM_REGION( 0x010000, "igs022data", 0 ) /* Protection Data */ |
| 2516 | 2615 | ROM_LOAD16_WORD_SWAP( "kb_u2_v104.u2", 0x000000, 0x010000, CRC(c970f6d5) SHA1(399fc6f80262784c566363c847dc3fdc4fb37494) ) |
| 2517 | 2616 | |
| 2518 | 2617 | ROM_REGION( 0x800000, "gfx1", 0 ) /* 8x8 Text Tiles + 32x32 BG Tiles */ |
| r7972 | r7973 | |
| 2545 | 2644 | |
| 2546 | 2645 | |
| 2547 | 2646 | |
| 2647 | |
| 2548 | 2648 | /* |
| 2549 | 2649 | Puzzle Star |
| 2550 | 2650 | IGS, 1999 |
| r7972 | r7973 | |
| 2598 | 2698 | |
| 2599 | 2699 | ROM_START( puzlstar ) |
| 2600 | 2700 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 2601 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) |
| 2701 | PGM_68K_BIOS |
| 2602 | 2702 | ROM_LOAD16_BYTE( "v100mg.u1", 0x100001, 0x080000, CRC(5788b77d) SHA1(7770aae6e686da92b2623c977d1bc8f019f48267) ) |
| 2603 | 2703 | ROM_LOAD16_BYTE( "v100mg.u2", 0x100000, 0x080000, CRC(4c79d979) SHA1(3b92052a35994f2b3dd164930154184c45d5e2d0) ) |
| 2604 | 2704 | |
| r7972 | r7973 | |
| 2683 | 2783 | |
| 2684 | 2784 | ROM_START( olds ) |
| 2685 | 2785 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 2686 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) )// (BIOS) |
| 2786 | PGM_68K_BIOS |
| 2687 | 2787 | ROM_LOAD16_BYTE( "sp_v101.u2", 0x100001, 0x080000, CRC(08eb9661) SHA1(105946e72e562adb1a9fd794ca0fd2c91967eb56) ) |
| 2688 | 2788 | ROM_LOAD16_BYTE( "sp_v101.u3", 0x100000, 0x080000, CRC(0a358c1e) SHA1(95c7c3f069c5d05001e22535750f6b3cd7de105f) ) |
| 2689 | 2789 | ROM_LOAD16_BYTE( "sp_v101.u4", 0x200001, 0x080000, CRC(766570e0) SHA1(e7c3f5664ec69b662b82c2e1375555db7305390c) ) |
| r7972 | r7973 | |
| 2692 | 2792 | |
| 2693 | 2793 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| 2694 | 2794 | |
| 2695 | | ROM_REGION( 0x010000, "user1", 0 ) /* ASIC25? Protection Data */ |
| 2795 | ROM_REGION( 0x010000, "user1", 0 ) /* IGS028 Protection Data */ |
| 2696 | 2796 | ROM_LOAD( "sp_v101.u6", 0x000000, 0x010000, CRC(097046bc) SHA1(6d75db85cf4c79b63e837897785c253014b2126d) ) |
| 2697 | 2797 | |
| 2698 | 2798 | ROM_REGION( 0x4000, "user2", ROMREGION_ERASEFF ) /* its a dump of the shared protection rom/ram from pcb. */ |
| r7972 | r7973 | |
| 2730 | 2830 | |
| 2731 | 2831 | ROM_START( olds100 ) |
| 2732 | 2832 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 2733 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) )// (BIOS) |
| 2833 | PGM_68K_BIOS |
| 2734 | 2834 | ROM_LOAD16_BYTE( "v100-u2.040", 0x100001, 0x080000, CRC(517c2a06) SHA1(bbf5b311fac9b0bb4d4129c0561e5e24f6963fa2) ) |
| 2735 | 2835 | ROM_LOAD16_BYTE( "v100-u3.040", 0x100000, 0x080000, CRC(d0e2b741) SHA1(2e671dbb4320d1f0c059b35efd33cdea26f12131) ) |
| 2736 | 2836 | ROM_LOAD16_BYTE( "v100-u4.040", 0x200001, 0x080000, CRC(32a6bdbd) SHA1(a93d7f4eae722a58eca9ec351ad5890cefda56f0) ) |
| r7972 | r7973 | |
| 2743 | 2843 | // used to simulate encrypted DMA protection device for now .. |
| 2744 | 2844 | ROM_LOAD( "ram_dump", 0x000000, 0x04000, CRC(280cfb4e) SHA1(cd2bdcaa21347952c2bf38b105a204d327fde39e) ) |
| 2745 | 2845 | |
| 2746 | | ROM_REGION( 0x010000, "user1", 0 ) /* ASIC25? Protection Data */ |
| 2846 | ROM_REGION( 0x010000, "user1", 0 ) /* IGS028 Protection Data */ |
| 2747 | 2847 | ROM_LOAD( "kd-u6.512", 0x000000, 0x010000, CRC(e7613dda) SHA1(0d7c043b90e2f9a36a45066f22e3e305dc716676) ) |
| 2748 | 2848 | |
| 2749 | 2849 | ROM_REGION( 0xc00000, "gfx1", 0 ) /* 8x8 Text Tiles + 32x32 BG Tiles */ |
| r7972 | r7973 | |
| 2777 | 2877 | /* this is the set which the protection ram dump seems to be for.. */ |
| 2778 | 2878 | ROM_START( olds100a ) |
| 2779 | 2879 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 2780 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) )// (BIOS) |
| 2880 | PGM_68K_BIOS |
| 2781 | 2881 | /* this rom had a lame hack applied to it by the dumper, this was removed, hopefully it is correct now */ |
| 2782 | 2882 | ROM_LOAD16_WORD_SWAP( "p0500.v10", 0x100000, 0x400000, CRC(8981fc87) SHA1(678d6705d06b99bca5951ff77708adadc4c4396b) ) |
| 2783 | 2883 | |
| 2784 | 2884 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| 2785 | 2885 | |
| 2786 | | ROM_REGION( 0x010000, "user1", ROMREGION_ERASEFF ) /* ASIC25? Protection Data */ |
| 2886 | ROM_REGION( 0x010000, "user1", ROMREGION_ERASEFF ) /* IGS028 Protection Data */ |
| 2787 | 2887 | /* missing from this set .. */ |
| 2788 | 2888 | |
| 2789 | 2889 | ROM_REGION( 0x4000, "user2", ROMREGION_ERASEFF ) /* its a dump of the shared protection rom/ram from pcb. */ |
| r7972 | r7973 | |
| 2821 | 2921 | |
| 2822 | 2922 | ROM_START( kov2 ) |
| 2823 | 2923 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 2824 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) |
| 2924 | PGM_68K_BIOS |
| 2825 | 2925 | ROM_LOAD16_WORD_SWAP( "u18.107", 0x100000, 0x400000, CRC(661a5b2c) SHA1(125054fabc93d4f4cba869c3e6adf863650d30cf) ) |
| 2826 | 2926 | |
| 2827 | 2927 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| r7972 | r7973 | |
| 2857 | 2957 | |
| 2858 | 2958 | ROM_START( kov2106 ) |
| 2859 | 2959 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 2860 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) |
| 2960 | PGM_68K_BIOS |
| 2861 | 2961 | ROM_LOAD16_WORD_SWAP( "u18.106", 0x100000, 0x400000, CRC(40051ad9) SHA1(ba2ddf267fe688d5dfed575aeeccbab10135b37b) ) |
| 2862 | 2962 | |
| 2863 | 2963 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| r7972 | r7973 | |
| 2894 | 2994 | |
| 2895 | 2995 | ROM_START( kov2103 ) |
| 2896 | 2996 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 2897 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) |
| 2997 | PGM_68K_BIOS |
| 2898 | 2998 | ROM_LOAD16_WORD_SWAP( "u18.103", 0x100000, 0x400000, CRC(98c32f76) SHA1(ec7e35e8071bb7097e415493be4e40be0ca19fd6) ) |
| 2899 | 2999 | |
| 2900 | 3000 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| r7972 | r7973 | |
| 2931 | 3031 | |
| 2932 | 3032 | ROM_START( kov2102 ) |
| 2933 | 3033 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 2934 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) |
| 3034 | PGM_68K_BIOS |
| 2935 | 3035 | ROM_LOAD16_WORD_SWAP( "u18.102", 0x100000, 0x400000, CRC(a2489c37) SHA1(77ea7cdec211848296dafd45bee1d042133ea2a6) ) |
| 2936 | 3036 | |
| 2937 | 3037 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| r7972 | r7973 | |
| 2967 | 3067 | |
| 2968 | 3068 | ROM_START( kov2100 ) |
| 2969 | 3069 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 2970 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) |
| 3070 | PGM_68K_BIOS |
| 2971 | 3071 | ROM_LOAD16_WORD_SWAP( "igs_u18.rom", 0x100000, 0x400000, CRC(86205879) SHA1(f73d5b70b41d39be1cac75e474b025de2cce0b01) ) |
| 2972 | 3072 | |
| 2973 | 3073 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| r7972 | r7973 | |
| 3003 | 3103 | |
| 3004 | 3104 | ROM_START( kov2p ) |
| 3005 | 3105 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 3006 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) |
| 3106 | PGM_68K_BIOS |
| 3007 | 3107 | ROM_LOAD16_WORD_SWAP( "v204-32m.rom", 0x100000, 0x400000, CRC(583e0650) SHA1(2e5656dd9c6cba9f84af9baa3f5f70cdccf9db47) ) |
| 3008 | 3108 | |
| 3009 | 3109 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| r7972 | r7973 | |
| 3039 | 3139 | |
| 3040 | 3140 | ROM_START( kov2p205 ) |
| 3041 | 3141 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 3042 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) |
| 3142 | PGM_68K_BIOS |
| 3043 | 3143 | ROM_LOAD16_WORD_SWAP( "u8-27322.rom", 0x100000, 0x400000, CRC(3a2cc0de) SHA1(d7511478b34bfb03b2fb5b8268b60502d05b9414) ) |
| 3044 | 3144 | |
| 3045 | 3145 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| r7972 | r7973 | |
| 3090 | 3190 | |
| 3091 | 3191 | ROM_START( ddp2 ) |
| 3092 | 3192 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 3093 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) |
| 3193 | PGM_68K_BIOS |
| 3094 | 3194 | ROM_LOAD16_WORD_SWAP( "v100.u8", 0x100000, 0x200000, CRC(0c8aa8ea) SHA1(57e33224622607a1df8daabf26ba063cf8a6d3fc) ) |
| 3095 | 3195 | |
| 3096 | 3196 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| r7972 | r7973 | |
| 3122 | 3222 | |
| 3123 | 3223 | ROM_START( ddp2a ) |
| 3124 | 3224 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 3125 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) |
| 3225 | PGM_68K_BIOS |
| 3126 | 3226 | ROM_LOAD16_WORD_SWAP( "v102.u8", 0x100000, 0x200000, CRC(5a9ea040) SHA1(51eaec46c368f7cfc5245e64896092f52b1193e0) ) |
| 3127 | 3227 | |
| 3128 | 3228 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| r7972 | r7973 | |
| 3208 | 3308 | */ |
| 3209 | 3309 | ROM_START( puzzli2 ) |
| 3210 | 3310 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 3211 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) |
| 3311 | PGM_68K_BIOS |
| 3212 | 3312 | ROM_LOAD16_BYTE( "2sp_v200.u3", 0x100001, 0x080000, CRC(2a5ba8a6) SHA1(4c87b849fd6f39152e3e2ef699b78ce24b3fb6d0) ) |
| 3213 | 3313 | ROM_LOAD16_BYTE( "2sp_v200.u4", 0x100000, 0x080000, CRC(fa5c86c1) SHA1(11c219722b891b775c0f7f9bc8276cdd8f74d657) ) |
| 3214 | 3314 | |
| r7972 | r7973 | |
| 3300 | 3400 | |
| 3301 | 3401 | ROM_START( martmast ) |
| 3302 | 3402 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 3303 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) |
| 3403 | PGM_68K_BIOS |
| 3304 | 3404 | ROM_LOAD16_WORD_SWAP( "v104_32m.u9", 0x100000, 0x400000, CRC(cfd9dff4) SHA1(328eaf6ac49a73265ee4e0f992b1b1312f49877b) ) |
| 3305 | 3405 | |
| 3306 | 3406 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| r7972 | r7973 | |
| 3337 | 3437 | |
| 3338 | 3438 | ROM_START( martmastc ) |
| 3339 | 3439 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 3340 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) |
| 3440 | PGM_68K_BIOS |
| 3341 | 3441 | ROM_LOAD16_WORD_SWAP( "v104_32m.u9", 0x100000, 0x400000, CRC(cfd9dff4) SHA1(328eaf6ac49a73265ee4e0f992b1b1312f49877b) ) |
| 3342 | 3442 | |
| 3343 | 3443 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| r7972 | r7973 | |
| 3374 | 3474 | |
| 3375 | 3475 | ROM_START( martmastc102 ) |
| 3376 | 3476 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 3377 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) |
| 3477 | PGM_68K_BIOS |
| 3378 | 3478 | ROM_LOAD16_WORD_SWAP( "martmast_u9-v102.322", 0x100000, 0x400000, CRC(bb24b92a) SHA1(442cb9e3f51727be82f71c078c5c3e49dc1a23f0) ) |
| 3379 | 3479 | |
| 3380 | 3480 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| r7972 | r7973 | |
| 3462 | 3562 | |
| 3463 | 3563 | ROM_START( dmnfrnt ) |
| 3464 | 3564 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 3465 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) |
| 3565 | PGM_68K_BIOS |
| 3466 | 3566 | ROM_LOAD16_WORD_SWAP( "v102_16m.u5", 0x100000, 0x200000, CRC(3d4d481a) SHA1(95953b8f31343389405cc722b4177ff5adf67b62) ) |
| 3467 | 3567 | |
| 3468 | 3568 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| r7972 | r7973 | |
| 3496 | 3596 | |
| 3497 | 3597 | ROM_START( dmnfrnta ) |
| 3498 | 3598 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 3499 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) |
| 3599 | PGM_68K_BIOS |
| 3500 | 3600 | ROM_LOAD16_WORD_SWAP( "v105_16m.u5", 0x100000, 0x200000, CRC(bda083bd) SHA1(58d6438737a2c43aa8bbcb7f34fb51375b781b1c) ) |
| 3501 | 3601 | |
| 3502 | 3602 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| r7972 | r7973 | |
| 3530 | 3630 | |
| 3531 | 3631 | ROM_START( theglad ) |
| 3532 | 3632 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 3533 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) |
| 3633 | PGM_68K_BIOS |
| 3534 | 3634 | ROM_LOAD16_WORD_SWAP( "u6.rom", 0x100000, 0x080000, CRC(14c85212) SHA1(8d2489708e176a2c460498a13173be01f645b79e) ) |
| 3535 | 3635 | |
| 3536 | 3636 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| r7972 | r7973 | |
| 3564 | 3664 | |
| 3565 | 3665 | ROM_START( theglada ) |
| 3566 | 3666 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 3567 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) |
| 3667 | PGM_68K_BIOS |
| 3568 | 3668 | ROM_LOAD16_WORD_SWAP( "v101.u6", 0x100000, 0x080000, CRC(f799e866) SHA1(dccc3c903357c40c3cf85ac0ae8fc12fb0f853a6) ) |
| 3569 | 3669 | |
| 3570 | 3670 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| r7972 | r7973 | |
| 3598 | 3698 | |
| 3599 | 3699 | ROM_START( oldsplus ) |
| 3600 | 3700 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 3601 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) |
| 3701 | PGM_68K_BIOS |
| 3602 | 3702 | ROM_LOAD16_WORD_SWAP( "p05301.rom", 0x100000, 0x400000, CRC(923f7246) SHA1(818ade79e9724f5a2b0cc5a647ae5d4ee0374799) ) |
| 3603 | 3703 | |
| 3604 | 3704 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| r7972 | r7973 | |
| 3630 | 3730 | |
| 3631 | 3731 | ROM_START( kovshp ) |
| 3632 | 3732 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 3633 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) |
| 3733 | PGM_68K_BIOS |
| 3634 | 3734 | ROM_LOAD16_WORD_SWAP( "p0600h.rom", 0x100000, 0x400000, CRC(e251e8e4) SHA1(af5b7c81632a39e1450d932951bed634c76b84e8) ) |
| 3635 | 3735 | |
| 3636 | 3736 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| r7972 | r7973 | |
| 3662 | 3762 | |
| 3663 | 3763 | ROM_START( killbldp ) |
| 3664 | 3764 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 3665 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) |
| 3765 | PGM_68K_BIOS |
| 3666 | 3766 | ROM_LOAD16_WORD_SWAP( "v300x.u6", 0x100000, 0x080000, CRC(b7fb8ec9) SHA1(e71b2d74269a82c7155b9818821156e128b68b28) ) |
| 3667 | 3767 | |
| 3668 | 3768 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| r7972 | r7973 | |
| 3697 | 3797 | |
| 3698 | 3798 | ROM_START( svg ) |
| 3699 | 3799 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 3700 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) |
| 3800 | PGM_68K_BIOS |
| 3701 | 3801 | ROM_LOAD16_WORD_SWAP( "u30.bin", 0x100000, 0x080000, CRC(34c18f3f) SHA1(42d1edd0dcfaa5e44861c6a1d4cb24f51ba23de8) ) |
| 3702 | 3802 | |
| 3703 | 3803 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| r7972 | r7973 | |
| 3734 | 3834 | |
| 3735 | 3835 | ROM_START( happy6 ) |
| 3736 | 3836 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 3737 | | ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) ) // (BIOS) |
| 3837 | PGM_68K_BIOS |
| 3738 | 3838 | ROM_LOAD16_WORD_SWAP( "happy6in1_v100cn.u5", 0x100000, 0x080000, CRC(a25418e8) SHA1(acd7e7b69956cb4ce8e26c6420cb97bb4bf404e7) ) |
| 3739 | 3839 | |
| 3740 | 3840 | /* CPU2 = Z80, romless, code uploaded by 68k */ |
| r7972 | r7973 | |
| 4092 | 4192 | kov2_latch_init(machine); |
| 4093 | 4193 | } |
| 4094 | 4194 | |
| 4095 | | static DRIVER_INIT( dw3 ) |
| 4096 | | { |
| 4097 | | pgm_basic_init(machine); |
| 4098 | 4195 | |
| 4099 | | // memory_install_readwrite16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xda0000, 0xdaffff, 0, 0, dw3_prot_r, dw3_prot_w); |
| 4196 | /* The IGS022 is an MCU which performs encrypted DMA used by |
| 4197 | - The Killing Blade |
| 4198 | - Dragon World 3 |
| 4100 | 4199 | |
| 4101 | | pgm_dw3_decrypt(machine); |
| 4102 | | } |
| 4200 | There is also an automatic transfer which happens on startup using params stored in the data ROM. |
| 4201 | This has been verified on real hardware running without any 68k game program. |
| 4103 | 4202 | |
| 4104 | | /* Killing Blade uses some kind of DMA protection device which can copy data from a data rom. The |
| 4105 | | MCU appears to have an internal ROM as if you remove the data ROM then the shared ram is filled |
| 4106 | | with a constant value. |
| 4107 | | |
| 4108 | | The device can perform various decryption operations on the data it copies. for now we're just |
| 4109 | | using a dump of the shared RAM instead. This will be improved later. |
| 4110 | 4203 | */ |
| 4111 | 4204 | |
| 4112 | 4205 | |
| 4113 | | static WRITE16_HANDLER( killbld_prot_w ) |
| 4206 | static void IGS022_do_dma(running_machine* machine, UINT16 src, UINT16 dst, UINT16 size, UINT16 mode) |
| 4114 | 4207 | { |
| 4115 | | // mame_printf_debug("killbrd prot r\n"); |
| 4116 | | // return 0; |
| 4117 | | pgm_state *state = (pgm_state *)space->machine->driver_data; |
| 4118 | | offset &= 0xf; |
| 4208 | pgm_state *state = (pgm_state *)machine->driver_data; |
| 4209 | UINT16 param; |
| 4210 | /* |
| 4211 | P_SRC =0x300290 (offset from prot rom base) |
| 4212 | P_DST =0x300292 (words from 0x300000) |
| 4213 | P_SIZE=0x300294 (words) |
| 4214 | P_MODE=0x300296 |
| 4119 | 4215 | |
| 4120 | | if (offset == 0) |
| 4121 | | state->kb_cmd = data; |
| 4122 | | else //offset==2 |
| 4216 | Mode 5 direct |
| 4217 | Mode 6 swap nibbles and bytes |
| 4218 | |
| 4219 | 1,2,3 table based ops |
| 4220 | */ |
| 4221 | |
| 4222 | //mame_printf_debug("src %04x dst %04x size %04x mode %04x\n", src, dst, size, mode); |
| 4223 | |
| 4224 | //if (src&1) mame_printf_debug("odd offset\n"); |
| 4225 | |
| 4226 | param = mode >> 8; |
| 4227 | mode &=0xf; // what are the other bits? |
| 4228 | |
| 4229 | |
| 4230 | if ((mode == 0) || (mode == 1) || (mode == 2) || (mode == 3)) |
| 4123 | 4231 | { |
| 4124 | | logerror("%06X: ASIC25 W CMD %X VAL %X", cpu_get_pc(space->cpu), state->kb_cmd, data); |
| 4125 | | if (state->kb_cmd == 0) |
| 4126 | | state->kb_reg = data; |
| 4127 | | else if (state->kb_cmd == 2) |
| 4232 | /* mode3 applies a xor from a 0x100 byte table to the data being |
| 4233 | transferred |
| 4234 | |
| 4235 | the table is stored at the start of the protection rom. |
| 4236 | |
| 4237 | the param used with the mode gives a start offset into the table |
| 4238 | |
| 4239 | odd offsets seem to change the table slightly (see rawDataOdd) |
| 4240 | |
| 4241 | */ |
| 4242 | |
| 4243 | /* |
| 4244 | unsigned char rawDataOdd[256] = { |
| 4245 | 0xB6, 0xA8, 0xB1, 0x5D, 0x2C, 0x5D, 0x4F, 0xC1, |
| 4246 | 0xCF, 0x39, 0x3A, 0xB7, 0x65, 0x85, 0xD9, 0xEE, |
| 4247 | 0xDB, 0x7B, 0x5F, 0x81, 0x03, 0x6D, 0xEB, 0x07, |
| 4248 | 0x0F, 0xB5, 0x61, 0x59, 0xCD, 0x60, 0x06, 0x21, |
| 4249 | 0xA0, 0x99, 0xDD, 0x27, 0x42, 0xD7, 0xC5, 0x5B, |
| 4250 | 0x3B, 0xC6, 0x4F, 0xA2, 0x20, 0xF6, 0x61, 0x61, |
| 4251 | 0x8C, 0x46, 0x8C, 0xCA, 0xE0, 0x0E, 0x2C, 0xE9, |
| 4252 | 0xBA, 0x0F, 0x45, 0x6D, 0x36, 0x1C, 0x18, 0x37, |
| 4253 | 0xE7, 0x85, 0x89, 0xA4, 0x94, 0x46, 0x30, 0x9B, |
| 4254 | 0xB2, 0xF4, 0x41, 0x55, 0xA5, 0x63, 0x1C, 0xEF, |
| 4255 | 0xB7, 0x18, 0xB3, 0xB1, 0xD4, 0x72, 0xA0, 0x1C, |
| 4256 | 0x0B, 0x97, 0x02, 0xB6, 0xC5, 0x1F, 0x1B, 0x94, |
| 4257 | 0xC3, 0x83, 0xAA, 0xAC, 0xD9, 0x44, 0x09, 0xD7, |
| 4258 | 0x6C, 0xDB, 0x07, 0xA9, 0xAD, 0x64, 0x83, 0xF1, |
| 4259 | 0x92, 0x09, 0xCD, 0x0E, 0x99, 0x2F, 0xBC, 0xF8, |
| 4260 | 0x3C, 0x63, 0x8F, 0x0A, 0x33, 0x03, 0x84, 0x91, |
| 4261 | 0x6C, 0xAC, 0x3A, 0x15, 0xCB, 0x67, 0xC7, 0x69, |
| 4262 | 0xA1, 0x92, 0x99, 0x74, 0xEE, 0x90, 0x0D, 0xBE, |
| 4263 | 0x57, 0x30, 0xD1, 0xBA, 0xE5, 0xDE, 0xFA, 0xD6, |
| 4264 | 0x83, 0x8C, 0xE4, 0x43, 0x36, 0x5E, 0xCD, 0x84, |
| 4265 | 0x1A, 0x18, 0x31, 0xB9, 0x20, 0x48, 0xE3, 0xA8, |
| 4266 | 0x89, 0x32, 0xF0, 0x90, 0x21, 0x80, 0x33, 0xAE, |
| 4267 | 0x3C, 0xA6, 0xB8, 0x8C, 0x72, 0x17, 0xD1, 0x0C, |
| 4268 | 0x1A, 0x29, 0xFA, 0x38, 0x87, 0xC9, 0x6E, 0xC7, |
| 4269 | 0x05, 0xDE, 0x85, 0x6E, 0x92, 0x7E, 0xD4, 0xED, |
| 4270 | 0x5C, 0xD3, 0x03, 0xD4, 0xFE, 0xCB, 0x6C, 0x19, |
| 4271 | 0x7A, 0x83, 0x79, 0x5B, 0xF6, 0x71, 0xBA, 0xF4, |
| 4272 | 0x37, 0x53, 0xC9, 0xC1, 0xDE, 0xDB, 0xDE, 0xB1, |
| 4273 | 0x64, 0x17, 0x31, 0x0E, 0xD7, 0xA2, 0x13, 0x8E, |
| 4274 | 0x52, 0x8D, 0xCB, 0x19, 0x3D, 0x0B, 0x31, 0x58, |
| 4275 | 0x4A, 0xDE, 0x0C, 0x01, 0x2B, 0x85, 0x2D, 0xE5, |
| 4276 | 0x13, 0x22, 0x48, 0xB6, 0xF3, 0x2D, 0x00, 0x9A |
| 4277 | }; |
| 4278 | */ |
| 4279 | int x; |
| 4280 | UINT16 *PROTROM = (UINT16*)memory_region(machine, "igs022data"); |
| 4281 | |
| 4282 | for (x = 0; x < size; x++) |
| 4128 | 4283 | { |
| 4129 | | if (data == 1) //Execute cmd |
| 4130 | | { |
| 4131 | | UINT16 cmd = state->sharedprotram[0x200/2]; |
| 4132 | | //mame_printf_debug("command %04x\n", cmd); |
| 4133 | | if (cmd == 0x6d) //Store values to asic ram |
| 4134 | | { |
| 4135 | | UINT32 p1 = (state->sharedprotram[0x298/2] << 16) | state->sharedprotram[0x29a/2]; |
| 4136 | | UINT32 p2 = (state->sharedprotram[0x29c/2] << 16) | state->sharedprotram[0x29e/2]; |
| 4284 | //UINT16 *RAMDUMP = (UINT16*)memory_region(space->machine, "user2"); |
| 4285 | //UINT16 dat = RAMDUMP[dst + x]; |
| 4137 | 4286 | |
| 4138 | | if ((p2 & 0xffff) == 0x9) //Set value |
| 4139 | | { |
| 4140 | | int reg = (p2 >> 16) & 0xffff; |
| 4141 | | if (reg & 0x200) |
| 4142 | | state->kb_regs[reg & 0xff] = p1; |
| 4143 | | } |
| 4144 | | if ((p2 & 0xffff) == 0x6) //Add value |
| 4145 | | { |
| 4146 | | int src1 = (p1 >> 16) & 0xff; |
| 4147 | | int src2 = (p1 >> 0) & 0xff; |
| 4148 | | int dst = (p2 >> 16) & 0xff; |
| 4149 | | state->kb_regs[dst] = state->kb_regs[src2] - state->kb_regs[src1]; |
| 4150 | | } |
| 4151 | | if ((p2 & 0xffff) == 0x1) //Add Imm? |
| 4152 | | { |
| 4153 | | int reg = (p2 >> 16) & 0xff; |
| 4154 | | int imm = (p1 >> 0) & 0xffff; |
| 4155 | | state->kb_regs[reg] += imm; |
| 4156 | | } |
| 4157 | | if ((p2 & 0xffff) == 0xa) //Get value |
| 4158 | | { |
| 4159 | | int reg = (p1 >> 16) & 0xFF; |
| 4160 | | state->sharedprotram[0x29c/2] = (state->kb_regs[reg] >> 16) & 0xffff; |
| 4161 | | state->sharedprotram[0x29e/2] = state->kb_regs[reg] & 0xffff; |
| 4162 | | } |
| 4163 | | } |
| 4164 | | if(cmd == 0x4f) //memcpy with encryption / scrambling |
| 4165 | | { |
| 4166 | | UINT16 src = state->sharedprotram[0x290 / 2] >> 1; // ? |
| 4167 | | UINT32 dst = state->sharedprotram[0x292 / 2]; |
| 4168 | | UINT16 size = state->sharedprotram[0x294 / 2]; |
| 4169 | | UINT16 mode = state->sharedprotram[0x296 / 2]; |
| 4287 | UINT16 dat2 = PROTROM[src + x]; |
| 4170 | 4288 | |
| 4289 | UINT8 extraoffset = param&0xfe; // the lowest bit changed the table addressing in tests, see 'rawDataOdd' table instead.. it's still related to the main one, not identical |
| 4290 | UINT8* dectable = (UINT8*)memory_region(machine, "igs022data");//rawDataEven; // the basic decryption table is at the start of the mcu data rom! at least in killbld |
| 4291 | UINT16 extraxor = ((dectable[((x*2)+0+extraoffset)&0xff]) << 8) | (dectable[((x*2)+1+extraoffset)&0xff] << 0); |
| 4171 | 4292 | |
| 4172 | | // int a=1; |
| 4173 | | // if(src==0x580) |
| 4174 | | // int a=1; |
| 4175 | | /* |
| 4176 | | P_SRC =0x300290 (offset from prot rom base) |
| 4177 | | P_DST =0x300292 (words from 0x300000) |
| 4178 | | P_SIZE=0x300294 (words) |
| 4179 | | P_MODE=0x300296 |
| 4293 | dat2 = ((dat2 & 0x00ff)<<8) | ((dat2 & 0xff00)>>8); |
| 4180 | 4294 | |
| 4181 | | Mode 5 direct |
| 4182 | | Mode 6 swap nibbles and bytes |
| 4295 | // mode==0 plain |
| 4296 | if (mode==3) dat2 ^= extraxor; |
| 4297 | if (mode==2) dat2 += extraxor; |
| 4298 | if (mode==1) dat2 -= extraxor; |
| 4183 | 4299 | |
| 4184 | | 1,2,3 unk. |
| 4185 | | */ |
| 4300 | //if (dat!=dat2) |
| 4301 | // printf("Mode %04x Param %04x Mismatch %04x %04x\n", mode, param, dat, dat2); |
| 4186 | 4302 | |
| 4187 | | //mame_printf_debug("src %04x dst %04x size %04x mode %04x\n", src, dst, size, mode); |
| 4303 | state->sharedprotram[dst + x] = dat2; |
| 4304 | } |
| 4188 | 4305 | |
| 4189 | | //if (src&1) mame_printf_debug("odd offset\n"); |
| 4306 | /* hack, patches out some additional security checks... we need to emulate them instead! |
| 4307 | they occur before it displays the disclaimer, so if you remove the overlay patches it will display |
| 4308 | the highscore table before coming up with this error... */ |
| 4309 | if ((mode==3) && (param==0x54) && (src*2==0x2120) && (dst*2==0x2600)) state->sharedprotram[0x2600 / 2] = 0x4e75; |
| 4190 | 4310 | |
| 4191 | | mode &=0xf; // what are the other bits? |
| 4311 | } |
| 4312 | if (mode == 4) |
| 4313 | { |
| 4314 | mame_printf_debug("unhandled copy mode %04x!\n", mode); |
| 4315 | // not used by killing blade |
| 4316 | /* looks almost like a fixed value xor, but isn't */ |
| 4317 | } |
| 4318 | else if (mode == 5) |
| 4319 | { |
| 4320 | /* mode 5 seems to be a straight copy */ |
| 4321 | int x; |
| 4322 | UINT16 *PROTROM = (UINT16*)memory_region(machine, "igs022data"); |
| 4323 | for (x = 0; x < size; x++) |
| 4324 | { |
| 4325 | UINT16 dat = PROTROM[src + x]; |
| 4192 | 4326 | |
| 4193 | | if (mode == 1 || mode == 2 || mode == 3) |
| 4194 | | { |
| 4195 | | /* for now, cheat -- the scramble isn't understood, it might |
| 4196 | | be state based */ |
| 4197 | | int x; |
| 4198 | | UINT16 *RAMDUMP = (UINT16*)memory_region(space->machine, "user2"); |
| 4199 | | for (x = 0; x < size; x++) |
| 4200 | | { |
| 4201 | | UINT16 dat; |
| 4202 | 4327 | |
| 4203 | | dat = RAMDUMP[dst + x]; |
| 4204 | | state->sharedprotram[dst + x] = dat; |
| 4205 | | } |
| 4206 | | } |
| 4207 | | else if (mode == 5) |
| 4208 | | { |
| 4209 | | /* mode 5 seems to be a straight copy */ |
| 4210 | | int x; |
| 4211 | | UINT16 *RAMDUMP = (UINT16*)memory_region(space->machine, "user2"); |
| 4212 | | UINT16 *PROTROM = (UINT16*)memory_region(space->machine, "user1"); |
| 4213 | | for (x = 0; x < size; x++) |
| 4214 | | { |
| 4215 | | UINT16 dat = PROTROM[src + x]; |
| 4328 | state->sharedprotram[dst + x] = dat; |
| 4329 | } |
| 4330 | } |
| 4331 | else if (mode == 6) |
| 4332 | { |
| 4333 | /* mode 6 seems to swap bytes and nibbles */ |
| 4334 | int x; |
| 4335 | UINT16 *PROTROM = (UINT16*)memory_region(machine, "igs022data"); |
| 4336 | for (x = 0; x < size; x++) |
| 4337 | { |
| 4338 | UINT16 dat = PROTROM[src + x]; |
| 4216 | 4339 | |
| 4217 | | if (RAMDUMP[dst + x] != dat) |
| 4218 | | mame_printf_debug("Mismatch! %04x %04x\n", RAMDUMP[dst + x], dat); |
| 4340 | dat = ((dat & 0xf000) >> 12)| |
| 4341 | ((dat & 0x0f00) >> 4)| |
| 4342 | ((dat & 0x00f0) << 4)| |
| 4343 | ((dat & 0x000f) << 12); |
| 4219 | 4344 | |
| 4220 | | state->sharedprotram[dst + x] = dat; |
| 4221 | | } |
| 4222 | | } |
| 4223 | | else if (mode == 6) |
| 4224 | | { |
| 4225 | | /* mode 6 seems to swap bytes and nibbles */ |
| 4226 | | int x; |
| 4227 | | UINT16 *RAMDUMP = (UINT16*)memory_region(space->machine, "user2"); |
| 4228 | | UINT16 *PROTROM = (UINT16*)memory_region(space->machine, "user1"); |
| 4229 | | for (x = 0; x < size; x++) |
| 4230 | | { |
| 4231 | | UINT16 dat = PROTROM[src + x]; |
| 4345 | state->sharedprotram[dst + x] = dat; |
| 4346 | } |
| 4347 | } |
| 4348 | else if (mode == 7) |
| 4349 | { |
| 4350 | mame_printf_debug("unhandled copy mode %04x!\n", mode); |
| 4351 | // not used by killing blade |
| 4352 | /* weird mode, the params get left in memory? - maybe it's a NOP? */ |
| 4353 | } |
| 4354 | else |
| 4355 | { |
| 4356 | mame_printf_debug("unhandled copy mode %04x!\n", mode); |
| 4357 | // not used by killing blade |
| 4358 | /* invalid? */ |
| 4232 | 4359 | |
| 4233 | | dat = ((dat & 0xf000) >> 12)| |
| 4234 | | ((dat & 0x0f00) >> 4)| |
| 4235 | | ((dat & 0x00f0) << 4)| |
| 4236 | | ((dat & 0x000f) << 12); |
| 4360 | } |
| 4361 | } |
| 4237 | 4362 | |
| 4238 | | if (RAMDUMP[dst + x] != dat) |
| 4239 | | mame_printf_debug("Mismatch! Mode 6 %04x %04x\n", RAMDUMP[dst + x], dat); |
| 4363 | // the internal MCU boot code automatically does this DMA |
| 4364 | // and puts the version # of the data rom in ram |
| 4365 | static void IGS022_reset(running_machine* machine) |
| 4366 | { |
| 4367 | int i; |
| 4368 | UINT16 *PROTROM = (UINT16*)memory_region(machine, "igs022data"); |
| 4369 | pgm_state *state = (pgm_state *)machine->driver_data; |
| 4370 | UINT16 tmp; |
| 4240 | 4371 | |
| 4241 | | state->sharedprotram[dst + x] = dat; |
| 4242 | | } |
| 4243 | | } |
| 4244 | | else |
| 4245 | | { |
| 4246 | | mame_printf_debug("unknown copy mode!\n"); |
| 4247 | | } |
| 4248 | | /* hack.. it jumps here but there isn't valid code even when we do |
| 4249 | | use what was in ram.. probably some more protection as the game |
| 4250 | | still doesn't behave 100% correctly :-/ |
| 4372 | // fill ram with A5 patern |
| 4373 | for (i = 0; i < 0x4000/2; i++) |
| 4374 | state->sharedprotram[i] = 0xa55a; |
| 4251 | 4375 | |
| 4252 | | the code is copied in 'mode 3' but even the code put here on |
| 4253 | | the real ram dump is corrupt??? something _very_ strange is |
| 4254 | | going on.. maybe more rom overlays, or ram overlays too?? |
| 4376 | // the auto-dma |
| 4377 | UINT16 src = PROTROM[0x100 / 2]; |
| 4378 | UINT32 dst = PROTROM[0x102 / 2]; |
| 4379 | UINT16 size = PROTROM[0x104/ 2]; |
| 4380 | UINT16 mode = PROTROM[0x106 / 2]; |
| 4255 | 4381 | |
| 4256 | | */ |
| 4257 | | state->sharedprotram[0x2600 / 2] = 0x4e75; |
| 4382 | src = ((src & 0xff00) >> 8) | ((src & 0x00ff) << 8); |
| 4383 | dst = ((dst & 0xff00) >> 8) | ((dst & 0x00ff) << 8); |
| 4384 | size = ((size & 0xff00) >> 8) | ((size & 0x00ff) << 8); |
| 4385 | mode &= 0xff; |
| 4258 | 4386 | |
| 4387 | src >>= 1; |
| 4259 | 4388 | |
| 4260 | | } |
| 4389 | printf("Auto-DMA %04x %04x %04x %04x\n",src,dst,size,mode); |
| 4390 | |
| 4391 | IGS022_do_dma(machine,src,dst,size,mode); |
| 4392 | |
| 4393 | // there is also a version ID? (or is it some kind of checksum) that is stored in the data rom, and gets copied.. |
| 4394 | // Dragon World 3 checks it |
| 4395 | tmp = PROTROM[0x114/2]; |
| 4396 | tmp = ((tmp & 0xff00) >> 8) | ((tmp & 0x00ff) << 8); |
| 4397 | state->sharedprotram[0x2a2/2] = tmp; |
| 4398 | } |
| 4399 | |
| 4400 | static void IGS022_handle_command(running_machine* machine) |
| 4401 | { |
| 4402 | pgm_state *state = (pgm_state *)machine->driver_data; |
| 4403 | UINT16 cmd = state->sharedprotram[0x200/2]; |
| 4404 | //mame_printf_debug("command %04x\n", cmd); |
| 4405 | if (cmd == 0x6d) //Store values to asic ram |
| 4406 | { |
| 4407 | UINT32 p1 = (state->sharedprotram[0x298/2] << 16) | state->sharedprotram[0x29a/2]; |
| 4408 | UINT32 p2 = (state->sharedprotram[0x29c/2] << 16) | state->sharedprotram[0x29e/2]; |
| 4409 | |
| 4410 | if ((p2 & 0xffff) == 0x9) //Set value |
| 4411 | { |
| 4412 | int reg = (p2 >> 16) & 0xffff; |
| 4413 | if (reg & 0x200) |
| 4414 | state->kb_regs[reg & 0xff] = p1; |
| 4415 | } |
| 4416 | if ((p2 & 0xffff) == 0x6) //Add value |
| 4417 | { |
| 4418 | int src1 = (p1 >> 16) & 0xff; |
| 4419 | int src2 = (p1 >> 0) & 0xff; |
| 4420 | int dst = (p2 >> 16) & 0xff; |
| 4421 | state->kb_regs[dst] = state->kb_regs[src2] - state->kb_regs[src1]; |
| 4422 | } |
| 4423 | if ((p2 & 0xffff) == 0x1) //Add Imm? |
| 4424 | { |
| 4425 | int reg = (p2 >> 16) & 0xff; |
| 4426 | int imm = (p1 >> 0) & 0xffff; |
| 4427 | state->kb_regs[reg] += imm; |
| 4428 | } |
| 4429 | if ((p2 & 0xffff) == 0xa) //Get value |
| 4430 | { |
| 4431 | int reg = (p1 >> 16) & 0xFF; |
| 4432 | state->sharedprotram[0x29c/2] = (state->kb_regs[reg] >> 16) & 0xffff; |
| 4433 | state->sharedprotram[0x29e/2] = state->kb_regs[reg] & 0xffff; |
| 4434 | } |
| 4435 | } |
| 4436 | if(cmd == 0x4f) //memcpy with encryption / scrambling |
| 4437 | { |
| 4438 | UINT16 src = state->sharedprotram[0x290 / 2] >> 1; // ? |
| 4439 | UINT32 dst = state->sharedprotram[0x292 / 2]; |
| 4440 | UINT16 size = state->sharedprotram[0x294 / 2]; |
| 4441 | UINT16 mode = state->sharedprotram[0x296 / 2]; |
| 4442 | |
| 4443 | IGS022_do_dma(machine, src,dst,size,mode); |
| 4444 | } |
| 4445 | |
| 4446 | } |
| 4447 | |
| 4448 | |
| 4449 | static WRITE16_HANDLER( killbld_igs025_prot_w ) |
| 4450 | { |
| 4451 | // mame_printf_debug("killbrd prot r\n"); |
| 4452 | // return 0; |
| 4453 | pgm_state *state = (pgm_state *)space->machine->driver_data; |
| 4454 | offset &= 0xf; |
| 4455 | |
| 4456 | if (offset == 0) |
| 4457 | state->kb_cmd = data; |
| 4458 | else //offset==2 |
| 4459 | { |
| 4460 | logerror("%06X: ASIC25 W CMD %X VAL %X\n", cpu_get_pc(space->cpu), state->kb_cmd, data); |
| 4461 | if (state->kb_cmd == 0) |
| 4462 | state->kb_reg = data; |
| 4463 | else if (state->kb_cmd == 2) |
| 4464 | { |
| 4465 | if (data == 1) //Execute cmd |
| 4466 | { |
| 4467 | IGS022_handle_command(space->machine); |
| 4261 | 4468 | state->kb_reg++; |
| 4262 | 4469 | } |
| 4263 | 4470 | } |
| r7972 | r7973 | |
| 4268 | 4475 | } |
| 4269 | 4476 | } |
| 4270 | 4477 | |
| 4271 | | static READ16_HANDLER( killbld_prot_r ) |
| 4478 | static READ16_HANDLER( killbld_igs025_prot_r ) |
| 4272 | 4479 | { |
| 4273 | 4480 | // mame_printf_debug("killbld prot w\n"); |
| 4274 | 4481 | pgm_state *state = (pgm_state *)space->machine->driver_data; |
| r7972 | r7973 | |
| 4289 | 4496 | res = (protvalue >> (8 * (state->kb_ptr - 1))) & 0xff; |
| 4290 | 4497 | } |
| 4291 | 4498 | } |
| 4292 | | logerror("%06X: ASIC25 R CMD %X VAL %X", cpu_get_pc(space->cpu), state->kb_cmd, res); |
| 4499 | logerror("%06X: ASIC25 R CMD %X VAL %X\n", cpu_get_pc(space->cpu), state->kb_cmd, res); |
| 4293 | 4500 | return res; |
| 4294 | 4501 | } |
| 4295 | 4502 | |
| 4503 | |
| 4504 | |
| 4296 | 4505 | static MACHINE_RESET( killbld ) |
| 4297 | 4506 | { |
| 4298 | | pgm_state *state = (pgm_state *)machine->driver_data; |
| 4299 | | int i; |
| 4300 | | |
| 4301 | 4507 | MACHINE_RESET_CALL(pgm); |
| 4302 | | |
| 4303 | | /* fill the protection ram with a5 */ |
| 4304 | | for (i = 0; i < 0x4000/2; i++) |
| 4305 | | state->sharedprotram[i] = 0xa5a5; |
| 4508 | /* fill the protection ram with a5 + auto dma */ |
| 4509 | IGS022_reset(machine); |
| 4306 | 4510 | } |
| 4307 | 4511 | |
| 4308 | 4512 | |
| 4513 | |
| 4514 | |
| 4515 | /* ASIC025/ASIC022 don't provide rom patches like the DW2 protection does, the previous dump was bad :-) */ |
| 4309 | 4516 | static DRIVER_INIT( killbld ) |
| 4310 | 4517 | { |
| 4311 | 4518 | pgm_state *state = (pgm_state *)machine->driver_data; |
| 4312 | | UINT16 *mem16 = (UINT16 *)memory_region(machine, "maincpu"); |
| 4313 | 4519 | |
| 4314 | 4520 | pgm_basic_init(machine); |
| 4315 | 4521 | pgm_killbld_decrypt(machine); |
| 4316 | 4522 | |
| 4317 | | /* this isn't a hack.. doing a rom dump while the game is running shows the |
| 4318 | | rom space to look like this.. there may be more overlays / enables tho */ |
| 4523 | memory_install_readwrite16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xd40000, 0xd40003, 0, 0, killbld_igs025_prot_r, killbld_igs025_prot_w); |
| 4319 | 4524 | |
| 4320 | | /* the game actually performs a CRC check of the rom during the 'Please Wait' |
| 4321 | | screen, the checksum expected is that of the patched rom. if the checksum |
| 4322 | | fails the please wait screen doesn't last as long and the region supplied |
| 4323 | | by the protection device is ignored and the attract sequence appears out |
| 4324 | | of order */ |
| 4325 | | mem16[0x108a2c / 2] = 0xb6aa; |
| 4326 | | mem16[0x108a30 / 2] = 0x6610; |
| 4327 | | mem16[0x108a32 / 2] = 0x13c2; |
| 4328 | | mem16[0x108a34 / 2] = 0x0080; |
| 4329 | | mem16[0x108a36 / 2] = 0x9c76; |
| 4330 | | mem16[0x108a38 / 2] = 0x23c3; |
| 4331 | | mem16[0x108a3a / 2] = 0x0080; |
| 4332 | | mem16[0x108a3c / 2] = 0x9c78; |
| 4333 | | mem16[0x108a3e / 2] = 0x1002; |
| 4334 | | mem16[0x108a40 / 2] = 0x6054; |
| 4335 | | mem16[0x108a42 / 2] = 0x5202; |
| 4336 | | mem16[0x108a44 / 2] = 0x0c02; |
| 4337 | | |
| 4338 | | memory_install_readwrite16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xd40000, 0xd40003, 0, 0, killbld_prot_r, killbld_prot_w); |
| 4339 | | |
| 4340 | 4525 | state->kb_cmd = 0; |
| 4341 | 4526 | state->kb_reg = 0; |
| 4342 | 4527 | state->kb_ptr = 0; |
| r7972 | r7973 | |
| 4348 | 4533 | state_save_register_global_array(machine, state->kb_regs); |
| 4349 | 4534 | } |
| 4350 | 4535 | |
| 4536 | static MACHINE_RESET( dw3 ) |
| 4537 | { |
| 4538 | pgm_state *state = (pgm_state *)machine->driver_data; |
| 4539 | |
| 4540 | |
| 4541 | MACHINE_RESET_CALL(pgm); |
| 4542 | /* fill the protection ram with a5 + auto dma */ |
| 4543 | IGS022_reset(machine); |
| 4544 | |
| 4545 | /* game won't boot unless various values are in protection RAM |
| 4546 | - these should almost certainly end up there as the result of executing the protection |
| 4547 | commands are startup, but which, and how? */ |
| 4548 | |
| 4549 | // state->sharedprotram[0x200/2] = 0x006d; |
| 4550 | state->sharedprotram[0x202/2] = 0x007c; // it cares about this, operation status flag? |
| 4551 | |
| 4552 | // state->sharedprotram[0x20c/2] = 0x0000; |
| 4553 | // state->sharedprotram[0x20e/2] = 0x0007; |
| 4554 | // state->sharedprotram[0x210/2] = 0x0000; |
| 4555 | // state->sharedprotram[0x212/2] = 0x0004; |
| 4556 | // state->sharedprotram[0x214/2] = 0x0000; |
| 4557 | // state->sharedprotram[0x216/2] = 0x0007; |
| 4558 | // state->sharedprotram[0x218/2] = 0x0000; |
| 4559 | // state->sharedprotram[0x21a/2] = 0x0004; |
| 4560 | |
| 4561 | // state->sharedprotram[0x288/2] = 0x0000; |
| 4562 | // state->sharedprotram[0x28a/2] = 0x00c2; |
| 4563 | // state->sharedprotram[0x28c/2] = 0x0000; |
| 4564 | // state->sharedprotram[0x28e/2] = 0x00c2; |
| 4565 | // state->sharedprotram[0x290/2] = 0x0500; |
| 4566 | // state->sharedprotram[0x292/2] = 0x1000; |
| 4567 | // state->sharedprotram[0x294/2] = 0x00c3; |
| 4568 | // state->sharedprotram[0x296/2] = 0x7104; |
| 4569 | // state->sharedprotram[0x298/2] = 0x0000; |
| 4570 | // state->sharedprotram[0x29a/2] = 0x0003; |
| 4571 | // state->sharedprotram[0x29c/2] = 0x0108; |
| 4572 | // state->sharedprotram[0x29e/2] = 0x0009; |
| 4573 | |
| 4574 | // state->sharedprotram[0x2a2/2] = 0x84f6; // it cares about this, it's the version number of the data rom, copied automatically! |
| 4575 | |
| 4576 | // state->sharedprotram[0x2ac/2] = 0x006d; |
| 4577 | // state->sharedprotram[0x2ae/2] = 0x0000; |
| 4578 | |
| 4579 | // state->sharedprotram[0x2b0/2] = 0xaf56; |
| 4580 | |
| 4581 | |
| 4582 | } |
| 4583 | |
| 4584 | |
| 4585 | |
| 4586 | static int reg; |
| 4587 | static int ptr=0; |
| 4588 | |
| 4589 | #define DW3BITSWAP(s,d,bs,bd) d=((d&(~(1<<bd)))|(((s>>bs)&1)<<bd)) |
| 4590 | static UINT8 dw3_swap; |
| 4591 | static WRITE16_HANDLER( drgw3_igs025_prot_w ) |
| 4592 | { |
| 4593 | pgm_state *state = (pgm_state *)space->machine->driver_data; |
| 4594 | |
| 4595 | offset&=0xf; |
| 4596 | |
| 4597 | if(offset==0) |
| 4598 | state->kb_cmd=data; |
| 4599 | else //offset==2 |
| 4600 | { |
| 4601 | printf("%06X: ASIC25 W CMD %X VAL %X\n",cpu_get_pc(space->cpu),state->kb_cmd,data); |
| 4602 | if(state->kb_cmd==0) |
| 4603 | reg=data; |
| 4604 | else if(state->kb_cmd==3) //?????????? |
| 4605 | { |
| 4606 | dw3_swap = data; |
| 4607 | |
| 4608 | printf("SWAP %02x\n",dw3_swap); |
| 4609 | } |
| 4610 | //else if(kb_cmd==4) |
| 4611 | // ptr=data; |
| 4612 | else if(state->kb_cmd==0x20) |
| 4613 | ptr++; |
| 4614 | } |
| 4615 | } |
| 4616 | |
| 4617 | static READ16_HANDLER( drgw3_igs025_prot_r ) |
| 4618 | { |
| 4619 | // mame_printf_debug("killbld prot w\n"); |
| 4620 | pgm_state *state = (pgm_state *)space->machine->driver_data; |
| 4621 | |
| 4622 | UINT16 res ; |
| 4623 | |
| 4624 | offset&=0xf; |
| 4625 | res=0; |
| 4626 | |
| 4627 | if(offset==1) |
| 4628 | { |
| 4629 | if(state->kb_cmd==0) //swap |
| 4630 | { |
| 4631 | UINT8 v1=(dw3_swap+1)&0x7F; |
| 4632 | UINT8 v2=0; |
| 4633 | DW3BITSWAP(v1,v2,7,0); |
| 4634 | DW3BITSWAP(v1,v2,6,1); |
| 4635 | DW3BITSWAP(v1,v2,5,2); |
| 4636 | DW3BITSWAP(v1,v2,4,3); |
| 4637 | DW3BITSWAP(v1,v2,3,4); |
| 4638 | DW3BITSWAP(v1,v2,2,5); |
| 4639 | DW3BITSWAP(v1,v2,1,6); |
| 4640 | DW3BITSWAP(v1,v2,0,7); |
| 4641 | |
| 4642 | res=v2; |
| 4643 | |
| 4644 | } |
| 4645 | else if(state->kb_cmd==1) |
| 4646 | { |
| 4647 | res=reg&0x7f; |
| 4648 | } |
| 4649 | else if(state->kb_cmd==5) |
| 4650 | { |
| 4651 | UINT32 protvalue; |
| 4652 | protvalue = 0x60000|input_port_read(space->machine, "Region"); |
| 4653 | res=(protvalue>>(8*(ptr-1)))&0xff; |
| 4654 | |
| 4655 | |
| 4656 | } |
| 4657 | } |
| 4658 | logerror("%06X: ASIC25 R CMD %X VAL %X\n",cpu_get_pc(space->cpu),state->kb_cmd,res); |
| 4659 | return res; |
| 4660 | } |
| 4661 | |
| 4662 | |
| 4663 | static DRIVER_INIT( drgw3 ) |
| 4664 | { |
| 4665 | pgm_basic_init(machine); |
| 4666 | |
| 4667 | /* |
| 4668 | pgm_state *state = (pgm_state *)machine->driver_data; |
| 4669 | |
| 4670 | { |
| 4671 | int x; |
| 4672 | UINT16 *RAMDUMP = (UINT16*)memory_region(machine, "user2"); |
| 4673 | for (x=0;x<(0x4000/2);x++) |
| 4674 | { |
| 4675 | state->sharedprotram[x] = RAMDUMP[x]; |
| 4676 | if((x>=0x100)&&(x<0x110)) printf("data 0x%4x, offset:%x\n",state->sharedprotram[x],x); |
| 4677 | } |
| 4678 | } |
| 4679 | */ |
| 4680 | memory_install_readwrite16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xDA5610, 0xDA5613, 0, 0, drgw3_igs025_prot_r, drgw3_igs025_prot_w); |
| 4681 | |
| 4682 | pgm_dw3_decrypt(machine); |
| 4683 | } |
| 4684 | |
| 4351 | 4685 | static DRIVER_INIT( puzzli2 ) |
| 4352 | 4686 | { |
| 4353 | 4687 | /* this protection emulation is wrong |
| r7972 | r7973 | |
| 4631 | 4965 | Partially Working, playable, but some imperfections |
| 4632 | 4966 | -----------------------------------------------------------------------------------------------------------------------*/ |
| 4633 | 4967 | |
| 4634 | | GAME( 1998, killbld, pgm, killbld, killbld, killbld, ROT0, "IGS", "The Killing Blade (ver. 109, Chinese Board)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) // it's playable, but there are some things unclear about the protection |
| 4635 | | GAME( 1998, killbld104, killbld, killbld, killbld, killbld, ROT0, "IGS", "The Killing Blade (ver. 104)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) // this set doesn't work, needs the DMA device emulating properly rather than using extracted data |
| 4968 | // it's playable, but one of the protection checks is still patched |
| 4969 | GAME( 1998, killbld, pgm, killbld, killbld, killbld, ROT0, "IGS", "The Killing Blade (ver. 109, Chinese Board)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) |
| 4970 | GAME( 1998, killbld104, killbld, killbld, killbld, killbld, ROT0, "IGS", "The Killing Blade (ver. 104)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) |
| 4636 | 4971 | |
| 4637 | 4972 | GAME( 1998, olds, pgm, olds, olds, olds, ROT0, "IGS", "Oriental Legend Special / Xi You Shi E Zhuan Super (ver. 101, Korean Board)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| 4638 | 4973 | GAME( 1998, olds100, olds, olds, olds, olds, ROT0, "IGS", "Oriental Legend Special / Xi You Shi E Zhuan Super (ver. 100)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| r7972 | r7973 | |
| 4641 | 4976 | /* ----------------------------------------------------------------------------------------------------------------------- |
| 4642 | 4977 | NOT Working (mostly due to needing internal protection roms dumped) |
| 4643 | 4978 | -----------------------------------------------------------------------------------------------------------------------*/ |
| 4644 | | GAME( 1998, drgw3, pgm, pgm, sango, dw3, ROT0, "IGS", "Dragon World 3 (ver. 100)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| 4645 | | GAME( 1998, drgw3k, drgw3, pgm, sango, dw3, ROT0, "IGS", "Dragon World 3 (ver. 106, Korean Board)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| 4646 | 4979 | |
| 4980 | // should have DMA protection, like killbld, as well as the math / bitswap / memory manipulation stuff, but it never attempts to trigger the DMA? - we currently have a RAM dump to allow it to boot, but I think this stuff should be DMA copied into RAM, like killbld |
| 4981 | GAME( 1998, drgw3, pgm, dw3, dw3, drgw3, ROT0, "IGS", "Dragon World 3 (ver. 106, Korean Board)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| 4982 | GAME( 1998, drgw3105, drgw3, dw3, dw3, drgw3, ROT0, "IGS", "Dragon World 3 (ver. 105)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| 4983 | GAME( 1998, drgw3100, drgw3, dw3, dw3, drgw3, ROT0, "IGS", "Dragon World 3 (ver. 100)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) // Japan Only? |
| 4984 | |
| 4647 | 4985 | GAME( 1999, kov, pgm, kov, sango, kov, ROT0, "IGS", "Knights of Valour / Sangoku Senki (ver. 117)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) /* need internal rom of IGS027A */ // V0008 04/27/99 10:33:33 |
| 4648 | 4986 | GAME( 1999, kov115, kov, kov, sango, kov, ROT0, "IGS", "Knights of Valour / Sangoku Senki (ver. 115)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) /* need internal rom of IGS027A */ // V0006 02/22/99 11:53:18 |
| 4649 | 4987 | GAME( 1999, kov100, kov, kov, sango, kov, ROT0, "IGS", "Knights of Valour / Sangoku Senki (ver. 100, Japanese Board)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) /* need internal rom of IGS027A */ // V0002 01/31/99 01:54:16 |
| r7972 | r7973 | |
| 4664 | 5002 | GAME( 2002, dmnfrnt, pgm, svg, sango, dmnfrnt, ROT0, "IGS", "Demon Front (ver. 102)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) /* need internal rom of IGS027A */ |
| 4665 | 5003 | GAME( 2002, dmnfrnta, dmnfrnt, svg, sango, dmnfrnt, ROT0, "IGS", "Demon Front (ver. 105)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) /* need internal rom of IGS027A */ |
| 4666 | 5004 | |
| 5005 | /* Games below this point are known to have an 'execute only' internal ROM area covering an area at the start of the internal ROM. This can't be read when running code from either internal or external ROM space. */ |
| 5006 | |
| 4667 | 5007 | GAME( 2003, theglad, pgm, svg, sango, theglad, ROT0, "IGS", "The Gladiator (ver. 100)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) /* need internal rom of IGS027A */ |
| 4668 | 5008 | GAME( 2003, theglada, theglad, svg, sango, theglad, ROT0, "IGS", "The Gladiator (ver. 101)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) /* need internal rom of IGS027A */ |
| 4669 | 5009 | |
src/mame/drivers/naomi.c
| r7972 | r7973 | |
| 17 | 17 | |
| 18 | 18 | Sega Naomi is Dreamcast based Arcade hardware. |
| 19 | 19 | |
| 20 | | Current Compatibility notes (GD-rom games only) |
| 21 | | |----------|-------|-----|------|------|------|--------------------------------|-----------------------------------------------------| |
| 22 | | |romname | Pl(s) | Rot | Test | Boot | Game | Control Type | Notes | |
| 23 | | |----------|-------|-----|------|------|------|--------------------------------|-----------------------------------------------------| |
| 24 | | |gundmgd | 1 | H | Yes | Yes | Yes | joystick with 4 buttons | | |
| 25 | | |sfz3ugd | 2 | H | Yes | Yes | No | joystick with 6 buttons | Hangs after pressing start | |
| 26 | | |cvsgd | 2 | H | Yes | Yes | Yes | joystick with 4 buttons | 2 + 2 extra buttons | |
| 27 | | |gundmxgd | 1 | H | Yes | Yes | Yes | joystick with 4 buttons | | |
| 28 | | |cvs2gd | 2 | H | Yes | Yes | Yes | joystick with 6 buttons | | |
| 29 | | |ikaruga | 2 | V | Yes | Yes | Yes | joystick with 2 buttons | | |
| 30 | | |ggxx | 2 | H | Yes | Yes | Yes | joystick with 5 buttons | | |
| 31 | | |moeru | 2 | H | No | No | No | joystick with 3 buttons | Broken i/o, stuck at the "now loading" msg | |
| 32 | | |chocomk | 2 | H | Yes | Yes | Yes | joystick with 2 buttons | | |
| 33 | | |quizqgd | 2 | V | Yes | Yes | Yes | joystick with 4 buttons | Can play without joystick | |
| 34 | | |ggxxrl | 2 | H | Yes | Yes | Yes | joystick with 5 buttons | | |
| 35 | | |tetkiwam | 2 | H | No | No | No | joystick with 3 buttons | Black screen, tests the SCIF (UART) regs? | |
| 36 | | |shikgam2 | 2 | V | Yes | Yes | No | joystick with 3 buttons | Broken i/o, crashes on the proper gameplay | |
| 37 | | |usagui | 1 | H | Yes | Yes | No | mahjong panel | | |
| 38 | | |bdrdown | 2 | H | Yes | Yes | Yes | joystick with 3 buttons | | |
| 39 | | |psyvar2 | 1 | V | Yes | Yes | No | joystick with 2 buttons | Broken i/o? Hangs after pressing start | |
| 40 | | |cfield | 1 | H | Yes | Yes | Yes | joystick with 3 buttons | | |
| 41 | | |trizeal | 2 | V | No | No | No | joystick with 3 buttons | | |
| 42 | | |meltybld | 2 | H | Yes | Yes | Yes | joystick with 4 buttons | Crashes in attract mode | |
| 43 | | |senko | 2 | H | Yes | Yes | No | joystick with 3 buttons | Senko no Londe SP (undumped) uses 5 buttons | |
| 44 | | |senkoo | 2 | H | Yes | Yes | No | joystick with 3 buttons | | |
| 45 | | |ss2005 | 1 | H | Yes | Yes | No | joystick with 3 buttons | Calls a YUV FMV, crashes due of that | |
| 46 | | |radirgy | 1 | V | Yes | Yes | Yes | joystick with 3 buttons | | |
| 47 | | |ggxxsla | 2 | H | Yes | Yes | Yes | joystick with 5 buttons | | |
| 48 | | |kurucham | 2 | H | Yes | Yes | No | joystick with 3 buttons | Broken i/o, crashes in attract with wrong mask | |
| 49 | | |undefeat | 2 | V | No | No | No | joystick with 2 buttons | Stuck at the "now loading" msg | |
| 50 | | |trgheart | 1 | V | Yes | Yes | No | joystick with 3 buttons | Broken i/o | |
| 51 | | |jingystm | 2 | H | Yes | Yes | No | joystick with 3 buttons | Broken i/o | |
| 52 | | |meltyb | 2 | H | Yes | Yes | Yes | joystick with 5 buttons | Crashes in attract mode | |
| 53 | | |meltyba | 2 | H | Yes | Yes | Yes | joystick with 5 buttons | Crashes in attract mode | |
| 54 | | |karous | 1 | V | Yes | Yes | No | joystick with 3 buttons | Broken i/o | |
| 55 | | |takoron | 2 | H | Yes | Yes | Yes | joystick with 3 buttons | | |
| 56 | | -------------------------------------------------------------------------------------------------------------------------------------- |
| 57 | | |confmiss | 2 | H | Yes | Yes | No | lightgun | | |
| 58 | | |sprtjam | 2 | H | Yes | Yes | Yes | joystick with 2 buttons | | |
| 59 | | |slashout | 1 | H | Yes | Yes | Yes | joystick with 4 buttons | | |
| 60 | | |spkrbtl | 2 | H | Yes | Yes | No | joystick with 4 buttons | Crashes when loading the gameplay | |
| 61 | | |monkeyba | 1 | H | Yes | Yes | No | ad stick | Crashes when loading the gameplay | |
| 62 | | |dygolf | 2 | H | No | No | No | trackball + 4 buttons | Moans about the jvs settings | |
| 63 | | |wsbbgd | 2 | H | No | No | No | ad stick + 2 buttons | Moans about the jvs settings | |
| 64 | | |vtennisg | 2 | H | Yes | Yes | No | joystick with 2 buttons | Broken gfxs, crashes after a while | |
| 65 | | |vathlete | 2 | H | Yes | Yes | No | joystick with 3 buttons | Broken i/o | |
| 66 | | |vtennis2 | 2 | H | No | No | No | joystick with 3 buttons | | |
| 67 | | |keyboard | 2 | H | Yes | Yes | No | keyboard | Broken i/o, crashes after a while | |
| 68 | | |lupinsho | 2 | H | Yes | Yes | No | lightgun | Broken i/o, crashes after a while | |
| 69 | | |luptype | 2 | H | Yes | Yes | No | keyboard | Broken i/o, ARM cpu crashes when inserting a coin | |
| 70 | | |mok | 2 | H | Yes | Yes | No | lightgun | Broken i/o | |
| 71 | | |ngdup23a | 2 | H | Yes | Yes | Yes | n/a | Missing DIMM emulation | |
| 72 | | |ngdup23c | 2 | H | Yes | Yes | Yes | n/a | Missing DIMM emulation | |
| 73 | | |puyofev | 2 | H | Yes | Yes | No | joystick with 2 buttons | Broken i/o? Hangs after pressing start | |
| 74 | | -------------------------------------------------------------------------------------------------------------------------------------- |
| 20 | ToDo: |
| 21 | - many games needs proper per-game JVS settings, at least to let them boot: |
| 22 | - lightgun games (confmiss, lupinsho, mok); |
| 23 | - dygolf (trackball + 4 buttons / not actually needed to let it boot, just press start to bypass the moan msg); |
| 24 | - wsbbgd (ad stick + 2 buttons); |
| 25 | - monkeyba (ad stick, not actually needed to let it boot, but crashes at the proper gameplay, so it might); |
| 26 | - otrigger ? |
| 27 | - smarinef ? |
| 28 | - crackndj ? |
| 29 | - shootpl / shootopl ? |
| 30 | - kick4csh ? |
| 75 | 31 | |
| 76 | | Test: If it enters into test mode (not actually working test mode, i.e. if inputs doesn't work) |
| 77 | | Boot: If game boots and draws some gfxs |
| 78 | | Game: If game can be coined up and can actually be played without problems. |
| 79 | | If the three aforementioned are all yes and there aren't any notes, game is fully working. |
| 32 | - tetkiwam, keyboard, vtennis2, vtennisg, monkeyba: they all crashes at some point, might be due of a bad FPU opcode; |
| 80 | 33 | |
| 34 | - meltybld, meltyb, meltyba: crashes in attract mode; |
| 81 | 35 | |
| 36 | - all games that uses YUV just updates one frame then dies, why? |
| 37 | |
| 38 | - all or almost all games seems to have issues with the sound loops, for example sfz3ugd keeps to say "This-This-This ..." at start-up |
| 39 | instead of completing the phrase; |
| 40 | |
| 41 | - luptype: ARM crashes when you insert a coin; |
| 42 | |
| 43 | - suchie3: used to boot (at least go over the I/O test), it doesn't now, might be protection related. |
| 44 | |
| 45 | - ngdup23a, ngdup23c: missing DIMM emulation, hence they can't possibly work, emulate the DIMM means to add an extra SH-4 ... |
| 46 | |
| 47 | - totd: emulation exits at some point during attract mode without any output. |
| 48 | |
| 49 | - spkrbtl: ARM CPU crashes sometimes? Also, it crashes when entering into the gameplay. |
| 50 | |
| 82 | 51 | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| 83 | 52 | |
| 84 | 53 | Guru's Readme |
| r7972 | r7973 | |
| 199 | 168 | |
| 200 | 169 | |
| 201 | 170 | |
| 202 | | Sega NAOMI ROM cart usage |
| 171 | NAOMI ROM cart usage |
| 203 | 172 | ------------------------- |
| 173 | There are 3 know types of carts manufactured by Sega: 171-7919A, 171-7978B, 171-8132B |
| 174 | There are also 2 types of carts manufactured by Namco: MASK-B, MASK-C |
| 204 | 175 | |
| 205 | 176 | 837-13668 171-7919A (C) Sega 1998 |
| 206 | | |----------------------------------------------------------| |
| 207 | | |IC1 IC2 IC3 IC4 IC5 IC6 CN2 | |
| 208 | | |ROM1 ROM2 ROM3 ROM4 ROM5 ROM6 JP1| |
| 209 | | | IC42 | |
| 210 | | | 71256 | |
| 211 | | | 71256 IC22 | |
| 212 | | | IC7 IC8 IC9 IC10 IC11 | |
| 177 | |---------------------------------------------------------| |
| 178 | | ----CN2---- -| |
| 179 | |IC1 IC2 IC3 IC4 IC5 IC6 JP1| |
| 180 | |ROM1 ROM2 ROM3 ROM4 ROM5 ROM6 IC42 | |
| 181 | | IC45 | |
| 182 | | IC44 IC22 | |
| 183 | | IC7 IC8 IC9 IC10 IC11 | male side |
| 213 | 184 | | ROM7 ROM8 ROM9 ROM10 ROM11 IC41 | |
| 214 | 185 | | | |
| 215 | 186 | | 28MHz | |
| 216 | 187 | | | |
| 217 | | | CN3 X76F100 CN1 | |
| 188 | | ----CN3---- IC37 ----CN1---- | |
| 218 | 189 | |----------------------------------------------------------| |
| 219 | 190 | Notes: |
| 220 | | Not all MASKROM positions are populated. |
| 221 | | All MASKROMs (IC1 to IC21) are SOP44, either 32M or 64M |
| 222 | 191 | The other side of the cart PCB just has more locations for |
| 223 | | SOP44 MASKROMs... IC12 to IC21 (ROM12 to ROM21) |
| 192 | SOP44 MASKROMs... IC12S to IC21S (ROM12 to ROM21) |
| 224 | 193 | |
| 225 | | IC22 - DIP42 EPROM, either 27C160 or 27C322 |
| 226 | | JP1 - Sets the size of the EPROM. 1-2 = 32M, 2-3 = 16M |
| 227 | | IC41 - Xilinx XC9536 (PLCC44) |
| 228 | | IC42 - SEGA 315-5881 (QFP100). Probably some kind of FPGA or CPLD. Usually different per game. |
| 229 | | On the end of the number, -JPN means it requires Japanese BIOS, -COM will run with any BIOS |
| 230 | | X76F100 - Xicor X76F100 secured EEPROM (SOIC8) |
| 231 | | 71256 - IDT 71256 32kx8 SRAM (SOJ28) |
| 232 | | CN1/2/3 - connectors joining to main board |
| 194 | IC1-IC21S - MaskROM (SOP44), either 32M or 64M. Not all positions are populated. |
| 195 | IC22 - EPROM (DIP42), either 27C160 or 27C322 |
| 196 | JP1 - JUMPER Sets the size of the EPROM. 1-2 = 32M, 2-3 = 16M |
| 197 | IC37 - FLASHROM (SOIC8) Xicor X76F100 Secure SerialFlash |
| 198 | IC41 - Sega 315-6213 Xilinx XC9536 (PLCC44) |
| 199 | IC42 - SEGA 315-5581 (QFP100). Probably some kind of FPGA or CPLD. Usually different per game. |
| 200 | On the end of the number, -JPN means it requires Japanese BIOS, -COM will run with any BIOS |
| 201 | IC44-IC45 - SRAM (SOJ28) 32kx8, either IDT71256 or CY7C199 |
| 202 | CN1/2/3 - connectors joining to main board |
| 233 | 203 | |
| 204 | Games known to use this PCB include.... |
| 205 | Sticker EPROM # of SOP44 |
| 206 | Game on cart IC22# MASKROMs IC41# IC42# Notes |
| 207 | -------------------------------------------------------------------------------------------------------------------------- |
| 208 | 18 Wheeler Deluxe (Rev A) 840-0023C 22285A 20 (64Mb) 315-6213 317-0273-COM |
| 209 | Airline Pilots 840-0005C 21739 11 (64Mb) 315-6213 317-0251-COM |
| 210 | Airline Pilots (Rev A) 840-0005C 21739A 11 (64Mb) 315-6213 317-0251-COM |
| 211 | Cosmic Smash 840-0044C 23428 8 (64Mb) 315-6213 317-0289-COM joystick + 2 buttons |
| 212 | Cosmic Smash (Rev A) 840-0044C 23428A 8 (64Mb) 315-6213 317-0289-COM joystick + 2 buttons |
| 213 | Crazy Taxi 840-0002C 21684 13 (64Mb) 315-6213 317-0248-COM |
| 214 | Dead Or Alive 2 841-0003C 22121 21 (64Mb) 315-6213 317-5048-COM joystick + 3 buttons |
| 215 | Dead Or Alive 2 Millenium 841-0003C DOA2 Ver.M 21 (64Mb) 315-6213 317-5048-COM joystick + 3 buttons |
| 216 | Death Crimson OX 841-0016C 23524 10 (64Mb) 315-6213 317-5066-COM |
| 217 | Dengen Tenshi Taisen Janshi Shangri-La 841-0004C 22060 12 (64Mb) 315-6213 317-5050-JPN |
| 218 | Derby Owners Club 840-0016C 22099B 14 (64Mb) 315-6213 317-0262-JPN touch panel + 2 buttons + card reader |
| 219 | Dynamite Baseball '99 / World Series'99 840-0019C 22141B 19 (64Mb) 315-6213 317-0269-JPN requires special panel (joystick + 2 buttons + bat controller for each player) |
| 220 | Dynamite Baseball Naomi 840-0001C 21575 21 (64Mb) 315-6213 317-0246-JPN requires special panel (joystick + 2 buttons + bat controller for each player) |
| 221 | Ferrari F355 Challenge 834-13842 21902 21 (64Mb) 315-6213 317-0254-COM |
| 222 | Ferrari F355 Challenge 2 Twin 840-0042C 23399 21 (64Mb) 315-6213 317-0287-COM 2 know BIOS 22850 (USA), 22851 (EXP) |
| 223 | Ferrari F355 Challenge Twin 834-13950 22848 21 (64Mb) 315-6213 317-0267-COM 2 know BIOS 22850 (USA), 22851 (EXP) |
| 224 | Giant Gram Pro Wrestle 2 840-0007C 21820 9 (64Mb) 315-6213 317-0253-JPN joystick + 3 buttons |
| 225 | Guilty Gear X 841-0013C 23356 14 (64Mb) 315-6213 317-5063-COM |
| 226 | Gun Spike / Cannon Spike 841-0012C 23210 12 (64Mb) 315-6213 317-5060-COM |
| 227 | Heavy Metal Geo Matrix HMG016007 23716A 11 (64Mb) 315-6213 317-5071-COM joystick + 2 buttons |
| 228 | Idol Janshi Suchie-Pai 3 841-0002C 21979 14 (64Mb) 315-6213 317-5047-JPN requires special I/O board and mahjong panel |
| 229 | Jumbo! Safari (Rev A) 840-0013C 22826A 8 (64Mb) 315-6213 317-0264-COM |
| 230 | OutTrigger 840-0017C 22163 19 (64Mb) 315-6213 317-0266-COM requires analog controllers/special panel |
| 231 | Power Stone 841-0001C 21597 8 (64Mb) 315-6213 317-5046-COM joystick + 3 buttons |
| 232 | Power Stone 2 841-0008C 23127 9 (64Mb) 315-6213 317-5054-COM joystick + 3 buttons |
| 233 | Samba de Amigo 840-0020C 22966B 16 (64Mb) 315-6213 317-0270-COM will boot but requires special controller to play it |
| 234 | Sega Marine Fishing 840-0027C 22221 10 (64Mb) 315-6213 not populated ROM 3&4 not populated. Requires special I/O board and fishing controller |
| 235 | Sega Strike Fighter (Rev A) 840-0035C 23323A 20 (64Mb) 315-6213 317-0281-COM |
| 236 | Slashout 840-0041C 23341 17 (64Mb) 315-6213 317-0286-COM joystick + 4 buttons |
| 237 | Spawn 841-0005C 22977B 10 (64Mb) 315-6213 317-5051-COM joystick + 4 buttons |
| 238 | The Typing of the Dead 840-0026C 23021A 20 (64Mb) 315-6213 not populated |
| 239 | Toy Fighter / Waffupu 840-0011C 22035 10 (64Mb) 315-6212 317-0257-COM joystick + 3 buttons |
| 240 | Virtua NBA 840-0021C 23073 21 (64Mb) 315-6213 not populated |
| 241 | Virtua Striker 2 2000 840-0010C 21929C 14 (64Mb) 315-6213 317-0258-COM joystick + 3 buttons (+1x 32Mb) |
| 242 | Virtua Tennis / Power Smash 840-0015C 22927 11 (64Mb) 315-6213 317-0263-COM |
| 243 | Zombie Revenge 840-0003C 21707 19 (64Mb) 315-6213 317-0249-COM joystick + 3 buttons |
| 244 | |
| 245 | |
| 246 | |
| 247 | 837-13801 171-7978B (C) Sega 1999 |
| 248 | |---------------------------------------------------------| |
| 249 | | ----CN2---- -| |
| 250 | | JP1 | |
| 251 | |IC18 IC20 IC22 IC24 IC26 IC28 OSC1 | |
| 252 | |ROM2 ROM4 ROM6 ROM8 ROM10 ROM12 | |
| 253 | | ---- IC11 | |
| 254 | | |IC1 | | male side |
| 255 | | IC29 IC31 IC33 IC35 IC37 | | | |
| 256 | | ROM13 ROM15 ROM17 ROM19 ROM21 ---- | |
| 257 | | IC14 IC15 | |
| 258 | | | |
| 259 | | ----CN3---- ----CN1---- | |
| 260 | |----------------------------------------------------------| |
| 261 | |
| 262 | |---------------------------------------------------------| |
| 263 | |- ----CN2---- | |
| 264 | | | |
| 265 | | IC27S IC25S IC23S IC21S IC19S IC17S | |
| 266 | | ROM11 ROM9 ROM7 ROM5 ROM3 ROM1 | |
| 267 | | | |
| 268 | | | female side |
| 269 | | IC38S IC36S IC34S IC32S IC30S | |
| 270 | | IC13S ROM22 ROM20 ROM18 ROM16 ROM14 | |
| 271 | | | |
| 272 | | | |
| 273 | | ----CN1---- ----CN3---- | |
| 274 | |----------------------------------------------------------| |
| 275 | Notes: |
| 276 | |
| 277 | OSC1 - oscillator 50.0000MHz |
| 278 | IC1 - FPGA ACTEL A54SX32A (QFP208) SEGA part number 317-xxxx-yyy; -JPN means it requires Japanese BIOS, -COM will run with any BIOS |
| 279 | IC11 - EPROM (DIP42), either 27C160 or 27C322 |
| 280 | JP1 - JUMPER Sets the size of the EPROM. 1-2 = 32M, 2-3 = 16M |
| 281 | IC13S - EEPROM (SOIC8) 25LC040 serial EEPROM |
| 282 | IC14 - 256 x 9 AsyncFIFO, 5.0V (SOP28) |
| 283 | IC15 - SRAM (SOJ28) 32kx8, IDT71256 |
| 284 | IC17S-IC38S - MaskROM (SOP44), either 32M or 64M |
| 285 | CN1/2/3 - connectors joining to main board |
| 286 | |
| 287 | Games known to use this PCB include.... |
| 288 | Sticker EPROM # of SOP44 |
| 289 | Game on cart IC11# MASKROMs IC1# label IC1# Notes |
| 290 | --------------------------------------------------------------------------------------------------------------------- |
| 291 | Giant Gram 2000 840-0039C 23373 20 (64Mb) A54SX32 317-0296-COM |
| 292 | Kick '4' Cash 840-0140C 24212 16 (64Mb) A54SX32A 317-0397-COM |
| 293 | Marvel Vs. Capcom 2 841-0007B 23085A 14 (64Mb) A54SX32 317-5058-COM +2x 32Mb |
| 294 | Quiz Ah Megamisama 840-0030C 23227 16 (64Mb) A54SX32 317-0280-JPN |
| 295 | Shootout Pool 840-0098C 23844 4 (64mb) A54SX32 317-0336-COM |
| 296 | Shootout Pool - Shootout Pool Prize 840-0128C 24065 4 (64mb) A54SX32 317-0367-COM |
| 297 | Virtua Fighter 4 Evolution 840-0106B 23934 20 (64Mb) A54SX32 317-0339-COM |
| 298 | Virtua Tennis 2 / Power Smash 2 840-0084C 22327 18 (64Mb) A54SX32 317-0320-COM |
| 299 | Virtua Tennis 2 / Power Smash 2 (Rev A) 840-0084C 22327A 18 (64Mb) A54SX32 317-0320-COM |
| 300 | |
| 301 | |
| 302 | |
| 303 | 837-14114-01 171-8132B (C) Sega 2000 |
| 304 | |---------------------------------------------------------| |
| 305 | | IC11 IC10 IC9 ----CN2---- -| |
| 306 | | 21/22 19/20 17/18 IC44 IC45 | |
| 307 | | IC27 | |
| 308 | | | |
| 309 | |IC8 IC7 IC6 IC5 JP2 IC22 | |
| 310 | |15/16 13/14 11/12 9/10 | male side |
| 311 | | IC41 OSC1 | |
| 312 | |IC4 IC3 IC2 IC1 IC42 JP1 | |
| 313 | |7/8 5/6 3/4 1/2 | |
| 314 | | | |
| 315 | | ----CN3---- ----CN1---- | |
| 316 | |----------------------------------------------------------| |
| 317 | |
| 318 | Notes: |
| 319 | |
| 320 | OSC1 - oscillator 28.000MHz |
| 321 | IC1-IC11 - MaskROM (TSOP48), 128M |
| 322 | IC22 - EPROM (DIP42), either 27C160 or 27C322 |
| 323 | JP1 - JUMPER Sets the size of the EPROM. 1-2 = 32M, 2-3 = 16M |
| 324 | IC27 - PLD Sega 315-6319A ALTERA EPM7032 (PLCC44) |
| 325 | IC41 - Sega 315-6213 Xilinx XC9536 (PLCC44) |
| 326 | IC42 - SEGA 315-5581 (QFP100). Probably some kind of FPGA or CPLD. Usually different per game. |
| 327 | On the end of the number, -JPN means it requires Japanese BIOS, -COM will run with any BIOS |
| 328 | IC44-IC45 - SRAM (SOJ28) 32kx8, either IDT71256 or CY7C199 |
| 329 | JP2 - JUMPER unknown function |
| 330 | CN1/2/3 - connectors joining to main board |
| 331 | |
| 332 | Games known to use this PCB include.... |
| 333 | Sticker EPROM # of SOP44 |
| 334 | Game on cart IC22# MASKROMs IC27# IC41# IC42# Notes |
| 335 | ----------------------------------------------------------------------------------------------------------------------- |
| 336 | Capcom Vs. SNK Millennium Fight 2000 841-0011C 23511A 7 (128Mb) 315-6219 315-6213 317-5059-COM (000804) |
| 337 | Capcom Vs. SNK Millennium Fight 2000 841-0011C 23511A 7 (128Mb) 315-6319 315-6213 317-5059-COM (000904) |
| 338 | Derby Owners Club 2 840-0083C 22306B 11 (128Mb) 315-6319A 315-6213 not populated |
| 339 | Derby Owners Club World Edition (Rev C) 840-0088C 22336C 7 (128Mb) 315-6319A 315-6213 not populated |
| 340 | Giga Wing 2 841-0014C 22270 5 (128Mb) 315-6319A 315-6213 317-5064-COM |
| 341 | Moero Justice Gakuen / Project Justice 841-0015C 23548A 11 (128Mb) 315-6319A 315-6213 317-5065-COM |
| 342 | Samba de Amigo Ver.2000 840-0047C 23600 ? (128Mb) 315-6319A 315-6213 317-0295-COM |
| 343 | The King of Route 66 (Rev A) 840-0087C 23819A ? (128Mb) ? ? ? |
| 344 | Wild Riders 840-0046C 23622 10 (128Mb) 315-6319A 315-6213 317-0301-COM |
| 345 | WWF Royal Rumble 840-0040C 22261 8 (128Mb) 315-6319 315-6213 317-0285-COM |
| 346 | Zero Gunner 2 841-0020C 23689 ? (128Mb) 315-6319A 315-6213 317-5073-COM |
| 347 | |
| 348 | |
| 349 | |
| 234 | 350 | Note! Generally, games that require a special I/O board or controller will not boot at all with a |
| 235 | 351 | standard NAOMI I/O board. Usually they display a message saying the I/O board is not acceptable |
| 236 | 352 | or not connected properly. |
| 237 | 353 | |
| 238 | 354 | |
| 239 | | Games known to use this PCB include.... |
| 240 | 355 | |
| 241 | | Sticker EPROM # of SOP44 |
| 242 | | Game on cart IC22# MASKROMs IC41# IC42# Notes |
| 243 | | -------------------------------------------------------------------------------------------------------------- |
| 244 | | Cosmic Smash 840-0044C 23428A 8 315-6213 317-0289-COM joystick + 2 buttons |
| 245 | | Dead Or Alive 2 841-0003C 22121 21 315-6213 317-5048-COM joystick + 3 buttons |
| 246 | | Dead Or Alive 2 Millenium 841-0003C DOA2 Ver.M 21 315-6213 317-5048-COM joystick + 3 buttons |
| 247 | | Derby Owners Club 840-0016C 22099B 14 315-6213 317-0262-JPN touch panel + 2 buttons + card reader |
| 248 | | Dynamite Baseball '99 840-0019C 22141B 19 315-6213 317-0269-JPN requires special panel (joystick + 2 buttons + bat controller for each player) |
| 249 | | Dynamite Baseball Naomi 840-0001C 21575 21 315-6213 317-0246-JPN requires special panel (joystick + 2 buttons + bat controller for each player) |
| 250 | | Giant Gram Pro Wrestle 2 840-0007C 21820 9 315-6213 317-0253-JPN joystick + 3 buttons |
| 251 | | Heavy Metal Geo Matrix HMG016007 23716A 11 315-6213 317-5071-COM joystick + 2 buttons |
| 252 | | Idol Janshi Suchie-Pai 3 841-0002C 21979 14 315-6213 317-5047-JPN requires special I/O board and mahjong panel |
| 253 | | Out Trigger 840-0017C 22163 19 315-6213 317-0266-COM requires analog controllers/special panel |
| 254 | | Power Stone 841-0001C 21597 8 315-6213 317-5046-COM joystick + 3 buttons |
| 255 | | Power Stone 2 841-0008C 23127 9 315-6213 317-5054-COM joystick + 3 buttons |
| 256 | | Samba de Amigo 840-0020C 22966B 16 315-6213 317-0270-COM will boot but requires special controller to play it |
| 257 | | Sega Marine Fishing 840-0027C 22221 10 315-6213 not populated ROM 3&4 not populated. Requires special I/O board and fishing controller |
| 258 | | Slash Out 840-0041C 23341 17 315-6213 317-0286-COM joystick + 4 buttons |
| 259 | | Spawn 841-0005C 22977B 10 315-6213 317-5051-COM joystick + 4 buttons |
| 260 | | Toy Fighter 840-0011C 22035 10 315-6212 317-0257-COM joystick + 3 buttons |
| 261 | | Virtua Striker 2 2000 840-0010C 21929C 15 315-6213 317-0258-COM joystick + 3 buttons |
| 262 | | Zombie Revenge 840-0003C 21707 19 315-6213 317-0249-COM joystick + 3 buttons |
| 263 | | |
| 264 | | |
| 265 | 356 | Sega I/O boards |
| 266 | 357 | --------------- |
| 267 | 358 | |
| r7972 | r7973 | |
| 1060 | 1151 | /* MD2 MD1 MD0 MD6 MD4 MD3 MD5 MD7 MD8 */ |
| 1061 | 1152 | static const struct sh4_config sh4cpu_config = { 1, 0, 1, 0, 0, 0, 1, 1, 0, CPU_CLOCK }; |
| 1062 | 1153 | |
| 1063 | | static INTERRUPT_GEN( naomi_vblank ) |
| 1064 | | { |
| 1065 | | dc_vblank(device->machine); |
| 1066 | | } |
| 1067 | | |
| 1068 | 1154 | static READ64_HANDLER( naomi_arm_r ) |
| 1069 | 1155 | { |
| 1070 | 1156 | return *((UINT64 *)dc_sound_ram+offset); |
| r7972 | r7973 | |
| 1234 | 1320 | |
| 1235 | 1321 | 7 0x1C000000 - 0x1FFFFFFF(SH4 Internal area) |
| 1236 | 1322 | |
| 1323 | |
| 1324 | |
| 1237 | 1325 | */ |
| 1238 | 1326 | |
| 1239 | 1327 | /* |
| r7972 | r7973 | |
| 1277 | 1365 | |
| 1278 | 1366 | static ADDRESS_MAP_START( naomi_map, ADDRESS_SPACE_PROGRAM, 64 ) |
| 1279 | 1367 | /* Area 0 */ |
| 1280 | | AM_RANGE(0x00000000, 0x001fffff) AM_ROM AM_SHARE("share3") AM_REGION("maincpu", 0) // BIOS |
| 1281 | | AM_RANGE(0xa0000000, 0xa01fffff) AM_ROM AM_SHARE("share3") // non cachable access to 0x00000000 - 0x001fffff |
| 1368 | AM_RANGE(0x00000000, 0x001fffff) AM_MIRROR(0xa2000000) AM_ROM AM_REGION("maincpu", 0) // BIOS |
| 1282 | 1369 | |
| 1283 | | AM_RANGE(0x00200000, 0x00207fff) AM_RAM // bios uses it (battery backed ram ?) |
| 1284 | | AM_RANGE(0x005f6800, 0x005f69ff) AM_READWRITE( dc_sysctrl_r, dc_sysctrl_w ) |
| 1285 | | AM_RANGE(0x005f6c00, 0x005f6cff) AM_READWRITE( naomi_maple_r, naomi_maple_w ) |
| 1286 | | AM_RANGE(0x005f7000, 0x005f70ff) AM_DEVREADWRITE("rom_board", naomibd_r, naomibd_w) |
| 1287 | | AM_RANGE(0x005f7400, 0x005f74ff) AM_READWRITE( dc_g1_ctrl_r, dc_g1_ctrl_w ) |
| 1288 | | AM_RANGE(0x005f7800, 0x005f78ff) AM_READWRITE( dc_g2_ctrl_r, dc_g2_ctrl_w ) |
| 1289 | | AM_RANGE(0x005f7c00, 0x005f7cff) AM_READWRITE( pvr_ctrl_r, pvr_ctrl_w ) |
| 1290 | | AM_RANGE(0x005f8000, 0x005f9fff) AM_READWRITE( pvr_ta_r, pvr_ta_w ) |
| 1291 | | AM_RANGE(0x00600000, 0x006007ff) AM_READWRITE( dc_modem_r, dc_modem_w ) |
| 1292 | | AM_RANGE(0x00700000, 0x00707fff) AM_DEVREADWRITE( "aica", dc_aica_reg_r, dc_aica_reg_w ) |
| 1293 | | AM_RANGE(0x00710000, 0x0071000f) AM_READWRITE( dc_rtc_r, dc_rtc_w ) |
| 1294 | | AM_RANGE(0x00800000, 0x00ffffff) AM_READWRITE( naomi_arm_r, naomi_arm_w ) // sound RAM (8 MB) |
| 1370 | AM_RANGE(0x00200000, 0x00207fff) AM_MIRROR(0x02000000) AM_RAM // bios uses it (battery backed ram ?) |
| 1371 | AM_RANGE(0x005f6800, 0x005f69ff) AM_MIRROR(0x02000000) AM_READWRITE( dc_sysctrl_r, dc_sysctrl_w ) |
| 1372 | AM_RANGE(0x005f6c00, 0x005f6cff) AM_MIRROR(0x02000000) AM_READWRITE( naomi_maple_r, naomi_maple_w ) |
| 1373 | AM_RANGE(0x005f7000, 0x005f70ff) AM_MIRROR(0x02000000) AM_DEVREADWRITE("rom_board", naomibd_r, naomibd_w) |
| 1374 | AM_RANGE(0x005f7400, 0x005f74ff) AM_MIRROR(0x02000000) AM_READWRITE( dc_g1_ctrl_r, dc_g1_ctrl_w ) |
| 1375 | AM_RANGE(0x005f7800, 0x005f78ff) AM_MIRROR(0x02000000) AM_READWRITE( dc_g2_ctrl_r, dc_g2_ctrl_w ) |
| 1376 | AM_RANGE(0x005f7c00, 0x005f7cff) AM_MIRROR(0x02000000) AM_READWRITE( pvr_ctrl_r, pvr_ctrl_w ) |
| 1377 | AM_RANGE(0x005f8000, 0x005f9fff) AM_MIRROR(0x02000000) AM_READWRITE( pvr_ta_r, pvr_ta_w ) |
| 1378 | AM_RANGE(0x00600000, 0x006007ff) AM_MIRROR(0x02000000) AM_READWRITE( dc_modem_r, dc_modem_w ) |
| 1379 | AM_RANGE(0x00700000, 0x00707fff) AM_MIRROR(0x02000000) AM_DEVREADWRITE( "aica", dc_aica_reg_r, dc_aica_reg_w ) |
| 1380 | AM_RANGE(0x00710000, 0x0071000f) AM_MIRROR(0x02000000) AM_READWRITE( dc_rtc_r, dc_rtc_w ) |
| 1381 | AM_RANGE(0x00800000, 0x00ffffff) AM_MIRROR(0x02000000) AM_READWRITE( naomi_arm_r, naomi_arm_w ) // sound RAM (8 MB) |
| 1295 | 1382 | |
| 1383 | /* External Device */ |
| 1384 | AM_RANGE(0x01010098, 0x0101009f) AM_MIRROR(0x02000000) AM_RAM // Naomi 2 BIOS tests this, needs to read back as written |
| 1385 | AM_RANGE(0x0103ff00, 0x0103ffff) AM_MIRROR(0x02000000) AM_READWRITE( naomi_unknown1_r, naomi_unknown1_w ) // bios uses it, actual start and end addresses not known |
| 1296 | 1386 | |
| 1297 | | AM_RANGE(0x0103ff00, 0x0103ffff) AM_READWRITE( naomi_unknown1_r, naomi_unknown1_w ) // bios uses it, actual start and end addresses not known |
| 1298 | | |
| 1299 | | AM_RANGE(0x03010098, 0x0301009f) AM_RAM // Naomi 2 BIOS tests this, needs to read back as written |
| 1300 | | |
| 1301 | 1387 | /* Area 1 */ |
| 1302 | | AM_RANGE(0x04000000, 0x04ffffff) AM_RAM AM_BASE( &dc_texture_ram ) // texture memory 64 bit access |
| 1303 | | AM_RANGE(0x05000000, 0x05ffffff) AM_RAM AM_BASE( &dc_framebuffer_ram ) // apparently this actually accesses the same memory as the 64-bit texture memory access, but in a different format, keep it apart for now |
| 1388 | AM_RANGE(0x04000000, 0x04ffffff) AM_MIRROR(0x02000000) AM_RAM AM_BASE( &dc_texture_ram ) // texture memory 64 bit access |
| 1389 | AM_RANGE(0x05000000, 0x05ffffff) AM_MIRROR(0x02000000) AM_RAM AM_BASE( &dc_framebuffer_ram ) // apparently this actually accesses the same memory as the 64-bit texture memory access, but in a different format, keep it apart for now |
| 1304 | 1390 | |
| 1305 | 1391 | /* Area 2*/ |
| 1306 | | AM_RANGE(0x08000000, 0x0bffffff) AM_NOP // 'Unassigned' |
| 1392 | AM_RANGE(0x08000000, 0x09ffffff) AM_MIRROR(0x02000000) AM_NOP // 'Unassigned' |
| 1307 | 1393 | |
| 1308 | 1394 | /* Area 3 */ |
| 1309 | | AM_RANGE(0x0c000000, 0x0dffffff) AM_RAM AM_BASE(&naomi_ram64) AM_SHARE("share4") |
| 1395 | AM_RANGE(0x0c000000, 0x0dffffff) AM_MIRROR(0xa2000000) AM_RAM AM_BASE(&naomi_ram64) |
| 1310 | 1396 | |
| 1311 | | AM_RANGE(0x0e000000, 0x0fffffff) AM_RAM AM_SHARE("share4")// mirror |
| 1312 | | |
| 1313 | | AM_RANGE(0x8c000000, 0x8dffffff) AM_RAM AM_SHARE("share4") // RAM access through cache |
| 1314 | | |
| 1315 | | AM_RANGE(0xac000000, 0xadffffff) AM_RAM AM_SHARE("share4") // written here by totd |
| 1316 | | |
| 1317 | 1397 | /* Area 4 */ |
| 1318 | | AM_RANGE(0x10000000, 0x107fffff) AM_WRITE( ta_fifo_poly_w ) |
| 1319 | | AM_RANGE(0x10800000, 0x10ffffff) AM_WRITE( ta_fifo_yuv_w ) |
| 1320 | | AM_RANGE(0x11000000, 0x11ffffff) AM_WRITE( ta_texture_directpath0_w ) // access to texture / fraembfufer memory (either 32-bit or 64-bit area depending on SB_LMMODE0 register - cannot be written directly, only through dma / store queue |
| 1398 | AM_RANGE(0x10000000, 0x107fffff) AM_MIRROR(0x02000000) AM_WRITE( ta_fifo_poly_w ) |
| 1399 | AM_RANGE(0x10800000, 0x10ffffff) AM_MIRROR(0x02000000) AM_WRITE( ta_fifo_yuv_w ) |
| 1400 | AM_RANGE(0x11000000, 0x11ffffff) AM_WRITE( ta_texture_directpath0_w ) // access to texture / framebuffer memory (either 32-bit or 64-bit area depending on SB_LMMODE0 register - cannot be written directly, only through dma / store queue) |
| 1321 | 1401 | /* 0x12000000 -0x13ffffff Mirror area of 0x10000000 -0x11ffffff */ |
| 1322 | | AM_RANGE(0x12000000, 0x127fffff) AM_WRITE( ta_fifo_poly_w ) |
| 1323 | | AM_RANGE(0x12800000, 0x12ffffff) AM_WRITE( ta_fifo_yuv_w ) |
| 1324 | | AM_RANGE(0x13000000, 0x13ffffff) AM_WRITE( ta_texture_directpath1_w ) // access to texture / fraembfufer memory (either 32-bit or 64-bit area depending on SB_LMMODE1 register - cannot be written directly, only through dma / store queue |
| 1402 | AM_RANGE(0x13000000, 0x13ffffff) AM_WRITE( ta_texture_directpath1_w ) // access to texture / framebuffer memory (either 32-bit or 64-bit area depending on SB_LMMODE1 register - cannot be written directly, only through dma / store queue) |
| 1325 | 1403 | |
| 1326 | 1404 | /* Area 5 */ |
| 1327 | 1405 | //AM_RANGE(0x14000000, 0x17ffffff) AM_NOP // MPX Ext. |
| r7972 | r7973 | |
| 1501 | 1579 | }; |
| 1502 | 1580 | |
| 1503 | 1581 | |
| 1504 | | |
| 1505 | 1582 | static ADDRESS_MAP_START( dc_audio_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 1506 | 1583 | ADDRESS_MAP_UNMAP_HIGH |
| 1507 | 1584 | AM_RANGE(0x00000000, 0x007fffff) AM_RAM AM_BASE( &dc_sound_ram ) /* shared with SH-4 */ |
| r7972 | r7973 | |
| 1581 | 1658 | PORT_START("IN0") |
| 1582 | 1659 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Service") |
| 1583 | 1660 | PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_LOW ) |
| 1584 | | PORT_START("IN1") |
| 1585 | | PORT_DIPNAME( 0x01, 0x00, "SYSA" ) |
| 1586 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1587 | | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 1588 | | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) |
| 1589 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1590 | | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 1591 | | PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) |
| 1592 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1593 | | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 1594 | | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) |
| 1595 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1596 | | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 1597 | | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) |
| 1598 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1599 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 1600 | | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) |
| 1601 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1602 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 1603 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) |
| 1604 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1605 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 1606 | | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) |
| 1607 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1608 | | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 1609 | | PORT_START("IN2") |
| 1610 | | PORT_DIPNAME( 0x01, 0x00, "SYSB" ) |
| 1611 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1612 | | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 1613 | | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) |
| 1614 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1615 | | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 1616 | | PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) |
| 1617 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1618 | | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 1619 | | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) |
| 1620 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1621 | | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 1622 | | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) |
| 1623 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1624 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 1625 | | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) |
| 1626 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1627 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 1628 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) |
| 1629 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1630 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 1631 | | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) |
| 1632 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1633 | | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 1634 | | PORT_START("IN3") |
| 1635 | | PORT_DIPNAME( 0x01, 0x00, "SYSC" ) |
| 1636 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1637 | | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 1638 | | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) |
| 1639 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1640 | | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 1641 | | PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) |
| 1642 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1643 | | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 1644 | | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) |
| 1645 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1646 | | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 1647 | | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) |
| 1648 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1649 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 1650 | | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) |
| 1651 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1652 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 1653 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) |
| 1654 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1655 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 1656 | | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) |
| 1657 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1658 | | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 1659 | | PORT_START("IN4") |
| 1660 | | PORT_DIPNAME( 0x01, 0x00, "SYSD" ) |
| 1661 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1662 | | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 1663 | | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) |
| 1664 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1665 | | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 1666 | | PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) |
| 1667 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1668 | | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 1669 | | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) |
| 1670 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1671 | | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 1672 | | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) |
| 1673 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1674 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 1675 | | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) |
| 1676 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1677 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 1678 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) |
| 1679 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1680 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 1681 | | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) |
| 1682 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1683 | | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 1684 | 1661 | |
| 1662 | PORT_START("KEY1") |
| 1663 | PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) //TODO: mahjong panel test & service buttons are presumably here |
| 1664 | |
| 1665 | PORT_START("KEY2") |
| 1666 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 1667 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START1 ) |
| 1668 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_KAN ) |
| 1669 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_M ) |
| 1670 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_I ) |
| 1671 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_MAHJONG_E ) |
| 1672 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 1673 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_MAHJONG_A ) |
| 1674 | PORT_START("KEY3") |
| 1675 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 1676 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 1677 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_REACH ) |
| 1678 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_N ) |
| 1679 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_J ) |
| 1680 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_MAHJONG_F ) |
| 1681 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 1682 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_MAHJONG_B ) |
| 1683 | PORT_START("KEY4") |
| 1684 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 1685 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 1686 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_RON ) |
| 1687 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_CHI ) |
| 1688 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_K ) |
| 1689 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_MAHJONG_G ) |
| 1690 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 1691 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_MAHJONG_C ) |
| 1692 | PORT_START("KEY5") |
| 1693 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 1694 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 1695 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 1696 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_PON ) |
| 1697 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_L ) |
| 1698 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_MAHJONG_H ) |
| 1699 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 1700 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_MAHJONG_D ) |
| 1685 | 1701 | PORT_START("COINS") |
| 1686 | 1702 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED(dc_coin_slots_callback, &dc_coin_counts[0]) |
| 1687 | 1703 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_CHANGED(dc_coin_slots_callback, &dc_coin_counts[1]) |
| r7972 | r7973 | |
| 1808 | 1824 | MDRV_CPU_CONFIG(sh4cpu_config) |
| 1809 | 1825 | MDRV_CPU_PROGRAM_MAP(naomi_map) |
| 1810 | 1826 | MDRV_CPU_IO_MAP(naomi_port) |
| 1811 | | MDRV_CPU_VBLANK_INT("screen", naomi_vblank) |
| 1812 | 1827 | |
| 1813 | 1828 | MDRV_CPU_ADD("soundcpu", ARM7, ((XTAL_33_8688MHz*2)/3)/8) // AICA bus clock is 2/3rds * 33.8688. ARM7 gets 1 bus cycle out of each 8. |
| 1814 | 1829 | MDRV_CPU_PROGRAM_MAP(dc_audio_map) |
| r7972 | r7973 | |
| 2566 | 2581 | |
| 2567 | 2582 | */ |
| 2568 | 2583 | |
| 2569 | | ROM_START( derbyocb ) |
| 2584 | ROM_START( derbyoc ) |
| 2570 | 2585 | ROM_REGION( 0x200000, "maincpu", 0) |
| 2571 | 2586 | NAOMI_BIOS |
| 2572 | 2587 | NAOMI_DEFAULT_EEPROM |
| r7972 | r7973 | |
| 2589 | 2604 | ROM_LOAD("mpr-22098.ic14", 0x7000000, 0x0800000, CRC(f9824d2e) SHA1(f20f8cc2b1bef9077ede1cb874da8f2a335d39de) ) |
| 2590 | 2605 | ROM_END |
| 2591 | 2606 | |
| 2592 | | ROM_START( derbyoc ) |
| 2607 | ROM_START( derbyocw ) |
| 2593 | 2608 | ROM_REGION( 0x200000, "maincpu", 0) |
| 2594 | 2609 | NAOMI_BIOS |
| 2595 | 2610 | NAOMI_DEFAULT_EEPROM |
| r7972 | r7973 | |
| 2951 | 2966 | |
| 2952 | 2967 | ROM_REGION( 0xa800000, "user1", ROMREGION_ERASEFF) |
| 2953 | 2968 | ROM_LOAD( "epr-21585.ic22", 0x0000000, 0x200000, CRC(b23d1a0c) SHA1(9e77980d1aa980c879886e53cc76a16d7a9d43a1) ) |
| 2954 | | ROM_LOAD( "mpr-21565.ic1", 0x0800000, 0x800000, CRC(88fb0562) SHA1(185a0eab68d86617cb6325d64c48a2dd4854622b) ) |
| 2955 | | ROM_LOAD( "mpr-21566.ic2", 0x1000000, 0x800000, CRC(5f4dd576) SHA1(5483c3949e587bbcca7e8fc7db9aff4cd2a33f02) ) |
| 2956 | | ROM_LOAD( "mpr-21567.ic3", 0x1800000, 0x800000, CRC(3e62fca4) SHA1(8cdebdebabc88160f458e1e779d9ebb4e6a14523) ) |
| 2957 | | ROM_LOAD( "mpr-21568.ic4", 0x2000000, 0x800000, CRC(6f73a852) SHA1(d5fd4c0800b3a1ea04231018fcaba79184fa1d87) ) |
| 2958 | | ROM_LOAD( "mpr-21569.ic5", 0x2800000, 0x800000, CRC(c7950445) SHA1(4f56768f07703452ef92d183e4ee654ab9711283) ) |
| 2959 | | ROM_LOAD( "mpr-21570.ic6", 0x3000000, 0x800000, CRC(5a812247) SHA1(7636661da0cc9bd5a1a2062f9f3ef65889c86fd5) ) |
| 2960 | | ROM_LOAD( "mpr-21571.ic7", 0x3800000, 0x800000, CRC(17e9414a) SHA1(9f291c4dd9a049eeed88d80867f7fca1d15c6095) ) |
| 2961 | | ROM_LOAD( "mpr-21572.ic8", 0x4000000, 0x800000, CRC(5d2d8134) SHA1(a2941b6afd0302822133d932064d1aad873b1c04) ) |
| 2962 | | ROM_LOAD( "mpr-21573.ic9", 0x4800000, 0x800000, CRC(eacaf26d) SHA1(21e35def0ed998a70cc982f373feb50b7974612a) ) |
| 2963 | | ROM_LOAD( "mpr-21574.ic10", 0x5000000, 0x800000, CRC(1e3686be) SHA1(7ec1b3c9c94882c5fe7b6ba6ffe9220e90824870) ) |
| 2964 | | ROM_LOAD( "mpr-21575.ic11", 0x5800000, 0x800000, CRC(5ada00a2) SHA1(981c65310c89e7a26e2b2c3e57623e78f6ad33d0) ) |
| 2965 | | ROM_LOAD( "mpr-21576.ic12", 0x6000000, 0x800000, CRC(9eff6247) SHA1(9257492fc3e48516897002dd3ff247093af27d87) ) |
| 2966 | | ROM_LOAD( "mpr-21577.ic13", 0x6800000, 0x800000, CRC(8a80b16a) SHA1(ffeb061b31027ac322c14b9050c686b2b844d2e1) ) |
| 2967 | | ROM_LOAD( "mpr-21578.ic14", 0x7000000, 0x800000, CRC(7ae20daf) SHA1(b36d8e490ac477db178b8df08f7997448308d3fd) ) |
| 2968 | | ROM_LOAD( "mpr-21579.ic15", 0x7800000, 0x800000, CRC(fbb8641b) SHA1(6cb44f0a3f80eb68a218bba97b2395961c596b9c) ) |
| 2969 | | ROM_LOAD( "mpr-21580.ic16", 0x8000000, 0x800000, CRC(3881ec23) SHA1(e4b87a6c6fd6a2eeda8e0e5ae7bed01b18386e54) ) |
| 2970 | | ROM_LOAD( "mpr-21581.ic17", 0x8800000, 0x800000, CRC(66bff6e4) SHA1(f87d618231b71b65952fc7ea7ccabdd208622a00) ) |
| 2971 | | ROM_LOAD( "mpr-21582.ic18", 0x9000000, 0x800000, CRC(8cd2f654) SHA1(77eb7061caaf0288aad04ed88c4247d27617f338) ) |
| 2972 | | ROM_LOAD( "mpr-21583.ic19", 0x9800000, 0x800000, CRC(6cf6e705) SHA1(68d7e9becefe27b556e0c5d7ba00efd2d1fb71ca) ) |
| 2973 | | ROM_LOAD( "mpr-21584.ic20", 0xa000000, 0x800000, CRC(495e6265) SHA1(57936367fec0000691641525682fb8aefc4e4f56) ) |
| 2969 | ROM_LOAD( "mpr-21386.ic1", 0x0800000, 0x800000, CRC(88fb0562) SHA1(185a0eab68d86617cb6325d64c48a2dd4854622b) ) |
| 2970 | ROM_LOAD( "mpr-21387.ic2", 0x1000000, 0x800000, CRC(5f4dd576) SHA1(5483c3949e587bbcca7e8fc7db9aff4cd2a33f02) ) |
| 2971 | ROM_LOAD( "mpr-21388.ic3", 0x1800000, 0x800000, CRC(3e62fca4) SHA1(8cdebdebabc88160f458e1e779d9ebb4e6a14523) ) |
| 2972 | ROM_LOAD( "mpr-21389.ic4", 0x2000000, 0x800000, CRC(6f73a852) SHA1(d5fd4c0800b3a1ea04231018fcaba79184fa1d87) ) |
| 2973 | ROM_LOAD( "mpr-21390.ic5", 0x2800000, 0x800000, CRC(c7950445) SHA1(4f56768f07703452ef92d183e4ee654ab9711283) ) |
| 2974 | ROM_LOAD( "mpr-21391.ic6", 0x3000000, 0x800000, CRC(5a812247) SHA1(7636661da0cc9bd5a1a2062f9f3ef65889c86fd5) ) |
| 2975 | ROM_LOAD( "mpr-21392.ic7", 0x3800000, 0x800000, CRC(17e9414a) SHA1(9f291c4dd9a049eeed88d80867f7fca1d15c6095) ) |
| 2976 | ROM_LOAD( "mpr-21393.ic8", 0x4000000, 0x800000, CRC(5d2d8134) SHA1(a2941b6afd0302822133d932064d1aad873b1c04) ) |
| 2977 | ROM_LOAD( "mpr-21394.ic9", 0x4800000, 0x800000, CRC(eacaf26d) SHA1(21e35def0ed998a70cc982f373feb50b7974612a) ) |
| 2978 | ROM_LOAD( "mpr-21395.ic10", 0x5000000, 0x800000, CRC(1e3686be) SHA1(7ec1b3c9c94882c5fe7b6ba6ffe9220e90824870) ) |
| 2979 | ROM_LOAD( "mpr-21396.ic11", 0x5800000, 0x800000, CRC(5ada00a2) SHA1(981c65310c89e7a26e2b2c3e57623e78f6ad33d0) ) |
| 2980 | ROM_LOAD( "mpr-21397.ic12", 0x6000000, 0x800000, CRC(9eff6247) SHA1(9257492fc3e48516897002dd3ff247093af27d87) ) |
| 2981 | ROM_LOAD( "mpr-21398.ic13", 0x6800000, 0x800000, CRC(8a80b16a) SHA1(ffeb061b31027ac322c14b9050c686b2b844d2e1) ) |
| 2982 | ROM_LOAD( "mpr-21399.ic14", 0x7000000, 0x800000, CRC(7ae20daf) SHA1(b36d8e490ac477db178b8df08f7997448308d3fd) ) |
| 2983 | ROM_LOAD( "mpr-21400.ic15", 0x7800000, 0x800000, CRC(fbb8641b) SHA1(6cb44f0a3f80eb68a218bba97b2395961c596b9c) ) |
| 2984 | ROM_LOAD( "mpr-21401.ic16", 0x8000000, 0x800000, CRC(3881ec23) SHA1(e4b87a6c6fd6a2eeda8e0e5ae7bed01b18386e54) ) |
| 2985 | ROM_LOAD( "mpr-21402.ic17", 0x8800000, 0x800000, CRC(66bff6e4) SHA1(f87d618231b71b65952fc7ea7ccabdd208622a00) ) |
| 2986 | ROM_LOAD( "mpr-21403.ic18", 0x9000000, 0x800000, CRC(8cd2f654) SHA1(77eb7061caaf0288aad04ed88c4247d27617f338) ) |
| 2987 | ROM_LOAD( "mpr-21404.ic19", 0x9800000, 0x800000, CRC(6cf6e705) SHA1(68d7e9becefe27b556e0c5d7ba00efd2d1fb71ca) ) |
| 2988 | ROM_LOAD( "mpr-21405.ic20", 0xa000000, 0x800000, CRC(495e6265) SHA1(57936367fec0000691641525682fb8aefc4e4f56) ) |
| 2974 | 2989 | ROM_END |
| 2975 | 2990 | |
| 2991 | ROM_START( hotd2o ) |
| 2992 | ROM_REGION( 0x200000, "maincpu", 0) |
| 2993 | HOTD2_BIOS |
| 2994 | NAOMI_DEFAULT_EEPROM |
| 2995 | |
| 2996 | ROM_REGION( 0xa800000, "user1", ROMREGION_ERASEFF) |
| 2997 | ROM_LOAD( "epr-21385.ic22", 0x0000000, 0x200000, CRC(dedffe5f) SHA1(98b2a4c67ecb30cb096b9cea9061d904cf495937) ) |
| 2998 | ROM_LOAD( "mpr-21386.ic1", 0x0800000, 0x800000, CRC(88fb0562) SHA1(185a0eab68d86617cb6325d64c48a2dd4854622b) ) |
| 2999 | ROM_LOAD( "mpr-21387.ic2", 0x1000000, 0x800000, CRC(5f4dd576) SHA1(5483c3949e587bbcca7e8fc7db9aff4cd2a33f02) ) |
| 3000 | ROM_LOAD( "mpr-21388.ic3", 0x1800000, 0x800000, CRC(3e62fca4) SHA1(8cdebdebabc88160f458e1e779d9ebb4e6a14523) ) |
| 3001 | ROM_LOAD( "mpr-21389.ic4", 0x2000000, 0x800000, CRC(6f73a852) SHA1(d5fd4c0800b3a1ea04231018fcaba79184fa1d87) ) |
| 3002 | ROM_LOAD( "mpr-21390.ic5", 0x2800000, 0x800000, CRC(c7950445) SHA1(4f56768f07703452ef92d183e4ee654ab9711283) ) |
| 3003 | ROM_LOAD( "mpr-21391.ic6", 0x3000000, 0x800000, CRC(5a812247) SHA1(7636661da0cc9bd5a1a2062f9f3ef65889c86fd5) ) |
| 3004 | ROM_LOAD( "mpr-21392.ic7", 0x3800000, 0x800000, CRC(17e9414a) SHA1(9f291c4dd9a049eeed88d80867f7fca1d15c6095) ) |
| 3005 | ROM_LOAD( "mpr-21393.ic8", 0x4000000, 0x800000, CRC(5d2d8134) SHA1(a2941b6afd0302822133d932064d1aad873b1c04) ) |
| 3006 | ROM_LOAD( "mpr-21394.ic9", 0x4800000, 0x800000, CRC(eacaf26d) SHA1(21e35def0ed998a70cc982f373feb50b7974612a) ) |
| 3007 | ROM_LOAD( "mpr-21395.ic10", 0x5000000, 0x800000, CRC(1e3686be) SHA1(7ec1b3c9c94882c5fe7b6ba6ffe9220e90824870) ) |
| 3008 | ROM_LOAD( "mpr-21396.ic11", 0x5800000, 0x800000, CRC(5ada00a2) SHA1(981c65310c89e7a26e2b2c3e57623e78f6ad33d0) ) |
| 3009 | ROM_LOAD( "mpr-21397.ic12", 0x6000000, 0x800000, CRC(9eff6247) SHA1(9257492fc3e48516897002dd3ff247093af27d87) ) |
| 3010 | ROM_LOAD( "mpr-21398.ic13", 0x6800000, 0x800000, CRC(8a80b16a) SHA1(ffeb061b31027ac322c14b9050c686b2b844d2e1) ) |
| 3011 | ROM_LOAD( "mpr-21399.ic14", 0x7000000, 0x800000, CRC(7ae20daf) SHA1(b36d8e490ac477db178b8df08f7997448308d3fd) ) |
| 3012 | ROM_LOAD( "mpr-21400.ic15", 0x7800000, 0x800000, CRC(fbb8641b) SHA1(6cb44f0a3f80eb68a218bba97b2395961c596b9c) ) |
| 3013 | ROM_LOAD( "mpr-21401.ic16", 0x8000000, 0x800000, CRC(3881ec23) SHA1(e4b87a6c6fd6a2eeda8e0e5ae7bed01b18386e54) ) |
| 3014 | ROM_LOAD( "mpr-21402.ic17", 0x8800000, 0x800000, CRC(66bff6e4) SHA1(f87d618231b71b65952fc7ea7ccabdd208622a00) ) |
| 3015 | ROM_LOAD( "mpr-21403.ic18", 0x9000000, 0x800000, CRC(8cd2f654) SHA1(77eb7061caaf0288aad04ed88c4247d27617f338) ) |
| 3016 | ROM_LOAD( "mpr-21404.ic19", 0x9800000, 0x800000, CRC(6cf6e705) SHA1(68d7e9becefe27b556e0c5d7ba00efd2d1fb71ca) ) |
| 3017 | ROM_LOAD( "mpr-21405.ic20", 0xa000000, 0x800000, CRC(495e6265) SHA1(57936367fec0000691641525682fb8aefc4e4f56) ) |
| 3018 | ROM_END |
| 3019 | |
| 2976 | 3020 | /* |
| 2977 | 3021 | SYSTEMID: NAOMI |
| 2978 | 3022 | JAP: GIANT GRAM |
| r7972 | r7973 | |
| 4513 | 4557 | /* 0007C */ GAME( 1999, ggram2, naomi, naomi, naomi, naomi, ROT0, "Sega", "Giant Gram (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4514 | 4558 | /* 0010C */ GAME( 1999, vs2_2k, naomi, naomi, naomi, naomi, ROT0, "Sega", "Virtua Striker 2 Ver. 2000 (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4515 | 4559 | /* 0011C */ GAME( 1999, toyfight, naomi, naomi, naomi, naomi, ROT0, "Sega", "Toy Fighter", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4560 | /* 0012C */ GAME( 1999, smlg99, naomi, naomi, naomi, naomi, ROT0, "Sega", "Super Major League '99", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4516 | 4561 | /* 0013C */ GAME( 1999, jambo, naomi, naomi, naomi, naomi, ROT0, "Sega", "Jambo! Safari (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4517 | 4562 | /* 0015C */ GAME( 1999, vtennis, naomi, naomi, naomi, naomi, ROT0, "Sega", "Power Smash (JPN) / Virtua Tennis (USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4518 | | /* 0016C */ GAME( 1999, derbyoc, naomi, naomi, naomi, naomi, ROT0, "Sega", "Derby Owners Club (JPN, USA, EXP, KOR, AUS Ver. C)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4519 | | /* 0016C */ GAME( 1999, derbyocb, derbyoc, naomi, naomi, naomi, ROT0, "Sega", "Derby Owners Club (JPN, USA, EXP, KOR, AUS Ver. B)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4563 | /* 0016C */ GAME( 1999, derbyoc, naomi, naomi, naomi, naomi, ROT0, "Sega", "Derby Owners Club (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4520 | 4564 | /* 0017C */ GAME( 1999, otrigger, naomi, naomi, naomi, naomi, ROT0, "Sega", "OutTrigger (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4521 | 4565 | /* 0018C */ GAME( 1999, sgtetris, naomi, naomi, naomi, naomi, ROT0, "Sega", "Sega Tetris", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4522 | 4566 | /* 0019C */ GAME( 1999, dybb99, naomi, naomi, naomi, naomi, ROT0, "Sega", "Dynamite Baseball '99 (JPN) / World Series '99 (USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4523 | | /* 00??C */ GAME( 1999, smlg99, naomi, naomi, naomi, naomi, ROT0, "Sega", "Super Major League '99", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4524 | 4567 | /* 0020C */ GAME( 1999, samba, naomi, naomi, naomi, naomi, ROT0, "Sega", "Samba De Amigo (JPN)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4525 | 4568 | /* 0021C */ GAME( 2000, virnba, naomi, naomi, naomi, naomi, ROT0, "Sega", "Virtua NBA (JPN, USA, EXP, KOR, AUS)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4526 | 4569 | /* 0021C */ GAME( 2000, virnbao, virnba, naomi, naomi, naomi, ROT0, "Sega", "Virtua NBA (JPN, USA, EXP, KOR, AUS) (original)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4527 | 4570 | /* 0026C */ GAME( 2000, totd, naomi, naomi, naomi, naomi, ROT0, "Sega", "The Typing of the Dead (JPN, USA, EXP, KOR, AUS)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4528 | 4571 | /* 0027C */ GAME( 2000, smarinef, naomi, naomi, naomi, naomi, ROT0, "Sega", "Sega Marine Fishing", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4529 | 4572 | /* 0030C */ GAME( 2000, qmegamis, naomi, naomi, naomi, qmegamis, ROT0, "Sega", "Quiz Ah Megamisama (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4530 | | /* 0035B */ GAME( 2000, sstrkfgt, naomi, naomi, naomi, naomi, ROT0, "Sega", "Sega Strike Fighter (rev. A)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4573 | /* 0035B */ GAME( 2000, sstrkfgt, naomi, naomi, naomi, naomi, ROT0, "Sega", "Sega Strike Fighter (Rev A)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4531 | 4574 | /* 0037C */ GAME( 2000, 18wheelr, naomi, naomi, naomi, naomi, ROT0, "Sega", "18 Wheeler (JPN)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4532 | 4575 | /* 0039C */ GAME( 2000, gram2000, naomi, naomi, naomi, gram2000, ROT0, "Sega", "Giant Gram 2000 (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4533 | 4576 | /* 0040C */ GAME( 2000, wwfroyal, naomi, naomi, naomi, naomi, ROT0, "Sega", "WWF Royal Rumble (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4534 | 4577 | /* 0041C */ GAME( 2000, slasho, naomi, naomi, naomi, naomi, ROT0, "Sega", "Slashout (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4535 | 4578 | /* 0043C */ GAME( 2000, crackndj, naomi, naomi, naomi, naomi, ROT0, "Sega", "Crackin' DJ", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4536 | | /* 0044C */ GAME( 2001, csmash, naomi, naomi, naomi, naomi, ROT0, "Sega", "Cosmic Smash (JPN, USA, EXP, KOR, AUS) (rev. A)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4579 | /* 0044C */ GAME( 2001, csmash, naomi, naomi, naomi, naomi, ROT0, "Sega", "Cosmic Smash (JPN, USA, EXP, KOR, AUS) (Rev A)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4537 | 4580 | /* 0044C */ GAME( 2001, csmasho, csmash, naomi, naomi, naomi, ROT0, "Sega", "Cosmic Smash (JPN, USA, EXP, KOR, AUS) (original)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4538 | 4581 | /* 0083C */ GAME( 2001, derbyoc2, naomi, naomi, naomi, naomi, ROT0, "Sega", "Derby Owners Club II (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4539 | 4582 | /* 0084C */ GAME( 2001, vtenis2c, naomi, naomi, naomi, naomi, ROT0, "Sega", "Power Smash 2 / Virtua Tennis 2 (cartridge)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4583 | /* 0088C */ GAME( 2001, derbyocw, naomi, naomi, naomi, naomi, ROT0, "Sega", "Derby Owners Club World Edition (Rev C) (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4540 | 4584 | /* 0098C */ GAME( 2001, shootopl, naomi, naomi, naomi, naomi, ROT0, "Sega", "Shootout Pool", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4541 | 4585 | /* 0128C */ GAME( 2001, shootpl, naomi, naomi, naomi, naomi, ROT0, "Sega", "Shootout Pool (JPN, USA, KOR, AUS) / Shootout Pool Prize (EXP)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4542 | | /* 0140B */ GAME( 2004, kick4csh, naomi, naomi, naomi, kick4csh, ROT0, "Sega", "Kick '4' Cash", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4586 | /* 0140C */ GAME( 2004, kick4csh, naomi, naomi, naomi, kick4csh, ROT0, "Sega", "Kick '4' Cash", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4543 | 4587 | |
| 4544 | 4588 | /* 841-xxxxx ("Licensed by Sega" games)*/ |
| 4545 | 4589 | /* 0001C */ GAME( 1999, pstone, naomi, naomi, naomi, naomi, ROT0, "Capcom", "Power Stone (JPN, USA, EUR, ASI, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| r7972 | r7973 | |
| 4556 | 4600 | /* 0013C */ GAME( 2000, ggx, naomi, naomi, naomi, naomi, ROT0, "Arc System Works","Guilty Gear X (JPN)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4557 | 4601 | /* 0014C */ GAME( 2000, gwing2, naomi, naomi, naomi, naomi, ROT0, "Takumi / Capcom", "Giga Wing 2 (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4558 | 4602 | /* 0015C */ GAME( 2000, pjustic, naomi, naomi, naomi, naomi, ROT0, "Capcom", "Moero Justice Gakuen (JPN) / Project Justice (USA, EXP, KOR, AUS) ", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4559 | | /* 0016 */ GAME( 2000, deathcox, naomi, naomi, naomi, naomi, ROT0, "Ecole", "Death Crimson OX (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4560 | | /* xxxx */ GAME( 2001, hmgeo, naomi, naomi, naomi, naomi, ROT0, "Capcom", "Heavy Metal Geomatrix (JPN, USA, EUR, ASI, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4603 | /* 0016C */ GAME( 2000, deathcox, naomi, naomi, naomi, naomi, ROT0, "Ecole", "Death Crimson OX (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4604 | /* HMG016007 */ GAME( 2001, hmgeo, naomi, naomi, naomi, naomi, ROT0, "Capcom", "Heavy Metal Geomatrix (JPN, USA, EUR, ASI, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4561 | 4605 | |
| 4562 | 4606 | /* Games with incomplete dumps */ |
| 4563 | | /* xxxx */ GAME( 2001, gunsur2, naomi, naomi, naomi, naomi, ROT0, "Capcom / Namco", "Gun Survivor 2: Bio Hazard Code Veronica", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4607 | /* 25709801 */ GAME( 2001, gunsur2, naomi, naomi, naomi, naomi, ROT0, "Capcom / Namco", "Gun Survivor 2: Bio Hazard Code Veronica", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4564 | 4608 | |
| 4565 | 4609 | /* Games with game specific bios sets */ |
| 4566 | 4610 | GAME( 1998, hod2bios, 0, naomi, naomi, 0, ROT0, "Sega", "Naomi House of the Dead 2 Bios", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT ) |
| 4567 | | GAME( 1999, hotd2, hod2bios, naomi, naomi, 0, ROT0, "Sega", "House of the Dead 2", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4611 | /* 834-13636 */ GAME( 1999, hotd2, hod2bios, naomi, naomi, 0, ROT0, "Sega", "House of the Dead 2", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4612 | /* 834-13636 */ GAME( 1999, hotd2o, hotd2, naomi, naomi, 0, ROT0, "Sega", "House of the Dead 2 (original)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4568 | 4613 | GAME( 1999, f355bios, 0, naomi, naomi, 0, ROT0, "Sega", "Naomi Ferrari F355 Challenge Bios", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT ) |
| 4569 | | GAME( 1999, f355, f355bios, naomi, naomi, 0, ROT0, "Sega", "Ferrari F355 Challenge", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4570 | | GAME( 1999, f355twin, f355bios, naomi, naomi, 0, ROT0, "Sega", "Ferrari F355 Challenge (Twin)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4571 | | GAME( 1999, f355twn2, f355bios, naomi, naomi, 0, ROT0, "Sega", "Ferrari F355 Challenge 2 (Twin)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4614 | /* 834-13842 */ GAME( 1999, f355, f355bios, naomi, naomi, 0, ROT0, "Sega", "Ferrari F355 Challenge", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4615 | /* 834-13950 */ GAME( 1999, f355twin, f355bios, naomi, naomi, 0, ROT0, "Sega", "Ferrari F355 Challenge (Twin)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4616 | /* 840-0042C */ GAME( 1999, f355twn2, f355bios, naomi, naomi, 0, ROT0, "Sega", "Ferrari F355 Challenge 2 (Twin)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4572 | 4617 | GAME( 1999, airlbios, 0, naomi, naomi, 0, ROT0, "Sega", "Naomi Airline Pilots Deluxe Bios", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT ) |
| 4573 | 4618 | GAME( 1999, alpiltdx, airlbios, naomi, naomi, 0, ROT0, "Sega", "Airline Pilots Deluxe", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4574 | | GAME( 1999, alpilota, alpiltdx, naomi, naomi, 0, ROT0, "Sega", "Airline Pilots (Rev. A)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4619 | /* 840-0005C */ GAME( 1999, alpilota, alpiltdx, naomi, naomi, 0, ROT0, "Sega", "Airline Pilots (Rev A)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4575 | 4620 | |
| 4576 | 4621 | /********************************************** |
| 4577 | 4622 | * |
| r7972 | r7973 | |
| 5738 | 5783 | |
| 5739 | 5784 | /* GDL-xxxx ("licensed by Sega" games) */ |
| 5740 | 5785 | GAME( 2001, gundmgd, naomigd, naomigd, naomi, naomi, ROT0, "Capcom", "Mobile Suit Gundam: Federation VS Zeon (GDL-0001)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 5741 | | GAME( 2001, sfz3ugd, naomigd, naomigd, naomi, naomi, ROT0, "Capcom", "Street Fighter Zero 3 Upper (GDL-0002)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 5786 | GAME( 2001, sfz3ugd, naomigd, naomigd, naomi, sfz3ugd, ROT0, "Capcom", "Street Fighter Zero 3 Upper (GDL-0002)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 5742 | 5787 | //GDL-0003 |
| 5743 | 5788 | GAME( 2001, cvsgd, naomigd, naomigd, naomi, naomi, ROT0, "Capcom / SNK", "Capcom Vs. SNK Millenium Fight 2000 Pro (GDL-0004)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 5744 | 5789 | //GDL-0005 Doki Doki Idol Star Seeker |
| r7972 | r7973 | |
| 5827 | 5872 | //GDS-0026 Initial D Arcade Stage Ver. 2 (Japan) (NAOMI 2) |
| 5828 | 5873 | //GDS-0027 Initial D Arcade Stage Ver. 2 (Export) (NAOMI 2) |
| 5829 | 5874 | //GDS-0028 |
| 5830 | | //GDS-0029 |
| 5875 | //GDS-0029 Club Kart Cycraft Edition |
| 5831 | 5876 | //GDS-0030 |
| 5832 | 5877 | GAME( 2003, puyofev, naomigd, naomigd, naomi, naomi, ROT0, "Sega", "Puyo Puyo Fever (GDS-0031)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 5833 | 5878 | //GDS-0032 Initial D Arcade Stage Ver. 3 (Japan) |
| r7972 | r7973 | |
| 5836 | 5881 | //GDS-0035 |
| 5837 | 5882 | //GDS-0036 Virtua Fighter 4 Final Tuned |
| 5838 | 5883 | //GDS-0037? Puyo Puyo Fever (Export) |
| 5884 | //GDS-0038 |
| 5885 | //GDS-0039 Initial D: Arcade Stage Ver. 3 Cycraft Edition |
| 5839 | 5886 | |
| 5840 | 5887 | |
| 5841 | 5888 | /********************************************** |
| r7972 | r7973 | |
| 6253 | 6300 | GAME( 2001, naomi2, 0, naomi, naomi, 0, ROT0, "Sega", "Naomi 2 Bios", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT ) |
| 6254 | 6301 | |
| 6255 | 6302 | //Naomi 2 Cart Games |
| 6303 | /* 840-xxxxx (Sega games)*/ |
| 6256 | 6304 | /* Complete Dumps */ |
| 6257 | | GAME( 2001, vstrik3c, naomi2, naomi, naomi, 0, ROT0, "Sega", "Virtua Striker 3 (Cart) (USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 6258 | | GAME( 2001, wldrider, naomi2, naomi, naomi, 0, ROT0, "Sega", "Wild Riders (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 6259 | | GAME( 2001, vf4cart, naomi2, naomi, naomi, 0, ROT0, "Sega", "Virtua Fighter 4 (Cartridge)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 6260 | | GAME( 2001, vf4evoct, naomi2, naomi, naomi, vf4evoct, ROT0, "Sega", "Virtua Fighter 4 Evolution (Cartridge)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 6261 | | GAME( 2002, clubkrte, naomi2, naomi, naomi, 0, ROT0, "Sega", "Club Kart: European Session", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 6305 | /* 0046C */ GAME( 2001, wldrider, naomi2, naomi, naomi, 0, ROT0, "Sega", "Wild Riders (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 6306 | /* 0061C */ GAME( 2001, vstrik3c, naomi2, naomi, naomi, 0, ROT0, "Sega", "Virtua Striker 3 (Cart) (USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 6307 | /* 0080C */ GAME( 2001, vf4cart, naomi2, naomi, naomi, 0, ROT0, "Sega", "Virtua Fighter 4 (Cartridge)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 6308 | /* 0106C */ GAME( 2001, vf4evoct, naomi2, naomi, naomi, vf4evoct, ROT0, "Sega", "Virtua Fighter 4 Evolution (Cartridge)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 6309 | /* 0139C */ GAME( 2002, clubkrte, naomi2, naomi, naomi, 0, ROT0, "Sega", "Club Kart: European Session", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 6262 | 6310 | |
| 6263 | 6311 | /* GDS-xxxx (Sega first party games) */ |
| 6264 | 6312 | GAME( 2001, vstrik3, naomi2, naomigd, naomi, naomi2, ROT0, "Sega", "Virtua Striker 3 (GDS-0006)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| r7972 | r7973 | |
| 6570 | 6618 | AW_BIOS |
| 6571 | 6619 | |
| 6572 | 6620 | ROM_REGION( 0x8000000, "user1", ROMREGION_ERASE) |
| 6573 | | ROM_LOAD( "ax2201p01.ic18", 0x0000000, 0x0800000, CRC(ecc4a5c7) SHA1(97c2ef2be95b39bc978474a8243740df50255a8b) ) |
| 6621 | ROM_LOAD( "ax2201p01.ic18", 0x0000000, 0x0800000, CRC(ecc4a5c7) SHA1(97c2ef2be95b39bc978474a8243740df50255a8b) ) |
| 6622 | /* these are taken from the above set, game *seems* to work fine with these ... */ |
| 6623 | ROM_LOAD( "ax2201m01.ic11", 0x1000000, 0x1000000, CRC(22ea665b) SHA1(292c92c9ae43eea2d1c27cedfb89c3956b8dea32) ) |
| 6624 | ROM_LOAD( "ax2202m01.ic12", 0x2000000, 0x1000000, CRC(7fad1bea) SHA1(89f3f88af48973a4685955d86ef97a1487b8e7a8) ) |
| 6625 | ROM_LOAD( "ax2203m01.ic13", 0x3000000, 0x1000000, CRC(78986ca4) SHA1(5a6c8c12955573f33361d2c6f20f85de35ac7bae) ) |
| 6626 | ROM_LOAD( "ax2204m01.ic14", 0x4000000, 0x1000000, CRC(6ffbeb04) SHA1(975062cf364589dbdd5c5cb5ca945f76d87fc120) ) |
| 6627 | ROM_LOAD( "ax2205m01.ic15", 0x5000000, 0x1000000, CRC(2851b791) SHA1(566ef95ea066b7bf548986085670242be217befc) ) |
| 6628 | ROM_LOAD( "ax2206m01.ic16", 0x6000000, 0x1000000, CRC(e53eb965) SHA1(f50cd53a5859f081d8a278d24a519c9d9b49ab96) ) |
| 6574 | 6629 | ROM_END |
| 6575 | 6630 | |
| 6576 | 6631 | ROM_START( kov7sprt ) |
| r7972 | r7973 | |
| 6649 | 6704 | GAME( 2005, ngbc, awbios, aw, aw, ngbc, ROT0, "Sammy / SNK Playmore", "Neo-Geo Battle Coliseum", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 6650 | 6705 | GAME( 2005, fotns, awbios, aw, aw, fotns, ROT0, "Sega / Arc System Works", "Fist Of The North Star", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 6651 | 6706 | GAME( 2005, kofnw, awbios, aw, aw, kofnw, ROT0, "Sammy / SNK Playmore", "The King of Fighters Neowave", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 6652 | | GAME( 2005, kofnwj, awbios, aw, aw, kofnw, ROT0, "Sammy / SNK Playmore", "The King of Fighters Neowave (Japan)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 6707 | GAME( 2005, kofnwj, kofnw, aw, aw, kofnw, ROT0, "Sammy / SNK Playmore", "The King of Fighters Neowave (Japan)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 6653 | 6708 | GAME( 2005, xtrmhunt, awbios, aw, aw, xtrmhunt, ROT0, "Sammy", "Extreme Hunting", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 6654 | 6709 | GAME( 2006, xtrmhnt2, awbios, aw, aw, xtrmhnt2, ROT0, "Sega", "Extreme Hunting 2", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
src/mame/drivers/vsnes.c
| r7972 | r7973 | |
| 44 | 44 | - Goonies |
| 45 | 45 | - Soccer |
| 46 | 46 | - T.K.O. Boxing * |
| 47 | (Manual states this is an RP2C04-0004 - though the pallete doesn't agree) |
| 47 | 48 | |
| 48 | 49 | RP2C04-0004: |
| 49 | 50 | - Clu Clu Land |
| r7972 | r7973 | |
| 167 | 168 | { |
| 168 | 169 | coin_counter_w( space->machine, 0, data & 0x01 ); |
| 169 | 170 | coin = data; |
| 170 | | if( data & 0xfe ) //"bnglngby" and "cluclu" |
| 171 | |
| 172 | //"bnglngby" and "cluclu" |
| 173 | if( data & 0xfe ) |
| 171 | 174 | { |
| 172 | 175 | logerror("vsnes_coin_counter_w: pc = 0x%04x - data = 0x%02x\n", cpu_get_pc(space->cpu), data); |
| 173 | 176 | } |
| r7972 | r7973 | |
| 184 | 187 | coin_counter_w( space->machine, 1, data & 0x01 ); |
| 185 | 188 | if( data & 0xfe ) //vsbball service mode |
| 186 | 189 | { |
| 187 | | //do something? |
| 190 | //do something? |
| 188 | 191 | logerror("vsnes_coin_counter_1_w: pc = 0x%04x - data = 0x%02x\n", cpu_get_pc(space->cpu), data); |
| 189 | 192 | } |
| 190 | 193 | |
| r7972 | r7973 | |
| 212 | 215 | AM_RANGE(0x4011, 0x4011) AM_DEVWRITE("dac1", dac_w) |
| 213 | 216 | AM_RANGE(0x4000, 0x4013) AM_DEVREADWRITE("nes1", nes_psg_r, nes_psg_w) |
| 214 | 217 | AM_RANGE(0x4014, 0x4014) AM_WRITE(sprite_dma_0_w) |
| 215 | | AM_RANGE(0x4015, 0x4015) AM_DEVREADWRITE("nes1", psg_4015_r, psg_4015_w) /* PSG status / first control register */ |
| 218 | AM_RANGE(0x4015, 0x4015) AM_DEVREADWRITE("nes1", psg_4015_r, psg_4015_w) /* PSG status / first control register */ |
| 216 | 219 | AM_RANGE(0x4016, 0x4016) AM_READWRITE(vsnes_in0_r, vsnes_in0_w) |
| 217 | | AM_RANGE(0x4017, 0x4017) AM_READ(vsnes_in1_r) AM_DEVWRITE("nes1", psg_4017_w) /* IN1 - input port 2 / PSG second control register */ |
| 220 | AM_RANGE(0x4017, 0x4017) AM_READ(vsnes_in1_r) AM_DEVWRITE("nes1", psg_4017_w) /* IN1 - input port 2 / PSG second control register */ |
| 218 | 221 | AM_RANGE(0x4020, 0x4020) AM_READWRITE(vsnes_coin_counter_r, vsnes_coin_counter_w) |
| 219 | 222 | AM_RANGE(0x6000, 0x7fff) AM_RAMBANK("extra1") |
| 220 | 223 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| r7972 | r7973 | |
| 228 | 231 | AM_RANGE(0x4014, 0x4014) AM_WRITE(sprite_dma_1_w) |
| 229 | 232 | AM_RANGE(0x4015, 0x4015) AM_DEVREADWRITE("nes2", psg_4015_r, psg_4015_w) /* PSG status / first control register */ |
| 230 | 233 | AM_RANGE(0x4016, 0x4016) AM_READWRITE(vsnes_in0_1_r, vsnes_in0_1_w) |
| 231 | | AM_RANGE(0x4017, 0x4017) AM_READ(vsnes_in1_1_r) AM_DEVWRITE("nes2", psg_4017_w) /* IN1 - input port 2 / PSG second control register */ |
| 234 | AM_RANGE(0x4017, 0x4017) AM_READ(vsnes_in1_1_r) AM_DEVWRITE("nes2", psg_4017_w) /* IN1 - input port 2 / PSG second control register */ |
| 232 | 235 | AM_RANGE(0x4020, 0x4020) AM_WRITE(vsnes_coin_counter_1_w) |
| 233 | 236 | AM_RANGE(0x6000, 0x7fff) AM_RAMBANK("extra2") |
| 234 | 237 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| r7972 | r7973 | |
| 241 | 244 | PORT_START("IN0") |
| 242 | 245 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) /* BUTTON A on a nes */ |
| 243 | 246 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) /* BUTTON B on a nes */ |
| 244 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 ) /* SELECT on a nes */ |
| 245 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* START on a nes */ |
| 247 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 ) /* SELECT on a nes */ |
| 248 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* START on a nes */ |
| 246 | 249 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) |
| 247 | 250 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) |
| 248 | 251 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) |
| r7972 | r7973 | |
| 251 | 254 | PORT_START("IN1") |
| 252 | 255 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) /* BUTTON A on a nes */ |
| 253 | 256 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) /* BUTTON B on a nes */ |
| 254 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START2 ) /* SELECT on a nes */ |
| 255 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* START on a nes */ |
| 257 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START2 ) /* SELECT on a nes */ |
| 258 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* START on a nes */ |
| 256 | 259 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) |
| 257 | 260 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) |
| 258 | 261 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) |
| 259 | 262 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) |
| 260 | 263 | |
| 261 | 264 | PORT_START("COINS") |
| 262 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) /* serial pin from controller */ |
| 265 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) /* serial pin from controller */ |
| 263 | 266 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 264 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_IMPULSE(1) /* service credit? */ |
| 265 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) /* bit 0 of dsw goes here */ |
| 266 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) /* bit 1 of dsw goes here */ |
| 267 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_IMPULSE(1) /* service credit? */ |
| 268 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) /* bit 0 of dsw goes here */ |
| 269 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) /* bit 1 of dsw goes here */ |
| 267 | 270 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1) |
| 268 | 271 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(1) |
| 269 | 272 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| r7972 | r7973 | |
| 296 | 299 | PORT_START("IN0") |
| 297 | 300 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) /* BUTTON A on a nes */ |
| 298 | 301 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) /* BUTTON B on a nes */ |
| 299 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 ) /* SELECT on a nes */ |
| 300 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START3 ) /* START on a nes */ |
| 302 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 ) /* SELECT on a nes */ |
| 303 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START3 ) /* START on a nes */ |
| 301 | 304 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) |
| 302 | 305 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) |
| 303 | 306 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) |
| r7972 | r7973 | |
| 306 | 309 | PORT_START("IN1") |
| 307 | 310 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) /* BUTTON A on a nes */ |
| 308 | 311 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) /* BUTTON B on a nes */ |
| 309 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START2 ) /* SELECT on a nes */ |
| 310 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START4 ) /* START on a nes */ |
| 312 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START2 ) /* SELECT on a nes */ |
| 313 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START4 ) /* START on a nes */ |
| 311 | 314 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) |
| 312 | 315 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) |
| 313 | 316 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) |
| 314 | 317 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) |
| 315 | 318 | |
| 316 | 319 | PORT_START("COINS") |
| 317 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) /* serial pin from controller */ |
| 320 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) /* serial pin from controller */ |
| 318 | 321 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 319 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_IMPULSE(1) /* service credit? */ |
| 320 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) /* bit 0 of dsw goes here */ |
| 321 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) /* bit 1 of dsw goes here */ |
| 322 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_IMPULSE(1) /* service credit? */ |
| 323 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) /* bit 0 of dsw goes here */ |
| 324 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) /* bit 1 of dsw goes here */ |
| 322 | 325 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1) |
| 323 | 326 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(1) |
| 324 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) /* this bit masks irqs - dont change */ |
| 327 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) /* this bit masks irqs - dont change */ |
| 325 | 328 | |
| 326 | 329 | /* Right Side Controls */ |
| 327 | 330 | PORT_START("IN2") |
| r7972 | r7973 | |
| 337 | 340 | PORT_START("IN3") |
| 338 | 341 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(4) /* BUTTON A on a nes */ |
| 339 | 342 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(4) /* BUTTON B on a nes */ |
| 340 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("2nd Side 2 Player Start") PORT_CODE(KEYCODE_EQUALS) /* SELECT on a nes */ |
| 341 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("2nd Side 4 Player Start") PORT_CODE(KEYCODE_BACKSPACE) /* START on a nes */ |
| 343 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("2nd Side 2 Player Start") PORT_CODE(KEYCODE_EQUALS) /* SELECT on a nes */ |
| 344 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("2nd Side 4 Player Start") PORT_CODE(KEYCODE_BACKSPACE) /* START on a nes */ |
| 342 | 345 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(4) |
| 343 | 346 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4) |
| 344 | 347 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4) |
| 345 | 348 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4) |
| 346 | 349 | |
| 347 | 350 | PORT_START("COINS2") |
| 348 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) /* serial pin from controller */ |
| 351 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) /* serial pin from controller */ |
| 349 | 352 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 350 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE2 ) PORT_IMPULSE(1) /* service credit? */ |
| 351 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) /* bit 0 of dsw goes here */ |
| 352 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) /* bit 1 of dsw goes here */ |
| 353 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE2 ) PORT_IMPULSE(1) /* service credit? */ |
| 354 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) /* bit 0 of dsw goes here */ |
| 355 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) /* bit 1 of dsw goes here */ |
| 353 | 356 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN3 ) PORT_IMPULSE(1) |
| 354 | 357 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN4 ) PORT_IMPULSE(1) |
| 355 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) /* this bit masks irqs - dont change */ |
| 358 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) /* this bit masks irqs - dont change */ |
| 356 | 359 | |
| 357 | 360 | /* Both sides also have a DSW (#0 & #1) which are defined per game, below */ |
| 358 | 361 | INPUT_PORTS_END |
| r7972 | r7973 | |
| 401 | 404 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 402 | 405 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 403 | 406 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 404 | | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) /* sprite hit */ |
| 405 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) /* gun trigger */ |
| 407 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) /* sprite hit */ |
| 408 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) /* gun trigger */ |
| 406 | 409 | |
| 407 | 410 | PORT_START("IN1") |
| 408 | 411 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| r7972 | r7973 | |
| 415 | 418 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 416 | 419 | |
| 417 | 420 | PORT_START("COINS") |
| 418 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) /* serial pin from controller */ |
| 421 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) /* serial pin from controller */ |
| 419 | 422 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 420 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_IMPULSE(1) /* service credit? */ |
| 421 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) /* bit 0 of dsw goes here */ |
| 422 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) /* bit 1 of dsw goes here */ |
| 423 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_IMPULSE(1) /* service credit? */ |
| 424 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) /* bit 0 of dsw goes here */ |
| 425 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) /* bit 1 of dsw goes here */ |
| 423 | 426 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1) |
| 424 | 427 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(1) |
| 425 | 428 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| r7972 | r7973 | |
| 436 | 439 | PORT_INCLUDE( vsnes ) |
| 437 | 440 | |
| 438 | 441 | PORT_START("DSW0") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 439 | | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) |
| 442 | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!1,!2,!3") |
| 440 | 443 | PORT_DIPSETTING( 0x03, DEF_STR( 5C_1C ) ) |
| 441 | 444 | PORT_DIPSETTING( 0x05, DEF_STR( 4C_1C ) ) |
| 442 | 445 | PORT_DIPSETTING( 0x01, DEF_STR( 3C_1C ) ) |
| r7972 | r7973 | |
| 445 | 448 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) ) |
| 446 | 449 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) |
| 447 | 450 | PORT_DIPSETTING( 0x07, DEF_STR( Free_Play ) ) |
| 448 | | PORT_DIPNAME( 0x08, 0x00, "Lives per Coin" ) |
| 451 | PORT_DIPNAME( 0x08, 0x00, "Lives per Coin" ) PORT_DIPLOCATION("SW1:!4") |
| 449 | 452 | PORT_DIPSETTING( 0x00, "3 - 12 Max" ) |
| 450 | 453 | PORT_DIPSETTING( 0x08, "2 - 9 Max" ) |
| 451 | | PORT_DIPNAME( 0x30, 0x00, "Bonus" ) |
| 454 | PORT_DIPNAME( 0x30, 0x00, "Bonus" ) PORT_DIPLOCATION("SW1:!5,!6") |
| 452 | 455 | PORT_DIPSETTING( 0x00, "30k and Every 50k" ) |
| 453 | 456 | PORT_DIPSETTING( 0x20, "50k and Every 100k" ) |
| 454 | 457 | PORT_DIPSETTING( 0x10, "100k and Every 150k" ) |
| 455 | 458 | PORT_DIPSETTING( 0x30, "200k and Every 200k" ) |
| 456 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Difficulty ) ) |
| 457 | | PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) |
| 459 | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:!7") |
| 460 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) |
| 458 | 461 | PORT_DIPSETTING( 0x40, DEF_STR( Hard ) ) |
| 459 | | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) |
| 462 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:!8") |
| 460 | 463 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 461 | 464 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 462 | 465 | INPUT_PORTS_END |
| r7972 | r7973 | |
| 465 | 468 | PORT_INCLUDE( vsnes ) |
| 466 | 469 | |
| 467 | 470 | PORT_START("DSW0") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 468 | | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) ) |
| 471 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:!1") |
| 469 | 472 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 470 | 473 | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 471 | | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) |
| 474 | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:!2") |
| 472 | 475 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 473 | 476 | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 474 | | PORT_DIPNAME( 0x04, 0x00, DEF_STR( Demo_Sounds ) ) |
| 477 | PORT_DIPNAME( 0x04, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:!3") |
| 475 | 478 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 476 | 479 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 477 | | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) |
| 478 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 479 | | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 480 | | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) |
| 481 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 482 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 483 | | PORT_DIPNAME( 0xE0, 0x00, DEF_STR( Coinage ) ) |
| 480 | PORT_DIPNAME( 0x18, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:!4,!5") |
| 481 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) |
| 482 | PORT_DIPSETTING( 0x08, DEF_STR( Normal ) ) |
| 483 | PORT_DIPSETTING( 0x10, DEF_STR( Medium ) ) |
| 484 | PORT_DIPSETTING( 0x18, DEF_STR( Hard ) ) |
| 485 | PORT_DIPNAME( 0xE0, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!6,!7,!8") |
| 484 | 486 | PORT_DIPSETTING( 0xc0, DEF_STR( 5C_1C ) ) |
| 485 | 487 | PORT_DIPSETTING( 0xa0, DEF_STR( 4C_1C ) ) |
| 486 | 488 | PORT_DIPSETTING( 0x80, DEF_STR( 3C_1C ) ) |
| r7972 | r7973 | |
| 491 | 493 | PORT_DIPSETTING( 0xe0, DEF_STR( Free_Play ) ) |
| 492 | 494 | INPUT_PORTS_END |
| 493 | 495 | |
| 494 | | /* |
| 495 | | Stroke Play Off On |
| 496 | | Hole in 1 +5 +4 |
| 497 | | Double Eagle +4 +3 |
| 498 | | Eagle +3 +2 |
| 499 | | Birdie +2 +1 |
| 500 | | Par +1 0 |
| 501 | | Bogey 0 -1 |
| 502 | | Other 0 -2 |
| 503 | | |
| 504 | | Match Play OFF ON |
| 505 | | Win Hole +1 +2 |
| 506 | | Tie 0 0 |
| 507 | | Lose Hole -1 -2 |
| 508 | | */ |
| 509 | | |
| 510 | 496 | static INPUT_PORTS_START( golf ) |
| 511 | 497 | PORT_INCLUDE( vsnes_rev ) |
| 512 | 498 | |
| 513 | 499 | PORT_START("DSW0") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 514 | | PORT_DIPNAME( 0x07, 0x01, DEF_STR( Coinage ) ) |
| 500 | PORT_DIPNAME( 0x07, 0x01, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!1,!2,!3") |
| 515 | 501 | PORT_DIPSETTING( 0x07, DEF_STR( 4C_1C ) ) |
| 516 | 502 | PORT_DIPSETTING( 0x03, DEF_STR( 3C_1C ) ) |
| 517 | 503 | PORT_DIPSETTING( 0x05, DEF_STR( 2C_1C ) ) |
| r7972 | r7973 | |
| 520 | 506 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) |
| 521 | 507 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ) ) |
| 522 | 508 | PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) |
| 523 | | PORT_DIPNAME( 0x08, 0x00, "Hole Size" ) |
| 509 | PORT_DIPNAME( 0x08, 0x00, "Hole Size" ) PORT_DIPLOCATION("SW1:!4") |
| 524 | 510 | PORT_DIPSETTING( 0x00, "Large" ) |
| 525 | 511 | PORT_DIPSETTING( 0x08, "Small" ) |
| 526 | | PORT_DIPNAME( 0x10, 0x00, "Points per Stroke" ) |
| 512 | PORT_DIPNAME( 0x10, 0x00, "Points per Stroke" ) PORT_DIPLOCATION("SW1:!5") |
| 527 | 513 | PORT_DIPSETTING( 0x00, DEF_STR( Easier ) ) |
| 528 | 514 | PORT_DIPSETTING( 0x10, DEF_STR( Harder ) ) |
| 529 | | PORT_DIPNAME( 0x60, 0x00, "Starting Points" ) |
| 515 | /* |
| 516 | Stroke Play OFF/ON |
| 517 | Hole in 1 +5 +4 |
| 518 | Double Eagle +4 +3 |
| 519 | Eagle +3 +2 |
| 520 | Birdie +2 +1 |
| 521 | Par +1 0 |
| 522 | Bogey 0 -1 |
| 523 | Other 0 -2 |
| 524 | |
| 525 | Match Play OFF/ON |
| 526 | Win Hole +1 +2 |
| 527 | Tie 0 0 |
| 528 | Lose Hole -1 -2 |
| 529 | */ |
| 530 | PORT_DIPNAME( 0x60, 0x00, "Starting Points" ) PORT_DIPLOCATION("SW1:!6,7") |
| 530 | 531 | PORT_DIPSETTING( 0x00, "10" ) |
| 531 | 532 | PORT_DIPSETTING( 0x40, "13" ) |
| 532 | 533 | PORT_DIPSETTING( 0x20, "16" ) |
| 533 | 534 | PORT_DIPSETTING( 0x60, "20" ) |
| 534 | | PORT_DIPNAME( 0x80, 0x00, "Difficulty Vs. Computer" ) |
| 535 | PORT_DIPNAME( 0x80, 0x00, "Difficulty Vs. Computer" ) PORT_DIPLOCATION("SW1:!8") |
| 535 | 536 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) |
| 536 | 537 | PORT_DIPSETTING( 0x80, DEF_STR( Hard ) ) |
| 537 | 538 | INPUT_PORTS_END |
| r7972 | r7973 | |
| 541 | 542 | PORT_INCLUDE( golf ) |
| 542 | 543 | |
| 543 | 544 | PORT_MODIFY("IN0") |
| 544 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START3 ) /* START on a nes */ |
| 545 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START3 ) /* START on a nes */ |
| 545 | 546 | |
| 546 | 547 | PORT_MODIFY("IN1") |
| 547 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START4 ) /* START on a nes */ |
| 548 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START4 ) /* START on a nes */ |
| 548 | 549 | INPUT_PORTS_END |
| 549 | 550 | |
| 550 | 551 | static INPUT_PORTS_START( vstennis ) |
| 551 | 552 | PORT_INCLUDE( vsnes_dual ) |
| 552 | 553 | |
| 553 | 554 | PORT_START("DSW0") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 554 | | PORT_DIPNAME( 0x03, 0x00, "Difficulty Vs. Computer" ) |
| 555 | PORT_DIPNAME( 0x03, 0x00, "Difficulty Vs. Computer" ) PORT_DIPLOCATION("SW1:!1,!2") |
| 555 | 556 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) |
| 556 | 557 | PORT_DIPSETTING( 0x02, DEF_STR( Normal ) ) |
| 557 | | PORT_DIPSETTING( 0x01, DEF_STR( Hard ) ) |
| 558 | | PORT_DIPSETTING( 0x03, DEF_STR( Very_Hard ) ) |
| 559 | | PORT_DIPNAME( 0x0c, 0x00, "Difficulty Vs. Player" ) |
| 558 | PORT_DIPSETTING( 0x01, DEF_STR( Medium ) ) |
| 559 | PORT_DIPSETTING( 0x03, DEF_STR( Hard ) ) |
| 560 | PORT_DIPNAME( 0x0c, 0x00, "Difficulty Vs. Player" ) PORT_DIPLOCATION("SW1:!3,!4") |
| 560 | 561 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) |
| 561 | 562 | PORT_DIPSETTING( 0x08, DEF_STR( Normal ) ) |
| 562 | | PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) |
| 563 | | PORT_DIPSETTING( 0x0c, DEF_STR( Very_Hard ) ) |
| 564 | | PORT_DIPNAME( 0x10, 0x00, "Raquet Size" ) |
| 563 | PORT_DIPSETTING( 0x04, DEF_STR( Medium ) ) |
| 564 | PORT_DIPSETTING( 0x0c, DEF_STR( Hard ) ) |
| 565 | PORT_DIPNAME( 0x10, 0x00, "Raquet Size" ) PORT_DIPLOCATION("SW1:!5") |
| 565 | 566 | PORT_DIPSETTING( 0x00, "Large" ) |
| 566 | 567 | PORT_DIPSETTING( 0x10, "Small" ) |
| 567 | | PORT_DIPNAME( 0x20, 0x00, "Extra Score" ) |
| 568 | PORT_DIPNAME( 0x20, 0x00, "Extra Score" ) PORT_DIPLOCATION("SW1:!6") |
| 568 | 569 | PORT_DIPSETTING( 0x00, "1 Set" ) |
| 569 | 570 | PORT_DIPSETTING( 0x20, "1 Game" ) |
| 570 | | PORT_DIPNAME( 0x40, 0x00, "Court Color" ) |
| 571 | PORT_DIPNAME( 0x40, 0x00, "Court Color" ) PORT_DIPLOCATION("SW1:!7") |
| 571 | 572 | PORT_DIPSETTING( 0x00, "Green" ) |
| 572 | 573 | PORT_DIPSETTING( 0x40, "Blue" ) |
| 573 | | PORT_DIPNAME( 0x80, 0x00, "Copyright" ) |
| 574 | PORT_DIPNAME( 0x80, 0x00, "Copyright" ) PORT_DIPLOCATION("SW1:!8") |
| 574 | 575 | PORT_DIPSETTING( 0x00, DEF_STR( Japan ) ) |
| 575 | 576 | PORT_DIPSETTING( 0x80, DEF_STR( USA ) ) |
| 576 | 577 | |
| 577 | 578 | PORT_START("DSW1") /* DSW1 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 578 | | PORT_SERVICE( 0x01, IP_ACTIVE_HIGH ) |
| 579 | | PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) ) |
| 579 | PORT_SERVICE( 0x01, IP_ACTIVE_HIGH ) PORT_DIPLOCATION("SW2:!1") |
| 580 | PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:!2,!3") |
| 580 | 581 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) |
| 581 | 582 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) |
| 582 | 583 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) ) |
| 583 | 584 | PORT_DIPSETTING( 0x06, DEF_STR( Free_Play ) ) |
| 584 | | PORT_DIPNAME( 0x08, 0x08, "Doubles 4 Player" ) |
| 585 | | PORT_DIPSETTING( 0x00, "2 Credits" ) |
| 586 | | PORT_DIPSETTING( 0x08, "4 Credits" ) |
| 587 | | PORT_DIPNAME( 0x10, 0x10, "Doubles Vs CPU" ) |
| 588 | | PORT_DIPSETTING( 0x00, "1 Credit" ) |
| 589 | | PORT_DIPSETTING( 0x10, "2 Credits" ) |
| 590 | | PORT_DIPNAME( 0x60, 0x00, "Rackets Per Game" ) |
| 585 | PORT_DIPNAME( 0x18, 0x08, "Game Mode - Credits: 1VsC/2VsC/1Vs1/2Vs2" ) PORT_DIPLOCATION("SW2:!4,!5") |
| 586 | PORT_DIPSETTING( 0x00, "A - 1/1/1/1" ) |
| 587 | PORT_DIPSETTING( 0x10, "B - 1/2/1/2" ) |
| 588 | PORT_DIPSETTING( 0x08, "C - 2/2/2/2" ) |
| 589 | PORT_DIPSETTING( 0x18, "D - 2/2/4/4" ) |
| 590 | PORT_DIPNAME( 0x60, 0x00, "Rackets Per Game" ) PORT_DIPLOCATION("SW2:!6,!7") |
| 591 | 591 | PORT_DIPSETTING( 0x60, "2" ) |
| 592 | 592 | PORT_DIPSETTING( 0x00, "3" ) |
| 593 | 593 | PORT_DIPSETTING( 0x40, "4" ) |
| 594 | 594 | PORT_DIPSETTING( 0x20, "5" ) |
| 595 | | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) |
| 595 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:!8") |
| 596 | 596 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 597 | 597 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 598 | 598 | INPUT_PORTS_END |
| r7972 | r7973 | |
| 601 | 601 | PORT_INCLUDE( vsnes_dual ) |
| 602 | 602 | |
| 603 | 603 | PORT_START("DSW0") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 604 | | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) |
| 604 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:!1,!2") |
| 605 | 605 | PORT_DIPSETTING( 0x00, "3" ) |
| 606 | 606 | PORT_DIPSETTING( 0x02, "4" ) |
| 607 | 607 | PORT_DIPSETTING( 0x01, "5" ) |
| 608 | 608 | PORT_DIPSETTING( 0x03, "6" ) |
| 609 | | PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) |
| 610 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 611 | | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 612 | | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) |
| 613 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 614 | | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 615 | | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) |
| 616 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 617 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 618 | | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) |
| 619 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 620 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 621 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) |
| 622 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 623 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 624 | | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) |
| 625 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 626 | | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 609 | PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "SW1:!3" ) |
| 610 | PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "SW1:!4" ) |
| 611 | PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x00, "SW1:!5" ) |
| 612 | PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x00, "SW1:!6" ) |
| 613 | PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x00, "SW1:!7" ) |
| 614 | PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x00, "SW1:!8" ) |
| 627 | 615 | |
| 628 | 616 | PORT_START("DSW1") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 629 | | PORT_DIPNAME( 0x07, 0x01, DEF_STR( Coinage ) ) |
| 617 | PORT_DIPNAME( 0x07, 0x01, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:!1,!2,!3") |
| 630 | 618 | PORT_DIPSETTING( 0x07, DEF_STR( 4C_1C ) ) |
| 631 | 619 | PORT_DIPSETTING( 0x03, DEF_STR( 3C_1C ) ) |
| 632 | 620 | PORT_DIPSETTING( 0x05, DEF_STR( 2C_1C ) ) |
| r7972 | r7973 | |
| 635 | 623 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) |
| 636 | 624 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ) ) |
| 637 | 625 | PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) |
| 638 | | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) |
| 639 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 640 | | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 641 | | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) |
| 642 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 643 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 644 | | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) |
| 645 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 646 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 647 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) |
| 648 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 649 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 650 | | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) |
| 651 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 652 | | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 626 | PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "SW2:!4" ) |
| 627 | PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x00, "SW2:!5" ) |
| 628 | PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x00, "SW2:!6" ) |
| 629 | PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x00, "SW2:!7" ) |
| 630 | PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x00, "SW2:!8" ) |
| 653 | 631 | INPUT_PORTS_END |
| 654 | 632 | |
| 655 | 633 | static INPUT_PORTS_START( balonfgt ) |
| 656 | 634 | PORT_INCLUDE( vsnes_dual ) |
| 657 | 635 | |
| 658 | 636 | PORT_START("DSW0") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 659 | | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) |
| 637 | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!1,!2,!3") |
| 660 | 638 | PORT_DIPSETTING( 0x03, DEF_STR( 4C_1C ) ) |
| 661 | 639 | PORT_DIPSETTING( 0x05, DEF_STR( 3C_1C ) ) |
| 662 | 640 | PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) |
| r7972 | r7973 | |
| 665 | 643 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) |
| 666 | 644 | PORT_DIPSETTING( 0x06, DEF_STR( 1C_4C ) ) |
| 667 | 645 | PORT_DIPSETTING( 0x07, DEF_STR( Free_Play ) ) |
| 668 | | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) |
| 669 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 670 | | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 671 | | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) |
| 672 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 673 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 674 | | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) |
| 675 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 676 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 677 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) |
| 678 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 679 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 680 | | PORT_SERVICE( 0x80, IP_ACTIVE_HIGH ) |
| 646 | PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "SW1:!4" ) |
| 647 | PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x00, "SW1:!5" ) |
| 648 | PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x00, "SW1:!6" ) |
| 649 | PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x00, "SW1:!7" ) |
| 650 | PORT_SERVICE( 0x80, IP_ACTIVE_HIGH ) PORT_DIPLOCATION("SW1:!8") |
| 681 | 651 | |
| 682 | 652 | PORT_START("DSW1") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 683 | | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) |
| 653 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:!1,!2") |
| 684 | 654 | PORT_DIPSETTING( 0x00, "3" ) |
| 685 | 655 | PORT_DIPSETTING( 0x02, "4" ) |
| 686 | 656 | PORT_DIPSETTING( 0x01, "5" ) |
| 687 | 657 | PORT_DIPSETTING( 0x03, "6" ) |
| 688 | | PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) |
| 689 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 690 | | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 691 | | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) |
| 692 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 693 | | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 694 | | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) |
| 695 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 696 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 697 | | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) |
| 698 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 699 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 700 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) |
| 701 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 702 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 703 | | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) |
| 704 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 705 | | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 658 | PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "SW2:!3" ) |
| 659 | PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "SW2:!4" ) |
| 660 | PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x00, "SW2:!5" ) |
| 661 | PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x00, "SW2:!6" ) |
| 662 | PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x00, "SW2:!7" ) |
| 663 | PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x00, "SW2:!8" ) |
| 706 | 664 | INPUT_PORTS_END |
| 707 | 665 | |
| 708 | 666 | static INPUT_PORTS_START( vsmahjng ) |
| 709 | 667 | PORT_INCLUDE( vsnes_dual ) |
| 710 | 668 | |
| 711 | 669 | PORT_START("DSW0") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 712 | | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) ) |
| 713 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 714 | | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 715 | | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) |
| 716 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 717 | | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 718 | | PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) |
| 719 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 720 | | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 721 | | PORT_DIPNAME( 0x08, 0x00, "Infinite Time" ) |
| 722 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 723 | | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 724 | | PORT_DIPNAME( 0x30, 0x00, "Time" ) |
| 670 | PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x00, "SW1:!1" ) |
| 671 | PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x00, "SW1:!2" ) |
| 672 | PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "SW1:!3" ) |
| 673 | PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "SW1:!4" ) |
| 674 | PORT_DIPNAME( 0x30, 0x00, "Time" ) PORT_DIPLOCATION("SW1:!5,!6") |
| 725 | 675 | PORT_DIPSETTING( 0x30, "30" ) |
| 726 | 676 | PORT_DIPSETTING( 0x10, "45" ) |
| 727 | 677 | PORT_DIPSETTING( 0x20, "60" ) |
| 728 | 678 | PORT_DIPSETTING( 0x00, "90" ) |
| 729 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) |
| 730 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 731 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 732 | | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) |
| 733 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 734 | | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 679 | PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x00, "SW1:!7" ) |
| 680 | PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x00, "SW1:!8" ) |
| 735 | 681 | |
| 736 | 682 | PORT_START("DSW1") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 737 | | PORT_SERVICE( 0x01, IP_ACTIVE_HIGH ) |
| 738 | | PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) ) |
| 683 | PORT_SERVICE( 0x01, IP_ACTIVE_HIGH ) PORT_DIPLOCATION("SW2:!1") |
| 684 | PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:!2,!3") |
| 739 | 685 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) |
| 740 | 686 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) |
| 741 | 687 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) ) |
| 742 | 688 | PORT_DIPSETTING( 0x06, DEF_STR( Free_Play ) ) |
| 743 | | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) |
| 744 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 745 | | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 746 | | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) |
| 747 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 748 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 749 | | PORT_DIPNAME( 0x60, 0x20, "Starting Points" ) |
| 689 | PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "SW2:!4" ) |
| 690 | PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x00, "SW2:!5" ) |
| 691 | PORT_DIPNAME( 0x60, 0x20, "Starting Points" ) PORT_DIPLOCATION("SW2:!6,!7") |
| 750 | 692 | PORT_DIPSETTING( 0x60, "15000" ) |
| 751 | 693 | PORT_DIPSETTING( 0x20, "20000" ) |
| 752 | 694 | PORT_DIPSETTING( 0x40, "25000" ) |
| 753 | 695 | PORT_DIPSETTING( 0x00, "30000" ) |
| 754 | | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) |
| 696 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:!8") |
| 755 | 697 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 756 | 698 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 757 | 699 | INPUT_PORTS_END |
| r7972 | r7973 | |
| 759 | 701 | static INPUT_PORTS_START( vsbball ) |
| 760 | 702 | PORT_INCLUDE( vsnes_dual ) |
| 761 | 703 | |
| 704 | PORT_START("DSW1") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 705 | PORT_DIPNAME( 0x03, 0x02, "Player Defense Strength" ) PORT_DIPLOCATION("SW1:!1,!2") |
| 706 | PORT_DIPSETTING( 0x00, "Weak" ) |
| 707 | PORT_DIPSETTING( 0x02, DEF_STR( Normal ) ) |
| 708 | PORT_DIPSETTING( 0x01, DEF_STR( Medium ) ) |
| 709 | PORT_DIPSETTING( 0x03, "Strong" ) |
| 710 | PORT_DIPNAME( 0x0c, 0x08, "Player Offense Strength" ) PORT_DIPLOCATION("SW1:!3,!4") |
| 711 | PORT_DIPSETTING( 0x00, "Weak" ) |
| 712 | PORT_DIPSETTING( 0x08, DEF_STR( Normal ) ) |
| 713 | PORT_DIPSETTING( 0x04, DEF_STR( Medium ) ) |
| 714 | PORT_DIPSETTING( 0x0c, "Strong" ) |
| 715 | PORT_DIPNAME( 0x30, 0x20, "Computer Defense Strength" ) PORT_DIPLOCATION("SW1:!5,!6") |
| 716 | PORT_DIPSETTING( 0x00, "Weak" ) |
| 717 | PORT_DIPSETTING( 0x20, DEF_STR( Normal ) ) |
| 718 | PORT_DIPSETTING( 0x10, DEF_STR( Medium ) ) |
| 719 | PORT_DIPSETTING( 0x30, "Strong" ) |
| 720 | PORT_DIPNAME( 0xc0, 0x80, "Computer Offense Strength" ) PORT_DIPLOCATION("SW1:!7,!8") |
| 721 | PORT_DIPSETTING( 0x00, "Weak" ) |
| 722 | PORT_DIPSETTING( 0x80, DEF_STR( Normal ) ) |
| 723 | PORT_DIPSETTING( 0x40, DEF_STR( Medium ) ) |
| 724 | PORT_DIPSETTING( 0xc0, "Strong" ) |
| 725 | |
| 762 | 726 | PORT_START("DSW0") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 763 | | PORT_SERVICE( 0x01, IP_ACTIVE_HIGH ) |
| 764 | | PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) ) |
| 727 | PORT_SERVICE( 0x01, IP_ACTIVE_HIGH ) PORT_DIPLOCATION("SW2:!1") |
| 728 | PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:!2,!3") |
| 765 | 729 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) |
| 766 | 730 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) |
| 767 | 731 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) ) |
| 768 | 732 | PORT_DIPSETTING( 0x06, DEF_STR( Free_Play ) ) |
| 769 | | PORT_DIPNAME( 0x38, 0x00, "Starting Points" ) |
| 770 | | PORT_DIPSETTING( 0x00, "80 Pts" ) |
| 771 | | PORT_DIPSETTING( 0x20, "100 Pts" ) |
| 772 | | PORT_DIPSETTING( 0x10, "150 Pts" ) |
| 773 | | PORT_DIPSETTING( 0x30, "200 Pts" ) |
| 774 | | PORT_DIPSETTING( 0x08, "250 Pts" ) |
| 775 | | PORT_DIPSETTING( 0x28, "300 Pts" ) |
| 776 | | PORT_DIPSETTING( 0x18, "350 Pts" ) |
| 777 | | PORT_DIPSETTING( 0x38, "400 Pts" ) |
| 778 | | PORT_DIPNAME( 0x40, 0x00, "Bonus Play" ) //? |
| 733 | PORT_DIPNAME( 0x38, 0x00, "Starting Points" ) PORT_DIPLOCATION("SW2:!4,!5,!6") |
| 734 | PORT_DIPSETTING( 0x00, "80 Pts" ) |
| 735 | PORT_DIPSETTING( 0x20, "100 Pts" ) |
| 736 | PORT_DIPSETTING( 0x10, "150 Pts" ) |
| 737 | PORT_DIPSETTING( 0x30, "200 Pts" ) |
| 738 | PORT_DIPSETTING( 0x08, "250 Pts" ) |
| 739 | PORT_DIPSETTING( 0x28, "300 Pts" ) |
| 740 | PORT_DIPSETTING( 0x18, "350 Pts" ) |
| 741 | PORT_DIPSETTING( 0x38, "400 Pts" ) |
| 742 | PORT_DIPNAME( 0x40, 0x00, "Bonus Play" ) PORT_DIPLOCATION("SW2:!7") |
| 779 | 743 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 780 | 744 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 781 | | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) |
| 745 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:!8") |
| 782 | 746 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 783 | 747 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 784 | 748 | |
| 785 | | PORT_START("DSW1") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 786 | | PORT_DIPNAME( 0x03, 0x02, "Player Defense Strenght" ) |
| 787 | | PORT_DIPSETTING( 0x00, "Weak" ) |
| 788 | | PORT_DIPSETTING( 0x02, DEF_STR( Normal ) ) |
| 789 | | PORT_DIPSETTING( 0x01, "Strong" ) |
| 790 | | PORT_DIPSETTING( 0x03, "Very Strong" ) |
| 791 | | PORT_DIPNAME( 0x0c, 0x08, "Player Offense Strenght" ) |
| 792 | | PORT_DIPSETTING( 0x00, "Weak" ) |
| 793 | | PORT_DIPSETTING( 0x08, DEF_STR( Normal ) ) |
| 794 | | PORT_DIPSETTING( 0x04, "Strong" ) |
| 795 | | PORT_DIPSETTING( 0x0c, "Very Strong" ) |
| 796 | | PORT_DIPNAME( 0x30, 0x20, "Computer Defense Strenght" ) |
| 797 | | PORT_DIPSETTING( 0x00, "Weak" ) |
| 798 | | PORT_DIPSETTING( 0x20, DEF_STR( Normal ) ) |
| 799 | | PORT_DIPSETTING( 0x10, "Strong" ) |
| 800 | | PORT_DIPSETTING( 0x30, "Very Strong" ) |
| 801 | | PORT_DIPNAME( 0xc0, 0x80, "Computer Offense Strenght" ) |
| 802 | | PORT_DIPSETTING( 0x00, "Weak" ) |
| 803 | | PORT_DIPSETTING( 0x80, DEF_STR( Normal ) ) |
| 804 | | PORT_DIPSETTING( 0x40, "Strong" ) |
| 805 | | PORT_DIPSETTING( 0xc0, "Very Strong" ) |
| 806 | 749 | INPUT_PORTS_END |
| 807 | 750 | |
| 808 | 751 | static INPUT_PORTS_START( vsbballj ) |
| 809 | 752 | PORT_INCLUDE( vsnes_dual ) |
| 810 | 753 | |
| 811 | 754 | PORT_START("DSW0") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 812 | | PORT_DIPNAME( 0x03, 0x02, "Player Defense Strenght" ) |
| 755 | PORT_DIPNAME( 0x03, 0x02, "Player Defense Strength" ) PORT_DIPLOCATION("SW1:!1,!2") |
| 813 | 756 | PORT_DIPSETTING( 0x00, "Weak" ) |
| 814 | 757 | PORT_DIPSETTING( 0x02, DEF_STR( Normal ) ) |
| 815 | | PORT_DIPSETTING( 0x01, "Strong" ) |
| 816 | | PORT_DIPSETTING( 0x03, "Very Strong" ) |
| 817 | | PORT_DIPNAME( 0x0c, 0x08, "Player Offense Strenght" ) |
| 758 | PORT_DIPSETTING( 0x01, DEF_STR( Medium ) ) |
| 759 | PORT_DIPSETTING( 0x03, "Strong" ) |
| 760 | PORT_DIPNAME( 0x0c, 0x08, "Player Offense Strength" ) PORT_DIPLOCATION("SW1:!3,!4") |
| 818 | 761 | PORT_DIPSETTING( 0x00, "Weak" ) |
| 819 | 762 | PORT_DIPSETTING( 0x08, DEF_STR( Normal ) ) |
| 820 | | PORT_DIPSETTING( 0x04, "Strong" ) |
| 821 | | PORT_DIPSETTING( 0x0c, "Very Strong" ) |
| 822 | | PORT_DIPNAME( 0x30, 0x20, "Computer Defense Strenght" ) |
| 763 | PORT_DIPSETTING( 0x04, DEF_STR( Medium ) ) |
| 764 | PORT_DIPSETTING( 0x0c, "Strong" ) |
| 765 | PORT_DIPNAME( 0x30, 0x20, "Computer Defense Strength" ) PORT_DIPLOCATION("SW1:!5,!6") |
| 823 | 766 | PORT_DIPSETTING( 0x00, "Weak" ) |
| 824 | 767 | PORT_DIPSETTING( 0x20, DEF_STR( Normal ) ) |
| 825 | | PORT_DIPSETTING( 0x10, "Strong" ) |
| 826 | | PORT_DIPSETTING( 0x30, "Very Strong" ) |
| 827 | | PORT_DIPNAME( 0xc0, 0x80, "Computer Offense Strenght" ) |
| 768 | PORT_DIPSETTING( 0x10, DEF_STR( Medium ) ) |
| 769 | PORT_DIPSETTING( 0x30, "Strong" ) |
| 770 | PORT_DIPNAME( 0xc0, 0x80, "Computer Offense Strength" ) PORT_DIPLOCATION("SW1:!7,!8") |
| 828 | 771 | PORT_DIPSETTING( 0x00, "Weak" ) |
| 829 | 772 | PORT_DIPSETTING( 0x80, DEF_STR( Normal ) ) |
| 830 | | PORT_DIPSETTING( 0x40, "Strong" ) |
| 831 | | PORT_DIPSETTING( 0xc0, "Very Strong" ) |
| 773 | PORT_DIPSETTING( 0x40, DEF_STR( Medium ) ) |
| 774 | PORT_DIPSETTING( 0xc0, "Strong" ) |
| 832 | 775 | |
| 833 | 776 | PORT_START("DSW1") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 834 | | PORT_SERVICE( 0x01, IP_ACTIVE_HIGH ) |
| 835 | | PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) ) |
| 777 | PORT_SERVICE( 0x01, IP_ACTIVE_HIGH ) PORT_DIPLOCATION("SW2:!1") |
| 778 | PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:!2,!3") |
| 836 | 779 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) |
| 837 | 780 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) |
| 838 | 781 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) ) |
| 839 | 782 | PORT_DIPSETTING( 0x06, DEF_STR( Free_Play ) ) |
| 840 | | PORT_DIPNAME( 0x38, 0x00, "Starting Points" ) |
| 841 | | PORT_DIPSETTING( 0x00, "80 Pts" ) |
| 842 | | PORT_DIPSETTING( 0x20, "100 Pts" ) |
| 843 | | PORT_DIPSETTING( 0x10, "150 Pts" ) |
| 844 | | PORT_DIPSETTING( 0x30, "200 Pts" ) |
| 845 | | PORT_DIPSETTING( 0x08, "250 Pts" ) |
| 846 | | PORT_DIPSETTING( 0x28, "300 Pts" ) |
| 847 | | PORT_DIPSETTING( 0x18, "350 Pts" ) |
| 848 | | PORT_DIPSETTING( 0x38, "400 Pts" ) |
| 849 | | PORT_DIPNAME( 0x40, 0x00, "Bonus Play" ) //? |
| 783 | PORT_DIPNAME( 0x38, 0x00, "Starting Points" ) PORT_DIPLOCATION("SW2:!4,!5,!6") |
| 784 | PORT_DIPSETTING( 0x00, "80 Pts" ) |
| 785 | PORT_DIPSETTING( 0x20, "100 Pts" ) |
| 786 | PORT_DIPSETTING( 0x10, "150 Pts" ) |
| 787 | PORT_DIPSETTING( 0x30, "200 Pts" ) |
| 788 | PORT_DIPSETTING( 0x08, "250 Pts" ) |
| 789 | PORT_DIPSETTING( 0x28, "300 Pts" ) |
| 790 | PORT_DIPSETTING( 0x18, "350 Pts" ) |
| 791 | PORT_DIPSETTING( 0x38, "400 Pts" ) |
| 792 | PORT_DIPNAME( 0x40, 0x00, "Bonus Play" ) PORT_DIPLOCATION("SW2:!7") |
| 850 | 793 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 851 | 794 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 852 | | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) |
| 795 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:!8") |
| 853 | 796 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 854 | 797 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 855 | 798 | INPUT_PORTS_END |
| r7972 | r7973 | |
| 859 | 802 | PORT_INCLUDE( vsnes_dual_rev ) |
| 860 | 803 | |
| 861 | 804 | PORT_START("DSW0") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 862 | | PORT_DIPNAME( 0x07, 0x00, "Coinage (Left Side)" ) |
| 805 | PORT_DIPNAME( 0x07, 0x00, "Coinage (Left Side)" ) PORT_DIPLOCATION("SW1:!1,!2,!3") |
| 863 | 806 | PORT_DIPSETTING( 0x03, DEF_STR( 4C_1C ) ) |
| 864 | 807 | PORT_DIPSETTING( 0x05, DEF_STR( 3C_1C ) ) |
| 865 | 808 | PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) |
| r7972 | r7973 | |
| 868 | 811 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) |
| 869 | 812 | PORT_DIPSETTING( 0x06, DEF_STR( 1C_4C ) ) |
| 870 | 813 | PORT_DIPSETTING( 0x07, DEF_STR( Free_Play ) ) |
| 871 | | PORT_DIPNAME( 0x18, 0x00, "Lives (Left Side)" ) |
| 814 | PORT_DIPNAME( 0x18, 0x00, "Lives (Left Side)" ) PORT_DIPLOCATION("SW1:!4,!5") |
| 872 | 815 | PORT_DIPSETTING( 0x00, "3" ) |
| 873 | 816 | PORT_DIPSETTING( 0x10, "4" ) |
| 874 | 817 | PORT_DIPSETTING( 0x08, "5" ) |
| 875 | 818 | PORT_DIPSETTING( 0x18, "7" ) |
| 876 | | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) |
| 819 | PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x00, "SW1:!6" ) |
| 820 | PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x00, "SW1:!7" ) |
| 821 | PORT_DIPNAME( 0x80, 0x00, "Service Mode (Left Side)" ) PORT_TOGGLE PORT_CODE(KEYCODE_F2) PORT_DIPLOCATION("SW1:!8") |
| 877 | 822 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 878 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 879 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) |
| 880 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 881 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 882 | | PORT_DIPNAME( 0x80, 0x00, "Service Mode (Left Side)" ) PORT_TOGGLE PORT_CODE(KEYCODE_F2) |
| 883 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 884 | 823 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 885 | 824 | |
| 886 | 825 | PORT_START("DSW1") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 887 | | PORT_DIPNAME( 0x07, 0x00, "Coinage (Right Side)" ) |
| 826 | PORT_DIPNAME( 0x07, 0x00, "Coinage (Right Side)" ) PORT_DIPLOCATION("SW2:!1,!2,!3") |
| 888 | 827 | PORT_DIPSETTING( 0x03, DEF_STR( 4C_1C ) ) |
| 889 | 828 | PORT_DIPSETTING( 0x05, DEF_STR( 3C_1C ) ) |
| 890 | 829 | PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) |
| r7972 | r7973 | |
| 893 | 832 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) |
| 894 | 833 | PORT_DIPSETTING( 0x06, DEF_STR( 1C_4C ) ) |
| 895 | 834 | PORT_DIPSETTING( 0x07, DEF_STR( Free_Play ) ) |
| 896 | | PORT_DIPNAME( 0x18, 0x00, "Lives (Right Side)" ) |
| 835 | PORT_DIPNAME( 0x18, 0x00, "Lives (Right Side)" ) PORT_DIPLOCATION("SW2:!4,!5") |
| 897 | 836 | PORT_DIPSETTING( 0x00, "3" ) |
| 898 | 837 | PORT_DIPSETTING( 0x10, "4" ) |
| 899 | 838 | PORT_DIPSETTING( 0x08, "5" ) |
| 900 | 839 | PORT_DIPSETTING( 0x18, "7" ) |
| 901 | | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) |
| 840 | PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x00, "SW2:!6" ) |
| 841 | PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x00, "SW2:!7" ) |
| 842 | PORT_DIPNAME( 0x80, 0x00, "Service Mode (Right Side)" ) PORT_TOGGLE PORT_CODE(KEYCODE_F1) PORT_DIPLOCATION("SW2:!8") |
| 902 | 843 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 903 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 904 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) |
| 905 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 906 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 907 | | PORT_DIPNAME( 0x80, 0x00, "Service Mode (Right Side)" ) PORT_TOGGLE PORT_CODE(KEYCODE_F1) |
| 908 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 909 | 844 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 910 | 845 | INPUT_PORTS_END |
| 911 | 846 | |
| r7972 | r7973 | |
| 913 | 848 | PORT_INCLUDE( vsnes_rev ) |
| 914 | 849 | |
| 915 | 850 | PORT_START("DSW0") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 916 | | PORT_DIPNAME( 0x03, 0x00, "Drop Rate Increases After" ) |
| 851 | PORT_DIPNAME( 0x03, 0x03, "Drop Rate Increases After" ) PORT_DIPLOCATION("SW1:!1,!2") |
| 917 | 852 | PORT_DIPSETTING( 0x00, "7 Pills" ) |
| 918 | 853 | PORT_DIPSETTING( 0x01, "8 Pills" ) |
| 919 | 854 | PORT_DIPSETTING( 0x02, "9 Pills" ) |
| 920 | 855 | PORT_DIPSETTING( 0x03, "10 Pills" ) |
| 921 | | PORT_DIPNAME( 0x0c, 0x00, "Virus Level" ) |
| 856 | PORT_DIPNAME( 0x0c, 0x04, "Virus Level" ) PORT_DIPLOCATION("SW1:!3,!4") |
| 922 | 857 | PORT_DIPSETTING( 0x00, "1" ) |
| 923 | 858 | PORT_DIPSETTING( 0x04, "3" ) |
| 924 | 859 | PORT_DIPSETTING( 0x08, "5" ) |
| 925 | 860 | PORT_DIPSETTING( 0x0c, "7" ) |
| 926 | | PORT_DIPNAME( 0x30, 0x00, "Drop Speed Up" ) |
| 861 | PORT_DIPNAME( 0x30, 0x00, "Drop Speed Up" ) PORT_DIPLOCATION("SW1:!5,!6") |
| 927 | 862 | PORT_DIPSETTING( 0x00, "Slow" ) |
| 928 | 863 | PORT_DIPSETTING( 0x10, DEF_STR( Medium ) ) |
| 929 | 864 | PORT_DIPSETTING( 0x20, "Fast" ) |
| 930 | 865 | PORT_DIPSETTING( 0x30, "Fastest" ) |
| 931 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Free_Play ) ) |
| 866 | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:!7") |
| 932 | 867 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 933 | 868 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 934 | | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) |
| 869 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:!8") |
| 935 | 870 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 936 | 871 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 937 | 872 | INPUT_PORTS_END |
| r7972 | r7973 | |
| 940 | 875 | PORT_INCLUDE( vsnes_rev ) |
| 941 | 876 | |
| 942 | 877 | PORT_START("DSW0") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 943 | | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) |
| 878 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!1,!2") |
| 944 | 879 | PORT_DIPSETTING( 0x03, DEF_STR( 3C_1C ) ) |
| 945 | 880 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) |
| 946 | 881 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) |
| 947 | 882 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) |
| 948 | | PORT_DIPNAME( 0x0c, 0x0c, "Max. 1p/in, 2p/in, Min" ) |
| 883 | PORT_DIPNAME( 0x0c, 0x0c, "1p/inn, 2p/inn, Time/Min" ) PORT_DIPLOCATION("SW1:!3,!4") |
| 949 | 884 | PORT_DIPSETTING( 0x04, "2, 1, 3" ) |
| 950 | 885 | PORT_DIPSETTING( 0x0c, "2, 2, 4" ) |
| 951 | 886 | PORT_DIPSETTING( 0x00, "3, 2, 6" ) |
| 952 | 887 | PORT_DIPSETTING( 0x08, "4, 3, 7" ) |
| 953 | | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Demo_Sounds ) ) |
| 888 | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:!5") |
| 954 | 889 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 955 | 890 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 956 | | PORT_DIPNAME( 0xe0, 0x00, "PPU Type" ) |
| 891 | PORT_DIPNAME( 0xe0, 0x00, "PPU Type" ) PORT_DIPLOCATION("SW1:!6,!7,!8") |
| 957 | 892 | PORT_DIPSETTING( 0x00, "RP2C04-0001" ) |
| 958 | 893 | PORT_DIPSETTING( 0x20, "RP2C03" ) |
| 959 | 894 | PORT_DIPSETTING( 0x40, "RP2C04-0002" ) |
| r7972 | r7973 | |
| 968 | 903 | PORT_INCLUDE( vsnes_rev ) |
| 969 | 904 | |
| 970 | 905 | PORT_START("DSW0") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 971 | | PORT_DIPNAME( 0x01, 0x01, "Credits for 2 Players" ) |
| 906 | PORT_DIPNAME( 0x01, 0x01, "Credits for 2 Players" ) PORT_DIPLOCATION("SW1:!1") |
| 972 | 907 | PORT_DIPSETTING( 0x00, "1" ) |
| 973 | 908 | PORT_DIPSETTING( 0x01, "2" ) |
| 974 | | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Lives ) ) |
| 909 | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:!2") |
| 975 | 910 | PORT_DIPSETTING( 0x00, "3" ) |
| 976 | 911 | PORT_DIPSETTING( 0x02, "5" ) |
| 977 | | PORT_DIPNAME( 0x04, 0x00, DEF_STR( Demo_Sounds ) ) |
| 912 | PORT_DIPNAME( 0x04, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:!3") |
| 978 | 913 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 979 | 914 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 980 | | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) |
| 981 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 982 | | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 983 | | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) |
| 984 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 985 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 986 | | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) |
| 987 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 988 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 989 | | PORT_DIPNAME( 0xc0, 0x00, "PPU Type" ) |
| 915 | PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "SW1:!4" ) |
| 916 | PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x00, "SW1:!5" ) |
| 917 | PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x00, "SW1:!6" ) |
| 918 | PORT_DIPNAME( 0xc0, 0x00, "PPU Type" ) PORT_DIPLOCATION("SW1:!7,!8") |
| 990 | 919 | PORT_DIPSETTING( 0x00, "RP2C04-0001" ) |
| 991 | 920 | PORT_DIPSETTING( 0x40, "RP2C04-0002" ) |
| 992 | 921 | PORT_DIPSETTING( 0x80, "RP2C04-0003" ) |
| r7972 | r7973 | |
| 997 | 926 | PORT_INCLUDE( vsnes_rev ) |
| 998 | 927 | |
| 999 | 928 | PORT_START("DSW0") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 1000 | | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) |
| 929 | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!1,!2,!3") |
| 1001 | 930 | PORT_DIPSETTING( 0x03, DEF_STR( 4C_1C ) ) |
| 1002 | 931 | PORT_DIPSETTING( 0x05, DEF_STR( 3C_1C ) ) |
| 1003 | 932 | PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) |
| r7972 | r7973 | |
| 1006 | 935 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) |
| 1007 | 936 | PORT_DIPSETTING( 0x06, DEF_STR( 1C_4C ) ) |
| 1008 | 937 | PORT_DIPSETTING( 0x07, DEF_STR( Free_Play ) ) |
| 1009 | | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) |
| 1010 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1011 | | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 1012 | | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) |
| 1013 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1014 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 1015 | | PORT_DIPNAME( 0x60, 0x00, DEF_STR( Lives ) ) |
| 938 | PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "SW1:!4" ) |
| 939 | PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x00, "SW1:!5" ) |
| 940 | PORT_DIPNAME( 0x60, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:!6,!7") |
| 1016 | 941 | PORT_DIPSETTING( 0x60, "2" ) |
| 1017 | 942 | PORT_DIPSETTING( 0x00, "3" ) |
| 1018 | 943 | PORT_DIPSETTING( 0x40, "4" ) |
| 1019 | 944 | PORT_DIPSETTING( 0x20, "5" ) |
| 1020 | | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) |
| 1021 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1022 | | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 945 | PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x00, "SW1:!8" ) |
| 1023 | 946 | INPUT_PORTS_END |
| 1024 | 947 | |
| 1025 | 948 | static INPUT_PORTS_START( cstlevna ) |
| 1026 | 949 | PORT_INCLUDE( vsnes ) |
| 1027 | 950 | |
| 1028 | 951 | PORT_START("DSW0") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 1029 | | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) |
| 952 | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!1,!2,!3") |
| 1030 | 953 | PORT_DIPSETTING( 0x03, DEF_STR( 5C_1C ) ) |
| 1031 | 954 | PORT_DIPSETTING( 0x05, DEF_STR( 4C_1C ) ) |
| 1032 | 955 | PORT_DIPSETTING( 0x01, DEF_STR( 3C_1C ) ) |
| r7972 | r7973 | |
| 1035 | 958 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) ) |
| 1036 | 959 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) |
| 1037 | 960 | PORT_DIPSETTING( 0x07, DEF_STR( Free_Play ) ) |
| 1038 | | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Lives ) ) |
| 961 | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:!4") |
| 1039 | 962 | PORT_DIPSETTING( 0x08, "2" ) |
| 1040 | 963 | PORT_DIPSETTING( 0x00, "3" ) |
| 1041 | | PORT_DIPNAME( 0x30, 0x00, "Bonus" ) |
| 1042 | | PORT_DIPSETTING( 0x00, "100k" ) |
| 1043 | | PORT_DIPSETTING( 0x20, "200k" ) |
| 1044 | | PORT_DIPSETTING( 0x10, "300k" ) |
| 1045 | | PORT_DIPSETTING( 0x30, "400k" ) |
| 1046 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Difficulty ) ) // Damage taken |
| 1047 | | PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) // Normal |
| 1048 | | PORT_DIPSETTING( 0x40, DEF_STR( Hard ) ) // Double |
| 1049 | | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unused ) ) |
| 1050 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1051 | | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 964 | /* As near as I can tell, there is no adjustable bonus level where the manual states there should be (SW1:5,6). |
| 965 | The bonus lives, regardless of settings, are at 30000 and every 50000 thereafter. Until someone can figure out |
| 966 | what these dips do - they will be kept UNKNOWN */ |
| 967 | PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x00, "SW1:!5" ) |
| 968 | PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x00, "SW1:!6" ) |
| 969 | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:!7") // Damage taken |
| 970 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) // Normal |
| 971 | PORT_DIPSETTING( 0x40, DEF_STR( Hard ) ) // Double |
| 972 | PORT_DIPUNUSED_DIPLOC( 0x80, 0x00, "SW1:!8" ) // Manual states "Must be Set to "OFF" |
| 1052 | 973 | INPUT_PORTS_END |
| 1053 | 974 | |
| 1054 | 975 | static INPUT_PORTS_START( iceclimb ) |
| 1055 | 976 | PORT_INCLUDE( vsnes_rev ) |
| 1056 | 977 | |
| 1057 | 978 | PORT_START("DSW0") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 1058 | | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) |
| 979 | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!1,!2,!3") |
| 1059 | 980 | PORT_DIPSETTING( 0x03, DEF_STR( 4C_1C ) ) |
| 1060 | 981 | PORT_DIPSETTING( 0x05, DEF_STR( 3C_1C ) ) |
| 1061 | 982 | PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) |
| r7972 | r7973 | |
| 1064 | 985 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) |
| 1065 | 986 | PORT_DIPSETTING( 0x06, DEF_STR( 1C_4C ) ) |
| 1066 | 987 | PORT_DIPSETTING( 0x07, DEF_STR( Free_Play ) ) |
| 1067 | | PORT_DIPNAME( 0x18, 0x00, DEF_STR( Lives ) ) |
| 988 | PORT_DIPNAME( 0x18, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:!4,!5") |
| 1068 | 989 | PORT_DIPSETTING( 0x00, "3" ) |
| 1069 | 990 | PORT_DIPSETTING( 0x10, "4" ) |
| 1070 | 991 | PORT_DIPSETTING( 0x08, "5" ) |
| 1071 | 992 | PORT_DIPSETTING( 0x18, "7" ) |
| 1072 | | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Difficulty ) ) |
| 1073 | | PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) |
| 993 | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:!6") |
| 994 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) |
| 1074 | 995 | PORT_DIPSETTING( 0x20, DEF_STR( Hard ) ) |
| 1075 | | PORT_DIPNAME( 0x40, 0x00, "Time before bear appears" ) //? |
| 996 | PORT_DIPNAME( 0x40, 0x00, "Time before bear appears" ) PORT_DIPLOCATION("SW1:!7") |
| 1076 | 997 | PORT_DIPSETTING( 0x00, "Long" ) |
| 1077 | 998 | PORT_DIPSETTING( 0x40, "Short" ) |
| 1078 | | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unused ) ) |
| 1079 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1080 | | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 999 | PORT_DIPUNUSED_DIPLOC( 0x80, 0x00, "SW1:!8" ) |
| 1081 | 1000 | INPUT_PORTS_END |
| 1082 | 1001 | |
| 1083 | 1002 | /* Same as 'iceclimb', but different buttons mapping and input protection */ |
| r7972 | r7973 | |
| 1085 | 1004 | PORT_INCLUDE( iceclimb ) |
| 1086 | 1005 | |
| 1087 | 1006 | PORT_MODIFY("IN0") /* IN0 */ |
| 1088 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SPECIAL ) // protection /* START on a nes */ |
| 1007 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SPECIAL ) // protection /* START on a nes */ |
| 1089 | 1008 | |
| 1090 | 1009 | PORT_MODIFY("IN1") /* IN1 */ |
| 1091 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SPECIAL ) // protection /* START on a nes */ |
| 1010 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SPECIAL ) // protection /* START on a nes */ |
| 1092 | 1011 | |
| 1093 | 1012 | PORT_MODIFY("COINS") /* IN2 */ |
| 1094 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) /* service credit? */ |
| 1013 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) /* service credit? */ |
| 1095 | 1014 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 1096 | 1015 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 ) |
| 1097 | 1016 | INPUT_PORTS_END |
| r7972 | r7973 | |
| 1100 | 1019 | PORT_INCLUDE( vsnes ) |
| 1101 | 1020 | |
| 1102 | 1021 | PORT_START("DSW0") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 1103 | | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) |
| 1022 | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!1,!2,!3") |
| 1104 | 1023 | PORT_DIPSETTING( 0x03, DEF_STR( 4C_1C ) ) |
| 1105 | 1024 | PORT_DIPSETTING( 0x05, DEF_STR( 3C_1C ) ) |
| 1106 | 1025 | PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) |
| r7972 | r7973 | |
| 1109 | 1028 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) |
| 1110 | 1029 | PORT_DIPSETTING( 0x06, DEF_STR( 1C_4C ) ) |
| 1111 | 1030 | PORT_DIPSETTING( 0x07, DEF_STR( Free_Play ) ) |
| 1112 | | PORT_DIPNAME( 0x18, 0x00, "Bonus" ) |
| 1031 | PORT_DIPNAME( 0x18, 0x00, "Bonus Bike" ) PORT_DIPLOCATION("SW1:!4,!5") |
| 1113 | 1032 | PORT_DIPSETTING( 0x00, "100k and Every 50k" ) |
| 1114 | 1033 | PORT_DIPSETTING( 0x10, "Every 100k" ) |
| 1115 | 1034 | PORT_DIPSETTING( 0x08, "100k Only" ) |
| 1116 | 1035 | PORT_DIPSETTING( 0x18, DEF_STR( None ) ) |
| 1117 | | PORT_DIPNAME( 0x20, 0x00, "1st Half Qualifying Time" ) |
| 1118 | | PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) |
| 1036 | PORT_DIPNAME( 0x20, 0x00, "1st Half Qualifying Time" ) PORT_DIPLOCATION("SW1:!6") |
| 1037 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) |
| 1119 | 1038 | PORT_DIPSETTING( 0x20, DEF_STR( Hard ) ) |
| 1120 | | PORT_DIPNAME( 0x40, 0x00, "2nd Half Qualifying Time" ) |
| 1121 | | PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) |
| 1039 | PORT_DIPNAME( 0x40, 0x00, "2nd Half Qualifying Time" ) PORT_DIPLOCATION("SW1:!7") |
| 1040 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) |
| 1122 | 1041 | PORT_DIPSETTING( 0x40, DEF_STR( Hard ) ) |
| 1123 | | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unused ) ) |
| 1124 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1125 | | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 1042 | PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x00, "SW1:!8" ) |
| 1126 | 1043 | INPUT_PORTS_END |
| 1127 | 1044 | |
| 1128 | 1045 | static INPUT_PORTS_START( jajamaru ) |
| 1129 | 1046 | PORT_INCLUDE( vsnes_rev ) |
| 1130 | 1047 | |
| 1131 | 1048 | PORT_MODIFY("IN0") /* IN0 */ |
| 1132 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 ) /* START on a nes */ |
| 1049 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 ) /* START on a nes */ |
| 1133 | 1050 | |
| 1134 | 1051 | PORT_MODIFY("IN1") /* IN1 */ |
| 1135 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* SELECT on a nes */ |
| 1052 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* SELECT on a nes */ |
| 1136 | 1053 | |
| 1137 | 1054 | PORT_MODIFY("COINS") /* IN2 */ |
| 1138 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) /* service credit? */ |
| 1055 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) /* service credit? */ |
| 1139 | 1056 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 1140 | 1057 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 1141 | 1058 | |
| 1142 | 1059 | PORT_START("DSW0") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 1143 | | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) |
| 1060 | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!1,!2,!3") |
| 1144 | 1061 | PORT_DIPSETTING( 0x03, DEF_STR( 4C_1C ) ) |
| 1145 | 1062 | PORT_DIPSETTING( 0x05, DEF_STR( 3C_1C ) ) |
| 1146 | 1063 | PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) |
| r7972 | r7973 | |
| 1149 | 1066 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) |
| 1150 | 1067 | PORT_DIPSETTING( 0x06, DEF_STR( 1C_4C ) ) |
| 1151 | 1068 | PORT_DIPSETTING( 0x07, DEF_STR( Free_Play ) ) |
| 1152 | | PORT_DIPNAME( 0x18, 0x00, DEF_STR( Lives ) ) |
| 1069 | PORT_DIPNAME( 0x18, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:!4,!5") |
| 1153 | 1070 | PORT_DIPSETTING( 0x00, "3" ) |
| 1154 | 1071 | PORT_DIPSETTING( 0x10, "4" ) |
| 1155 | 1072 | PORT_DIPSETTING( 0x08, "5" ) |
| 1156 | | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) |
| 1073 | PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x00, "SW1:!6" ) |
| 1074 | PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x00, "SW1:!7" ) |
| 1075 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:!8") |
| 1157 | 1076 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1158 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 1159 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) |
| 1160 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1161 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 1162 | | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) |
| 1163 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1164 | 1077 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 1165 | 1078 | INPUT_PORTS_END |
| 1166 | 1079 | |
| r7972 | r7973 | |
| 1168 | 1081 | PORT_INCLUDE( vsnes ) |
| 1169 | 1082 | |
| 1170 | 1083 | PORT_START("DSW0") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 1171 | | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) |
| 1084 | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!1,!2,!3") |
| 1172 | 1085 | PORT_DIPSETTING( 0x03, DEF_STR( 4C_1C ) ) |
| 1173 | 1086 | PORT_DIPSETTING( 0x05, DEF_STR( 3C_1C ) ) |
| 1174 | 1087 | PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) |
| r7972 | r7973 | |
| 1177 | 1090 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) |
| 1178 | 1091 | PORT_DIPSETTING( 0x06, DEF_STR( 1C_4C ) ) |
| 1179 | 1092 | PORT_DIPSETTING( 0x07, DEF_STR( Free_Play ) ) |
| 1180 | | PORT_DIPNAME( 0x18, 0x00, "Time" ) |
| 1181 | | PORT_DIPSETTING( 0x00, "280" ) |
| 1093 | PORT_DIPNAME( 0x18, 0x00, "Time" ) PORT_DIPLOCATION("SW1:!4,!5") |
| 1094 | PORT_DIPSETTING( 0x00, "280 (Easy)" ) |
| 1182 | 1095 | PORT_DIPSETTING( 0x10, "250" ) |
| 1183 | 1096 | PORT_DIPSETTING( 0x08, "220" ) |
| 1184 | | PORT_DIPSETTING( 0x18, "200" ) |
| 1185 | | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) |
| 1186 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1187 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 1188 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) |
| 1189 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1190 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 1191 | | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) |
| 1192 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1193 | | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 1097 | PORT_DIPSETTING( 0x18, "200 (Hard)" ) |
| 1098 | PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x00, "SW1:!6" ) |
| 1099 | PORT_DIPNAME( 0x40, 0x00, "Enemies" ) PORT_DIPLOCATION("SW1:!7") |
| 1100 | PORT_DIPSETTING( 0x40, "More" ) |
| 1101 | PORT_DIPSETTING( 0x00, "Less" ) |
| 1102 | PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x00, "SW1:!8" ) |
| 1194 | 1103 | INPUT_PORTS_END |
| 1195 | 1104 | |
| 1196 | 1105 | static INPUT_PORTS_START( machridj ) |
| 1197 | 1106 | PORT_INCLUDE( vsnes ) |
| 1198 | 1107 | |
| 1199 | 1108 | PORT_MODIFY("IN0") /* IN0 */ |
| 1200 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 ) /* SELECT on a nes */ |
| 1201 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) /* START on a nes */ |
| 1109 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 ) /* SELECT on a nes */ |
| 1110 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) /* START on a nes */ |
| 1202 | 1111 | |
| 1203 | 1112 | PORT_MODIFY("IN1") /* IN1 */ |
| 1204 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) /* SELECT on a nes */ |
| 1205 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) /* START on a nes */ |
| 1113 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) /* SELECT on a nes */ |
| 1114 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) /* START on a nes */ |
| 1206 | 1115 | |
| 1207 | 1116 | PORT_MODIFY("COINS") /* IN2 */ |
| 1208 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) /* service credit? */ |
| 1117 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) /* service credit? */ |
| 1209 | 1118 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 1210 | 1119 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 ) |
| 1211 | 1120 | |
| 1212 | 1121 | PORT_START("DSW0") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 1213 | | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) |
| 1122 | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!1,!2,!3") |
| 1214 | 1123 | PORT_DIPSETTING( 0x03, DEF_STR( 4C_1C ) ) |
| 1215 | 1124 | PORT_DIPSETTING( 0x05, DEF_STR( 3C_1C ) ) |
| 1216 | 1125 | PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) |
| r7972 | r7973 | |
| 1219 | 1128 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) |
| 1220 | 1129 | PORT_DIPSETTING( 0x06, DEF_STR( 1C_4C ) ) |
| 1221 | 1130 | PORT_DIPSETTING( 0x07, DEF_STR( Free_Play ) ) |
| 1222 | | PORT_DIPNAME( 0x18, 0x00, "Km 1st Race" ) //? |
| 1223 | | PORT_DIPSETTING( 0x00, "12" ) |
| 1224 | | PORT_DIPSETTING( 0x10, "15" ) |
| 1225 | | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) |
| 1226 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1227 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 1228 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) |
| 1229 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1230 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 1231 | | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) |
| 1232 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1233 | | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 1131 | PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "SW1:!4" ) |
| 1132 | PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x00, "SW1:!5" ) |
| 1133 | PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x00, "SW1:!6" ) |
| 1134 | PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x00, "SW1:!7" ) |
| 1135 | PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x00, "SW1:!8" ) |
| 1234 | 1136 | INPUT_PORTS_END |
| 1235 | 1137 | |
| 1236 | 1138 | static INPUT_PORTS_START( suprmrio ) |
| 1237 | 1139 | PORT_INCLUDE( vsnes ) |
| 1238 | 1140 | |
| 1239 | 1141 | PORT_START("DSW0") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 1240 | | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) |
| 1142 | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!1,!2,!3") |
| 1241 | 1143 | PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) ) |
| 1242 | 1144 | PORT_DIPSETTING( 0x04, DEF_STR( 2C_1C ) ) |
| 1243 | 1145 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) |
| r7972 | r7973 | |
| 1246 | 1148 | PORT_DIPSETTING( 0x05, DEF_STR( 1C_4C ) ) |
| 1247 | 1149 | PORT_DIPSETTING( 0x03, DEF_STR( 1C_5C ) ) |
| 1248 | 1150 | PORT_DIPSETTING( 0x07, DEF_STR( Free_Play ) ) |
| 1249 | | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Lives ) ) |
| 1151 | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:!4") |
| 1250 | 1152 | PORT_DIPSETTING( 0x08, "2" ) |
| 1251 | 1153 | PORT_DIPSETTING( 0x00, "3" ) |
| 1252 | | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Bonus_Life ) ) |
| 1253 | | PORT_DIPSETTING( 0x00, "100" ) |
| 1254 | | PORT_DIPSETTING( 0x20, "150" ) |
| 1255 | | PORT_DIPSETTING( 0x10, "200" ) |
| 1256 | | PORT_DIPSETTING( 0x30, "250" ) |
| 1257 | | PORT_DIPNAME( 0x40, 0x00, "Timer" ) |
| 1258 | | PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) |
| 1154 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:!5,!6") |
| 1155 | PORT_DIPSETTING( 0x00, "100 Coins" ) |
| 1156 | PORT_DIPSETTING( 0x20, "150 Coins" ) |
| 1157 | PORT_DIPSETTING( 0x10, "200 Coins" ) |
| 1158 | PORT_DIPSETTING( 0x30, "250 Coins" ) |
| 1159 | PORT_DIPNAME( 0x40, 0x00, "Timer" ) PORT_DIPLOCATION("SW1:!7") |
| 1160 | PORT_DIPSETTING( 0x00, "Slow" ) |
| 1259 | 1161 | PORT_DIPSETTING( 0x40, "Fast" ) |
| 1260 | | PORT_DIPNAME( 0x80, 0x80, "Continue Lives" ) |
| 1162 | PORT_DIPNAME( 0x80, 0x80, "Continue Lives" ) PORT_DIPLOCATION("SW1:!8") |
| 1261 | 1163 | PORT_DIPSETTING( 0x80, "3" ) |
| 1262 | 1164 | PORT_DIPSETTING( 0x00, "4" ) |
| 1263 | 1165 | INPUT_PORTS_END |
| r7972 | r7973 | |
| 1266 | 1168 | PORT_INCLUDE( vsnes_zapper ) |
| 1267 | 1169 | |
| 1268 | 1170 | PORT_START("DSW0") /* IN3 */ |
| 1269 | | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) |
| 1171 | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!1,!2,!3") |
| 1270 | 1172 | PORT_DIPSETTING( 0x03, DEF_STR( 5C_1C ) ) |
| 1271 | 1173 | PORT_DIPSETTING( 0x05, DEF_STR( 4C_1C ) ) |
| 1272 | 1174 | PORT_DIPSETTING( 0x01, DEF_STR( 3C_1C ) ) |
| r7972 | r7973 | |
| 1275 | 1177 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) ) |
| 1276 | 1178 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) |
| 1277 | 1179 | PORT_DIPSETTING( 0x07, DEF_STR( Free_Play ) ) |
| 1278 | | PORT_DIPNAME( 0x18, 0x08, DEF_STR( Difficulty ) ) |
| 1180 | PORT_DIPNAME( 0x18, 0x08, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:!4,!5") |
| 1279 | 1181 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) |
| 1280 | 1182 | PORT_DIPSETTING( 0x08, DEF_STR( Normal ) ) |
| 1281 | | PORT_DIPSETTING( 0x10, DEF_STR( Hard ) ) |
| 1282 | | PORT_DIPSETTING( 0x18, DEF_STR( Hardest ) ) |
| 1283 | | PORT_DIPNAME( 0x20, 0x20, "Misses per game" ) |
| 1183 | PORT_DIPSETTING( 0x10, DEF_STR( Medium ) ) |
| 1184 | PORT_DIPSETTING( 0x18, DEF_STR( Hard ) ) |
| 1185 | PORT_DIPNAME( 0x20, 0x20, "Misses per game" ) PORT_DIPLOCATION("SW1:!6") |
| 1284 | 1186 | PORT_DIPSETTING( 0x00, "3" ) |
| 1285 | 1187 | PORT_DIPSETTING( 0x20, "5" ) |
| 1286 | | PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Bonus_Life ) ) |
| 1188 | PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:!7,!8") |
| 1287 | 1189 | PORT_DIPSETTING( 0x00, "30000" ) |
| 1288 | 1190 | PORT_DIPSETTING( 0x40, "50000" ) |
| 1289 | 1191 | PORT_DIPSETTING( 0x80, "80000" ) |
| r7972 | r7973 | |
| 1294 | 1196 | PORT_INCLUDE( vsnes_zapper ) |
| 1295 | 1197 | |
| 1296 | 1198 | PORT_START("DSW0") /* IN3 */ |
| 1297 | | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) |
| 1199 | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!1,!2,!3") |
| 1298 | 1200 | PORT_DIPSETTING( 0x03, DEF_STR( 5C_1C ) ) |
| 1299 | 1201 | PORT_DIPSETTING( 0x05, DEF_STR( 4C_1C ) ) |
| 1300 | 1202 | PORT_DIPSETTING( 0x01, DEF_STR( 3C_1C ) ) |
| r7972 | r7973 | |
| 1303 | 1205 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) ) |
| 1304 | 1206 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) |
| 1305 | 1207 | PORT_DIPSETTING( 0x07, DEF_STR( Free_Play ) ) |
| 1306 | | PORT_DIPNAME( 0x18, 0x08, DEF_STR( Difficulty ) ) |
| 1208 | PORT_DIPNAME( 0x18, 0x08, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:!4,!5") |
| 1307 | 1209 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) |
| 1308 | 1210 | PORT_DIPSETTING( 0x08, DEF_STR( Normal ) ) |
| 1309 | | PORT_DIPSETTING( 0x10, DEF_STR( Hard ) ) |
| 1310 | | PORT_DIPSETTING( 0x18, DEF_STR( Hardest ) ) |
| 1311 | | PORT_DIPNAME( 0x20, 0x20, "Misses per game" ) |
| 1211 | PORT_DIPSETTING( 0x10, DEF_STR( Medium ) ) |
| 1212 | PORT_DIPSETTING( 0x18, DEF_STR( Hard ) ) |
| 1213 | PORT_DIPNAME( 0x20, 0x20, "Misses per game" ) PORT_DIPLOCATION("SW1:!6") |
| 1312 | 1214 | PORT_DIPSETTING( 0x00, "3" ) |
| 1313 | 1215 | PORT_DIPSETTING( 0x20, "5" ) |
| 1314 | | PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Bonus_Life ) ) |
| 1216 | PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:!7,!8") |
| 1315 | 1217 | PORT_DIPSETTING( 0x00, "30000" ) |
| 1316 | 1218 | PORT_DIPSETTING( 0x40, "50000" ) |
| 1317 | 1219 | PORT_DIPSETTING( 0x80, "80000" ) |
| r7972 | r7973 | |
| 1322 | 1224 | PORT_INCLUDE( vsnes_zapper ) |
| 1323 | 1225 | |
| 1324 | 1226 | PORT_START("DSW0") /* IN3 */ |
| 1325 | | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) |
| 1227 | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!1,!2,!3") |
| 1326 | 1228 | PORT_DIPSETTING( 0x03, DEF_STR( 5C_1C ) ) |
| 1327 | 1229 | PORT_DIPSETTING( 0x05, DEF_STR( 4C_1C ) ) |
| 1328 | 1230 | PORT_DIPSETTING( 0x01, DEF_STR( 3C_1C ) ) |
| r7972 | r7973 | |
| 1331 | 1233 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) ) |
| 1332 | 1234 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) |
| 1333 | 1235 | PORT_DIPSETTING( 0x07, DEF_STR( Free_Play ) ) |
| 1334 | | PORT_DIPNAME( 0x18, 0x08, DEF_STR( Difficulty ) ) |
| 1236 | PORT_DIPNAME( 0x18, 0x08, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:!4,!5") |
| 1335 | 1237 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) |
| 1336 | 1238 | PORT_DIPSETTING( 0x08, DEF_STR( Normal ) ) |
| 1337 | 1239 | PORT_DIPSETTING( 0x10, DEF_STR( Hard ) ) |
| 1338 | 1240 | PORT_DIPSETTING( 0x18, DEF_STR( Hardest ) ) |
| 1339 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Lives ) ) |
| 1241 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:!6") |
| 1340 | 1242 | PORT_DIPSETTING( 0x20, "3" ) |
| 1341 | 1243 | PORT_DIPSETTING( 0x00, "5" ) |
| 1342 | | PORT_DIPNAME( 0x40, 0x00, "Bullets per Balloon" ) |
| 1244 | PORT_DIPNAME( 0x40, 0x00, "Bullets per Balloon" ) PORT_DIPLOCATION("SW1:!7") |
| 1343 | 1245 | PORT_DIPSETTING( 0x00, "3" ) |
| 1344 | 1246 | PORT_DIPSETTING( 0x40, "2" ) |
| 1345 | | PORT_DIPNAME( 0x80, 0x00, "1 Bonus Man Awarded at 50k" ) |
| 1346 | | PORT_DIPSETTING( 0x00, "80000" ) |
| 1347 | | PORT_DIPSETTING( 0x80, "100000" ) |
| 1247 | PORT_DIPNAME( 0x80, 0x00, "Bonus Man Awarded" ) PORT_DIPLOCATION("SW1:!8") |
| 1248 | PORT_DIPSETTING( 0x00, "At 50000" ) |
| 1249 | PORT_DIPSETTING( 0x80, DEF_STR( None ) ) |
| 1348 | 1250 | INPUT_PORTS_END |
| 1349 | 1251 | |
| 1350 | 1252 | static INPUT_PORTS_START( vsfdf ) |
| 1351 | 1253 | PORT_INCLUDE( vsnes_zapper ) |
| 1352 | 1254 | |
| 1353 | 1255 | PORT_START("DSW0") /* IN3 */ |
| 1354 | | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) |
| 1256 | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!1,!2,!3") |
| 1355 | 1257 | PORT_DIPSETTING( 0x03, DEF_STR( 5C_1C ) ) |
| 1356 | 1258 | PORT_DIPSETTING( 0x05, DEF_STR( 4C_1C ) ) |
| 1357 | 1259 | PORT_DIPSETTING( 0x01, DEF_STR( 3C_1C ) ) |
| r7972 | r7973 | |
| 1360 | 1262 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) ) |
| 1361 | 1263 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) |
| 1362 | 1264 | PORT_DIPSETTING( 0x07, DEF_STR( Free_Play ) ) |
| 1363 | | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) |
| 1364 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1365 | | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 1366 | | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) |
| 1367 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1368 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 1369 | | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) |
| 1370 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1371 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 1372 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) |
| 1373 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1374 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 1375 | | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) |
| 1376 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1377 | | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 1265 | PORT_DIPNAME( 0x18, 0x10, "Health Awarded At" ) PORT_DIPLOCATION("SW1:!4,!5") |
| 1266 | PORT_DIPSETTING( 0x00, "20k/60k" ) |
| 1267 | PORT_DIPSETTING( 0x08, "20k/60k/Every 60k" ) |
| 1268 | PORT_DIPSETTING( 0x10, "10k/50k") |
| 1269 | PORT_DIPSETTING( 0x18, "10k/50k/Every 50k" ) |
| 1270 | PORT_DIPNAME( 0x60, 0x00, "Difficulty (Damage)" ) PORT_DIPLOCATION("SW1:!6,!7") |
| 1271 | PORT_DIPSETTING( 0x40, DEF_STR( Easy ) ) |
| 1272 | PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) |
| 1273 | PORT_DIPSETTING( 0x20, DEF_STR( Hard ) ) |
| 1274 | PORT_DIPSETTING( 0x60, DEF_STR( Hardest) ) |
| 1275 | PORT_DIPNAME( 0x80, 0x00, "Difficulty (Enemy)" ) PORT_DIPLOCATION("SW1:!8") |
| 1276 | PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) |
| 1277 | PORT_DIPSETTING( 0x80, DEF_STR( Hard ) ) |
| 1378 | 1278 | INPUT_PORTS_END |
| 1379 | 1279 | |
| 1380 | 1280 | static INPUT_PORTS_START( vstetris ) |
| 1381 | 1281 | PORT_INCLUDE( vsnes_rev ) |
| 1382 | 1282 | |
| 1383 | 1283 | PORT_START("DSW0") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 1384 | | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) ) |
| 1385 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1386 | | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 1387 | | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) |
| 1388 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1389 | | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 1390 | | PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Difficulty ) ) |
| 1284 | PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x00, "SW1:!1" ) |
| 1285 | PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x00, "SW1:!2" ) |
| 1286 | PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:!3,!4") |
| 1391 | 1287 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) |
| 1392 | 1288 | PORT_DIPSETTING( 0x04, DEF_STR( Normal ) ) |
| 1393 | | PORT_DIPSETTING( 0x08, DEF_STR( Hard ) ) |
| 1394 | | PORT_DIPSETTING( 0x0c, DEF_STR( Very_Hard ) ) |
| 1395 | | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) |
| 1396 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1397 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 1398 | | PORT_DIPNAME( 0xe0, 0x00, "PPU Type" ) |
| 1289 | PORT_DIPSETTING( 0x08, DEF_STR( Medium ) ) |
| 1290 | PORT_DIPSETTING( 0x0c, DEF_STR( Hard ) ) |
| 1291 | PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x00, "SW1:!5" ) |
| 1292 | PORT_DIPNAME( 0xe0, 0x00, "PPU Type" ) PORT_DIPLOCATION("SW1:!6,!7,!8") |
| 1399 | 1293 | PORT_DIPSETTING( 0x00, "RP2C04-0001" ) |
| 1400 | 1294 | PORT_DIPSETTING( 0x20, "RP2C03" ) |
| 1401 | 1295 | PORT_DIPSETTING( 0x40, "RP2C04-0002" ) |
| r7972 | r7973 | |
| 1411 | 1305 | PORT_INCLUDE( vsnes_rev ) |
| 1412 | 1306 | |
| 1413 | 1307 | PORT_MODIFY("IN0") |
| 1414 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START2 ) /* START on a nes */ |
| 1308 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START2 ) /* START on a nes */ |
| 1415 | 1309 | |
| 1416 | 1310 | PORT_MODIFY("IN1") |
| 1417 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* SELECT on a nes */ |
| 1311 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* SELECT on a nes */ |
| 1418 | 1312 | |
| 1419 | 1313 | PORT_START("DSW0") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 1420 | | PORT_DIPNAME( 0x03, 0x01, DEF_STR( Difficulty ) ) |
| 1314 | PORT_DIPNAME( 0x03, 0x01, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:!1,!2") |
| 1421 | 1315 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) |
| 1422 | 1316 | PORT_DIPSETTING( 0x01, DEF_STR( Normal ) ) |
| 1423 | 1317 | PORT_DIPSETTING( 0x02, DEF_STR( Medium ) ) |
| 1424 | 1318 | PORT_DIPSETTING( 0x03, DEF_STR( Hard ) ) |
| 1425 | | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Lives ) ) |
| 1319 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:!3") |
| 1426 | 1320 | PORT_DIPSETTING( 0x00, "2" ) |
| 1427 | 1321 | PORT_DIPSETTING( 0x04, "3" ) |
| 1428 | | PORT_DIPNAME( 0x18, 0x00, DEF_STR( Coinage ) ) |
| 1322 | PORT_DIPNAME( 0x18, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!4,!5") |
| 1429 | 1323 | PORT_DIPSETTING( 0x18, DEF_STR( 3C_1C ) ) |
| 1430 | 1324 | PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) |
| 1431 | 1325 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) |
| 1432 | 1326 | PORT_DIPSETTING( 0x08, DEF_STR( 1C_2C ) ) |
| 1433 | | PORT_DIPNAME( 0xe0, 0x00, "PPU Type" ) |
| 1327 | PORT_DIPNAME( 0xe0, 0x00, "PPU Type" ) PORT_DIPLOCATION("SW1:!6,!7,!8") |
| 1434 | 1328 | PORT_DIPSETTING( 0x00, "RP2C04-0001" ) |
| 1435 | 1329 | PORT_DIPSETTING( 0x20, "RP2C03" ) |
| 1436 | 1330 | PORT_DIPSETTING( 0x40, "RP2C04-0002" ) |
| r7972 | r7973 | |
| 1446 | 1340 | |
| 1447 | 1341 | PORT_START("DSW0") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 1448 | 1342 | PORT_DIPNAME( 0x07, 0x01, DEF_STR( Coinage ) ) |
| 1449 | | PORT_DIPSETTING( 0x07, DEF_STR( 4C_1C ) ) |
| 1343 | PORT_DIPSETTING( 0x07, DEF_STR( 4C_1C ) ) PORT_DIPLOCATION("SW1:!1,!2,!3") |
| 1450 | 1344 | PORT_DIPSETTING( 0x03, DEF_STR( 3C_1C ) ) |
| 1451 | 1345 | PORT_DIPSETTING( 0x05, DEF_STR( 2C_1C ) ) |
| 1452 | 1346 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_1C ) ) |
| r7972 | r7973 | |
| 1454 | 1348 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) |
| 1455 | 1349 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ) ) |
| 1456 | 1350 | PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) |
| 1457 | | PORT_DIPNAME( 0x08, 0x00, "Side Drain Walls" ) |
| 1351 | PORT_DIPNAME( 0x08, 0x00, "Side Drain Walls" ) PORT_DIPLOCATION("SW1:!4") |
| 1458 | 1352 | PORT_DIPSETTING( 0x00, DEF_STR( High ) ) |
| 1459 | 1353 | PORT_DIPSETTING( 0x08, DEF_STR( Low ) ) |
| 1460 | | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Bonus_Life ) ) |
| 1354 | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:!5") |
| 1461 | 1355 | PORT_DIPSETTING( 0x00, "50000" ) |
| 1462 | 1356 | PORT_DIPSETTING( 0x10, "70000" ) |
| 1463 | | PORT_DIPNAME( 0x60, 0x00, "Balls" ) |
| 1357 | PORT_DIPNAME( 0x60, 0x00, "Balls" ) PORT_DIPLOCATION("SW1:!6,!7") |
| 1464 | 1358 | PORT_DIPSETTING( 0x60, "2" ) |
| 1465 | 1359 | PORT_DIPSETTING( 0x00, "3" ) |
| 1466 | 1360 | PORT_DIPSETTING( 0x40, "4" ) |
| 1467 | 1361 | PORT_DIPSETTING( 0x20, "5" ) |
| 1468 | | PORT_DIPNAME( 0x80, 0x00, "Ball speed" ) |
| 1469 | | PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) |
| 1362 | PORT_DIPNAME( 0x80, 0x00, "Ball speed" ) PORT_DIPLOCATION("SW1:!8") |
| 1363 | PORT_DIPSETTING( 0x00, "Slow" ) |
| 1470 | 1364 | PORT_DIPSETTING( 0x80, "Fast" ) |
| 1471 | 1365 | INPUT_PORTS_END |
| 1472 | 1366 | |
| r7972 | r7973 | |
| 1481 | 1375 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) /* Left flipper */ |
| 1482 | 1376 | |
| 1483 | 1377 | PORT_START("COIN") /* IN2 */ |
| 1484 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) /* service credit? */ |
| 1378 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) /* service credit? */ |
| 1485 | 1379 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 1486 | 1380 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 ) |
| 1487 | 1381 | INPUT_PORTS_END |
| r7972 | r7973 | |
| 1490 | 1384 | PORT_INCLUDE( vsnes ) |
| 1491 | 1385 | |
| 1492 | 1386 | PORT_START("DSW0") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 1493 | | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) |
| 1387 | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!1,!2,!3") |
| 1494 | 1388 | PORT_DIPSETTING( 0x03, DEF_STR( 5C_1C ) ) |
| 1495 | 1389 | PORT_DIPSETTING( 0x05, DEF_STR( 4C_1C ) ) |
| 1496 | 1390 | PORT_DIPSETTING( 0x01, DEF_STR( 3C_1C ) ) |
| r7972 | r7973 | |
| 1499 | 1393 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) ) |
| 1500 | 1394 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) |
| 1501 | 1395 | PORT_DIPSETTING( 0x07, DEF_STR( Free_Play ) ) |
| 1502 | | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Lives ) ) |
| 1396 | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:!4") |
| 1503 | 1397 | PORT_DIPSETTING( 0x00, "4" ) |
| 1504 | 1398 | PORT_DIPSETTING( 0x08, "3" ) |
| 1505 | | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Bonus_Life ) ) |
| 1399 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:!5,!6") |
| 1506 | 1400 | PORT_DIPSETTING( 0x00, "40000" ) |
| 1507 | 1401 | PORT_DIPSETTING( 0x20, "50000" ) |
| 1508 | 1402 | PORT_DIPSETTING( 0x10, "60000" ) |
| 1509 | 1403 | PORT_DIPSETTING( 0x30, "70000" ) |
| 1510 | | PORT_DIPNAME(0x40, 0x00, "Timer" ) |
| 1404 | PORT_DIPNAME(0x40, 0x00, "Timer" ) PORT_DIPLOCATION("SW1:!7") |
| 1511 | 1405 | PORT_DIPSETTING( 0x00, "Slow" ) |
| 1512 | 1406 | PORT_DIPSETTING( 0x40, "Fast" ) |
| 1513 | | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) |
| 1407 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:!8") |
| 1514 | 1408 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1515 | 1409 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 1516 | 1410 | INPUT_PORTS_END |
| r7972 | r7973 | |
| 1519 | 1413 | PORT_INCLUDE( vsnes_rev ) |
| 1520 | 1414 | |
| 1521 | 1415 | PORT_START("DSW0") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 1522 | | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) |
| 1416 | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!1,!2,!3") |
| 1523 | 1417 | PORT_DIPSETTING( 0x03, DEF_STR( 4C_1C ) ) |
| 1524 | 1418 | PORT_DIPSETTING( 0x05, DEF_STR( 3C_1C ) ) |
| 1525 | 1419 | PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) |
| r7972 | r7973 | |
| 1528 | 1422 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) |
| 1529 | 1423 | PORT_DIPSETTING( 0x06, DEF_STR( 1C_4C ) ) |
| 1530 | 1424 | PORT_DIPSETTING( 0x07, DEF_STR( Free_Play ) ) |
| 1531 | | PORT_DIPNAME( 0x18, 0x08, "Points Timer" ) |
| 1425 | PORT_DIPNAME( 0x18, 0x08, "Points Timer" ) PORT_DIPLOCATION("SW1:!4,!5") |
| 1532 | 1426 | PORT_DIPSETTING( 0x00, "600 Pts" ) |
| 1533 | 1427 | PORT_DIPSETTING( 0x10, "800 Pts" ) |
| 1534 | 1428 | PORT_DIPSETTING( 0x08, "1000 Pts" ) |
| 1535 | 1429 | PORT_DIPSETTING( 0x18, "1200 Pts" ) |
| 1536 | | PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) ) |
| 1430 | PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:!6,!7") |
| 1537 | 1431 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) |
| 1538 | 1432 | PORT_DIPSETTING( 0x40, DEF_STR( Normal ) ) |
| 1539 | | PORT_DIPSETTING( 0x20, DEF_STR( Hard ) ) |
| 1540 | | PORT_DIPSETTING( 0x60, DEF_STR( Very_Hard ) ) |
| 1541 | | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unused ) ) |
| 1542 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1543 | | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 1433 | PORT_DIPSETTING( 0x20, DEF_STR( Medium ) ) |
| 1434 | PORT_DIPSETTING( 0x60, DEF_STR( Hard ) ) |
| 1435 | PORT_DIPUNUSED_DIPLOC( 0x80, 0x00, "SW1:!8" ) |
| 1544 | 1436 | INPUT_PORTS_END |
| 1545 | 1437 | |
| 1546 | 1438 | static INPUT_PORTS_START( vsgradus ) |
| 1547 | 1439 | PORT_INCLUDE( vsnes_rev ) |
| 1548 | 1440 | |
| 1549 | 1441 | PORT_START("DSW0") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 1550 | | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) |
| 1442 | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!1,!2,!3") |
| 1551 | 1443 | PORT_DIPSETTING( 0x03, DEF_STR( 5C_1C ) ) |
| 1552 | 1444 | PORT_DIPSETTING( 0x05, DEF_STR( 4C_1C ) ) |
| 1553 | 1445 | PORT_DIPSETTING( 0x01, DEF_STR( 3C_1C ) ) |
| r7972 | r7973 | |
| 1556 | 1448 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) ) |
| 1557 | 1449 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) |
| 1558 | 1450 | PORT_DIPSETTING( 0x07, DEF_STR( Free_Play ) ) |
| 1559 | | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) |
| 1451 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:!4") |
| 1560 | 1452 | PORT_DIPSETTING( 0x08, "3" ) |
| 1561 | 1453 | PORT_DIPSETTING( 0x00, "4" ) |
| 1562 | | PORT_DIPNAME( 0x30, 0x00, "Bonus" ) |
| 1454 | PORT_DIPNAME( 0x30, 0x00, "Bonus" ) PORT_DIPLOCATION("SW1:!5,!6") |
| 1563 | 1455 | PORT_DIPSETTING( 0x00, "100k" ) |
| 1564 | 1456 | PORT_DIPSETTING( 0x20, "200k" ) |
| 1565 | 1457 | PORT_DIPSETTING( 0x10, "300k" ) |
| 1566 | 1458 | PORT_DIPSETTING( 0x30, "400k" ) |
| 1567 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Difficulty ) ) |
| 1568 | | PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) |
| 1459 | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:!7") |
| 1460 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) |
| 1569 | 1461 | PORT_DIPSETTING( 0x40, DEF_STR( Hard ) ) |
| 1570 | | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) |
| 1462 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:!8") |
| 1571 | 1463 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1572 | 1464 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 1573 | 1465 | INPUT_PORTS_END |
| r7972 | r7973 | |
| 1576 | 1468 | PORT_INCLUDE( vsnes ) |
| 1577 | 1469 | |
| 1578 | 1470 | PORT_START("DSW0") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 1579 | | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) |
| 1471 | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!1,!2,!3") |
| 1580 | 1472 | PORT_DIPSETTING( 0x03, DEF_STR( 5C_1C ) ) |
| 1581 | 1473 | PORT_DIPSETTING( 0x05, DEF_STR( 4C_1C ) ) |
| 1582 | 1474 | PORT_DIPSETTING( 0x01, DEF_STR( 3C_1C ) ) |
| r7972 | r7973 | |
| 1585 | 1477 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) ) |
| 1586 | 1478 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) |
| 1587 | 1479 | PORT_DIPSETTING( 0x07, DEF_STR( Free_Play ) ) |
| 1588 | | PORT_DIPNAME( 0x08, 0x00, "Freestyle Points" ) |
| 1480 | PORT_DIPNAME( 0x08, 0x00, "Freestyle Points" ) PORT_DIPLOCATION("SW1:!4") |
| 1589 | 1481 | PORT_DIPSETTING( 0x00, "Left / Right" ) |
| 1590 | 1482 | PORT_DIPSETTING( 0x08, "Hold Time" ) |
| 1591 | | PORT_DIPNAME( 0x30, 0x10, DEF_STR( Difficulty ) ) |
| 1483 | PORT_DIPNAME( 0x30, 0x10, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:!5,!6") |
| 1592 | 1484 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) |
| 1593 | 1485 | PORT_DIPSETTING( 0x10, DEF_STR( Normal ) ) |
| 1594 | | PORT_DIPSETTING( 0x20, DEF_STR( Hard ) ) |
| 1595 | | PORT_DIPSETTING( 0x30, DEF_STR( Hardest ) ) |
| 1596 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Allow_Continue ) ) |
| 1486 | PORT_DIPSETTING( 0x20, DEF_STR( Medium ) ) |
| 1487 | PORT_DIPSETTING( 0x30, DEF_STR( Hard ) ) |
| 1488 | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW1:!7") |
| 1597 | 1489 | PORT_DIPSETTING( 0x40, DEF_STR( No ) ) |
| 1598 | 1490 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) |
| 1599 | | PORT_DIPNAME( 0x80, 0x00, "Inverted input" ) |
| 1491 | PORT_DIPNAME( 0x80, 0x00, "Inverted input" ) PORT_DIPLOCATION("SW1:!8") |
| 1600 | 1492 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1601 | 1493 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 1602 | 1494 | INPUT_PORTS_END |
| r7972 | r7973 | |
| 1605 | 1497 | PORT_INCLUDE( vsnes_dual ) |
| 1606 | 1498 | |
| 1607 | 1499 | PORT_START("DSW0") |
| 1608 | | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) |
| 1500 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!1,!2") |
| 1609 | 1501 | PORT_DIPSETTING( 0x03, DEF_STR( 3C_1C ) ) |
| 1610 | 1502 | PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) |
| 1611 | 1503 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) |
| 1612 | 1504 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) |
| 1613 | | PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) |
| 1614 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1615 | | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 1616 | | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) |
| 1617 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1618 | | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 1619 | | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) |
| 1620 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1621 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 1622 | | PORT_DIPNAME( 0xe0, 0x00, "PPU Type" ) |
| 1505 | PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "SW1:!3" ) |
| 1506 | PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "SW1:!4" ) |
| 1507 | PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x00, "SW1:!5" ) |
| 1508 | PORT_DIPNAME( 0xe0, 0x00, "PPU Type" ) PORT_DIPLOCATION("SW1:!6,!7,!8") |
| 1623 | 1509 | PORT_DIPSETTING( 0x00, "RP2C03" ) |
| 1624 | 1510 | PORT_DIPSETTING( 0x20, "RP2C04-0001" ) |
| 1625 | 1511 | // PORT_DIPSETTING( 0x40, "RP2C03" ) |
| r7972 | r7973 | |
| 1637 | 1523 | PORT_INCLUDE( vsnes ) |
| 1638 | 1524 | |
| 1639 | 1525 | PORT_MODIFY("COINS") /* IN2 */ |
| 1640 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) /* service credit? */ |
| 1526 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) /* service credit? */ |
| 1641 | 1527 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 1642 | 1528 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 ) |
| 1643 | 1529 | |
| 1644 | 1530 | PORT_START("DSW0") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 1645 | | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) |
| 1531 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!1,!2") |
| 1646 | 1532 | PORT_DIPSETTING( 0x03, DEF_STR( 3C_1C ) ) |
| 1647 | 1533 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) |
| 1648 | 1534 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) |
| 1649 | 1535 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) |
| 1650 | | PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) |
| 1651 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1652 | | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 1653 | | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) |
| 1654 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1655 | | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 1656 | | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) |
| 1657 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1658 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 1659 | | PORT_DIPNAME( 0xe0, 0x00, "PPU Type" ) |
| 1536 | PORT_DIPNAME( 0x0C, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:!3,!4") |
| 1537 | PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) |
| 1538 | PORT_DIPSETTING( 0x04, DEF_STR( Normal ) ) |
| 1539 | PORT_DIPSETTING( 0x08, DEF_STR( Hard ) ) |
| 1540 | PORT_DIPSETTING( 0x0C, DEF_STR( Very_Hard ) ) |
| 1541 | PORT_DIPUNUSED_DIPLOC( 0x10, 0x00, "SW1:!5" ) |
| 1542 | PORT_DIPNAME( 0xe0, 0x00, "PPU Type" ) PORT_DIPLOCATION("SW1:!6,!7,!8") |
| 1660 | 1543 | PORT_DIPSETTING( 0x00, "RP2C04-0003" ) |
| 1661 | 1544 | // PORT_DIPSETTING( 0x20, "RP2C03" ) |
| 1662 | 1545 | // PORT_DIPSETTING( 0x40, "RP2C03" ) |
| r7972 | r7973 | |
| 1671 | 1554 | PORT_INCLUDE( vsnes_rev ) |
| 1672 | 1555 | |
| 1673 | 1556 | PORT_MODIFY("IN0") /* IN0 */ |
| 1674 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SPECIAL ) // protection /* START on a nes */ |
| 1557 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SPECIAL ) // protection /* START on a nes */ |
| 1675 | 1558 | |
| 1676 | 1559 | PORT_MODIFY("IN1") /* IN1 */ |
| 1677 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SPECIAL ) // protection /* START on a nes */ |
| 1560 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SPECIAL ) // protection /* START on a nes */ |
| 1678 | 1561 | |
| 1679 | 1562 | PORT_MODIFY("COINS") /* IN2 */ |
| 1680 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) /* service credit? */ |
| 1563 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) /* service credit? */ |
| 1681 | 1564 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 1682 | 1565 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 ) |
| 1683 | 1566 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) |
| 1684 | 1567 | |
| 1685 | 1568 | PORT_START("DSW0") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 1686 | | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) |
| 1569 | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!1,!2,!3") |
| 1687 | 1570 | PORT_DIPSETTING( 0x03, DEF_STR( 4C_1C ) ) |
| 1688 | 1571 | PORT_DIPSETTING( 0x05, DEF_STR( 3C_1C ) ) |
| 1689 | 1572 | PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) |
| r7972 | r7973 | |
| 1692 | 1575 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) |
| 1693 | 1576 | PORT_DIPSETTING( 0x06, DEF_STR( 1C_4C ) ) |
| 1694 | 1577 | PORT_DIPSETTING( 0x07, DEF_STR( Free_Play ) ) |
| 1695 | | PORT_DIPNAME( 0x18, 0x00, DEF_STR( Lives ) ) |
| 1578 | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:!4") |
| 1696 | 1579 | PORT_DIPSETTING( 0x00, "2" ) |
| 1697 | 1580 | PORT_DIPSETTING( 0x08, "3" ) |
| 1698 | | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) |
| 1699 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1700 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 1701 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) |
| 1702 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1703 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 1704 | | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) |
| 1705 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1706 | | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 1581 | PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x00, "SW1:!5" ) |
| 1582 | PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x00, "SW1:!6" ) |
| 1583 | PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x00, "SW1:!7" ) |
| 1584 | PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x00, "SW1:!8" ) |
| 1707 | 1585 | INPUT_PORTS_END |
| 1708 | 1586 | |
| 1709 | 1587 | static INPUT_PORTS_START( mightybj ) |
| 1710 | 1588 | PORT_INCLUDE( vsnes ) |
| 1711 | 1589 | |
| 1712 | 1590 | PORT_START("DSW0") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 1713 | | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) |
| 1591 | PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!1,!2,!3") |
| 1714 | 1592 | PORT_DIPSETTING( 0x07, DEF_STR( 5C_1C ) ) |
| 1715 | 1593 | PORT_DIPSETTING( 0x03, DEF_STR( 4C_1C ) ) |
| 1716 | 1594 | PORT_DIPSETTING( 0x05, DEF_STR( 3C_1C ) ) |
| r7972 | r7973 | |
| 1719 | 1597 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) ) |
| 1720 | 1598 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) |
| 1721 | 1599 | PORT_DIPSETTING( 0x06, DEF_STR( 1C_4C ) ) |
| 1722 | | PORT_DIPNAME( 0x18, 0x00, DEF_STR( Lives ) ) |
| 1600 | PORT_DIPNAME( 0x18, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:!4,!5") |
| 1723 | 1601 | PORT_DIPSETTING( 0x10, "2" ) |
| 1724 | 1602 | PORT_DIPSETTING( 0x00, "3" ) |
| 1725 | 1603 | PORT_DIPSETTING( 0x08, "4" ) |
| 1726 | 1604 | PORT_DIPSETTING( 0x18, "5" ) |
| 1727 | | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) |
| 1728 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1729 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 1730 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) |
| 1731 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1732 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 1733 | | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) |
| 1734 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1735 | | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 1605 | PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x00, "SW1:!6" ) |
| 1606 | PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x00, "SW1:!7" ) |
| 1607 | PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x00, "SW1:!8" ) |
| 1736 | 1608 | INPUT_PORTS_END |
| 1737 | 1609 | |
| 1738 | 1610 | static INPUT_PORTS_START( supxevs ) |
| 1739 | 1611 | PORT_INCLUDE( vsnes ) |
| 1740 | 1612 | |
| 1741 | 1613 | PORT_MODIFY("IN1") /* IN1 */ |
| 1742 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* SELECT on a nes */ |
| 1614 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* SELECT on a nes */ |
| 1743 | 1615 | |
| 1744 | 1616 | PORT_MODIFY("COINS") /* IN2 */ |
| 1745 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) /* service credit? */ |
| 1617 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) /* service credit? */ |
| 1746 | 1618 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 1747 | 1619 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 1748 | 1620 | |
| 1749 | 1621 | PORT_START("DSW0") /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */ |
| 1750 | | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) ) |
| 1751 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1752 | | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 1753 | | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) |
| 1754 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1755 | | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 1756 | | PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) |
| 1757 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1758 | | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 1759 | | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) |
| 1760 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1761 | | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 1762 | | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coinage ) ) |
| 1622 | PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x00, "SW1:!1" ) |
| 1623 | PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x00, "SW1:!2" ) |
| 1624 | PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "SW1:!3" ) |
| 1625 | PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "SW1:!4" ) |
| 1626 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!5,!6") |
| 1763 | 1627 | PORT_DIPSETTING( 0x30, DEF_STR( 3C_1C ) ) |
| 1764 | 1628 | PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) |
| 1765 | 1629 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) |
| 1766 | 1630 | PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) |
| 1767 | | PORT_DIPNAME( 0xc0, 0x00, "PPU Type" ) |
| 1631 | PORT_DIPNAME( 0xc0, 0x00, "PPU Type" ) PORT_DIPLOCATION("SW1:!7,!8") |
| 1768 | 1632 | PORT_DIPSETTING( 0x00, "RP2C04-0001" ) |
| 1769 | 1633 | PORT_DIPSETTING( 0x40, "RP2C04-0002" ) |
| 1770 | 1634 | PORT_DIPSETTING( 0x80, "RP2C04-0003" ) |
| r7972 | r7973 | |
| 2416 | 2280 | ROM_REGION( 0x10000,"gfx1", 0 ) /* PPU memory */ |
| 2417 | 2281 | ROM_LOAD( "tkochr.bin", 0x0000, 0x10000, CRC(21275ba5) SHA1(160131586aeeca848deabff258a2ce5f62b17c5f) ) |
| 2418 | 2282 | |
| 2419 | | /* also compatible with 2C03 via dipswitches */ |
| 2283 | /* also compatible with 2C03 via dipswitches |
| 2284 | Manual clearly states "RP2C04 0004" as PPU type, but the palette files argue that this is incorrect */ |
| 2420 | 2285 | PALETTE_2C04_0003 |
| 2421 | 2286 | ROM_END |
| 2422 | 2287 | |
| r7972 | r7973 | |
| 2560 | 2425 | |
| 2561 | 2426 | ROM_REGION( 0x4000,"gfx1", 0 ) /* PPU memory */ |
| 2562 | 2427 | ROM_LOAD( "bb-2b", 0x0000, 0x2000, CRC(3ff8bec3) SHA1(28c1bf89ed1046243ca8cf122cefa0752c242577) ) |
| 2563 | | ROM_LOAD( "bb-2a", 0x2000, 0x2000, CRC(ebb88502) SHA1(010fdffbd1cddcde8176aaaae5ca8e9c3411c02a) ) |
| 2428 | ROM_LOAD( "bb-2a", 0x2000, 0x2000, CRC(13b20cfd) SHA1(cb333cbea09557a9d2bdc351fabc61fc7760c35d) ) |
| 2564 | 2429 | |
| 2430 | /* ROM_LOAD( "bb-2a", 0x2000, 0x2000, CRC(ebb88502) SHA1(010fdffbd1cddcde8176aaaae5ca8e9c3411c02a) ) |
| 2431 | This rom dump is suspected either bad or an operator hacked version. The GFX roms for all the other Vs. Baseball sets have mirrored |
| 2432 | GFX roms. In this case, the bb-8a "gfx2" dump was placed in this slot to allow the Service Mode to green light all the roms. |
| 2433 | |
| 2434 | FC /b shows: |
| 2435 | Comparing files bb-2a and bb-8a. |
| 2436 | 00000E0A: 40 00 |
| 2437 | 00000E79: 40 00 |
| 2438 | */ |
| 2439 | |
| 2565 | 2440 | ROM_REGION( 0x10000,"sub",0 ) /* 6502 memory */ |
| 2566 | 2441 | ROM_LOAD( "bb-6d", 0x08000, 0x02000, CRC(7ec792bc) SHA1(92d1f8809db89a8d99f7ea1d2ba3f9be69195866) ) |
| 2567 | 2442 | ROM_LOAD( "bb-6c", 0x0a000, 0x02000, CRC(b631f8aa) SHA1(0ee8a8def9512552037fdac1a14a3ea9393bb943) ) |
src/mame/drivers/crystal.c
| r7972 | r7973 | |
| 124 | 124 | |
| 125 | 125 | #define IDLE_LOOP_SPEEDUP |
| 126 | 126 | |
| 127 | class crystal_state |
| 128 | { |
| 129 | public: |
| 130 | static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, crystal_state(machine)); } |
| 131 | |
| 132 | crystal_state(running_machine &machine) { } |
| 133 | |
| 134 | /* memory pointers */ |
| 135 | UINT32 * workram; |
| 136 | UINT32 * textureram; |
| 137 | UINT32 * frameram; |
| 138 | UINT32 * sysregs; |
| 139 | UINT32 * vidregs; |
| 140 | // UINT32 * nvram; // currently this uses generic nvram handling |
| 141 | |
| 127 | 142 | #ifdef IDLE_LOOP_SPEEDUP |
| 128 | | static UINT8 FlipCntRead; |
| 143 | UINT8 FlipCntRead; |
| 129 | 144 | #endif |
| 130 | 145 | |
| 131 | | static UINT32 *workram,*textureram,*frameram; |
| 132 | | static UINT32 *sysregs,*vidregs; |
| 133 | | static UINT32 Bank; |
| 134 | | static UINT8 FlipCount,IntHigh; |
| 135 | | static UINT32 Timerctrl[4]; |
| 136 | | static emu_timer *Timer[4]; |
| 137 | | static UINT32 FlashCmd,PIO; |
| 138 | | static UINT32 DMActrl[2]; |
| 139 | | static UINT8 OldPort4; |
| 140 | | static UINT32 *ResetPatch; |
| 146 | UINT32 Bank; |
| 147 | UINT8 FlipCount, IntHigh; |
| 148 | UINT32 Timerctrl[4]; |
| 149 | emu_timer *Timer[4]; |
| 150 | UINT32 FlashCmd, PIO; |
| 151 | UINT32 DMActrl[2]; |
| 152 | UINT8 OldPort4; |
| 153 | UINT32 *ResetPatch; |
| 141 | 154 | |
| 142 | | static void IntReq(running_machine *machine, int num) |
| 155 | running_device *maincpu; |
| 156 | running_device *ds1302; |
| 157 | running_device *vr0video; |
| 158 | }; |
| 159 | |
| 160 | static void IntReq( running_machine *machine, int num ) |
| 143 | 161 | { |
| 144 | | const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 145 | | UINT32 IntEn=memory_read_dword(space, 0x01800c08); |
| 146 | | UINT32 IntPend=memory_read_dword(space, 0x01800c0c); |
| 147 | | if(IntEn & (1 << num)) |
| 162 | crystal_state *state = (crystal_state *)machine->driver_data; |
| 163 | const address_space *space = cpu_get_address_space(state->maincpu, ADDRESS_SPACE_PROGRAM); |
| 164 | UINT32 IntEn = memory_read_dword(space, 0x01800c08); |
| 165 | UINT32 IntPend = memory_read_dword(space, 0x01800c0c); |
| 166 | if (IntEn & (1 << num)) |
| 148 | 167 | { |
| 149 | 168 | IntPend |= (1 << num); |
| 150 | 169 | memory_write_dword(space, 0x01800c0c, IntPend); |
| 151 | | cputag_set_input_line(machine, "maincpu", SE3208_INT, ASSERT_LINE); |
| 170 | cpu_set_input_line(state->maincpu, SE3208_INT, ASSERT_LINE); |
| 152 | 171 | } |
| 153 | 172 | #ifdef IDLE_LOOP_SPEEDUP |
| 154 | | FlipCntRead = 0; |
| 155 | | cputag_resume(machine, "maincpu", SUSPEND_REASON_SPIN); |
| 173 | state->FlipCntRead = 0; |
| 174 | cpu_resume(state->maincpu, SUSPEND_REASON_SPIN); |
| 156 | 175 | #endif |
| 157 | 176 | } |
| 158 | 177 | |
| 159 | | static READ32_HANDLER(FlipCount_r) |
| 178 | static READ32_HANDLER( FlipCount_r ) |
| 160 | 179 | { |
| 180 | crystal_state *state = (crystal_state *)space->machine->driver_data; |
| 181 | |
| 161 | 182 | #ifdef IDLE_LOOP_SPEEDUP |
| 162 | 183 | UINT32 IntPend = memory_read_dword(space, 0x01800c0c); |
| 163 | | FlipCntRead++; |
| 164 | | if(FlipCntRead >= 16 && !IntPend && FlipCount != 0) |
| 165 | | cputag_suspend(space->machine, "maincpu", SUSPEND_REASON_SPIN, 1); |
| 184 | state->FlipCntRead++; |
| 185 | if (state->FlipCntRead >= 16 && !IntPend && state->FlipCount != 0) |
| 186 | cpu_suspend(state->maincpu, SUSPEND_REASON_SPIN, 1); |
| 166 | 187 | #endif |
| 167 | | return ((UINT32) FlipCount)<<16; |
| 188 | return ((UINT32) state->FlipCount) << 16; |
| 168 | 189 | } |
| 169 | 190 | |
| 170 | | static WRITE32_HANDLER(FlipCount_w) |
| 191 | static WRITE32_HANDLER( FlipCount_w ) |
| 171 | 192 | { |
| 172 | | if(mem_mask & 0x00ff0000) |
| 193 | crystal_state *state = (crystal_state *)space->machine->driver_data; |
| 194 | |
| 195 | if (mem_mask & 0x00ff0000) |
| 173 | 196 | { |
| 174 | 197 | int fc = (data >> 16) & 0xff; |
| 175 | | if(fc == 1) |
| 176 | | FlipCount++; |
| 177 | | else if(fc == 0) |
| 178 | | FlipCount = 0; |
| 198 | if (fc == 1) |
| 199 | state->FlipCount++; |
| 200 | else if (fc == 0) |
| 201 | state->FlipCount = 0; |
| 179 | 202 | } |
| 180 | 203 | } |
| 181 | 204 | |
| 182 | | static READ32_HANDLER(Input_r) |
| 205 | static READ32_HANDLER( Input_r ) |
| 183 | 206 | { |
| 184 | | if(offset == 0) |
| 207 | crystal_state *state = (crystal_state *)space->machine->driver_data; |
| 208 | |
| 209 | if (offset == 0) |
| 185 | 210 | return input_port_read(space->machine, "P1_P2"); |
| 186 | | else if(offset == 1) |
| 211 | else if (offset == 1) |
| 187 | 212 | return input_port_read(space->machine, "P3_P4"); |
| 188 | | else if(offset == 2) |
| 213 | else if( offset == 2) |
| 189 | 214 | { |
| 190 | 215 | UINT8 Port4 = input_port_read(space->machine, "SYSTEM"); |
| 191 | | if(!(Port4 & 0x10) && ((OldPort4^Port4) & 0x10)) //coin buttons trigger IRQs |
| 216 | if (!(Port4 & 0x10) && ((state->OldPort4 ^ Port4) & 0x10)) //coin buttons trigger IRQs |
| 192 | 217 | IntReq(space->machine, 12); |
| 193 | | if(!(Port4 & 0x20) && ((OldPort4^Port4) & 0x20)) |
| 218 | if (!(Port4 & 0x20) && ((state->OldPort4 ^ Port4) & 0x20)) |
| 194 | 219 | IntReq(space->machine, 19); |
| 195 | | OldPort4 = Port4; |
| 220 | state->OldPort4 = Port4; |
| 196 | 221 | return /*dips*/input_port_read(space->machine, "DSW") | (Port4 << 16); |
| 197 | 222 | } |
| 198 | 223 | return 0; |
| 199 | 224 | } |
| 200 | 225 | |
| 201 | | static WRITE32_HANDLER(IntAck_w) |
| 226 | static WRITE32_HANDLER( IntAck_w ) |
| 202 | 227 | { |
| 228 | crystal_state *state = (crystal_state *)space->machine->driver_data; |
| 203 | 229 | UINT32 IntPend = memory_read_dword(space, 0x01800c0c); |
| 204 | | if(mem_mask & 0xff) |
| 230 | |
| 231 | if (mem_mask & 0xff) |
| 205 | 232 | { |
| 206 | 233 | IntPend &= ~(1 << (data & 0x1f)); |
| 207 | 234 | memory_write_dword(space, 0x01800c0c, IntPend); |
| 208 | | if(!IntPend) |
| 209 | | cputag_set_input_line(space->machine, "maincpu", SE3208_INT, CLEAR_LINE); |
| 235 | if (!IntPend) |
| 236 | cpu_set_input_line(state->maincpu, SE3208_INT, CLEAR_LINE); |
| 210 | 237 | } |
| 211 | | if(mem_mask & 0xff00) |
| 212 | | IntHigh = (data >> 8) & 7; |
| 238 | if (mem_mask & 0xff00) |
| 239 | state->IntHigh = (data >> 8) & 7; |
| 213 | 240 | } |
| 214 | 241 | |
| 215 | | static IRQ_CALLBACK(icallback) |
| 242 | static IRQ_CALLBACK( icallback ) |
| 216 | 243 | { |
| 244 | crystal_state *state = (crystal_state *)device->machine->driver_data; |
| 217 | 245 | const address_space *space = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM); |
| 218 | 246 | UINT32 IntPend = memory_read_dword(space, 0x01800c0c); |
| 219 | 247 | int i; |
| 220 | 248 | |
| 221 | | for(i = 0; i < 32; ++i) |
| 249 | for (i = 0; i < 32; ++i) |
| 222 | 250 | { |
| 223 | | if(IntPend & (1 << i)) |
| 251 | if (BIT(IntPend, i)) |
| 224 | 252 | { |
| 225 | | return (IntHigh << 5) | i; |
| 253 | return (state->IntHigh << 5) | i; |
| 226 | 254 | } |
| 227 | 255 | } |
| 228 | 256 | return 0; //This should never happen |
| 229 | 257 | } |
| 230 | 258 | |
| 231 | | static WRITE32_HANDLER(Banksw_w) |
| 259 | static WRITE32_HANDLER( Banksw_w ) |
| 232 | 260 | { |
| 233 | | Bank=(data>>1)&7; |
| 234 | | if(Bank<=2) |
| 235 | | memory_set_bankptr(space->machine, "bank1",memory_region(space->machine, "user1")+Bank*0x1000000); |
| 261 | crystal_state *state = (crystal_state *)space->machine->driver_data; |
| 262 | |
| 263 | state->Bank = (data >> 1) & 7; |
| 264 | if (state->Bank <= 2) |
| 265 | memory_set_bankptr(space->machine, "bank1", memory_region(space->machine, "user1") + state->Bank * 0x1000000); |
| 236 | 266 | else |
| 237 | | memory_set_bankptr(space->machine, "bank1",memory_region(space->machine, "user2")); |
| 267 | memory_set_bankptr(space->machine, "bank1", memory_region(space->machine, "user2")); |
| 238 | 268 | } |
| 239 | 269 | |
| 240 | 270 | static TIMER_CALLBACK( Timercb ) |
| 241 | 271 | { |
| 272 | crystal_state *state = (crystal_state *)machine->driver_data; |
| 242 | 273 | int which = (int)(FPTR)ptr; |
| 243 | 274 | static const int num[] = { 0, 1, 9, 10 }; |
| 244 | 275 | |
| 245 | | if(!(Timerctrl[which]&2)) |
| 246 | | Timerctrl[which]&=~1; |
| 276 | if (!(state->Timerctrl[which] & 2)) |
| 277 | state->Timerctrl[which] &= ~1; |
| 278 | |
| 247 | 279 | IntReq(machine, num[which]); |
| 248 | 280 | } |
| 249 | 281 | |
| 250 | | INLINE void Timer_w(const address_space *space, int which, UINT32 data, UINT32 mem_mask) |
| 282 | INLINE void Timer_w( const address_space *space, int which, UINT32 data, UINT32 mem_mask ) |
| 251 | 283 | { |
| 252 | | if(((data^Timerctrl[which])&1) && (data&1)) //Timer activate |
| 284 | crystal_state *state = (crystal_state *)space->machine->driver_data; |
| 285 | |
| 286 | if (((data ^ state->Timerctrl[which]) & 1) && (data & 1)) //Timer activate |
| 253 | 287 | { |
| 254 | | int PD=(data>>8)&0xff; |
| 255 | | int TCV=memory_read_dword(space, 0x01801404+which*8); |
| 288 | int PD = (data >> 8) & 0xff; |
| 289 | int TCV = memory_read_dword(space, 0x01801404 + which * 8); |
| 256 | 290 | attotime period = attotime_mul(ATTOTIME_IN_HZ(43000000), (PD + 1) * (TCV + 1)); |
| 257 | 291 | |
| 258 | | if(Timerctrl[which]&2) |
| 259 | | timer_adjust_periodic(Timer[which],period,0,period); |
| 292 | if (state->Timerctrl[which] & 2) |
| 293 | timer_adjust_periodic(state->Timer[which], period, 0, period); |
| 260 | 294 | else |
| 261 | | timer_adjust_oneshot(Timer[which],period,0); |
| 295 | timer_adjust_oneshot(state->Timer[which], period, 0); |
| 262 | 296 | } |
| 263 | | COMBINE_DATA(&Timerctrl[which]); |
| 297 | COMBINE_DATA(&state->Timerctrl[which]); |
| 264 | 298 | } |
| 265 | 299 | |
| 266 | | static WRITE32_HANDLER(Timer0_w) |
| 300 | static WRITE32_HANDLER( Timer0_w ) |
| 267 | 301 | { |
| 268 | 302 | Timer_w(space, 0, data, mem_mask); |
| 269 | 303 | } |
| 270 | 304 | |
| 271 | | static READ32_HANDLER(Timer0_r) |
| 305 | static READ32_HANDLER( Timer0_r ) |
| 272 | 306 | { |
| 273 | | return Timerctrl[0]; |
| 307 | crystal_state *state = (crystal_state *)space->machine->driver_data; |
| 308 | return state->Timerctrl[0]; |
| 274 | 309 | } |
| 275 | 310 | |
| 276 | | static WRITE32_HANDLER(Timer1_w) |
| 311 | static WRITE32_HANDLER( Timer1_w ) |
| 277 | 312 | { |
| 278 | 313 | Timer_w(space, 1, data, mem_mask); |
| 279 | 314 | } |
| 280 | 315 | |
| 281 | | static READ32_HANDLER(Timer1_r) |
| 316 | static READ32_HANDLER( Timer1_r ) |
| 282 | 317 | { |
| 283 | | return Timerctrl[1]; |
| 318 | crystal_state *state = (crystal_state *)space->machine->driver_data; |
| 319 | return state->Timerctrl[1]; |
| 284 | 320 | } |
| 285 | 321 | |
| 286 | | static WRITE32_HANDLER(Timer2_w) |
| 322 | static WRITE32_HANDLER( Timer2_w ) |
| 287 | 323 | { |
| 288 | 324 | Timer_w(space, 2, data, mem_mask); |
| 289 | 325 | } |
| 290 | 326 | |
| 291 | | static READ32_HANDLER(Timer2_r) |
| 327 | static READ32_HANDLER( Timer2_r ) |
| 292 | 328 | { |
| 293 | | return Timerctrl[2]; |
| 329 | crystal_state *state = (crystal_state *)space->machine->driver_data; |
| 330 | return state->Timerctrl[2]; |
| 294 | 331 | } |
| 295 | 332 | |
| 296 | | static WRITE32_HANDLER(Timer3_w) |
| 333 | static WRITE32_HANDLER( Timer3_w ) |
| 297 | 334 | { |
| 298 | 335 | Timer_w(space, 3, data, mem_mask); |
| 299 | 336 | } |
| 300 | 337 | |
| 301 | | static READ32_HANDLER(Timer3_r) |
| 338 | static READ32_HANDLER( Timer3_r ) |
| 302 | 339 | { |
| 303 | | return Timerctrl[3]; |
| 340 | crystal_state *state = (crystal_state *)space->machine->driver_data; |
| 341 | return state->Timerctrl[3]; |
| 304 | 342 | } |
| 305 | 343 | |
| 306 | | static READ32_HANDLER(FlashCmd_r) |
| 344 | static READ32_HANDLER( FlashCmd_r ) |
| 307 | 345 | { |
| 308 | | if((FlashCmd&0xff)==0xff) |
| 346 | crystal_state *state = (crystal_state *)space->machine->driver_data; |
| 347 | |
| 348 | if ((state->FlashCmd & 0xff) == 0xff) |
| 309 | 349 | { |
| 310 | | if(Bank<=2) |
| 350 | if (state->Bank <= 2) |
| 311 | 351 | { |
| 312 | | UINT32 *ptr=(UINT32*)(memory_region(space->machine, "user1")+Bank*0x1000000); |
| 352 | UINT32 *ptr = (UINT32*)(memory_region(space->machine, "user1") + state->Bank * 0x1000000); |
| 313 | 353 | return ptr[0]; |
| 314 | 354 | } |
| 315 | 355 | else |
| 316 | 356 | return 0xffffffff; |
| 317 | 357 | } |
| 318 | | if((FlashCmd&0xff)==0x90) |
| 358 | if ((state->FlashCmd & 0xff) == 0x90) |
| 319 | 359 | { |
| 320 | | if(Bank<=2) |
| 360 | if (state->Bank <= 2) |
| 321 | 361 | return 0x00180089; //Intel 128MBit |
| 322 | 362 | else |
| 323 | 363 | return 0xffffffff; |
| r7972 | r7973 | |
| 325 | 365 | return 0; |
| 326 | 366 | } |
| 327 | 367 | |
| 328 | | static WRITE32_HANDLER(FlashCmd_w) |
| 368 | static WRITE32_HANDLER( FlashCmd_w ) |
| 329 | 369 | { |
| 330 | | FlashCmd=data; |
| 370 | crystal_state *state = (crystal_state *)space->machine->driver_data; |
| 371 | state->FlashCmd = data; |
| 331 | 372 | } |
| 332 | 373 | |
| 333 | | static READ32_HANDLER(PIO_r) |
| 374 | static READ32_HANDLER( PIO_r ) |
| 334 | 375 | { |
| 335 | | return PIO; |
| 376 | crystal_state *state = (crystal_state *)space->machine->driver_data; |
| 377 | return state->PIO; |
| 336 | 378 | } |
| 337 | 379 | |
| 338 | | static WRITE32_HANDLER(PIO_w) |
| 380 | static WRITE32_HANDLER( PIO_w ) |
| 339 | 381 | { |
| 340 | | running_device *ds1302 = devtag_get_device(space->machine, "rtc"); |
| 382 | crystal_state *state = (crystal_state *)space->machine->driver_data; |
| 341 | 383 | UINT32 RST = data & 0x01000000; |
| 342 | 384 | UINT32 CLK = data & 0x02000000; |
| 343 | 385 | UINT32 DAT = data & 0x10000000; |
| 344 | 386 | |
| 345 | 387 | if (!RST) |
| 346 | | ds1302->reset(); |
| 388 | state->ds1302->reset(); |
| 347 | 389 | |
| 348 | | ds1302_dat_w(ds1302, 0, DAT ? 1 : 0); |
| 349 | | ds1302_clk_w(ds1302, 0, CLK ? 1 : 0); |
| 390 | ds1302_dat_w(state->ds1302, 0, DAT ? 1 : 0); |
| 391 | ds1302_clk_w(state->ds1302, 0, CLK ? 1 : 0); |
| 350 | 392 | |
| 351 | | if (ds1302_read(ds1302, 0)) |
| 393 | if (ds1302_read(state->ds1302, 0)) |
| 352 | 394 | memory_write_dword(space, 0x01802008, memory_read_dword(space, 0x01802008) | 0x10000000); |
| 353 | 395 | else |
| 354 | 396 | memory_write_dword(space, 0x01802008, memory_read_dword(space, 0x01802008) & (~0x10000000)); |
| 355 | 397 | |
| 356 | | COMBINE_DATA(&PIO); |
| 398 | COMBINE_DATA(&state->PIO); |
| 357 | 399 | } |
| 358 | 400 | |
| 359 | | INLINE void DMA_w(const address_space *space, int which, UINT32 data, UINT32 mem_mask) |
| 401 | INLINE void DMA_w( const address_space *space, int which, UINT32 data, UINT32 mem_mask ) |
| 360 | 402 | { |
| 361 | | if(((data^DMActrl[which])&(1<<10)) && (data&(1<<10))) //DMAOn |
| 403 | crystal_state *state = (crystal_state *)space->machine->driver_data; |
| 404 | |
| 405 | if (((data ^ state->DMActrl[which]) & (1 << 10)) && (data & (1 << 10))) //DMAOn |
| 362 | 406 | { |
| 363 | | UINT32 CTR=data; |
| 364 | | UINT32 SRC=memory_read_dword(space,0x01800804+which*0x10); |
| 365 | | UINT32 DST=memory_read_dword(space,0x01800808+which*0x10); |
| 366 | | UINT32 CNT=memory_read_dword(space,0x0180080C+which*0x10); |
| 407 | UINT32 CTR = data; |
| 408 | UINT32 SRC = memory_read_dword(space, 0x01800804 + which * 0x10); |
| 409 | UINT32 DST = memory_read_dword(space, 0x01800808 + which * 0x10); |
| 410 | UINT32 CNT = memory_read_dword(space, 0x0180080C + which * 0x10); |
| 367 | 411 | int i; |
| 368 | 412 | |
| 369 | | if(CTR&0x2) //32 bits |
| 413 | if (CTR & 0x2) //32 bits |
| 370 | 414 | { |
| 371 | | for(i=0;i<CNT;++i) |
| 415 | for (i = 0; i < CNT; ++i) |
| 372 | 416 | { |
| 373 | | UINT32 v=memory_read_dword(space,SRC+i*4); |
| 374 | | memory_write_dword(space,DST+i*4,v); |
| 417 | UINT32 v = memory_read_dword(space, SRC + i * 4); |
| 418 | memory_write_dword(space, DST + i * 4, v); |
| 375 | 419 | } |
| 376 | 420 | } |
| 377 | | else if(CTR&0x1) //16 bits |
| 421 | else if (CTR & 0x1) //16 bits |
| 378 | 422 | { |
| 379 | | for(i=0;i<CNT;++i) |
| 423 | for (i = 0; i < CNT; ++i) |
| 380 | 424 | { |
| 381 | | UINT16 v=memory_read_word(space,SRC+i*2); |
| 382 | | memory_write_word(space,DST+i*2,v); |
| 425 | UINT16 v = memory_read_word(space, SRC + i * 2); |
| 426 | memory_write_word(space, DST + i * 2, v); |
| 383 | 427 | } |
| 384 | 428 | } |
| 385 | 429 | else //8 bits |
| 386 | 430 | { |
| 387 | | for(i=0;i<CNT;++i) |
| 431 | for (i = 0; i < CNT; ++i) |
| 388 | 432 | { |
| 389 | | UINT8 v=memory_read_byte(space,SRC+i); |
| 390 | | memory_write_byte(space,DST+i,v); |
| 433 | UINT8 v = memory_read_byte(space, SRC + i); |
| 434 | memory_write_byte(space, DST + i, v); |
| 391 | 435 | } |
| 392 | 436 | } |
| 393 | | data&=~(1<<10); |
| 394 | | memory_write_dword(space,0x0180080C+which*0x10,0); |
| 395 | | IntReq(space->machine, 7+which); |
| 437 | data &= ~(1 << 10); |
| 438 | memory_write_dword(space, 0x0180080C + which * 0x10, 0); |
| 439 | IntReq(space->machine, 7 + which); |
| 396 | 440 | } |
| 397 | | COMBINE_DATA(&DMActrl[which]); |
| 441 | COMBINE_DATA(&state->DMActrl[which]); |
| 398 | 442 | } |
| 399 | 443 | |
| 400 | | static READ32_HANDLER(DMA0_r) |
| 444 | static READ32_HANDLER( DMA0_r ) |
| 401 | 445 | { |
| 402 | | return DMActrl[0]; |
| 446 | crystal_state *state = (crystal_state *)space->machine->driver_data; |
| 447 | return state->DMActrl[0]; |
| 403 | 448 | } |
| 404 | 449 | |
| 405 | | static WRITE32_HANDLER(DMA0_w) |
| 450 | static WRITE32_HANDLER( DMA0_w ) |
| 406 | 451 | { |
| 407 | 452 | DMA_w(space, 0, data, mem_mask); |
| 408 | 453 | } |
| 409 | 454 | |
| 410 | | static READ32_HANDLER(DMA1_r) |
| 455 | static READ32_HANDLER( DMA1_r ) |
| 411 | 456 | { |
| 412 | | return DMActrl[1]; |
| 457 | crystal_state *state = (crystal_state *)space->machine->driver_data; |
| 458 | return state->DMActrl[1]; |
| 413 | 459 | } |
| 414 | 460 | |
| 415 | | static WRITE32_HANDLER(DMA1_w) |
| 461 | static WRITE32_HANDLER( DMA1_w ) |
| 416 | 462 | { |
| 417 | 463 | DMA_w(space, 1, data, mem_mask); |
| 418 | 464 | } |
| r7972 | r7973 | |
| 425 | 471 | AM_RANGE(0x01280000, 0x01280003) AM_WRITE(Banksw_w) |
| 426 | 472 | AM_RANGE(0x01400000, 0x0140ffff) AM_RAM AM_BASE_SIZE_GENERIC(nvram) |
| 427 | 473 | |
| 428 | | AM_RANGE(0x01801400, 0x01801403) AM_READ(Timer0_r) AM_WRITE(Timer0_w) |
| 429 | | AM_RANGE(0x01801408, 0x0180140b) AM_READ(Timer1_r) AM_WRITE(Timer1_w) |
| 430 | | AM_RANGE(0x01801410, 0x01801413) AM_READ(Timer2_r) AM_WRITE(Timer2_w) |
| 431 | | AM_RANGE(0x01801418, 0x0180141b) AM_READ(Timer3_r) AM_WRITE(Timer3_w) |
| 432 | | AM_RANGE(0x01802004, 0x01802007) AM_WRITE(PIO_w) AM_READ(PIO_r) |
| 474 | AM_RANGE(0x01801400, 0x01801403) AM_READWRITE(Timer0_r, Timer0_w) |
| 475 | AM_RANGE(0x01801408, 0x0180140b) AM_READWRITE(Timer1_r, Timer1_w) |
| 476 | AM_RANGE(0x01801410, 0x01801413) AM_READWRITE(Timer2_r, Timer2_w) |
| 477 | AM_RANGE(0x01801418, 0x0180141b) AM_READWRITE(Timer3_r, Timer3_w) |
| 478 | AM_RANGE(0x01802004, 0x01802007) AM_READWRITE(PIO_r, PIO_w) |
| 433 | 479 | |
| 434 | | AM_RANGE(0x01800800, 0x01800803) AM_READ(DMA0_r) AM_WRITE(DMA0_w) |
| 435 | | AM_RANGE(0x01800810, 0x01800813) AM_READ(DMA1_r) AM_WRITE(DMA1_w) |
| 480 | AM_RANGE(0x01800800, 0x01800803) AM_READWRITE(DMA0_r, DMA0_w) |
| 481 | AM_RANGE(0x01800810, 0x01800813) AM_READWRITE(DMA1_r, DMA1_w) |
| 436 | 482 | |
| 437 | 483 | AM_RANGE(0x01800c04, 0x01800c07) AM_WRITE(IntAck_w) |
| 438 | | AM_RANGE(0x01800000, 0x0180ffff) AM_RAM AM_BASE(&sysregs) |
| 439 | | AM_RANGE(0x02000000, 0x027fffff) AM_RAM AM_BASE(&workram) |
| 484 | AM_RANGE(0x01800000, 0x0180ffff) AM_RAM AM_BASE_MEMBER(crystal_state, sysregs) |
| 485 | AM_RANGE(0x02000000, 0x027fffff) AM_RAM AM_BASE_MEMBER(crystal_state, workram) |
| 440 | 486 | |
| 441 | | AM_RANGE(0x030000a4, 0x030000a7) AM_READ(FlipCount_r) AM_WRITE(FlipCount_w) |
| 487 | AM_RANGE(0x030000a4, 0x030000a7) AM_READWRITE(FlipCount_r, FlipCount_w) |
| 442 | 488 | |
| 443 | | AM_RANGE(0x03000000, 0x0300ffff) AM_RAM AM_BASE(&vidregs) |
| 444 | | AM_RANGE(0x03800000, 0x03ffffff) AM_RAM AM_BASE(&textureram) |
| 445 | | AM_RANGE(0x04000000, 0x047fffff) AM_RAM AM_BASE(&frameram) |
| 489 | AM_RANGE(0x03000000, 0x0300ffff) AM_RAM AM_BASE_MEMBER(crystal_state, vidregs) |
| 490 | AM_RANGE(0x03800000, 0x03ffffff) AM_RAM AM_BASE_MEMBER(crystal_state, textureram) |
| 491 | AM_RANGE(0x04000000, 0x047fffff) AM_RAM AM_BASE_MEMBER(crystal_state, frameram) |
| 446 | 492 | AM_RANGE(0x04800000, 0x04800fff) AM_DEVREADWRITE("vrender", vr0_snd_read, vr0_snd_write) |
| 447 | 493 | |
| 448 | | AM_RANGE(0x05000000, 0x05000003) AM_READ(FlashCmd_r) AM_WRITE(FlashCmd_w) |
| 494 | AM_RANGE(0x05000000, 0x05000003) AM_READWRITE(FlashCmd_r, FlashCmd_w) |
| 449 | 495 | AM_RANGE(0x05000000, 0x05ffffff) AM_ROMBANK("bank1") |
| 450 | 496 | |
| 451 | | AM_RANGE(0x44414F4C, 0x44414F7F) AM_RAM AM_BASE(&ResetPatch) |
| 497 | AM_RANGE(0x44414F4C, 0x44414F7F) AM_RAM AM_BASE_MEMBER(crystal_state, ResetPatch) |
| 452 | 498 | |
| 453 | 499 | ADDRESS_MAP_END |
| 454 | 500 | |
| 455 | | static void PatchReset(void) |
| 501 | static void PatchReset( running_machine *machine ) |
| 456 | 502 | { |
| 457 | 503 | //The test menu reset routine seems buggy |
| 458 | 504 | //it reads the reset vector from 0x02000000 but it should be |
| r7972 | r7973 | |
| 476 | 522 | JMP Loop1 |
| 477 | 523 | */ |
| 478 | 524 | |
| 525 | crystal_state *state = (crystal_state *)machine->driver_data; |
| 526 | |
| 479 | 527 | #if 1 |
| 480 | 528 | static const UINT32 Patch[] = |
| 481 | 529 | { |
| r7972 | r7973 | |
| 487 | 535 | 0xdef4d4fa |
| 488 | 536 | }; |
| 489 | 537 | |
| 490 | | memcpy(ResetPatch,Patch,sizeof(Patch)); |
| 538 | memcpy(state->ResetPatch, Patch, sizeof(Patch)); |
| 491 | 539 | #else |
| 492 | 540 | static const UINT8 Patch[] = |
| 493 | 541 | { |
| r7972 | r7973 | |
| 496 | 544 | 0x20,0x3A,0xD0,0xA1,0xFA,0xD4,0xF4,0xDE |
| 497 | 545 | }; |
| 498 | 546 | |
| 499 | | memcpy(ResetPatch,Patch,sizeof(Patch)); |
| 547 | memcpy(state->ResetPatch, Patch, sizeof(Patch)); |
| 500 | 548 | #endif |
| 501 | 549 | } |
| 502 | 550 | |
| 503 | | static MACHINE_START(crystal) |
| 551 | static STATE_POSTLOAD( crystal_banksw_postload ) |
| 504 | 552 | { |
| 553 | crystal_state *state = (crystal_state *)machine->driver_data; |
| 554 | |
| 555 | if (state->Bank <= 2) |
| 556 | memory_set_bankptr(machine, "bank1", memory_region(machine, "user1") + state->Bank * 0x1000000); |
| 557 | else |
| 558 | memory_set_bankptr(machine, "bank1", memory_region(machine, "user2")); |
| 559 | } |
| 560 | |
| 561 | static MACHINE_START( crystal ) |
| 562 | { |
| 563 | crystal_state *state = (crystal_state *)machine->driver_data; |
| 505 | 564 | int i; |
| 506 | 565 | |
| 566 | state->maincpu = devtag_get_device(machine, "maincpu"); |
| 567 | state->ds1302 = devtag_get_device(machine, "rtc"); |
| 568 | state->vr0video = devtag_get_device(machine, "vr0"); |
| 569 | |
| 507 | 570 | cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), icallback); |
| 508 | 571 | for (i = 0; i < 4; i++) |
| 509 | | Timer[i] = timer_alloc(machine, Timercb, (void*)(FPTR)i); |
| 572 | state->Timer[i] = timer_alloc(machine, Timercb, (void*)(FPTR)i); |
| 510 | 573 | |
| 511 | | PatchReset(); |
| 574 | PatchReset(machine); |
| 575 | |
| 576 | #ifdef IDLE_LOOP_SPEEDUP |
| 577 | state_save_register_global(machine, state->FlipCntRead); |
| 578 | #endif |
| 579 | |
| 580 | state_save_register_global(machine, state->Bank); |
| 581 | state_save_register_global(machine, state->FlipCount); |
| 582 | state_save_register_global(machine, state->IntHigh); |
| 583 | state_save_register_global_array(machine, state->Timerctrl); |
| 584 | state_save_register_global(machine, state->FlashCmd); |
| 585 | state_save_register_global(machine, state->PIO); |
| 586 | state_save_register_global_array(machine, state->DMActrl); |
| 587 | state_save_register_global(machine, state->OldPort4); |
| 588 | state_save_register_postload(machine, crystal_banksw_postload, NULL); |
| 512 | 589 | } |
| 513 | 590 | |
| 514 | | static MACHINE_RESET(crystal) |
| 591 | static MACHINE_RESET( crystal ) |
| 515 | 592 | { |
| 593 | crystal_state *state = (crystal_state *)machine->driver_data; |
| 516 | 594 | int i; |
| 517 | 595 | |
| 518 | | memset(sysregs, 0, 0x10000); |
| 519 | | memset(vidregs, 0, 0x10000); |
| 520 | | FlipCount = 0; |
| 521 | | IntHigh = 0; |
| 596 | memset(state->sysregs, 0, 0x10000); |
| 597 | memset(state->vidregs, 0, 0x10000); |
| 598 | state->FlipCount = 0; |
| 599 | state->IntHigh = 0; |
| 522 | 600 | cpu_set_irq_callback(devtag_get_device(machine, "maincpu"), icallback); |
| 523 | | Bank = 0; |
| 601 | state->Bank = 0; |
| 524 | 602 | memory_set_bankptr(machine, "bank1", memory_region(machine, "user1") + 0); |
| 525 | | FlashCmd = 0xff; |
| 526 | | OldPort4 = 0; |
| 603 | state->FlashCmd = 0xff; |
| 604 | state->OldPort4 = 0; |
| 527 | 605 | |
| 528 | | DMActrl[0] = 0; |
| 529 | | DMActrl[1] = 0; |
| 606 | state->DMActrl[0] = 0; |
| 607 | state->DMActrl[1] = 0; |
| 530 | 608 | |
| 531 | 609 | for (i = 0; i < 4; i++) |
| 532 | 610 | { |
| 533 | | Timerctrl[i] = 0; |
| 534 | | timer_adjust_oneshot(Timer[i], attotime_never, 0); |
| 611 | state->Timerctrl[i] = 0; |
| 612 | timer_adjust_oneshot(state->Timer[i], attotime_never, 0); |
| 535 | 613 | } |
| 536 | 614 | |
| 537 | | vr0_snd_set_areas(devtag_get_device(machine, "vrender"), textureram, frameram); |
| 615 | vr0_snd_set_areas(devtag_get_device(machine, "vrender"), state->textureram, state->frameram); |
| 538 | 616 | #ifdef IDLE_LOOP_SPEEDUP |
| 539 | | FlipCntRead = 0; |
| 617 | state->FlipCntRead = 0; |
| 540 | 618 | #endif |
| 541 | 619 | |
| 542 | | PatchReset(); |
| 620 | PatchReset(machine); |
| 543 | 621 | } |
| 544 | 622 | |
| 545 | | static VIDEO_START(crystal) |
| 623 | static UINT16 GetVidReg( const address_space *space, UINT16 reg ) |
| 546 | 624 | { |
| 547 | | vrender0_init(machine); |
| 548 | | } |
| 549 | | |
| 550 | | static UINT16 GetVidReg(const address_space *space, UINT16 reg) |
| 551 | | { |
| 552 | 625 | return memory_read_word(space, 0x03000000 + reg); |
| 553 | 626 | } |
| 554 | 627 | |
| 555 | | static void SetVidReg(const address_space *space, UINT16 reg, UINT16 val) |
| 628 | static void SetVidReg( const address_space *space, UINT16 reg, UINT16 val ) |
| 556 | 629 | { |
| 557 | 630 | memory_write_word(space, 0x03000000 + reg, val); |
| 558 | 631 | } |
| 559 | 632 | |
| 560 | 633 | |
| 561 | | static VIDEO_UPDATE(crystal) |
| 634 | static VIDEO_UPDATE( crystal ) |
| 562 | 635 | { |
| 636 | crystal_state *state = (crystal_state *)screen->machine->driver_data; |
| 563 | 637 | const address_space *space = cputag_get_address_space(screen->machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 564 | 638 | int DoFlip; |
| 565 | 639 | |
| 566 | | |
| 567 | 640 | UINT32 B0 = 0x0; |
| 568 | 641 | UINT32 B1 = (GetVidReg(space, 0x90) & 0x8000) ? 0x400000 : 0x100000; |
| 569 | 642 | UINT16 *Front, *Back; |
| r7972 | r7973 | |
| 573 | 646 | UINT16 head, tail; |
| 574 | 647 | UINT32 width = video_screen_get_width(screen); |
| 575 | 648 | |
| 576 | | if(GetVidReg(space, 0x8e) & 1) |
| 649 | if (GetVidReg(space, 0x8e) & 1) |
| 577 | 650 | { |
| 578 | | Front = (UINT16*) (frameram + B1 / 4); |
| 579 | | Back = (UINT16*) (frameram + B0 / 4); |
| 651 | Front = (UINT16*) (state->frameram + B1 / 4); |
| 652 | Back = (UINT16*) (state->frameram + B0 / 4); |
| 580 | 653 | } |
| 581 | 654 | else |
| 582 | 655 | { |
| 583 | | Front = (UINT16*) (frameram + B0 / 4); |
| 584 | | Back = (UINT16*) (frameram + B1 / 4); |
| 656 | Front = (UINT16*) (state->frameram + B0 / 4); |
| 657 | Back = (UINT16*) (state->frameram + B1 / 4); |
| 585 | 658 | } |
| 586 | 659 | |
| 587 | 660 | Visible = (UINT16*) Front; |
| 588 | | DrawDest = (UINT16 *) frameram; |
| 661 | DrawDest = (UINT16 *) state->frameram; |
| 589 | 662 | |
| 590 | 663 | |
| 591 | | if(GetVidReg(space, 0x8c) & 0x80) |
| 664 | if (GetVidReg(space, 0x8c) & 0x80) |
| 592 | 665 | DrawDest = Front; |
| 593 | 666 | else |
| 594 | 667 | DrawDest = Back; |
| r7972 | r7973 | |
| 600 | 673 | DoFlip = 0; |
| 601 | 674 | head = GetVidReg(space, 0x82); |
| 602 | 675 | tail = GetVidReg(space, 0x80); |
| 603 | | while((head & 0x7ff) != (tail & 0x7ff)) |
| 676 | while ((head & 0x7ff) != (tail & 0x7ff)) |
| 604 | 677 | { |
| 605 | | DoFlip = vrender0_ProcessPacket(space, 0x03800000 + head * 64, DrawDest, (UINT8*)textureram); |
| 678 | DoFlip = vrender0_ProcessPacket(state->vr0video, 0x03800000 + head * 64, DrawDest, (UINT8*)state->textureram); |
| 606 | 679 | head++; |
| 607 | 680 | head &= 0x7ff; |
| 608 | | if(DoFlip) |
| 681 | if (DoFlip) |
| 609 | 682 | break; |
| 610 | 683 | } |
| 611 | 684 | |
| 612 | | if(DoFlip) |
| 685 | if (DoFlip) |
| 613 | 686 | SetVidReg(space, 0x8e, GetVidReg(space, 0x8e) ^ 1); |
| 614 | 687 | |
| 615 | | srcline=(UINT16 *) Visible; |
| 616 | | for(y = 0; y < 240; y++) |
| 688 | srcline = (UINT16 *) Visible; |
| 689 | for (y = 0; y < 240; y++) |
| 617 | 690 | memcpy(BITMAP_ADDR16(bitmap, y, 0), &srcline[y * 512], width * 2); |
| 618 | 691 | |
| 619 | 692 | return 0; |
| r7972 | r7973 | |
| 621 | 694 | |
| 622 | 695 | static VIDEO_EOF(crystal) |
| 623 | 696 | { |
| 697 | crystal_state *state = (crystal_state *)machine->driver_data; |
| 624 | 698 | const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 625 | 699 | UINT16 head, tail; |
| 626 | 700 | int DoFlip = 0; |
| 627 | 701 | |
| 628 | 702 | head = GetVidReg(space, 0x82); |
| 629 | 703 | tail = GetVidReg(space, 0x80); |
| 630 | | while((head & 0x7ff) != (tail & 0x7ff)) |
| 704 | while ((head & 0x7ff) != (tail & 0x7ff)) |
| 631 | 705 | { |
| 632 | 706 | UINT16 Packet0 = memory_read_word(space, 0x03800000 + head * 64); |
| 633 | | if(Packet0 & 0x81) |
| 707 | if (Packet0 & 0x81) |
| 634 | 708 | DoFlip = 1; |
| 635 | 709 | head++; |
| 636 | 710 | head &= 0x7ff; |
| 637 | | if(DoFlip) |
| 711 | if (DoFlip) |
| 638 | 712 | break; |
| 639 | 713 | } |
| 640 | 714 | SetVidReg(space, 0x82, head); |
| 641 | | if(DoFlip) |
| 715 | if (DoFlip) |
| 642 | 716 | { |
| 643 | | if(FlipCount) |
| 644 | | FlipCount--; |
| 717 | if (state->FlipCount) |
| 718 | state->FlipCount--; |
| 645 | 719 | |
| 646 | 720 | } |
| 647 | 721 | } |
| r7972 | r7973 | |
| 736 | 810 | 0x04800000 |
| 737 | 811 | }; |
| 738 | 812 | |
| 813 | static const vr0video_interface vr0video_config = |
| 814 | { |
| 815 | "maincpu" |
| 816 | }; |
| 739 | 817 | |
| 740 | 818 | static MACHINE_DRIVER_START( crystal ) |
| 819 | |
| 820 | MDRV_DRIVER_DATA(crystal_state) |
| 821 | |
| 741 | 822 | MDRV_CPU_ADD("maincpu", SE3208, 43000000) |
| 742 | 823 | MDRV_CPU_PROGRAM_MAP(crystal_mem) |
| 743 | 824 | MDRV_CPU_VBLANK_INT("screen", crystal_interrupt) |
| r7972 | r7973 | |
| 754 | 835 | MDRV_SCREEN_SIZE(320, 240) |
| 755 | 836 | MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239) |
| 756 | 837 | |
| 757 | | MDRV_VIDEO_START(crystal) |
| 758 | 838 | MDRV_VIDEO_UPDATE(crystal) |
| 759 | 839 | MDRV_VIDEO_EOF(crystal) |
| 760 | 840 | |
| 841 | MDRV_VIDEO_VRENDER0_ADD("vr0", vr0video_config) |
| 842 | |
| 761 | 843 | MDRV_PALETTE_INIT(RRRRR_GGGGGG_BBBBB) |
| 762 | 844 | MDRV_PALETTE_LENGTH(65536) |
| 763 | 845 | |
| r7972 | r7973 | |
| 841 | 923 | |
| 842 | 924 | static DRIVER_INIT(crysking) |
| 843 | 925 | { |
| 844 | | UINT16 *Rom=(UINT16*) memory_region(machine, "user1"); |
| 926 | UINT16 *Rom = (UINT16*) memory_region(machine, "user1"); |
| 845 | 927 | |
| 846 | 928 | //patch the data feed by the protection |
| 847 | 929 | |
| 848 | | Rom[WORD_XOR_LE(0x7bb6/2)]=0xDF01; |
| 849 | | Rom[WORD_XOR_LE(0x7bb8/2)]=0x9C00; |
| 930 | Rom[WORD_XOR_LE(0x7bb6/2)] = 0xDF01; |
| 931 | Rom[WORD_XOR_LE(0x7bb8/2)] = 0x9C00; |
| 850 | 932 | |
| 851 | | Rom[WORD_XOR_LE(0x976a/2)]=0x901C; |
| 852 | | Rom[WORD_XOR_LE(0x976c/2)]=0x9001; |
| 933 | Rom[WORD_XOR_LE(0x976a/2)] = 0x901C; |
| 934 | Rom[WORD_XOR_LE(0x976c/2)] = 0x9001; |
| 853 | 935 | |
| 854 | | Rom[WORD_XOR_LE(0x8096/2)]=0x90FC; |
| 855 | | Rom[WORD_XOR_LE(0x8098/2)]=0x9001; |
| 936 | Rom[WORD_XOR_LE(0x8096/2)] = 0x90FC; |
| 937 | Rom[WORD_XOR_LE(0x8098/2)] = 0x9001; |
| 856 | 938 | |
| 857 | | Rom[WORD_XOR_LE(0x8a52/2)]=0x4000; //NOP |
| 858 | | Rom[WORD_XOR_LE(0x8a54/2)]=0x403c; //NOP |
| 939 | Rom[WORD_XOR_LE(0x8a52/2)] = 0x4000; //NOP |
| 940 | Rom[WORD_XOR_LE(0x8a54/2)] = 0x403c; //NOP |
| 859 | 941 | } |
| 860 | 942 | |
| 861 | 943 | static DRIVER_INIT(evosocc) |
| 862 | 944 | { |
| 863 | | UINT16 *Rom=(UINT16*) memory_region(machine, "user1"); |
| 864 | | Rom+=0x1000000*2/2; |
| 945 | UINT16 *Rom = (UINT16*) memory_region(machine, "user1"); |
| 946 | Rom += 0x1000000 * 2 / 2; |
| 865 | 947 | |
| 866 | | Rom[WORD_XOR_LE(0x97388E/2)]=0x90FC; //PUSH R2..R7 |
| 867 | | Rom[WORD_XOR_LE(0x973890/2)]=0x9001; //PUSH R0 |
| 948 | Rom[WORD_XOR_LE(0x97388E/2)] = 0x90FC; //PUSH R2..R7 |
| 949 | Rom[WORD_XOR_LE(0x973890/2)] = 0x9001; //PUSH R0 |
| 868 | 950 | |
| 869 | | Rom[WORD_XOR_LE(0x971058/2)]=0x907C; //PUSH R2..R6 |
| 870 | | Rom[WORD_XOR_LE(0x971060/2)]=0x9001; //PUSH R0 |
| 951 | Rom[WORD_XOR_LE(0x971058/2)] = 0x907C; //PUSH R2..R6 |
| 952 | Rom[WORD_XOR_LE(0x971060/2)] = 0x9001; //PUSH R0 |
| 871 | 953 | |
| 872 | | Rom[WORD_XOR_LE(0x978036/2)]=0x900C; //PUSH R2-R3 |
| 873 | | Rom[WORD_XOR_LE(0x978038/2)]=0x8303; //LD (%SP,0xC),R3 |
| 954 | Rom[WORD_XOR_LE(0x978036/2)] = 0x900C; //PUSH R2-R3 |
| 955 | Rom[WORD_XOR_LE(0x978038/2)] = 0x8303; //LD (%SP,0xC),R3 |
| 874 | 956 | |
| 875 | | Rom[WORD_XOR_LE(0x974ED0/2)]=0x90FC; //PUSH R7-R6-R5-R4-R3-R2 |
| 876 | | Rom[WORD_XOR_LE(0x974ED2/2)]=0x9001; //PUSH R0 |
| 957 | Rom[WORD_XOR_LE(0x974ED0/2)] = 0x90FC; //PUSH R7-R6-R5-R4-R3-R2 |
| 958 | Rom[WORD_XOR_LE(0x974ED2/2)] = 0x9001; //PUSH R0 |
| 877 | 959 | } |
| 878 | 960 | |
| 879 | 961 | static DRIVER_INIT(topbladv) |
| 880 | 962 | { |
| 881 | | UINT16 *Rom=(UINT16*) memory_region(machine, "user1"); |
| 963 | UINT16 *Rom = (UINT16*) memory_region(machine, "user1"); |
| 882 | 964 | |
| 883 | | Rom[WORD_XOR_LE(0x12d7a/2)]=0x90FC; //PUSH R7-R6-R5-R4-R3-R2 |
| 884 | | Rom[WORD_XOR_LE(0x12d7c/2)]=0x9001; //PUSH R0 |
| 965 | Rom[WORD_XOR_LE(0x12d7a/2)] = 0x90FC; //PUSH R7-R6-R5-R4-R3-R2 |
| 966 | Rom[WORD_XOR_LE(0x12d7c/2)] = 0x9001; //PUSH R0 |
| 885 | 967 | |
| 886 | | Rom[WORD_XOR_LE(0x2fe18/2)]=0x9001; //PUSH R0 |
| 887 | | Rom[WORD_XOR_LE(0x2fe1a/2)]=0x9200; //PUSH SR |
| 968 | Rom[WORD_XOR_LE(0x2fe18/2)] = 0x9001; //PUSH R0 |
| 969 | Rom[WORD_XOR_LE(0x2fe1a/2)] = 0x9200; //PUSH SR |
| 888 | 970 | |
| 889 | | Rom[WORD_XOR_LE(0x18880/2)]=0x9001; //PUSH R0 |
| 890 | | Rom[WORD_XOR_LE(0x18882/2)]=0x9200; //PUSH SR |
| 971 | Rom[WORD_XOR_LE(0x18880/2)] = 0x9001; //PUSH R0 |
| 972 | Rom[WORD_XOR_LE(0x18882/2)] = 0x9200; //PUSH SR |
| 891 | 973 | |
| 892 | | Rom[WORD_XOR_LE(0xDACE/2)]=0x901C; //PUSH R4-R3-R2 |
| 893 | | Rom[WORD_XOR_LE(0xDAD0/2)]=0x9001; //PUSH R0 |
| 974 | Rom[WORD_XOR_LE(0xDACE/2)] = 0x901C; //PUSH R4-R3-R2 |
| 975 | Rom[WORD_XOR_LE(0xDAD0/2)] = 0x9001; //PUSH R0 |
| 894 | 976 | |
| 895 | 977 | } |
| 896 | 978 | |
| 897 | 979 | static DRIVER_INIT(officeye) |
| 898 | 980 | { |
| 899 | | UINT16 *Rom=(UINT16*) memory_region(machine, "user1"); |
| 981 | UINT16 *Rom = (UINT16*) memory_region(machine, "user1"); |
| 900 | 982 | |
| 901 | | Rom[WORD_XOR_LE(0x9c9e/2)]=0x901C; //PUSH R4-R3-R2 |
| 902 | | Rom[WORD_XOR_LE(0x9ca0/2)]=0x9001; //PUSH R0 |
| 983 | Rom[WORD_XOR_LE(0x9c9e/2)] = 0x901C; //PUSH R4-R3-R2 |
| 984 | Rom[WORD_XOR_LE(0x9ca0/2)] = 0x9001; //PUSH R0 |
| 903 | 985 | |
| 904 | | Rom[WORD_XOR_LE(0x9EE4/2)]=0x907C; //PUSH R6-R5-R4-R3-R2 |
| 905 | | Rom[WORD_XOR_LE(0x9EE6/2)]=0x9001; //PUSH R0 |
| 986 | Rom[WORD_XOR_LE(0x9EE4/2)] = 0x907C; //PUSH R6-R5-R4-R3-R2 |
| 987 | Rom[WORD_XOR_LE(0x9EE6/2)] = 0x9001; //PUSH R0 |
| 906 | 988 | |
| 907 | | Rom[WORD_XOR_LE(0x4B2E0/2)]=0x9004; //PUSH R2 |
| 908 | | Rom[WORD_XOR_LE(0x4B2E2/2)]=0x9001; //PUSH R0 |
| 989 | Rom[WORD_XOR_LE(0x4B2E0/2)] = 0x9004; //PUSH R2 |
| 990 | Rom[WORD_XOR_LE(0x4B2E2/2)] = 0x9001; //PUSH R0 |
| 909 | 991 | |
| 910 | 992 | /* |
| 911 | | Rom[WORD_XOR_LE(0x18880/2)]=0x9001; //PUSH R0 |
| 912 | | Rom[WORD_XOR_LE(0x18882/2)]=0x9200; //PUSH SR |
| 993 | Rom[WORD_XOR_LE(0x18880/2)] = 0x9001; //PUSH R0 |
| 994 | Rom[WORD_XOR_LE(0x18882/2)] = 0x9200; //PUSH SR |
| 913 | 995 | */ |
| 914 | 996 | } |
| 915 | 997 | |
| 916 | 998 | |
| 917 | 999 | |
| 918 | | GAME( 2001, crysbios, 0, crystal, crystal, 0, ROT0, "Brezzasoft", "Crystal System BIOS", GAME_IS_BIOS_ROOT ) |
| 919 | | GAME( 2001, crysking, crysbios, crystal, crystal, crysking, ROT0, "Brezzasoft", "The Crystal of Kings", 0 ) |
| 920 | | GAME( 2001, evosocc, crysbios, crystal, crystal, evosocc, ROT0, "Evoga", "Evolution Soccer", 0 ) |
| 921 | | GAME( 2003, topbladv, crysbios, topbladv,crystal, topbladv, ROT0, "SonoKong / Expotato", "Top Blade V", GAME_NOT_WORKING ) // protection |
| 922 | | GAME( 2001, officeye, 0, crystal, crystal, officeye, ROT0, "Danbi", "Office Yeo In Cheon Ha (version 1.2)", GAME_NOT_WORKING ) // protection |
| 1000 | GAME( 2001, crysbios, 0, crystal, crystal, 0, ROT0, "Brezzasoft", "Crystal System BIOS", GAME_IS_BIOS_ROOT ) |
| 1001 | GAME( 2001, crysking, crysbios, crystal, crystal, crysking, ROT0, "Brezzasoft", "The Crystal of Kings", 0 ) |
| 1002 | GAME( 2001, evosocc, crysbios, crystal, crystal, evosocc, ROT0, "Evoga", "Evolution Soccer", 0 ) |
| 1003 | GAME( 2003, topbladv, crysbios, topbladv, crystal, topbladv, ROT0, "SonoKong / Expotato", "Top Blade V", GAME_NOT_WORKING ) // protection |
| 1004 | GAME( 2001, officeye, 0, crystal, crystal, officeye, ROT0, "Danbi", "Office Yeo In Cheon Ha (version 1.2)", GAME_NOT_WORKING ) // protection |
src/mame/drivers/subsino.c
| r7972 | r7973 | |
| 166 | 166 | - Figured out and documented all the game outputs. |
| 167 | 167 | - Created proper button-lamps layout. |
| 168 | 168 | |
| 169 | Now the game is in full-working state. |
| 169 | 170 | |
| 171 | |
| 172 | 2010-04-22 |
| 173 | ---------- |
| 174 | |
| 175 | Treasure Bonus (Subsino) |
| 176 | |
| 177 | - Reworked and cleaned-up the inputs. |
| 178 | Most buttons have more than one single function. |
| 179 | - Added DIP locations. |
| 180 | - Figured out the following DIP Switches: |
| 181 | Complete Coinage (1/2/5/10/20/25/50/100). |
| 182 | Remote Credits (1/2/5/10/20/25/50/100). |
| 183 | Minimum Bet (1/8/16/32). |
| 184 | Max Bet (16/32/64/80). |
| 185 | Demo Sounds (Off/On). |
| 186 | Game Limit (10000/20000/30000/60000). |
| 187 | Double-Up (No/Yes). |
| 188 | Win Rate (84/86/88/90/92/94/96%). |
| 189 | Double-Up Level (0/1/2/3/4/5/6/7). |
| 190 | Double-Up Game (Dancers / Panties Colors / Cards / Seven-Bingo). |
| 191 | |
| 192 | - Fixed inverted functions and buggy inputs. |
| 193 | - Added lamps support. |
| 194 | - Created button-lamps layout. |
| 195 | - Remapped inputs to reflect the controls layout. This way is more |
| 196 | user-friendly since controls are straight with button-lamps. |
| 197 | - Added coin/keyin/keyout/payout counters. |
| 198 | - Removed the pulse limitation in the BET input. This allow it to work |
| 199 | as BET and STOP2 properly. |
| 200 | - Added technical notes. |
| 201 | |
| 202 | |
| 170 | 203 | ***************************************************************************/ |
| 171 | 204 | |
| 172 | 205 | #include "emu.h" |
| r7972 | r7973 | |
| 182 | 215 | #include "sharkpye.lh" |
| 183 | 216 | #include "smoto.lh" |
| 184 | 217 | #include "tisub.lh" |
| 218 | #include "stisub.lh" |
| 185 | 219 | |
| 186 | 220 | |
| 187 | 221 | /*************************************************************************** |
| r7972 | r7973 | |
| 508 | 542 | /***** COIN PULSE: ***** |
| 509 | 543 | |
| 510 | 544 | |
| 511 | | * Victor 5, Victor 21, Poker Carnival (crsbingo), Shark Party (English, Alpha license). |
| 545 | * Victor 5, Victor 21, Poker Carnival (crsbingo), |
| 546 | Shark Party (English, Alpha license), Treasure Bonus (Subsino). |
| 512 | 547 | |
| 513 | 548 | 7654 3210 |
| 514 | 549 | ---- ---x Coin pulse. |
| r7972 | r7973 | |
| 645 | 680 | -x-- ---- ???. |
| 646 | 681 | x--- ---- HOLD4 & HOLD5. |
| 647 | 682 | |
| 683 | |
| 684 | * Treasure Bonus (Subsino). |
| 685 | |
| 686 | 7654 3210 |
| 687 | ---- ---x SMALL / RED / STOP3. |
| 688 | ---- --x- D-UP / INFO. |
| 689 | ---- -x-- START / STOP ALL. |
| 690 | ---- x--- BET / STOP2. |
| 691 | ---x ---- ???. |
| 692 | --x- ---- TAKE / STOP1. |
| 693 | -x-- ---- ???. |
| 694 | x--- ---- BIG / BLACK. |
| 695 | |
| 696 | |
| 697 | After seeing the button/lamps functions, I think that controls layout should be |
| 698 | arranged the following way: |
| 699 | |
| 700 | ________ ________ ________ ________ ________ __________ |
| 701 | | | | | | | | | | | | | |
| 702 | | D-UP | | TAKE | | BET | | SMALL | | BIG | | START | |
| 703 | | INFO | | STOP 1 | | STOP 2 | | STOP 3 | | | | STOP ALL | |
| 704 | |________| |________| |________| |________| |________| |__________| |
| 705 | |
| 706 | Key 'Z' Key 'X' Key 'C' Key 'V' Key 'B' Key 'N' |
| 707 | |
| 708 | Mapped to the above keys to be more user-friendly. |
| 709 | |
| 648 | 710 | */ |
| 649 | 711 | |
| 650 | 712 | output_set_lamp_value(0, (data) & 1); /* Lamp 0 */ |
| r7972 | r7973 | |
| 1041 | 1103 | AM_RANGE( 0x0000, 0x003f ) AM_RAM // internal regs |
| 1042 | 1104 | ADDRESS_MAP_END |
| 1043 | 1105 | |
| 1106 | |
| 1044 | 1107 | /*************************************************************************** |
| 1045 | 1108 | * Input Ports * |
| 1046 | 1109 | ***************************************************************************/ |
| r7972 | r7973 | |
| 1398 | 1461 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1399 | 1462 | INPUT_PORTS_END |
| 1400 | 1463 | |
| 1464 | |
| 1401 | 1465 | static INPUT_PORTS_START( stisub ) |
| 1402 | 1466 | PORT_START("SW1") |
| 1403 | | PORT_DIPNAME( 0x01, 0x01, "SW1" ) |
| 1404 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 1405 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1406 | | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) |
| 1407 | | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 1408 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1409 | | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) |
| 1410 | | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 1411 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1412 | | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) |
| 1413 | | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 1414 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1415 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) |
| 1416 | | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 1417 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1418 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) |
| 1419 | | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 1420 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1421 | | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) |
| 1467 | PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2,3") |
| 1468 | PORT_DIPSETTING( 0x06, DEF_STR( 1C_1C ) ) |
| 1469 | PORT_DIPSETTING( 0x05, DEF_STR( 1C_2C ) ) |
| 1470 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_5C ) ) |
| 1471 | PORT_DIPSETTING( 0x07, "1 Coin / 10 Credits" ) |
| 1472 | PORT_DIPSETTING( 0x03, "1 Coin / 20 Credits" ) |
| 1473 | PORT_DIPSETTING( 0x02, "1 Coin / 25 Credits" ) |
| 1474 | PORT_DIPSETTING( 0x01, "1 Coin / 50 Credits" ) |
| 1475 | PORT_DIPSETTING( 0x00, "1 Coin / 100 Credits" ) |
| 1476 | PORT_DIPNAME( 0x38, 0x00, "Remote Credits" ) PORT_DIPLOCATION("SW1:4,5,6") |
| 1477 | PORT_DIPSETTING( 0x30, "1 Pulse / 1 Credits" ) |
| 1478 | PORT_DIPSETTING( 0x28, "1 Pulse / 2 Credits" ) |
| 1479 | PORT_DIPSETTING( 0x20, "1 Pulse / 5 Credits" ) |
| 1480 | PORT_DIPSETTING( 0x38, "1 Pulse / 10 Credits" ) |
| 1481 | PORT_DIPSETTING( 0x18, "1 Pulse / 20 Credits" ) |
| 1482 | PORT_DIPSETTING( 0x10, "1 Pulse / 25 Credits" ) |
| 1483 | PORT_DIPSETTING( 0x08, "1 Pulse / 50 Credits" ) |
| 1484 | PORT_DIPSETTING( 0x00, "1 Pulse / 100 Credits" ) |
| 1485 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:7") |
| 1422 | 1486 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 1423 | 1487 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1424 | | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) |
| 1488 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:8") |
| 1425 | 1489 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 1426 | 1490 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1427 | 1491 | |
| 1428 | 1492 | PORT_START("SW2") |
| 1429 | | PORT_DIPNAME( 0x01, 0x01, "SW2" ) |
| 1430 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 1431 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1432 | | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) |
| 1433 | | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 1434 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1435 | | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) |
| 1436 | | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 1437 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1438 | | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) |
| 1439 | | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 1440 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1441 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) |
| 1493 | PORT_DIPNAME( 0x03, 0x03, "Minimum Bet" ) PORT_DIPLOCATION("SW2:1,2") |
| 1494 | PORT_DIPSETTING( 0x02, "1" ) |
| 1495 | PORT_DIPSETTING( 0x03, "8" ) |
| 1496 | PORT_DIPSETTING( 0x01, "16" ) |
| 1497 | PORT_DIPSETTING( 0x00, "32" ) |
| 1498 | PORT_DIPNAME( 0x0c, 0x0c, "Max Bet" ) PORT_DIPLOCATION("SW2:3,4") |
| 1499 | PORT_DIPSETTING( 0x04, "16" ) |
| 1500 | PORT_DIPSETTING( 0x08, "32" ) |
| 1501 | PORT_DIPSETTING( 0x0c, "64" ) |
| 1502 | PORT_DIPSETTING( 0x00, "80" ) |
| 1503 | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:5") |
| 1442 | 1504 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 1443 | 1505 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1444 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) |
| 1445 | | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 1446 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1447 | | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) |
| 1448 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 1449 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1450 | | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) |
| 1451 | | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 1452 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1506 | PORT_DIPNAME( 0x60, 0x60, "Game Limit" ) PORT_DIPLOCATION("SW2:6,7") |
| 1507 | PORT_DIPSETTING( 0x40, "10000" ) |
| 1508 | PORT_DIPSETTING( 0x60, "20000" ) |
| 1509 | PORT_DIPSETTING( 0x20, "30000" ) |
| 1510 | PORT_DIPSETTING( 0x00, "60000" ) |
| 1511 | PORT_DIPNAME( 0x80, 0x80, "Double Up" ) PORT_DIPLOCATION("SW2:8") |
| 1512 | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 1513 | PORT_DIPSETTING( 0x80, DEF_STR( Yes ) ) |
| 1453 | 1514 | |
| 1454 | | PORT_START("SW3") |
| 1455 | | PORT_DIPNAME( 0x01, 0x01, "SW3" ) |
| 1456 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 1457 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1458 | | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) |
| 1459 | | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 1460 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1461 | | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) |
| 1462 | | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 1463 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1464 | | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) |
| 1515 | PORT_START( "SW3" ) |
| 1516 | PORT_DIPNAME( 0x07, 0x07, "Win Rate" ) PORT_DIPLOCATION("SW3:1,2,3") |
| 1517 | PORT_DIPSETTING( 0x00, "84%" ) |
| 1518 | PORT_DIPSETTING( 0x01, "84%" ) // yes, again! |
| 1519 | PORT_DIPSETTING( 0x02, "86%" ) |
| 1520 | PORT_DIPSETTING( 0x03, "88%" ) |
| 1521 | PORT_DIPSETTING( 0x04, "90%" ) |
| 1522 | PORT_DIPSETTING( 0x07, "92%" ) |
| 1523 | PORT_DIPSETTING( 0x05, "94%" ) |
| 1524 | PORT_DIPSETTING( 0x06, "96%" ) |
| 1525 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:4") |
| 1465 | 1526 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 1466 | 1527 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1467 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) |
| 1528 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:5") |
| 1468 | 1529 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 1469 | 1530 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1470 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) |
| 1531 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:6") |
| 1471 | 1532 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 1472 | 1533 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1473 | | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) |
| 1534 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:7") |
| 1474 | 1535 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 1475 | 1536 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1476 | | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) |
| 1537 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:8") |
| 1477 | 1538 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 1478 | 1539 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1479 | 1540 | |
| 1480 | | PORT_START("SW4") |
| 1481 | | PORT_DIPNAME( 0x01, 0x01, "SW4" ) |
| 1482 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 1483 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1484 | | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) |
| 1485 | | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 1486 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1487 | | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) |
| 1488 | | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 1489 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1490 | | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) |
| 1541 | PORT_START( "SW4" ) |
| 1542 | PORT_DIPNAME( 0x07, 0x07, "Double-Up Level" ) PORT_DIPLOCATION("SW4:1,2,3") |
| 1543 | PORT_DIPSETTING( 0x00, "0" ) |
| 1544 | PORT_DIPSETTING( 0x01, "1" ) |
| 1545 | PORT_DIPSETTING( 0x02, "2" ) |
| 1546 | PORT_DIPSETTING( 0x03, "3" ) |
| 1547 | PORT_DIPSETTING( 0x04, "4" ) |
| 1548 | PORT_DIPSETTING( 0x05, "5" ) |
| 1549 | PORT_DIPSETTING( 0x06, "6" ) |
| 1550 | PORT_DIPSETTING( 0x07, "7" ) |
| 1551 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW4:4") |
| 1491 | 1552 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 1492 | 1553 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1493 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) |
| 1494 | | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 1495 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1496 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) |
| 1554 | PORT_DIPNAME( 0x10, 0x10, "Double-Up Game" ) PORT_DIPLOCATION("SW4:5") |
| 1555 | PORT_DIPSETTING( 0x10, "Dancers / Panties Colors" ) |
| 1556 | PORT_DIPSETTING( 0x00, "Cards / Seven-Bingo" ) |
| 1557 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW4:6") |
| 1497 | 1558 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 1498 | 1559 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1499 | | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) |
| 1560 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW4:7") |
| 1500 | 1561 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 1501 | 1562 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1502 | | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) |
| 1563 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW4:8") |
| 1503 | 1564 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 1504 | 1565 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1505 | 1566 | |
| 1506 | | /* |
| 1507 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) PORT_NAME("Hold 1") |
| 1508 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) PORT_NAME("Hold 2 / Big") |
| 1509 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) PORT_NAME("Hold 3 / Small") |
| 1510 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1511 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_POKER_BET ) PORT_IMPULSE(3) |
| 1512 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1513 | | */ |
| 1514 | | |
| 1515 | 1567 | PORT_START("INA") |
| 1516 | | PORT_DIPNAME( 0x01, 0x01, "INA" ) |
| 1517 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 1518 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1519 | | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) |
| 1520 | | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 1521 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1522 | | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) |
| 1523 | | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 1524 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1525 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL ) PORT_NAME("Start") |
| 1526 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_POKER_BET ) PORT_IMPULSE(3) |
| 1527 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_D_UP ) PORT_NAME("Double / Info") |
| 1528 | | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) |
| 1529 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 1530 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1531 | | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) |
| 1532 | | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 1533 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1568 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1569 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1570 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1571 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START ) PORT_CODE(KEYCODE_N) PORT_NAME("Start / Stop All") |
| 1572 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_POKER_BET ) PORT_CODE(KEYCODE_C) PORT_NAME("Bet / Stop 2") |
| 1573 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_D_UP ) PORT_CODE(KEYCODE_Z) PORT_NAME("Double / Info") |
| 1574 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1575 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1534 | 1576 | |
| 1535 | 1577 | PORT_START( "INB" ) |
| 1536 | 1578 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(3) // coin |
| r7972 | r7973 | |
| 1543 | 1585 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) // key out |
| 1544 | 1586 | |
| 1545 | 1587 | PORT_START("INC") |
| 1546 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH ) PORT_NAME("Black") |
| 1547 | | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) |
| 1548 | | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 1549 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1588 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) PORT_CODE(KEYCODE_V) PORT_NAME("Small / Black / Stop 3") |
| 1589 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1550 | 1590 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_R) PORT_NAME("Reset") // hard reset |
| 1551 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) PORT_NAME("Red") |
| 1552 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) |
| 1553 | | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 1554 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1555 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) |
| 1556 | | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 1557 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1558 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_TAKE ) |
| 1559 | | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) |
| 1560 | | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 1561 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1591 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH ) PORT_CODE(KEYCODE_B) PORT_NAME("Big / Red") |
| 1592 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1593 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1594 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_TAKE ) PORT_CODE(KEYCODE_X) PORT_NAME("Take / Stop 1") |
| 1595 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1562 | 1596 | INPUT_PORTS_END |
| 1563 | 1597 | |
| 1598 | |
| 1564 | 1599 | static INPUT_PORTS_START( crsbingo ) |
| 1565 | 1600 | |
| 1566 | 1601 | PORT_START( "SW1" ) |
| r7972 | r7973 | |
| 2083 | 2118 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 2084 | 2119 | INPUT_PORTS_END |
| 2085 | 2120 | |
| 2121 | |
| 2086 | 2122 | /*************************************************************************** |
| 2087 | 2123 | * Graphics Layout * |
| 2088 | 2124 | ***************************************************************************/ |
| r7972 | r7973 | |
| 2162 | 2198 | GFXDECODE_ENTRY( "reels", 0, layout_8x32x8, 0, 1 ) |
| 2163 | 2199 | GFXDECODE_END |
| 2164 | 2200 | |
| 2201 | |
| 2165 | 2202 | /*************************************************************************** |
| 2166 | 2203 | * Machine Drivers * |
| 2167 | 2204 | ***************************************************************************/ |
| r7972 | r7973 | |
| 2896 | 2933 | ROM_LOAD( "sti-alpha_9-ver1.1.u22", 0x60000, 0x20000, CRC(9710a223) SHA1(76ef6bd77ae33d91a9b6a9a615d07caee3356dfb) ) |
| 2897 | 2934 | ROM_END |
| 2898 | 2935 | |
| 2936 | |
| 2899 | 2937 | /*************************************************************************** |
| 2900 | 2938 | * Driver Init / Decryption * |
| 2901 | 2939 | ***************************************************************************/ |
| r7972 | r7973 | |
| 3073 | 3111 | |
| 3074 | 3112 | } |
| 3075 | 3113 | |
| 3114 | |
| 3076 | 3115 | /*************************************************************************** |
| 3077 | 3116 | * Game Drivers * |
| 3078 | 3117 | ***************************************************************************/ |
| 3079 | 3118 | |
| 3080 | 3119 | /* YEAR NAME PARENT MACHINE INPUT INIT ROT COMPANY FULLNAME FLAGS LAYOUT */ |
| 3081 | 3120 | GAMEL( 1990, victor21, 0, victor21, victor21, victor21, ROT0, "Subsino / Buffy", "Victor 21", 0, layout_victor21 ) |
| 3082 | | GAMEL( 1991, victor5, 0, victor5, victor5, victor5, ROT0, "Subsino", "G.E.A.", 0, layout_victor5 ) // PCB black-box was marked 'victor 5' - in-game says G.E.A with no manufacturer info? |
| 3121 | GAMEL( 1991, victor5, 0, victor5, victor5, victor5, ROT0, "Subsino", "G.E.A.", 0, layout_victor5 ) // PCB black-box was marked 'victor 5' - in-game says G.E.A with no manufacturer info? |
| 3083 | 3122 | GAMEL( 1992, tisub, 0, tisub, tisub, tisub, ROT0, "Subsino", "Treasure Island (Subsino, set 1)", 0, layout_tisub ) |
| 3084 | 3123 | GAMEL( 1992, tisuba, tisub, tisub, tisub, tisuba, ROT0, "Subsino", "Treasure Island (Subsino, set 2)", 0, layout_tisub ) |
| 3085 | 3124 | GAMEL( 1991, crsbingo, 0, crsbingo, crsbingo, crsbingo, ROT0, "Subsino", "Poker Carnival", 0, layout_crsbingo ) |
| 3086 | | GAME( 1995, stisub, 0, stisub, stisub, stisub, ROT0, "Alpha", "Treasure Bonus (Subsino)", 0 ) // board CPU module marked 'Super Treasure Island' (alt title?) |
| 3087 | | GAMEL( 1996, sharkpy, 0, sharkpy, sharkpy, sharkpy, ROT0, "Subsino", "Shark Party (Italy, v1.3)", 0, layout_sharkpy ) // missing POST messages? |
| 3088 | | GAMEL( 1996, sharkpya, sharkpy, sharkpy, sharkpy, sharkpy, ROT0, "Subsino", "Shark Party (Italy, v1.6)", 0, layout_sharkpy ) // missing POST messages? |
| 3089 | | GAMEL( 1995, sharkpye, sharkpy, sharkpy, sharkpye, sharkpye, ROT0, "Alpha", "Shark Party (English, Alpha license)", 0, layout_sharkpye ) // PCB black-box was marked 'victor 6' |
| 3125 | GAMEL( 1995, stisub, 0, stisub, stisub, stisub, ROT0, "Alpha", "Treasure Bonus (Subsino)", 0, layout_stisub ) // board CPU module marked 'Super Treasure Island' (alt title?) |
| 3126 | GAMEL( 1996, sharkpy, 0, sharkpy, sharkpy, sharkpy, ROT0, "Subsino", "Shark Party (Italy, v1.3)", 0, layout_sharkpy ) // missing POST messages? |
| 3127 | GAMEL( 1996, sharkpya, sharkpy, sharkpy, sharkpy, sharkpy, ROT0, "Subsino", "Shark Party (Italy, v1.6)", 0, layout_sharkpy ) // missing POST messages? |
| 3128 | GAMEL( 1995, sharkpye, sharkpy, sharkpy, sharkpye, sharkpye, ROT0, "Alpha", "Shark Party (English, Alpha license)", 0, layout_sharkpye ) // PCB black-box was marked 'victor 6' |
| 3090 | 3129 | GAMEL( 1996, smoto20, 0, srider, smoto20, smoto20, ROT0, "Subsino", "Super Rider (Italy, v2.0)", 0, layout_smoto ) |
| 3091 | 3130 | GAMEL( 1996, smoto16, smoto20, srider, smoto16, smoto16, ROT0, "Subsino", "Super Moto (Italy, v1.6)", 0, layout_smoto ) |
src/emu/sound/tms5110r.c
| r7972 | r7973 | |
| 40 | 40 | #define SUBTYPE_TMS5200 8 |
| 41 | 41 | #define SUBTYPE_TMS5220 16 |
| 42 | 42 | #define SUBTYPE_TMS5220C 32 |
| 43 | #define SUBTYPE_PAT4335277 64 |
| 43 | 44 | |
| 44 | 45 | /* coefficient defines */ |
| 45 | 46 | #define MAX_K 10 |
| 46 | 47 | #define MAX_SCALE_BITS 6 |
| 47 | 48 | #define MAX_SCALE (1<<MAX_SCALE_BITS) |
| 48 | 49 | #define COEFF_ENERGY_SENTINEL (511) |
| 49 | | #define MAX_CHIRP_SIZE 51 |
| 50 | #define MAX_CHIRP_SIZE 52 |
| 50 | 51 | |
| 51 | 52 | struct tms5100_coeffs |
| 52 | 53 | { |
| r7972 | r7973 | |
| 58 | 59 | unsigned short energytable[MAX_SCALE]; |
| 59 | 60 | unsigned short pitchtable[MAX_SCALE]; |
| 60 | 61 | int ktable[MAX_K][MAX_SCALE]; |
| 61 | | INT8 chirptable[MAX_CHIRP_SIZE]; |
| 62 | INT16 chirptable[MAX_CHIRP_SIZE]; |
| 62 | 63 | INT8 interp_coeff[8]; |
| 63 | 64 | }; |
| 64 | 65 | |
| r7972 | r7973 | |
| 120 | 121 | 37, 43, 34, 33, 15, -1, -8,-18, |
| 121 | 122 | -19,-17, -9,-10, -6, 0, 3, 2, |
| 122 | 123 | 1, 0, 0, 0, 0, 0, 0, 0, |
| 123 | | 0, 0, 0 }, |
| 124 | 0, 0, 0, 0 }, |
| 124 | 125 | /* interpolation coefficients */ |
| 125 | 126 | { 3, 3, 3, 2, 2, 2, 1, 0 } |
| 126 | 127 | }; |
| r7972 | r7973 | |
| 184 | 185 | }, |
| 185 | 186 | }, |
| 186 | 187 | /* Chirp table */ |
| 187 | | { 0,43,-44,51,-77,18,37,20, |
| 188 | | 2,-30,-58,3,96,91,5,15, |
| 189 | | 38,-4,-90,-91,-42,-35,-35,-3, |
| 190 | | 37,43,35,34,15,-1,-8,-17, |
| 191 | | -19,-17,-9,-9,-6,1,4,3, |
| 192 | | 1,0,0,0,0,0,0,0, |
| 193 | | 0,0,0 |
| 194 | | }, |
| 188 | { 0, 43, -44, 51,-77, 18, 37, 20, |
| 189 | 2,-30, -58, 3, 96, 91, 5, 15, |
| 190 | 38, -4, -90,-91,-42,-35,-35, -3, |
| 191 | 37, 43, 35, 34, 15, -1, -8,-17, |
| 192 | -19,-17, -9, -9, -6, 1, 4, 3, |
| 193 | 1, 0, 0, 0, 0, 0, 0, 0, |
| 194 | 0, 0, 0, 0 }, |
| 195 | 195 | /* interpolation coefficients */ |
| 196 | 196 | { 3, 3, 3, 2, 2, 2, 1, 0 } |
| 197 | 197 | }; |
| 198 | 198 | |
| 199 | | /* The following TMS5110A LPC coefficients were read from an actual chip by Jarek Burczynski using the PROMOUT pin, and can be regarded as established fact. However, the chirp table and the interpolation coefficients still came from the patents as there doesn't seem to be an easy way to read those out from the chip without decapping it. |
| 199 | /* The following TMS5110A LPC coefficients were directly read from an actual TMS5110A chip by Jarek Burczynski using the PROMOUT pin, and can be regarded as established fact. However, the chirp table and the interpolation coefficients still come from the patents as there doesn't seem to be an easy way to read those out from the chip without decapping it. |
| 200 | 200 | */ |
| 201 | 201 | static const struct tms5100_coeffs tms5110a_coeff = |
| 202 | 202 | { |
| r7972 | r7973 | |
| 251 | 251 | { 0, 42, -44, 50, -78, 18, 37, 20, |
| 252 | 252 | 2, -31, -59, 2, 95, 90, 5, 15, |
| 253 | 253 | 38, -4, -91,-91, -42,-35,-36, -4, |
| 254 | | 37, 43, 34, 33, 15, -1, -8,-18, |
| 254 | 37, 43, 34, 33, 15, -1, -8,-18, |
| 255 | 255 | -19,-17, -9,-10, -6, 0, 3, 2, |
| 256 | 256 | 1, 0, 0, 0, 0, 0, 0, 0, |
| 257 | | 0, 0, 0 }, |
| 257 | 0, 0, 0, 0 }, |
| 258 | 258 | /* interpolation coefficients */ |
| 259 | 259 | { 3, 3, 3, 2, 2, 2, 1, 0 } |
| 260 | 260 | }; |
| 261 | 261 | |
| 262 | | /* The following TMS5200/TMC0285 coefficients come from US Patent 4,335,277 and 4,581,757. However, the K10 row of coefficients are entirely missing from both of those patents. |
| 263 | | ***These values have not yet been verified against a real TMS5200 or TMC0285*** |
| 262 | /* The following coefficients come from US Patent 4,335,277 and 4,581,757. However, the K10 row of coefficients are entirely missing from both of those patents. |
| 263 | The K values don't match the values read from an actual TMS5200 chip, but might match the CD2501 or some other undiscovered chip? |
| 264 | 264 | */ |
| 265 | 265 | // k* is followed by d if done transcription, c if checked for derivative aberrations |
| 266 | | static const struct tms5100_coeffs tms5200_coeff = |
| 266 | static const struct tms5100_coeffs pat4335277_coeff = |
| 267 | 267 | { |
| 268 | 268 | /* subtype */ |
| 269 | | SUBTYPE_TMS5200, |
| 269 | SUBTYPE_PAT4335277, |
| 270 | 270 | 10, |
| 271 | 271 | 4, |
| 272 | 272 | 6, |
| r7972 | r7973 | |
| 313 | 313 | { -195, -117, -32, 54, 137, 213, 279, 335 }, |
| 314 | 314 | /* K9dc */ |
| 315 | 315 | { -122, -55, 15, 83, 149, 210, 264, 311 }, |
| 316 | | /* K10 - this was entirely missing from the patent, and I've simply copied the TMS5220 one, which is wrong */ |
| 316 | /* K10 - this was entirely missing from the patent, and I've simply copied the real TMS5220 one, which is wrong */ |
| 317 | 317 | { -205, -132, -59, 14, 87, 160, 234, 307 }, |
| 318 | 318 | }, |
| 319 | 319 | /* Chirp table */ |
| 320 | 320 | { 0, 42, -44, 50, -78, 18, 37, 20, |
| 321 | 321 | 2, -31, -59, 2, 95, 90, 5, 15, |
| 322 | 322 | 38, -4, -91,-91, -42,-35,-36, -4, |
| 323 | | 37, 43, 34, 33, 15, -1, -8,-18, |
| 323 | 37, 43, 34, 33, 15, -1, -8,-18, |
| 324 | 324 | -19,-17, -9,-10, -6, 0, 3, 2, |
| 325 | 325 | 1, 0, 0, 0, 0, 0, 0, 0, |
| 326 | | 0, 0, 0 }, |
| 326 | 0, 0, 0, 0 }, |
| 327 | 327 | /* interpolation coefficients */ |
| 328 | 328 | { 3, 3, 3, 2, 2, 2, 1, 0 } |
| 329 | 329 | }; |
| 330 | 330 | |
| 331 | | /* The following TMS5220 coefficients come from the datasheet, and its addendum, with the exception of the energy table. The energy table is copied from the TMS5110a dump and the TMS5200 patent (which are both the same for energy), as the datasheet lists it in RMS notation which doesn't help us since I(Lord Nightmare) can't figure out the proper formula TI used for converting energy to RMS (the obvious 'take all the values in the chirp ROM, multiply them by 1/2/3/4/etc, square each one, sum them up, divide by 51, which is # of ROM entries in chirp ROM, and take the square root of the result', doesn't QUITE work. It almost does, if you add 16 to the result, for the first 4 entries, but beyond that the entries become farther and farther offset). |
| 331 | /* The following TMS5200/TMC0285 coefficients were directly read from an actual TMS5200 chip by Lord Nightmare using the PROMOUT pin, and can be regarded as established fact. However, the chirp table and the interpolation coefficients still come from the patents as there doesn't seem to be an easy way to read those out from the chip without decapping it. |
| 332 | Note that the K coefficients are VERY different from the coefficients given in the US 4,335,277 patent, which may have been for some sort of prototype or otherwise intentionally scrambled. The energy and pitch tables, however, are identical to the patent. |
| 333 | Also note, that the K coefficients are ALMOST identical to the coefficients from the CD2802, above. */ |
| 334 | static const struct tms5100_coeffs tms5200_coeff = |
| 335 | { |
| 336 | /* subtype */ |
| 337 | SUBTYPE_TMS5200, |
| 338 | 10, |
| 339 | 4, |
| 340 | 6, |
| 341 | { 5, 5, 4, 4, 4, 4, 4, 3, 3, 3 }, |
| 342 | /* E */ |
| 343 | { 0, 1, 2, 3, 4, 6, 8, 11, |
| 344 | 16, 23, 33, 47, 63, 85, 114, 0 }, |
| 345 | /* P */ |
| 346 | { 0, 14, 15, 16, 17, 18, 19, 20, |
| 347 | 21, 22, 23, 24, 25, 26, 27, 28, |
| 348 | 29, 30, 31, 32, 34, 36, 38, 40, |
| 349 | 41, 43, 45, 48, 49, 51, 54, 55, |
| 350 | 57, 60, 62, 64, 68, 72, 74, 76, |
| 351 | 81, 85, 87, 90, 96, 99, 103, 107, |
| 352 | 112, 117, 122, 127, 133, 139, 145, 151, |
| 353 | 157, 164, 171, 178, 186, 194, 202, 211 }, |
| 354 | { |
| 355 | /* K1 */ |
| 356 | { -501, -498, -495, -490, -485, -478, -469, -459, |
| 357 | -446, -431, -412, -389, -362, -331, -295, -253, |
| 358 | -207, -156, -102, -45, 13, 70, 126, 179, |
| 359 | 228, 272, 311, 345, 374, 399, 420, 437 }, |
| 360 | /* K2 */ |
| 361 | { -376, -357, -335, -312, -286, -258, -227, -195, |
| 362 | -161, -124, -87, -49, -10, 29, 68, 106, |
| 363 | 143, 178, 212, 243, 272, 299, 324, 346, |
| 364 | 366, 384, 400, 414, 427, 438, 448, 506 }, |
| 365 | /* K3 */ |
| 366 | { -407, -381, -349, -311, -268, -218, -162, -102, |
| 367 | -39, 25, 89, 149, 206, 257, 302, 341 }, |
| 368 | /* K4 */ |
| 369 | { -290, -252, -209, -163, -114, -62, -9, 44, |
| 370 | 97, 147, 194, 238, 278, 313, 344, 371 }, |
| 371 | /* K5 */ |
| 372 | { -318, -283, -245, -202, -156, -107, -56, -3, |
| 373 | 49, 101, 150, 196, 239, 278, 313, 344 }, |
| 374 | /* K6 */ |
| 375 | { -193, -152, -109, -65, -20, 26, 71, 115, |
| 376 | 158, 198, 235, 270, 301, 330, 355, 377 }, |
| 377 | /* K7 */ |
| 378 | { -254, -218, -180, -140, -97, -53, -8, 36, |
| 379 | 81, 124, 165, 204, 240, 274, 304, 332 }, |
| 380 | /* K8 */ |
| 381 | { -205, -112, -10, 92, 187, 269, 336, 387 }, |
| 382 | /* K9 */ |
| 383 | { -249, -183, -110, -32, 48, 126, 198, 261 }, |
| 384 | /* K10 */ |
| 385 | { -190, -133, -73, -10, 53, 115, 173, 227 }, |
| 386 | }, |
| 387 | /* Chirp table */ |
| 388 | { 0, 42, -44, 50, -78, 18, 37, 20, |
| 389 | 2, -31, -59, 2, 95, 90, 5, 15, |
| 390 | 38, -4, -91,-91, -42,-35,-36, -4, |
| 391 | 37, 43, 34, 33, 15, -1, -8,-18, |
| 392 | -19,-17, -9,-10, -6, 0, 3, 2, |
| 393 | 1, 0, 0, 0, 0, 0, 0, 0, |
| 394 | 0, 0, 0, 0 }, |
| 395 | /* interpolation coefficients */ |
| 396 | { 3, 3, 3, 2, 2, 2, 1, 0 } |
| 397 | }; |
| 398 | |
| 399 | /* The following TMS5220 coefficients were directly read from an actual TMS5220 chip by Lord Nightmare using the PROMOUT pin, and can be regarded as established fact. However, the chirp table and the interpolation coefficients still come from the patents as there doesn't seem to be an easy way to read those out from the chip without decapping it. |
| 400 | Note: The coefficients match those from the datasheet, and its addendum, with the exception of the energy table. The energy table on the datasheet (and in the QV5220.COD from qboxpro) lists it in RMS notation which doesn't help us since I(Lord Nightmare) can't figure out the proper formula TI used for converting energy to RMS (the obvious 'take all the values in the chirp ROM, multiply them by 1/2/3/4/etc, square each one, sum them up, divide by 51, which is # of ROM entries in chirp ROM, and take the square root of the result', doesn't QUITE work. It almost does, if you add 16 to the result, for the first 4 entries, but beyond that the entries become farther and farther offset). |
| 332 | 401 | Note that all the LPC K* values match the TMS5110a table exactly. |
| 333 | | ***These values have not yet been verified against a real TMS5220*** |
| 334 | 402 | */ |
| 335 | 403 | static const struct tms5100_coeffs tms5220_coeff = |
| 336 | 404 | { |
| r7972 | r7973 | |
| 341 | 409 | 6, |
| 342 | 410 | { 5, 5, 4, 4, 4, 4, 4, 3, 3, 3 }, |
| 343 | 411 | /* E */ |
| 344 | | { 0, 1, 2, 3, 4, 6, 8, 11, |
| 345 | | 16, 23, 33, 47, 63, 85, 114, 511 }, /* last value is actually 0 in ROM, but 511 is stop sentinel */ |
| 412 | { 0, 1, 2, 3, 4, 6, 8, 11, |
| 413 | 16, 23, 33, 47, 63, 85, 114, 0 }, |
| 346 | 414 | /* P */ |
| 347 | 415 | { 0, 15, 16, 17, 18, 19, 20, 21, |
| 348 | 416 | 22, 23, 24, 25, 26, 27, 28, 29, |
| r7972 | r7973 | |
| 365 | 433 | 422, 435, 445, 455, 463, 470, 476, 506 }, |
| 366 | 434 | /* K3 */ |
| 367 | 435 | { -441, -387, -333, -279, -225, -171, -117, -63, |
| 368 | | -9, 45, 98, 152, 206, 260, 314, 368 }, |
| 436 | -9, 45, 98, 152, 206, 260, 314, 368 }, |
| 369 | 437 | /* K4 */ |
| 370 | 438 | { -328, -273, -217, -161, -106, -50, 5, 61, |
| 371 | 439 | 116, 172, 228, 283, 339, 394, 450, 506 }, |
| r7972 | r7973 | |
| 374 | 442 | 43, 90, 136, 182, 229, 275, 322, 368 }, |
| 375 | 443 | /* K6 */ |
| 376 | 444 | { -256, -212, -168, -123, -79, -35, 10, 54, |
| 377 | | 98, 143, 187, 232, 276, 320, 365, 409 }, |
| 445 | 98, 143, 187, 232, 276, 320, 365, 409 }, |
| 378 | 446 | /* K7 */ |
| 379 | 447 | { -308, -260, -212, -164, -117, -69, -21, 27, |
| 380 | 448 | 75, 122, 170, 218, 266, 314, 361, 409 }, |
| 381 | 449 | /* K8 */ |
| 382 | 450 | { -256, -161, -66, 29, 124, 219, 314, 409 }, |
| 383 | 451 | /* K9 */ |
| 384 | | { -256, -176, -96, -15, 65, 146, 226, 307 }, |
| 452 | { -256, -176, -96, -15, 65, 146, 226, 307 }, |
| 385 | 453 | /* K10 */ |
| 386 | | { -205, -132, -59, 14, 87, 160, 234, 307 }, |
| 454 | { -205, -132, -59, 14, 87, 160, 234, 307 }, |
| 387 | 455 | }, |
| 388 | 456 | /* Chirp table */ |
| 389 | 457 | { 0, 42, -44, 50, -78, 18, 37, 20, |
| 390 | 458 | 2, -31, -59, 2, 95, 90, 5, 15, |
| 391 | | 38, -4, -91,-91, -42,-35,-36, -4, |
| 392 | | 37, 43, 34, 33, 15, -1, -8,-18, |
| 393 | | -19,- 17, -9,-10, -6, 0, 3, 2, |
| 394 | | 1, 0, 0, 0, 0, 0, 0, 0, |
| 395 | | 0, 0, 0 }, |
| 459 | 38, -4, -91,-91, -42,-35,-36, -4, |
| 460 | 37, 43, 34, 33, 15, -1, -8,-18, |
| 461 | -19,-17, -9,-10, -6, 0, 3, 2, |
| 462 | 1, 0, 0, 0, 0, 0, 0, 0, |
| 463 | 0, 0, 0, 0 }, |
| 396 | 464 | /* interpolation coefficients */ |
| 397 | 465 | { 3, 3, 3, 2, 2, 2, 1, 0 } |
| 398 | 466 | }; |
| 399 | 467 | |
| 400 | 468 | /* The following TMS5220C coefficients come from the tables in QBOXPRO, a program written at least in part by George "Larry" Brantingham of Quadravox, formerly of Texas Instruments, who had laid out the silicon for the TMS5100/TMC0280/CD2801. It is the same as the TMS5220 but has a change in the energy table (is this actually correct? or is this one correct for both 5220s? or is this the wrong table and the TMS5220 one correct for both?) |
| 401 | | Note: the energy table in QBOXPRO is also in RMS and was not used; however the energy values are offset by -1 compared to the 5220, which has been done here. the '152' is an educated guess. |
| 402 | | Note: the pitch table is the same as TMS5220 but with +1 applied to each value, and the first and second values the same, as shown in QV5220.COD. |
| 469 | Note: the energy table in QV5220.COD is also in RMS and was not used (it also may well be incorrect; the values in QV5220.COD have an offset by one index which looks wrong), instead the table from the 5200/5220 is used here. |
| 403 | 470 | Note: the Kx tables are taken directly from QV5220.COD but with /64 added to each value as the values are stored ranging from -32768 to 32767 in QBOXPRO instead of -512 to 511 as on the real chip. |
| 404 | 471 | ***These values have not yet been verified against a real TMS5220C, see below as for why*** |
| 405 | 472 | This has not yet been verified against a real TMS5220C, and doing so will require decapping one as the TMS5220C, unlike the TMS5220, has a nonfunctional PROMOUT pin. This makes reading the internal LPC tables out electronically (via PROMOUT) impossible. |
| r7972 | r7973 | |
| 413 | 480 | 6, |
| 414 | 481 | { 5, 5, 4, 4, 4, 4, 4, 3, 3, 3 }, |
| 415 | 482 | /* E */ |
| 416 | | { 0, 2, 3, 4, 6, 8, 11, 16, // first value is really 1, but must be 0 for zero energy frames to work properly |
| 417 | | 23, 33, 47, 63, 85, 114, 152, 511 }, /* last value is actually 0 in ROM, but 511 is stop sentinel */ |
| 483 | { 0, 1, 2, 3, 4, 6, 8, 11, |
| 484 | 16, 23, 33, 47, 63, 85, 114, 0 }, |
| 418 | 485 | //{ 0x0d, 0x16, 0x20, 0x2d, 0x40, 0x5b, 0x81, 0xb6, |
| 419 | | // 0x101, 0x16c, 0x202, 0x2d6, 0x402, 0x5a9, 0x7ff, 511 }, /* last value is actually 0 in ROM, but 511 is stop sentinel */ |
| 486 | // 0x101, 0x16c, 0x202, 0x2d6, 0x402, 0x5a9, 0x7ff, 0 }, /* values from 5220_10.bin code for the tms50c10 */ |
| 420 | 487 | /* P */ |
| 421 | 488 | { 0, 16, 17, 18, 19, 20, 21, 22, // first value is 16 in QV5220.COD but must be 0 for unvoiced speech to work properly |
| 422 | 489 | 23, 24, 25, 26, 27, 28, 29, 30, |
| r7972 | r7973 | |
| 463 | 530 | { 0, 42, -44, 50, -78, 18, 37, 20, |
| 464 | 531 | 2, -31, -59, 2, 95, 90, 5, 15, |
| 465 | 532 | 38, -4, -91,-91, -42,-35,-36, -4, |
| 466 | | 37, 43, 34, 33, 15, -1, -8,-18, |
| 533 | 37, 43, 34, 33, 15, -1, -8,-18, |
| 467 | 534 | -19,-17, -9,-10, -6, 0, 3, 2, |
| 468 | 535 | 1, 0, 0, 0, 0, 0, 0, 0, |
| 469 | | 0, 0, 0 }, |
| 536 | 0, 0, 0, 0 }, |
| 470 | 537 | /* interpolation coefficients */ |
| 471 | 538 | { 3, 3, 3, 2, 2, 2, 1, 0 } |
| 472 | | }; |
| | No newline at end of file |
| 539 | }; |
src/emu/sound/tms5220.c
| r7972 | r7973 | |
| 14 | 14 | Preliminary MASSIVE merge of tms5110 and tms5220 cores by Lord Nightmare |
| 15 | 15 | Lattice Filter, Multiplier, and clipping redone by Lord Nightmare |
| 16 | 16 | TMS5220C multi-rate feature added by Lord Nightmare |
| 17 | Massive rewrite and reorganization by Lord Nightmare |
| 17 | 18 | |
| 18 | 19 | Much information regarding these lpc encoding comes from US patent 4,209,844 |
| 19 | 20 | US patent 4,331,836 describes the complete 51xx chip |
| r7972 | r7973 | |
| 42 | 43 | TI's naming has D7 as LSB and D0 as MSB and is in uppercase |
| 43 | 44 | |
| 44 | 45 | TODO: |
| 45 | | Implement a ready callback for pc interfaces |
| 46 | * Implement a ready callback for pc interfaces |
| 46 | 47 | - this will be quite a challenge since for it to be really accurate |
| 47 | 48 | the whole emulation has to run in sync (lots of timers) with the |
| 48 | 49 | cpu cores. |
| 49 | | If a command is still executing, /READY will be kept high until the command has |
| 50 | | finished if the next command is written. |
| 51 | | tomcat has a 5220 which is not hooked up at all |
| 50 | * If a command is still executing, /READY will be kept high until the command has |
| 51 | finished if the next command is written. |
| 52 | * tomcat has a 5220 which is not hooked up at all |
| 53 | * documentation is inconsistent in the patents about what data is returned for chirp rom addresses (base 0) 41 to 51; the patent says the 'rom returns zeroes for locations beyond 40', but at the same time the rom stores the complement of the actual chirp rom value, so are locations beyond 40 = 0x00(0) or = 0xFF(-1)? The latter seems more likely to me, and that is how it is currently implemented. (LN). |
| 54 | * Is the TS=0 forcing energy to 0 for next frame in the interpolator actually correct? |
| 52 | 55 | |
| 56 | Pedantic detail from observation of real chip: |
| 57 | The 5200 and 5220 chips outputs the following coefficients over PROMOUT while |
| 58 | 'idle' and not speaking, in this order: |
| 59 | e[0 or f] p[0] k1[0] k2[0] k3[0] k4[0] k5[f] k6[f] k7[f] k8[7] k9[7] k10[7] |
| 60 | |
| 61 | Driver specific notes: |
| 62 | |
| 63 | Looping has the tms5220 hookep up directly to the cpu. However currently the |
| 64 | tms9900 cpu core does not support a ready line. |
| 65 | |
| 66 | Victory's initial audio selftest is pretty brutal to the FIFO: it sends a |
| 67 | sequence of bytes to the FIFO and checks the status bits after each one; if |
| 68 | even one bit is in the wrong state (i.e. speech starts one byte too early or |
| 69 | late), the test fails! |
| 70 | The sample in Victory 'Shields up!' after you activate shields, the 'up' part |
| 71 | of the sample is missing the STOP frame at the end of it; this causes the |
| 72 | speech core to run out of bits to parse from the FIFO, cutting the sample off |
| 73 | by one frame. This appears to be an original game code bug. |
| 74 | |
| 53 | 75 | Progress list for drivers using old vs new interface: |
| 54 | 76 | starwars: uses new interface (couriersud) |
| 55 | | gauntlet: uses new interface (couriersud |
| 77 | gauntlet: uses new interface (couriersud) |
| 56 | 78 | atarisy1: uses new interface (Lord Nightmare) |
| 57 | 79 | atarisy2: uses new interface (Lord Nightmare) |
| 58 | 80 | atarijsa: uses new interface (Lord Nightmare) |
| 59 | 81 | firefox: uses new interface (couriersud) |
| 60 | 82 | mhavoc: uses old interface, and is in the machine file instead of the driver. |
| 61 | | monymony(zaccaria.c): uses new interface (couriersud) |
| 83 | monymony/jackrabt(zaccaria.c): uses new interface (couriersud) |
| 62 | 84 | victory(audio/exidy.c): uses new interface (couriersud) |
| 63 | 85 | looping: uses old interface |
| 64 | 86 | portraits: uses *NO* interface; the i/o cpu hasn't been hooked to anything! |
| 65 | 87 | dotron and midwayfb(mcr.c): uses old interface |
| 66 | 88 | |
| 67 | | Notes: |
| 68 | | Looping has the tms5220 hookep up directly to the cpu. However currently the |
| 69 | | tms9900 cpu core does not support a ready line. |
| 70 | | |
| 71 | 89 | Email from Lord Nightmare having a lot more detail follows: |
| 72 | 90 | |
| 73 | 91 | Yes, there is at least two more differences: |
| r7972 | r7973 | |
| 175 | 193 | between current and target to the current each frame */ |
| 176 | 194 | #undef OVERRIDE_INTERPOLATION |
| 177 | 195 | |
| 178 | | /* defines how many times to leftshift the chirp rom before feeding to the lattice filter. default is 0 */ |
| 179 | | #define CHIRPROM_LEFTSHIFT 0 |
| 180 | | |
| 181 | 196 | /* *****debugging defines***** */ |
| 182 | 197 | #undef VERBOSE |
| 183 | | // above is general, somewhat obsolete |
| 198 | // above is general, somewhat obsolete, catch all for debugs which don't fit elsewhere |
| 199 | #undef DEBUG_DUMP_INPUT_DATA |
| 200 | // above dumps the data input to the tms52xx to stdout, useful for making logged data dumps for real hardware tests |
| 184 | 201 | #undef DEBUG_FIFO |
| 185 | 202 | // above debugs fifo stuff: writes, reads and flag updates |
| 186 | | #undef DEBUG_FRAME_DUMP |
| 187 | | // above dumps the contents of each decoded speech frame as hex |
| 188 | | #undef DEBUG_FRAME_INFO |
| 189 | | // above dumps information about each decoded speech frame |
| 203 | #undef DEBUG_PARSE_FRAME_DUMP |
| 204 | // above dumps each frame to stderr: be sure to select one of the options below if you define it! |
| 205 | #undef DEBUG_PARSE_FRAME_DUMP_BIN |
| 206 | // dumps each speech frame as binary |
| 207 | #undef DEBUG_PARSE_FRAME_DUMP_HEX |
| 208 | // dumps each speech frame as hex |
| 190 | 209 | #undef DEBUG_FRAME_ERRORS |
| 191 | 210 | // above dumps info if a frame ran out of data |
| 192 | 211 | #undef DEBUG_COMMAND_DUMP |
| r7972 | r7973 | |
| 195 | 214 | // above spams the errorlog with i/o ready messages whenever the ready or irq pin is read |
| 196 | 215 | #undef DEBUG_GENERATION |
| 197 | 216 | // above dumps some debug information related to the sample generation loop, i.e. when ramp frames happen |
| 217 | #undef DEBUG_GENERATION_VERBOSE |
| 218 | // above dumps MUCH MORE debug information related to the sample generation loop, namely the k, pitch and energy values for EVERY SINGLE SAMPLE. |
| 219 | #undef DEBUG_CLIP_WRAP |
| 220 | // above dumps info to stderr whenever the clip/wrap hardware is (or would be) clipping the signal. |
| 198 | 221 | #undef DEBUG_IO_READY |
| 199 | 222 | // above debugs the io ready callback |
| 200 | 223 | #undef DEBUG_RS_WS |
| r7972 | r7973 | |
| 234 | 257 | |
| 235 | 258 | |
| 236 | 259 | /* these contain global status bits */ |
| 237 | | /* |
| 238 | | R Nabet : speak_external is only set when a speak external command is going on. |
| 239 | | speaking_now is set whenever a speak or speak external command is going on. |
| 240 | | Note that we really need to do anything in tms5220_process and play samples only when |
| 241 | | speaking_now is true. Else, we can play nothing as well, which is a |
| 242 | | speed-up... |
| 243 | | */ |
| 244 | | UINT8 speaking_now; /* Speak or Speak External command in progress */ |
| 245 | | UINT8 speak_external; /* Speak External command in progress, writes go to FIFO. */ |
| 246 | | UINT8 talk_status; /* TS status bit is 1, i.e. speak or speak external is in progress and we have not encountered a stop frame yet; talk_status differs from speaking_now in that speaking_now is set as soon as a speak or speak external command is started; talk_status does NOT go active until after 8 bytes are written to the fifo on a speak external command, otherwise the two are the same. TS is cleared when a STOP command has just been processed in the speech stream, and a new command is about to be processed. */ |
| 260 | UINT8 speaking_now; /* True only if actual speech is being generated right now. Is set when a speak vsm command happens OR when speak external happens and buffer low becomes nontrue; Is cleared when speech halts after the last stop frame or the last frame after talk status is otherwise cleared.*/ |
| 261 | UINT8 speak_external; /* DDIS is 1, i.e. Speak External command in progress, writes go to FIFO. */ |
| 262 | UINT8 talk_status; /* TS status bit is 1 i.e. speak or speak external is in progress and we have not encountered a stop frame yet; talk_status differs from speaking_now in that speaking_now is set as soon as a speak or speak external command is started; talk_status does NOT go active until after 8 bytes are written to the fifo on a speak external command, otherwise the two are the same. TS is cleared by 3 things: 1. when a STOP command has just been processed as a new frame in the speech stream; 2. if the fifo runs out in speak external mode; 3. on power-up/during a reset command; When it gets cleared, speak_external is also cleared, an interrupt is generated, and speaking_now will be cleared when the next frame starts. */ |
| 247 | 263 | UINT8 buffer_low; /* FIFO has less than 8 bytes in it */ |
| 248 | 264 | UINT8 buffer_empty; /* FIFO is empty*/ |
| 249 | 265 | UINT8 irq_pin; /* state of the IRQ pin (output) */ |
| 250 | 266 | |
| 251 | 267 | /* these contain data describing the current and previous voice frames */ |
| 252 | | #define OLD_FRAME_STOP_FLAG (tms->old_frame_energy == COEFF_ENERGY_SENTINEL) // 1 if this was a stop (E = 0xF) frame |
| 253 | | #define OLD_FRAME_SILENCE_FLAG (tms->old_frame_energy == 0) // 1 if this was a silence (E=0) frame |
| 254 | | #define OLD_FRAME_UNVOICED_FLAG (tms->old_frame_pitch == 0) // 1 if unvoiced, 0 if voiced |
| 255 | | UINT16 old_frame_energy; |
| 256 | | UINT16 old_frame_pitch; |
| 257 | | INT32 old_frame_k[10]; |
| 268 | #define OLD_FRAME_SILENCE_FLAG (tms->old_frame_energy_idx == 0) // 1 if E=0, 0 otherwise. |
| 269 | #define OLD_FRAME_UNVOICED_FLAG (tms->old_frame_pitch_idx == 0) // 1 if P=0 (unvoiced), 0 if voiced |
| 270 | UINT8 old_frame_energy_idx; |
| 271 | UINT8 old_frame_pitch_idx; |
| 272 | UINT8 old_frame_k_idx[10]; |
| 258 | 273 | |
| 259 | | #define NEW_FRAME_STOP_FLAG (tms->new_frame_energy == COEFF_ENERGY_SENTINEL) // ditto as above |
| 260 | | #define NEW_FRAME_SILENCE_FLAG (tms->new_frame_energy == 0) // ditto as above |
| 261 | | #define NEW_FRAME_UNVOICED_FLAG (tms->new_frame_pitch == 0) // ditto as above |
| 262 | | UINT16 new_frame_energy; |
| 263 | | UINT16 new_frame_pitch; |
| 264 | | INT32 new_frame_k[10]; |
| 274 | #define NEW_FRAME_STOP_FLAG (tms->new_frame_energy_idx == 0xF) // 1 if this is a stop (Energy = 0xF) frame |
| 275 | #define NEW_FRAME_SILENCE_FLAG (tms->new_frame_energy_idx == 0) // ditto as above |
| 276 | #define NEW_FRAME_UNVOICED_FLAG (tms->new_frame_pitch_idx == 0) // ditto as above |
| 277 | UINT8 new_frame_energy_idx; |
| 278 | UINT8 new_frame_pitch_idx; |
| 279 | UINT8 new_frame_k_idx[10]; |
| 265 | 280 | |
| 266 | 281 | |
| 267 | 282 | /* these are all used to contain the current state of the sound generation */ |
| 268 | 283 | UINT16 current_energy; |
| 269 | 284 | UINT16 current_pitch; |
| 270 | | INT32 current_k[10]; |
| 285 | INT16 current_k[10]; |
| 271 | 286 | |
| 272 | 287 | UINT16 target_energy; |
| 273 | 288 | UINT16 target_pitch; |
| 274 | | INT32 target_k[10]; |
| 289 | INT16 target_k[10]; |
| 275 | 290 | |
| 276 | 291 | UINT16 previous_energy; /* needed for lattice filter to match patent */ |
| 277 | 292 | |
| 278 | 293 | //UINT8 interp_period; /* TODO: the current interpolation period, counts 1,2,3,4,5,6,7,0 for divide by 8,8,8,4,4,4,2,1 */ |
| 279 | 294 | UINT8 interp_count; /* number of samples within each sub-interpolation period, ranges from 0-24 */ |
| 295 | //UINT8 spkslow_delay; /* delay counter for interp count, only used on tms51xx */ |
| 280 | 296 | UINT8 sample_count; /* number of samples within the ENTIRE interpolation period, ranges from 0-199 */ |
| 281 | 297 | UINT8 tms5220c_rate; /* only relevant for tms5220C's multi frame rate feature; is the actual 4 bit value written on a 0x2* or 0x0* command */ |
| 282 | 298 | UINT16 pitch_count; /* pitch counter; provides chirp rom address */ |
| r7972 | r7973 | |
| 358 | 374 | break; |
| 359 | 375 | case TMS5220_IS_5200: |
| 360 | 376 | tms->coeff = &tms5200_coeff; |
| 377 | //tms->coeff = &pat4335277_coeff; |
| 361 | 378 | break; |
| 362 | 379 | case TMS5220_IS_5220: |
| 363 | 380 | tms->coeff = &tms5220_coeff; |
| r7972 | r7973 | |
| 385 | 402 | state_save_register_device_item(tms->device, 0, tms->buffer_empty); |
| 386 | 403 | state_save_register_device_item(tms->device, 0, tms->irq_pin); |
| 387 | 404 | |
| 388 | | state_save_register_device_item(tms->device, 0, tms->old_frame_energy); |
| 389 | | state_save_register_device_item(tms->device, 0, tms->old_frame_pitch); |
| 390 | | state_save_register_device_item_array(tms->device, 0, tms->old_frame_k); |
| 405 | state_save_register_device_item(tms->device, 0, tms->old_frame_energy_idx); |
| 406 | state_save_register_device_item(tms->device, 0, tms->old_frame_pitch_idx); |
| 407 | state_save_register_device_item_array(tms->device, 0, tms->old_frame_k_idx); |
| 391 | 408 | |
| 392 | | state_save_register_device_item(tms->device, 0, tms->new_frame_energy); |
| 393 | | state_save_register_device_item(tms->device, 0, tms->new_frame_pitch); |
| 394 | | state_save_register_device_item_array(tms->device, 0, tms->new_frame_k); |
| 409 | state_save_register_device_item(tms->device, 0, tms->new_frame_energy_idx); |
| 410 | state_save_register_device_item(tms->device, 0, tms->new_frame_pitch_idx); |
| 411 | state_save_register_device_item_array(tms->device, 0, tms->new_frame_k_idx); |
| 395 | 412 | |
| 396 | 413 | state_save_register_device_item(tms->device, 0, tms->current_energy); |
| 397 | 414 | state_save_register_device_item(tms->device, 0, tms->current_pitch); |
| r7972 | r7973 | |
| 425 | 442 | |
| 426 | 443 | /********************************************************************************************** |
| 427 | 444 | |
| 445 | printbits helper function: takes a long int input and prints the resulting bits to stderr |
| 446 | |
| 447 | **********************************************************************************************/ |
| 448 | |
| 449 | #ifdef DEBUG_PARSE_FRAME_DUMP_BIN |
| 450 | static void printbits(long data, int num) |
| 451 | { |
| 452 | int i; |
| 453 | for (i=(num-1); i>=0; i--) |
| 454 | fprintf(stderr,"%0ld", (data>>i)&1); |
| 455 | } |
| 456 | #endif |
| 457 | #ifdef DEBUG_PARSE_FRAME_DUMP_HEX |
| 458 | static void printbits(long data, int num) |
| 459 | { |
| 460 | switch((num-1)&0xFC) |
| 461 | { |
| 462 | case 0: |
| 463 | fprintf(stderr,"%0lx", data); |
| 464 | break; |
| 465 | case 4: |
| 466 | fprintf(stderr,"%02lx", data); |
| 467 | break; |
| 468 | case 8: |
| 469 | fprintf(stderr,"%03lx", data); |
| 470 | break; |
| 471 | case 12: |
| 472 | fprintf(stderr,"%04lx", data); |
| 473 | break; |
| 474 | default: |
| 475 | fprintf(stderr,"%04lx", data); |
| 476 | break; |
| 477 | } |
| 478 | } |
| 479 | #endif |
| 480 | |
| 481 | /********************************************************************************************** |
| 482 | |
| 428 | 483 | tms5220_data_write -- handle a write to the TMS5220 |
| 429 | 484 | |
| 430 | 485 | ***********************************************************************************************/ |
| 431 | 486 | |
| 432 | 487 | static void tms5220_data_write(tms5220_state *tms, int data) |
| 433 | 488 | { |
| 489 | #ifdef DEBUG_DUMP_INPUT_DATA |
| 490 | fprintf(stdout, "%c",data); |
| 491 | #endif |
| 434 | 492 | if (tms->speak_external) // If we're in speak external mode |
| 435 | 493 | { |
| 436 | 494 | /* add this byte to the FIFO */ |
| r7972 | r7973 | |
| 439 | 497 | tms->fifo[tms->fifo_tail] = data; |
| 440 | 498 | tms->fifo_tail = (tms->fifo_tail + 1) % FIFO_SIZE; |
| 441 | 499 | tms->fifo_count++; |
| 442 | | |
| 443 | | /* if we were speaking, then we're no longer empty */ |
| 444 | | if (tms->speak_external) |
| 445 | | tms->buffer_empty = 0; |
| 446 | 500 | #ifdef DEBUG_FIFO |
| 447 | 501 | logerror("data_write: Added byte to FIFO (current count=%2d)\n", tms->fifo_count); |
| 502 | #endif |
| 503 | update_status_and_ints(tms); |
| 504 | if ((tms->talk_status == 0) && (tms->buffer_low == 0)) // we just unset buffer low with that last write, and talk status *was* zero... |
| 505 | { |
| 506 | int i; |
| 507 | #ifdef DEBUG_FIFO |
| 508 | logerror("data_write triggered talk status to go active!\n"); |
| 509 | #endif |
| 510 | /* ...then we now have enough bytes to start talking; clear out the new frame parameters (it will become old frame just before the first call to parse_frame() ) */ |
| 511 | tms->new_frame_energy_idx = 0; |
| 512 | tms->new_frame_pitch_idx = 0; |
| 513 | for (i = 0; i < tms->coeff->num_k; i++) |
| 514 | tms->new_frame_k_idx[i] = 0; |
| 515 | tms->talk_status = tms->speaking_now = 1; |
| 516 | } |
| 448 | 517 | } |
| 449 | 518 | else |
| 450 | 519 | { |
| 451 | | |
| 452 | | logerror("data_write: Ran out of room in the FIFO!\n"); |
| 520 | #ifdef DEBUG_FIFO |
| 521 | logerror("data_write: Ran out of room in the tms52xx FIFO! this should never happen!\n"); |
| 453 | 522 | // at this point, /READY should remain HIGH/inactive until the fifo has at least one byte open in it. |
| 454 | 523 | #endif |
| 455 | 524 | } |
| 456 | 525 | |
| 457 | | update_status_and_ints(tms); |
| 526 | |
| 458 | 527 | } |
| 459 | 528 | else //(! tms->speak_external) |
| 460 | 529 | /* R Nabet : we parse commands at once. It is necessary for such commands as read. */ |
| r7972 | r7973 | |
| 500 | 569 | mode, it is immediately unset here. */ |
| 501 | 570 | if ((tms->speak_external == 1) && (tms->buffer_empty == 1)) |
| 502 | 571 | { |
| 503 | | /* generate an interrupt if necessary; if /TS was active and is now inactive, set int. */ |
| 504 | | if (tms->talk_status == 1) |
| 505 | | set_interrupt_state(tms, 1); |
| 506 | | tms->talk_status = 0; |
| 572 | /* generate an interrupt: /TS was active, and is now inactive. */ |
| 573 | if (tms->talk_status == 1) |
| 574 | { |
| 575 | tms->talk_status = tms->speak_external = 0; |
| 576 | set_interrupt_state(tms, 1); |
| 577 | } |
| 507 | 578 | } |
| 508 | 579 | /* Note that TS being unset will also generate an interrupt when a STOP |
| 509 | 580 | frame is encountered; this is handled in the sample generator code and not here */ |
| r7972 | r7973 | |
| 672 | 743 | static void tms5220_process(tms5220_state *tms, INT16 *buffer, unsigned int size) |
| 673 | 744 | { |
| 674 | 745 | int buf_count=0; |
| 675 | | int i, interp_period, bitout; |
| 746 | int i, interp_period, bitout, zpar; |
| 676 | 747 | |
| 677 | 748 | //tryagain: |
| 678 | 749 | |
| r7972 | r7973 | |
| 682 | 753 | |
| 683 | 754 | /* if speak external is set, but talk status is not (yet) set, |
| 684 | 755 | wait for buffer low to clear */ |
| 685 | | if (!tms->talk_status && tms->speak_external) |
| 686 | | { |
| 687 | | if (tms->buffer_low == 1) |
| 756 | if (!tms->talk_status && tms->speak_external && (tms->buffer_low == 1)) |
| 688 | 757 | goto empty; |
| 689 | 758 | |
| 690 | | /* we now have enough bytes; clear out the new frame parameters (it will become old frame just before the first call to parse_frame() ) */ |
| 691 | | tms->new_frame_energy = 0; |
| 692 | | tms->new_frame_pitch = 0; |
| 693 | | for (i = 0; i < tms->coeff->num_k; i++) |
| 694 | | tms->new_frame_k[i] = 0; |
| 695 | | |
| 696 | | tms->talk_status = 1; |
| 697 | | } |
| 698 | | |
| 699 | 759 | /* loop until the buffer is full or we've stopped speaking */ |
| 700 | | while ((size > 0) && tms->talk_status) |
| 760 | while ((size > 0) && tms->speaking_now) |
| 701 | 761 | { |
| 702 | 762 | |
| 703 | 763 | /* if we're ready for a new frame */ |
| 704 | 764 | if ((tms->interp_count == 0) && (tms->sample_count == 0)) |
| 705 | 765 | { |
| 766 | /* appropriately override the initial sample count */ |
| 767 | tms->sample_count = reload_table[tms->tms5220c_rate&0x3]; |
| 706 | 768 | |
| 707 | 769 | /* remember previous frame energy, pitch, and coefficients */ |
| 708 | | tms->old_frame_energy = tms->new_frame_energy; |
| 709 | | tms->old_frame_pitch = tms->new_frame_pitch; |
| 770 | tms->old_frame_energy_idx = tms->new_frame_energy_idx; |
| 771 | tms->old_frame_pitch_idx = tms->new_frame_pitch_idx; |
| 710 | 772 | for (i = 0; i < tms->coeff->num_k; i++) |
| 711 | | tms->old_frame_k[i] = tms->new_frame_k[i]; |
| 773 | tms->old_frame_k_idx[i] = tms->new_frame_k_idx[i]; |
| 712 | 774 | |
| 713 | | /* if the old frame was a stop frame, exit and do not process any more frames */ |
| 714 | | if (OLD_FRAME_STOP_FLAG) |
| 775 | /* if the talk status was clear last frame, halt speech now. */ |
| 776 | if (tms->talk_status == 0) |
| 715 | 777 | { |
| 716 | 778 | #ifdef DEBUG_GENERATION |
| 717 | | logerror("tms5220_process: processing frame: stop frame\n"); |
| 779 | fprintf(stderr,"tms5220_process: processing frame: talk status = 0 caused by stop frame or buffer empty, halting speech.\n"); |
| 718 | 780 | #endif |
| 719 | | tms->speaking_now = tms->talk_status = tms->speak_external = 0; |
| 720 | | set_interrupt_state(tms, 1); // TS went inactive, so int is raised |
| 721 | | tms->sample_count = reload_table[tms->tms5220c_rate&0x3]; |
| 722 | | update_status_and_ints(tms); |
| 781 | tms->speaking_now = 0; // finally halt speech |
| 723 | 782 | goto empty; |
| 724 | 783 | } |
| 725 | 784 | |
| 726 | 785 | |
| 727 | 786 | /* Parse a new frame into the new_target_energy, new_target_pitch and new_target_k[] */ |
| 728 | 787 | parse_frame(tms); |
| 788 | #ifdef DEBUG_PARSE_FRAME_DUMP |
| 789 | fprintf(stderr,"\n"); |
| 790 | #endif |
| 729 | 791 | |
| 792 | /* if the new frame is a stop frame, set an interrupt and set talk status to 0 */ |
| 793 | if (NEW_FRAME_STOP_FLAG == 1) |
| 794 | { |
| 795 | tms->talk_status = tms->speak_external = 0; |
| 796 | set_interrupt_state(tms, 1); |
| 797 | update_status_and_ints(tms); |
| 798 | } |
| 730 | 799 | |
| 731 | | /* Set old frame targets as starting point of new frame */ |
| 732 | | tms->current_energy = tms->old_frame_energy; |
| 733 | | tms->current_pitch = tms->old_frame_pitch; |
| 734 | | for (i = 0; i < tms->coeff->num_k; i++) |
| 735 | | tms->current_k[i] = tms->old_frame_k[i]; |
| 736 | | |
| 737 | | |
| 738 | 800 | /* in all cases where interpolation would be inhibited, set the target |
| 739 | 801 | value equal to the current value. |
| 740 | 802 | Interpolation inhibit cases: |
| 741 | 803 | * Old frame was voiced, new is unvoiced |
| 742 | | * Old frame was silence/zero energy, new is unvoiced |
| 804 | * Old frame was silence/zero energy, new has nonzero energy |
| 743 | 805 | * Old frame was unvoiced, new is voiced |
| 744 | | * New frame is a silence/zero energy frame - ? not sure |
| 745 | | * New frame is a stop frame - ? not sure |
| 746 | 806 | */ |
| 747 | | if ( ((NEW_FRAME_SILENCE_FLAG == 0) && (NEW_FRAME_STOP_FLAG == 0)) |
| 748 | | && ( ((OLD_FRAME_UNVOICED_FLAG == 0) && (NEW_FRAME_UNVOICED_FLAG == 1)) |
| 749 | | || ((OLD_FRAME_SILENCE_FLAG == 1) && (NEW_FRAME_UNVOICED_FLAG == 1)) |
| 750 | | || ((OLD_FRAME_UNVOICED_FLAG == 1) && (NEW_FRAME_UNVOICED_FLAG == 0)) ) |
| 751 | | ) |
| 807 | if ( ((OLD_FRAME_UNVOICED_FLAG == 0) && (NEW_FRAME_UNVOICED_FLAG == 1)) |
| 808 | || ((OLD_FRAME_UNVOICED_FLAG == 1) && (NEW_FRAME_UNVOICED_FLAG == 0)) |
| 809 | || ((OLD_FRAME_SILENCE_FLAG == 1) && (NEW_FRAME_SILENCE_FLAG == 0)) ) |
| 752 | 810 | { |
| 753 | 811 | #ifdef DEBUG_GENERATION |
| 754 | | logerror("processing frame: interpolation inhibited\n"); |
| 755 | | logerror("*** current Energy = %d\n",tms->current_energy); |
| 756 | | logerror("*** next frame Energy = %d\n",tms->new_frame_energy); |
| 812 | fprintf(stderr,"processing frame: interpolation inhibited\n"); |
| 813 | fprintf(stderr,"*** current Energy = %d\n",tms->current_energy); |
| 814 | fprintf(stderr,"*** next frame Energy = %d(index: %x)\n",tms->coeff->energytable[tms->new_frame_energy_idx],tms->new_frame_energy_idx); |
| 757 | 815 | #endif |
| 758 | 816 | tms->target_energy = tms->current_energy; |
| 759 | 817 | tms->target_pitch = tms->current_pitch; |
| 760 | 818 | for (i = 0; i < tms->coeff->num_k; i++) |
| 761 | 819 | tms->target_k[i] = tms->current_k[i]; |
| 762 | 820 | } |
| 763 | | /* in cases where the new frame is a STOP or SILENCE frame, |
| 764 | | ramp the energy down to 0, leaving everything else alone. */ |
| 765 | | else if ((NEW_FRAME_SILENCE_FLAG == 1) || (NEW_FRAME_STOP_FLAG == 1)) |
| 821 | else // normal frame, normal interpolation |
| 766 | 822 | { |
| 767 | 823 | #ifdef DEBUG_GENERATION |
| 768 | | logerror("processing frame: ramp-down (energy = 0 or STOP)\n"; |
| 824 | fprintf(stderr,"processing frame: Normal\n"); |
| 825 | fprintf(stderr,"*** current Energy = %d\n",tms->current_energy); |
| 826 | fprintf(stderr,"*** new (target) Energy = %d(index: %x)\n",tms->coeff->energytable[tms->new_frame_energy_idx],tms->new_frame_energy_idx); |
| 769 | 827 | #endif |
| 770 | | tms->target_energy = 0; |
| 771 | | tms->target_pitch = tms->current_pitch; |
| 772 | | for (i = 0; i < tms->coeff->num_k; i++) |
| 773 | | tms->target_k[i] = tms->current_k[i]; |
| 828 | |
| 829 | tms->target_energy = tms->coeff->energytable[tms->new_frame_energy_idx]; |
| 830 | tms->target_pitch = tms->coeff->pitchtable[tms->new_frame_pitch_idx]; |
| 831 | zpar = NEW_FRAME_UNVOICED_FLAG; // find out if parameters k5-k10 should be zeroed |
| 832 | for (i = 0; i < 4; i++) |
| 833 | tms->target_k[i] = tms->coeff->ktable[i][tms->new_frame_k_idx[i]]; |
| 834 | for (i = 4; i < tms->coeff->num_k; i++) |
| 835 | tms->target_k[i] = (tms->coeff->ktable[i][tms->new_frame_k_idx[i]] * (1-zpar)); |
| 774 | 836 | } |
| 775 | | else // normal frame, normal interpolation |
| 837 | |
| 838 | /* if TS is now 0, ramp the energy down to 0. Is this really correct to hardware? */ |
| 839 | if ( (tms->talk_status == 0)) |
| 776 | 840 | { |
| 777 | 841 | #ifdef DEBUG_GENERATION |
| 778 | | logerror("processing frame: Normal\n"); |
| 779 | | logerror("*** current Energy = %d\n",tms->current_energy); |
| 780 | | logerror("*** new (target) Energy = %d\n",tms->new_frame_energy); |
| 842 | fprintf(stderr,"Talk status is 0, forcing target energy to 0\n"); |
| 781 | 843 | #endif |
| 782 | | |
| 783 | | tms->target_energy = tms->new_frame_energy; |
| 784 | | tms->target_pitch = tms->new_frame_pitch; |
| 785 | | for (i = 0; i < tms->coeff->num_k; i++) |
| 786 | | tms->target_k[i] = tms->new_frame_k[i]; |
| 844 | tms->target_energy = 0; |
| 787 | 845 | } |
| 788 | 846 | } |
| 789 | 847 | else // Not a new frame, just interpolate the existing frame. |
| r7972 | r7973 | |
| 793 | 851 | #else |
| 794 | 852 | interp_period = tms->sample_count / 25; |
| 795 | 853 | #endif |
| 854 | #define PC_COUNT_LOAD 0 |
| 855 | zpar = OLD_FRAME_UNVOICED_FLAG; |
| 796 | 856 | switch(tms->interp_count) |
| 797 | 857 | { |
| 798 | 858 | /* PC=X X cycle, rendering change (change for next cycle which chip is actually doing) */ |
| r7972 | r7973 | |
| 801 | 861 | case 1: /* PC=0, B cycle, nothing happens (update energy) */ |
| 802 | 862 | break; |
| 803 | 863 | case 2: /* PC=1, A cycle, update energy (calc pitch) */ |
| 864 | if (interp_period == PC_COUNT_LOAD) |
| 865 | tms->current_energy = tms->coeff->energytable[tms->old_frame_energy_idx]; |
| 804 | 866 | tms->current_energy += ((tms->target_energy - tms->current_energy) >> tms->coeff->interp_coeff[interp_period]); |
| 805 | 867 | break; |
| 806 | 868 | case 3: /* PC=1, B cycle, nothing happens (update pitch) */ |
| 807 | 869 | break; |
| 808 | 870 | case 4: /* PC=2, A cycle, update pitch (calc K1) */ |
| 871 | if (interp_period == PC_COUNT_LOAD) |
| 872 | tms->current_pitch = tms->coeff->pitchtable[tms->old_frame_pitch_idx]; |
| 809 | 873 | tms->current_pitch += ((tms->target_pitch - tms->current_pitch) >> tms->coeff->interp_coeff[interp_period]); |
| 810 | 874 | break; |
| 811 | 875 | case 5: /* PC=2, B cycle, nothing happens (update K1) */ |
| 812 | 876 | break; |
| 813 | 877 | case 6: /* PC=3, A cycle, update K1 (calc K2) */ |
| 878 | if (interp_period == PC_COUNT_LOAD) |
| 879 | tms->current_k[0] = tms->coeff->ktable[0][tms->old_frame_k_idx[0]]; |
| 814 | 880 | tms->current_k[0] += ((tms->target_k[0] - tms->current_k[0]) >> tms->coeff->interp_coeff[interp_period]); |
| 815 | 881 | break; |
| 816 | 882 | case 7: /* PC=3, B cycle, nothing happens (update K2) */ |
| 817 | 883 | break; |
| 818 | 884 | case 8: /* PC=4, A cycle, update K2 (calc K3) */ |
| 885 | if (interp_period == PC_COUNT_LOAD) |
| 886 | tms->current_k[1] = tms->coeff->ktable[1][tms->old_frame_k_idx[1]]; |
| 819 | 887 | tms->current_k[1] += ((tms->target_k[1] - tms->current_k[1]) >> tms->coeff->interp_coeff[interp_period]); |
| 820 | 888 | break; |
| 821 | 889 | case 9: /* PC=4, B cycle, nothing happens (update K3) */ |
| 822 | 890 | break; |
| 823 | 891 | case 10: /* PC=5, A cycle, update K3 (calc K4) */ |
| 892 | if (interp_period == PC_COUNT_LOAD) |
| 893 | tms->current_k[2] = tms->coeff->ktable[2][tms->old_frame_k_idx[2]]; |
| 824 | 894 | tms->current_k[2] += ((tms->target_k[2] - tms->current_k[2]) >> tms->coeff->interp_coeff[interp_period]); |
| 825 | 895 | break; |
| 826 | 896 | case 11: /* PC=5, B cycle, nothing happens (update K4) */ |
| 827 | 897 | break; |
| 828 | 898 | case 12: /* PC=6, A cycle, update K4 (calc K5) */ |
| 899 | if (interp_period == PC_COUNT_LOAD) |
| 900 | tms->current_k[3] = tms->coeff->ktable[3][tms->old_frame_k_idx[3]]; |
| 829 | 901 | tms->current_k[3] += ((tms->target_k[3] - tms->current_k[3]) >> tms->coeff->interp_coeff[interp_period]); |
| 830 | 902 | break; |
| 831 | 903 | case 13: /* PC=6, B cycle, nothing happens (update K5) */ |
| 832 | 904 | break; |
| 833 | 905 | case 14: /* PC=7, A cycle, update K5 (calc K6) */ |
| 906 | if (interp_period == PC_COUNT_LOAD) |
| 907 | tms->current_k[4] = (tms->coeff->ktable[4][tms->old_frame_k_idx[4]] * (1-zpar)); |
| 834 | 908 | tms->current_k[4] += ((tms->target_k[4] - tms->current_k[4]) >> tms->coeff->interp_coeff[interp_period]); |
| 835 | 909 | break; |
| 836 | 910 | case 15: /* PC=7, B cycle, nothing happens (update K6) */ |
| 837 | 911 | break; |
| 838 | 912 | case 16: /* PC=8, A cycle, update K6 (calc K7) */ |
| 913 | if (interp_period == PC_COUNT_LOAD) |
| 914 | tms->current_k[5] = (tms->coeff->ktable[5][tms->old_frame_k_idx[5]] * (1-zpar)); |
| 839 | 915 | tms->current_k[5] += ((tms->target_k[5] - tms->current_k[5]) >> tms->coeff->interp_coeff[interp_period]); |
| 840 | 916 | break; |
| 841 | 917 | case 17: /* PC=8, B cycle, nothing happens (update K7) */ |
| 842 | 918 | break; |
| 843 | 919 | case 18: /* PC=9, A cycle, update K7 (calc K8) */ |
| 920 | if (interp_period == PC_COUNT_LOAD) |
| 921 | tms->current_k[6] = (tms->coeff->ktable[6][tms->old_frame_k_idx[6]] * (1-zpar)); |
| 844 | 922 | tms->current_k[6] += ((tms->target_k[6] - tms->current_k[6]) >> tms->coeff->interp_coeff[interp_period]); |
| 845 | 923 | break; |
| 846 | 924 | case 19: /* PC=9, B cycle, nothing happens (update K8) */ |
| 847 | 925 | break; |
| 848 | 926 | case 20: /* PC=10, A cycle, update K8 (calc K9) */ |
| 927 | if (interp_period == PC_COUNT_LOAD) |
| 928 | tms->current_k[7] = (tms->coeff->ktable[7][tms->old_frame_k_idx[7]] * (1-zpar)); |
| 849 | 929 | tms->current_k[7] += ((tms->target_k[7] - tms->current_k[7]) >> tms->coeff->interp_coeff[interp_period]); |
| 850 | 930 | break; |
| 851 | 931 | case 21: /* PC=10, B cycle, nothing happens (update K9) */ |
| 852 | 932 | break; |
| 853 | 933 | case 22: /* PC=11, A cycle, update K9 (calc K10) */ |
| 934 | if (interp_period == PC_COUNT_LOAD) |
| 935 | tms->current_k[8] = (tms->coeff->ktable[8][tms->old_frame_k_idx[8]] * (1-zpar)); |
| 854 | 936 | tms->current_k[8] += ((tms->target_k[8] - tms->current_k[8]) >> tms->coeff->interp_coeff[interp_period]); |
| 855 | 937 | break; |
| 856 | 938 | case 23: /* PC=11, B cycle, nothing happens (update K10) */ |
| 857 | 939 | break; |
| 858 | 940 | case 24: /* PC=12, A cycle, update K10 (do nothing) */ |
| 941 | if (interp_period == PC_COUNT_LOAD) |
| 942 | tms->current_k[9] = (tms->coeff->ktable[9][tms->old_frame_k_idx[9]] * (1-zpar)); |
| 859 | 943 | tms->current_k[9] += ((tms->target_k[9] - tms->current_k[9]) >> tms->coeff->interp_coeff[interp_period]); |
| 860 | 944 | break; |
| 861 | 945 | } |
| r7972 | r7973 | |
| 865 | 949 | if (OLD_FRAME_UNVOICED_FLAG == 1) |
| 866 | 950 | { |
| 867 | 951 | /* generate unvoiced samples here */ |
| 952 | #ifdef NORMALMODE |
| 868 | 953 | if (tms->RNG & 1) |
| 869 | | tms->excitation_data = -0x40; /* according to the patent it is (either + or -) half of the maximum value in the chirp table, so +-64 */ |
| 954 | tms->excitation_data = ~0x3F; /* according to the patent it is (either + or -) half of the maximum value in the chirp table, so either 01000000(0x40) or 11000000(0xC0)*/ |
| 870 | 955 | else |
| 871 | 956 | tms->excitation_data = 0x40; |
| 957 | #else |
| 958 | if (tms->RNG & 1) |
| 959 | tms->excitation_data = ~0x7F; |
| 960 | else |
| 961 | tms->excitation_data = 0x80; |
| 962 | #endif |
| 872 | 963 | } |
| 873 | 964 | else |
| 874 | 965 | { |
| 875 | 966 | /* generate voiced samples here */ |
| 876 | 967 | /* US patent 4331836 Figure 14B shows, and logic would hold, that a pitch based chirp |
| 877 | 968 | * function has a chirp/peak and then a long chain of zeroes. |
| 878 | | * The last entry of the chirp rom is at address 0b110011 (50d), the 51st sample, |
| 969 | * The last entry of the chirp rom is at address 0b110011 (51d), the 52nd sample, |
| 879 | 970 | * and if the address reaches that point the ADDRESS incrementer is |
| 880 | | * disabled, forcing all samples beyond 50d to be == 50d |
| 881 | | * (address 50d holds zeroes) |
| 971 | * disabled, forcing all samples beyond 51d to be == 51d |
| 972 | * (address 51d holds zeroes, which may or may not be inverted to -1) |
| 882 | 973 | */ |
| 883 | 974 | #ifdef NORMALMODE |
| 884 | | if (tms->pitch_count > 50) |
| 885 | | tms->excitation_data = tms->coeff->chirptable[50]<<CHIRPROM_LEFTSHIFT; |
| 886 | | else /*tms->pitch_count <= 50*/ |
| 887 | | tms->excitation_data = tms->coeff->chirptable[tms->pitch_count]<<CHIRPROM_LEFTSHIFT; |
| 975 | if (tms->pitch_count >= 51) |
| 976 | tms->excitation_data = tms->coeff->chirptable[51]; |
| 977 | else /*tms->pitch_count < 51*/ |
| 978 | tms->excitation_data = tms->coeff->chirptable[tms->pitch_count]; |
| 888 | 979 | #else |
| 889 | | tms->excitation_data = tms->pitch_count - 64; |
| 980 | if (tms->pitch_count >= 51) |
| 981 | tms->excitation_data = tms->coeff->chirptable[51]^0xFF; |
| 982 | else /*tms->pitch_count < 51*/ |
| 983 | tms->excitation_data = tms->coeff->chirptable[tms->pitch_count]^0xFF; |
| 890 | 984 | #endif |
| 891 | 985 | } |
| 892 | 986 | |
| r7972 | r7973 | |
| 900 | 994 | tms->RNG >>= 1; |
| 901 | 995 | tms->RNG |= bitout << 12; |
| 902 | 996 | } |
| 903 | | |
| 997 | #ifdef DEBUG_GENERATION_VERBOSE |
| 998 | fprintf(stderr,"X:%04d; E:%04d; P:%04d; Pc:%04d ",tms->excitation_data, tms->current_energy, tms->current_pitch, tms->pitch_count); |
| 999 | for (i=0; i<10; i++) |
| 1000 | fprintf(stderr,"K%d:%04d ", i+1, tms->current_k[i]); |
| 1001 | fprintf(stderr,"\n"); |
| 1002 | #endif |
| 904 | 1003 | buffer[buf_count] = clip_and_wrap(lattice_filter(tms)); /* execute lattice filter and clipping/wrapping */ |
| 905 | 1004 | |
| 906 | 1005 | //if (tms->digital_select == 0) /* if digital is NOT selected... */ |
| r7972 | r7973 | |
| 910 | 1009 | |
| 911 | 1010 | size--; |
| 912 | 1011 | tms->sample_count = (tms->sample_count + 1) % 200; |
| 913 | | #ifdef NORMALMODE |
| 914 | | if (tms->current_pitch != 0) |
| 915 | | tms->pitch_count = (tms->pitch_count + 1) % tms->current_pitch; |
| 916 | | else |
| 917 | | tms->pitch_count = 51; // blank spot in the chirp rom |
| 918 | | #else |
| 919 | | tms->pitch_count = (tms->pitch_count + 1) % 128; |
| 920 | | #endif |
| 1012 | tms->pitch_count++; |
| 1013 | if (tms->pitch_count >= tms->current_pitch) tms->pitch_count = 0; |
| 921 | 1014 | |
| 922 | 1015 | tms->interp_count = (tms->interp_count + 1) % 25; |
| 923 | 1016 | buf_count++; |
| r7972 | r7973 | |
| 929 | 1022 | { |
| 930 | 1023 | tms->sample_count = (tms->sample_count + 1) % 200; |
| 931 | 1024 | tms->interp_count = (tms->interp_count + 1) % 25; |
| 932 | | buffer[buf_count] = 0x00; /* should be (-1 << 8) ??? (cf note in data sheet, p 10, table 4) */ |
| 1025 | buffer[buf_count] = -1<<4; /* should be (-1 << 8) ??? (cf note in data sheet, p 10, table 4) */ |
| 933 | 1026 | buf_count++; |
| 934 | 1027 | size--; |
| 935 | 1028 | } |
| r7972 | r7973 | |
| 955 | 1048 | 00 0bcd efgh xxxx -> 0b0bcdefgh |
| 956 | 1049 | 0x xxxx xxxx xxxx -> 0b01111111 |
| 957 | 1050 | */ |
| 1051 | #ifdef DEBUG_CLIP_WRAP |
| 1052 | if ((cliptemp > 2047) || (cliptemp < -2048)) fprintf(stderr,"clipping cliptemp to range; was %d\n", cliptemp); |
| 1053 | #endif |
| 958 | 1054 | #ifdef DO_CLIP_AND_WRAP |
| 959 | 1055 | if (cliptemp > 2047) cliptemp = 2047; |
| 960 | 1056 | else if (cliptemp < -2048) cliptemp = -2048; |
| 1057 | //cliptemp &= 0xFFF0; |
| 961 | 1058 | /* at this point the analog output is tapped*/ |
| 962 | 1059 | return cliptemp << 4; |
| 963 | 1060 | #else |
| r7972 | r7973 | |
| 971 | 1068 | ti_matrix_multiply -- does the proper multiply and shift as the TI chips do. |
| 972 | 1069 | a is the k coefficient and is clamped to 10 bits (9 bits plus a sign) |
| 973 | 1070 | b is the running result and is clamped to 14 bits. |
| 974 | | output is 14 bits, but note the result LSB bit is always 1. |
| 1071 | output is 14 bits, but note the result LSB bit is always 1. (or is it?) |
| 975 | 1072 | |
| 976 | 1073 | **********************************************************************************************/ |
| 977 | 1074 | static INT16 matrix_multiply(INT16 a, INT16 b) |
| r7972 | r7973 | |
| 981 | 1078 | while (a<-512) { a+=1024; } |
| 982 | 1079 | while (b>16383) { b-=32768; } |
| 983 | 1080 | while (b<-16384) { b+=32768; } |
| 1081 | #ifdef NORMALMODE |
| 984 | 1082 | result = ((a*b)>>9)|1; |
| 1083 | #else |
| 1084 | result = (a*b)>>9; |
| 1085 | #endif |
| 985 | 1086 | #ifdef VERBOSE |
| 986 | 1087 | if (result>16383) fprintf(stderr,"matrix multiplier overflowed! a: %x, b: %x", a, b); |
| 987 | 1088 | if (result<-16384) fprintf(stderr,"matrix multiplier underflowed! a: %x, b: %x", a, b); |
| r7972 | r7973 | |
| 1007 | 1108 | Kn = tms->current_k[n-1] |
| 1008 | 1109 | bn = tms->x[n-1] |
| 1009 | 1110 | */ |
| 1010 | | tms->u[10] = matrix_multiply(tms->current_energy, (tms->excitation_data*64)); //Y(11) |
| 1111 | tms->u[10] = matrix_multiply(tms->previous_energy, (tms->excitation_data*64)); //Y(11) |
| 1011 | 1112 | //tms->u[10] = matrix_multiply((tms->excitation_data*64), tms->current_energy); // wrong but sounds better |
| 1012 | 1113 | tms->u[9] = tms->u[10] - matrix_multiply(tms->current_k[9], tms->x[9]); |
| 1013 | 1114 | tms->u[8] = tms->u[9] - matrix_multiply(tms->current_k[8], tms->x[8]); |
| r7972 | r7973 | |
| 1110 | 1211 | { |
| 1111 | 1212 | //SPKEXT going active activates SPKEE which clears the fifo |
| 1112 | 1213 | tms->fifo_head = tms->fifo_tail = tms->fifo_count = tms->fifo_bits_taken = 0; |
| 1113 | | tms->speaking_now = tms->speak_external = 1; |
| 1214 | tms->speak_external = 1; |
| 1114 | 1215 | tms->RDB_flag = FALSE; |
| 1115 | 1216 | } |
| 1116 | 1217 | break; |
| r7972 | r7973 | |
| 1138 | 1239 | |
| 1139 | 1240 | static void parse_frame(tms5220_state *tms) |
| 1140 | 1241 | { |
| 1141 | | int bits, indx, i, rep_flag; |
| 1142 | | #ifdef DEBUG_FRAME_DUMP |
| 1143 | | int ene; |
| 1144 | | #endif |
| 1242 | int indx, i, rep_flag; |
| 1145 | 1243 | |
| 1146 | | // todo: we actually don't care how many bits are left in the fifo here; the frame subpart will be processed normally, and any bits extracted 'past the end' of the fifo will be read as zeroes; the fifo being emptied will set the /BE latch which will halt speech exactly as if a stop frame had been encountered (instead of whatever partial frame was read); the same exact circuitry is used for both on the real chip, see us patent 4335277 sheet 16, gates 232a (decode stop frame) and 232b (decode /BE plus DDIS (decode disable) which is active during speak external). |
| 1147 | | if (tms->speak_external) |
| 1148 | | { |
| 1149 | | /* count the total number of bits available */ |
| 1150 | | bits = ((tms->fifo_count)*8)-tms->fifo_bits_taken; |
| 1151 | | } |
| 1152 | | else |
| 1153 | | { |
| 1154 | | /* we're talking out of a vsm rom, hence we have an effectively infinite number of bits which are pullable. extract_bits will toggle M0 for us and grab what bits are needed */ |
| 1155 | | bits = 131072; // == arbitrary large number |
| 1156 | | } |
| 1244 | // We actually don't care how many bits are left in the fifo here; the frame subpart will be processed normally, and any bits extracted 'past the end' of the fifo will be read as zeroes; the fifo being emptied will set the /BE latch which will halt speech exactly as if a stop frame had been encountered (instead of whatever partial frame was read); the same exact circuitry is used for both on the real chip, see us patent 4335277 sheet 16, gates 232a (decode stop frame) and 232b (decode /BE plus DDIS (decode disable) which is active during speak external). |
| 1245 | |
| 1157 | 1246 | /* if the chip is a tms5220C, and the rate mode is set to that each frame (0x04 bit set) |
| 1158 | 1247 | has a 2 bit rate preceeding it, grab two bits here and store them as the rate; */ |
| 1159 | 1248 | if ((tms->variant == SUBTYPE_TMS5220C) && (tms->tms5220c_rate & 0x04)) |
| 1160 | 1249 | { |
| 1161 | | bits -= 2; |
| 1162 | | if (bits < 0) goto ranout; |
| 1163 | 1250 | indx = extract_bits(tms, 2); |
| 1251 | #ifdef DEBUG_PARSE_FRAME_DUMP |
| 1252 | printbits(indx,2); |
| 1253 | fprintf(stderr," "); |
| 1254 | #endif |
| 1164 | 1255 | tms->sample_count = reload_table[indx]; |
| 1165 | 1256 | } |
| 1166 | 1257 | else // non-5220C and 5220C in fixed rate mode |
| 1167 | 1258 | tms->sample_count = reload_table[tms->tms5220c_rate&0x3]; |
| 1168 | 1259 | |
| 1260 | update_status_and_ints(tms); |
| 1261 | if (!tms->talk_status) goto ranout; |
| 1262 | |
| 1169 | 1263 | /* attempt to extract the energy index */ |
| 1170 | | bits -= tms->coeff->energy_bits; |
| 1171 | | if (bits < 0) goto ranout; |
| 1172 | | indx = extract_bits(tms,tms->coeff->energy_bits); |
| 1173 | | tms->new_frame_energy = tms->coeff->energytable[indx]; |
| 1174 | | #ifdef DEBUG_FRAME_DUMP |
| 1175 | | ene = indx; |
| 1264 | tms->new_frame_energy_idx = extract_bits(tms,tms->coeff->energy_bits); |
| 1265 | #ifdef DEBUG_PARSE_FRAME_DUMP |
| 1266 | printbits(tms->new_frame_energy_idx,tms->coeff->energy_bits); |
| 1267 | fprintf(stderr," "); |
| 1176 | 1268 | #endif |
| 1177 | | |
| 1269 | update_status_and_ints(tms); |
| 1270 | if (!tms->talk_status) goto ranout; |
| 1178 | 1271 | /* if the energy index is 0 or 15, we're done */ |
| 1179 | | |
| 1180 | | if ((indx == 0) || (indx == 15)) |
| 1181 | | { |
| 1182 | | #ifdef DEBUG_FRAME_INFO |
| 1183 | | logerror(" (4-bit energy=%d frame)\n",tms->new_frame_energy); |
| 1184 | | #endif |
| 1272 | if ((tms->new_frame_energy_idx == 0) || (tms->new_frame_energy_idx == 15)) |
| 1185 | 1273 | return; |
| 1186 | | } |
| 1187 | 1274 | |
| 1275 | |
| 1188 | 1276 | /* attempt to extract the repeat flag */ |
| 1189 | | bits -= 1; |
| 1190 | | if (bits < 0) goto ranout; |
| 1191 | 1277 | rep_flag = extract_bits(tms,1); |
| 1278 | #ifdef DEBUG_PARSE_FRAME_DUMP |
| 1279 | printbits(rep_flag, 1); |
| 1280 | fprintf(stderr," "); |
| 1281 | #endif |
| 1192 | 1282 | |
| 1193 | 1283 | /* attempt to extract the pitch */ |
| 1194 | | bits -= tms->coeff->pitch_bits; |
| 1195 | | if (bits < 0) goto ranout; |
| 1196 | | indx = extract_bits(tms,tms->coeff->pitch_bits); |
| 1197 | | tms->new_frame_pitch = tms->coeff->pitchtable[indx]; |
| 1198 | | |
| 1284 | tms->new_frame_pitch_idx = extract_bits(tms,tms->coeff->pitch_bits); |
| 1285 | #ifdef DEBUG_PARSE_FRAME_DUMP |
| 1286 | printbits(tms->new_frame_pitch_idx,tms->coeff->pitch_bits); |
| 1287 | fprintf(stderr," "); |
| 1288 | #endif |
| 1289 | update_status_and_ints(tms); |
| 1290 | if (!tms->talk_status) goto ranout; |
| 1199 | 1291 | /* if this is a repeat frame, just copy the k's */ |
| 1200 | 1292 | if (rep_flag) |
| 1293 | return; |
| 1294 | |
| 1295 | /* extract first 4 K coefficients */ |
| 1296 | for (i = 0; i < 4; i++) |
| 1201 | 1297 | { |
| 1202 | | //actually, we do nothing because the k's were already loaded (on parsing the previous frame) |
| 1203 | | |
| 1204 | | #ifdef DEBUG_FRAME_INFO |
| 1205 | | logerror(" (10-bit energy=%d pitch=%d rep=%d frame)\n", tms->new_frame_energy, tms->new_frame_pitch, rep_flag); |
| 1298 | tms->new_frame_k_idx[i] = extract_bits(tms,tms->coeff->kbits[i]); |
| 1299 | #ifdef DEBUG_PARSE_FRAME_DUMP |
| 1300 | printbits(tms->new_frame_k_idx[i],tms->coeff->kbits[i]); |
| 1301 | fprintf(stderr," "); |
| 1206 | 1302 | #endif |
| 1207 | | return; |
| 1303 | update_status_and_ints(tms); |
| 1304 | if (!tms->talk_status) goto ranout; |
| 1208 | 1305 | } |
| 1209 | 1306 | |
| 1210 | | |
| 1211 | | /* if the pitch index was zero, we need 4 k's */ |
| 1212 | | if (indx == 0) |
| 1307 | /* if the pitch index was zero, we only need 4 K's... */ |
| 1308 | if (tms->new_frame_pitch_idx == 0) |
| 1213 | 1309 | { |
| 1214 | | /* attempt to extract 4 K's */ |
| 1215 | | bits -= 18; |
| 1216 | | if (bits < 0) goto ranout; |
| 1217 | | for (i = 0; i < 4; i++) |
| 1218 | | tms->new_frame_k[i] = tms->coeff->ktable[i][extract_bits(tms,tms->coeff->kbits[i])]; |
| 1219 | | |
| 1220 | | /* and clear the rest of the new_frame_k[] */ |
| 1221 | | for (i = 4; i < tms->coeff->num_k; i++) |
| 1222 | | tms->new_frame_k[i] = 0; |
| 1223 | | #ifdef DEBUG_FRAME_INFO |
| 1224 | | logerror(" (29-bit energy=%d pitch=%d rep=%d 4K frame)\n", tms->new_frame_energy, tms->new_frame_pitch, rep_flag); |
| 1225 | | #endif |
| 1310 | /* and the rest of the coefficients are zeroed, but that's done in the generator code */ |
| 1226 | 1311 | return; |
| 1227 | 1312 | } |
| 1228 | 1313 | |
| 1229 | | /* else we need 10 K's */ |
| 1230 | | bits -= 39; |
| 1231 | | if (bits < 0) goto ranout; |
| 1232 | | #ifdef DEBUG_FRAME_DUMP |
| 1233 | | logerror("FrameDump %02d ", ene); |
| 1234 | | for (i = 0; i < tms->coeff->num_k; i++) |
| 1314 | /* If we got here, we need the remaining 6 K's */ |
| 1315 | for (i = 4; i < tms->coeff->num_k; i++) |
| 1235 | 1316 | { |
| 1236 | | int x; |
| 1237 | | x = extract_bits(tms, tms->coeff->kbits[i]); |
| 1238 | | tms->new_frame_k[i] = tms->coeff->ktable[i][x]; |
| 1239 | | logerror("%02d ", x); |
| 1317 | tms->new_frame_k_idx[i] = extract_bits(tms, tms->coeff->kbits[i]); |
| 1318 | #ifdef DEBUG_PARSE_FRAME_DUMP |
| 1319 | printbits(tms->new_frame_k_idx[i],tms->coeff->kbits[i]); |
| 1320 | fprintf(stderr," "); |
| 1321 | #endif |
| 1322 | update_status_and_ints(tms); |
| 1323 | if (!tms->talk_status) goto ranout; |
| 1240 | 1324 | } |
| 1241 | | logerror("\n"); |
| 1242 | | #else |
| 1243 | | for (i = 0; i < tms->coeff->num_k; i++) |
| 1244 | | { |
| 1245 | | int x; |
| 1246 | | x = extract_bits(tms, tms->coeff->kbits[i]); |
| 1247 | | tms->new_frame_k[i] = tms->coeff->ktable[i][x]; |
| 1248 | | } |
| 1249 | | #endif |
| 1250 | | #ifdef DEBUG_FRAME_INFO |
| 1251 | | logerror(" (50-bit energy=%d pitch=%d rep=%d 10K frame))\n", tms->new_frame_energy, tms->new_frame_pitch, rep_flag); |
| 1325 | #ifdef VERBOSE |
| 1252 | 1326 | if (tms->speak_external) |
| 1253 | 1327 | logerror("Parsed a frame successfully in FIFO - %d bits remaining\n", bits); |
| 1254 | 1328 | else |
| r7972 | r7973 | |
| 1260 | 1334 | #ifdef DEBUG_FRAME_ERRORS |
| 1261 | 1335 | logerror("Ran out of bits on a parse!\n"); |
| 1262 | 1336 | #endif |
| 1263 | | /* this is an error condition; mark the buffer empty and turn off speaking */ |
| 1264 | | tms->buffer_empty = 1; |
| 1265 | | tms->talk_status = tms->speak_external = tms->speaking_now = 0; |
| 1266 | | tms->fifo_count = tms->fifo_head = tms->fifo_tail = 0; |
| 1267 | | |
| 1268 | | tms->RDB_flag = FALSE; |
| 1269 | | |
| 1270 | | /* generate an interrupt since TS went low */ |
| 1271 | | set_interrupt_state(tms, 1); |
| 1272 | | return; |
| 1273 | | |
| 1337 | return; |
| 1274 | 1338 | } |
| 1275 | 1339 | |
| 1276 | 1340 | /********************************************************************************************** |
| r7972 | r7973 | |
| 1376 | 1440 | tms->RDB_flag = FALSE; |
| 1377 | 1441 | |
| 1378 | 1442 | /* initialize the energy/pitch/k states */ |
| 1379 | | tms->old_frame_energy = tms->new_frame_energy = tms->current_energy = tms->target_energy = 0; |
| 1380 | | tms->old_frame_pitch = tms->new_frame_pitch = tms->current_pitch = tms->target_pitch = 0; |
| 1381 | | memset(tms->old_frame_k, 0, sizeof(tms->old_frame_k)); |
| 1382 | | memset(tms->new_frame_k, 0, sizeof(tms->new_frame_k)); |
| 1443 | tms->old_frame_energy_idx = tms->new_frame_energy_idx = tms->current_energy = tms->target_energy = 0; |
| 1444 | tms->old_frame_pitch_idx = tms->new_frame_pitch_idx = tms->current_pitch = tms->target_pitch = 0; |
| 1445 | memset(tms->old_frame_k_idx, 0, sizeof(tms->old_frame_k_idx)); |
| 1446 | memset(tms->new_frame_k_idx, 0, sizeof(tms->new_frame_k_idx)); |
| 1383 | 1447 | memset(tms->current_k, 0, sizeof(tms->current_k)); |
| 1384 | 1448 | memset(tms->target_k, 0, sizeof(tms->target_k)); |
| 1385 | 1449 | |
| r7972 | r7973 | |
| 1477 | 1541 | logerror("Schedule write ready\n"); |
| 1478 | 1542 | #endif |
| 1479 | 1543 | //tms->io_ready = 1; |
| 1480 | | ///* 100 nsec from data sheet */ |
| 1481 | | //timer_set(tms->device->machine, ATTOTIME_IN_NSEC(100), tms, 0, io_ready_cb); |
| 1544 | /* 100 nsec from data sheet, through 3 asynchronous gates on patent */ |
| 1545 | //timer_set(tms->device->machine, ATTOTIME_IN_HZ(device->clock), tms, 0, io_ready_cb); // /READY goes inactive immediately, within one clock... for that matter, what do we even need a timer for then? |
| 1482 | 1546 | tms->io_ready = 0; |
| 1483 | | /* 25 usec in datasheet, but zaccaria won't work */ |
| 1484 | | timer_set(tms->device->machine, ATTOTIME_IN_USEC(100), tms, 1, io_ready_cb); |
| 1547 | /* 25 usec (16 clocks) in datasheet, but zaccaria games glitch or fail to talk if that value is used. The zaccaria glitching may be buggy game code or may be a bug with the MAME 6821 PIA code which interfaces with the tms5200, particularly its handling of updates of the CA1 and CA2 lines? */ |
| 1548 | //timer_set(tms->device->machine, ATTOTIME_IN_USEC(100), tms, 1, io_ready_cb); |
| 1549 | timer_set(tms->device->machine, ATTOTIME_IN_HZ(device->clock/16), tms, 1, io_ready_cb); // this should take around 10-16 (closer to ~11?) cycles to complete |
| 1485 | 1550 | } |
| 1486 | 1551 | } |
| 1487 | 1552 | } |
| r7972 | r7973 | |
| 1525 | 1590 | { |
| 1526 | 1591 | ///* high to low - schedule ready cycle*/ |
| 1527 | 1592 | //tms->io_ready = 1; |
| 1528 | | //timer_set(tms->device->machine, ATTOTIME_IN_NSEC(100), tms, 0, io_ready_cb); |
| 1593 | /* 100 nsec from data sheet, through 3 asynchronous gates on patent */ |
| 1594 | //timer_set(tms->device->machine, ATTOTIME_IN_HZ(device->clock), tms, 0, io_ready_cb); // /READY goes inactive immediately, within one clock... for that matter, what do we even need a timer for then? |
| 1529 | 1595 | tms->io_ready = 0; |
| 1530 | | timer_set(tms->device->machine, ATTOTIME_IN_USEC(25), tms, 1, io_ready_cb); |
| 1596 | timer_set(tms->device->machine, ATTOTIME_IN_HZ(device->clock/16), tms, 1, io_ready_cb); // this should take around 10-16 (closer to ~15) cycles to complete |
| 1531 | 1597 | } |
| 1532 | 1598 | } |
| 1533 | 1599 | } |