diff options
author | Martmists <mail@martmists.com> | 2020-04-26 17:49:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-26 17:49:13 +0200 |
commit | daf2b831efe688dd9ee55f549d00a33c16e840ba (patch) | |
tree | bdb1765edc0c10ec83f02ded9e9c478d01e241a4 /arm9/src/main.c | |
parent | f11bca0db09b9e7f7514f5033fe6c31b6efd05e2 (diff) | |
parent | eb0b544c0678a0e601686fc32b6019b4e893d5f9 (diff) |
Merge pull request #27 from PikalaxALT/pikalax_work
Separate build structures for ARM9 and ARM7
Diffstat (limited to 'arm9/src/main.c')
-rw-r--r-- | arm9/src/main.c | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/arm9/src/main.c b/arm9/src/main.c new file mode 100644 index 00000000..bfd6c82e --- /dev/null +++ b/arm9/src/main.c @@ -0,0 +1,110 @@ +#include "global.h" +#include "main.h" + +extern struct Unk2106FA0 gBacklightTop; +extern struct Unk2106FA0 gBacklightTop_2; // same as the first one, it's referenced twice in the constant pool... +extern struct Unk2106FA0 gUnknown2106FB8; +extern struct Unk21C48B8 gUnknown21C48B8; + +extern s32 gUnk027FFC20; +extern struct { + s32 unk0; + s32 unk4; + u8 unk8; +} gUnk021C4918; + +extern void PM_GetBackLight(); +extern void OS_WaitIrq(); +extern void FUN_02016438(s32); + +extern const s32 CONST_3F; // 0x0000003F +extern const s32 CONST_34; // 0x00000034 + +extern struct Unk21DBE18 gUnk021DBE18; +extern struct Unk21DBE18 gUnk021D76C8; + + +void NitroMain(void) +{ + InitSystemForTheGame(); + InitGraphicMemory(); + FUN_020163BC(); + FUN_02016438(0); + + PM_GetBackLight(&gBacklightTop_2, 0); + + FUN_02022294(); + FUN_0201259C(); + FUN_02000DF4(); + FUN_02002C14(); + FUN_02002C50(0, 3); + FUN_02002C50(1, 3); + FUN_02002C50(3, 3); + gBacklightTop.unk18 = -1; + gBacklightTop.unk20 = FUN_0202254C(); + FUN_02003B98(FUN_02029EF8(gBacklightTop.unk20), LoadPlayerDataAddress(gBacklightTop.unk20)); + FUN_02020AFC(); + if (FUN_020337E8(3) == 3) + FUN_02034188(3, 0); + if (FUN_020227FC(gBacklightTop.unk20) == 0) + { + FUN_02089D90(0); + } + else + { + switch (gUnk027FFC20) + { + case 0: + gBacklightTop.unk1C = 0; + FUN_02000E7C(&CONST_3F, &gUnk021DBE18); + break; + case 1: + gBacklightTop.unk1C = 1; + FUN_02000E7C(&CONST_34, &gUnk021D76C8); + break; + default: + ErrorHandling(); + break; + } + } + gUnknown21C48B8.unk6C = 1; + gUnknown21C48B8.unk30 = 0; + FUN_02000FA4(); + FUN_0200A2AC(); + FUN_02015E30(); + gBacklightTop.unk4 = 0; + for (;;) + { + FUN_02000EE8(); + FUN_02000FE8(); + FUN_02016464(); + if ((gUnknown21C48B8.unk38 & 0x30C) == 0x30C && !gUnk021C4918.unk8) // soft reset? + { + FUN_02000F18(0); // soft reset? + } + if (FUN_0202FB80()) + { + FUN_02000E0C(); + FUN_0201B5CC(gUnknown21C48B8.unk18); + FUN_0201B5CC(gUnknown21C48B8.unk24); + if (!gUnknown21C48B8.unk30) + { + OS_WaitIrq(1, 1); + gUnknown21C48B8.unk2C++; + } + } + FUN_020125D4(); + FUN_02015E60(); + FUN_020222C4(); + FUN_0201B5CC(gUnknown21C48B8.unk24); + OS_WaitIrq(1, 1); + gUnknown21C48B8.unk2C++; + gUnknown21C48B8.unk30 = 0; + FUN_0200A318(); + FUN_0200E2D8(); + if (gUnknown21C48B8.unk0) + gUnknown21C48B8.unk0(gUnknown21C48B8.unk4); + FUN_02003C10(); + FUN_0201B5CC(gUnknown21C48B8.unk20); + } +}
\ No newline at end of file |