trunk/src/mess/drivers/snes.c
| r21851 | r21852 | |
| 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 | | |
| 1619 | |
| 1620 | 1620 | if (offset < 0x400000) |
| 1621 | 1621 | { |
| 1622 | 1622 | if (address < 0x2000) |
| r21851 | r21852 | |
| 1676 | 1676 | else if (m_type == SNES_SUFAMITURBO |
| 1677 | 1677 | && address >= 0x8000 && ((offset >= 0x600000 && offset < 0x640000) || (offset >= 0x700000 && offset < 0x740000))) |
| 1678 | 1678 | { m_slotcart->m_cart->write_h(space, offset, data); return; } |
| 1679 | | |
| 1680 | | |
| 1679 | |
| 1681 | 1680 | if (offset < 0x400000) |
| 1682 | 1681 | { |
| 1683 | 1682 | if (address < 0x2000) |
| r21851 | r21852 | |
| 1712 | 1711 | else if (m_slotcart->get_type() == SNES_CX4 |
| 1713 | 1712 | && (offset < 0x400000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000)) // hack until we emulate the real CPU |
| 1714 | 1713 | return CX4_read((offset & 0xffff) - 0x6000); |
| 1715 | | |
| 1716 | | |
| 1714 | |
| 1717 | 1715 | if (offset < 0x400000) |
| 1718 | 1716 | { |
| 1719 | 1717 | if (address < 0x2000) |
| r21851 | r21852 | |
| 1761 | 1759 | if (m_type == SNES_SUFAMITURBO |
| 1762 | 1760 | && (offset & 0xffff) >= 0x8000 && ((offset >= 0x600000 && offset < 0x640000) || (offset >= 0x700000 && offset < 0x740000))) |
| 1763 | 1761 | { m_slotcart->m_cart->write_l(space, offset, data); return; } |
| 1764 | | |
| 1762 | |
| 1765 | 1763 | // other add-on writes matches the hi handler |
| 1766 | 1764 | snes20_hi_w(space, offset, data, 0xff); |
| 1767 | 1765 | } |
| r21851 | r21852 | |
| 1781 | 1779 | return space.read_byte(0x7e0000 + address); |
| 1782 | 1780 | else if (address < 0x6000) |
| 1783 | 1781 | return snes_r_io(space, address); |
| 1784 | | else if (address < 0x8000) |
| 1782 | else |
| 1785 | 1783 | { |
| 1786 | 1784 | if (m_type == SNES_BSXHI && m_slotcart->m_cart->get_nvram_size() && offset >= 0x200000) |
| 1787 | 1785 | { |
| r21851 | r21852 | |
| 1814 | 1812 | space.write_byte(0x7e0000 + address, data); |
| 1815 | 1813 | else if (address < 0x6000) |
| 1816 | 1814 | snes_w_io(space, address, data); |
| 1817 | | else if (address < 0x8000) |
| 1815 | else |
| 1818 | 1816 | { |
| 1819 | 1817 | if (m_type == SNES_BSXHI && m_slotcart->m_cart->get_nvram_size() && offset >= 0x200000) |
| 1820 | 1818 | { |
| r21851 | r21852 | |
| 1843 | 1841 | return space.read_byte(0x7e0000 + address); |
| 1844 | 1842 | else if (address < 0x6000) |
| 1845 | 1843 | return snes_r_io(space, address); |
| 1846 | | else if (address < 0x8000) |
| 1844 | else |
| 1847 | 1845 | { |
| 1848 | 1846 | if (m_type == SNES_BSXHI && m_slotcart->m_cart->get_nvram_size() && offset >= 0x200000) |
| 1849 | 1847 | { |
| r21851 | r21852 | |
| 1876 | 1874 | space.write_byte(0x7e0000 + address, data); |
| 1877 | 1875 | else if (address < 0x6000) |
| 1878 | 1876 | snes_w_io(space, address, data); |
| 1879 | | else if (address < 0x8000) |
| 1877 | else |
| 1880 | 1878 | { |
| 1881 | 1879 | if (m_type == SNES_BSXHI && m_slotcart->m_cart->get_nvram_size() && offset >= 0x200000) |
| 1882 | 1880 | { |
| r21851 | r21852 | |
| 2280 | 2278 | SLOT_INTERFACE_INTERNAL("lorom_mcpir1", SNS_LOROM_MCPIR1) |
| 2281 | 2279 | SLOT_INTERFACE_INTERNAL("lorom_mcpir2", SNS_LOROM_MCPIR2) |
| 2282 | 2280 | SLOT_INTERFACE_INTERNAL("lorom_20col", SNS_LOROM_20COL) |
| 2283 | | SLOT_INTERFACE_INTERNAL("lorom_pija", SNS_LOROM_BANANA) // not working yet |
| 2284 | | SLOT_INTERFACE_INTERNAL("lorom_bugs", SNS_LOROM_BUGSLIFE) // not working yet |
| 2281 | SLOT_INTERFACE_INTERNAL("lorom_pija", SNS_LOROM_BANANA) // not working yet |
| 2282 | SLOT_INTERFACE_INTERNAL("lorom_bugs", SNS_LOROM_BUGSLIFE) // not working yet |
| 2285 | 2283 | SLOT_INTERFACE_END |
| 2286 | 2284 | |
| 2287 | 2285 | |
| r21851 | r21852 | |
| 2386 | 2384 | break; |
| 2387 | 2385 | case SNES_BUGS: |
| 2388 | 2386 | case SNES_BANANA: |
| 2389 | | // machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x808000, 0x80ffff, 0, 0x780000, read8_delegate(FUNC(device_sns_cart_interface::chip_read),state->m_slotcart->m_cart)); |
| 2390 | | // machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x808000, 0x80ffff, 0, 0x780000, write8_delegate(FUNC(device_sns_cart_interface::chip_write),state->m_slotcart->m_cart)); |
| 2387 | // machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x808000, 0x80ffff, 0, 0x780000, read8_delegate(FUNC(device_sns_cart_interface::chip_read),state->m_slotcart->m_cart)); |
| 2388 | // machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x808000, 0x80ffff, 0, 0x780000, write8_delegate(FUNC(device_sns_cart_interface::chip_write),state->m_slotcart->m_cart)); |
| 2391 | 2389 | // set_5a22_map(*state->m_maincpu); |
| 2392 | 2390 | break; |
| 2393 | 2391 | } |