summaryrefslogtreecommitdiff
path: root/src/boot
diff options
context:
space:
mode:
authorDerek Hensley <hensley.derek58@gmail.com>2024-05-12 10:08:52 -0700
committerGitHub <noreply@github.com>2024-05-12 10:08:52 -0700
commit6d315fa2aea31b56edeebc7f754211ffefc0d44e (patch)
tree013b285e519bf629cc143ea98e086e64335fd7a9 /src/boot
parent0e8b225279333708feb8c7995ddf9243e9cc1fe3 (diff)
Use Romfile in place of vromStart and vromEnd in structs (#1618)
* DmaEntry * KaleidoMgrOverlay * ActorOverlay * EffectSsOverlay * GameStateOverlay * TransitionOverlay
Diffstat (limited to 'src/boot')
-rw-r--r--src/boot/z_std_dma.c18
1 files changed, 9 insertions, 9 deletions
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++;
}