Previous 15994 Revisions Next

r7520 Saturday 6th March, 2010 at 17:19:39 UTC by Fabio Priuli
[SNES] Fixed serial joystick reads to work as per docs.
Super Double Dragon and Super Star Wars Empire Strikes Back (and probably other games as well) can be started again.
No regression in Bishojo Janshi Suchie-Pai either.
[src/mame/machine]snes.c

src/mame/machine/snes.c
r7519r7520
638638         {
639639            if (snes_ram[offset] & 0x1)
640640            {
641               return 0 | (snes_open_bus_r(space,0) & 0xfc); //correct?
641               return 0 | (snes_open_bus_r(space, 0) & 0xfc); //correct?
642642            }
643            value = ((joy1l | (joy1h << 8) | 0x10000) >> (16 - (joypad[0].oldrol & 0xf))) & 0x1;
644            joypad[0].oldrol++;
645            joypad[0].oldrol&=0xf;
646            if (!(joypad[0].oldrol % 17))
647               value = 0x1;
648            return (value & 0x03) | (snes_open_bus_r(space,0) & 0xfc); //correct?
643
644            if (joypad[0].oldrol >= 16)
645               value = 0x01;
646            else
647               value = ((joypad[0].low | (joypad[0].high << 8)) >> (15 - joypad[0].oldrol++)) & 0x01;
648
649            return (value & 0x03) | (snes_open_bus_r(space, 0) & 0xfc); //correct?
649650         }
650651      case OLDJOY2:   /* Data for old NES controllers (JOYSER2) */
651652         {
652653            if (snes_ram[OLDJOY1] & 0x1)
653654            {
654               return 0 | 0x1c | (snes_open_bus_r(space,0) & 0xe0); //correct?
655               return 0 | 0x1c | (snes_open_bus_r(space, 0) & 0xe0); //correct?
655656            }
656            value = ((joy2l | (joy2h << 8) | 0x10000) >> (16 - (joypad[1].oldrol & 0xf))) & 0x1;
657            joypad[1].oldrol++;
658            joypad[1].oldrol &= 0xf;
659            if (!(joypad[1].oldrol % 17))
660               value = 0x1;
661            //value |= 0x1c;    // bits 4, 3, and 2 are always set
657
658            if (joypad[1].oldrol >= 16)
659               value = 0x01;
660            else
661               value = ((joypad[1].low | (joypad[1].high << 8)) >> (15 - joypad[1].oldrol++)) & 0x01;
662
662663            return value | 0x1c | (snes_open_bus_r(space, 0) & 0xe0); //correct?
663664         }
664665      case HTIMEL:
r7519r7520
13071308      case WMADDH:   /* Address to read/write to wram (high) */
13081309         break;
13091310      case OLDJOY1:   /* Old NES joystick support */
1310         if (((data & 0x1) && !(snes_ram[offset] & 0x1)) || ((!(data & 0x1)) && (snes_ram[offset] & 0x1)))
1311         if (((!(data & 0x1)) && (snes_ram[offset] & 0x1)))
13111312         {
13121313            joypad[0].oldrol = 0;
13131314            joypad[1].oldrol = 0;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team