src/mame/machine/snes.c
| r5457 | r5458 | |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | /* three lines after start of vblank we update the controllers (value from snes9x) */ |
| 193 | | if (snes_ppu.beam.current_vert == snes_ppu.beam.last_visible_line + 3) |
| 193 | if (snes_ppu.beam.current_vert == snes_ppu.beam.last_visible_line + 2) |
| 194 | 194 | { |
| 195 | 195 | int i; |
| 196 | 196 | |
| r5457 | r5458 | |
| 559 | 559 | { |
| 560 | 560 | return 0 | (snes_open_bus_r(space,0) & 0xfc); //correct? |
| 561 | 561 | } |
| 562 | | value = ((joypad[0].low | (joypad[0].high << 8) | 0x10000) >> (15 - (joypad[0].oldrol++ % 16))) & 0x1; |
| 562 | value = ((joy1l | (joy1h << 8) | 0x10000) >> (16 - (joypad[0].oldrol & 0xf))) & 0x1; |
| 563 | joypad[0].oldrol++; |
| 564 | joypad[0].oldrol&=0xf; |
| 563 | 565 | if( !(joypad[0].oldrol % 17) ) |
| 564 | 566 | value = 0x1; |
| 565 | 567 | return (value & 0x03) | (snes_open_bus_r(space,0) & 0xfc); //correct? |
| r5457 | r5458 | |
| 603 | 605 | case RDMPYH: /* Product/Remainder of mult/div result (high) */ |
| 604 | 606 | return snes_ram[offset]; |
| 605 | 607 | case JOY1L: /* Joypad 1 status register (low) */ |
| 606 | | return joypad[0].low; |
| 608 | return joy1l; |
| 607 | 609 | case JOY1H: /* Joypad 1 status register (high) */ |
| 608 | | return joypad[0].high; |
| 610 | return joy1h; |
| 609 | 611 | case JOY2L: /* Joypad 2 status register (low) */ |
| 610 | | return joypad[1].low; |
| 612 | return joy2l; |
| 611 | 613 | case JOY2H: /* Joypad 2 status register (high) */ |
| 612 | | return joypad[1].high; |
| 614 | return joy2h; |
| 613 | 615 | case JOY3L: /* Joypad 3 status register (low) */ |
| 614 | | return joypad[2].low; |
| 616 | return joy3l; |
| 615 | 617 | case JOY3H: /* Joypad 3 status register (high) */ |
| 616 | | return joypad[2].high; |
| 618 | return joy3h; |
| 617 | 619 | case JOY4L: /* Joypad 4 status register (low) */ |
| 618 | | return joypad[3].low; |
| 620 | return joy4l; |
| 619 | 621 | case JOY4H: /* Joypad 4 status register (high) */ |
| 620 | | return joypad[3].high; |
| 622 | return joy4h; |
| 621 | 623 | case DMAP0: |
| 622 | 624 | case DMAP1: |
| 623 | 625 | case DMAP2: |
| r5457 | r5458 | |
| 1178 | 1180 | case WMADDH: /* Address to read/write to wram (high) */ |
| 1179 | 1181 | break; |
| 1180 | 1182 | case OLDJOY1: /* Old NES joystick support */ |
| 1181 | | if( (data & 0x1) && !(snes_ram[offset] & 0x1) ) |
| 1183 | if( ((data & 0x1) && !(snes_ram[offset] & 0x1)) || ((!(data & 0x1)) && (snes_ram[offset] & 0x1)) ) |
| 1182 | 1184 | { |
| 1183 | 1185 | joypad[0].oldrol = 0; |
| 1184 | 1186 | joypad[1].oldrol = 0; |