trunk/src/mess/drivers/snes.c
| r21820 | r21821 | |
| 1616 | 1616 | else if (m_slotcart->get_type() == SNES_CX4 |
| 1617 | 1617 | && (offset < 0x400000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000)) // hack until we emulate the real CPU |
| 1618 | 1618 | return CX4_read((offset & 0xffff) - 0x6000); |
| 1619 | | else if (m_slotcart->get_type() == SNES_BANANA |
| 1620 | | && (offset & 0x78000) == 0x8000) |
| 1621 | | { |
| 1622 | | return m_slotcart->m_cart->chip_read(space, offset); |
| 1623 | | } |
| 1624 | | else if (m_slotcart->get_type() == SNES_BUGS |
| 1625 | | && (offset & 0x7f000) == 0xf000) |
| 1626 | | { |
| 1627 | | printf("read hi addr %X\n", offset); |
| 1628 | | // return m_slotcart->m_cart->chip_read(space, offset); |
| 1629 | | } |
| 1630 | 1619 | |
| 1631 | 1620 | if (offset < 0x400000) |
| 1632 | 1621 | { |
| r21820 | r21821 | |
| 1687 | 1676 | else if (m_type == SNES_SUFAMITURBO |
| 1688 | 1677 | && address >= 0x8000 && ((offset >= 0x600000 && offset < 0x640000) || (offset >= 0x700000 && offset < 0x740000))) |
| 1689 | 1678 | { m_slotcart->m_cart->write_h(space, offset, data); return; } |
| 1690 | | // else if (m_slotcart->get_type() == SNES_BANANA |
| 1691 | | // && (offset & 0x8000) == 0x8000) |
| 1692 | | // { |
| 1693 | | // printf("write addr hi %X data %X\n", offset, data); |
| 1694 | | // m_slotcart->m_cart->chip_write(space, offset, data); |
| 1695 | | // return; |
| 1696 | | // } |
| 1697 | | else if (m_slotcart->get_type() == SNES_BUGS |
| 1698 | | && (offset & 0x7f000) == 0xf000) |
| 1699 | | { |
| 1700 | | // printf("write hi addr %X data %X\n", offset, data); |
| 1701 | | } |
| 1702 | 1679 | |
| 1703 | 1680 | |
| 1704 | 1681 | if (offset < 0x400000) |
| r21820 | r21821 | |
| 1735 | 1712 | else if (m_slotcart->get_type() == SNES_CX4 |
| 1736 | 1713 | && (offset < 0x400000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000)) // hack until we emulate the real CPU |
| 1737 | 1714 | return CX4_read((offset & 0xffff) - 0x6000); |
| 1738 | | else if (m_slotcart->get_type() == SNES_BUGS |
| 1739 | | && (offset & 0x78000) == 0x8000) |
| 1740 | | { |
| 1741 | | // printf("read lo addr %X\n", offset); |
| 1742 | | // return m_slotcart->m_cart->chip_read(space, offset); |
| 1743 | | } |
| 1744 | 1715 | |
| 1745 | 1716 | |
| 1746 | 1717 | if (offset < 0x400000) |
| r21820 | r21821 | |
| 1790 | 1761 | if (m_type == SNES_SUFAMITURBO |
| 1791 | 1762 | && (offset & 0xffff) >= 0x8000 && ((offset >= 0x600000 && offset < 0x640000) || (offset >= 0x700000 && offset < 0x740000))) |
| 1792 | 1763 | { m_slotcart->m_cart->write_l(space, offset, data); return; } |
| 1793 | | else if (m_slotcart->get_type() == SNES_20COL |
| 1794 | | && offset >= 0x8000 && offset < 0x9000) |
| 1795 | | { m_slotcart->m_cart->chip_write(space, offset, data); return; } |
| 1796 | | else if (m_slotcart->get_type() == SNES_BANANA |
| 1797 | | && (offset & 0x8000) == 0x8000) |
| 1798 | | { |
| 1799 | | printf("write addr lo %X data %X\n", offset, data); |
| 1800 | | m_slotcart->m_cart->chip_write(space, offset, data); |
| 1801 | | return; |
| 1802 | | } |
| 1803 | | else if (m_slotcart->get_type() == SNES_BUGS |
| 1804 | | && (offset & 0x78000) == 0x8000) |
| 1805 | | { |
| 1806 | | // printf("write lo addr %X data %X\n", offset, data); |
| 1807 | | } |
| 1808 | 1764 | |
| 1809 | 1765 | // other add-on writes matches the hi handler |
| 1810 | 1766 | snes20_hi_w(space, offset, data, 0xff); |