Match and link GBAGetProcess.c

This commit is contained in:
Phillip Stephens 2023-09-25 20:20:40 -07:00
parent 20502fb6dd
commit d1bf059e8a
2 changed files with 12 additions and 11 deletions

View File

@ -1048,7 +1048,7 @@ LIBS = [
"host": False,
"objects": [
["Dolphin/GBA/GBA", True],
["Dolphin/GBA/GBAGetProcessStatus", False],
["Dolphin/GBA/GBAGetProcessStatus", True],
["Dolphin/GBA/GBAJoyBoot", True],
["Dolphin/GBA/GBARead", True],
["Dolphin/GBA/GBAWrite", True],

View File

@ -59,23 +59,24 @@
*/
s32 GBAGetProcessStatus(s32 chan, u8* percentp) {
BOOL enabled;
s32 ret; // r29
GBAControl* gba = &__GBA[chan]; // r25
GBABootInfo* bootInfo; // r31
u8 percent; // r30
OSTime t; // r27
BOOL enabled; // r26
s32 ret; // r29
GBAControl* gba; // r25
GBABootInfo* bootInfo; // r31
u8 percent; // r30
OSTime t; // r27
bootInfo = &gba->bootInfo;
gba = &__GBA[chan];
bootInfo = &__GBA[chan].bootInfo;
enabled = OSDisableInterrupts();
if (bootInfo->callback != NULL) {
ret = 2;
percent = (bootInfo->curOffset * 100) / bootInfo->realLength;
if (bootInfo->begin != 0) {
t = OSGetTime();
if (OSTicksToMilliseconds(t - bootInfo->begin) < (5500)) {
percent = ((t - bootInfo->begin) * percent) / OSMillisecondsToTicks((OSTime)5500);
t = OSGetTime() - bootInfo->begin;
if (OSTicksToMilliseconds(t) < 5500) {
percent = (percent * t) / OSMillisecondsToTicks(5500ll);
}
if (percent >= 100) {