iwram init done

This commit is contained in:
DizzyEggg
2024-12-18 12:09:22 +01:00
parent 0c53d4011f
commit bdae856769
10 changed files with 35 additions and 58 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
#include "global.h"
IWRAM_DATA_2 u32 gUnknown_3004000 = {0};
extern u32 gUnknown_3004000;
// unused, returns stack pointer
u32 sub_80001DC() {
+8 -8
View File
@@ -22,12 +22,12 @@ extern u8 ewram_end[]; // Force a second storage in the asm
extern u8 ewram_init_start[];
extern u8 ewram_init_end[];
extern u8 iwram_start[];
extern u8 iwramClearEnd[];
extern u8 unk_code[];
extern u8 unk_code_ram[];
extern u8 unk_code_ram_end[];
extern u8 iwram_end[];
extern u8 iwram_init_start[];
extern u8 iwram_init_end[];
extern const u8 EWRAM_INIT_ROM_START[];
extern const u8 IWRAM_INIT_ROM_START[];
UNUSED static const char sStringRomUserData[] = "PKD ROM USER DATA 000000";
@@ -56,12 +56,12 @@ void AgbMain(void)
CpuSet(&value, ewram_start, CPU_SET_SRC_FIXED | CPU_SET_32BIT | (((ewram_end - ewram_start) / 4) & 0x1FFFFF));
}
if (unk_code_ram_end - unk_code_ram > 0)
CpuCopy32(unk_code, unk_code_ram, unk_code_ram_end - unk_code_ram);
if (iwram_init_end - iwram_init_start > 0)
CpuCopy32(IWRAM_INIT_ROM_START, iwram_init_start, iwram_init_end - iwram_init_start);
if (iwramClearEnd - iwram_start > 0) {
if (iwram_end - iwram_start > 0) {
memset(value, 0, sizeof(value));
CpuSet(&value, iwram_start, CPU_SET_SRC_FIXED | CPU_SET_32BIT | (((iwramClearEnd - iwram_start) / 4) & 0x1FFFFF));
CpuSet(&value, iwram_start, CPU_SET_SRC_FIXED | CPU_SET_32BIT | (((iwram_end - iwram_start) / 4) & 0x1FFFFF));
}
REG_WIN0H = 0;
+9 -8
View File
@@ -41,15 +41,16 @@ EWRAM_DATA static u32 sTextShadowMask = 0; // Some text color info is stored; re
EWRAM_DATA static u8 sDrawTextShadow = 0;
EWRAM_DATA ALIGNED(4) u16 gUnknown_202B038[4][32][32] = {0};
extern ALIGNED(4) u8 gUnkIwramFunc1Buffer[];
extern ALIGNED(4) u8 gUnkIwramFunc2Buffer[];
extern ALIGNED(4) u8 gUnkIwramFunc3Buffer[];
extern ALIGNED(4) u8 gUnkIwramFunc4Buffer[];
extern void sub_8272760(s32 a0);
extern void sub_8272870(s32 a0);
extern void sub_82729A4(s32 a0);
extern void sub_8272A78(s32 a0);
// Despite these not being used anywhere in this file, file order and usage point to these variables being declared here
EWRAM_INIT void (*gUnknown_203B080)(s32 a0) = (void *) &gUnkIwramFunc1Buffer[1]; // + 1 because the function is in thumb!
EWRAM_INIT void (*gUnknown_203B084)(s32 a0) = (void *) &gUnkIwramFunc2Buffer[1]; // + 1 because the function is in thumb!
EWRAM_INIT void (*gUnknown_203B088)(s32 a0) = (void *) &gUnkIwramFunc3Buffer[1]; // + 1 because the function is in thumb!
EWRAM_INIT void (*gUnknown_203B08C)(s32 a0) = (void *) &gUnkIwramFunc4Buffer[1]; // + 1 because the function is in thumb!
EWRAM_INIT void (*gUnknown_203B080)(s32 a0) = sub_8272760;
EWRAM_INIT void (*gUnknown_203B084)(s32 a0) = sub_8272870;
EWRAM_INIT void (*gUnknown_203B088)(s32 a0) = sub_82729A4;
EWRAM_INIT void (*gUnknown_203B08C)(s32 a0) = sub_8272A78;
// This variable is only used in InitGraphics function, which could or could not belong to text.c
EWRAM_INIT u8 gUnknown_203B090 = 0;