From 090a418e7f1eae23bdf38fd1791f6bce6b30a181 Mon Sep 17 00:00:00 2001 From: Derek Hensley Date: Fri, 19 Jul 2024 15:38:51 -0700 Subject: [PATCH] eep stuff --- linker_scripts/us/symbol_addrs.txt | 4 ++-- src/main/O2/65430.c | 26 +++++++++++++------------- src/main/eepmgr.c | 8 ++++---- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/linker_scripts/us/symbol_addrs.txt b/linker_scripts/us/symbol_addrs.txt index 635ad56..f53e428 100644 --- a/linker_scripts/us/symbol_addrs.txt +++ b/linker_scripts/us/symbol_addrs.txt @@ -109,9 +109,9 @@ csleep = 0x800821A0; // data gEepMgr = 0x800F95D0; -D_800F97F8 = 0x800F97F8; +sEepBuff = 0x800F97F8; sEepStack = 0x800F9FF8; -sEepBuff = 0x800FA2F8; +sEepCache = 0x800FA2F8; sEepStackInfo = 0x800FAB00; sBootStack = 0x800FB018; sBootStackInfo = 0x800FD018; diff --git a/src/main/O2/65430.c b/src/main/O2/65430.c index a8efcc4..7bc7227 100644 --- a/src/main/O2/65430.c +++ b/src/main/O2/65430.c @@ -519,18 +519,18 @@ u16 func_800699BC(EepBuffer* arg0); #pragma GLOBAL_ASM("asm/us/nonmatchings/main/O2/65430/func_800699BC.s") extern EepMgr gEepMgr; -extern EepBuffer D_800F97F8[2]; -extern STACK(sEepStack, 0x300); extern EepBuffer sEepBuff[2]; +extern STACK(sEepStack, 0x300); +extern EepBuffer sEepCache[2]; extern StackEntry sEepStackInfo; s32 func_80069A80(void* arg0) { - func_80065528(&D_800F97F8[0].data, arg0, ARRAY_COUNT(D_800F97F8[0].data)); - D_800F97F8[0].unk3FA = func_800699BC(D_800F97F8); - D_800F97F8[0].magic = EEPBUFFER_MAGIC; - D_800F97F8[1] = D_800F97F8[0]; + func_80065528(&sEepBuff[0].data, arg0, ARRAY_COUNT(sEepBuff[0].data)); + sEepBuff[0].unk3FA = func_800699BC(sEepBuff); + sEepBuff[0].magic = EEPBUFFER_MAGIC; + sEepBuff[1] = sEepBuff[0]; - eepmgr_SendWrite(&gEepMgr, D_800F97F8); + eepmgr_SendWrite(&gEepMgr, sEepBuff); if (func_8007D508(&gEepMgr) != 0) { return 1; } @@ -539,19 +539,19 @@ s32 func_80069A80(void* arg0) { } s32 func_80069B34(UNK_PTR arg0) { - eepmgr_SendRead(&gEepMgr, D_800F97F8); + eepmgr_SendRead(&gEepMgr, sEepBuff); if (func_8007D508(&gEepMgr) != 0) { return 1; } - if ((D_800F97F8[0].unk3FA == func_800699BC(&D_800F97F8[0])) && (D_800F97F8[0].magic == EEPBUFFER_MAGIC)) { - func_80065528(arg0, &D_800F97F8[0].data, ARRAY_COUNT(D_800F97F8[0].data)); + if ((sEepBuff[0].unk3FA == func_800699BC(&sEepBuff[0])) && (sEepBuff[0].magic == EEPBUFFER_MAGIC)) { + func_80065528(arg0, &sEepBuff[0].data, ARRAY_COUNT(sEepBuff[0].data)); return 0; } - if ((D_800F97F8[1].unk3FA == func_800699BC(&D_800F97F8[1])) && (D_800F97F8[1].magic == EEPBUFFER_MAGIC)) { - func_80065528(arg0, &D_800F97F8[1].data, ARRAY_COUNT(D_800F97F8[1].data)); + if ((sEepBuff[1].unk3FA == func_800699BC(&sEepBuff[1])) && (sEepBuff[1].magic == EEPBUFFER_MAGIC)) { + func_80065528(arg0, &sEepBuff[1].data, ARRAY_COUNT(sEepBuff[1].data)); return 0; } @@ -560,6 +560,6 @@ s32 func_80069B34(UNK_PTR arg0) { void func_80069C10(void) { StackCheck_Init(&sEepStackInfo, sEepStack, STACK_TOP(sEepStack), 0, 0x100, "eepmgr"); - eepmgr_Create(&gEepMgr, &D_8010DF40, EEPROM_TYPE_16K, sEepBuff, Y_THREAD_ID_EEPMGR, Y_PRIORITY_EEPMGR, + eepmgr_Create(&gEepMgr, &D_8010DF40, EEPROM_TYPE_16K, sEepCache, Y_THREAD_ID_EEPMGR, Y_PRIORITY_EEPMGR, STACK_TOP(sEepStack)); } diff --git a/src/main/eepmgr.c b/src/main/eepmgr.c index 7f43155..f0736f3 100644 --- a/src/main/eepmgr.c +++ b/src/main/eepmgr.c @@ -71,10 +71,10 @@ void eepmgr_Probe(EepMgr* eepmgr) { } } -void eepmgr_Setup(EepMgr* eepmgr, UNK_PTR arg1, s32 type, EepBuffer* buffer) { +void eepmgr_Setup(EepMgr* eepmgr, UNK_PTR arg1, s32 type, EepBuffer* cache) { bzero(eepmgr, sizeof(EepMgr)); eepmgr->unk218 = arg1; - eepmgr->cache = buffer; + eepmgr->cache = cache; eepmgr->type = type; eepmgr->numBlocks = sMaxBlocks[eepmgr->type]; } @@ -255,9 +255,9 @@ void eepmgr_ThreadEntry(void* arg) { } } -void eepmgr_Create(EepMgr* eepmgr, UNK_PTR arg1, s32 type, EepBuffer* buffer, s32 id, s32 priority, void* stack) { +void eepmgr_Create(EepMgr* eepmgr, UNK_PTR arg1, s32 type, EepBuffer* cache, s32 id, s32 priority, void* stack) { (void)"eepmgr_Create(%08x, %08x, %d, %08x, %d, %d, %08x)\n"; - eepmgr_Setup(eepmgr, arg1, type, buffer); + eepmgr_Setup(eepmgr, arg1, type, cache); osCreateMesgQueue(&eepmgr->unk014, eepmgr->unk000, ARRAY_COUNT(eepmgr->unk000)); osCreateMesgQueue(&eepmgr->unk02C, eepmgr->unk004, ARRAY_COUNT(eepmgr->unk004)); osCreateThread(&eepmgr->thread, id, eepmgr_ThreadEntry, eepmgr, stack, priority);