diff --git a/Makefile b/Makefile index 12cb59131f..e49e3c94a0 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ OPTIMIZATION := -O2 -g3 build/src/libultra/os/%: OPTIMIZATION := -O1 build/src/libultra/io/%: OPTIMIZATION := -O2 build/src/libultra/libc/%: OPTIMIZATION := -O2 -test.txt: OPTIMIZATION := -O2 +test.txt: OPTIMIZATION := -O2 -g3 test.txt: MIPS_VERSION := -mips2 BASEROM_FILES := $(wildcard baserom/*) @@ -27,8 +27,8 @@ S_O_FILES = $(S_FILES:asm/%.asm=build/asm/%.o) C_FILES := $(wildcard src/*) $(wildcard src/libultra/*) $(wildcard src/libultra/os/*) $(wildcard src/libultra/io/*) $(wildcard src/libultra/libc/*) $(wildcard src/code/*) C_O_FILES = $(C_FILES:src/%.c=build/src/%.o) O_FILES := $(BASEROM_O_FILES) $(S_O_FILES) - - + + ROM := rom.z64 ELF := build/rom.elf @@ -44,36 +44,36 @@ $(shell mkdir -p build/src/code) check: $(ROM) code.bin boot.bin @md5sum -c checksum.md5 - + $(ROM): $(ELF) @python3 elf2rom.py $(ELF): $(O_FILES) ldscript.txt $(LD) -T ldscript.txt --no-check-sections --accept-unknown-input-arch -o $@ - + boot.bin: code.elf $(MIPS_BINUTILS)objcopy --dump-section boot=$@ $< - + code.bin: code.elf $(MIPS_BINUTILS)objcopy --dump-section code=$@ $< - + code.elf: $(S_O_FILES) $(C_O_FILES) codescript.txt undef.txt $(LD) -T codescript.txt -T undef.txt --no-check-sections --accept-unknown-input-arch -o $@ - + test.txt: build/src/test.o - $(MIPS_BINUTILS)objdump -d --adjust-vma=0x8008F1A0 $< > test.txt - + $(MIPS_BINUTILS)objdump -d -z --adjust-vma=0x800BF9A0 $< > test.txt + clean: rm $(ROM) $(ELF) code.elf code.bin boot.bin -r build # Recipes - + build/baserom/%.o: baserom/% $(MIPS_BINUTILS)objcopy -I binary -O elf32-big $< $@ - + build/asm/%.o: asm/%.asm $(AS) -march=vr4300 -32 $^ -o $@ - + build/src/%.o: src/%.c include/* - $(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTIMIZATION) -Iinclude $< -o $@ - + $(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTIMIZATION) -Iinclude $< -o $@ + diff --git a/codescript.txt b/codescript.txt index 9e8608c327..0f7b060b1b 100644 --- a/codescript.txt +++ b/codescript.txt @@ -280,7 +280,7 @@ SECTIONS build/asm/code_0x801795F0.o(.text) build/asm/code_0x80180160.o(.text) build/asm/code_0x80182CE0.o(.text) - build/asm/code_0x80183070.o(.text) + build/src/code/code_0x80183070.o(.text) build/asm/code_0x801830A0.o(.text) build/asm/code_0x80185F90.o(.text) build/asm/code_0x801877D0.o(.text) diff --git a/functions.py b/functions.py index 17e625e95e..ccfd206046 100644 --- a/functions.py +++ b/functions.py @@ -34,6 +34,7 @@ known_funcs = { 0x80087830:("func_80087830","UNK_TYPE","UNK_TYPE, UNK_TYPE, UNK_TYPE"), 0x80087854:("func_80087854","UNK_TYPE","u8*, UNK_TYPE, UNK_PTR"), 0x800878A4:("func_800878A4","UNK_TYPE","u8*, UNK_TYPE, UNK_TYPE, UNK_TYPE"), + 0x80087A6C:("func_80087A6C","UNK_RET","UNK_TYPE"), 0x80087B00:("__osSetCause","void","u32 value"), 0x80087B10:("osSendMesg","s32","OSMesgQueue* mq, OSMesg msg, s32 flags"), 0x80087E00:("func_80087E00","void","u32"), @@ -224,6 +225,7 @@ known_funcs = { 0x80139188:("func_80139188","UNK_TYPE","UNK_PTR, UNK_PTR"), 0x80139894:("func_80139894","UNK_RET","UNK_PTR, UNK_TYPE, UNK_TYPE, UNK_TYPE, UNK_TYPE, UNK_TYPE, UNK_TYPE, f32, f32, f32"), 0x80174BF0:("func_80174BF0","UNK_RET","UNK_TYPE"), + 0x80183070:("func_80183070","void","void"), 0x8018349C:("func_8018349C","UNK_RET","UNK_TYPE, UNK_TYPE"), # ovl_En_Test diff --git a/include/functions.h b/include/functions.h index c327f2db47..9539e467c9 100644 --- a/include/functions.h +++ b/include/functions.h @@ -202,7 +202,7 @@ UNK_TYPE func_800878A4(u8*, UNK_TYPE, UNK_TYPE, UNK_TYPE); // func_800878A4 // UNK_RET func_80087900(UNK_ARGS); // UNK_RET func_80087960(UNK_ARGS); // UNK_RET func_80087A1C(UNK_ARGS); -// UNK_RET func_80087A6C(UNK_ARGS); +UNK_RET func_80087A6C(UNK_TYPE); // func_80087A6C void __osSetCause(u32 value); // func_80087B00 s32 osSendMesg(OSMesgQueue* mq, OSMesg msg, s32 flags); // func_80087B10 // UNK_RET func_80087C60(UNK_ARGS); @@ -3567,6 +3567,7 @@ UNK_RET func_80174BF0(UNK_TYPE); // func_80174BF0 // UNK_RET func_80182CE0(UNK_ARGS); // UNK_RET func_80183020(UNK_ARGS); // UNK_RET func_80183058(UNK_ARGS); +void func_80183070(void); // func_80183070 // UNK_RET func_801830A0(UNK_ARGS); // UNK_RET func_801830C8(UNK_ARGS); // UNK_RET func_801830E8(UNK_ARGS); diff --git a/src/code/code_0x80183070.c b/src/code/code_0x80183070.c new file mode 100644 index 0000000000..72f0ab9cbf --- /dev/null +++ b/src/code/code_0x80183070.c @@ -0,0 +1,6 @@ +#include +#include + +void func_80183070(void) { + for(;;) func_80087A6C(1000); +}