Previous 15994 Revisions Next

r5407 Wednesday 12th August, 2009 at 10:17:01 UTC by Angelo Salese
[SNES]: Even more aggressive open bus fixes.
[src/mame/machine]snes.c

src/mame/machine/snes.c
r5406r5407
370370      case WBGLOG:
371371         return snes_ppu.ppu1_open_bus;
372372
373      /* Shien The Blade Chaser / Shien's Revenge reads here instead */
374      case NMITIMEN:
375         return snes_open_bus_r(space,0);
376373// According to BSNES, these should return snes_open_bus_r!
377374//      case OAMADDL:
378375//      case OAMADDH:
r5406r5407
403400         }
404401      case SLHV:      /* Software latch for H/V counter */
405402         snes_latch_counters(space->machine);
406         return 0x0;      /* Return value is meaningless */
403         return snes_open_bus_r(space,0);      /* Return value is meaningless */
407404      case ROAMDATA:   /* Read data from OAM (DR) */
408405         {
409406            int oam_addr = snes_ppu.oam.address;
r5406r5407
555552      case WMADDM:   /* Address to read/write to wram (mid) */
556553      case WMADDH:   /* Address to read/write to wram (high) */
557554         return snes_ram[offset];
558      case OLDJOY1:   /* Data for old NES controllers */
555      case OLDJOY1:   /* Data for old NES controllers (JOYSER1) */
559556         {
560557            if( snes_ram[offset] & 0x1 )
561558            {
562               return 0;
559               return 0 | (snes_open_bus_r(space,0) & 0xfc); //correct?
563560            }
564561            value = ((joypad[0].low | (joypad[0].high << 8) | 0x10000) >> (15 - (joypad[0].oldrol++ % 16))) & 0x1;
565562            if( !(joypad[0].oldrol % 17) )
566563               value = 0x1;
567            return value;
564            return (value & 0x03) | (snes_open_bus_r(space,0) & 0xfc); //correct?
568565         }
569      case OLDJOY2:   /* Data for old NES controllers */
566      case OLDJOY2:   /* Data for old NES controllers (JOYSER2) */
570567         {
571568            if( snes_ram[OLDJOY1] & 0x1 )
572569            {
573               return 0;
570               return 0 | 0x1c | (snes_open_bus_r(space,0) & 0xe0); //correct?
574571            }
575572            value = ((joypad[1].low | (joypad[1].high << 8) | 0x10000) >> (15 - (joypad[1].oldrol++ % 16))) & 0x1;
576573            if( !(joypad[1].oldrol % 17) )
577574               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?
580577         }
581578      case HTIMEL:
582579      case HTIMEH:
583580      case VTIMEL:
584581      case VTIMEH:
585582         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];
589583      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);
591585         snes_ram[offset] &= 0x7f;   /* NMI flag is reset on read */
592586         return value;
593587      case TIMEUP:      /* IRQ flag by H/V count timer */
r5406r5407
599593         // electronics test says hcounter 272 is start of hblank, which is beampos 363
600594//          if (video_screen_get_hpos(space->machine->primary_screen) >= 363) snes_ram[offset] |= 0x40;
601595//              else snes_ram[offset] &= ~0x40;
602         return snes_ram[offset];
596         return (snes_ram[offset] & 0xc1) | (snes_open_bus_r(space,0) & 0x3e);
603597      case RDIO:         /* Programmable I/O port - echos back what's written to WRIO */
604598         return snes_ram[WRIO];
605599      case RDDIVL:      /* Quotient of divide result (low) */
r5406r5407
623617         return joypad[3].low;
624618      case JOY4H:         /* Joypad 4 status register (high) */
625619         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:
627630      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:
629632      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:
631634      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:
633636      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:
635638      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:
637640      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:
639642      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:
641644      case DAS7H: case DSAB7: case A2A7L: case A2A7H: case NTRL7:
642645         return snes_ram[offset];
643646

Previous 15994 Revisions Next


© 1998-2018 The MESS Team