diff --git a/Makefile b/Makefile index 6cbd4f32..54d2e824 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,7 @@ CC := ido/ido5.3_recomp/cc CPP := cpp GCC := $(CROSS)gcc AS := $(CROSS)as -LD := LD_LIBRARY_PATH=../../papermario ../../papermario/mips-linux-gnu-ld.bfd -b elf32-tradbigmips +LD := $(CROSS)ld -b elf32-tradbigmips OBJDUMP := $(CROSS)objdump OBJCOPY := $(CROSS)objcopy PYTHON := python3 @@ -166,7 +166,7 @@ OPT_FLAGS := -O2 MIPSBIT := -mips2 ASFLAGS := -EB -mtune=vr4300 -march=vr4300 -mabi=32 -I include GCC_ASFLAGS := -c -x assembler-with-cpp -mabi=32 -ffreestanding -mtune=vr4300 -march=vr4300 -mfix4300 -G 0 -O -mno-shared -fno-PIC -mno-abicalls -LDFLAGS := -T $(LD_SCRIPT) -Map $(ELF:.elf=.map) --no-check-sections --accept-unknown-input-arch -T undefined_syms.libultra.txt +LDFLAGS := -T $(LD_SCRIPT) -Map $(ELF:.elf=.map) --no-check-sections --accept-unknown-input-arch -T manual_syms.txt BINOFLAGS := -I binary -O elf32-tradbigmips ### Rules ### diff --git a/asm/core1/ultra/parameters.s b/asm/core1/ultra/parameters.s new file mode 100644 index 00000000..450af31b --- /dev/null +++ b/asm/core1/ultra/parameters.s @@ -0,0 +1,17 @@ +#include "PR/R4300.h" +#include "sys/asm.h" +#include "sys/regdef.h" + +.text +ABS(leoBootID, 0x800001a0) +ABS(osTvType, 0x80000300) +ABS(osRomType, 0x80000304) +ABS(osRomBase, 0x80000308) +ABS(osResetType, 0x8000030c) +ABS(osCicId, 0x80000310) +ABS(osVersion, 0x80000314) +ABS(osMemSize, 0x80000318) +ABS(osAppNMIBuffer, 0x8000031c) + +.space 0x60 +/* padded to 0x60 in the object file */ diff --git a/asm/ultra/parameters.s b/asm/ultra/parameters.s new file mode 100644 index 00000000..450af31b --- /dev/null +++ b/asm/ultra/parameters.s @@ -0,0 +1,17 @@ +#include "PR/R4300.h" +#include "sys/asm.h" +#include "sys/regdef.h" + +.text +ABS(leoBootID, 0x800001a0) +ABS(osTvType, 0x80000300) +ABS(osRomType, 0x80000304) +ABS(osRomBase, 0x80000308) +ABS(osResetType, 0x8000030c) +ABS(osCicId, 0x80000310) +ABS(osVersion, 0x80000314) +ABS(osMemSize, 0x80000318) +ABS(osAppNMIBuffer, 0x8000031c) + +.space 0x60 +/* padded to 0x60 in the object file */ diff --git a/decompressed.us.v10.yaml b/decompressed.us.v10.yaml index dadbfb14..f848f3b9 100644 --- a/decompressed.us.v10.yaml +++ b/decompressed.us.v10.yaml @@ -65,7 +65,7 @@ segments: - [0x3870, hasm, maptlbrdb] - [0x38D0, c, done/pirawread] - [0x3930, c, done/ll] - - [0x3BF0, bin, padding3BF0] # Empty space + - [0x3BF0, hasm, ultra/parameters] - [0x3C50, c, done/virtualtophysical] - [0x3CD0, c, done/si] - [0x3D00, c, done/thread] @@ -237,7 +237,7 @@ segments: - [0xF3F820, c, gu/sinf] #DONE - [0xF3F9E0, c, audio/cents2ratio] #DONE - [0xF3FA30, c, audio/heapinit] #DONE - - [0xF3FA70, asm, padding] # 0x60 bytes of zeroes? + - [0xF3FA70, hasm, ultra/parameters] #DONE - [0xF3FAD0, c, os/createmesgqueue] #DONE - [0xF3FB00, c, io/aisetfreq] #DONE - [0xF3FC60, c, audio/sl] #DONE diff --git a/undefined_syms.libultra.txt b/manual_syms.txt similarity index 80% rename from undefined_syms.libultra.txt rename to manual_syms.txt index 05bcae7b..4cc3d756 100644 --- a/undefined_syms.libultra.txt +++ b/manual_syms.txt @@ -1,10 +1,3 @@ -/* Fixed-address libultra symbols */ -osTvType = 0x80000300; -osRomBase = 0x80000308; -osResetType = 0x8000030C; -osCicId = 0x80000310; -osAppNMIBuffer = 0x8000031C; - /* Microcode renames to match ucode.h names */ n_aspMainTextStart = _binary_bin_core1_n_aspMain_text_bin_start; n_aspMainTextEnd = _binary_bin_core1_n_aspMain_text_bin_end; @@ -30,12 +23,6 @@ gOverlayTable = 0x803FFE10; D_803A5D00 = 0x803A5D00; /* framebuffers */ /* Renames for the boot segment */ -boot_osTvType = osTvType; -boot_osRomBase = osRomBase; -boot_osResetType = osResetType; -boot_osCicId = osCicId; -boot_osAppNMIBuffer = osAppNMIBuffer; - boot_D_8002D500 = D_8002D500; boot_core1_VRAM = core1_VRAM; boot_D_803FBE00 = D_803FBE00;