mirror of
https://github.com/izzy2lost/Diddy-Kong-Racing.git
synced 2026-06-19 01:16:26 -07:00
Decompiled functions in sched. Moved sched & osCreatePiManager to lib/src/mips1 folder
This commit is contained in:
@@ -257,10 +257,10 @@ ALL_ASSETS_BUILT += $(patsubst $(UCODE_IN_DIR)/%.bin,$(UCODE_OUT_DIR)/%.bin,$(UC
|
||||
####################### LIBULTRA #########################
|
||||
|
||||
$(BUILD_DIR)/lib/%.o: OPT_FLAGS := -O2
|
||||
$(BUILD_DIR)/lib/%.o: MIPSISET := -mips2
|
||||
$(BUILD_DIR)/lib/src/al/%.o: OPT_FLAGS := -O3
|
||||
$(BUILD_DIR)/lib/src/os/%.o: OPT_FLAGS := -O1
|
||||
$(BUILD_DIR)/lib/src/os/osViMgr.o: OPT_FLAGS := -O2
|
||||
$(BUILD_DIR)/lib/src/os/osCreatePiManager.o: OPT_FLAGS := -O2
|
||||
$(BUILD_DIR)/lib/src/unknown_0C91A0.o : OPT_FLAGS := -O1
|
||||
$(BUILD_DIR)/lib/src/unknown_0D29F0.o: OPT_FLAGS := -O1
|
||||
$(BUILD_DIR)/lib/src/unknown_0CDE90.o: OPT_FLAGS := -O1
|
||||
@@ -272,6 +272,9 @@ $(BUILD_DIR)/lib/src/osEepromWrite.o: OPT_FLAGS := -O1
|
||||
$(BUILD_DIR)/lib/src/osEepromRead.o: OPT_FLAGS := -O1
|
||||
$(BUILD_DIR)/lib/src/osSetTimer.o: OPT_FLAGS := -O1
|
||||
|
||||
$(BUILD_DIR)/lib/%.o: MIPSISET := -mips2
|
||||
$(BUILD_DIR)/lib/src/mips1/%.o: MIPSISET := -mips1
|
||||
|
||||
# asm-processor currently does not support -O3, so this is my workaround.
|
||||
$(BUILD_DIR)/lib/src/al/global_asm/%.o: OPT_FLAGS := -O2
|
||||
|
||||
|
||||
@@ -18,26 +18,26 @@ glabel render
|
||||
/* 06D24C 8006C64C 248411F8 */ addiu $a0, %lo(D_801211F8) # addiu $a0, $a0, 0x11f8
|
||||
/* 06D250 8006C650 00002825 */ move $a1, $zero
|
||||
/* 06D254 8006C654 00003025 */ move $a2, $zero
|
||||
/* 06D258 8006C658 0C01E8B4 */ jal func_8007A2D0
|
||||
/* 06D258 8006C658 0C01E8B4 */ jal set_rsp_segment
|
||||
/* 06D25C 8006C65C AC990000 */ sw $t9, ($a0)
|
||||
/* 06D260 8006C660 3C068012 */ lui $a2, %hi(gVideoCurrFramebuffer) # $a2, 0x8012
|
||||
/* 06D264 8006C664 8CC662D4 */ lw $a2, %lo(gVideoCurrFramebuffer)($a2)
|
||||
/* 06D268 8006C668 3C048012 */ lui $a0, %hi(D_801211F8) # $a0, 0x8012
|
||||
/* 06D26C 8006C66C 248411F8 */ addiu $a0, %lo(D_801211F8) # addiu $a0, $a0, 0x11f8
|
||||
/* 06D270 8006C670 0C01E8B4 */ jal func_8007A2D0
|
||||
/* 06D270 8006C670 0C01E8B4 */ jal set_rsp_segment
|
||||
/* 06D274 8006C674 24050001 */ li $a1, 1
|
||||
/* 06D278 8006C678 3C068012 */ lui $a2, %hi(gVideoLastDepthBuffer) # $a2, 0x8012
|
||||
/* 06D27C 8006C67C 8CC662E0 */ lw $a2, %lo(gVideoLastDepthBuffer)($a2)
|
||||
/* 06D280 8006C680 3C048012 */ lui $a0, %hi(D_801211F8) # $a0, 0x8012
|
||||
/* 06D284 8006C684 248411F8 */ addiu $a0, %lo(D_801211F8) # addiu $a0, $a0, 0x11f8
|
||||
/* 06D288 8006C688 0C01E8B4 */ jal func_8007A2D0
|
||||
/* 06D288 8006C688 0C01E8B4 */ jal set_rsp_segment
|
||||
/* 06D28C 8006C68C 24050002 */ li $a1, 2
|
||||
/* 06D290 8006C690 3C068012 */ lui $a2, %hi(gVideoCurrFramebuffer) # $a2, 0x8012
|
||||
/* 06D294 8006C694 8CC662D4 */ lw $a2, %lo(gVideoCurrFramebuffer)($a2)
|
||||
/* 06D298 8006C698 3C048012 */ lui $a0, %hi(D_801211F8) # $a0, 0x8012
|
||||
/* 06D29C 8006C69C 248411F8 */ addiu $a0, %lo(D_801211F8) # addiu $a0, $a0, 0x11f8
|
||||
/* 06D2A0 8006C6A0 24050004 */ li $a1, 4
|
||||
/* 06D2A4 8006C6A4 0C01E8B4 */ jal func_8007A2D0
|
||||
/* 06D2A4 8006C6A4 0C01E8B4 */ jal set_rsp_segment
|
||||
/* 06D2A8 8006C6A8 24C6FB00 */ addiu $a2, $a2, -0x500
|
||||
.L8006C6AC:
|
||||
/* 06D2AC 8006C6AC 3C03800E */ lui $v1, %hi(D_800DD3F0) # $v1, 0x800e
|
||||
@@ -96,26 +96,26 @@ glabel render
|
||||
/* 06D378 8006C778 3C018012 */ lui $at, %hi(D_80121228) # $at, 0x8012
|
||||
/* 06D37C 8006C77C 00002825 */ move $a1, $zero
|
||||
/* 06D380 8006C780 00003025 */ move $a2, $zero
|
||||
/* 06D384 8006C784 0C01E8B4 */ jal func_8007A2D0
|
||||
/* 06D384 8006C784 0C01E8B4 */ jal set_rsp_segment
|
||||
/* 06D388 8006C788 AC291228 */ sw $t1, %lo(D_80121228)($at)
|
||||
/* 06D38C 8006C78C 3C068012 */ lui $a2, %hi(gVideoLastFramebuffer) # $a2, 0x8012
|
||||
/* 06D390 8006C790 8CC662D8 */ lw $a2, %lo(gVideoLastFramebuffer)($a2)
|
||||
/* 06D394 8006C794 3C048012 */ lui $a0, %hi(D_801211F8) # $a0, 0x8012
|
||||
/* 06D398 8006C798 248411F8 */ addiu $a0, %lo(D_801211F8) # addiu $a0, $a0, 0x11f8
|
||||
/* 06D39C 8006C79C 0C01E8B4 */ jal func_8007A2D0
|
||||
/* 06D39C 8006C79C 0C01E8B4 */ jal set_rsp_segment
|
||||
/* 06D3A0 8006C7A0 24050001 */ li $a1, 1
|
||||
/* 06D3A4 8006C7A4 3C068012 */ lui $a2, %hi(gVideoLastDepthBuffer) # $a2, 0x8012
|
||||
/* 06D3A8 8006C7A8 8CC662E0 */ lw $a2, %lo(gVideoLastDepthBuffer)($a2)
|
||||
/* 06D3AC 8006C7AC 3C048012 */ lui $a0, %hi(D_801211F8) # $a0, 0x8012
|
||||
/* 06D3B0 8006C7B0 248411F8 */ addiu $a0, %lo(D_801211F8) # addiu $a0, $a0, 0x11f8
|
||||
/* 06D3B4 8006C7B4 0C01E8B4 */ jal func_8007A2D0
|
||||
/* 06D3B4 8006C7B4 0C01E8B4 */ jal set_rsp_segment
|
||||
/* 06D3B8 8006C7B8 24050002 */ li $a1, 2
|
||||
/* 06D3BC 8006C7BC 3C068012 */ lui $a2, %hi(gVideoLastFramebuffer) # $a2, 0x8012
|
||||
/* 06D3C0 8006C7C0 8CC662D8 */ lw $a2, %lo(gVideoLastFramebuffer)($a2)
|
||||
/* 06D3C4 8006C7C4 3C048012 */ lui $a0, %hi(D_801211F8) # $a0, 0x8012
|
||||
/* 06D3C8 8006C7C8 248411F8 */ addiu $a0, %lo(D_801211F8) # addiu $a0, $a0, 0x11f8
|
||||
/* 06D3CC 8006C7CC 24050004 */ li $a1, 4
|
||||
/* 06D3D0 8006C7D0 0C01E8B4 */ jal func_8007A2D0
|
||||
/* 06D3D0 8006C7D0 0C01E8B4 */ jal set_rsp_segment
|
||||
/* 06D3D4 8006C7D4 24C6FB00 */ addiu $a2, $a2, -0x500
|
||||
/* 06D3D8 8006C7D8 3C048012 */ lui $a0, %hi(D_801211F8) # $a0, 0x8012
|
||||
/* 06D3DC 8006C7DC 0C01E037 */ jal func_800780DC
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
glabel func_8007957C
|
||||
/* 07A17C 8007957C 03E00008 */ jr $ra
|
||||
/* 07A180 80079580 24820040 */ addiu $v0, $a0, 0x40
|
||||
|
||||
/* 07A184 80079584 3C01800E */ lui $at, %hi(D_800DE740) # $at, 0x800e
|
||||
/* 07A188 80079588 C424E740 */ lwc1 $f4, %lo(D_800DE740)($at)
|
||||
/* 07A18C 8007958C 3C01800E */ lui $at, %hi(D_800DE748) # $at, 0x800e
|
||||
/* 07A190 80079590 E4840000 */ swc1 $f4, ($a0)
|
||||
/* 07A194 80079594 C426E748 */ lwc1 $f6, %lo(D_800DE748)($at)
|
||||
/* 07A198 80079598 3C01800E */ lui $at, %hi(D_800DE74C) # $at, 0x800e
|
||||
/* 07A19C 8007959C E4A60000 */ swc1 $f6, ($a1)
|
||||
/* 07A1A0 800795A0 C428E74C */ lwc1 $f8, %lo(D_800DE74C)($at)
|
||||
/* 07A1A4 800795A4 03E00008 */ jr $ra
|
||||
/* 07A1A8 800795A8 E4C80000 */ swc1 $f8, ($a2)
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
glabel func_80079760
|
||||
/* 07A360 80079760 27BDFFD8 */ addiu $sp, $sp, -0x28
|
||||
/* 07A364 80079764 AFBF0014 */ sw $ra, 0x14($sp)
|
||||
/* 07A368 80079768 AFA00020 */ sw $zero, 0x20($sp)
|
||||
/* 07A36C 8007976C AFA0001C */ sw $zero, 0x1c($sp)
|
||||
/* 07A370 80079770 8C8E0264 */ lw $t6, 0x264($a0)
|
||||
/* 07A374 80079774 240F0001 */ li $t7, 1
|
||||
/* 07A378 80079778 11C00002 */ beqz $t6, .L80079784
|
||||
/* 07A37C 8007977C 27A50020 */ addiu $a1, $sp, 0x20
|
||||
/* 07A380 80079780 AC8F0284 */ sw $t7, 0x284($a0)
|
||||
.L80079784:
|
||||
/* 07A384 80079784 8C980284 */ lw $t8, 0x284($a0)
|
||||
/* 07A388 80079788 27A6001C */ addiu $a2, $sp, 0x1c
|
||||
/* 07A38C 8007978C 13000009 */ beqz $t8, .L800797B4
|
||||
/* 07A390 80079790 00000000 */ nop
|
||||
/* 07A394 80079794 8C990274 */ lw $t9, 0x274($a0)
|
||||
/* 07A398 80079798 00000000 */ nop
|
||||
/* 07A39C 8007979C 13200005 */ beqz $t9, .L800797B4
|
||||
/* 07A3A0 800797A0 00000000 */ nop
|
||||
/* 07A3A4 800797A4 0C01E820 */ jal func_8007A080
|
||||
/* 07A3A8 800797A8 00000000 */ nop
|
||||
/* 07A3AC 800797AC 10000013 */ b .L800797FC
|
||||
/* 07A3B0 800797B0 8FBF0014 */ lw $ra, 0x14($sp)
|
||||
.L800797B4:
|
||||
/* 07A3B4 800797B4 8C880274 */ lw $t0, 0x274($a0)
|
||||
/* 07A3B8 800797B8 8C8B0278 */ lw $t3, 0x278($a0)
|
||||
/* 07A3BC 800797BC 2D090001 */ sltiu $t1, $t0, 1
|
||||
/* 07A3C0 800797C0 00095040 */ sll $t2, $t1, 1
|
||||
/* 07A3C4 800797C4 2D6C0001 */ sltiu $t4, $t3, 1
|
||||
/* 07A3C8 800797C8 014C3825 */ or $a3, $t2, $t4
|
||||
/* 07A3CC 800797CC AFA70024 */ sw $a3, 0x24($sp)
|
||||
/* 07A3D0 800797D0 0C01E835 */ jal __scSchedule
|
||||
/* 07A3D4 800797D4 AFA40028 */ sw $a0, 0x28($sp)
|
||||
/* 07A3D8 800797D8 8FA70024 */ lw $a3, 0x24($sp)
|
||||
/* 07A3DC 800797DC 8FA40028 */ lw $a0, 0x28($sp)
|
||||
/* 07A3E0 800797E0 10470006 */ beq $v0, $a3, .L800797FC
|
||||
/* 07A3E4 800797E4 8FBF0014 */ lw $ra, 0x14($sp)
|
||||
/* 07A3E8 800797E8 8FA50020 */ lw $a1, 0x20($sp)
|
||||
/* 07A3EC 800797EC 8FA6001C */ lw $a2, 0x1c($sp)
|
||||
/* 07A3F0 800797F0 0C01E7EA */ jal __scExec
|
||||
/* 07A3F4 800797F4 00000000 */ nop
|
||||
/* 07A3F8 800797F8 8FBF0014 */ lw $ra, 0x14($sp)
|
||||
.L800797FC:
|
||||
/* 07A3FC 800797FC 27BD0028 */ addiu $sp, $sp, 0x28
|
||||
/* 07A400 80079800 03E00008 */ jr $ra
|
||||
/* 07A404 80079804 00000000 */ nop
|
||||
|
||||
/* 07A408 80079808 03E00008 */ jr $ra
|
||||
/* 07A40C 8007980C 00000000 */ nop
|
||||
|
||||
/* 07A410 80079810 03E00008 */ jr $ra
|
||||
/* 07A414 80079814 00000000 */ nop
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
glabel func_8007A080
|
||||
/* 07AC80 8007A080 27BDFFE8 */ addiu $sp, $sp, -0x18
|
||||
/* 07AC84 8007A084 AFBF0014 */ sw $ra, 0x14($sp)
|
||||
/* 07AC88 8007A088 8C820274 */ lw $v0, 0x274($a0)
|
||||
/* 07AC8C 8007A08C 24010001 */ li $at, 1
|
||||
/* 07AC90 8007A090 8C4E0010 */ lw $t6, 0x10($v0)
|
||||
/* 07AC94 8007A094 00000000 */ nop
|
||||
/* 07AC98 8007A098 15C1000B */ bne $t6, $at, .L8007A0C8
|
||||
/* 07AC9C 8007A09C 8FBF0014 */ lw $ra, 0x14($sp)
|
||||
/* 07ACA0 8007A0A0 8C4F0004 */ lw $t7, 4($v0)
|
||||
/* 07ACA4 8007A0A4 00000000 */ nop
|
||||
/* 07ACA8 8007A0A8 35F80010 */ ori $t8, $t7, 0x10
|
||||
/* 07ACAC 8007A0AC 0C03486C */ jal osGetTime
|
||||
/* 07ACB0 8007A0B0 AC580004 */ sw $t8, 4($v0)
|
||||
/* 07ACB4 8007A0B4 3C018012 */ lui $at, %hi(D_8012611C) # $at, 0x8012
|
||||
/* 07ACB8 8007A0B8 AC226118 */ sw $v0, %lo(D_80126118)($at)
|
||||
/* 07ACBC 8007A0BC 0C034890 */ jal osSpTaskYield
|
||||
/* 07ACC0 8007A0C0 AC23611C */ sw $v1, %lo(D_8012611C)($at)
|
||||
/* 07ACC4 8007A0C4 8FBF0014 */ lw $ra, 0x14($sp)
|
||||
.L8007A0C8:
|
||||
/* 07ACC8 8007A0C8 27BD0018 */ addiu $sp, $sp, 0x18
|
||||
/* 07ACCC 8007A0CC 03E00008 */ jr $ra
|
||||
/* 07ACD0 8007A0D0 00000000 */ nop
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
glabel func_8007A2D0
|
||||
/* 07AED0 8007A2D0 00057880 */ sll $t7, $a1, 2
|
||||
/* 07AED4 8007A2D4 8C830000 */ lw $v1, ($a0)
|
||||
/* 07AED8 8007A2D8 31F8FFFF */ andi $t8, $t7, 0xffff
|
||||
/* 07AEDC 8007A2DC 0018CA00 */ sll $t9, $t8, 8
|
||||
/* 07AEE0 8007A2E0 3C01BC00 */ lui $at, 0xbc00
|
||||
/* 07AEE4 8007A2E4 03214025 */ or $t0, $t9, $at
|
||||
/* 07AEE8 8007A2E8 3C018000 */ lui $at, 0x8000
|
||||
/* 07AEEC 8007A2EC 246E0008 */ addiu $t6, $v1, 8
|
||||
/* 07AEF0 8007A2F0 AC8E0000 */ sw $t6, ($a0)
|
||||
/* 07AEF4 8007A2F4 00C15021 */ addu $t2, $a2, $at
|
||||
/* 07AEF8 8007A2F8 35090006 */ ori $t1, $t0, 6
|
||||
/* 07AEFC 8007A2FC AC690000 */ sw $t1, ($v1)
|
||||
/* 07AF00 8007A300 03E00008 */ jr $ra
|
||||
/* 07AF04 8007A304 AC6A0004 */ sw $t2, 4($v1)
|
||||
|
||||
/* 07AF08 8007A308 00000000 */ nop
|
||||
/* 07AF0C 8007A30C 00000000 */ nop
|
||||
|
||||
+1
-2
@@ -3,7 +3,7 @@ glabel D_800E796C
|
||||
.float 468750.0
|
||||
|
||||
.text
|
||||
glabel func_80079B44
|
||||
glabel __scHandleRSP
|
||||
/* 07A744 80079B44 27BDFFC8 */ addiu $sp, $sp, -0x38
|
||||
/* 07A748 80079B48 AFBF001C */ sw $ra, 0x1c($sp)
|
||||
/* 07A74C 80079B4C AFB00018 */ sw $s0, 0x18($sp)
|
||||
@@ -149,4 +149,3 @@ glabel func_80079B44
|
||||
/* 07A950 80079D50 8FB00018 */ lw $s0, 0x18($sp)
|
||||
/* 07A954 80079D54 03E00008 */ jr $ra
|
||||
/* 07A958 80079D58 27BD0038 */ addiu $sp, $sp, 0x38
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ glabel __scMain
|
||||
/* 07A250 80079650 1000FFEC */ b .L80079604
|
||||
/* 07A254 80079654 02602025 */ move $a0, $s3
|
||||
.L80079658:
|
||||
/* 07A258 80079658 0C01E6D1 */ jal func_80079B44
|
||||
/* 07A258 80079658 0C01E6D1 */ jal __scHandleRSP
|
||||
/* 07A25C 8007965C 02402025 */ move $a0, $s2
|
||||
/* 07A260 80079660 1000FFE8 */ b .L80079604
|
||||
/* 07A264 80079664 02602025 */ move $a0, $s3
|
||||
@@ -1,9 +1,9 @@
|
||||
/* The comment below is needed for this file to be picked up by generate_ld */
|
||||
/* RAM_POS: 0x800C6000 */
|
||||
|
||||
// osCreatePiManager is compiled with -mips1, so it belongs in the source folder I think.
|
||||
|
||||
#include "osCreatePiManager.h"
|
||||
#include "types.h"
|
||||
#include "libultra_internal.h"
|
||||
#include "stacks.h"
|
||||
|
||||
extern OSMesgQueue piAccessQueue; //piAccessQueue
|
||||
extern u32 __osPiAccessQueueEnabled; //__osPiAccessQueueEnabled
|
||||
@@ -1,10 +1,9 @@
|
||||
/* The comment below is needed for this file to be picked up by generate_ld */
|
||||
/* RAM_POS: 0x80079350 */
|
||||
|
||||
#include "unknown_079F50.h"
|
||||
|
||||
#include "types.h"
|
||||
#include "macros.h"
|
||||
#include "f3ddkr.h"
|
||||
#include "libultra_internal.h"
|
||||
|
||||
#define OS_SC_RETRACE_MSG 1
|
||||
@@ -57,6 +56,7 @@ typedef struct {
|
||||
OSScTask *curRDPTask;
|
||||
u32 frameCount;
|
||||
s32 doAudio;
|
||||
s32 unk284;
|
||||
} OSSched;
|
||||
|
||||
typedef struct{
|
||||
@@ -70,10 +70,10 @@ typedef struct{
|
||||
s32 D_800DE730[] = { 0, 0 };
|
||||
s32 D_800DE738[] = { 0, 8 };
|
||||
|
||||
s32 D_800DE740 = 0; // Currently unknown, might be a different type.
|
||||
s32 D_800DE744 = 0; // Currently unknown, might be a different type.
|
||||
s32 D_800DE748 = 0; // Currently unknown, might be a different type.
|
||||
s32 D_800DE74C = 0; // Currently unknown, might be a different type.
|
||||
f32 D_800DE740 = 0;
|
||||
f32 D_800DE744 = 0;
|
||||
f32 D_800DE748 = 0;
|
||||
f32 D_800DE74C = 0;
|
||||
|
||||
s32 D_800DE750 = 0; // Currently unknown, might be a different type.
|
||||
u32 D_800DE754 = 0;
|
||||
@@ -109,20 +109,20 @@ const char D_800E7958[] = "\tdata_size\t\t= %u\n";
|
||||
|
||||
/*********************************/
|
||||
|
||||
extern OSViMode osViModeTable[];//osViModeTable;
|
||||
extern OSViMode osViModeTable[];
|
||||
|
||||
/************ .bss ************/
|
||||
|
||||
s32 D_80126110;
|
||||
s32 D_80126114;
|
||||
s32 D_80126118;
|
||||
s32 D_8012611C;
|
||||
OSTime D_80126118;
|
||||
s32 D_80126120;
|
||||
s32 D_80126124;
|
||||
s32 D_80126128[18];
|
||||
|
||||
/*******************************/
|
||||
|
||||
void func_8007A080(OSSched *sc);
|
||||
void __scMain(void);
|
||||
void __scExec(OSSched *sc, OSScTask *sp, OSScTask *dp);
|
||||
|
||||
@@ -201,77 +201,46 @@ OSMesgQueue *osScGetCmdQ(OSSched *sc){
|
||||
return &sc->cmdQ;
|
||||
}
|
||||
|
||||
GLOBAL_ASM("asm/non_matchings/unknown_079F50/func_8007957C.s")
|
||||
GLOBAL_ASM("asm/non_matchings/unknown_079F50/__scMain.s")
|
||||
GLOBAL_ASM("asm/non_matchings/unknown_079F50/func_80079760.s")
|
||||
GLOBAL_ASM("asm/non_matchings/unknown_079F50/func_80079818.s")
|
||||
|
||||
|
||||
#if 1
|
||||
GLOBAL_ASM("asm/non_matchings/unknown_079F50/func_80079B44.s")
|
||||
#else
|
||||
extern f32 D_800DE740;
|
||||
extern f32 D_800DE744;
|
||||
extern f32 D_800DE748;
|
||||
extern f32 D_800DE74C;
|
||||
extern u32 D_800DE750;
|
||||
extern u32 D_80126124;
|
||||
void func_80079B44(OSSched *sc){
|
||||
OSScTask *t, *sp = 0, *dp = 0;
|
||||
s32 state;
|
||||
u32 delta;
|
||||
f32 tmp1;
|
||||
|
||||
|
||||
//assert(sc->curRSPTask);
|
||||
|
||||
t = sc->curRSPTask;
|
||||
sc->curRSPTask = 0;
|
||||
|
||||
if (t->list.t.type == 2) {
|
||||
D_80126124 = osGetCount();
|
||||
delta = D_80126124 - D_80126120;
|
||||
tmp1 = (f32) delta;
|
||||
if(delta < 0){
|
||||
tmp1 += 4294967296.0;
|
||||
}
|
||||
D_800DE74C = tmp1*60.0f/468750.0f;
|
||||
D_800DE744 = D_800DE744 + D_800DE74C;
|
||||
if(D_800DE740 < D_800DE74C){
|
||||
D_800DE740 = D_800DE74C;
|
||||
}
|
||||
if(D_800DE750%1000 == 1 || D_800DE750%1000 == 2){
|
||||
D_800DE748 = D_800DE744/500.0f;
|
||||
D_800DE744 = 0.0f;
|
||||
D_800DE740 = 0.0f;
|
||||
}
|
||||
}
|
||||
if(t->state & 0x10){
|
||||
if(osSpTaskYielded(&(t->list))){
|
||||
t->state |= 0x20;
|
||||
if ((t->flags & 0x07) == -3) {
|
||||
|
||||
/* push the task back on the list */
|
||||
t->next = sc->gfxListHead;
|
||||
sc->gfxListHead = t;
|
||||
if (sc->gfxListTail == 0)
|
||||
sc->gfxListTail = t;
|
||||
}
|
||||
}
|
||||
else{
|
||||
t->state &= -3;
|
||||
}
|
||||
}
|
||||
else {
|
||||
t->state &= -3;
|
||||
__scTaskComplete(sc, t);
|
||||
}
|
||||
|
||||
state = ((sc->curRSPTask == 0) << 1) | (sc->curRDPTask == 0);
|
||||
if ( (__scSchedule (sc, &sp, &dp, state)) != state)
|
||||
__scExec(sc, sp, dp);
|
||||
s32 func_8007957C(s32 arg0) {
|
||||
return arg0 + 0x40;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Unused.
|
||||
void func_80079584(f32 *arg0, f32 *arg1, f32 *arg2) {
|
||||
*arg0 = D_800DE740;
|
||||
*arg1 = D_800DE748;
|
||||
*arg2 = D_800DE74C;
|
||||
}
|
||||
|
||||
GLOBAL_ASM("lib/asm/non_matchings/sched/__scMain.s")
|
||||
|
||||
void func_80079760(OSSched *sc) {
|
||||
s32 sp24;
|
||||
s32 sp20;
|
||||
s32 sp1C;
|
||||
|
||||
sp20 = 0;
|
||||
sp1C = 0;
|
||||
if (sc->audioListHead != 0) {
|
||||
sc->unk284 = 1;
|
||||
}
|
||||
if ((sc->unk284 != 0) && (sc->curRSPTask != 0)) {
|
||||
func_8007A080(sc);
|
||||
} else {
|
||||
sp24 = ((sc->curRSPTask == 0) << 1) | (sc->curRDPTask == 0);
|
||||
if (__scSchedule(sc, &sp20, &sp1C, sp24) != sp24) {
|
||||
__scExec(sc, sp20, sp1C);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void dummy_80079808() {
|
||||
}
|
||||
void dummy_80079810() {
|
||||
}
|
||||
|
||||
GLOBAL_ASM("lib/asm/non_matchings/sched/func_80079818.s")
|
||||
GLOBAL_ASM("lib/asm/non_matchings/sched/__scHandleRSP.s")
|
||||
|
||||
void __scHandleRDP(OSSched *sc){
|
||||
OSScTask *t, *sp = 0, *dp = 0;
|
||||
@@ -306,9 +275,7 @@ OSScTask *__scTaskReady(OSScTask *t){
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if 1
|
||||
GLOBAL_ASM("asm/non_matchings/unknown_079F50/__scTaskComplete.s")
|
||||
#else
|
||||
#if 0
|
||||
s32 __scTaskComplete(OSSched *sc, OSScTask *t) {
|
||||
int rv;
|
||||
int firsttime = 1;
|
||||
@@ -343,6 +310,8 @@ s32 __scTaskComplete(OSSched *sc, OSScTask *t) {
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("lib/asm/non_matchings/sched/__scTaskComplete.s")
|
||||
#endif
|
||||
|
||||
void __scAppendList(OSSched *sc, OSScTask *t) {
|
||||
@@ -375,8 +344,7 @@ void __scExec(OSSched *sc, OSScTask *sp, OSScTask *dp){
|
||||
D_80126120 = osGetCount();
|
||||
}
|
||||
|
||||
//sp->state &= ~(OS_SC_YIELD | OS_SC_YIELDED);
|
||||
sp->state &= -49;
|
||||
sp->state &= ~0x30;
|
||||
osSpTaskLoad(&sp->list);
|
||||
osSpTaskStartGo(&sp->list);
|
||||
D_800DE754 = 0;
|
||||
@@ -388,25 +356,22 @@ void __scExec(OSSched *sc, OSScTask *sp, OSScTask *dp){
|
||||
}
|
||||
|
||||
if (dp && (dp != sp)) {
|
||||
osDpSetNextBuffer(dp->list.t.output_buff,
|
||||
*dp->list.t.output_buff_size);
|
||||
osDpSetNextBuffer(dp->list.t.output_buff, *dp->list.t.output_buff_size);
|
||||
sc->curRDPTask = dp;
|
||||
}
|
||||
}
|
||||
|
||||
#if 1
|
||||
GLOBAL_ASM("asm/non_matchings/unknown_079F50/func_8007A080.s")
|
||||
#else
|
||||
extern OSTime D_80126118;
|
||||
void func_8007A080(OSSched *sc) {
|
||||
if (sc->curRSPTask->list.t.type == M_GFXTASK) {
|
||||
|
||||
//sc->curRSPTask->state |= OS_SC_YIELD;
|
||||
sc->curRSPTask->state |= 0x10;
|
||||
D_80126118 = osGetTime(); //TODO extra lui
|
||||
D_80126118 = osGetTime();
|
||||
osSpTaskYield();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
GLOBAL_ASM("asm/non_matchings/unknown_079F50/__scSchedule.s")
|
||||
GLOBAL_ASM("asm/non_matchings/unknown_079F50/func_8007A2D0.s")
|
||||
|
||||
GLOBAL_ASM("lib/asm/non_matchings/sched/__scSchedule.s")
|
||||
|
||||
// This might need to be moved into it's own file.
|
||||
void set_rsp_segment(Gfx **dlist, s32 segment, s32 base) {
|
||||
gSPSegment((*dlist)++, segment, base + 0x80000000)
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#ifndef _PI_MANAGER_H_
|
||||
#define _PI_MANAGER_H_
|
||||
|
||||
#include "types.h"
|
||||
#include "libultra_internal.h"
|
||||
#include "stacks.h"
|
||||
|
||||
extern OSThread piThread;
|
||||
extern s32 D_8012A9B0[64];
|
||||
extern OSMesgQueue piEventQueue;
|
||||
extern OSMesg piEventBuf[2];
|
||||
|
||||
void osCreatePiManager(OSPri pri, OSMesgQueue *cmdQ, OSMesg *cmdBuf, s32 cmdMsgCnt);
|
||||
|
||||
#endif
|
||||
@@ -793,10 +793,10 @@ void render(void) {
|
||||
|
||||
if (D_800DD380 == 8) {
|
||||
D_801211F8 = D_801211F0[D_801234E8];
|
||||
func_8007A2D0(&D_801211F8, 0, 0);
|
||||
func_8007A2D0(&D_801211F8, 1, gVideoCurrFramebuffer);
|
||||
func_8007A2D0(&D_801211F8, 2, gVideoLastDepthBuffer);
|
||||
func_8007A2D0(&D_801211F8, 4, gVideoCurrFramebuffer - 0x500);
|
||||
set_rsp_segment(&D_801211F8, 0, 0);
|
||||
set_rsp_segment(&D_801211F8, 1, gVideoCurrFramebuffer);
|
||||
set_rsp_segment(&D_801211F8, 2, gVideoLastDepthBuffer);
|
||||
set_rsp_segment(&D_801211F8, 4, gVideoCurrFramebuffer - 0x500);
|
||||
}
|
||||
if (D_800DD3F0 == 0) {
|
||||
setupOSTasks(D_801211F0[D_801234E8], D_801211F8, 0);
|
||||
@@ -812,10 +812,10 @@ void render(void) {
|
||||
D_80121218 = D_80121210[D_801234E8];
|
||||
D_80121228 = D_80121220[D_801234E8];
|
||||
|
||||
func_8007A2D0(&D_801211F8, 0, 0, &D_801234E8);
|
||||
func_8007A2D0(&D_801211F8, 1, gVideoLastFramebuffer);
|
||||
func_8007A2D0(&D_801211F8, 2, gVideoLastDepthBuffer);
|
||||
func_8007A2D0(&D_801211F8, 4, gVideoLastFramebuffer - 0x500);
|
||||
set_rsp_segment(&D_801211F8, 0, 0, &D_801234E8);
|
||||
set_rsp_segment(&D_801211F8, 1, gVideoLastFramebuffer);
|
||||
set_rsp_segment(&D_801211F8, 2, gVideoLastDepthBuffer);
|
||||
set_rsp_segment(&D_801211F8, 4, gVideoLastFramebuffer - 0x500);
|
||||
func_800780DC(&D_801211F8);
|
||||
func_80078054(&D_801211F8);
|
||||
func_80077B9C(&D_801211F8, &D_80121208, 1);
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
#ifndef _UNKNOWN_079F50_H_
|
||||
#define _UNKNOWN_079F50_H_
|
||||
|
||||
#include "types.h"
|
||||
|
||||
// Unsure about if this is an array or struct.
|
||||
extern s32 D_800DE730[];
|
||||
extern s32 D_800DE738[];
|
||||
|
||||
extern s32 D_800DE740;
|
||||
extern s32 D_800DE744;
|
||||
extern s32 D_800DE748;
|
||||
extern s32 D_800DE74C;
|
||||
|
||||
extern s32 D_800DE750;
|
||||
extern u32 D_800DE754;
|
||||
extern u32 D_800DE758;
|
||||
extern s32 D_800DE75C;
|
||||
|
||||
extern s32 D_800DE760;
|
||||
extern s32 D_800DE764;
|
||||
|
||||
#endif
|
||||
@@ -32,8 +32,8 @@ opt_flags = [x for x in compile_args if x in ['-g3', '-g', '-O1', '-O2', '-frame
|
||||
preprocessed_file = tempfile.NamedTemporaryFile(prefix='preprocessed', suffix='.c', delete=False)
|
||||
|
||||
try:
|
||||
# Only want to apply -mips1 flag to the main source files. Not the lib files.
|
||||
if ('-O2' in opt_flags) and (not 'lib/' in in_file):
|
||||
# Only want to apply -mips1 flag to certain files
|
||||
if ('-O2' in opt_flags) and ((not 'lib/' in in_file) or ('lib/src/mips1' in in_file)):
|
||||
opt_flags.append('-mips1')
|
||||
asmproc_flags = opt_flags + [in_file, '--input-enc', 'utf-8', '--output-enc', 'euc-jp']
|
||||
compile_cmdline = compiler + compile_args + ['-I', in_dir, '-o', out_file, preprocessed_file.name]
|
||||
|
||||
Reference in New Issue
Block a user