src/mame/machine/snes.c
| r5406 | r5407 | |
| 370 | 370 | case WBGLOG: |
| 371 | 371 | return snes_ppu.ppu1_open_bus; |
| 372 | 372 | |
| 373 | | /* Shien The Blade Chaser / Shien's Revenge reads here instead */ |
| 374 | | case NMITIMEN: |
| 375 | | return snes_open_bus_r(space,0); |
| 376 | 373 | // According to BSNES, these should return snes_open_bus_r! |
| 377 | 374 | // case OAMADDL: |
| 378 | 375 | // case OAMADDH: |
| r5406 | r5407 | |
| 403 | 400 | } |
| 404 | 401 | case SLHV: /* Software latch for H/V counter */ |
| 405 | 402 | snes_latch_counters(space->machine); |
| 406 | | return 0x0; /* Return value is meaningless */ |
| 403 | return snes_open_bus_r(space,0); /* Return value is meaningless */ |
| 407 | 404 | case ROAMDATA: /* Read data from OAM (DR) */ |
| 408 | 405 | { |
| 409 | 406 | int oam_addr = snes_ppu.oam.address; |
| r5406 | r5407 | |
| 555 | 552 | case WMADDM: /* Address to read/write to wram (mid) */ |
| 556 | 553 | case WMADDH: /* Address to read/write to wram (high) */ |
| 557 | 554 | return snes_ram[offset]; |
| 558 | | case OLDJOY1: /* Data for old NES controllers */ |
| 555 | case OLDJOY1: /* Data for old NES controllers (JOYSER1) */ |
| 559 | 556 | { |
| 560 | 557 | if( snes_ram[offset] & 0x1 ) |
| 561 | 558 | { |
| 562 | | return 0; |
| 559 | return 0 | (snes_open_bus_r(space,0) & 0xfc); //correct? |
| 563 | 560 | } |
| 564 | 561 | value = ((joypad[0].low | (joypad[0].high << 8) | 0x10000) >> (15 - (joypad[0].oldrol++ % 16))) & 0x1; |
| 565 | 562 | if( !(joypad[0].oldrol % 17) ) |
| 566 | 563 | value = 0x1; |
| 567 | | return value; |
| 564 | return (value & 0x03) | (snes_open_bus_r(space,0) & 0xfc); //correct? |
| 568 | 565 | } |
| 569 | | case OLDJOY2: /* Data for old NES controllers */ |
| 566 | case OLDJOY2: /* Data for old NES controllers (JOYSER2) */ |
| 570 | 567 | { |
| 571 | 568 | if( snes_ram[OLDJOY1] & 0x1 ) |
| 572 | 569 | { |
| 573 | | return 0; |
| 570 | return 0 | 0x1c | (snes_open_bus_r(space,0) & 0xe0); //correct? |
| 574 | 571 | } |
| 575 | 572 | value = ((joypad[1].low | (joypad[1].high << 8) | 0x10000) >> (15 - (joypad[1].oldrol++ % 16))) & 0x1; |
| 576 | 573 | if( !(joypad[1].oldrol % 17) ) |
| 577 | 574 | value = 0x1; |
| 578 | | value |= 0x1c; // bits 4, 3, and 2 are always set |
| 579 | | return value; |
| 575 | //value |= 0x1c; // bits 4, 3, and 2 are always set |
| 576 | return value | 0x1c | (snes_open_bus_r(space,0) & 0xe0); //correct? |
| 580 | 577 | } |
| 581 | 578 | case HTIMEL: |
| 582 | 579 | case HTIMEH: |
| 583 | 580 | case VTIMEL: |
| 584 | 581 | case VTIMEH: |
| 585 | 582 | return snes_ram[offset]; |
| 586 | | case MDMAEN: /* GDMA channel designation and trigger */ |
| 587 | | /* FIXME: Is this really read-only? - Villgust needs to read it */ |
| 588 | | return snes_ram[offset]; |
| 589 | 583 | case RDNMI: /* NMI flag by v-blank and version number */ |
| 590 | | value = snes_ram[offset]; |
| 584 | value = (snes_ram[offset] & 0x8f) | (snes_open_bus_r(space,0) & 0x70); |
| 591 | 585 | snes_ram[offset] &= 0x7f; /* NMI flag is reset on read */ |
| 592 | 586 | return value; |
| 593 | 587 | case TIMEUP: /* IRQ flag by H/V count timer */ |
| r5406 | r5407 | |
| 599 | 593 | // electronics test says hcounter 272 is start of hblank, which is beampos 363 |
| 600 | 594 | // if (video_screen_get_hpos(space->machine->primary_screen) >= 363) snes_ram[offset] |= 0x40; |
| 601 | 595 | // else snes_ram[offset] &= ~0x40; |
| 602 | | return snes_ram[offset]; |
| 596 | return (snes_ram[offset] & 0xc1) | (snes_open_bus_r(space,0) & 0x3e); |
| 603 | 597 | case RDIO: /* Programmable I/O port - echos back what's written to WRIO */ |
| 604 | 598 | return snes_ram[WRIO]; |
| 605 | 599 | case RDDIVL: /* Quotient of divide result (low) */ |
| r5406 | r5407 | |
| 623 | 617 | return joypad[3].low; |
| 624 | 618 | case JOY4H: /* Joypad 4 status register (high) */ |
| 625 | 619 | return joypad[3].high; |
| 626 | | case DMAP0: case BBAD0: case A1T0L: case A1T0H: case A1B0: case DAS0L: |
| 620 | case DMAP0: |
| 621 | case DMAP1: |
| 622 | case DMAP2: |
| 623 | case DMAP3: |
| 624 | case DMAP4: |
| 625 | case DMAP5: |
| 626 | case DMAP6: |
| 627 | case DMAP7: |
| 628 | return (snes_ram[offset] & 0xdf) | (snes_open_bus_r(space,0) & 0x20); |
| 629 | case BBAD0: case A1T0L: case A1T0H: case A1B0: case DAS0L: |
| 627 | 630 | case DAS0H: case DSAB0: case A2A0L: case A2A0H: case NTRL0: |
| 628 | | case DMAP1: case BBAD1: case A1T1L: case A1T1H: case A1B1: case DAS1L: |
| 631 | case BBAD1: case A1T1L: case A1T1H: case A1B1: case DAS1L: |
| 629 | 632 | case DAS1H: case DSAB1: case A2A1L: case A2A1H: case NTRL1: |
| 630 | | case DMAP2: case BBAD2: case A1T2L: case A1T2H: case A1B2: case DAS2L: |
| 633 | case BBAD2: case A1T2L: case A1T2H: case A1B2: case DAS2L: |
| 631 | 634 | case DAS2H: case DSAB2: case A2A2L: case A2A2H: case NTRL2: |
| 632 | | case DMAP3: case BBAD3: case A1T3L: case A1T3H: case A1B3: case DAS3L: |
| 635 | case BBAD3: case A1T3L: case A1T3H: case A1B3: case DAS3L: |
| 633 | 636 | case DAS3H: case DSAB3: case A2A3L: case A2A3H: case NTRL3: |
| 634 | | case DMAP4: case BBAD4: case A1T4L: case A1T4H: case A1B4: case DAS4L: |
| 637 | case BBAD4: case A1T4L: case A1T4H: case A1B4: case DAS4L: |
| 635 | 638 | case DAS4H: case DSAB4: case A2A4L: case A2A4H: case NTRL4: |
| 636 | | case DMAP5: case BBAD5: case A1T5L: case A1T5H: case A1B5: case DAS5L: |
| 639 | case BBAD5: case A1T5L: case A1T5H: case A1B5: case DAS5L: |
| 637 | 640 | case DAS5H: case DSAB5: case A2A5L: case A2A5H: case NTRL5: |
| 638 | | case DMAP6: case BBAD6: case A1T6L: case A1T6H: case A1B6: case DAS6L: |
| 641 | case BBAD6: case A1T6L: case A1T6H: case A1B6: case DAS6L: |
| 639 | 642 | case DAS6H: case DSAB6: case A2A6L: case A2A6H: case NTRL6: |
| 640 | | case DMAP7: case BBAD7: case A1T7L: case A1T7H: case A1B7: case DAS7L: |
| 643 | case BBAD7: case A1T7L: case A1T7H: case A1B7: case DAS7L: |
| 641 | 644 | case DAS7H: case DSAB7: case A2A7L: case A2A7H: case NTRL7: |
| 642 | 645 | return snes_ram[offset]; |
| 643 | 646 | |