summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorSeth Barberee <seth.barberee@gmail.com>2021-08-12 17:26:01 -0700
committerGitHub <noreply@github.com>2021-08-12 17:26:01 -0700
commitd9883945954a30e4b753ecbd5d807f4b6cd2a38a (patch)
tree093c45ab4de91a75d546f58a6672dfc72136677c /src/main.c
parente005410884803f1ec8f5942bd0c8d2da5c2e29c8 (diff)
More data dumping and some code cleaning (#46)
* more data dumping and some code cleaning * split out cutscene scripts * initial start at script conversion * more script work * use correct type * clearer up struct field names * split known scripts into seperate files * no need to preproc pure ascii strings in debug * more cutscene work * split out personality test scripts * solidify text macros and doc some dungeon fields * more scripting work
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/main.c b/src/main.c
index 7890a1a..120b08e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -9,7 +9,7 @@ extern char ewram_start[];
typedef void (*IntrCallback)(void);
EWRAM_DATA u8 IntrMain_Buffer[0x120];
-EWRAM_DATA u32 gIntrTable[6];
+EWRAM_DATA IntrCallback gIntrTable[6];
EWRAM_DATA IntrCallback gIntrCallbacks[6];
extern u16 gBldCnt;
extern u8 gUnknown_202D7FE;
@@ -31,7 +31,7 @@ extern char unk_code_ram[];
extern char unk_code_ram_end[];
extern u8 gUnknown_80B9BF1[];
-extern u32 gUnknown_80B9C00;
+extern IntrCallback gInitialIntrTable[6];
extern char gUnknown_8270000[];
@@ -58,8 +58,8 @@ extern void sub_800D6AC(void);
extern void sub_800D7D0(void);
bool8 EnableInterrupts(void);
-void InitIntrTable(const u32 *interrupt_table);
-void *SetInterruptCallback(u32 index, void * new_callback);
+void InitIntrTable(const IntrCallback *interrupt_table);
+IntrCallback SetInterruptCallback(u32 index, IntrCallback new_callback);
void AgbMain(void)
@@ -121,7 +121,7 @@ void AgbMain(void)
LoadCharmaps();
sub_80098A0();
InitGraphics();
- SetInterruptCallback(1, VBlank_CB);
+ SetInterruptCallback(1, (IntrCallback)VBlank_CB);
REG_DISPCNT = DISPCNT_WIN1_ON | DISPCNT_WIN0_ON | DISPCNT_OBJ_ON | DISPCNT_BG_ALL_ON | DISPCNT_OBJ_1D_MAP; // 32576
GameLoop();
Hang();
@@ -143,7 +143,7 @@ void sub_800B540(void)
*(u8*)&REG_DISPCNT |= DISPCNT_FORCED_BLANK;
- InitIntrTable(&gUnknown_80B9C00); // set up intrrupt vector/table
+ InitIntrTable(gInitialIntrTable); // set up intrrupt vector/table
REG_TM3CNT = (TIMER_64CLK | TIMER_INTR_ENABLE | TIMER_ENABLE) << 16;
@@ -225,21 +225,21 @@ void AckInterrupt(u16 flag)
REG_IME = 1;
}
-void InitIntrTable(const u32 *interrupt_table)
+void InitIntrTable(const IntrCallback *interrupt_table)
{
CpuCopy32(interrupt_table, gIntrTable, sizeof(gIntrTable)); // 0x18 = 0x6 * 4 (0x4f00 is 32 bits)
CpuCopy32(IntrMain, IntrMain_Buffer, sizeof(IntrMain_Buffer)); // 0x120 = 0x48 * 4 (0x4f00 is 32 bits)
INTR_VECTOR = IntrMain_Buffer;
}
-u32 *GetInterruptCallback(u32 index)
+IntrCallback *GetInterruptHandler(u32 index)
{
return &gIntrTable[index];
}
-void *SetInterruptCallback(u32 index, void * new_callback)
+IntrCallback SetInterruptCallback(u32 index, IntrCallback new_callback)
{
- void *old_callback;
+ IntrCallback old_callback;
u32 interrupt_var;
interrupt_var = DisableInterrupts();