Match and link GBAGetProcess.c

Former-commit-id: d1bf059e8a
This commit is contained in:
Phillip Stephens 2023-09-25 20:20:40 -07:00
parent 9aea4fc9bd
commit 3da1e1b45b
2 changed files with 12 additions and 11 deletions

View File

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

View File

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