GBDK 2020 Docs 4.4.0 API Documentation for GBDK 2020

isr.h
Go to the documentation of this file.
1
9 #ifndef _ISR_H_INCLUDE_
10 #define _ISR_H_INCLUDE_
11
12 #include <stdint.h>
13 #include <types.h>
14
15 // #define VECTOR_VBL 0x40 // you can not define raw vector for VBlank interrupt
16 #define VECTOR_STAT 0x48
17 #define VECTOR_TIMER 0x50
18 #define VECTOR_SERIAL 0x58
19 #define VECTOR_JOYPAD 0x60
21 typedef struct isr_vector_t {
22 uint8_t opcode;
23 void * func;
24 } isr_vector_t;
25
52 #define ISR_VECTOR(ADDR, FUNC) \
53 static const isr_vector_t AT((ADDR)) __ISR_ ## ADDR = {0xc3, (void *)&(FUNC)};
54
55 typedef struct isr_nested_vector_t {
56 uint8_t opcode[2];
57 void * func;
58 } isr_nested_vector_t;
59
74 #define ISR_NESTED_VECTOR(ADDR, FUNC) \
75 static const isr_nested_vector_t AT((ADDR)) __ISR_ ## ADDR = {{0xfb, 0xc3}, (void *)&(FUNC)};
76
77
78 #endif // _ISR_H_INCLUDE_
isr_vector_t
struct isr_vector_t isr_vector_t
isr_nested_vector_t
struct isr_nested_vector_t isr_nested_vector_t
stdint.h
uint8_t
unsigned char uint8_t
Definition: stdint.h:51
isr_nested_vector_t
Definition: isr.h:55
isr_nested_vector_t::opcode
uint8_t opcode[2]
Definition: isr.h:56
isr_nested_vector_t::func
void * func
Definition: isr.h:57
isr_vector_t
Definition: isr.h:21
isr_vector_t::opcode
uint8_t opcode
Definition: isr.h:22
isr_vector_t::func
void * func
Definition: isr.h:23