GBDK 2020 Docs
4.1.1
API Documentation for GBDK 2020
|
Go to the source code of this file.
Data Structures | |
struct | isr_vector_t |
struct | isr_nested_vector_t |
Macros | |
#define | VECTOR_STAT 0x48 |
#define | VECTOR_TIMER 0x50 |
#define | VECTOR_SERIAL 0x58 |
#define | VECTOR_JOYPAD 0x60 |
#define | ISR_VECTOR(ADDR, FUNC) static const isr_vector_t AT((ADDR)) __ISR_ ## ADDR = {0xc3, (void *)&(FUNC)}; |
#define | ISR_NESTED_VECTOR(ADDR, FUNC) static const isr_nested_vector_t AT((ADDR)) __ISR_ ## ADDR = {{0xfb, 0xc3}, (void *)&(FUNC)}; |
Typedefs | |
typedef struct isr_vector_t | isr_vector_t |
typedef struct isr_nested_vector_t | isr_nested_vector_t |
Macros for creating raw interrupt service routines (ISRs) which do not use the default GBDK ISR dispatcher.
Handlers installed this way will have less overhead than ones which use the GBDK ISR dispatcher.
#define VECTOR_STAT 0x48 |
Address for the STAT interrupt vector
#define VECTOR_TIMER 0x50 |
Address for the TIMER interrupt vector
#define VECTOR_SERIAL 0x58 |
Address for the SERIAL interrupt vector
#define VECTOR_JOYPAD 0x60 |
Address for the JOYPAD interrupt vector
#define ISR_VECTOR | ( | ADDR, | |
FUNC | |||
) | static const isr_vector_t AT((ADDR)) __ISR_ ## ADDR = {0xc3, (void *)&(FUNC)}; |
Creates an interrupt vector at the given address for a raw interrupt service routine (which does not use the GBDK ISR dispatcher)
ADDR | Address of the interrupt vector, any of: VECTOR_STAT, VECTOR_TIMER, VECTOR_SERIAL, VECTOR_JOYPAD |
FUNC | ISR function supplied by the user |
This cannot be used with the VBLANK interrupt.
Do not use this in combination with interrupt installers that rely on the default GBDK ISR dispatcher such as add_TIM(), remove_TIM() (and the same for all other interrupts).
Example:
#define ISR_NESTED_VECTOR | ( | ADDR, | |
FUNC | |||
) | static const isr_nested_vector_t AT((ADDR)) __ISR_ ## ADDR = {{0xfb, 0xc3}, (void *)&(FUNC)}; |
Creates an interrupt vector at the given address for a raw interrupt service routine allowing nested interrupts
ADDR | Address of the interrupt vector, any of: VECTOR_STAT, VECTOR_TIMER, VECTOR_SERIAL, VECTOR_JOYPAD |
FUNC | ISR function |
This cannot be used with the VBLANK interrupt
The LCD STAT vector (VECTOR_STAT) cannot be used in the same program as stdio.h
since they install an ISR vector to the same location.
typedef struct isr_vector_t isr_vector_t |
typedef struct isr_nested_vector_t isr_nested_vector_t |