Decompile osViSwapBuffer

This commit is contained in:
Ryan Dwyer committed 2021-01-30 00:20:14 +10:00
1 parent 27943128e9
commit 5f89d4c303
11 files changed
+76 -53

No files matched your search

+1
View File
@@ -82,6 +82,7 @@ $(B_DIR)/lib/ultra/io/visetevent.o: OPT_LVL := -O1
$(B_DIR)/lib/ultra/io/visetmode.o: OPT_LVL := -O1
$(B_DIR)/lib/ultra/io/visetxscale.o: OPT_LVL := -O1
$(B_DIR)/lib/ultra/io/visetyscale.o: OPT_LVL := -O1
$(B_DIR)/lib/ultra/io/viswapbuf.o: OPT_LVL := -O1
$(B_DIR)/lib/ultra/os/createmesgqueue.o: OPT_LVL := -O1
$(B_DIR)/lib/ultra/os/destroythread.o: OPT_LVL := -O1
$(B_DIR)/lib/ultra/os/jammesg.o: OPT_LVL := -O1
+3 -1
View File
@@ -108,7 +108,9 @@
build/ROMID/lib/ultra/io/visetxscale.o (section); \
build/ROMID/lib/ultra/io/visetyscale.o (section); \
build/ROMID/lib/lib_48f50.o (section); \
build/ROMID/lib/lib_490b0.o (section); \
build/ROMID/lib/ultra/io/viswapbuf.o (section); \
build/ROMID/lib/ultra/io/sptaskyield.o (section); \
build/ROMID/lib/lib_49120.o (section); \
build/ROMID/lib/ultra/os/timerintr.o (section); \
build/ROMID/lib/ultra/os/interrupt.o (section); \
build/ROMID/lib/ultra/io/vi.o (section); \
-1
View File
@@ -22,7 +22,6 @@
#include "lib/lib_48150.h"
#include "lib/lib_48cd0.h"
#include "lib/lib_48f50.h"
#include "lib/lib_490b0.h"
#include "types.h"
GLOBAL_ASM(
-1
View File
@@ -25,7 +25,6 @@
#include "lib/lib_48150.h"
#include "lib/lib_48cd0.h"
#include "lib/lib_48f50.h"
#include "lib/lib_490b0.h"
#include "types.h"
#if VERSION >= VERSION_NTSC_1_0
+1 -2
View File
@@ -24,7 +24,6 @@
#include "lib/lib_48150.h"
#include "lib/lib_48cd0.h"
#include "lib/lib_48f50.h"
#include "lib/lib_490b0.h"
#include "types.h"
void func00001b10(u32 value)
@@ -514,7 +513,7 @@ s32 __scTaskComplete(OSSched *sc, OSScTask *t)
}
func00001b40(t->framebuffer);
func000490b0(t->framebuffer);
osViSwapBuffer(t->framebuffer);
}
osSendMesg(t->msgQ, t->msg, OS_MESG_BLOCK);
+1 -1
View File
@@ -3,7 +3,7 @@
#include <ultra64.h>
#include "types.h"
void func000490b0(void *framebuffer);
void osViSwapBuffer(void *framebuffer);
u64 func00049120(void);
#endif
-1
View File
@@ -15,7 +15,6 @@
#include "lib/lib_2fba0.h"
#include "lib/lib_2fc60.h"
#include "lib/lib_30ce0.h"
#include "lib/lib_490b0.h"
#include "lib/libc/ll.h"
#include "types.h"
+1 -46
View File
@@ -11,7 +11,7 @@
#include "types.h"
GLOBAL_ASM(
glabel func000490b0
glabel osViSwapBuffer
/* 490b0: 27bdffe0 */ addiu $sp,$sp,-32
/* 490b4: afbf0014 */ sw $ra,0x14($sp)
/* 490b8: 0c01256c */ jal __osDisableInt
@@ -33,48 +33,3 @@ glabel func000490b0
/* 490f8: 03e00008 */ jr $ra
/* 490fc: 00000000 */ nop
);
void osSpTaskYield(void)
{
__osSpSetStatus(SP_SET_YIELD);
}
GLOBAL_ASM(
glabel func00049120
/* 49120: 27bdffc8 */ addiu $sp,$sp,-56
/* 49124: afbf001c */ sw $ra,0x1c($sp)
/* 49128: 0c01256c */ jal __osDisableInt
/* 4912c: afb00018 */ sw $s0,0x18($sp)
/* 49130: 0c012144 */ jal osGetCount
/* 49134: 00408025 */ or $s0,$v0,$zero
/* 49138: afa20034 */ sw $v0,0x34($sp)
/* 4913c: 3c0f800a */ lui $t7,%hi(var8009c788)
/* 49140: 8defc788 */ lw $t7,%lo(var8009c788)($t7)
/* 49144: 8fae0034 */ lw $t6,0x34($sp)
/* 49148: 3c08800a */ lui $t0,%hi(var8009c780)
/* 4914c: 3c09800a */ lui $t1,%hi(var8009c784)
/* 49150: 8d29c784 */ lw $t1,%lo(var8009c784)($t1)
/* 49154: 8d08c780 */ lw $t0,%lo(var8009c780)($t0)
/* 49158: 01cfc023 */ subu $t8,$t6,$t7
/* 4915c: afb80030 */ sw $t8,0x30($sp)
/* 49160: 02002025 */ or $a0,$s0,$zero
/* 49164: afa9002c */ sw $t1,0x2c($sp)
/* 49168: 0c012588 */ jal __osRestoreInt
/* 4916c: afa80028 */ sw $t0,0x28($sp)
/* 49170: 8fb90030 */ lw $t9,0x30($sp)
/* 49174: 8fad002c */ lw $t5,0x2c($sp)
/* 49178: 8fbf001c */ lw $ra,0x1c($sp)
/* 4917c: 03205825 */ or $t3,$t9,$zero
/* 49180: 016d1821 */ addu $v1,$t3,$t5
/* 49184: 8fac0028 */ lw $t4,0x28($sp)
/* 49188: 240a0000 */ addiu $t2,$zero,0x0
/* 4918c: 006d082b */ sltu $at,$v1,$t5
/* 49190: 002a1021 */ addu $v0,$at,$t2
/* 49194: 8fb00018 */ lw $s0,0x18($sp)
/* 49198: 27bd0038 */ addiu $sp,$sp,0x38
/* 4919c: 03e00008 */ jr $ra
/* 491a0: 004c1021 */ addu $v0,$v0,$t4
/* 491a4: 00000000 */ nop
/* 491a8: 00000000 */ nop
/* 491ac: 00000000 */ nop
);
+51
View File
@@ -0,0 +1,51 @@
#include <ultra64.h>
#include "constants.h"
#include "game/data/data_000000.h"
#include "game/data/data_0083d0.h"
#include "game/data/data_00e460.h"
#include "game/data/data_0160b0.h"
#include "game/data/data_01a3a0.h"
#include "game/data/data_020df0.h"
#include "game/data/data_02da90.h"
#include "gvars/gvars.h"
#include "types.h"
GLOBAL_ASM(
glabel func00049120
/* 49120: 27bdffc8 */ addiu $sp,$sp,-56
/* 49124: afbf001c */ sw $ra,0x1c($sp)
/* 49128: 0c01256c */ jal __osDisableInt
/* 4912c: afb00018 */ sw $s0,0x18($sp)
/* 49130: 0c012144 */ jal osGetCount
/* 49134: 00408025 */ or $s0,$v0,$zero
/* 49138: afa20034 */ sw $v0,0x34($sp)
/* 4913c: 3c0f800a */ lui $t7,%hi(var8009c788)
/* 49140: 8defc788 */ lw $t7,%lo(var8009c788)($t7)
/* 49144: 8fae0034 */ lw $t6,0x34($sp)
/* 49148: 3c08800a */ lui $t0,%hi(var8009c780)
/* 4914c: 3c09800a */ lui $t1,%hi(var8009c784)
/* 49150: 8d29c784 */ lw $t1,%lo(var8009c784)($t1)
/* 49154: 8d08c780 */ lw $t0,%lo(var8009c780)($t0)
/* 49158: 01cfc023 */ subu $t8,$t6,$t7
/* 4915c: afb80030 */ sw $t8,0x30($sp)
/* 49160: 02002025 */ or $a0,$s0,$zero
/* 49164: afa9002c */ sw $t1,0x2c($sp)
/* 49168: 0c012588 */ jal __osRestoreInt
/* 4916c: afa80028 */ sw $t0,0x28($sp)
/* 49170: 8fb90030 */ lw $t9,0x30($sp)
/* 49174: 8fad002c */ lw $t5,0x2c($sp)
/* 49178: 8fbf001c */ lw $ra,0x1c($sp)
/* 4917c: 03205825 */ or $t3,$t9,$zero
/* 49180: 016d1821 */ addu $v1,$t3,$t5
/* 49184: 8fac0028 */ lw $t4,0x28($sp)
/* 49188: 240a0000 */ addiu $t2,$zero,0x0
/* 4918c: 006d082b */ sltu $at,$v1,$t5
/* 49190: 002a1021 */ addu $v0,$at,$t2
/* 49194: 8fb00018 */ lw $s0,0x18($sp)
/* 49198: 27bd0038 */ addiu $sp,$sp,0x38
/* 4919c: 03e00008 */ jr $ra
/* 491a0: 004c1021 */ addu $v0,$v0,$t4
/* 491a4: 00000000 */ nop
/* 491a8: 00000000 */ nop
/* 491ac: 00000000 */ nop
);
+6
View File
@@ -0,0 +1,6 @@
#include <ultra64.h>
void osSpTaskYield(void)
{
__osSpSetStatus(SP_SET_YIELD);
}
+12
View File
@@ -0,0 +1,12 @@
#include <ultra64.h>
#include "game/data/data_000000.h"
void osViSwapBuffer(void *frameBufPtr)
{
u32 saveMask = __osDisableInt();
__osViNext->framep = frameBufPtr;
__osViNext->state |= VI_STATE_10;
__osRestoreInt(saveMask);
}