trunk/src/mame/machine/snes.c
| r21581 | r21582 | |
| 410 | 410 | return superfx_mmio_read(state->m_superfx, offset); |
| 411 | 411 | } |
| 412 | 412 | } |
| 413 | | else if (state->m_has_addon_chip == HAS_SDD1) |
| 414 | | { |
| 415 | | if (offset >= 0x4800 && offset < 0x4808) |
| 416 | | { |
| 417 | | return sdd1_mmio_read(space, (UINT32)offset); |
| 418 | | } |
| 419 | | if (offset < 0x80) |
| 420 | | { |
| 421 | | offset += 0x4300; |
| 422 | | } |
| 423 | | } |
| 424 | 413 | else if (state->m_has_addon_chip == HAS_SPC7110 || state->m_has_addon_chip == HAS_SPC7110_RTC) |
| 425 | 414 | { |
| 426 | 415 | UINT16 limit = (state->m_has_addon_chip == HAS_SPC7110_RTC) ? 0x4842 : 0x483f; |
| r21581 | r21582 | |
| 540 | 529 | return; |
| 541 | 530 | } |
| 542 | 531 | } |
| 543 | | else if (state->m_has_addon_chip == HAS_SDD1) |
| 544 | | { |
| 545 | | if ((offset >= 0x4300 && offset < 0x4380) || |
| 546 | | (offset >= 0x4800 && offset < 0x4808)) |
| 547 | | { |
| 548 | | sdd1_mmio_write(space, (UINT32)offset, data); |
| 549 | | return; |
| 550 | | } |
| 551 | | if (offset < 0x80) |
| 552 | | { |
| 553 | | offset += 0x4300; |
| 554 | | } |
| 555 | | } |
| 556 | 532 | else if (state->m_has_addon_chip == HAS_SPC7110 || state->m_has_addon_chip == HAS_SPC7110_RTC) |
| 557 | 533 | { |
| 558 | 534 | UINT16 limit = (state->m_has_addon_chip == HAS_SPC7110_RTC) ? 0x4842 : 0x483f; |
| r21581 | r21582 | |
| 1021 | 997 | } |
| 1022 | 998 | else if ((state->m_has_addon_chip == HAS_SPC7110 || state->m_has_addon_chip == HAS_SPC7110_RTC) && offset >= 0x100000) |
| 1023 | 999 | value = spc7110_bank7_read(space, offset); |
| 1024 | | else if (state->m_has_addon_chip == HAS_SDD1) |
| 1025 | | value = sdd1_read(space.machine(), offset); |
| 1026 | 1000 | else if ((state->m_cart[0].mode & 5) && !(state->m_has_addon_chip == HAS_SUPERFX)) /* Mode 20 & 22 */ |
| 1027 | 1001 | { |
| 1028 | 1002 | if (address < 0x8000) |
trunk/src/mame/machine/snessdd1.c
| r21581 | r21582 | |
| 554 | 554 | snes_sdd1.buffer.ready = 0; |
| 555 | 555 | } |
| 556 | 556 | |
| 557 | | static UINT8 sdd1_mmio_read(address_space &space, UINT32 addr) |
| 557 | UINT8 sdd1_mmio_read(address_space &space, UINT32 addr) |
| 558 | 558 | { |
| 559 | 559 | addr &= 0xffff; |
| 560 | 560 | |
| 561 | | if ((addr & 0x4380) == 0x4300) |
| 562 | | { |
| 563 | | return snes_r_io(space, addr & 0x7f); |
| 564 | | } |
| 565 | | |
| 566 | 561 | switch(addr) |
| 567 | 562 | { |
| 568 | 563 | case 0x4804: |
| r21581 | r21582 | |
| 578 | 573 | return snes_open_bus_r(space, 0); |
| 579 | 574 | } |
| 580 | 575 | |
| 581 | | static void sdd1_mmio_write(address_space &space, UINT32 addr, UINT8 data) |
| 576 | void sdd1_mmio_write(address_space &space, UINT32 addr, UINT8 data) |
| 582 | 577 | { |
| 583 | 578 | addr &= 0xffff; |
| 584 | 579 | |
| r21581 | r21582 | |
| 604 | 599 | snes_sdd1.dma[channel].size = (snes_sdd1.dma[channel].size & 0x00ff) + (data << 8); |
| 605 | 600 | break; |
| 606 | 601 | } |
| 607 | | snes_ram[addr] = data; |
| 608 | | snes_io_dma_w(space, addr, data); |
| 609 | 602 | return; |
| 610 | 603 | } |
| 611 | 604 | |
| r21581 | r21582 | |
| 633 | 626 | } |
| 634 | 627 | } |
| 635 | 628 | |
| 636 | | static UINT8 sdd1_read(running_machine& machine, UINT32 addr) |
| 629 | UINT8 sdd1_read(running_machine& machine, UINT32 addr) |
| 637 | 630 | { |
| 638 | 631 | unsigned char *ROM = machine.root_device().memregion("cart")->base(); |
| 639 | 632 | |
trunk/src/mame/includes/snes.h
| r21581 | r21582 | |
| 773 | 773 | extern DECLARE_WRITE8_HANDLER(obc1_write); |
| 774 | 774 | UINT8 CX4_read(UINT32 addr); |
| 775 | 775 | void CX4_write(running_machine &machine, UINT32 addr, UINT8 data); |
| 776 | UINT8 sdd1_mmio_read(address_space &space, UINT32 addr); |
| 777 | void sdd1_mmio_write(address_space &space, UINT32 addr, UINT8 data); |
| 778 | UINT8 sdd1_read(running_machine& machine, UINT32 addr); |
| 776 | 779 | |
| 777 | 780 | |
| 778 | 781 | extern struct snes_cart_info snes_cart; |
trunk/src/mess/drivers/snes.c
| r21581 | r21582 | |
| 141 | 141 | if (state->m_has_addon_chip == HAS_DSP4 |
| 142 | 142 | && (offset >= 0x300000 && offset < 0x400000 && (offset & 0x8000) == 0x8000)) |
| 143 | 143 | return ((offset & 0xffff) < 0xc000) ? dsp_get_dr() : dsp_get_sr(); |
| 144 | if (state->m_has_addon_chip == HAS_SDD1 |
| 145 | && (offset < 0x400000 && (offset & 0xffff) >= 0x4800 && (offset & 0xffff) < 0x4808)) |
| 146 | return sdd1_mmio_read(space, (UINT32)(offset & 0xffff)); |
| 144 | 147 | |
| 145 | 148 | // base cart access |
| 146 | 149 | if (offset < 0x300000) |
| r21581 | r21582 | |
| 191 | 194 | if (state->m_has_addon_chip == HAS_DSP4 |
| 192 | 195 | && (offset >= 0x300000 && offset < 0x400000 && (offset & 0x8000) == 0x8000)) |
| 193 | 196 | return ((offset & 0xffff) < 0xc000) ? dsp_get_dr() : dsp_get_sr(); |
| 197 | if (state->m_has_addon_chip == HAS_SDD1 |
| 198 | && (offset < 0x400000 && (offset & 0xffff) >= 0x4800 && (offset & 0xffff) < 0x4808)) |
| 199 | return sdd1_mmio_read(space, (UINT32)(offset & 0xffff)); |
| 200 | if (state->m_has_addon_chip == HAS_SDD1 && offset >= 0x400000) |
| 201 | return sdd1_read(space.machine(), offset - 0x400000);; |
| 194 | 202 | |
| 195 | 203 | // base cart access |
| 196 | 204 | if (offset < 0x400000) |
| r21581 | r21582 | |
| 259 | 267 | else |
| 260 | 268 | { dsp_set_sr(data); return; } |
| 261 | 269 | } |
| 270 | if (state->m_has_addon_chip == HAS_SDD1 && offset < 0x400000) |
| 271 | { |
| 272 | if (((offset & 0xffff) >= 0x4300 && (offset & 0xffff) < 0x4380) || |
| 273 | ((offset & 0xffff) >= 0x4800 && (offset & 0xffff) < 0x4808)) |
| 274 | { |
| 275 | sdd1_mmio_write(space, (UINT32)(offset & 0xffff), data); |
| 276 | // here we don't return, but we let the w_io happen... |
| 277 | } |
| 278 | } |
| 262 | 279 | |
| 263 | 280 | // base cart access |
| 264 | 281 | if (offset < 0x300000) |
| r21581 | r21582 | |
| 333 | 350 | else |
| 334 | 351 | { dsp_set_sr(data); return; } |
| 335 | 352 | } |
| 353 | if (state->m_has_addon_chip == HAS_SDD1 && offset < 0x400000) |
| 354 | { |
| 355 | if (((offset & 0xffff) >= 0x4300 && (offset & 0xffff) < 0x4380) || |
| 356 | ((offset & 0xffff) >= 0x4800 && (offset & 0xffff) < 0x4808)) |
| 357 | { |
| 358 | sdd1_mmio_write(space, (UINT32)(offset & 0xffff), data); |
| 359 | // here we don't return, but we let the w_io happen... |
| 360 | } |
| 361 | } |
| 336 | 362 | |
| 337 | 363 | // base cart access |
| 338 | 364 | if (offset < 0x400000) |