diff options
| author | Derek Hensley <hensley.derek58@gmail.com> | 2022-05-31 11:28:17 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-31 20:28:17 +0200 |
| commit | bd6b51a869b34c1695397dcfc9ef3248faa2e5b0 (patch) | |
| tree | 6f60700c8032a8e85beb3a5a4e4f6806f221c423 /src/code/code_800FC620.c | |
| parent | 6eeb217225f9b865c0a3da0d31b512815c01b415 (diff) | |
Overlay Functions Cleanup (#1235)
* Cleanup load functions
* Some cleanup
* forgot .
* Split off Overlay_Load
* review
* OverlayRelocationType -> MIPSRelocationType
* Reloc type macro and mips relocations
Diffstat (limited to 'src/code/code_800FC620.c')
| -rw-r--r-- | src/code/code_800FC620.c | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/src/code/code_800FC620.c b/src/code/code_800FC620.c index 74d64f717..951b2e79a 100644 --- a/src/code/code_800FC620.c +++ b/src/code/code_800FC620.c @@ -20,77 +20,6 @@ char D_80134488[0x18] = { 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, }; -s32 Overlay_Load(u32 vRomStart, u32 vRomEnd, void* vRamStart, void* vRamEnd, void* allocatedVRamAddr) { - s32 pad; - u32 end; - u32 bssSize; - OverlayRelocationSection* ovl; - u32 relocCnt; - u32 ovlOffset; - u32 size; - - size = vRomEnd - vRomStart; - end = (u32)allocatedVRamAddr + size; - - if (gOverlayLogSeverity >= 3) { - // "Start loading dynamic link function" - osSyncPrintf("\nダイナミックリンクファンクションのロードを開始します\n"); - } - - if (gOverlayLogSeverity >= 3) { - // "DMA transfer of TEXT, DATA, RODATA + rel (%08x-%08x)" - osSyncPrintf("TEXT,DATA,RODATA+relをDMA転送します(%08x-%08x)\n", allocatedVRamAddr, end); - } - - DmaMgr_SendRequest0((u32)allocatedVRamAddr, vRomStart, size); - - ovlOffset = ((s32*)end)[-1]; - - ovl = (OverlayRelocationSection*)((u32)end - ovlOffset); - if (gOverlayLogSeverity >= 3) { - osSyncPrintf("TEXT(%08x), DATA(%08x), RODATA(%08x), BSS(%08x)\n", ovl->textSize, ovl->dataSize, ovl->rodataSize, - ovl->bssSize); - } - - if (gOverlayLogSeverity >= 3) { - osSyncPrintf("リロケーションします\n"); // "Relocate" - } - - Overlay_Relocate(allocatedVRamAddr, ovl, vRamStart); - - bssSize = ovl->bssSize; - if (bssSize != 0) { - if (gOverlayLogSeverity >= 3) { - // "Clear BSS area (% 08x-% 08x)" - osSyncPrintf("BSS領域をクリアします(%08x-%08x)\n", end, end + ovl->bssSize); - } - - size = ovl->bssSize; - bssSize = size; - bzero((void*)end, bssSize); - relocCnt = ovl->nRelocations; - (void)relocCnt; // suppresses set but unused warning - } - - size = (u32)&ovl->relocations[ovl->nRelocations] - (u32)ovl; - if (gOverlayLogSeverity >= 3) { - // "Clear REL area (%08x-%08x)" - osSyncPrintf("REL領域をクリアします(%08x-%08x)\n", ovl, (u32)ovl + size); - } - - bzero(ovl, size); - - size = (u32)vRamEnd - (u32)vRamStart; - osWritebackDCache(allocatedVRamAddr, size); - osInvalICache(allocatedVRamAddr, size); - - if (gOverlayLogSeverity >= 3) { - // "Finish loading dynamic link function" - osSyncPrintf("ダイナミックリンクファンクションのロードを終了します\n\n"); - } - return size; -} - // possibly some kind of new() function void* func_800FC800(u32 size) { if (size == 0) { |
