From d416539bd3eab798fa556a1e853a7f16c682de76 Mon Sep 17 00:00:00 2001 From: David Benepe Date: Sat, 1 Aug 2020 07:43:45 -0500 Subject: [PATCH 1/6] Fixed minor issues and added some asm files. --- asm/unknown_070110/func_80070B04.s | 2 +- include/PR/os_message.h | 2 +- include/PR/os_vi.h | 2 +- .../unknown_0D3020 => }/__osProbeTLB.s | 10 +++++ lib/asm/exception.s | 18 ++++++++ .../unknown_0D3020 => exception}/D_800D35A0.s | 0 .../__osDispatchThread.s | 0 .../__osEnqueueAndYield.s | 0 .../__osEnqueueThread.s | 0 .../__osException.s | 0 .../__osExceptionPreamble.s | 0 .../__osPopThread.s | 0 .../unknown_0D3020 => exception}/send_mesg.s | 0 .../D_800D25A0.s | 0 .../D_800D2680.s | 0 .../D_800D2760.s | 0 .../__osDequeueThread.s | 0 .../__osDisableInt.s | 0 .../__osRestoreInt.s | 0 .../__osViInit.s | 0 .../func_800D2C60.s | 0 .../_Printf.s | 0 .../_Putfld.s | 0 .../__osGetSR.s | 0 .../__osSetFpcCsr.s | 0 .../__osSetSR.s | 0 .../__osSiRawReadIo.s | 0 .../__osSiRawWriteIo.s | 0 .../func_800D3670.s | 0 .../func_800D3820.s | 0 .../func_800D47F0.s | 0 .../osJamMesg.s | 0 .../osMapTLBRdb.s | 0 .../osPiGetCmdQueue.s | 0 .../osPiRawWriteIo.s | 0 .../osWritebackDCache.s | 0 .../osWritebackICache.s | 0 lib/src/osRecvMesg.c | 1 - lib/src/osSetTimer.c | 9 ++-- lib/src/osTimer.c | 15 ++++--- lib/src/osViSwapBuffer.c | 2 +- lib/src/unknown_0D3160.c | 41 ++++--------------- lib/src/unknown_0D4270.c | 22 ++++++++++ tools/python/score.py | 41 +++++++++++-------- 44 files changed, 100 insertions(+), 65 deletions(-) rename lib/asm/{non_matchings/unknown_0D3020 => }/__osProbeTLB.s (89%) create mode 100644 lib/asm/exception.s rename lib/asm/{non_matchings/unknown_0D3020 => exception}/D_800D35A0.s (100%) rename lib/asm/{non_matchings/unknown_0D3020 => exception}/__osDispatchThread.s (100%) rename lib/asm/{non_matchings/unknown_0D3020 => exception}/__osEnqueueAndYield.s (100%) rename lib/asm/{non_matchings/unknown_0D3020 => exception}/__osEnqueueThread.s (100%) rename lib/asm/{non_matchings/unknown_0D3020 => exception}/__osException.s (100%) rename lib/asm/{non_matchings/unknown_0D3020 => exception}/__osExceptionPreamble.s (100%) rename lib/asm/{non_matchings/unknown_0D3020 => exception}/__osPopThread.s (100%) rename lib/asm/{non_matchings/unknown_0D3020 => exception}/send_mesg.s (100%) rename lib/asm/non_matchings/{unknown_0D3020 => unknown_0D3160}/D_800D25A0.s (100%) rename lib/asm/non_matchings/{unknown_0D3020 => unknown_0D3160}/D_800D2680.s (100%) rename lib/asm/non_matchings/{unknown_0D3020 => unknown_0D3160}/D_800D2760.s (100%) rename lib/asm/non_matchings/{unknown_0D3020 => unknown_0D3160}/__osDequeueThread.s (100%) rename lib/asm/non_matchings/{unknown_0D3020 => unknown_0D3160}/__osDisableInt.s (100%) rename lib/asm/non_matchings/{unknown_0D3020 => unknown_0D3160}/__osRestoreInt.s (100%) rename lib/asm/non_matchings/{unknown_0D3020 => unknown_0D3160}/__osViInit.s (100%) rename lib/asm/non_matchings/{unknown_0D3020 => unknown_0D3160}/func_800D2C60.s (100%) rename lib/asm/non_matchings/{unknown_0D3020 => unknown_0D4270}/_Printf.s (100%) rename lib/asm/non_matchings/{unknown_0D3020 => unknown_0D4270}/_Putfld.s (100%) rename lib/asm/non_matchings/{unknown_0D3020 => unknown_0D4270}/__osGetSR.s (100%) rename lib/asm/non_matchings/{unknown_0D3020 => unknown_0D4270}/__osSetFpcCsr.s (100%) rename lib/asm/non_matchings/{unknown_0D3020 => unknown_0D4270}/__osSetSR.s (100%) rename lib/asm/non_matchings/{unknown_0D3020 => unknown_0D4270}/__osSiRawReadIo.s (100%) rename lib/asm/non_matchings/{unknown_0D3020 => unknown_0D4270}/__osSiRawWriteIo.s (100%) rename lib/asm/non_matchings/{unknown_0D3020 => unknown_0D4270}/func_800D3670.s (100%) rename lib/asm/non_matchings/{unknown_0D3020 => unknown_0D4270}/func_800D3820.s (100%) rename lib/asm/non_matchings/{unknown_0D3020 => unknown_0D4270}/func_800D47F0.s (100%) rename lib/asm/non_matchings/{unknown_0D3020 => unknown_0D4270}/osJamMesg.s (100%) rename lib/asm/non_matchings/{unknown_0D3020 => unknown_0D4270}/osMapTLBRdb.s (100%) rename lib/asm/non_matchings/{unknown_0D3020 => unknown_0D4270}/osPiGetCmdQueue.s (100%) rename lib/asm/non_matchings/{unknown_0D3020 => unknown_0D4270}/osPiRawWriteIo.s (100%) rename lib/asm/non_matchings/{unknown_0D3020 => unknown_0D4270}/osWritebackDCache.s (100%) rename lib/asm/non_matchings/{unknown_0D3020 => unknown_0D4270}/osWritebackICache.s (100%) create mode 100644 lib/src/unknown_0D4270.c diff --git a/asm/unknown_070110/func_80070B04.s b/asm/unknown_070110/func_80070B04.s index fc219a86..3ad9426a 100644 --- a/asm/unknown_070110/func_80070B04.s +++ b/asm/unknown_070110/func_80070B04.s @@ -11,4 +11,4 @@ glabel func_80070B04 /* 071724 80070B24 00000000 */ nop /* 071728 80070B28 00000000 */ nop -/* 07172C 80070B2C 00000000 */ nop \ No newline at end of file +/* 07172C 80070B2C 00000000 */ nop diff --git a/include/PR/os_message.h b/include/PR/os_message.h index 191e1b1d..1418d898 100644 --- a/include/PR/os_message.h +++ b/include/PR/os_message.h @@ -160,4 +160,4 @@ extern void osSetEventMesg(OSEvent, OSMesgQueue *, OSMesg); } #endif -#endif /* !_OS_MESSAGE_H_ */ \ No newline at end of file +#endif /* !_OS_MESSAGE_H_ */ diff --git a/include/PR/os_vi.h b/include/PR/os_vi.h index 522bd1e0..9293ab08 100644 --- a/include/PR/os_vi.h +++ b/include/PR/os_vi.h @@ -111,4 +111,4 @@ void osViSwapBuffer(void *vaddr); extern OSViMode osViModeTable[]; /* Global VI mode table */ -#endif \ No newline at end of file +#endif diff --git a/lib/asm/non_matchings/unknown_0D3020/__osProbeTLB.s b/lib/asm/__osProbeTLB.s similarity index 89% rename from lib/asm/non_matchings/unknown_0D3020/__osProbeTLB.s rename to lib/asm/__osProbeTLB.s index acfe56d2..3e3e9539 100644 --- a/lib/asm/non_matchings/unknown_0D3020/__osProbeTLB.s +++ b/lib/asm/__osProbeTLB.s @@ -1,3 +1,13 @@ +/* The comment below is needed for this file to be picked up by generate_ld */ +/* RAM_POS: 0x800D35B0 */ + +.include "globals.inc" +.include "macros.inc" + +.set noat # allow manual use of $at +.set noreorder # dont insert nops after branches +.set gp=64 # 64-bit instructions are used + glabel __osProbeTLB /* 0D41B0 800D35B0 40085000 */ mfc0 $t0, $10 /* 0D41B4 800D35B4 310900FF */ andi $t1, $t0, 0xff diff --git a/lib/asm/exception.s b/lib/asm/exception.s new file mode 100644 index 00000000..44eb877d --- /dev/null +++ b/lib/asm/exception.s @@ -0,0 +1,18 @@ +/* The comment below is needed for this file to be picked up by generate_ld */ +/* RAM_POS: 0x800D2CB0 */ + +.include "globals.inc" +.include "macros.inc" + +.set noat # allow manual use of $at +.set noreorder # dont insert nops after branches +.set gp=64 # 64-bit instructions are used + +.include "lib/asm/exception/__osExceptionPreamble.s" +.include "lib/asm/exception/__osException.s" +.include "lib/asm/exception/send_mesg.s" +.include "lib/asm/exception/__osEnqueueAndYield.s" +.include "lib/asm/exception/__osEnqueueThread.s" +.include "lib/asm/exception/__osPopThread.s" +.include "lib/asm/exception/__osDispatchThread.s" +.include "lib/asm/exception/D_800D35A0.s" diff --git a/lib/asm/non_matchings/unknown_0D3020/D_800D35A0.s b/lib/asm/exception/D_800D35A0.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D3020/D_800D35A0.s rename to lib/asm/exception/D_800D35A0.s diff --git a/lib/asm/non_matchings/unknown_0D3020/__osDispatchThread.s b/lib/asm/exception/__osDispatchThread.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D3020/__osDispatchThread.s rename to lib/asm/exception/__osDispatchThread.s diff --git a/lib/asm/non_matchings/unknown_0D3020/__osEnqueueAndYield.s b/lib/asm/exception/__osEnqueueAndYield.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D3020/__osEnqueueAndYield.s rename to lib/asm/exception/__osEnqueueAndYield.s diff --git a/lib/asm/non_matchings/unknown_0D3020/__osEnqueueThread.s b/lib/asm/exception/__osEnqueueThread.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D3020/__osEnqueueThread.s rename to lib/asm/exception/__osEnqueueThread.s diff --git a/lib/asm/non_matchings/unknown_0D3020/__osException.s b/lib/asm/exception/__osException.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D3020/__osException.s rename to lib/asm/exception/__osException.s diff --git a/lib/asm/non_matchings/unknown_0D3020/__osExceptionPreamble.s b/lib/asm/exception/__osExceptionPreamble.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D3020/__osExceptionPreamble.s rename to lib/asm/exception/__osExceptionPreamble.s diff --git a/lib/asm/non_matchings/unknown_0D3020/__osPopThread.s b/lib/asm/exception/__osPopThread.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D3020/__osPopThread.s rename to lib/asm/exception/__osPopThread.s diff --git a/lib/asm/non_matchings/unknown_0D3020/send_mesg.s b/lib/asm/exception/send_mesg.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D3020/send_mesg.s rename to lib/asm/exception/send_mesg.s diff --git a/lib/asm/non_matchings/unknown_0D3020/D_800D25A0.s b/lib/asm/non_matchings/unknown_0D3160/D_800D25A0.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D3020/D_800D25A0.s rename to lib/asm/non_matchings/unknown_0D3160/D_800D25A0.s diff --git a/lib/asm/non_matchings/unknown_0D3020/D_800D2680.s b/lib/asm/non_matchings/unknown_0D3160/D_800D2680.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D3020/D_800D2680.s rename to lib/asm/non_matchings/unknown_0D3160/D_800D2680.s diff --git a/lib/asm/non_matchings/unknown_0D3020/D_800D2760.s b/lib/asm/non_matchings/unknown_0D3160/D_800D2760.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D3020/D_800D2760.s rename to lib/asm/non_matchings/unknown_0D3160/D_800D2760.s diff --git a/lib/asm/non_matchings/unknown_0D3020/__osDequeueThread.s b/lib/asm/non_matchings/unknown_0D3160/__osDequeueThread.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D3020/__osDequeueThread.s rename to lib/asm/non_matchings/unknown_0D3160/__osDequeueThread.s diff --git a/lib/asm/non_matchings/unknown_0D3020/__osDisableInt.s b/lib/asm/non_matchings/unknown_0D3160/__osDisableInt.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D3020/__osDisableInt.s rename to lib/asm/non_matchings/unknown_0D3160/__osDisableInt.s diff --git a/lib/asm/non_matchings/unknown_0D3020/__osRestoreInt.s b/lib/asm/non_matchings/unknown_0D3160/__osRestoreInt.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D3020/__osRestoreInt.s rename to lib/asm/non_matchings/unknown_0D3160/__osRestoreInt.s diff --git a/lib/asm/non_matchings/unknown_0D3020/__osViInit.s b/lib/asm/non_matchings/unknown_0D3160/__osViInit.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D3020/__osViInit.s rename to lib/asm/non_matchings/unknown_0D3160/__osViInit.s diff --git a/lib/asm/non_matchings/unknown_0D3020/func_800D2C60.s b/lib/asm/non_matchings/unknown_0D3160/func_800D2C60.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D3020/func_800D2C60.s rename to lib/asm/non_matchings/unknown_0D3160/func_800D2C60.s diff --git a/lib/asm/non_matchings/unknown_0D3020/_Printf.s b/lib/asm/non_matchings/unknown_0D4270/_Printf.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D3020/_Printf.s rename to lib/asm/non_matchings/unknown_0D4270/_Printf.s diff --git a/lib/asm/non_matchings/unknown_0D3020/_Putfld.s b/lib/asm/non_matchings/unknown_0D4270/_Putfld.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D3020/_Putfld.s rename to lib/asm/non_matchings/unknown_0D4270/_Putfld.s diff --git a/lib/asm/non_matchings/unknown_0D3020/__osGetSR.s b/lib/asm/non_matchings/unknown_0D4270/__osGetSR.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D3020/__osGetSR.s rename to lib/asm/non_matchings/unknown_0D4270/__osGetSR.s diff --git a/lib/asm/non_matchings/unknown_0D3020/__osSetFpcCsr.s b/lib/asm/non_matchings/unknown_0D4270/__osSetFpcCsr.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D3020/__osSetFpcCsr.s rename to lib/asm/non_matchings/unknown_0D4270/__osSetFpcCsr.s diff --git a/lib/asm/non_matchings/unknown_0D3020/__osSetSR.s b/lib/asm/non_matchings/unknown_0D4270/__osSetSR.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D3020/__osSetSR.s rename to lib/asm/non_matchings/unknown_0D4270/__osSetSR.s diff --git a/lib/asm/non_matchings/unknown_0D3020/__osSiRawReadIo.s b/lib/asm/non_matchings/unknown_0D4270/__osSiRawReadIo.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D3020/__osSiRawReadIo.s rename to lib/asm/non_matchings/unknown_0D4270/__osSiRawReadIo.s diff --git a/lib/asm/non_matchings/unknown_0D3020/__osSiRawWriteIo.s b/lib/asm/non_matchings/unknown_0D4270/__osSiRawWriteIo.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D3020/__osSiRawWriteIo.s rename to lib/asm/non_matchings/unknown_0D4270/__osSiRawWriteIo.s diff --git a/lib/asm/non_matchings/unknown_0D3020/func_800D3670.s b/lib/asm/non_matchings/unknown_0D4270/func_800D3670.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D3020/func_800D3670.s rename to lib/asm/non_matchings/unknown_0D4270/func_800D3670.s diff --git a/lib/asm/non_matchings/unknown_0D3020/func_800D3820.s b/lib/asm/non_matchings/unknown_0D4270/func_800D3820.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D3020/func_800D3820.s rename to lib/asm/non_matchings/unknown_0D4270/func_800D3820.s diff --git a/lib/asm/non_matchings/unknown_0D3020/func_800D47F0.s b/lib/asm/non_matchings/unknown_0D4270/func_800D47F0.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D3020/func_800D47F0.s rename to lib/asm/non_matchings/unknown_0D4270/func_800D47F0.s diff --git a/lib/asm/non_matchings/unknown_0D3020/osJamMesg.s b/lib/asm/non_matchings/unknown_0D4270/osJamMesg.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D3020/osJamMesg.s rename to lib/asm/non_matchings/unknown_0D4270/osJamMesg.s diff --git a/lib/asm/non_matchings/unknown_0D3020/osMapTLBRdb.s b/lib/asm/non_matchings/unknown_0D4270/osMapTLBRdb.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D3020/osMapTLBRdb.s rename to lib/asm/non_matchings/unknown_0D4270/osMapTLBRdb.s diff --git a/lib/asm/non_matchings/unknown_0D3020/osPiGetCmdQueue.s b/lib/asm/non_matchings/unknown_0D4270/osPiGetCmdQueue.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D3020/osPiGetCmdQueue.s rename to lib/asm/non_matchings/unknown_0D4270/osPiGetCmdQueue.s diff --git a/lib/asm/non_matchings/unknown_0D3020/osPiRawWriteIo.s b/lib/asm/non_matchings/unknown_0D4270/osPiRawWriteIo.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D3020/osPiRawWriteIo.s rename to lib/asm/non_matchings/unknown_0D4270/osPiRawWriteIo.s diff --git a/lib/asm/non_matchings/unknown_0D3020/osWritebackDCache.s b/lib/asm/non_matchings/unknown_0D4270/osWritebackDCache.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D3020/osWritebackDCache.s rename to lib/asm/non_matchings/unknown_0D4270/osWritebackDCache.s diff --git a/lib/asm/non_matchings/unknown_0D3020/osWritebackICache.s b/lib/asm/non_matchings/unknown_0D4270/osWritebackICache.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D3020/osWritebackICache.s rename to lib/asm/non_matchings/unknown_0D4270/osWritebackICache.s diff --git a/lib/src/osRecvMesg.c b/lib/src/osRecvMesg.c index 08e28a7f..c8f3efc8 100644 --- a/lib/src/osRecvMesg.c +++ b/lib/src/osRecvMesg.c @@ -7,7 +7,6 @@ extern OSThread *__osRunningThread; -//GLOBAL_ASM("lib/asm/non_matchings/unknown_0C96F0/osRecvMesg.s") s32 osRecvMesg(OSMesgQueue *mq, OSMesg *msg, s32 flags) { register u32 saveMask; diff --git a/lib/src/osSetTimer.c b/lib/src/osSetTimer.c index 34620e4d..c969461b 100644 --- a/lib/src/osSetTimer.c +++ b/lib/src/osSetTimer.c @@ -3,10 +3,10 @@ #include "macros.h" +#if 1 GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/osSetTimer.s") - - -/*#include "libultra_internal.h" +#else +#include "libultra_internal.h" extern OSTimer *D_800E4910; @@ -25,4 +25,5 @@ u32 osSetTimer(OSTimer *t, OSTime value, OSTime interval, OSMesgQueue *mq, OSMes __osSetTimerIntr(time); } return 0; -}*/ \ No newline at end of file +} +#endif diff --git a/lib/src/osTimer.c b/lib/src/osTimer.c index dc3937b5..28d038e3 100644 --- a/lib/src/osTimer.c +++ b/lib/src/osTimer.c @@ -13,8 +13,10 @@ extern u32 D_8012D230; OSTime __osInsertTimer(OSTimer *t); +#if 1 GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/__osTimerServicesInit.s") -/*void __osTimerServicesInit(void) +#else +void __osTimerServicesInit(void) { //D_8012D224 = 0; __osCurrentTime = 0; @@ -26,7 +28,8 @@ GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/__osTimerServicesInit.s") D_800E4910->interval = D_800E4910->remaining; D_800E4910->mq = NULL; D_800E4910->msg = 0; -}*/ +} +#endif void __osTimerInterrupt(void) { @@ -67,8 +70,10 @@ void __osTimerInterrupt(void) } } +#if 1 GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/__osSetTimerIntr.s") -/*void __osSetTimerIntr(OSTime tim) +#else +void __osSetTimerIntr(OSTime tim) { OSTime NewTime; u32 savedMask; @@ -77,8 +82,8 @@ GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/__osSetTimerIntr.s") NewTime = tim + D_8012D230; __osSetCompare(NewTime); __osRestoreInt(savedMask); -}*/ - +} +#endif OSTime __osInsertTimer(OSTimer *t) diff --git a/lib/src/osViSwapBuffer.c b/lib/src/osViSwapBuffer.c index a0086baa..710fea86 100644 --- a/lib/src/osViSwapBuffer.c +++ b/lib/src/osViSwapBuffer.c @@ -10,4 +10,4 @@ void osViSwapBuffer(void* frameBufPtr){ D_800E4874->buffer = frameBufPtr; D_800E4874->unk00 |= 0x10; __osRestoreInt(saveMask); -} \ No newline at end of file +} diff --git a/lib/src/unknown_0D3160.c b/lib/src/unknown_0D3160.c index 8a8d2217..da6e3282 100644 --- a/lib/src/unknown_0D3160.c +++ b/lib/src/unknown_0D3160.c @@ -4,36 +4,11 @@ #include "types.h" #include "macros.h" -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/__osDisableInt.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/__osRestoreInt.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/D_800D25A0.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/D_800D2680.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/D_800D2760.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/__osViInit.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/func_800D2C60.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/__osDequeueThread.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/__osExceptionPreamble.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/__osException.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/send_mesg.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/__osEnqueueAndYield.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/__osEnqueueThread.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/__osPopThread.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/__osDispatchThread.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/D_800D35A0.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/__osProbeTLB.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/func_800D3670.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/osJamMesg.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/osPiGetCmdQueue.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/func_800D3820.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/_Putfld.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/_Printf.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/__osSetSR.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/__osGetSR.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/__osSetFpcCsr.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/__osSiRawReadIo.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/__osSiRawWriteIo.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/osWritebackDCache.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/osWritebackICache.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/osMapTLBRdb.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/osPiRawWriteIo.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/func_800D47F0.s") +GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3160/__osDisableInt.s") +GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3160/__osRestoreInt.s") +GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3160/D_800D25A0.s") +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") diff --git a/lib/src/unknown_0D4270.c b/lib/src/unknown_0D4270.c new file mode 100644 index 00000000..e9e75c2f --- /dev/null +++ b/lib/src/unknown_0D4270.c @@ -0,0 +1,22 @@ +/* The comment below is needed for this file to be picked up by generate_ld */ +/* RAM_POS: 0x800D3670 */ + +#include "types.h" +#include "macros.h" + +GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/func_800D3670.s") +GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/osJamMesg.s") +GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/osPiGetCmdQueue.s") +GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/func_800D3820.s") +GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/_Putfld.s") +GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/_Printf.s") +GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/__osSetSR.s") +GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/__osGetSR.s") +GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/__osSetFpcCsr.s") +GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/__osSiRawReadIo.s") +GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/__osSiRawWriteIo.s") +GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/osWritebackDCache.s") +GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/osWritebackICache.s") +GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/osMapTLBRdb.s") +GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/osPiRawWriteIo.s") +GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/func_800D47F0.s") diff --git a/tools/python/score.py b/tools/python/score.py index e790095f..18435543 100644 --- a/tools/python/score.py +++ b/tools/python/score.py @@ -9,6 +9,7 @@ ASM_FOLDERS = [ './asm/unknown_070110', './asm/gzip', './lib/asm', + './lib/asm/exception', ] # These will automatically be added to the adventure one percentage. @@ -25,7 +26,7 @@ for folder in ASM_FOLDERS: SRC_DIRECTORY = './src' LIB_SRC_DIRECTORY = './lib/src' -FUNCTION_REGEX = r'([/][*]([^*]|([*][^/]))*[*][/][\n]\s*)?(void|s64|s32|s16|s8|u64|u32|u16|u8|f32|f64)(\s|[*])*([0-9A-Za-z_]+)\s*[(][^)]*[)]\s*{' +FUNCTION_REGEX = r'([/][*][*]([^*]|([*][^/]))*[*][/][\n]\s*)?(void|s64|s32|s16|s8|u64|u32|u16|u8|f32|f64)(\s|[*])*([0-9A-Za-z_]+)\s*[(][^)]*[)]\s*{' GLOBAL_ASM_REGEX = r'GLOBAL_ASM[(]".*(?=\/)\/([^.]+).s"[)]' WIP_REGEX = r'#if(.|\n)*?(GLOBAL_ASM[(]([^)]*)[)])(.|\n)*?#else(.|\n)*?#endif' @@ -35,23 +36,27 @@ CODE_SIZE = CODE_END - CODE_START class DkrMapFile: def __init__(self): - with open('./build/dkr.map', 'r') as mapFile: - self.functionSizes = {} - functions = [] - lines = mapFile.read().split('\n') - for line in lines: - if line.startswith(' 0x00000000'): - if '=' in line: - line = line[0:line.find('=')-1] - address = int(line[26:26+8], 16) - if address >= CODE_START and address < CODE_END: - symbol = line[line.rfind(' ')+1:] - functions.append((symbol, address)) - functions.sort(key=lambda x:x[1]) # Sort by RAM address - for i in range(0, len(functions) - 1): - self.functionSizes[functions[i][0]] = functions[i + 1][1] - functions[i][1] - self.functionSizes[functions[len(functions) - 1][0]] = CODE_END - 0x800D7570 - self.numFunctions = len(functions) + try: + with open('./build/dkr.map', 'r') as mapFile: + self.functionSizes = {} + functions = [] + lines = mapFile.read().split('\n') + for line in lines: + if line.startswith(' 0x00000000'): + if '=' in line: + line = line[0:line.find('=')-1] + address = int(line[26:26+8], 16) + if address >= CODE_START and address < CODE_END: + symbol = line[line.rfind(' ')+1:] + functions.append((symbol, address)) + functions.sort(key=lambda x:x[1]) # Sort by RAM address + for i in range(0, len(functions) - 1): + self.functionSizes[functions[i][0]] = functions[i + 1][1] - functions[i][1] + self.functionSizes[functions[len(functions) - 1][0]] = CODE_END - 0x800D7570 + self.numFunctions = len(functions) + except FileNotFoundError: + print("You must build a rom before it can be scored!") + sys.exit() MAP_FILE = DkrMapFile() From a3ddd79d5d8deab71bb082fa29974f96aaf0df46 Mon Sep 17 00:00:00 2001 From: David Benepe Date: Sat, 1 Aug 2020 07:57:32 -0500 Subject: [PATCH 2/6] Removed .vscode folder --- .gitignore | 5 ++++- .vscode/settings.json | 6 ------ 2 files changed, 4 insertions(+), 7 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.gitignore b/.gitignore index c6f6a240..627faee0 100755 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,7 @@ assets/ !asm/assets/ # Linker file is automatically generated, so it should be ignored -dkr.ld \ No newline at end of file +dkr.ld + +# Misc stuff that should be ignored. +.*/ diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 28df4e3d..00000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "files.associations": { - "macros.h": "c", - "libultra_internal.h": "c" - } -} \ No newline at end of file From ecbc60c0d558ac15414d424a81fa0a555b84cc53 Mon Sep 17 00:00:00 2001 From: Faschz Date: Sat, 1 Aug 2020 15:08:47 -0500 Subject: [PATCH 3/6] Decomp 2 functions in unknown_001050 func_800011E8 and func_80001228 --- .../unknown_001050/func_800011E8.s | 38 ------------------- src/unknown_001050.c | 21 +++++++++- 2 files changed, 19 insertions(+), 40 deletions(-) delete mode 100644 asm/non_matchings/unknown_001050/func_800011E8.s diff --git a/asm/non_matchings/unknown_001050/func_800011E8.s b/asm/non_matchings/unknown_001050/func_800011E8.s deleted file mode 100644 index 7f05bdaa..00000000 --- a/asm/non_matchings/unknown_001050/func_800011E8.s +++ /dev/null @@ -1,38 +0,0 @@ -glabel func_800011E8 -/* 001DE8 800011E8 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 001DEC 800011EC 308700FF */ andi $a3, $a0, 0xff -/* 001DF0 800011F0 28E10010 */ slti $at, $a3, 0x10 -/* 001DF4 800011F4 AFBF0014 */ sw $ra, 0x14($sp) -/* 001DF8 800011F8 AFA40018 */ sw $a0, 0x18($sp) -/* 001DFC 800011FC AFA5001C */ sw $a1, 0x1c($sp) -/* 001E00 80001200 10200005 */ beqz $at, .L80001218 -/* 001E04 80001204 30A600FF */ andi $a2, $a1, 0xff -/* 001E08 80001208 3C04800E */ lui $a0, %hi(D_800DC630) # $a0, 0x800e -/* 001E0C 8000120C 8C84C630 */ lw $a0, %lo(D_800DC630)($a0) -/* 001E10 80001210 0C031E50 */ jal func_800C7940 -/* 001E14 80001214 30E500FF */ andi $a1, $a3, 0xff -.L80001218: -/* 001E18 80001218 8FBF0014 */ lw $ra, 0x14($sp) -/* 001E1C 8000121C 27BD0018 */ addiu $sp, $sp, 0x18 -/* 001E20 80001220 03E00008 */ jr $ra -/* 001E24 80001224 00000000 */ nop - -/* 001E28 80001228 308500FF */ andi $a1, $a0, 0xff -/* 001E2C 8000122C 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 001E30 80001230 28A10010 */ slti $at, $a1, 0x10 -/* 001E34 80001234 AFBF0014 */ sw $ra, 0x14($sp) -/* 001E38 80001238 14200003 */ bnez $at, .L80001248 -/* 001E3C 8000123C AFA40018 */ sw $a0, 0x18($sp) -/* 001E40 80001240 10000005 */ b .L80001258 -/* 001E44 80001244 00001025 */ move $v0, $zero -.L80001248: -/* 001E48 80001248 3C04800E */ lui $a0, %hi(D_800DC630) # $a0, 0x800e -/* 001E4C 8000124C 8C84C630 */ lw $a0, %lo(D_800DC630)($a0) -/* 001E50 80001250 0C031E68 */ jal func_800C79A0 -/* 001E54 80001254 00000000 */ nop -.L80001258: -/* 001E58 80001258 8FBF0014 */ lw $ra, 0x14($sp) -/* 001E5C 8000125C 27BD0018 */ addiu $sp, $sp, 0x18 -/* 001E60 80001260 03E00008 */ jr $ra -/* 001E64 80001264 00000000 */ nop - diff --git a/src/unknown_001050.c b/src/unknown_001050.c index 0ea154b8..196ace28 100644 --- a/src/unknown_001050.c +++ b/src/unknown_001050.c @@ -35,7 +35,7 @@ extern u8 D_800DC670; /* Unknown size */ typedef struct unk80115CF8 { u8 pad0[2]; - s16 unk2; + s16 unk2; } unk80115CF8; extern unk80115CF8 *D_80115CF8; @@ -234,7 +234,24 @@ void func_800011A8(u8 arg0, u8 arg1) { } } -GLOBAL_ASM("asm/non_matchings/unknown_001050/func_800011E8.s") +void func_800C7940(unk800DC630*, u8 arg1, u8 arg2); + +void func_800011E8(u8 arg0, u8 arg1) { + if (arg0 < 0x10) { + func_800C7940(D_800DC630, arg0, arg1); + } +} + +s32 func_800C79A0(unk800DC630*, u8 arg1); + +/* Unused?*/ +s32 func_80001228(u8 arg0) { + if (arg0 >= 0x10) { + return 0; + } else { + return func_800C79A0(D_800DC630, arg0); + } +} s32 func_80063BA0(unk800DC630*, u8 arg1, u8 arg2); From 3fcdeebd894bc06d7d5b96cf5a1202000f0f619a Mon Sep 17 00:00:00 2001 From: David Benepe Date: Sun, 2 Aug 2020 10:12:41 -0500 Subject: [PATCH 4/6] Made ./generate_ld automatic, and moved some more asm libultra functions. --- Makefile | 4 ++++ lib/asm/__osGetSR.s | 16 ++++++++++++++++ lib/asm/__osSetFpcCsr.s | 15 +++++++++++++++ lib/asm/__osSetSR.s | 16 ++++++++++++++++ .../{non_matchings/unknown_0CA9A0 => }/bcopy.s | 10 ++++++++++ .../non_matchings/unknown_0CCF90/osInitialize.s | 2 +- lib/asm/non_matchings/unknown_0D4270/__osGetSR.s | 6 ------ .../non_matchings/unknown_0D4270/__osSetFpcCsr.s | 6 ------ lib/asm/non_matchings/unknown_0D4270/__osSetSR.s | 6 ------ .../__osSiRawReadIo.s | 0 .../__osSiRawWriteIo.s | 0 .../func_800D47F0.s | 0 .../osPiRawWriteIo.s | 0 .../osWritebackICache.s => osInvalICache.s} | 12 +++++++++++- .../unknown_0D4270 => }/osMapTLBRdb.s | 10 ++++++++++ .../unknown_0D4270 => }/osWritebackDCache.s | 11 +++++++++++ lib/src/unknown_0CA9A0.c | 3 +-- lib/src/unknown_0D4270.c | 10 ---------- lib/src/unknown_0D5190.c | 8 ++++++++ lib/src/unknown_0D5390.c | 8 ++++++++ 20 files changed, 111 insertions(+), 32 deletions(-) create mode 100644 lib/asm/__osGetSR.s create mode 100644 lib/asm/__osSetFpcCsr.s create mode 100644 lib/asm/__osSetSR.s rename lib/asm/{non_matchings/unknown_0CA9A0 => }/bcopy.s (97%) delete mode 100644 lib/asm/non_matchings/unknown_0D4270/__osGetSR.s delete mode 100644 lib/asm/non_matchings/unknown_0D4270/__osSetFpcCsr.s delete mode 100644 lib/asm/non_matchings/unknown_0D4270/__osSetSR.s rename lib/asm/non_matchings/{unknown_0D4270 => unknown_0D5190}/__osSiRawReadIo.s (100%) rename lib/asm/non_matchings/{unknown_0D4270 => unknown_0D5190}/__osSiRawWriteIo.s (100%) rename lib/asm/non_matchings/{unknown_0D4270 => unknown_0D5390}/func_800D47F0.s (100%) rename lib/asm/non_matchings/{unknown_0D4270 => unknown_0D5390}/osPiRawWriteIo.s (100%) rename lib/asm/{non_matchings/unknown_0D4270/osWritebackICache.s => osInvalICache.s} (84%) rename lib/asm/{non_matchings/unknown_0D4270 => }/osMapTLBRdb.s (78%) rename lib/asm/{non_matchings/unknown_0D4270 => }/osWritebackDCache.s (85%) create mode 100644 lib/src/unknown_0D5190.c create mode 100644 lib/src/unknown_0D5390.c diff --git a/Makefile b/Makefile index a71e0ccb..1a7ae5f3 100755 --- a/Makefile +++ b/Makefile @@ -10,6 +10,10 @@ ifeq ($(wildcard ./assets/.*),) $(error Error, /assets/ folder was not found. Did you run the ./setup.sh script?) endif +#################### Generate linker file #################### + +GENERATE_LD := $(shell ./generate_ld.sh) + ################ Target Executable and Sources ############### # BUILD_DIR is location where all build artifacts are placed diff --git a/lib/asm/__osGetSR.s b/lib/asm/__osGetSR.s new file mode 100644 index 00000000..9abea28b --- /dev/null +++ b/lib/asm/__osGetSR.s @@ -0,0 +1,16 @@ +/* The comment below is needed for this file to be picked up by generate_ld */ +/* RAM_POS: 0x800D4570 */ + +.include "globals.inc" +.include "macros.inc" + +.set noat # allow manual use of $at +.set noreorder # dont insert nops after branches +.set gp=64 # 64-bit instructions are used + +glabel __osGetSR +/* 0D5170 800D4570 40026000 */ mfc0 $v0, $12 +/* 0D5174 800D4574 03E00008 */ jr $ra +/* 0D5178 800D4578 00000000 */ nop + +/* 0D517C 800D457C 00000000 */ nop diff --git a/lib/asm/__osSetFpcCsr.s b/lib/asm/__osSetFpcCsr.s new file mode 100644 index 00000000..35101507 --- /dev/null +++ b/lib/asm/__osSetFpcCsr.s @@ -0,0 +1,15 @@ +/* The comment below is needed for this file to be picked up by generate_ld */ +/* RAM_POS: 0x800D4580 */ + +.include "globals.inc" +.include "macros.inc" + +.set noat # allow manual use of $at +.set noreorder # dont insert nops after branches +.set gp=64 # 64-bit instructions are used + +glabel __osSetFpcCsr +/* 0D5180 800D4580 4442F800 */ cfc1 $v0, $31 +/* 0D5184 800D4584 44C4F800 */ ctc1 $a0, $31 +/* 0D5188 800D4588 03E00008 */ jr $ra +/* 0D518C 800D458C 00000000 */ nop diff --git a/lib/asm/__osSetSR.s b/lib/asm/__osSetSR.s new file mode 100644 index 00000000..d252f9d4 --- /dev/null +++ b/lib/asm/__osSetSR.s @@ -0,0 +1,16 @@ +/* The comment below is needed for this file to be picked up by generate_ld */ +/* RAM_POS: 0x800D4560 */ + +.include "globals.inc" +.include "macros.inc" + +.set noat # allow manual use of $at +.set noreorder # dont insert nops after branches +.set gp=64 # 64-bit instructions are used + +glabel __osSetSR +/* 0D5160 800D4560 40846000 */ mtc0 $a0, $12 +/* 0D5164 800D4564 00000000 */ nop +/* 0D5168 800D4568 03E00008 */ jr $ra +/* 0D516C 800D456C 00000000 */ nop + diff --git a/lib/asm/non_matchings/unknown_0CA9A0/bcopy.s b/lib/asm/bcopy.s similarity index 97% rename from lib/asm/non_matchings/unknown_0CA9A0/bcopy.s rename to lib/asm/bcopy.s index 200f57d3..bfdd7f35 100644 --- a/lib/asm/non_matchings/unknown_0CA9A0/bcopy.s +++ b/lib/asm/bcopy.s @@ -1,3 +1,13 @@ +/* The comment below is needed for this file to be picked up by generate_ld */ +/* RAM_POS: 0x800C9DA0 */ + +.include "globals.inc" +.include "macros.inc" + +.set noat # allow manual use of $at +.set noreorder # dont insert nops after branches +.set gp=64 # 64-bit instructions are used + glabel bcopy /* 0CA9A0 800C9DA0 10C0001A */ beqz $a2, .L800C9E0C /* 0CA9A4 800C9DA4 00A03825 */ move $a3, $a1 diff --git a/lib/asm/non_matchings/unknown_0CCF90/osInitialize.s b/lib/asm/non_matchings/unknown_0CCF90/osInitialize.s index a383f465..1ce2eb20 100644 --- a/lib/asm/non_matchings/unknown_0CCF90/osInitialize.s +++ b/lib/asm/non_matchings/unknown_0CCF90/osInitialize.s @@ -97,7 +97,7 @@ glabel osInitialize /* 0CD30C 800CC70C 0C03518C */ jal osWritebackDCache /* 0CD310 800CC710 ADF8000C */ sw $t8, %lo(D_8000000C)($t7) /* 0CD314 800CC714 3C048000 */ lui $a0, 0x8000 -/* 0CD318 800CC718 0C0351AC */ jal osWritebackICache +/* 0CD318 800CC718 0C0351AC */ jal osInvalICache /* 0CD31C 800CC71C 24050190 */ li $a1, 400 /* 0CD320 800CC720 0C0351CC */ jal osMapTLBRdb /* 0CD324 800CC724 00000000 */ nop diff --git a/lib/asm/non_matchings/unknown_0D4270/__osGetSR.s b/lib/asm/non_matchings/unknown_0D4270/__osGetSR.s deleted file mode 100644 index a4af5c8d..00000000 --- a/lib/asm/non_matchings/unknown_0D4270/__osGetSR.s +++ /dev/null @@ -1,6 +0,0 @@ -glabel __osGetSR -/* 0D5170 800D4570 40026000 */ mfc0 $v0, $12 -/* 0D5174 800D4574 03E00008 */ jr $ra -/* 0D5178 800D4578 00000000 */ nop - -/* 0D517C 800D457C 00000000 */ nop diff --git a/lib/asm/non_matchings/unknown_0D4270/__osSetFpcCsr.s b/lib/asm/non_matchings/unknown_0D4270/__osSetFpcCsr.s deleted file mode 100644 index de5ca5f8..00000000 --- a/lib/asm/non_matchings/unknown_0D4270/__osSetFpcCsr.s +++ /dev/null @@ -1,6 +0,0 @@ -glabel __osSetFpcCsr -/* 0D5180 800D4580 4442F800 */ cfc1 $v0, $31 -/* 0D5184 800D4584 44C4F800 */ ctc1 $a0, $31 -/* 0D5188 800D4588 03E00008 */ jr $ra -/* 0D518C 800D458C 00000000 */ nop - diff --git a/lib/asm/non_matchings/unknown_0D4270/__osSetSR.s b/lib/asm/non_matchings/unknown_0D4270/__osSetSR.s deleted file mode 100644 index c610f369..00000000 --- a/lib/asm/non_matchings/unknown_0D4270/__osSetSR.s +++ /dev/null @@ -1,6 +0,0 @@ -glabel __osSetSR -/* 0D5160 800D4560 40846000 */ mtc0 $a0, $12 -/* 0D5164 800D4564 00000000 */ nop -/* 0D5168 800D4568 03E00008 */ jr $ra -/* 0D516C 800D456C 00000000 */ nop - diff --git a/lib/asm/non_matchings/unknown_0D4270/__osSiRawReadIo.s b/lib/asm/non_matchings/unknown_0D5190/__osSiRawReadIo.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D4270/__osSiRawReadIo.s rename to lib/asm/non_matchings/unknown_0D5190/__osSiRawReadIo.s diff --git a/lib/asm/non_matchings/unknown_0D4270/__osSiRawWriteIo.s b/lib/asm/non_matchings/unknown_0D5190/__osSiRawWriteIo.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D4270/__osSiRawWriteIo.s rename to lib/asm/non_matchings/unknown_0D5190/__osSiRawWriteIo.s diff --git a/lib/asm/non_matchings/unknown_0D4270/func_800D47F0.s b/lib/asm/non_matchings/unknown_0D5390/func_800D47F0.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D4270/func_800D47F0.s rename to lib/asm/non_matchings/unknown_0D5390/func_800D47F0.s diff --git a/lib/asm/non_matchings/unknown_0D4270/osPiRawWriteIo.s b/lib/asm/non_matchings/unknown_0D5390/osPiRawWriteIo.s similarity index 100% rename from lib/asm/non_matchings/unknown_0D4270/osPiRawWriteIo.s rename to lib/asm/non_matchings/unknown_0D5390/osPiRawWriteIo.s diff --git a/lib/asm/non_matchings/unknown_0D4270/osWritebackICache.s b/lib/asm/osInvalICache.s similarity index 84% rename from lib/asm/non_matchings/unknown_0D4270/osWritebackICache.s rename to lib/asm/osInvalICache.s index fc8e035c..dec7d2dd 100644 --- a/lib/asm/non_matchings/unknown_0D4270/osWritebackICache.s +++ b/lib/asm/osInvalICache.s @@ -1,4 +1,14 @@ -glabel osWritebackICache +/* The comment below is needed for this file to be picked up by generate_ld */ +/* RAM_POS: 0x800D46B0 */ + +.include "globals.inc" +.include "macros.inc" + +.set noat # allow manual use of $at +.set noreorder # dont insert nops after branches +.set gp=64 # 64-bit instructions are used + +glabel osInvalICache /* 0D52B0 800D46B0 18A00011 */ blez $a1, .L800D46F8 /* 0D52B4 800D46B4 00000000 */ nop /* 0D52B8 800D46B8 240B4000 */ li $t3, 16384 diff --git a/lib/asm/non_matchings/unknown_0D4270/osMapTLBRdb.s b/lib/asm/osMapTLBRdb.s similarity index 78% rename from lib/asm/non_matchings/unknown_0D4270/osMapTLBRdb.s rename to lib/asm/osMapTLBRdb.s index fef03659..14874513 100644 --- a/lib/asm/non_matchings/unknown_0D4270/osMapTLBRdb.s +++ b/lib/asm/osMapTLBRdb.s @@ -1,3 +1,13 @@ +/* The comment below is needed for this file to be picked up by generate_ld */ +/* RAM_POS: 0x800D4730 */ + +.include "globals.inc" +.include "macros.inc" + +.set noat # allow manual use of $at +.set noreorder # dont insert nops after branches +.set gp=64 # 64-bit instructions are used + glabel osMapTLBRdb /* 0D5330 800D4730 40085000 */ mfc0 $t0, $10 /* 0D5334 800D4734 2409001F */ li $t1, 31 diff --git a/lib/asm/non_matchings/unknown_0D4270/osWritebackDCache.s b/lib/asm/osWritebackDCache.s similarity index 85% rename from lib/asm/non_matchings/unknown_0D4270/osWritebackDCache.s rename to lib/asm/osWritebackDCache.s index 832979a4..db6ff14f 100644 --- a/lib/asm/non_matchings/unknown_0D4270/osWritebackDCache.s +++ b/lib/asm/osWritebackDCache.s @@ -1,3 +1,14 @@ +/* The comment below is needed for this file to be picked up by generate_ld */ +/* RAM_POS: 0x800D4630 */ + +.include "globals.inc" +.include "macros.inc" + +.set noat # allow manual use of $at +.set noreorder # dont insert nops after branches +.set gp=64 # 64-bit instructions are used + + glabel osWritebackDCache /* 0D5230 800D4630 18A00011 */ blez $a1, .L800D4678 /* 0D5234 800D4634 00000000 */ nop diff --git a/lib/src/unknown_0CA9A0.c b/lib/src/unknown_0CA9A0.c index 81d89f83..4cbd9eec 100644 --- a/lib/src/unknown_0CA9A0.c +++ b/lib/src/unknown_0CA9A0.c @@ -1,10 +1,9 @@ /* The comment below is needed for this file to be picked up by generate_ld */ -/* RAM_POS: 0x800C9DA0 */ +/* RAM_POS: 0x800CA0B0 */ #include "types.h" #include "macros.h" -GLOBAL_ASM("lib/asm/non_matchings/unknown_0CA9A0/bcopy.s") GLOBAL_ASM("lib/asm/non_matchings/unknown_0CA9A0/func_800CA0B0.s") GLOBAL_ASM("lib/asm/non_matchings/unknown_0CA9A0/D_800CA0D0.s") GLOBAL_ASM("lib/asm/non_matchings/unknown_0CA9A0/D_800CAA7C.s") diff --git a/lib/src/unknown_0D4270.c b/lib/src/unknown_0D4270.c index e9e75c2f..f9d02b98 100644 --- a/lib/src/unknown_0D4270.c +++ b/lib/src/unknown_0D4270.c @@ -10,13 +10,3 @@ GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/osPiGetCmdQueue.s") GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/func_800D3820.s") GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/_Putfld.s") GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/_Printf.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/__osSetSR.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/__osGetSR.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/__osSetFpcCsr.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/__osSiRawReadIo.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/__osSiRawWriteIo.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/osWritebackDCache.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/osWritebackICache.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/osMapTLBRdb.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/osPiRawWriteIo.s") -GLOBAL_ASM("lib/asm/non_matchings/unknown_0D4270/func_800D47F0.s") diff --git a/lib/src/unknown_0D5190.c b/lib/src/unknown_0D5190.c new file mode 100644 index 00000000..36dca54f --- /dev/null +++ b/lib/src/unknown_0D5190.c @@ -0,0 +1,8 @@ +/* The comment below is needed for this file to be picked up by generate_ld */ +/* RAM_POS: 0x800D4590 */ + +#include "types.h" +#include "macros.h" + +GLOBAL_ASM("lib/asm/non_matchings/unknown_0D5190/__osSiRawReadIo.s") +GLOBAL_ASM("lib/asm/non_matchings/unknown_0D5190/__osSiRawWriteIo.s") diff --git a/lib/src/unknown_0D5390.c b/lib/src/unknown_0D5390.c new file mode 100644 index 00000000..3ec756cd --- /dev/null +++ b/lib/src/unknown_0D5390.c @@ -0,0 +1,8 @@ +/* The comment below is needed for this file to be picked up by generate_ld */ +/* RAM_POS: 0x800D4790 */ + +#include "types.h" +#include "macros.h" + +GLOBAL_ASM("lib/asm/non_matchings/unknown_0D5390/osPiRawWriteIo.s") +GLOBAL_ASM("lib/asm/non_matchings/unknown_0D5390/func_800D47F0.s") From c90cc43c8eda35a088c2b85e6e1e6ff63d8a5fc1 Mon Sep 17 00:00:00 2001 From: Faschz Date: Sun, 2 Aug 2020 18:27:23 -0500 Subject: [PATCH 5/6] Decomp 7 functions in unknown_064830 D_80063F94, func_80064E54, func_80064EF8, func_80064F9C, func_80065024, func_80065084, and func_800650E4 --- asm/non_matchings/unknown_064830/D_80063F94.s | 9 - .../unknown_064830/func_80064E54.s | 43 ----- .../unknown_064830/func_80064EF8.s | 43 ----- .../unknown_064830/func_80064F9C.s | 36 ---- .../unknown_064830/func_80065024.s | 26 --- .../unknown_064830/func_80065084.s | 26 --- .../unknown_064830/func_800650E4.s | 22 --- src/unknown_064830.c | 160 +++++++++++++++++- 8 files changed, 153 insertions(+), 212 deletions(-) delete mode 100644 asm/non_matchings/unknown_064830/D_80063F94.s delete mode 100644 asm/non_matchings/unknown_064830/func_80064E54.s delete mode 100644 asm/non_matchings/unknown_064830/func_80064EF8.s delete mode 100644 asm/non_matchings/unknown_064830/func_80064F9C.s delete mode 100644 asm/non_matchings/unknown_064830/func_80065024.s delete mode 100644 asm/non_matchings/unknown_064830/func_80065084.s delete mode 100644 asm/non_matchings/unknown_064830/func_800650E4.s diff --git a/asm/non_matchings/unknown_064830/D_80063F94.s b/asm/non_matchings/unknown_064830/D_80063F94.s deleted file mode 100644 index 81ddf604..00000000 --- a/asm/non_matchings/unknown_064830/D_80063F94.s +++ /dev/null @@ -1,9 +0,0 @@ -glabel D_80063F94 -/* 064B94 80063F94 24010001 */ li $at, 1 -/* 064B98 80063F98 14A10002 */ bne $a1, $at, .L80063FA4 -/* 064B9C 80063F9C 00000000 */ nop -/* 064BA0 80063FA0 AC860000 */ sw $a2, ($a0) -.L80063FA4: -/* 064BA4 80063FA4 03E00008 */ jr $ra -/* 064BA8 80063FA8 00001025 */ move $v0, $zero - diff --git a/asm/non_matchings/unknown_064830/func_80064E54.s b/asm/non_matchings/unknown_064830/func_80064E54.s deleted file mode 100644 index bfea6b4e..00000000 --- a/asm/non_matchings/unknown_064830/func_80064E54.s +++ /dev/null @@ -1,43 +0,0 @@ -glabel func_80064E54 -/* 065A54 80064E54 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 065A58 80064E58 AFA5002C */ sw $a1, 0x2c($sp) -/* 065A5C 80064E5C AFBF0024 */ sw $ra, 0x24($sp) -/* 065A60 80064E60 AFB00020 */ sw $s0, 0x20($sp) -/* 065A64 80064E64 3C05800D */ lui $a1, %hi(D_800CA0D0) # $a1, 0x800d -/* 065A68 80064E68 3C06800D */ lui $a2, %hi(D_800CAA7C) # $a2, 0x800d -/* 065A6C 80064E6C 00808025 */ move $s0, $a0 -/* 065A70 80064E70 24C6AA7C */ addiu $a2, %lo(D_800CAA7C) # addiu $a2, $a2, -0x5584 -/* 065A74 80064E74 24A5A0D0 */ addiu $a1, %lo(D_800CA0D0) # addiu $a1, $a1, -0x5f30 -/* 065A78 80064E78 0C03282C */ jal func_800CA0B0 -/* 065A7C 80064E7C 24070004 */ li $a3, 4 -/* 065A80 80064E80 8FA6002C */ lw $a2, 0x2c($sp) -/* 065A84 80064E84 240E0050 */ li $t6, 80 -/* 065A88 80064E88 AFAE0010 */ sw $t6, 0x10($sp) -/* 065A8C 80064E8C 00002025 */ move $a0, $zero -/* 065A90 80064E90 00002825 */ move $a1, $zero -/* 065A94 80064E94 0C031DFC */ jal func_800C77F0 -/* 065A98 80064E98 24070001 */ li $a3, 1 -/* 065A9C 80064E9C 24030001 */ li $v1, 1 -/* 065AA0 80064EA0 AE020014 */ sw $v0, 0x14($s0) -/* 065AA4 80064EA4 AE030038 */ sw $v1, 0x38($s0) -/* 065AA8 80064EA8 AE000048 */ sw $zero, 0x48($s0) -/* 065AAC 80064EAC A603001A */ sh $v1, 0x1a($s0) -/* 065AB0 80064EB0 A6030028 */ sh $v1, 0x28($s0) -/* 065AB4 80064EB4 A603002E */ sh $v1, 0x2e($s0) -/* 065AB8 80064EB8 A603001C */ sh $v1, 0x1c($s0) -/* 065ABC 80064EBC A603001E */ sh $v1, 0x1e($s0) -/* 065AC0 80064EC0 A6000020 */ sh $zero, 0x20($s0) -/* 065AC4 80064EC4 A6000022 */ sh $zero, 0x22($s0) -/* 065AC8 80064EC8 A6030026 */ sh $v1, 0x26($s0) -/* 065ACC 80064ECC A6000024 */ sh $zero, 0x24($s0) -/* 065AD0 80064ED0 AE000030 */ sw $zero, 0x30($s0) -/* 065AD4 80064ED4 AE000034 */ sw $zero, 0x34($s0) -/* 065AD8 80064ED8 A6000018 */ sh $zero, 0x18($s0) -/* 065ADC 80064EDC AE00003C */ sw $zero, 0x3c($s0) -/* 065AE0 80064EE0 AE000040 */ sw $zero, 0x40($s0) -/* 065AE4 80064EE4 AE000044 */ sw $zero, 0x44($s0) -/* 065AE8 80064EE8 8FBF0024 */ lw $ra, 0x24($sp) -/* 065AEC 80064EEC 8FB00020 */ lw $s0, 0x20($sp) -/* 065AF0 80064EF0 03E00008 */ jr $ra -/* 065AF4 80064EF4 27BD0028 */ addiu $sp, $sp, 0x28 - diff --git a/asm/non_matchings/unknown_064830/func_80064EF8.s b/asm/non_matchings/unknown_064830/func_80064EF8.s deleted file mode 100644 index 8a5d69c9..00000000 --- a/asm/non_matchings/unknown_064830/func_80064EF8.s +++ /dev/null @@ -1,43 +0,0 @@ -glabel func_80064EF8 -/* 065AF8 80064EF8 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 065AFC 80064EFC AFA5002C */ sw $a1, 0x2c($sp) -/* 065B00 80064F00 AFA60030 */ sw $a2, 0x30($sp) -/* 065B04 80064F04 AFBF0024 */ sw $ra, 0x24($sp) -/* 065B08 80064F08 AFB00020 */ sw $s0, 0x20($sp) -/* 065B0C 80064F0C 3C06800D */ lui $a2, %hi(D_800CB540) # $a2, 0x800d -/* 065B10 80064F10 3C05800D */ lui $a1, %hi(D_800CBBEC) # $a1, 0x800d -/* 065B14 80064F14 00808025 */ move $s0, $a0 -/* 065B18 80064F18 24A5BBEC */ addiu $a1, %lo(D_800CBBEC) # addiu $a1, $a1, -0x4414 -/* 065B1C 80064F1C 24C6B540 */ addiu $a2, %lo(D_800CB540) # addiu $a2, $a2, -0x4ac0 -/* 065B20 80064F20 0C03282C */ jal func_800CA0B0 -/* 065B24 80064F24 00003825 */ move $a3, $zero -/* 065B28 80064F28 8FA60030 */ lw $a2, 0x30($sp) -/* 065B2C 80064F2C 240E0020 */ li $t6, 32 -/* 065B30 80064F30 AFAE0010 */ sw $t6, 0x10($sp) -/* 065B34 80064F34 00002025 */ move $a0, $zero -/* 065B38 80064F38 00002825 */ move $a1, $zero -/* 065B3C 80064F3C 0C031DFC */ jal func_800C77F0 -/* 065B40 80064F40 24070001 */ li $a3, 1 -/* 065B44 80064F44 AE020014 */ sw $v0, 0x14($s0) -/* 065B48 80064F48 8FA60030 */ lw $a2, 0x30($sp) -/* 065B4C 80064F4C 240F0020 */ li $t7, 32 -/* 065B50 80064F50 AFAF0010 */ sw $t7, 0x10($sp) -/* 065B54 80064F54 00002025 */ move $a0, $zero -/* 065B58 80064F58 00002825 */ move $a1, $zero -/* 065B5C 80064F5C 0C031DFC */ jal func_800C77F0 -/* 065B60 80064F60 24070001 */ li $a3, 1 -/* 065B64 80064F64 AE020018 */ sw $v0, 0x18($s0) -/* 065B68 80064F68 8FB9002C */ lw $t9, 0x2c($sp) -/* 065B6C 80064F6C 26040034 */ addiu $a0, $s0, 0x34 -/* 065B70 80064F70 0320F809 */ jalr $t9 -/* 065B74 80064F74 00000000 */ nop -/* 065B78 80064F78 24180001 */ li $t8, 1 -/* 065B7C 80064F7C AE020030 */ sw $v0, 0x30($s0) -/* 065B80 80064F80 AE00003C */ sw $zero, 0x3c($s0) -/* 065B84 80064F84 AE180040 */ sw $t8, 0x40($s0) -/* 065B88 80064F88 AE000044 */ sw $zero, 0x44($s0) -/* 065B8C 80064F8C 8FBF0024 */ lw $ra, 0x24($sp) -/* 065B90 80064F90 8FB00020 */ lw $s0, 0x20($sp) -/* 065B94 80064F94 03E00008 */ jr $ra -/* 065B98 80064F98 27BD0028 */ addiu $sp, $sp, 0x28 - diff --git a/asm/non_matchings/unknown_064830/func_80064F9C.s b/asm/non_matchings/unknown_064830/func_80064F9C.s deleted file mode 100644 index 35c6d613..00000000 --- a/asm/non_matchings/unknown_064830/func_80064F9C.s +++ /dev/null @@ -1,36 +0,0 @@ -glabel func_80064F9C -/* 065B9C 80064F9C 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 065BA0 80064FA0 AFA5002C */ sw $a1, 0x2c($sp) -/* 065BA4 80064FA4 AFBF0024 */ sw $ra, 0x24($sp) -/* 065BA8 80064FA8 AFB00020 */ sw $s0, 0x20($sp) -/* 065BAC 80064FAC 3C05800D */ lui $a1, %hi(D_800CC17C) # $a1, 0x800d -/* 065BB0 80064FB0 3C06800D */ lui $a2, %hi(D_800CC090) # $a2, 0x800d -/* 065BB4 80064FB4 00808025 */ move $s0, $a0 -/* 065BB8 80064FB8 24C6C090 */ addiu $a2, %lo(D_800CC090) # addiu $a2, $a2, -0x3f70 -/* 065BBC 80064FBC 24A5C17C */ addiu $a1, %lo(D_800CC17C) # addiu $a1, $a1, -0x3e84 -/* 065BC0 80064FC0 0C03282C */ jal func_800CA0B0 -/* 065BC4 80064FC4 24070001 */ li $a3, 1 -/* 065BC8 80064FC8 8FA6002C */ lw $a2, 0x2c($sp) -/* 065BCC 80064FCC 240E0020 */ li $t6, 32 -/* 065BD0 80064FD0 AFAE0010 */ sw $t6, 0x10($sp) -/* 065BD4 80064FD4 00002025 */ move $a0, $zero -/* 065BD8 80064FD8 00002825 */ move $a1, $zero -/* 065BDC 80064FDC 0C031DFC */ jal func_800C77F0 -/* 065BE0 80064FE0 24070001 */ li $a3, 1 -/* 065BE4 80064FE4 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 065BE8 80064FE8 44802000 */ mtc1 $zero, $f4 -/* 065BEC 80064FEC 44813000 */ mtc1 $at, $f6 -/* 065BF0 80064FF0 240F0001 */ li $t7, 1 -/* 065BF4 80064FF4 AE020014 */ sw $v0, 0x14($s0) -/* 065BF8 80064FF8 AE0F0024 */ sw $t7, 0x24($s0) -/* 065BFC 80064FFC AE000030 */ sw $zero, 0x30($s0) -/* 065C00 80065000 AE00001C */ sw $zero, 0x1c($s0) -/* 065C04 80065004 AE000028 */ sw $zero, 0x28($s0) -/* 065C08 80065008 AE00002C */ sw $zero, 0x2c($s0) -/* 065C0C 8006500C E6040020 */ swc1 $f4, 0x20($s0) -/* 065C10 80065010 E6060018 */ swc1 $f6, 0x18($s0) -/* 065C14 80065014 8FBF0024 */ lw $ra, 0x24($sp) -/* 065C18 80065018 8FB00020 */ lw $s0, 0x20($sp) -/* 065C1C 8006501C 03E00008 */ jr $ra -/* 065C20 80065020 27BD0028 */ addiu $sp, $sp, 0x28 - diff --git a/asm/non_matchings/unknown_064830/func_80065024.s b/asm/non_matchings/unknown_064830/func_80065024.s deleted file mode 100644 index 5f0685f2..00000000 --- a/asm/non_matchings/unknown_064830/func_80065024.s +++ /dev/null @@ -1,26 +0,0 @@ -glabel func_80065024 -/* 065C24 80065024 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 065C28 80065028 AFA5001C */ sw $a1, 0x1c($sp) -/* 065C2C 8006502C AFA60020 */ sw $a2, 0x20($sp) -/* 065C30 80065030 AFBF0014 */ sw $ra, 0x14($sp) -/* 065C34 80065034 3C068006 */ lui $a2, %hi(D_800659D4) # $a2, 0x8006 -/* 065C38 80065038 3C058006 */ lui $a1, %hi(D_80065900) # $a1, 0x8006 -/* 065C3C 8006503C 24A55900 */ addiu $a1, %lo(D_80065900) # addiu $a1, $a1, 0x5900 -/* 065C40 80065040 24C659D4 */ addiu $a2, %lo(D_800659D4) # addiu $a2, $a2, 0x59d4 -/* 065C44 80065044 AFA40018 */ sw $a0, 0x18($sp) -/* 065C48 80065048 0C03282C */ jal func_800CA0B0 -/* 065C4C 8006504C 24070006 */ li $a3, 6 -/* 065C50 80065050 8FA40018 */ lw $a0, 0x18($sp) -/* 065C54 80065054 00000000 */ nop -/* 065C58 80065058 AC800014 */ sw $zero, 0x14($a0) -/* 065C5C 8006505C 8FAE0020 */ lw $t6, 0x20($sp) -/* 065C60 80065060 00000000 */ nop -/* 065C64 80065064 AC8E0018 */ sw $t6, 0x18($a0) -/* 065C68 80065068 8FAF001C */ lw $t7, 0x1c($sp) -/* 065C6C 8006506C 00000000 */ nop -/* 065C70 80065070 AC8F001C */ sw $t7, 0x1c($a0) -/* 065C74 80065074 8FBF0014 */ lw $ra, 0x14($sp) -/* 065C78 80065078 27BD0018 */ addiu $sp, $sp, 0x18 -/* 065C7C 8006507C 03E00008 */ jr $ra -/* 065C80 80065080 00000000 */ nop - diff --git a/asm/non_matchings/unknown_064830/func_80065084.s b/asm/non_matchings/unknown_064830/func_80065084.s deleted file mode 100644 index 8f6f3813..00000000 --- a/asm/non_matchings/unknown_064830/func_80065084.s +++ /dev/null @@ -1,26 +0,0 @@ -glabel func_80065084 -/* 065C84 80065084 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 065C88 80065088 AFA5001C */ sw $a1, 0x1c($sp) -/* 065C8C 8006508C AFA60020 */ sw $a2, 0x20($sp) -/* 065C90 80065090 AFBF0014 */ sw $ra, 0x14($sp) -/* 065C94 80065094 3C06800D */ lui $a2, %hi(D_800CC390) # $a2, 0x800d -/* 065C98 80065098 3C05800D */ lui $a1, %hi(D_800CC3C0) # $a1, 0x800d -/* 065C9C 8006509C 24A5C3C0 */ addiu $a1, %lo(D_800CC3C0) # addiu $a1, $a1, -0x3c40 -/* 065CA0 800650A0 24C6C390 */ addiu $a2, %lo(D_800CC390) # addiu $a2, $a2, -0x3c70 -/* 065CA4 800650A4 AFA40018 */ sw $a0, 0x18($sp) -/* 065CA8 800650A8 0C03282C */ jal func_800CA0B0 -/* 065CAC 800650AC 24070007 */ li $a3, 7 -/* 065CB0 800650B0 8FA40018 */ lw $a0, 0x18($sp) -/* 065CB4 800650B4 00000000 */ nop -/* 065CB8 800650B8 AC800014 */ sw $zero, 0x14($a0) -/* 065CBC 800650BC 8FAE0020 */ lw $t6, 0x20($sp) -/* 065CC0 800650C0 00000000 */ nop -/* 065CC4 800650C4 AC8E0018 */ sw $t6, 0x18($a0) -/* 065CC8 800650C8 8FAF001C */ lw $t7, 0x1c($sp) -/* 065CCC 800650CC 00000000 */ nop -/* 065CD0 800650D0 AC8F001C */ sw $t7, 0x1c($a0) -/* 065CD4 800650D4 8FBF0014 */ lw $ra, 0x14($sp) -/* 065CD8 800650D8 27BD0018 */ addiu $sp, $sp, 0x18 -/* 065CDC 800650DC 03E00008 */ jr $ra -/* 065CE0 800650E0 00000000 */ nop - diff --git a/asm/non_matchings/unknown_064830/func_800650E4.s b/asm/non_matchings/unknown_064830/func_800650E4.s deleted file mode 100644 index df6e7839..00000000 --- a/asm/non_matchings/unknown_064830/func_800650E4.s +++ /dev/null @@ -1,22 +0,0 @@ -glabel func_800650E4 -/* 065CE4 800650E4 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 065CE8 800650E8 AFBF0014 */ sw $ra, 0x14($sp) -/* 065CEC 800650EC 3C05800D */ lui $a1, %hi(D_800CC514) # $a1, 0x800d -/* 065CF0 800650F0 3C06800D */ lui $a2, %hi(D_800CC4E0) # $a2, 0x800d -/* 065CF4 800650F4 24C6C4E0 */ addiu $a2, %lo(D_800CC4E0) # addiu $a2, $a2, -0x3b20 -/* 065CF8 800650F8 24A5C514 */ addiu $a1, %lo(D_800CC514) # addiu $a1, $a1, -0x3aec -/* 065CFC 800650FC AFA40018 */ sw $a0, 0x18($sp) -/* 065D00 80065100 0C03282C */ jal func_800CA0B0 -/* 065D04 80065104 24070003 */ li $a3, 3 -/* 065D08 80065108 8FA40018 */ lw $a0, 0x18($sp) -/* 065D0C 8006510C 240E0001 */ li $t6, 1 -/* 065D10 80065110 AC800014 */ sw $zero, 0x14($a0) -/* 065D14 80065114 AC8E0018 */ sw $t6, 0x18($a0) -/* 065D18 80065118 8FBF0014 */ lw $ra, 0x14($sp) -/* 065D1C 8006511C 27BD0018 */ addiu $sp, $sp, 0x18 -/* 065D20 80065120 03E00008 */ jr $ra -/* 065D24 80065124 00000000 */ nop - -/* 065D28 80065128 00000000 */ nop -/* 065D2C 8006512C 00000000 */ nop - diff --git a/src/unknown_064830.c b/src/unknown_064830.c index c0e606b2..8f7be2d9 100644 --- a/src/unknown_064830.c +++ b/src/unknown_064830.c @@ -4,8 +4,28 @@ #include "types.h" #include "macros.h" +extern s32 D_80065900; +extern s32 D_800659D4; +extern s32 D_800CA0D0; +extern s32 D_800CAA7C; +extern s32 D_800CB540; +extern s32 D_800CBBEC; +extern s32 D_800CC090; +extern s32 D_800CC17C; +extern s32 D_800CC390; +extern s32 D_800CC3C0; +extern s32 D_800CC4E0; +extern s32 D_800CC514; + GLOBAL_ASM("asm/non_matchings/unknown_064830/D_80063C30.s") -GLOBAL_ASM("asm/non_matchings/unknown_064830/D_80063F94.s") + +s32 D_80063F94(s32* arg0, s32 arg1, s32 arg2) { + if (arg1 == 1) { + *arg0 = arg2; + } + return 0; +} + GLOBAL_ASM("asm/non_matchings/unknown_064830/D_80063FAC.s") GLOBAL_ASM("asm/non_matchings/unknown_064830/func_80064224.s") GLOBAL_ASM("asm/non_matchings/unknown_064830/func_800644A0.s") @@ -15,9 +35,135 @@ GLOBAL_ASM("asm/non_matchings/unknown_064830/func_80064884.s") GLOBAL_ASM("asm/non_matchings/unknown_064830/func_8006492C.s") GLOBAL_ASM("asm/non_matchings/unknown_064830/func_80064950.s") GLOBAL_ASM("asm/non_matchings/unknown_064830/func_80064A08.s") -GLOBAL_ASM("asm/non_matchings/unknown_064830/func_80064E54.s") -GLOBAL_ASM("asm/non_matchings/unknown_064830/func_80064EF8.s") -GLOBAL_ASM("asm/non_matchings/unknown_064830/func_80064F9C.s") -GLOBAL_ASM("asm/non_matchings/unknown_064830/func_80065024.s") -GLOBAL_ASM("asm/non_matchings/unknown_064830/func_80065084.s") -GLOBAL_ASM("asm/non_matchings/unknown_064830/func_800650E4.s") + +typedef struct unk80064E54 { + u8 unk00[0x14]; // unknown + s32 unk14; + s16 unk18; + s16 unk1A; + s16 unk1C; + s16 unk1E; + s16 unk20; + s16 unk22; + s16 unk24; + s16 unk26; + s16 unk28; + u8 unk2A[0x04]; // unknown + s16 unk2E; + s32 unk30; + s32 unk34; + s32 unk38; + s32 unk3C; + s32 unk40; + s32 unk44; + s32 unk48; +} unk80064E54; + +void func_80064E54(unk80064E54* arg0, s32 arg1) { + func_800CA0B0(arg0, &D_800CA0D0, &D_800CAA7C, 4); + arg0->unk14 = func_800C77F0(0, 0, arg1, 1, 0x50); + arg0->unk38 = 1; + arg0->unk48 = 0; + arg0->unk1A = 1; + arg0->unk28 = 1; + arg0->unk2E = 1; + arg0->unk1C = 1; + arg0->unk1E = 1; + arg0->unk20 = 0; + arg0->unk22 = 0; + arg0->unk26 = 1; + arg0->unk24 = 0; + arg0->unk30 = 0; + arg0->unk34 = 0; + arg0->unk18 = 0; + arg0->unk3C = 0; + arg0->unk40 = 0; + arg0->unk44 = 0; +} + +typedef struct unk80064EF8 { + u8 unk00[0x14]; // unknown + s32 unk14; + s32 unk18; + u8 unk1C[0x14]; // unknown + s32 unk30; + s32 unk34; + u8 unk38[0x04]; // unknown + s32 unk3C; + s32 unk40; + s32 unk44; +} unk80064EF8; + +void func_80064EF8(unk80064EF8* arg0, s32 (*arg1)(s32*), s32 arg2) { + func_800CA0B0(arg0, &D_800CBBEC, &D_800CB540, 0); + arg0->unk14 = func_800C77F0(0, 0, arg2, 1, 0x20); + arg0->unk18 = func_800C77F0(0, 0, arg2, 1, 0x20); + arg0->unk30 = arg1(&arg0->unk34); + arg0->unk3C = 0; + arg0->unk40 = 1; + arg0->unk44 = 0; +} + +typedef struct unk80064F9C { + u8 unk00[0x14]; // unknown + s32 unk14; + f32 unk18; + s32 unk1C; + f32 unk20; + s32 unk24; + s32 unk28; + s32 unk2C; + s32 unk30; +} unk80064F9C; + +void func_80064F9C(unk80064F9C* arg0, s32 arg1) { + func_800CA0B0(arg0, &D_800CC17C, &D_800CC090, 1); + arg0->unk14 = func_800C77F0(0, 0, arg1, 1, 0x20); + arg0->unk24 = 1; + arg0->unk30 = 0; + arg0->unk1C = 0; + arg0->unk28 = 0; + arg0->unk2C = 0; + arg0->unk20 = 0.0f; + arg0->unk18 = 1.0f; +} + +typedef struct unk80065024 { + u8 unk00[0x14]; // unknown + s32 unk14; + s32 unk18; + s32 unk1C; +} unk80065024; + +void func_80065024(unk80065024* arg0, s32 arg1, s32 arg2) { + func_800CA0B0(arg0, &D_80065900, &D_800659D4, 6); + arg0->unk14 = 0; + arg0->unk18 = arg2; + arg0->unk1C = arg1; +} + +typedef struct unk80065084 { + u8 unk00[0x14]; // unknown + s32 unk14; + s32 unk18; + s32 unk1C; +} unk80065084; + +void func_80065084(unk80065084* arg0, s32 arg1, s32 arg2) { + func_800CA0B0(arg0, &D_800CC3C0, &D_800CC390, 7); + arg0->unk14 = 0; + arg0->unk18 = arg2; + arg0->unk1C = arg1; +} + +typedef struct unk800650E4 { + u8 unk00[0x14]; // unknown + s32 unk14; + s32 unk18; +} unk800650E4; + +void func_800650E4(unk800650E4* arg0) { + func_800CA0B0(arg0, &D_800CC514, &D_800CC4E0, 3); + arg0->unk14 = 0; + arg0->unk18 = 1; +} From d92e5af46bbbe70f4bf7b430a27b5ab2d4800f07 Mon Sep 17 00:00:00 2001 From: Faschz Date: Sun, 2 Aug 2020 20:02:03 -0500 Subject: [PATCH 6/6] Decomp 5 functions in unknown_072E50 func_80072708, func_80073C4C, func_80073C54, func_80075AEC, and func_80076164 --- .../unknown_072E50/func_80072708.s | 6 -- .../unknown_072E50/func_80073C4C.s | 4 -- .../unknown_072E50/func_80073C54.s | 4 -- .../unknown_072E50/func_80075AEC.s | 13 ---- .../unknown_072E50/func_80076164.s | 15 ----- src/unknown_072E50.c | 67 +++++++++++++++++-- 6 files changed, 62 insertions(+), 47 deletions(-) delete mode 100644 asm/non_matchings/unknown_072E50/func_80072708.s delete mode 100644 asm/non_matchings/unknown_072E50/func_80073C4C.s delete mode 100644 asm/non_matchings/unknown_072E50/func_80073C54.s delete mode 100644 asm/non_matchings/unknown_072E50/func_80075AEC.s delete mode 100644 asm/non_matchings/unknown_072E50/func_80076164.s diff --git a/asm/non_matchings/unknown_072E50/func_80072708.s b/asm/non_matchings/unknown_072E50/func_80072708.s deleted file mode 100644 index 4dbbcd4d..00000000 --- a/asm/non_matchings/unknown_072E50/func_80072708.s +++ /dev/null @@ -1,6 +0,0 @@ -glabel func_80072708 -/* 073308 80072708 240E0003 */ li $t6, 3 -/* 07330C 8007270C 3C01800E */ lui $at, 0x800e -/* 073310 80072710 03E00008 */ jr $ra -/* 073314 80072714 AC2EE48C */ sw $t6, -0x1b74($at) - diff --git a/asm/non_matchings/unknown_072E50/func_80073C4C.s b/asm/non_matchings/unknown_072E50/func_80073C4C.s deleted file mode 100644 index c83da225..00000000 --- a/asm/non_matchings/unknown_072E50/func_80073C4C.s +++ /dev/null @@ -1,4 +0,0 @@ -glabel func_80073C4C -/* 07484C 80073C4C 03E00008 */ jr $ra -/* 074850 80073C50 24020100 */ li $v0, 256 - diff --git a/asm/non_matchings/unknown_072E50/func_80073C54.s b/asm/non_matchings/unknown_072E50/func_80073C54.s deleted file mode 100644 index 59017055..00000000 --- a/asm/non_matchings/unknown_072E50/func_80073C54.s +++ /dev/null @@ -1,4 +0,0 @@ -glabel func_80073C54 -/* 074854 80073C54 03E00008 */ jr $ra -/* 074858 80073C58 24020200 */ li $v0, 512 - diff --git a/asm/non_matchings/unknown_072E50/func_80075AEC.s b/asm/non_matchings/unknown_072E50/func_80075AEC.s deleted file mode 100644 index 6e8f07b4..00000000 --- a/asm/non_matchings/unknown_072E50/func_80075AEC.s +++ /dev/null @@ -1,13 +0,0 @@ -glabel func_80075AEC -/* 0766EC 80075AEC 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0766F0 80075AF0 AFA40018 */ sw $a0, 0x18($sp) -/* 0766F4 80075AF4 3C048012 */ lui $a0, %hi(D_80124010) # $a0, 0x8012 -/* 0766F8 80075AF8 AFBF0014 */ sw $ra, 0x14($sp) -/* 0766FC 80075AFC 8C844010 */ lw $a0, %lo(D_80124010)($a0) -/* 076700 80075B00 0C0333F8 */ jal func_800CCFE0 -/* 076704 80075B04 00000000 */ nop -/* 076708 80075B08 8FBF0014 */ lw $ra, 0x14($sp) -/* 07670C 80075B0C 27BD0018 */ addiu $sp, $sp, 0x18 -/* 076710 80075B10 03E00008 */ jr $ra -/* 076714 80075B14 00001025 */ move $v0, $zero - diff --git a/asm/non_matchings/unknown_072E50/func_80076164.s b/asm/non_matchings/unknown_072E50/func_80076164.s deleted file mode 100644 index 6284974a..00000000 --- a/asm/non_matchings/unknown_072E50/func_80076164.s +++ /dev/null @@ -1,15 +0,0 @@ -glabel func_80076164 -/* 076D64 80076164 3C04800E */ lui $a0, %hi(D_800DE440) # $a0, 0x800e -/* 076D68 80076168 8C84E440 */ lw $a0, %lo(D_800DE440)($a0) -/* 076D6C 8007616C 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 076D70 80076170 10800003 */ beqz $a0, .L80076180 -/* 076D74 80076174 AFBF0014 */ sw $ra, 0x14($sp) -/* 076D78 80076178 0C01C450 */ jal func_80071140 -/* 076D7C 8007617C 00000000 */ nop -.L80076180: -/* 076D80 80076180 8FBF0014 */ lw $ra, 0x14($sp) -/* 076D84 80076184 3C01800E */ lui $at, %hi(D_800DE440) # $at, 0x800e -/* 076D88 80076188 AC20E440 */ sw $zero, %lo(D_800DE440)($at) -/* 076D8C 8007618C 03E00008 */ jr $ra -/* 076D90 80076190 27BD0018 */ addiu $sp, $sp, 0x18 - diff --git a/src/unknown_072E50.c b/src/unknown_072E50.c index dc1e0688..88ba8483 100644 --- a/src/unknown_072E50.c +++ b/src/unknown_072E50.c @@ -4,12 +4,20 @@ #include "types.h" #include "macros.h" +extern s32 D_800DE440; +extern s32 D_800DE48C; +extern s32 D_80124010; + GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_80072250.s") GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_80072298.s") GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_80072348.s") GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_80072424.s") GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_80072578.s") -GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_80072708.s") + +void func_80072708(void) { + D_800DE48C = 3; +} + GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_80072718.s") GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_80072C54.s") GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_80072E28.s") @@ -17,8 +25,15 @@ GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_8007306C.s") GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_800732E8.s") GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_80073588.s") GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_800738A4.s") -GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_80073C4C.s") -GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_80073C54.s") + +s32 func_80073C4C(void) { + return 0x100; +} + +s32 func_80073C54(void) { + return 0x200; +} + GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_80073C5C.s") GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_80073E1C.s") GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_80073F5C.s") @@ -41,12 +56,24 @@ GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_80075000.s") GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_800753D8.s") GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_800756D4.s") GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_800758DC.s") -GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_80075AEC.s") + +s32 func_80075AEC(s32 arg0) { + func_800CCFE0(D_80124010); + return 0; +} + GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_80075B18.s") GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_80075D38.s") GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_80075DC4.s") GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_80075E60.s") -GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_80076164.s") + +void func_80076164(void) { + if (D_800DE440 != 0) { + func_80071140(D_800DE440); + } + D_800DE440 = 0; +} + GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_80076194.s") GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_800762C8.s") GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_80076388.s") @@ -57,6 +84,36 @@ GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_80076924.s") GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_8007698C.s") GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_80076A38.s") GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_80076AF4.s") +/* +// Last function of file +s32 func_80076AF4(s32 arg0, s32 arg1) { + s32* temp; + s32 pad; + s32 ret; + + ret = 6; + temp = func_80070C9C(0x100, 0xFF); + if (func_80076610(arg0, arg1, temp, 0x100) == 0) { + switch(*temp) { + case 0x47414D44: // GAMD + ret = 3; + break; + case 0x54494D44: // TIMD + ret = 4; + break; + case 0x47485353: // GHSS + ret = 5; + break; + default: + ret = 6; + break; + } + } + func_80071140(temp); + return ret; +} +*/ + GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_80076BA0.s") GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_80076C58.s") GLOBAL_ASM("asm/non_matchings/unknown_072E50/func_80076E68.s")