This commit is contained in:
Ethan Roseman 2021-02-09 03:20:27 +09:00
parent bbac3d905b
commit eb4ea01b3e
9 changed files with 24 additions and 63 deletions

View File

@ -1,12 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel nuContRmbForceStop
/* 3B4A0 800600A0 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 3B4A4 800600A4 24040304 */ addiu $a0, $zero, 0x304
/* 3B4A8 800600A8 AFBF0010 */ sw $ra, 0x10($sp)
/* 3B4AC 800600AC 0C00B3CA */ jal nuSiSendMesg
/* 3B4B0 800600B0 0000282D */ daddu $a1, $zero, $zero
/* 3B4B4 800600B4 8FBF0010 */ lw $ra, 0x10($sp)
/* 3B4B8 800600B8 03E00008 */ jr $ra
/* 3B4BC 800600BC 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,12 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel nuContRmbForceStopEnd
/* 3B4C0 800600C0 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 3B4C4 800600C4 24040305 */ addiu $a0, $zero, 0x305
/* 3B4C8 800600C8 AFBF0010 */ sw $ra, 0x10($sp)
/* 3B4CC 800600CC 0C00B3CA */ jal nuSiSendMesg
/* 3B4D0 800600D0 0000282D */ daddu $a1, $zero, $zero
/* 3B4D4 800600D4 8FBF0010 */ lw $ra, 0x10($sp)
/* 3B4D8 800600D8 03E00008 */ jr $ra
/* 3B4DC 800600DC 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,29 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel nuContRmbMgrInit
/* 3B08C 8005FC8C 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 3B090 8005FC90 AFBF0010 */ sw $ra, 0x10($sp)
/* 3B094 8005FC94 0000202D */ daddu $a0, $zero, $zero
/* 3B098 8005FC98 24050002 */ addiu $a1, $zero, 2
/* 3B09C 8005FC9C 0080182D */ daddu $v1, $a0, $zero
.L8005FCA0:
/* 3B0A0 8005FCA0 3C01800B */ lui $at, 0x800b
/* 3B0A4 8005FCA4 00230821 */ addu $at, $at, $v1
/* 3B0A8 8005FCA8 A0251D46 */ sb $a1, 0x1d46($at)
/* 3B0AC 8005FCAC 3C01800B */ lui $at, 0x800b
/* 3B0B0 8005FCB0 00230821 */ addu $at, $at, $v1
/* 3B0B4 8005FCB4 A0201D47 */ sb $zero, 0x1d47($at)
/* 3B0B8 8005FCB8 3C01800B */ lui $at, 0x800b
/* 3B0BC 8005FCBC 00230821 */ addu $at, $at, $v1
/* 3B0C0 8005FCC0 A4241D44 */ sh $a0, 0x1d44($at)
/* 3B0C4 8005FCC4 24840001 */ addiu $a0, $a0, 1
/* 3B0C8 8005FCC8 2C820004 */ sltiu $v0, $a0, 4
/* 3B0CC 8005FCCC 1440FFF4 */ bnez $v0, .L8005FCA0
/* 3B0D0 8005FCD0 2463000A */ addiu $v1, $v1, 0xa
/* 3B0D4 8005FCD4 3C048009 */ lui $a0, %hi(nuContRmbCallBack)
/* 3B0D8 8005FCD8 0C0180FC */ jal nuSiCallBackAdd
/* 3B0DC 8005FCDC 24843D00 */ addiu $a0, $a0, %lo(nuContRmbCallBack)
/* 3B0E0 8005FCE0 8FBF0010 */ lw $ra, 0x10($sp)
/* 3B0E4 8005FCE4 03E00008 */ jr $ra
/* 3B0E8 8005FCE8 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,7 +1,7 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel nuGfxThread
glabel nuGfxThread2
/* 3B648 80060248 27BDFFC8 */ addiu $sp, $sp, -0x38
/* 3B64C 8006024C AFB00028 */ sw $s0, 0x28($sp)
/* 3B650 80060250 3C10800B */ lui $s0, %hi(D_800B42F0)

View File

@ -12,8 +12,8 @@ glabel nuGfxThreadStart
/* 3B60C 8006020C AFA20010 */ sw $v0, 0x10($sp)
/* 3B610 80060210 24020032 */ addiu $v0, $zero, 0x32
/* 3B614 80060214 24050004 */ addiu $a1, $zero, 4
/* 3B618 80060218 3C068006 */ lui $a2, %hi(nuGfxThread)
/* 3B61C 8006021C 24C60248 */ addiu $a2, $a2, %lo(nuGfxThread)
/* 3B618 80060218 3C068006 */ lui $a2, %hi(nuGfxThread2)
/* 3B61C 8006021C 24C60248 */ addiu $a2, $a2, %lo(nuGfxThread2)
/* 3B620 80060220 0000382D */ daddu $a3, $zero, $zero
/* 3B624 80060224 AFBF001C */ sw $ra, 0x1c($sp)
/* 3B628 80060228 0C019798 */ jal osCreateThread

View File

@ -1,7 +1,12 @@
#include "common.h"
#include "nu/nusys.h"
INCLUDE_ASM(s32, "os/nusys/code_3B4A0", nuContRmbForceStop);
void nuContRmbForceStop(void) {
nuSiSendMesg(NU_CONT_RMB_FORCESTOP_MSG, NULL);
}
INCLUDE_ASM(s32, "os/nusys/code_3B4A0", nuContRmbForceStopEnd);
void nuContRmbForceStopEnd(void) {
nuSiSendMesg(NU_CONT_RMB_FORCESTOPEND_MSG, NULL);
}
INCLUDE_ASM(s32, "os/nusys/code_3B4A0", nuPiReadRomOverlay);
INCLUDE_ASM(void, "os/nusys/code_3B4A0", nuPiReadRomOverlay, NUPiOverlaySegment* segment);

View File

@ -1,5 +1,14 @@
#include "common.h"
#include "nu/nusys.h"
INCLUDE_ASM(s32, "os/nusys/nuGfxThread", nuGfxThreadStart);
void nuGfxThread2(void);
INCLUDE_ASM(s32, "os/nusys/nuGfxThread", nuGfxThread);
extern s32 D_800AE6D0;
extern OSThread D_800B1B90;
void nuGfxThreadStart(void) {
osCreateThread(&D_800B1B90, 4, nuGfxThread2, NULL, &D_800AE6D0, NU_GFX_THREAD_PRI);
osStartThread(&D_800B1B90);
}
INCLUDE_ASM(void, "os/nusys/nuGfxThread", nuGfxThread2);

View File

@ -26,7 +26,7 @@ def get_c_file(directory):
def import_c_file(in_file):
in_file = os.path.relpath(in_file, root_dir)
cpp_command = ["gcc", "-E", "-P", "-Iinclude", "-Isrc", "-D_LANGUAGE_C", "-ffreestanding", "-DF3DEX_GBI_2", in_file]
cpp_command = ["gcc", "-E", "-P", "-Iinclude", "-Isrc", "-Ibuild/include" ,"-D_LANGUAGE_C", "-ffreestanding", "-DF3DEX_GBI_2", in_file]
try:
return subprocess.check_output(cpp_command, cwd=root_dir, encoding="utf-8")
except subprocess.CalledProcessError:

View File

@ -324,7 +324,7 @@ nuContRmbForceStop = 0x800600A0; // type:func rom:0x3B4A0
nuContRmbForceStopEnd = 0x800600C0; // type:func rom:0x3B4C0
nuPiReadRomOverlay = 0x800600E0; // type:func rom:0x3B4E0
nuGfxThreadStart = 0x800601F0; // type:func rom:0x3B5F0
nuGfxThread = 0x80060248; // type:func rom:0x3B648
nuGfxThread2 = 0x80060248; // type:func rom:0x3B648
nuGfxSwapCfbFuncSet = 0x80060310; // type:func rom:0x3B710
nuGfxSwapCfb = 0x80060350; // type:func rom:0x3B750
nuGfxRetraceWait = 0x80060370; // type:func rom:0x3B770