Interrupt Enable Register

From SNESdev Wiki

Jump to: navigation, search

Register Information
Interrupt Enable Register

Register Access

Access Time

This register is used to enable NMI (VBlank), IRQ Interrupts and/or auto-joypad.

Contents

Register Bit Information

i-vh---j
i enable NMI
vh enable IRQ (see below)
j enable auto-joypad read


Usage

NMI (VBlank)

Setting 'i' will enable NMI, causing a NMI Inturrput to fire at the start of VBlank. If clear then NMI will not occour.


IRQ

The 'v' and 'h' bits are used to enable or disable the IRQ inturrupt.

'v' 'h' IRQ State
0 0 IRQ will not occour.
0 1 IRQ will fire when the Horizontal Counter reaches the value set to the HTIME register.
1 0 IRQ will fire when the Vertical Counter reaches the value set to the VTIME register.
1 1 IRQ will fire when the Horizontal Counter reaches the value set to the VTIME register and the Vertical Counter reaches the value set to the HTIME register.

Please note that due to the way the S-CPU handles inturrupts. When the Inturrupt routine actually starts, the H/V Counter will be slightly greater than the HTIME and VTIME values. This will only affect SNES programs that rely on very accurate H/V IRQ timing. For more information please read the SNES Inturrupts article.


auto-joypad read

Template:SeeAlso

Setting 'j' will enable the SNES to automatically read the state of the Standard Controllers just after VBlank starts and stors the state of the Standard Controllers to the Controller Port Data Registers.

Related Registers

Sources

Personal tools