mirror of
https://github.com/izzy2lost/Diddy-Kong-Racing.git
synced 2026-06-19 01:16:26 -07:00
Start work on __scHandleRetrace
This commit is contained in:
+7
-7
@@ -1,4 +1,4 @@
|
||||
glabel __scHandleRetrace_Maybe
|
||||
glabel __scHandleRetrace
|
||||
/* 07A418 80079818 27BDFFB8 */ addiu $sp, $sp, -0x48
|
||||
/* 07A41C 8007981C AFBF001C */ sw $ra, 0x1c($sp)
|
||||
/* 07A420 80079820 AFB10018 */ sw $s1, 0x18($sp)
|
||||
@@ -125,18 +125,18 @@ glabel __scHandleRetrace_Maybe
|
||||
/* 07A5D8 800799D8 0C01E7EA */ jal __scExec
|
||||
/* 07A5DC 800799DC 02202025 */ move $a0, $s1
|
||||
.L800799E0:
|
||||
/* 07A5E0 800799E0 3C0D800E */ lui $t5, %hi(D_800DE764) # $t5, 0x800e
|
||||
/* 07A5E4 800799E4 8DADE764 */ lw $t5, %lo(D_800DE764)($t5)
|
||||
/* 07A5E0 800799E0 3C0D800E */ lui $t5, %hi(D_800DE760) # $t5, 0x800e
|
||||
/* 07A5E4 800799E4 8DADE764 */ lw $t5, %lo(D_800DE760+4)($t5)
|
||||
/* 07A5E8 800799E8 3C0C800E */ lui $t4, %hi(D_800DE760) # $t4, 0x800e
|
||||
/* 07A5EC 800799EC 8D8CE760 */ lw $t4, %lo(D_800DE760)($t4)
|
||||
/* 07A5F0 800799F0 25AF0001 */ addiu $t7, $t5, 1
|
||||
/* 07A5F4 800799F4 2DE10001 */ sltiu $at, $t7, 1
|
||||
/* 07A5F8 800799F8 01817021 */ addu $t6, $t4, $at
|
||||
/* 07A5FC 800799FC 3C01800E */ lui $at, %hi(D_800DE764) # $at, 0x800e
|
||||
/* 07A5FC 800799FC 3C01800E */ lui $at, %hi(D_800DE760) # $at, 0x800e
|
||||
/* 07A600 80079A00 3C02800E */ lui $v0, %hi(D_800DE750) # $v0, 0x800e
|
||||
/* 07A604 80079A04 2442E750 */ addiu $v0, %lo(D_800DE750) # addiu $v0, $v0, -0x18b0
|
||||
/* 07A608 80079A08 AC2EE760 */ sw $t6, %lo(D_800DE760)($at)
|
||||
/* 07A60C 80079A0C AC2FE764 */ sw $t7, %lo(D_800DE764)($at)
|
||||
/* 07A60C 80079A0C AC2FE764 */ sw $t7, %lo(D_800DE760+4)($at)
|
||||
/* 07A610 80079A10 8C580000 */ lw $t8, ($v0)
|
||||
/* 07A614 80079A14 00000000 */ nop
|
||||
/* 07A618 80079A18 27190001 */ addiu $t9, $t8, 1
|
||||
@@ -184,8 +184,8 @@ glabel __scHandleRetrace_Maybe
|
||||
/* 07A6A8 80079AA8 24010001 */ li $at, 1
|
||||
/* 07A6AC 80079AAC 14410016 */ bne $v0, $at, .L80079B08
|
||||
/* 07A6B0 80079AB0 3C04800E */ lui $a0, %hi(D_800DE760) # $a0, 0x800e
|
||||
/* 07A6B4 80079AB4 3C05800E */ lui $a1, %hi(D_800DE764) # $a1, 0x800e
|
||||
/* 07A6B8 80079AB8 8CA5E764 */ lw $a1, %lo(D_800DE764)($a1)
|
||||
/* 07A6B4 80079AB4 3C05800E */ lui $a1, %hi(D_800DE760) # $a1, 0x800e
|
||||
/* 07A6B8 80079AB8 8CA5E764 */ lw $a1, %lo(D_800DE760+4)($a1)
|
||||
/* 07A6BC 80079ABC 8C84E760 */ lw $a0, %lo(D_800DE760)($a0)
|
||||
/* 07A6C0 80079AC0 24060000 */ li $a2, 0
|
||||
/* 07A6C4 80079AC4 0C033AA3 */ jal __ull_rem
|
||||
@@ -40,7 +40,7 @@ glabel __scMain
|
||||
/* 07A240 80079640 10000020 */ b .L800796C4
|
||||
/* 07A244 80079644 8FA50064 */ lw $a1, 0x64($sp)
|
||||
.L80079648:
|
||||
/* 07A248 80079648 0C01E606 */ jal __scHandleRetrace_Maybe
|
||||
/* 07A248 80079648 0C01E606 */ jal __scHandleRetrace
|
||||
/* 07A24C 8007964C 02402025 */ move $a0, $s2
|
||||
/* 07A250 80079650 1000FFEC */ b .L80079604
|
||||
/* 07A254 80079654 02602025 */ move $a0, $s3
|
||||
|
||||
+119
-7
@@ -23,8 +23,7 @@ u32 D_800DE754 = 0;
|
||||
u32 D_800DE758 = 0;
|
||||
s32 D_800DE75C = 0; // Currently unknown, might be a different type.
|
||||
|
||||
s32 D_800DE760 = 0; // Currently unknown, might be a different type.
|
||||
s32 D_800DE764 = 0; // Currently unknown, might be a different type.
|
||||
u64 D_800DE760 = 0;
|
||||
|
||||
/*******************************/
|
||||
|
||||
@@ -179,10 +178,124 @@ void dummy_80079808() {
|
||||
void dummy_80079810() {
|
||||
}
|
||||
|
||||
GLOBAL_ASM("lib/asm/non_matchings/sched/__scHandleRetrace_Maybe.s")
|
||||
#if 0
|
||||
void __scHandleRetrace(OSSched *sc) {
|
||||
void *sp44;
|
||||
OSScTask *sp38;
|
||||
OSScTask *sp34;
|
||||
u8 sp32;
|
||||
OSMesgQueue *sp28;
|
||||
OSMesgQueue *temp_a0;
|
||||
OSMesgQueue *temp_a0_2;
|
||||
OSScClient *temp_s0_2;
|
||||
OSScClient *temp_s0_3;
|
||||
OSScTask *temp_v0;
|
||||
OSScTask *temp_v0_2;
|
||||
s32 temp_s0;
|
||||
s32 temp_t2;
|
||||
s32 temp_t7;
|
||||
OSScTask *temp_v1;
|
||||
u64 temp_ret;
|
||||
u8 temp_v0_3;
|
||||
s32 phi_s0;
|
||||
OSScClient *phi_s0_2;
|
||||
|
||||
#if 1
|
||||
sp44 = NULL;
|
||||
sp38 = NULL;
|
||||
sp34 = NULL;
|
||||
sp32 = 0;
|
||||
phi_s0 = 0;
|
||||
if (sc->curRSPTask != 0) {
|
||||
D_800DE754 = (s32) (D_800DE754 + 1);
|
||||
}
|
||||
if (sc->curRDPTask != 0) {
|
||||
D_800DE758 = (s32) (D_800DE758 + 1);
|
||||
}
|
||||
temp_v0 = sc->curRSPTask;
|
||||
if ((D_800DE754 >= 0xB) && (temp_v0 != 0)) {
|
||||
D_800DE754 = 0;
|
||||
__osSpSetStatus(0xAAAA82U);
|
||||
phi_s0 = 1;
|
||||
} else if (temp_v0 != 0) {
|
||||
D_80126110 = 1;
|
||||
}
|
||||
temp_v0_2 = sc->curRDPTask;
|
||||
if ((D_800DE758 >= 0xB) && (temp_v0_2 != 0)) {
|
||||
if (temp_v0_2->unk68 == 0) {
|
||||
osSendMesg(temp_v0_2->msgQ, &D_800DE738, 1);
|
||||
}
|
||||
sp32 = 1;
|
||||
sc->doAudio = 0;
|
||||
D_800DE758 = 0;
|
||||
__osSpSetStatus(0xAAAA82U);
|
||||
osDpSetStatus(0x1D6U);
|
||||
} else if (temp_v0_2 != 0) {
|
||||
D_80126114 = 1;
|
||||
}
|
||||
temp_a0 = &sc->cmdQ;
|
||||
if (phi_s0 != 0) {
|
||||
sc->curRSPTask = NULL;
|
||||
}
|
||||
if (sp32 != 0) {
|
||||
sc->curRDPTask = NULL;
|
||||
}
|
||||
sp28 = temp_a0;
|
||||
if (osRecvMesg(temp_a0, &sp44, 0) != -1) {
|
||||
do {
|
||||
__scAppendList(sc, (OSScTask *) sp44);
|
||||
} while (osRecvMesg(sp28, &sp44, 0) != -1);
|
||||
}
|
||||
temp_s0 = ((sc->curRSPTask == 0) * 2) | (sc->curRDPTask == 0);
|
||||
if (__scSchedule(sc, &sp38, &sp34, temp_s0) != temp_s0) {
|
||||
__scExec(sc, sp38, sp34);
|
||||
}
|
||||
temp_t7 = D_800DE760 + 1;
|
||||
D_800DE760 = (s32) (D_800DE760 + (temp_t7 == 0));
|
||||
D_800DE760 = temp_t7;
|
||||
D_800DE750 = (s32) (D_800DE750 + 1);
|
||||
temp_v1 = sc->curRDPTask;
|
||||
temp_t2 = sc->doAudio + 1;
|
||||
sc->doAudio = temp_t2;
|
||||
if ((temp_v1 != 0) && ((u32) temp_t2 >= 2U)) {
|
||||
temp_a0_2 = temp_v1->msgQ;
|
||||
if (temp_a0_2 != 0) {
|
||||
if ((temp_v1->unk68 != 0) || (temp_v1->msgQ != 0)) {
|
||||
osSendMesg(temp_a0_2, temp_v1->msgQ, 1);
|
||||
} else {
|
||||
osSendMesg(temp_a0_2, &D_800DE730, 1);
|
||||
}
|
||||
}
|
||||
sc->doAudio = 0;
|
||||
sc->frameCount = 0;
|
||||
}
|
||||
temp_s0_2 = sc->clientList;
|
||||
phi_s0_2 = temp_s0_2;
|
||||
if (temp_s0_2 != 0) {
|
||||
do {
|
||||
temp_v0_3 = phi_s0_2->unk0;
|
||||
if (temp_v0_3 == 1) {
|
||||
temp_ret = D_800DE760 % 2;//__ull_rem(D_800DE760, D_800DE764, 0, 2);
|
||||
if ((temp_ret == 0)) {
|
||||
osSendMesg(phi_s0_2->msgQ, (void *) sc, 0);
|
||||
if (sc->audioListHead != 0) {
|
||||
func_80079760(sc);
|
||||
}
|
||||
}
|
||||
} else if (temp_v0_3 == 2) {
|
||||
osSendMesg(phi_s0_2->msgQ, (void *) sc, 0);
|
||||
}
|
||||
temp_s0_3 = phi_s0_2->next;
|
||||
phi_s0_2 = temp_s0_3;
|
||||
} while (temp_s0_3 != 0);
|
||||
}
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("lib/asm/non_matchings/sched/__scHandleRetrace.s")
|
||||
#endif
|
||||
|
||||
//Keeping this defined here because it seems too specific to this function
|
||||
#define OS_CPU_COUNTER_F (f32)(OS_CPU_COUNTER / 100.0f)
|
||||
|
||||
void __scHandleRSP(OSSched *sc) {
|
||||
OSScTask *t, *sp = 0, *dp = 0;
|
||||
s32 state;
|
||||
@@ -191,6 +304,8 @@ void __scHandleRSP(OSSched *sc) {
|
||||
t = sc->curRSPTask;
|
||||
sc->curRSPTask = NULL;
|
||||
|
||||
//Rare seems to have edited this function, most specifically here.
|
||||
//Still need to do better for a match, but this does work
|
||||
if (t->list.t.type == M_AUDTASK) {
|
||||
D_80126124 = osGetCount();
|
||||
D_800DE74C = (f32) (((f32) (D_80126124 - D_80126120) * 60.0f) / OS_CPU_COUNTER_F);
|
||||
@@ -232,9 +347,6 @@ void __scHandleRSP(OSSched *sc) {
|
||||
if ( (__scSchedule (sc, &sp, &dp, state)) != state)
|
||||
__scExec(sc, sp, dp);
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("lib/asm/non_matchings/sched/__scHandleRSP.s")
|
||||
#endif
|
||||
|
||||
void __scHandleRDP(OSSched *sc) {
|
||||
OSScTask *t, *sp = 0, *dp = 0;
|
||||
|
||||
Reference in New Issue
Block a user