Decompile code_0x80183070

This commit is contained in:
rozlette 2018-10-28 03:32:16 -05:00
parent 0418ad11d3
commit e5737d1688
5 changed files with 26 additions and 17 deletions

View File

@ -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 $@

View File

@ -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)

View File

@ -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

View File

@ -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);

View File

@ -0,0 +1,6 @@
#include <ultra64.h>
#include <global.h>
void func_80183070(void) {
for(;;) func_80087A6C(1000);
}