Skip to content

Interrupts

Javier de Silóniz Sandino edited this page Mar 26, 2021 · 2 revisions

Interrupts

The DSP inside the SVP chip has 3 interrupt request pins that can be activated from the outside:

Interrupt Vector Function
Reset 0xFC08 Executed at a reset
IE0 0x03FA Unknown
IE1 0x03FC In sync with HSYNC pin from the cartridge (pin B14)
IE2 0x03FE Also timing-related, probably in sync with the M68000 CLK signal in the cartridge (pin B19)

Interrupt handling and behavior

Interrupts are disabled by default. They also are automatically disabled after each time the vector interrupt (to prevent other interrupts to mess with the interrupt handlers), so they need to be enabled again if required (by calling mod f, setie of directly setting bit 7 of the ST register). It's been suggested that they can be activated/deactivated from the Mega Drive side, but this is still untested.

It seems the SVP don't like running too many interrupts continuously and resets itself after a few seconds of handling those (probably for over-calling RET?).

Custom interrupt handlers

The reset interrupt vector is hardcoded to point at the interrupt handler found in the Internal ROM. But IE0-IE2 are pointed to the IRAM area so that they can be rewritten by the user to point to their own interrupt handler routines. Virtua Racing does this in the communications test code, pointing IE0-IE2 to addresses 0xC8F6, 0xC906, and 0xC912.