-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Niko
committed
Feb 21, 2025
1 parent
6c9a1a5
commit fbb3a19
Showing
22 changed files
with
176 additions
and
233 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,2 @@ | ||
#include <common.h> | ||
|
||
void DECOMP_LOAD_DramFileCallback(); | ||
|
||
void* DECOMP_LOAD_DramFile(void* bigfilePtr, int subfileIndex, int* ptrDestination, int callbackOrFlags) | ||
{ | ||
struct LoadQueueSlot lqs; | ||
|
||
if(callbackOrFlags == -1) | ||
{ | ||
lqs.ptrBigfileCdPos = bigfilePtr; | ||
lqs.flags = 0; | ||
lqs.type = LT_DRAM; | ||
lqs.subfileIndex = subfileIndex; | ||
lqs.ptrDestination = DECOMP_LOAD_ReadFile(bigfilePtr, LT_DRAM, subfileIndex, 0, 0); | ||
lqs.callback.funcPtr = NULL; | ||
|
||
DECOMP_LOAD_DramFileCallback(&lqs); | ||
|
||
// optimization, dont use instructions writing | ||
// return value, let it use whatever sits on | ||
// the register. Return value is never used | ||
// because callback.funcptr is zero | ||
return NULL; //was just `return;` | ||
} | ||
|
||
if(callbackOrFlags == -2) | ||
{ | ||
void* ptrDest = DECOMP_LOAD_ReadFile(bigfilePtr, LT_DRAM, subfileIndex, 0, DECOMP_LOAD_DramFileCallback); | ||
|
||
*ptrDestination = (int)ptrDest; | ||
data.currSlot.ptrDestination = ptrDest; | ||
|
||
return ptrDest; | ||
} | ||
|
||
// valid callback | ||
|
||
return DECOMP_LOAD_ReadFile(bigfilePtr, LT_DRAM, subfileIndex, ptrDestination, DECOMP_LOAD_DramFileCallback); | ||
} | ||
// -- dead code -- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,22 @@ | ||
#include <common.h> | ||
|
||
void* DECOMP_LOAD_VramFile(void* bigfilePtr, int subfileIndex, int* ptrDestination, int callbackOrFlags) | ||
void* DECOMP_LOAD_VramFile(void* bigfilePtr, int subfileIndex) | ||
{ | ||
struct LoadQueueSlot lqs; | ||
|
||
if(callbackOrFlags == -1) | ||
{ | ||
lqs.ptrBigfileCdPos = bigfilePtr; | ||
lqs.flags = 0; | ||
lqs.type = LT_VRAM; | ||
lqs.subfileIndex = subfileIndex; | ||
lqs.ptrDestination = DECOMP_LOAD_ReadFile(bigfilePtr, LT_VRAM, subfileIndex, 0, 0); | ||
lqs.callback.funcPtr = NULL; | ||
|
||
DECOMP_LOAD_VramFileCallback(&lqs); | ||
|
||
VSync(2); | ||
|
||
sdata->frameFinishedVRAM = 0; | ||
|
||
// optimization, dont use instructions writing | ||
// return value, let it use whatever sits on | ||
// the register. Return value is never used | ||
// because callback.funcptr is zero | ||
return NULL; //was just `return;` | ||
} | ||
|
||
if(callbackOrFlags == -2) | ||
{ | ||
void* ptrDest = DECOMP_LOAD_ReadFile(bigfilePtr, LT_VRAM, subfileIndex, 0, &DECOMP_LOAD_VramFileCallback); | ||
*ptrDestination = (int)ptrDest; | ||
data.currSlot.ptrDestination = ptrDest; | ||
return ptrDest; | ||
} | ||
// callback=0 means this calls CdSync and is not async | ||
lqs.ptrDestination = DECOMP_LOAD_ReadFile(bigfilePtr, subfileIndex, 0, 0); | ||
|
||
// undo allocation, next LOAD queue request | ||
// will overwrite where VRAM was in RAM | ||
DECOMP_MEMPACK_ReallocMem(0); | ||
|
||
// run callback | ||
DECOMP_LOAD_VramFileCallback(&lqs); | ||
|
||
// valid callback | ||
// wait 2 frames for LoadImage to finish | ||
VSync(2); | ||
|
||
return DECOMP_LOAD_ReadFile(bigfilePtr, LT_VRAM, subfileIndex, ptrDestination, &DECOMP_LOAD_VramFileCallback); | ||
// do NOT trigger code in vsync callback to handle queue | ||
sdata->frameFinishedVRAM = 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.