From 6d315fa2aea31b56edeebc7f754211ffefc0d44e Mon Sep 17 00:00:00 2001 From: Derek Hensley Date: Sun, 12 May 2024 10:08:52 -0700 Subject: Use Romfile in place of vromStart and vromEnd in structs (#1618) * DmaEntry * KaleidoMgrOverlay * ActorOverlay * EffectSsOverlay * GameStateOverlay * TransitionOverlay --- src/boot/z_std_dma.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/boot') diff --git a/src/boot/z_std_dma.c b/src/boot/z_std_dma.c index d15da6518..71e64ad69 100644 --- a/src/boot/z_std_dma.c +++ b/src/boot/z_std_dma.c @@ -114,8 +114,8 @@ s32 DmaMgr_AudioDmaHandler(OSPiHandle* pihandle, OSIoMesg* mb, s32 direction) { DmaEntry* DmaMgr_FindDmaEntry(uintptr_t vrom) { DmaEntry* entry; - for (entry = gDmaDataTable; entry->vromEnd != 0; entry++) { - if ((vrom >= entry->vromStart) && (vrom < entry->vromEnd)) { + for (entry = gDmaDataTable; entry->file.vromEnd != 0; entry++) { + if ((vrom >= entry->file.vromStart) && (vrom < entry->file.vromEnd)) { return entry; } } @@ -128,10 +128,10 @@ s32 DmaMgr_TranslateVromToRom(uintptr_t vrom) { if (entry != NULL) { if (entry->romEnd == 0) { - return vrom + entry->romStart - entry->vromStart; + return vrom + entry->romStart - entry->file.vromStart; } - if (vrom == entry->vromStart) { + if (vrom == entry->file.vromStart) { return entry->romStart; } @@ -169,23 +169,23 @@ void DmaMgr_ProcessRequest(DmaRequest* req) { if (entry->romEnd == 0) { // romEnd of 0 indicates that the file is uncompressed. Files that are stored uncompressed can have // only part of their content loaded into RAM, so DMA only the requested region. - if (entry->vromEnd < (vrom + size)) { + if (entry->file.vromEnd < (vrom + size)) { // Error, vrom + size ends up in a different file than it started in Fault_AddHungupAndCrash("../z_std_dma.c", 499); } - DmaMgr_DmaRomToRam((entry->romStart + vrom) - entry->vromStart, ram, size); + DmaMgr_DmaRomToRam((entry->romStart + vrom) - entry->file.vromStart, ram, size); } else { // File is compressed. Files that are stored compressed must be loaded into RAM all at once. romSize = entry->romEnd - entry->romStart; romStart = entry->romStart; - if (vrom != entry->vromStart) { + if (vrom != entry->file.vromStart) { // Error, requested vrom is not the start of a file Fault_AddHungupAndCrash("../z_std_dma.c", 518); } - if (size != (entry->vromEnd - entry->vromStart)) { + if (size != (entry->file.vromEnd - entry->file.vromStart)) { // Error, only part of the file was requested Fault_AddHungupAndCrash("../z_std_dma.c", 525); } @@ -290,7 +290,7 @@ void DmaMgr_Init(void) { DmaEntry* entry = gDmaDataTable; s32 index = 0; - while (entry->vromEnd != 0) { + while (entry->file.vromEnd != 0) { entry++; index++; } -- cgit v1.2.3