diff --git a/assets/xml/boot/gfxprint.xml b/assets/xml/boot/gfxprint.xml index 7446095849..944a1432b0 100644 --- a/assets/xml/boot/gfxprint.xml +++ b/assets/xml/boot/gfxprint.xml @@ -4,6 +4,6 @@ - + diff --git a/spec/spec b/spec/spec index 245b29920a..e8cd722fc1 100644 --- a/spec/spec +++ b/spec/spec @@ -21,7 +21,6 @@ beginseg name "boot" address 0x80080060 include "$(BUILD_DIR)/src/boot/boot_main.o" - include "$(BUILD_DIR)/src/boot/rspboot.o" include "$(BUILD_DIR)/src/boot/idle.o" include "$(BUILD_DIR)/src/boot/viconfig.o" include "$(BUILD_DIR)/src/boot/carthandle.o" @@ -244,6 +243,8 @@ beginseg include "$(BUILD_DIR)/src/boot/libc/strcpy.o" include "$(BUILD_DIR)/src/boot/libc/memmove.o" include "$(BUILD_DIR)/src/boot/build.o" + include "$(BUILD_DIR)/src/boot/rspboot.o" + #ifdef COMPILER_GCC include "$(BUILD_DIR)/src/gcc_fix/missing_gcc_functions.o" #endif @@ -609,7 +610,6 @@ beginseg name "code" compress after "dmadata" - include "$(BUILD_DIR)/src/code/rsptext.o" include "$(BUILD_DIR)/src/code/z_en_a_keep.o" include "$(BUILD_DIR)/src/code/z_en_item00.o" include "$(BUILD_DIR)/src/code/z_eff_blure.o" @@ -780,7 +780,7 @@ beginseg include "$(BUILD_DIR)/assets/audio/sequence_font_table.o" include "$(BUILD_DIR)/src/audio/tables/sequence_table.o" include "$(BUILD_DIR)/src/audio/tables/samplebank_table.o" - include "$(BUILD_DIR)/src/code/rspdata.o" + include "$(BUILD_DIR)/src/code/rspcode.o" endseg // The game expects all the segments after the `code` segment and before the first overlay to be `NOLOAD` ones diff --git a/src/boot/fault.c b/src/boot/fault.c index 15a77f03b1..7d167e41cb 100644 --- a/src/boot/fault.c +++ b/src/boot/fault.c @@ -468,7 +468,7 @@ void Fault_PrintThreadContext(OSThread* thread) { } } -void osSyncPrintfThreadContext(OSThread* thread) { +void Fault_LogThreadContext(OSThread* thread) { __OSThreadContext* threadCtx; s16 causeStrIndex = _SHIFTR((u32)thread->context.cause, 2, 5); @@ -1035,7 +1035,7 @@ void Fault_ThreadEntry(void* arg) { do { // Thread context page Fault_PrintThreadContext(faultedThread); - osSyncPrintfThreadContext(faultedThread); + Fault_LogThreadContext(faultedThread); Fault_WaitForInput(); // Stack trace page diff --git a/src/boot/fault_drawer.c b/src/boot/fault_drawer.c index fa2dd3d4d3..1465c2c7e8 100644 --- a/src/boot/fault_drawer.c +++ b/src/boot/fault_drawer.c @@ -266,8 +266,6 @@ void* FaultDrawer_FormatStringFunc(void* arg, const char* str, size_t count) { return arg; } -const char D_80099080[] = "(null)"; - s32 FaultDrawer_VPrintf(const char* fmt, va_list ap) { return _Printf(FaultDrawer_FormatStringFunc, sFaultDrawerInstance, fmt, ap); } diff --git a/src/boot/libu64/stackcheck.c b/src/boot/libu64/stackcheck.c index de321bddd0..9054952210 100644 --- a/src/boot/libu64/stackcheck.c +++ b/src/boot/libu64/stackcheck.c @@ -94,6 +94,8 @@ StackStatus StackCheck_GetState(StackEntry* entry) { status = STACK_STATUS_OK; } + (void)"(null)"; + return status; } diff --git a/src/boot/rspboot.s b/src/boot/rspboot.s index bc1d5d4f5b..96f204b653 100644 --- a/src/boot/rspboot.s +++ b/src/boot/rspboot.s @@ -1,7 +1,10 @@ .include "macro.inc" -.section .data +.section .text -dlabel rspbootTextStart +.balign 16 + +glabel rspbootTextStart .incbin "incbin/rspbootText" +endlabel rspbootTextStart dlabel rspbootTextEnd diff --git a/src/code/rspdata.s b/src/code/rspcode.s similarity index 59% rename from src/code/rspdata.s rename to src/code/rspcode.s index 812bcf5d5c..e7e53298f2 100644 --- a/src/code/rspdata.s +++ b/src/code/rspcode.s @@ -1,7 +1,28 @@ .include "macro.inc" +.section .text + +.balign 16 + +glabel aspMainTextStart + .incbin "incbin/aspMainText" +endlabel aspMainTextStart +dlabel aspMainTextEnd + +glabel gspS2DEX2_fifoTextStart + .incbin "incbin/gspS2DEX2_fifoText" +endlabel gspS2DEX2_fifoTextStart +dlabel gspS2DEX2_fifoTextEnd + +glabel njpgdspMainTextStart + .incbin "incbin/njpgdspMainText" +endlabel njpgdspMainTextStart +dlabel njpgdspMainTextEnd + .section .rodata +.balign 16 + dlabel aspMainDataStart .incbin "incbin/aspMainData" dlabel aspMainDataEnd diff --git a/src/code/rsptext.s b/src/code/rsptext.s deleted file mode 100644 index d8d3290bd9..0000000000 --- a/src/code/rsptext.s +++ /dev/null @@ -1,15 +0,0 @@ -.include "macro.inc" - -.section .data - -dlabel aspMainTextStart - .incbin "incbin/aspMainText" -dlabel aspMainTextEnd - -dlabel gspS2DEX2_fifoTextStart - .incbin "incbin/gspS2DEX2_fifoText" -dlabel gspS2DEX2_fifoTextEnd - -dlabel njpgdspMainTextStart - .incbin "incbin/njpgdspMainText" -dlabel njpgdspMainTextEnd diff --git a/src/code/z_rumble.c b/src/code/z_rumble.c index 3cca1d4325..52267f6a28 100644 --- a/src/code/z_rumble.c +++ b/src/code/z_rumble.c @@ -10,6 +10,9 @@ #include "global.h" #include "z64rumble.h" +#pragma increment_block_number "n64-us:128" + +static s32 sBssPad[4]; RumbleManager gRumbleMgr; void Rumble_Update(void* arg0) { diff --git a/src/code/z_skin.c b/src/code/z_skin.c index 5ced3edeac..b3f3b577b5 100644 --- a/src/code/z_skin.c +++ b/src/code/z_skin.c @@ -10,8 +10,6 @@ // 60 is an arbitrary number which specifies the max amount of limbs per skeleton this system supports MtxF gSkinLimbMatrices[60]; -static s32 sBssPad; - void Skin_UpdateVertices(MtxF* mtx, SkinVertex* skinVertices, SkinLimbModif* modifEntry, Vtx* vtxBuf, Vec3f* pos) { SkinVertex* vertexEntry; Vtx* vtx; diff --git a/src/libultra/gu/position.c b/src/libultra/gu/position.c index 43072b5a63..20ee80bfe3 100644 --- a/src/libultra/gu/position.c +++ b/src/libultra/gu/position.c @@ -6,7 +6,7 @@ * Creates a rotation/parallel translation modelling matrix (floating point) */ void guPositionF(f32 mf[4][4], f32 rot, f32 pitch, f32 yaw, f32 scale, f32 x, f32 y, f32 z) { - static f32 D_80134D00 = M_PIf / 180.0f; + static f32 dtor = M_PIf / 180.0f; f32 sinr; f32 sinp; f32 sinh; @@ -14,9 +14,9 @@ void guPositionF(f32 mf[4][4], f32 rot, f32 pitch, f32 yaw, f32 scale, f32 x, f3 f32 cosp; f32 cosh; - rot *= D_80134D00; - pitch *= D_80134D00; - yaw *= D_80134D00; + rot *= dtor; + pitch *= dtor; + yaw *= dtor; sinr = sinf(rot); cosr = cosf(rot); diff --git a/tools/disasm/disasm.py b/tools/disasm/disasm.py index 1f0295cffc..79d41bd969 100755 --- a/tools/disasm/disasm.py +++ b/tools/disasm/disasm.py @@ -2229,7 +2229,7 @@ for segment in files_spec: data_size = 0x80800000 - file_list[full_index] elif segment[0] == "boot" and name == "vimgr" and segment[3][i][2] == "bss": # This is the end of boot, hardcode it - data_size = 0x800A5AC0 - file_list[full_index] + data_size = 0x8009F8B0 - file_list[full_index] else: data_size = file_list[full_index + 1] - file_list[full_index] diff --git a/tools/disasm/files.txt b/tools/disasm/files.txt index 7042d23334..9479465bd7 100644 --- a/tools/disasm/files.txt +++ b/tools/disasm/files.txt @@ -21,15 +21,6 @@ 0x80080000 : "entry", }, ], - ['dmadata', None, 'dmadata', - [ - [0x8009F8B0, 0x800A5AB0, 'dmadata', None], - [0x800A5AB0, 0x800A5AC0, 'bss', None], - ], - { - 0x8009F8B0 : "dmadata", - }, - ], ['boot', None, 'boot', [ [0x80080060, 0x800969C0, 'text', None], @@ -243,9 +234,9 @@ 0x800968B0 : "strcmp", 0x800968F0 : "strcpy", 0x80096930 : "memmove", + 0x800969C0 : "rspboot", # .data section - 0x800969C0 : "rspboot", 0x80096B20 : "idle", 0x80096B40 : "carthandle", 0x80096B50 : "z_std_dma", @@ -269,8 +260,8 @@ 0x80097E50 : "initialize", 0x80097E70 : "pimgr", 0x80097EA0 : "piacs", - 0x80097EB0 : "contpfs", 0x80097EB0 : "vimodentschpn1", + 0x80097F00 : "contpfs", 0x80097F10 : "seteventmesg", 0x80097F20 : "xprintf", 0x80097F70 : "timerintr", @@ -283,7 +274,7 @@ 0x80098060 : "vi", 0x800980D0 : "cartrominit", 0x800980E0 : "vimodefpallan1", - 0x80098130 : "xldtob", + 0x80098130 : "xlitob", 0x80098160 : "vimgr", 0x80098180 : "voicecontrolgain", @@ -296,6 +287,7 @@ 0x80098280 : "CIC6105", 0x800982B0 : "fault", 0x80098C50 : "fault_drawer", + 0x80099080 : "stackcheck", 0x80099090 : "gfxprint", 0x800990B0 : "debug", 0x800990C0 : "math64", @@ -342,6 +334,15 @@ 0x8009E690 : "vimgr", }, ], + ['dmadata', None, 'dmadata', + [ + [0x8009F8B0, 0x800A5AB0, 'dmadata', None], + [0x800A5AB0, 0x800A5AC0, 'bss', None], + ], + { + 0x8009F8B0 : "dmadata", + }, + ], ['code', None, 'code', [ [0x800A5AC0, 0x801AAAB0, 'text', ((0x80186028, 0x80186A70, 'data', None, None, None),)], @@ -382,7 +383,7 @@ 0x800EFE60 : "z_eff_footmark", 0x800F0390 : "z_sound_source", 0x800F05C0 : "z_elf_message", - 0x800F07C0 : "z_en_hy", + 0x800F07C0 : "z_en_hy_code", 0x800F1250 : "z_face_reaction", 0x800F12D0 : "z_env_flags", 0x800F1460 : "z_eventmgr", @@ -500,17 +501,17 @@ 0x801A4EB0 : "voice_external", 0x801A51F0 : "voice_internal", 0x801A5BC0 : "[PADDING]", - 0x801A5BD0 : "code_801A5BD0", + 0x801A5BD0 : "sfx", 0x801A7B10 : "sequence", 0x801A9B10 : "jpegutils", 0x801AA020 : "jpegdecoder", 0x801AA610 : "z_game_over", 0x801AAAA0 : "z_construct", - - # .data section 0x801AAAB0 : "aspMain", 0x801ABAB0 : "gspS2DEX2.fifo", 0x801AD370 : "njpgdspMain", + + # .data section 0x801ADE60 : "z_en_a_keep", 0x801ADEC0 : "z_en_item00", 0x801AE240 : "z_eff_blure", @@ -588,8 +589,7 @@ 0x801D1DE0 : "sys_matrix", 0x801D1E60 : "sys_ucode", 0x801D1E70 : "sys_rumble", - 0x801D1E80 : "code_801D1E80", - 0x801D2E80 : "audio_data", + 0x801D1E80 : "audio_data", 0x801D5FB0 : "audio_synthesis", 0x801D5FE0 : "audio_load", 0x801D5FF0 : "audio_thread", @@ -601,7 +601,7 @@ 0x801D8BE0 : "voice_external", 0x801D8E50 : "voice_internal", 0x801D9090 : "audio_sound_params", - 0x801DB470 : "code_801A5BD0", + 0x801DB470 : "sfx", 0x801DB4C0 : "sequence", 0x801DB4E0 : "session_config", @@ -682,7 +682,7 @@ 0x801E0540 : "audio_seqplayer", 0x801E0BD0 : "code_8019AF00", 0x801E0EC0 : "voice_internal", - 0x801E1050 : "code_801A5BD0", + 0x801E1050 : "sfx", 0x801E1070 : "sequence", 0x801E1100 : "session_config", 0x801E1110 : "z_game_over", @@ -748,7 +748,7 @@ 0x801FD140 : "audio_load", 0x801FD1F0 : "code_8019AF00", 0x801FD5A0 : "voice_internal", - 0x801FD710 : "code_801A5BD0", + 0x801FD710 : "sfx", 0x801FFD00 : "sequence", 0x80200BE0 : "session_config", 0x80208E90 : "jpegdecoder", diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index fcc3001b55..f911c3244a 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -69,7 +69,7 @@ 0x80082330:("Fault_PrintFPCSR",), 0x800823D4:("Fault_LogFPCSR",), 0x8008246C:("Fault_PrintThreadContext",), - 0x800827BC:("osSyncPrintfThreadContext",), + 0x800827BC:("Fault_LogThreadContext",), 0x80082AB8:("Fault_FindFaultedThread",), 0x80082B40:("Fault_Wait5Seconds",), 0x80082BD0:("Fault_WaitForButtonCombo",), diff --git a/tools/sizes/boot_functions.csv b/tools/sizes/boot_functions.csv index ac67c6687a..a79430b8a5 100644 --- a/tools/sizes/boot_functions.csv +++ b/tools/sizes/boot_functions.csv @@ -66,7 +66,7 @@ asm/non_matchings/boot/fault/Fault_LogFReg.s,Fault_LogFReg,0x80082280,0x2C asm/non_matchings/boot/fault/Fault_PrintFPCSR.s,Fault_PrintFPCSR,0x80082330,0x29 asm/non_matchings/boot/fault/Fault_LogFPCSR.s,Fault_LogFPCSR,0x800823D4,0x26 asm/non_matchings/boot/fault/Fault_PrintThreadContext.s,Fault_PrintThreadContext,0x8008246C,0xD4 -asm/non_matchings/boot/fault/osSyncPrintfThreadContext.s,osSyncPrintfThreadContext,0x800827BC,0xBF +asm/non_matchings/boot/fault/Fault_LogThreadContext.s,Fault_LogThreadContext,0x800827BC,0xBF asm/non_matchings/boot/fault/Fault_FindFaultedThread.s,Fault_FindFaultedThread,0x80082AB8,0x22 asm/non_matchings/boot/fault/Fault_Wait5Seconds.s,Fault_Wait5Seconds,0x80082B40,0x24 asm/non_matchings/boot/fault/Fault_WaitForButtonCombo.s,Fault_WaitForButtonCombo,0x80082BD0,0x27