c: __osPiCreateAccessQueue, __osPiGetAccess, __osPiRelAccess

This commit is contained in:
Mittenshugg
2020-08-04 15:42:51 -05:00
parent 5d66c6bc6f
commit 111972f9da
6 changed files with 48 additions and 36 deletions
+1 -4
View File
@@ -180,6 +180,7 @@ $(BUILD_DIR)/lib/%.o: MIPSISET := -mips2
$(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
$(BUILD_DIR)/lib/src/unknown_0D3160.o: OPT_FLAGS := -O1
$(BUILD_DIR)/lib/src/osCreateThread.o : OPT_FLAGS := -O1
$(BUILD_DIR)/lib/src/osGetThreadPri.o : OPT_FLAGS := -O1
$(BUILD_DIR)/lib/src/osPfsFreeBlocks.o: OPT_FLAGS := -O1
@@ -212,11 +213,7 @@ else
endif
clean_lib:
<<<<<<< HEAD
ifneq ($(wildcard ./build/lib/src/.*),)
=======
ifneq ($(wildcard $(BUILD_DIR)/lib/.*),)
>>>>>>> b1b1e461a6aa490d7355c207a9a9530181aa8fd7
rm -r $(BUILD_DIR)/lib/src/*.o
else
@echo "build lib directory has already been deleted."
+2 -2
View File
@@ -13,8 +13,8 @@ def add_custom_arguments(parser):
def apply(config, args):
lang = args.lang or 'us'
config['mapfile'] = f'build/dkr.map'
config['myimg'] = f'build/dkr.z64'
config['mapfile'] = f'build/us_1.0/dkr.map'
config['myimg'] = f'build/us_1.0/dkr.z64'
config['baseimg'] = f'baseroms/Diddy Kong Racing (USA 1.0).z64'
config['makeflags'] = [f'']
config['source_directories'] = ['src']
@@ -1,21 +0,0 @@
glabel __osDequeueThread
/* 0D3870 800D2C70 00803025 */ move $a2, $a0
/* 0D3874 800D2C74 8CC70000 */ lw $a3, ($a2)
/* 0D3878 800D2C78 27BDFFF8 */ addiu $sp, $sp, -8
/* 0D387C 800D2C7C 10E0000A */ beqz $a3, .L800D2CA8
/* 0D3880 800D2C80 00000000 */ nop
.L800D2C84:
/* 0D3884 800D2C84 14E50004 */ bne $a3, $a1, .L800D2C98
/* 0D3888 800D2C88 00000000 */ nop
/* 0D388C 800D2C8C 8CAE0000 */ lw $t6, ($a1)
/* 0D3890 800D2C90 10000005 */ b .L800D2CA8
/* 0D3894 800D2C94 ACCE0000 */ sw $t6, ($a2)
.L800D2C98:
/* 0D3898 800D2C98 00E03025 */ move $a2, $a3
/* 0D389C 800D2C9C 8CC70000 */ lw $a3, ($a2)
/* 0D38A0 800D2CA0 14E0FFF8 */ bnez $a3, .L800D2C84
/* 0D38A4 800D2CA4 00000000 */ nop
.L800D2CA8:
/* 0D38A8 800D2CA8 03E00008 */ jr $ra
/* 0D38AC 800D2CAC 27BD0008 */ addiu $sp, $sp, 8
+26 -2
View File
@@ -3,7 +3,31 @@
#include "types.h"
#include "macros.h"
#include "libultra_internal.h"
GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/func_800D2470.s")
GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/__osPiCreateAccessQueue.s")
#define PI_Q_BUF_LEN 1
extern u32 D_800E4800;//__osPiAccessQueueEnabled
extern OSMesg D_8012D1E0[PI_Q_BUF_LEN];//piAccessBuf
extern OSMesgQueue D_8012D1E8; //__osPiAccessQueue
void __osPiCreateAccessQueue(void)
{
D_800E4800 = 1;
osCreateMesgQueue(&D_8012D1E8, D_8012D1E0, PI_Q_BUF_LEN);
osSendMesg(&D_8012D1E8, NULL, OS_MESG_NOBLOCK);
}
void __osPiGetAccess(void)
{
OSMesg dummyMesg;
if (!D_800E4800)
__osPiCreateAccessQueue();
osRecvMesg(&D_8012D1E8, &dummyMesg, OS_MESG_BLOCK);
}
void __osPiRelAccess(void)
{
osSendMesg(&D_8012D1E8, NULL, OS_MESG_NOBLOCK);
}
+19 -1
View File
@@ -3,6 +3,7 @@
#include "types.h"
#include "macros.h"
#include "libultra_internal.h"
GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3160/__osDisableInt.s")
GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3160/__osRestoreInt.s")
@@ -11,4 +12,21 @@ GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3160/D_800D2680.s")
GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3160/D_800D2760.s")
GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3160/__osViInit.s")
GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3160/func_800D2C60.s")
GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3160/__osDequeueThread.s")
void __osDequeueThread(OSThread **queue, OSThread *t)
{
register OSThread *pred;
register OSThread *succ;
pred = (OSThread *)queue; //this is actually legit..
succ = pred->next;
while (succ != NULL)
{
if (succ == t)
{
pred->next = t->next;
return;
}
pred = succ;
succ = pred->next;
}
}
-6
View File
@@ -10,13 +10,7 @@ fi
#echo "Replace $1 with $2?"
#read
<<<<<<< HEAD
ofiles=$(grep -rl "$1" build/**/*.o)
rm -v $ofiles
grep -rl "$1" asm/**/*.s src/**/*.{c,h} lib/**/*.{c,s} include/*.h data/dkr.data.s undefined_syms.txt | xargs sed -i "s/\b$1\b/$2/g"
=======
grep -rl "$1" asm/**/*.s src/**/*.{c,h} lib/**/*.{c,s} include/*.h data/dkr.data.s undefined_syms.txt | xargs sed -i "s/\b$1\b/$2/g"
# This removes all the .o files that use the old name.
grep -rl "$1" build/**/*.o | xargs rm
>>>>>>> b1b1e461a6aa490d7355c207a9a9530181aa8fd7