Previous 15994 Revisions Next

r5406 Wednesday 12th August, 2009 at 09:14:02 UTC by Angelo Salese
[SNES]: fixed irq ack and fixed TIMEUP register open bus behaviour.
[src/mame/machine]snes.c

src/mame/machine/snes.c
r5405r5406
9292   // (don't need to switch to the 65816 context, we don't do anything dependant on it)
9393   snes_latch_counters(machine);
9494   snes_ram[TIMEUP] = 0x80;   /* Indicate that irq occured */
95   cputag_set_input_line(machine, "maincpu", G65816_LINE_IRQ, HOLD_LINE );
95   cputag_set_input_line(machine, "maincpu", G65816_LINE_IRQ, ASSERT_LINE );
9696
9797   // don't happen again
9898   timer_adjust_oneshot(snes_hirq_timer, attotime_never, 0);
r5405r5406
122122         snes_ram[TIMEUP] = 0x80;   /* Indicate that irq occured */
123123         // IRQ latches the counters, do it now
124124         snes_latch_counters(machine);
125         cputag_set_input_line(machine, "maincpu", G65816_LINE_IRQ, HOLD_LINE );
125         cputag_set_input_line(machine, "maincpu", G65816_LINE_IRQ, ASSERT_LINE );
126126      }
127127   }
128128   /* Horizontal IRQ timer */
r5405r5406
591591         snes_ram[offset] &= 0x7f;   /* NMI flag is reset on read */
592592         return value;
593593      case TIMEUP:      /* IRQ flag by H/V count timer */
594         value = snes_ram[offset];
595         snes_ram[offset] = 0;   /* Register is reset on read */
594         value = (snes_open_bus_r(space,0) & 0x7f) | (snes_ram[TIMEUP] & 0x80);
595         cputag_set_input_line(space->machine, "maincpu", G65816_LINE_IRQ, CLEAR_LINE );
596         snes_ram[TIMEUP] = 0;
596597         return value;
597598      case HVBJOY:      /* H/V blank and joypad controller enable */
598599         // electronics test says hcounter 272 is start of hblank, which is beampos 363
r5405r5406
12371238            mame_printf_debug( "CPU speed: %f Mhz\n", (data & 0x1) ? 3.58 : 2.68 );
12381239#endif
12391240         break;
1241      case TIMEUP:
1242         snes_ram[TIMEUP] = data &~0x7f;
1243         return;
12401244   /* Following are read-only */
12411245      case HVBJOY:   /* H/V blank and joypad enable */
12421246      case MPYL:      /* Multiplication result (low) */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team