The Socrates Gameboy Advance Development Engine
The SGADE is a development library for the Nintendo Gameboy
Advance. It's free for all uses and is distributed without guarantees.
For more information visit
the SGADE page.
Files | |
| file | SoIntManager.c |
| file | SoIntManager.h |
Interrupt types | |
| #define | SO_INTERRUPT_TYPE_VBLANK |
| #define | SO_INTERRUPT_TYPE_HBLANK |
| #define | SO_INTERRUPT_TYPE_VTRIGGER |
| #define | SO_INTERRUPT_TYPE_TIMER_0 |
| #define | SO_INTERRUPT_TYPE_TIMER_1 |
| #define | SO_INTERRUPT_TYPE_TIMER_2 |
| #define | SO_INTERRUPT_TYPE_TIMER_3 |
| #define | SO_INTERRUPT_TYPE_SERIAL |
| #define | SO_INTERRUPT_TYPE_DMA_0 |
| #define | SO_INTERRUPT_TYPE_DMA_1 |
| #define | SO_INTERRUPT_TYPE_DMA_2 |
| #define | SO_INTERRUPT_TYPE_DMA_3 |
| #define | SO_INTERRUPT_TYPE_KEYPAD |
| #define | SO_INTERRUPT_TYPE_CART |
| #define | SO_NUM_INTERRUPT_TYPES |
Typedefs | |
| typedef void(* | SoInterruptHandler )(void) |
| Interrupt handler type definition;. | |
Functions | |
| void | SoIntManagerInitialize (void) |
| Initializes the interrupt manager. | |
| void | SoIntManagerSetInterruptHandler (u32 a_InterruptType, SoInterruptHandler a_IntHandler) |
| Sets an interrupt;. | |
| void | SoIntManagerEnableInterruptMaster (void) |
| Enables the master-enable setting for the interrupts. | |
| void | SoIntManagerDisableInterruptMaster (void) |
| Disables the master-enable setting for the interrupts. | |
| void | SoIntManagerEnableInterrupt (u32 a_InterruptType) |
| Enables a specific interrupt. | |
| void | SoIntManagerDisableInterrupt (u32 a_InterruptType) |
| Disables a specific interrupt. | |
| void | SoIntManagerInterruptHandler (void) |
| The interrupt handler. | |
Variables | |
| SoInterruptHandler | g_InterruptHandlers [SO_NUM_INTERRUPT_TYPES] |
| Declared here because we need in both the .C and the assembly. | |
Singleton
This module contains all functionality to get control over interrupts. It allows you to enable/diable all interrupt processing, and also enable/disable each unique interrupt. You can install a separate interrupt handler (function) for each interrupt type.
One very very important thing to remember is that some interrupts may be used by the SGADE itself. For example, the SoSpriteManager and SoTimer modules use interrupts. These modules will probably even implicitly enable these interrupts. Because of this, you may sometimes find that the interrupt master is enabled even though you never did so. So watch out...
|
|
Interrupt handler type definition;.
This prototype defines interrupt handlers. When you want to install an interrupt handler you have to pass the installer a function of this type. Simply it's just a function with no parameters and which returns nothing. |
|
|
Disables a specific interrupt.
|
|
|
Disables the master-enable setting for the interrupts.
Disables all interrupts even when they are individually enabled. |
|
|
Enables a specific interrupt.
|
|
|
Enables the master-enable setting for the interrupts.
Without the master enabled, no interrupt will function even when you individually enable them. |
|
|
Initializes the interrupt manager.
First function you should call before you use any other function of the interrupt manager. This function will return immediately if it was called before (cause then the manager is already initialized). |
|
|
The interrupt handler.
For internal use only.
This is the function that is called when an interrupt occurs. It checks what interrupt occured and calls the installed interrupt handler for that specific interrupt type. |
|
||||||||||||
|
Sets an interrupt;.
|
|
|
Declared here because we need in both the .C and the assembly.
For internal use only.
This array contains all interrupt handlers. If an entry is NULL there is no handler installed for the interrupt type. |