trunk/src/mess/drivers/snes.c
| r21601 | r21602 | |
| 70 | 70 | DECLARE_READ8_MEMBER(snes_oldjoy1_read); |
| 71 | 71 | DECLARE_READ8_MEMBER(snes_oldjoy2_read); |
| 72 | 72 | |
| 73 | | UINT8 m_sfx_ram[0x200000]; // or 0x100000? |
| 73 | UINT8 m_sfx_ram[0x200000]; // or 0x100000? |
| 74 | 74 | }; |
| 75 | 75 | |
| 76 | 76 | /************************************* |
| r21601 | r21602 | |
| 191 | 191 | if ((m_has_addon_chip == HAS_SPC7110 || m_has_addon_chip == HAS_SPC7110_RTC) |
| 192 | 192 | && offset >= 0x500000 && offset < 0x510000) |
| 193 | 193 | return spc7110_mmio_read(space, 0x4800); |
| 194 | | if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL |
| 195 | | && offset < 0x400000) |
| 196 | | { |
| 197 | | if (address >= 0x3000 && address < 0x3300) |
| 198 | | return superfx_mmio_read(m_superfx, address); |
| 199 | | if (address >= 0x6000 && address < 0x8000) |
| 200 | | return superfx_access_ram(m_superfx) ? m_sfx_ram[offset & 0x1fff] : snes_open_bus_r(space, 0); |
| 201 | | } |
| 202 | | if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL |
| 203 | | && offset >= 0x400000 && offset < 0x600000) |
| 204 | | { |
| 205 | | if (superfx_access_rom(m_superfx)) |
| 206 | | return snes_ram[offset]; |
| 207 | | else |
| 208 | | { |
| 209 | | static const UINT8 sfx_data[16] = { |
| 210 | | 0x00, 0x01, 0x00, 0x01, 0x04, 0x01, 0x00, 0x01, |
| 211 | | 0x00, 0x01, 0x08, 0x01, 0x00, 0x01, 0x0c, 0x01, |
| 212 | | }; |
| 213 | | return sfx_data[offset & 0x0f]; |
| 214 | | } |
| 215 | | } |
| 216 | | if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL |
| 217 | | && offset >= 0x600000) |
| 218 | | return superfx_access_ram(m_superfx) ? m_sfx_ram[offset & 0xfffff] : snes_open_bus_r(space, 0); |
| 194 | if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL) |
| 195 | return space.read_byte(offset + 0x800000); // [00-7f] same as [80-ff] |
| 219 | 196 | |
| 220 | 197 | // base cart access |
| 221 | 198 | if (offset < 0x300000) |
| r21601 | r21602 | |
| 286 | 263 | if ((m_has_addon_chip == HAS_SPC7110 || m_has_addon_chip == HAS_SPC7110_RTC) |
| 287 | 264 | && offset >= 0x500000) |
| 288 | 265 | return spc7110_bank7_read(space, offset - 0x400000); |
| 289 | | if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL) |
| 290 | | return space.read_byte(offset); // [80-ff] same as [00-7f] |
| 266 | if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL |
| 267 | && offset < 0x400000) |
| 268 | { |
| 269 | if (address >= 0x3000 && address < 0x3300) |
| 270 | return superfx_mmio_read(m_superfx, address); |
| 271 | if (address >= 0x6000 && address < 0x8000) |
| 272 | return superfx_access_ram(m_superfx) ? m_sfx_ram[offset & 0x1fff] : snes_open_bus_r(space, 0); |
| 273 | } |
| 274 | if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL |
| 275 | && offset >= 0x400000 && offset < 0x600000) |
| 276 | { |
| 277 | if (superfx_access_rom(m_superfx)) |
| 278 | return snes_ram[offset]; |
| 279 | else |
| 280 | { |
| 281 | static const UINT8 sfx_data[16] = { |
| 282 | 0x00, 0x01, 0x00, 0x01, 0x04, 0x01, 0x00, 0x01, |
| 283 | 0x00, 0x01, 0x08, 0x01, 0x00, 0x01, 0x0c, 0x01, |
| 284 | }; |
| 285 | return sfx_data[offset & 0x0f]; |
| 286 | } |
| 287 | } |
| 288 | if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL |
| 289 | && offset >= 0x600000) |
| 290 | return superfx_access_ram(m_superfx) ? m_sfx_ram[offset & 0xfffff] : snes_open_bus_r(space, 0); |
| 291 | 291 | |
| 292 | 292 | // base cart access |
| 293 | 293 | if (offset < 0x400000) |
| r21601 | r21602 | |
| 363 | 363 | if (offset >= 0x300000 && offset < 0x310000 && address >= 0x6000 && address < 0x8000) |
| 364 | 364 | { snes_ram[0x306000 + (address & 0x1fff)] = data; return; } |
| 365 | 365 | } |
| 366 | | if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL |
| 367 | | && offset < 0x400000) |
| 368 | | { |
| 369 | | if (address >= 0x3000 && address < 0x3300) |
| 370 | | { superfx_mmio_write(m_superfx, address, data); return; } |
| 371 | | if (address >= 0x6000 && address < 0x8000) |
| 372 | | { m_sfx_ram[offset & 0x1fff] = data; return; } |
| 373 | | } |
| 374 | | if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL |
| 375 | | && offset >= 0x600000) |
| 376 | | { m_sfx_ram[offset & 0xfffff] = data; return; } |
| 366 | if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL) |
| 367 | { space.write_byte(offset + 0x800000, data); return; } // [00-7f] same as [80-ff] |
| 377 | 368 | |
| 378 | 369 | // base cart access |
| 379 | 370 | if (offset < 0x300000) |
| r21601 | r21602 | |
| 455 | 446 | if (offset >= 0x300000 && offset < 0x310000 && address >= 0x6000 && address < 0x8000) |
| 456 | 447 | { snes_ram[0x306000 + (address & 0x1fff)] = data; return; } |
| 457 | 448 | } |
| 458 | | if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL) |
| 459 | | { space.write_byte(offset, data); return; } // [80-ff] same as [00-7f] |
| 449 | if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL |
| 450 | && offset < 0x400000) |
| 451 | { |
| 452 | if (address >= 0x3000 && address < 0x3300) |
| 453 | { superfx_mmio_write(m_superfx, address, data); return; } |
| 454 | if (address >= 0x6000 && address < 0x8000) |
| 455 | { m_sfx_ram[offset & 0x1fff] = data; return; } |
| 456 | } |
| 457 | if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL |
| 458 | && offset >= 0x600000) |
| 459 | { m_sfx_ram[offset & 0xfffff] = data; return; } |
| 460 | 460 | |
| 461 | 461 | // base cart access |
| 462 | 462 | if (offset < 0x400000) |