mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
Dump current status
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
# TODO think about how to split this up
|
||||
|
||||
MIPS_BINUTILS := mips-linux-gnu-
|
||||
|
||||
AS := $(MIPS_BINUTILS)as
|
||||
LD := $(MIPS_BINUTILS)ld
|
||||
|
||||
QEMU_IRIX := ~/irixemu/mips-linux-user/qemu-mips
|
||||
IRIX_ROOT := ./ido/
|
||||
CC := $(QEMU_IRIX) -L $(IRIX_ROOT) $(IRIX_ROOT)/usr/bin/cc
|
||||
|
||||
CFLAGS := -G 0 -non_shared -Xfullwarn -Xcpluscomm
|
||||
|
||||
MIPS_VERSION := -mips2
|
||||
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: MIPS_VERSION := -mips2
|
||||
|
||||
BASEROM_FILES := $(wildcard baserom/*)
|
||||
BASEROM_O_FILES := $(BASEROM_FILES:baserom/%=build/baserom/%.o)
|
||||
S_FILES := $(wildcard asm/*)
|
||||
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
|
||||
|
||||
# make build directories
|
||||
$(shell mkdir -p build/asm)
|
||||
$(shell mkdir -p build/baserom)
|
||||
$(shell mkdir -p build/src)
|
||||
$(shell mkdir -p build/src/libultra)
|
||||
$(shell mkdir -p build/src/libultra/os)
|
||||
$(shell mkdir -p build/src/libultra/io)
|
||||
$(shell mkdir -p build/src/libultra/libc)
|
||||
$(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
|
||||
|
||||
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 $@
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
WIP Majora's Mask decomp, proper docs and README will be made later.
|
||||
|
||||
Basic steps (assuming you already have IDO and irixqemu):
|
||||
Run extract_rom.py with a USA Majora's Mask ROM named baserom.z64 (will need to get libyaz0 first, I'll set up the dependency file eventually)
|
||||
Run disasm.py
|
||||
Run Make (edit the makefile with the paths to ido, etc. I'll make it use evironment variables eventually)
|
||||
@@ -0,0 +1,3 @@
|
||||
2a0a8acb61538235bc1094d297fb6556 rom.z64
|
||||
4e8afbb44e6a4b9bc00eaa318bb1650c code.bin
|
||||
b0145fad4be13d63d5d7aa75062db400 boot.bin
|
||||
+302
@@ -0,0 +1,302 @@
|
||||
SECTIONS
|
||||
{
|
||||
boot 0x80080060:
|
||||
{
|
||||
build/asm/boot_0x80080060.o(.text)
|
||||
build/asm/boot_0x800805E0.o(.text)
|
||||
build/asm/boot_0x80080790.o(.text)
|
||||
build/asm/boot_0x80080E30.o(.text)
|
||||
build/asm/boot_0x80081820.o(.text)
|
||||
build/asm/boot_0x80081920.o(.text)
|
||||
build/asm/boot_0x80081980.o(.text)
|
||||
build/asm/boot_0x80083EB0.o(.text)
|
||||
build/asm/boot_0x80084940.o(.text)
|
||||
build/asm/boot_0x80085130.o(.text)
|
||||
build/asm/boot_0x80085320.o(.text)
|
||||
build/asm/boot_0x80085570.o(.text)
|
||||
build/asm/boot_0x80086110.o(.text)
|
||||
build/asm/boot_0x80086280.o(.text)
|
||||
build/asm/boot_0x800862E0.o(.text)
|
||||
build/asm/boot_0x80086760.o(.text)
|
||||
build/asm/boot_0x80087160.o(.text)
|
||||
build/asm/boot_0x80087830.o(.text)
|
||||
build/asm/boot_0x80087900.o(.text)
|
||||
build/asm/setcause.o(.text)
|
||||
build/src/libultra/os/sendmesg.o(.text)
|
||||
build/asm/boot_0x80087C60.o(.text)
|
||||
build/asm/boot_0x80087E00.o(.text)
|
||||
build/src/libultra/os/stopthread.o(.text)
|
||||
build/src/libultra/os/recvmesg.o(.text)
|
||||
build/asm/setintmask.o(.text)
|
||||
build/asm/getintmask.o(.text)
|
||||
build/asm/boot_0x80088110.o(.text)
|
||||
build/asm/boot_0x800882A0.o(.text)
|
||||
build/asm/sinf.o(.text)
|
||||
build/asm/sins.o(.text)
|
||||
build/asm/sptask.o(.text)
|
||||
build/asm/ll.o(.text)
|
||||
build/asm/exceptasm.o(.text)
|
||||
build/src/libultra/os/thread.o(.text)
|
||||
build/src/libultra/os/destroythread.o(.text)
|
||||
build/asm/boot_0x80089580.o(.text)
|
||||
build/asm/bzero.o(.text)
|
||||
build/asm/boot_0x800896D0.o(.text)
|
||||
build/asm/siacs.o(.text)
|
||||
build/asm/controller.o(.text)
|
||||
build/src/libultra/os/createthread.o(.text)
|
||||
build/asm/contreaddata.o(.text)
|
||||
build/asm/boot_0x8008A170.o(.text)
|
||||
build/src/libultra/os/virtualtophysical.o(.text)
|
||||
build/asm/getsr.o(.text)
|
||||
build/asm/setsr.o(.text)
|
||||
build/asm/writebackdcache.o(.text)
|
||||
build/asm/boot_0x8008A660.o(.text)
|
||||
build/asm/boot_0x8008AA10.o(.text)
|
||||
build/asm/perspective.o(.text)
|
||||
build/asm/boot_0x8008ACE0.o(.text)
|
||||
build/asm/sirawdma.o(.text)
|
||||
build/asm/boot_0x8008AE20.o(.text)
|
||||
build/asm/boot_0x8008AE70.o(.text)
|
||||
build/asm/boot_0x8008AEE0.o(.text)
|
||||
build/src/libultra/os/getthreadid.o(.text)
|
||||
build/asm/sptaskyield.o(.text)
|
||||
build/asm/boot_0x8008AF70.o(.text)
|
||||
build/asm/boot_0x8008B3C0.o(.text)
|
||||
build/asm/boot_0x8008B600.o(.text)
|
||||
build/asm/boot_0x8008B650.o(.text)
|
||||
build/asm/getconfig.o(.text)
|
||||
build/asm/setconfig.o(.text)
|
||||
build/asm/boot_0x8008B6D0.o(.text)
|
||||
build/asm/boot_0x8008B9F0.o(.text)
|
||||
build/src/libultra/os/stoptimer.o(.text)
|
||||
build/asm/probetlb.o(.text)
|
||||
build/asm/pimgr.o(.text)
|
||||
build/asm/piacs.o(.text)
|
||||
build/asm/boot_0x8008C260.o(.text)
|
||||
build/asm/boot_0x8008C740.o(.text)
|
||||
build/asm/getcount.o(.text)
|
||||
build/asm/boot_0x8008D2E0.o(.text)
|
||||
build/asm/boot_0x8008D350.o(.text)
|
||||
build/asm/boot_0x8008D470.o(.text)
|
||||
build/src/libultra/os/seteventmesg.o(.text)
|
||||
build/asm/sqrtf.o(.text)
|
||||
build/asm/boot_0x8008D710.o(.text)
|
||||
build/src/libultra/io/contquery.o(.text)
|
||||
build/asm/boot_0x8008D7D0.o(.text)
|
||||
build/asm/xprintf.o(.text)
|
||||
build/asm/boot_0x8008ED30.o(.text)
|
||||
build/asm/unmaptlball.o(.text)
|
||||
build/asm/pidma.o(.text)
|
||||
build/asm/boot_0x8008EED0.o(.text)
|
||||
build/asm/boot_0x8008F100.o(.text)
|
||||
build/src/libultra/libc/string.o(.text)
|
||||
build/asm/createmesgqueue.o(.text)
|
||||
build/asm/invalicache.o(.text)
|
||||
build/asm/invaldcache.o(.text)
|
||||
build/asm/timerintr.o(.text)
|
||||
build/asm/boot_0x8008F7D0.o(.text)
|
||||
build/asm/boot_0x8008FA00.o(.text)
|
||||
build/asm/si.o(.text)
|
||||
build/asm/boot_0x8008FA60.o(.text)
|
||||
build/src/libultra/os/jammesg.o(.text)
|
||||
build/asm/setthreadpri.o(.text)
|
||||
build/asm/getthreadpri.o(.text)
|
||||
build/asm/boot_0x8008FD00.o(.text)
|
||||
build/asm/boot_0x8008FE60.o(.text)
|
||||
build/asm/boot_0x8008FEB0.o(.text)
|
||||
build/asm/boot_0x800900C0.o(.text)
|
||||
build/asm/sptaskyielded.o(.text)
|
||||
build/asm/memcmp.o(.text)
|
||||
build/asm/gettime.o(.text)
|
||||
build/asm/boot_0x800904B0.o(.text)
|
||||
build/asm/setglobalintmask.o(.text)
|
||||
build/asm/boot_0x800906D0.o(.text)
|
||||
build/asm/boot_0x80090810.o(.text)
|
||||
build/asm/boot_0x80090900.o(.text)
|
||||
build/asm/boot_0x80090AF0.o(.text)
|
||||
build/asm/boot_0x80090C40.o(.text)
|
||||
build/asm/boot_0x80090E70.o(.text)
|
||||
build/asm/boot_0x800910A0.o(.text)
|
||||
build/asm/boot_0x80091210.o(.text)
|
||||
build/asm/boot_0x80091220.o(.text)
|
||||
build/asm/setcompare.o(.text)
|
||||
build/asm/getcompare.o(.text)
|
||||
build/asm/dpgetstat.o(.text)
|
||||
build/asm/dpsetstat.o(.text)
|
||||
build/asm/bcopy.o(.text)
|
||||
build/asm/resetglobalintmask.o(.text)
|
||||
build/asm/boot_0x80091630.o(.text)
|
||||
build/asm/ortho.o(.text)
|
||||
build/asm/interrupt.o(.text)
|
||||
build/asm/vi.o(.text)
|
||||
build/asm/viswapcontext.o(.text)
|
||||
build/asm/pigetcmdq.o(.text)
|
||||
build/asm/cosf.o(.text)
|
||||
build/asm/boot_0x800920B0.o(.text)
|
||||
build/asm/boot_0x80092100.o(.text)
|
||||
build/asm/coss.o(.text)
|
||||
build/asm/settime.o(.text)
|
||||
build/asm/boot_0x800922C0.o(.text)
|
||||
build/asm/boot_0x80092440.o(.text)
|
||||
build/asm/boot_0x80092730.o(.text)
|
||||
build/asm/boot_0x80092920.o(.text)
|
||||
build/asm/boot_0x80092A80.o(.text)
|
||||
build/asm/boot_0x80092C00.o(.text)
|
||||
build/asm/contsetch.o(.text)
|
||||
build/asm/setfpccsr.o(.text)
|
||||
build/asm/getfpccsr.o(.text)
|
||||
build/asm/boot_0x80092D00.o(.text)
|
||||
build/asm/boot_0x80092EE0.o(.text)
|
||||
build/asm/boot_0x800931F0.o(.text)
|
||||
build/asm/aigetlen.o(.text)
|
||||
build/asm/boot_0x80093BB0.o(.text)
|
||||
build/asm/maptlbrdb.o(.text)
|
||||
build/asm/yieldthread.o(.text)
|
||||
build/asm/boot_0x80093CC0.o(.text)
|
||||
build/asm/getcause.o(.text)
|
||||
build/asm/boot_0x80093DA0.o(.text)
|
||||
build/asm/boot_0x80093FF0.o(.text)
|
||||
build/asm/settimer.o(.text)
|
||||
build/asm/xldtob.o(.text)
|
||||
build/asm/ldiv.o(.text)
|
||||
build/asm/xlitob.o(.text)
|
||||
build/asm/sirawread.o(.text)
|
||||
build/asm/spgetstat.o(.text)
|
||||
build/asm/spsetstat.o(.text)
|
||||
build/asm/vimgr.o(.text)
|
||||
build/asm/vigetcurrcontext.o(.text)
|
||||
build/asm/writebackdcacheall.o(.text)
|
||||
build/src/libultra/os/getcurrfaultthread.o(.text)
|
||||
build/asm/boot_0x80095600.o(.text)
|
||||
build/asm/boot_0x80095740.o(.text)
|
||||
build/src/libultra/os/startthread.o(.text)
|
||||
build/asm/boot_0x80095900.o(.text)
|
||||
build/asm/boot_0x80095950.o(.text)
|
||||
build/asm/llcvt.o(.text)
|
||||
build/asm/boot_0x80095C70.o(.text)
|
||||
build/asm/boot_0x80096360.o(.text)
|
||||
build/asm/boot_0x80096410.o(.text)
|
||||
build/asm/boot_0x800964D0.o(.text)
|
||||
build/asm/spsetpc.o(.text)
|
||||
build/asm/boot_0x80096540.o(.text)
|
||||
build/asm/boot_0x80096770.o(.text)
|
||||
build/asm/boot_0x800967A0.o(.text)
|
||||
build/asm/boot_0x80096810.o(.text)
|
||||
build/asm/boot_0x80096820.o(.text)
|
||||
build/asm/boot_0x80096880.o(.text)
|
||||
build/asm/boot_0x800968B0.o(.text)
|
||||
build/asm/boot_0x800968F0.o(.text)
|
||||
build/asm/boot_0x80096930.o(.text)
|
||||
}
|
||||
|
||||
code 0x800A5AC0:
|
||||
{
|
||||
build/asm/code_0x800A5AC0.o(.text)
|
||||
build/asm/code_0x800A5D00.o(.text)
|
||||
build/asm/code_0x800A81F0.o(.text)
|
||||
build/asm/code_0x800ACBF0.o(.text)
|
||||
build/asm/code_0x800B32D0.o(.text)
|
||||
build/asm/code_0x800B3AD0.o(.text)
|
||||
build/asm/code_0x800BF9A0.o(.text)
|
||||
build/asm/code_0x800BFB80.o(.text)
|
||||
build/asm/code_0x800CAAD0.o(.text)
|
||||
build/asm/code_0x800CAE10.o(.text)
|
||||
build/asm/code_0x800E03A0.o(.text)
|
||||
build/asm/code_0x800E0410.o(.text)
|
||||
build/asm/code_0x800E8EA0.o(.text)
|
||||
build/asm/code_0x800E9360.o(.text)
|
||||
build/asm/code_0x800E9C90.o(.text)
|
||||
build/asm/code_0x800EE320.o(.text)
|
||||
build/asm/code_0x800EFE60.o(.text)
|
||||
build/asm/code_0x800F0390.o(.text)
|
||||
build/asm/code_0x800F05C0.o(.text)
|
||||
build/asm/code_0x800F07C0.o(.text)
|
||||
build/asm/code_0x800F1250.o(.text)
|
||||
build/asm/code_0x800F1460.o(.text)
|
||||
build/asm/code_0x800F2620.o(.text)
|
||||
build/asm/code_0x800F2D30.o(.text)
|
||||
build/asm/code_0x800F42A0.o(.text)
|
||||
build/asm/code_0x800F4F40.o(.text)
|
||||
build/asm/code_0x800F5090.o(.text)
|
||||
build/asm/code_0x800FEC90.o(.text)
|
||||
build/asm/code_0x801005C0.o(.text)
|
||||
build/asm/code_0x80102C60.o(.text)
|
||||
build/asm/code_0x80102E40.o(.text)
|
||||
build/asm/code_0x8010A000.o(.text)
|
||||
build/asm/code_0x8010A760.o(.text)
|
||||
build/asm/code_0x8010C0C0.o(.text)
|
||||
build/asm/code_0x8010C230.o(.text)
|
||||
build/asm/code_0x8010CB80.o(.text)
|
||||
build/asm/code_0x80122660.o(.text)
|
||||
build/asm/code_0x801226E0.o(.text)
|
||||
build/asm/code_0x8012BC50.o(.text)
|
||||
build/asm/code_0x8012D510.o(.text)
|
||||
build/asm/code_0x8012EC80.o(.text)
|
||||
build/asm/code_0x8012F2E0.o(.text)
|
||||
build/asm/code_0x801307C0.o(.text)
|
||||
build/asm/code_0x801322C0.o(.text)
|
||||
build/asm/code_0x801323D0.o(.text)
|
||||
build/asm/code_0x80137970.o(.text)
|
||||
build/asm/code_0x80138410.o(.text)
|
||||
build/asm/code_0x80138BA0.o(.text)
|
||||
build/asm/code_0x8013A240.o(.text)
|
||||
build/asm/code_0x8013A7C0.o(.text)
|
||||
build/asm/code_0x8013EC10.o(.text)
|
||||
build/asm/code_0x8013EE60.o(.text)
|
||||
build/asm/code_0x80140260.o(.text)
|
||||
build/asm/code_0x80140E80.o(.text)
|
||||
build/asm/code_0x801418B0.o(.text)
|
||||
build/asm/code_0x801420C0.o(.text)
|
||||
build/asm/code_0x80142440.o(.text)
|
||||
build/asm/code_0x80147520.o(.text)
|
||||
build/asm/code_0x801588D0.o(.text)
|
||||
build/asm/code_0x8015E750.o(.text)
|
||||
build/asm/code_0x80160A90.o(.text)
|
||||
build/asm/code_0x80161180.o(.text)
|
||||
build/asm/code_0x801639A0.o(.text)
|
||||
build/asm/code_0x80163C90.o(.text)
|
||||
build/asm/code_0x80163DC0.o(.text)
|
||||
build/asm/code_0x801647D0.o(.text)
|
||||
build/asm/code_0x80164AF0.o(.text)
|
||||
build/asm/code_0x801651B0.o(.text)
|
||||
build/asm/code_0x8016AC10.o(.text)
|
||||
build/asm/code_0x801727F0.o(.text)
|
||||
build/asm/code_0x80172A00.o(.text)
|
||||
build/asm/code_0x80172BC0.o(.text)
|
||||
build/asm/code_0x80172C30.o(.text)
|
||||
build/asm/code_0x80173130.o(.text)
|
||||
build/asm/code_0x80173BF0.o(.text)
|
||||
build/asm/code_0x80173D30.o(.text)
|
||||
build/asm/code_0x80174A40.o(.text)
|
||||
build/asm/code_0x80174AA0.o(.text)
|
||||
build/asm/code_0x80174BF0.o(.text)
|
||||
build/asm/code_0x80174F10.o(.text)
|
||||
build/asm/code_0x80176280.o(.text)
|
||||
build/asm/code_0x80177390.o(.text)
|
||||
build/asm/code_0x80178750.o(.text)
|
||||
build/asm/code_0x80178F30.o(.text)
|
||||
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/asm/code_0x801830A0.o(.text)
|
||||
build/asm/code_0x80185F90.o(.text)
|
||||
build/asm/code_0x801877D0.o(.text)
|
||||
build/asm/code_0x8018B0F0.o(.text)
|
||||
build/asm/code_0x8018EB60.o(.text)
|
||||
build/asm/code_0x80192BE0.o(.text)
|
||||
build/asm/code_0x80194710.o(.text)
|
||||
build/asm/code_0x80194930.o(.text)
|
||||
build/asm/code_0x801974D0.o(.text)
|
||||
build/asm/code_0x8019AE40.o(.text)
|
||||
build/asm/code_0x8019AEC0.o(.text)
|
||||
build/asm/code_0x8019AF00.o(.text)
|
||||
build/asm/code_0x801A51F0.o(.text)
|
||||
build/asm/code_0x801A5BD0.o(.text)
|
||||
build/asm/code_0x801A7B10.o(.text)
|
||||
build/asm/code_0x801AA020.o(.text)
|
||||
build/asm/code_0x801AA610.o(.text)
|
||||
build/asm/code_0x801AAAA0.o(.text)
|
||||
build/asm/code_0x801AAAB0.o(.text)
|
||||
}
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
import os
|
||||
import struct
|
||||
|
||||
FILENAME = 'build/rom.elf'
|
||||
OUT = 'rom.z64'
|
||||
|
||||
try:
|
||||
with open(FILENAME, 'rb') as f:
|
||||
fileData = f.read()
|
||||
except IOError:
|
||||
print('failed to read file ' + FILENAME)
|
||||
|
||||
def read_uint32_be(offset):
|
||||
return struct.unpack('>I', fileData[offset:offset+4])[0]
|
||||
|
||||
def read_uint16_be(offset):
|
||||
return struct.unpack('>H', fileData[offset:offset+2])[0]
|
||||
|
||||
with open(OUT, 'wb') as w:
|
||||
sht_off = read_uint32_be(0x20)
|
||||
sh_size = read_uint16_be(0x2E)
|
||||
num_sections = read_uint16_be(0x30)
|
||||
|
||||
total_size = 0
|
||||
for i in range(0, num_sections):
|
||||
type_ = read_uint32_be(sht_off + i*sh_size + 0x04)
|
||||
offset = read_uint32_be(sht_off + i*sh_size + 0x10)
|
||||
size = read_uint32_be(sht_off + i*sh_size + 0x14)
|
||||
if type_ == 1:# SHT_PROGBITS
|
||||
total_size += size
|
||||
w.write(fileData[offset:offset+size])
|
||||
|
||||
while total_size < 0x2000000:
|
||||
w.write((total_size % 256).to_bytes(1,"big"))
|
||||
total_size += 1
|
||||
|
||||
+1629
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,177 @@
|
||||
import struct;
|
||||
from tkinter import *;
|
||||
from tkinter.ttk import *
|
||||
from PIL import Image, ImageTk, ImageDraw
|
||||
|
||||
import png;
|
||||
|
||||
#FILE_NAME = 'baserom/jpn_font_static'
|
||||
FILE_NAME = 'decomp/object_boss03'
|
||||
|
||||
data = []
|
||||
image_data = [];
|
||||
|
||||
try:
|
||||
with open(FILE_NAME, 'rb') as f:
|
||||
data = f.read()
|
||||
except IOError:
|
||||
print('failed to read file ' + FILE_NAME)
|
||||
sys.exit(1)
|
||||
|
||||
#size = 0x80
|
||||
height = 32
|
||||
width = 32
|
||||
pixel_width = 2
|
||||
size = height*width*pixel_width
|
||||
scale = 4
|
||||
|
||||
window = Tk()
|
||||
|
||||
window.title("MM Texture viewer")
|
||||
window.geometry('500x500')
|
||||
|
||||
def load_file():
|
||||
print('load')
|
||||
update_image()
|
||||
|
||||
def read_i4_image(data, image_data):
|
||||
for i in range(0, len(data)):
|
||||
byte = data[i]
|
||||
color1 = ((byte >> 4) & 0xF) * 17
|
||||
color2 = (byte & 0xF) * 17
|
||||
image_data.append(color1)
|
||||
image_data.append(color1)
|
||||
image_data.append(color1)
|
||||
image_data.append(255)
|
||||
image_data.append(color2)
|
||||
image_data.append(color2)
|
||||
image_data.append(color2)
|
||||
image_data.append(255)
|
||||
|
||||
def read_i8_image(data, image_data):
|
||||
for i in range(0, len(data)):
|
||||
byte = data[i]
|
||||
image_data.append(byte)
|
||||
image_data.append(byte)
|
||||
image_data.append(byte)
|
||||
image_data.append(255)
|
||||
|
||||
def read_ia4_image(data, image_data):
|
||||
None
|
||||
|
||||
def read_ia8_image(data, image_data):
|
||||
None
|
||||
|
||||
def read_ia16_image(data, image_data):
|
||||
None
|
||||
|
||||
def read_rbg5a1_image(data, image_data):
|
||||
for i in range(0, len(data) // 2):
|
||||
byte1 = data[i*2]
|
||||
byte2 = data[i*2 + 1]
|
||||
red = (byte1 >> 3)*8
|
||||
green = (((byte1&0x7)<<2) | ((byte2>>6)&0x3))*8
|
||||
blue = ((byte2 >> 1) & 0x1F)*8
|
||||
alpha = (byte2&0x1)*0xFF
|
||||
image_data.append(red)
|
||||
image_data.append(green)
|
||||
image_data.append(blue)
|
||||
image_data.append(alpha)
|
||||
|
||||
def read_rbga32_image(data, image_data):
|
||||
for i in range(0, len(data)):
|
||||
byte = data[i]
|
||||
image_data.append(byte)
|
||||
|
||||
def read_ci4_image(data, image_data):
|
||||
None
|
||||
|
||||
def read_ci8_image(data, image_data):
|
||||
None
|
||||
|
||||
def update_image(*args):
|
||||
global image_label
|
||||
global image_data
|
||||
global data
|
||||
|
||||
image_data = []
|
||||
|
||||
texture_type = texture_type_combo.get()
|
||||
if texture_type == 'i4':
|
||||
read_i4_image(data, image_data)
|
||||
elif texture_type == 'i8':
|
||||
read_i8_image(data, image_data)
|
||||
elif texture_type == 'ia4':
|
||||
read_ia4_image(data, image_data)
|
||||
elif texture_type == 'ia8':
|
||||
read_ia8_image(data, image_data)
|
||||
elif texture_type == 'ia16':
|
||||
read_ia16_image(data, image_data)
|
||||
elif texture_type == 'rbg5a1':
|
||||
read_rbg5a1_image(data, image_data)
|
||||
elif texture_type == 'rbga32':
|
||||
read_rbga32_image(data, image_data)
|
||||
elif texture_type == 'ci4':
|
||||
read_ci4_image(data, image_data)
|
||||
elif texture_type == 'ci8':
|
||||
read_ci8_image(data, image_data)
|
||||
else:
|
||||
print('other type')
|
||||
|
||||
offset = int(offset_spinbox.get())
|
||||
|
||||
image = Image.frombytes("RGBA", (width, height), bytes(image_data[offset*4:])).resize((width*scale, height*scale))
|
||||
image_tk = ImageTk.PhotoImage(image=image)
|
||||
image_label.configure(image=image_tk)
|
||||
image_label.image = image_tk # prevent GC?
|
||||
|
||||
|
||||
|
||||
load_button = Button(window, text='Load File', command=load_file)
|
||||
load_button.pack()
|
||||
|
||||
texture_type_combo = Combobox(window)
|
||||
texture_type_combo['values'] = ('i4', 'i8', 'ia4', 'ia8', 'ia16', 'rbg5a1', 'rbga32', 'ci4', 'ci8')
|
||||
texture_type_combo.current(5)
|
||||
texture_type_combo.bind("<<ComboboxSelected>>", update_image)
|
||||
texture_type_combo.pack()
|
||||
|
||||
# TODO textures should be able to only take a few discret values, find them
|
||||
width_default = StringVar(window)
|
||||
width_default.set("32")
|
||||
width_spinbox = Spinbox(window, from_=1, to=48, textvariable=width_default, command=update_image)
|
||||
width_spinbox.pack();
|
||||
|
||||
offset_default = StringVar(window)
|
||||
offset_default.set("0")
|
||||
offset_spinbox = Spinbox(window, from_=0, to=len(data), textvariable=offset_default, command=update_image)
|
||||
offset_spinbox.pack();
|
||||
|
||||
image_label = Label(window)
|
||||
image_label.pack()
|
||||
|
||||
update_image()
|
||||
|
||||
window.mainloop()
|
||||
|
||||
#for i in range(0, len(data) // size):
|
||||
# texture_data = data[(i * size):((i + 1) * size)]
|
||||
#
|
||||
# with open('font_test2/' + str(i) + '.png', 'wb') as f:
|
||||
# w = png.Writer(width, height, alpha=True)#, greyscale=True)#
|
||||
# png_data = [];
|
||||
# for y in range(0, height):
|
||||
# row = []
|
||||
# '''
|
||||
# for x in range(0, 16//2):
|
||||
# byte = texture_data[8*y + x]
|
||||
# row.append(((byte >> 4) & 0xF) * 17)
|
||||
# row.append((byte & 0xF) * 17)
|
||||
# '''
|
||||
# '''
|
||||
# for x in range(0, width*pixel_width):
|
||||
# byte = texture_data[width*pixel_width*y + x]
|
||||
# row.append(byte)
|
||||
# '''
|
||||
# png_data.append(row)
|
||||
# w.write(f, png_data)
|
||||
+237
@@ -0,0 +1,237 @@
|
||||
known_funcs = {
|
||||
0x80080060:("func_80080060","UNK_RET","void"),
|
||||
0x80080150:("func_80080150","void","UNK_PTR, UNK_PTR"),
|
||||
0x80080180:("func_80080180","void","UNK_TYPE*, UNK_TYPE, UNK_TYPE"),
|
||||
0x8008019C:("func_8008019C","UNK_RET","void"),
|
||||
0x800801EC:("func_800801EC","UNK_RET","void"),
|
||||
0x80080250:("func_80080250","UNK_RET","void"),
|
||||
0x80080300:("func_80080300","UNK_RET","UNK_TYPE"),
|
||||
0x8008038C:("func_8008038C","UNK_RET","void"),
|
||||
0x80080514:("func_80080514","void","UNK_TYPE"),
|
||||
0x800805E0:("func_800805E0","UNK_RET","UNK_TYPE"),
|
||||
0x80080C04:("func_80080C04","UNK_RET","UNK_PTR, UNK_FUN_ARG, UNK_PTR, UNK_TYPE, UNK_TYPE, UNK_PTR, UNK_TYPE"),
|
||||
0x80080D0C:("func_80080D0C","UNK_RET","void"),
|
||||
0x80080E00:("func_80080E00","UNK_RET","void"),
|
||||
0x80081754:("func_80081754","UNK_RET","UNK_PTR, struct s80085320*, UNK_TYPE, UNK_TYPE"),
|
||||
0x80081820:("func_80081820","void","void"),
|
||||
0x80081828:("func_80081828","void","void"),
|
||||
0x80081830:("func_80081830","void","void"),
|
||||
0x8008189C:("func_8008189C","void","void"),
|
||||
0x800818D0:("func_800818D0","void","void"),
|
||||
0x800818F4:("func_800818F4","void","void"),
|
||||
0x800819F0:("func_800819F0","UNK_RET","UNK_PTR, void(*)(UNK_TYPE, UNK_TYPE), UNK_TYPE, UNK_TYPE"),
|
||||
0x80081AD4:("func_80081AD4","UNK_RET","UNK_PTR"),
|
||||
0x80081BCC:("func_80081BCC","UNK_RET","UNK_PTR, UNK_TYPE(*)(UNK_TYPE, UNK_TYPE), UNK_TYPE"),
|
||||
0x80081CA4:("func_80081CA4","UNK_RET","UNK_PTR"),
|
||||
0x8008439C:("func_8008439C","UNK_RET","UNK_TYPE, UNK_TYPE"),
|
||||
0x800847CC:("func_800847CC","UNK_RET","UNK_PTR, ..."), # printf?
|
||||
0x8008481C:("func_8008481C","UNK_RET","UNK_TYPE, UNK_TYPE, UNK_PTR, UNK_PTR"),
|
||||
0x80085320:("func_80085320","void","struct s80085320*, UNK_PTR, UNK_PTR, UNK_TYPE, UNK_TYPE, UNK_PTR"),
|
||||
0x800853F8:("func_800853F8","UNK_RET","struct s80085320*"),
|
||||
0x80085468:("func_80085468","UNK_TYPE","struct s80085320*"),
|
||||
0x800854E0:("func_800854E0","UNK_TYPE","UNK_ARGS"),
|
||||
0x80085538:("func_80085538","UNK_RET","struct s80085320*"),
|
||||
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"),
|
||||
0x80087B00:("__osSetCause","void","u32 value"),
|
||||
0x80087B10:("osSendMesg","s32","OSMesgQueue* mq, OSMesg msg, s32 flags"),
|
||||
0x80087E00:("func_80087E00","void","u32"),
|
||||
0x80087E10:("osStopThread","void","OSThread* t"),
|
||||
0x80087ED0:("osRecvMesg","s32","OSMesgQueue* mq, OSMesg* msg, s32 flags"),
|
||||
0x80088010:("osSetIntMask","OSIntMask","OSIntMask im"),
|
||||
0x800880B0:("osGetIntMask","OSIntMask","void"),
|
||||
0x80088350:("__sinf","float","float x"), # multiple names? __sinf/fsin/sinf
|
||||
0x80088510:("sins","short","unsigned short x"),
|
||||
0x80088580:("_VirtualToPhysicalTask","OSTask*","OSTask* intp"), # Note: not exported
|
||||
0x8008868C:("osSpTaskLoad","void","OSTask* intp"),
|
||||
0x800887F4:("osSpTaskStartGo","void","OSTask* tp"),
|
||||
0x80088840:("__ull_rshift","long long","unsigned long long left, long long right"),
|
||||
0x8008886C:("__ull_rem","unsigned long long","unsigned long long left, unsigned long long right"),
|
||||
0x800888A8:("__ull_div","unsigned long long","unsigned long long left, unsigned long long right"),
|
||||
0x800888E4:("__ll_lshift","long long","long long left, long long right"),
|
||||
0x80088910:("__ll_rem","long long","long long left, unsigned long long right"),
|
||||
0x8008894C:("__ll_div","long long","long long left, long long right"),
|
||||
0x800889A8:("__ll_mul","long long","long long left, long long right"),
|
||||
0x800889D8:("__ull_divremi","void","unsigned long long* quotient, unsigned long long* remainder, unsigned long long dividend, unsigned short divisor"),
|
||||
0x80088A38:("__ll_mod","long long","long long left, long long right"),
|
||||
0x80088AD4:("__ll_rshift","long long","long long left, long long right"),
|
||||
0x80088B00:("__osExceptionPreamble","UNK_RET","UNK_ARGS"),
|
||||
0x80088B10:("__osException","UNK_RET","UNK_ARGS"),
|
||||
0x8008905C:("send_mesg","UNK_RET","UNK_ARGS"),
|
||||
0x80089110:("handle_CpU","UNK_RET","UNK_ARGS"),
|
||||
0x80089144:("__osEnqueueAndYield","UNK_RET","OSThread**"),
|
||||
0x80089244:("__osEnqueueThread","UNK_RET","UNK_PTR, OSThread*"),
|
||||
0x8008928C:("__osPopThread","OSThread*","OSThread**"),
|
||||
0x800892A4:("__osDispatchThread","UNK_RET","void"), # TODO is this really void?
|
||||
0x80089420:("__osCleanupThread","UNK_RET","UNK_ARGS"),
|
||||
0x80089430:("__osDequeueThread","UNK_RET","OSThread**, OSThread*"),
|
||||
0x80089470:("osDestroyThread","void","OSThread* t"),
|
||||
0x80089630:("_blkclr","UNK_RET","u8*, u32"), # multiple names? bzero/_bzero/blkclr/_blkclr
|
||||
0x80089AA0:("__osSiCreateAccessQueue","void","void"),
|
||||
0x80089AF0:("__osSiGetAccess","void","void"),
|
||||
0x80089B34:("__osSiRelAccess","void","void"),
|
||||
0x80089B60:("osContInit","s32","OSMesgQueue* mq, u8* bitpattern, OSContStatus* data"),
|
||||
0x80089CBC:("__osContGetInitData","void","u8* pattern, OSContStatus* data"),
|
||||
0x80089D68:("__osPackRequestData","void","u8 cmd"),
|
||||
0x80089E40:("osCreateThread","void","OSThread* t, OSId id, void (*entry)(void*), void* arg, void* sp, OSPri p"),
|
||||
0x80089F90:("osContStartReadData","s32","OSMesgQueue* mq"),
|
||||
0x8008A014:("osContGetReadData","void","OSContPad* data"),
|
||||
0x8008A540:("osVirtualToPhysical","u32","void* virtualAddress"),
|
||||
0x8008A5C0:("__osGetSR","u32","void"),
|
||||
0x8008A5D0:("__osSetSR","void","u32 value"),
|
||||
0x8008A5E0:("osWritebackDCache","void","void *vaddr, s32 nbytes"),
|
||||
0x8008A660:("func_8008A660","void","void"),
|
||||
0x8008A6FC:("func_8008A6FC","void","void"),
|
||||
0x8008A9A8:("func_8008A9A8","void","void"),
|
||||
0x8008AA50:("guPerspectiveF","void","float* mf[4], u16* perspNorm, float fovy, float aspect, float near, float far, float scale"),
|
||||
0x8008AC80:("guPerspective","void","Mtx* m, u16* perspNorm, float fovy, float aspect, float near, float far, float scale"),
|
||||
0x8008ACE0:("__osSpRawStartDma","s32","s32 direction, u32 devAddr, void* dramAddr, u32 size"),
|
||||
0x8008AD70:("__osSiRawStartDma","s32","s32 direction, void* dramAddr"),
|
||||
0x8008AE70:("func_8008AE70","UNK_RET","UNK_TYPE"),
|
||||
0x8008AEE0:("func_8008AEE0","UNK_TYPE","UNK_TYPE, UNK_PTR"),
|
||||
0x8008AF30:("osGetThreadId","OSId","OSThread* t"),
|
||||
0x8008AF50:("osSpTaskYield","void","void"),
|
||||
0x8008B650:("func_8008B650","UNK_RET","UNK_PTR"),
|
||||
0x8008B6B0:("__osGetConfig","u32 ","void "),
|
||||
0x8008B6C0:("__osSetConfig","void ","u32 value"),
|
||||
0x8008BE70:("osStopTimer","int","OSTimer* t"),
|
||||
0x8008BF60:("__osProbeTLB","u32","void*"),
|
||||
0x8008C020:("osCreatePiManager","void","OSPri pri, OSMesgQueue* cmdQ, OSMesg* cmdBuf, s32 cmdMsgCnt"),
|
||||
0x8008C190:("__osPiCreateAccessQueue","void","void"),
|
||||
0x8008C1E0:("__osPiGetAccess","void","void"),
|
||||
0x8008C224:("__osPiRelAccess","void","void"),
|
||||
0x8008D2C0:("osGetCount","u32","void"),
|
||||
0x8008D350:("func_8008D350","UNK_TYPE","void"),
|
||||
0x8008D640:("osSetEventMesg","void","OSEvent e, OSMesgQueue* mq, OSMesg m"),
|
||||
0x8008D700:("sqrtf","UNK_RET","UNK_ARGS"),
|
||||
0x8008D730:("osContStartQuery","s32","OSMesgQueue* mq"),
|
||||
0x8008D7AC:("osContGetQuery","void","OSContStatus* data"),
|
||||
0x8008E050:("_Printf","int","void* (*pfn)(void*), void* arg, const unsigned char* fmt, va_list ap"),
|
||||
0x8008E698:("func_8008E698","UNK_RET","UNK_ARGS"), # this does not have a name? (maybe not exported idk) (_Putfld?)
|
||||
0x8008EDE0:("osUnmapTLBAll","void","void"),
|
||||
0x8008EE30:("osPiStartDma","s32","OSIoMesg* mb, s32 priority, s32 direction, u32 devAddr, void* dramAddr, u32 size, OSMesgQueue* mq"),
|
||||
0x8008F1A0:("strchr","unsigned char*","const unsigned char* s, int c"),
|
||||
0x8008F1E0:("strlen","size_t","const unsigned char* s"), # unsigned int == size_t
|
||||
0x8008F208:("memcpy","void*","void* s1, const void* s2, size_t n"), # unsigned int == size_t
|
||||
0x8008F240:("osCreateMesgQueue","void","OSMesgQueue* mq, OSMesg* msg, s32 msgCount"),
|
||||
0x8008F270:("osInvalICache","void","void *vaddr, s32 nbytes"),
|
||||
0x8008F2F0:("osInvalDCache","void","void *vaddr, s32 nbytes"),
|
||||
0x8008F3A0:("__osTimerServicesInit","void","void"),
|
||||
0x8008F42C:("__osTimerInterrupt","void","void"),
|
||||
0x8008F5A4:("__osSetTimerIntr","void","OSTime tim"),
|
||||
0x8008F644:("__osInsertTimer","OSTime","OSTimer* t"),
|
||||
0x8008FA00:("__osSpDeviceBusy","int","void"),
|
||||
0x8008FA30:("__osSiDeviceBusy","int","void"),
|
||||
0x8008FAB0:("osJamMesg","s32","OSMesgQueue* mq, OSMesg msg, s32 flags"),
|
||||
0x8008FC00:("osSetThreadPri","void","OSThread* t, OSPri p"),
|
||||
0x8008FCE0:("osGetThreadPri","OSPri","OSThread* t"),
|
||||
0x8008FE60:("func_8008FE60","UNK_RET","UNK_PTR"),
|
||||
0x800902A0:("osSpTaskYielded","void","void"),
|
||||
0x80090300:("memcmp","UNK_RET","UNK_ARGS"), # multiple names? memcmp/bcmp/_bcmp
|
||||
0x80090420:("osGetTime","OSTime","void"),
|
||||
0x80090680:("__osSetGlobalIntMask","UNK_RET","UNK_ARGS"),
|
||||
0x80091280:("__osSetCompare","void","u32 value"),
|
||||
0x80091290:("__osGetCompare","u32","void"),
|
||||
0x800912A0:("osDpGetStatus","u32","void"),
|
||||
0x800912B0:("osDpSetStatus","void","u32 data"),
|
||||
0x800912C0:("_bcopy","void","const void* src, void* dst, size_t n"), # multiple names? bcopy/_bcopy
|
||||
0x800915D0:("__osResetGlobalIntMask","UNK_RET","UNK_ARGS"),
|
||||
0x800918A0:("guOrthoF","void","float* mf[4], float l, float r, float b, float t, float n, float f, float scale"),
|
||||
0x800919F4:("guOrtho","void","Mtx* m, float l, float r, float b, float t, float n, float f, float scale"),
|
||||
0x80091A60:("__osDisableInt","u32","void"),
|
||||
0x80091AD0:("__osRestoreInt","void","u32"),
|
||||
0x80091AF0:("__osViInit","void","void"),
|
||||
0x80091C10:("__osViSwapContext","void","void"),
|
||||
0x80091F10:("osPiGetCmdQueue","OSMesgQueue*","void"),
|
||||
0x80091f40:("__cosf","float","float x"), # multiple names? __cosf/fcos/cosf
|
||||
0x80092100:("func_80092100","UNK_RET","UNK_TYPE"),
|
||||
0x80092260:("coss","short","unsigned short x"),
|
||||
0x80092290:("osSetTime","void","OSTime ticks"),
|
||||
0x80092920:("func_80092920","struct s80092920*","void"),
|
||||
0x80092C80:("osContSetCh","s32","u8 ch"),
|
||||
0x80092CE0:("__osSetFpcCsr","void","u32 value"),
|
||||
0x80092CF0:("__osGetFpcCsr","u32","void"),
|
||||
0x80093BA0:("osAiGetLength","u32","void"),
|
||||
0x80093C00:("osMapTLBRdb","void","void"),
|
||||
0x80093C60:("osYieldThread","void","void"),
|
||||
0x80093D90:("__osGetCause","u32","void"),
|
||||
0x80094150:("osSetTimer","int","OSTimer* t, OSTime value, OSTime interval, OSMesgQueue* mq, OSMesg msg"),
|
||||
0x800942E0:("_Ldtob","void","_Pft* px, unsigned char code"),
|
||||
0x80094770:("func_80094770","UNK_RET","UNK_ARGS"), # this does not have a name? (maybe not exported idk) (_Ldunscale?)
|
||||
0x80094828:("func_80094828","UNK_RET","UNK_ARGS"), # this does not have a name? (maybe not exported idk) (_Genld?)
|
||||
0x80094DF0:("ldiv","ldiv_t","long numer, long denom"),
|
||||
0x80094E74:("lldiv","lldiv_t","long long numer, long long denom"),
|
||||
0x80094F80:("_Litob","void","_Pft* px, unsigned char code"),
|
||||
0x80095220:("__osSiRawReadIo","s32","u32 devAddr, u32* data"),
|
||||
0x80095270:("__osSpGetStatus","u32","void"),
|
||||
0x80095280:("__osSpSetStatus","void","u32 data"),
|
||||
0x800952A0:("osCreateViManager","void","OSPri pri"),
|
||||
0x800955F0:("__osGetCurrFaultedThread","OSThread*","void"),
|
||||
0x800955B0:("__osViGetCurrentContext","__OSViContext*","void"),
|
||||
0x800955C0:("osWritebackDCacheAll","void","void"),
|
||||
0x80095740:("guMtxF2L","void","float* mf[4], Mtx* m"),
|
||||
0x800957B0:("osStartThread","void","OSThread* t"),
|
||||
0x80095900:("func_80095900","void","f32"),
|
||||
0x80095950:("func_80095950","UNK_RET","f32"),
|
||||
0x80095A60:("__d_to_ll","long long","double d"),
|
||||
0x80095A7C:("__f_to_ll","long long","float f"),
|
||||
0x80095A98:("__d_to_ull","unsigned long long","double d"),
|
||||
0x80095B38:("__f_to_ull","unsigned long long","float f"),
|
||||
0x80095BD4:("__ll_to_d","double","long long l"),
|
||||
0x80095BEC:("__ll_to_f","float","long long l"),
|
||||
0x80095C04:("__ull_to_d","double","unsigned long long l"),
|
||||
0x80095C38:("__ull_to_f","float","unsigned long long l"),
|
||||
0x80096510:("__osSpSetPc","s32","u32 data"),
|
||||
0x80096820:("func_80096820","UNK_RET","UNK_TYPE"),
|
||||
0x800968B0:("func_800968B0","u32","const u8*, const u8*"),
|
||||
0x80097540:("osViModeNtscHpf1","UNK_RET","UNK_ARGS"),
|
||||
0x80097eb0:("osViModeNtscHpn1","UNK_RET","UNK_ARGS"),
|
||||
0x80097fc0:("osViModeNtscLan1","UNK_RET","UNK_ARGS"),
|
||||
0x80098010:("osViModeMpalLan1","UNK_RET","UNK_ARGS"),
|
||||
0x800991a0:("__osRcpImTable","UNK_RET","UNK_ARGS"),
|
||||
0x80099450:("__libm_qnan_f","UNK_RET","UNK_ARGS"),
|
||||
0x800A5AC0:("func_800A5AC0","UNK_RET","void*, UNK_TYPE"), # guessing this is void* bc it's a thread entry point
|
||||
0x800A5B6C:("func_800A5B6C","UNK_RET","struct s800A5AC0*, UNK_TYPE"),
|
||||
0x800A5B98:("func_800A5B98","UNK_RET","struct s800A5AC0*, UNK_TYPE"),
|
||||
0x800A5C28:("func_800A5C28","UNK_RET","struct s800A5AC0*, UNK_TYPE"),
|
||||
0x800A5C60:("func_800A5C60","UNK_RET","struct s800A5AC0*, UNK_TYPE"),
|
||||
0x800A5CB8:("func_800A5CB8","UNK_RET","struct s800A5AC0*, UNK_TYPE"),
|
||||
0x800B3BA4:("func_800B3BA4","UNK_RET","UNK_PTR, UNK_TYPE, UNK_PTR, UNK_TYPE"),
|
||||
0x800B3FC0:("func_800B3FC0","UNK_TYPE","UNK_TYPE"),
|
||||
0x800B675C:("func_800B675C","UNK_RET","struct s800A5AC0*, UNK_TYPE"),
|
||||
0x800B84D0:("func_800B84D0","UNK_TYPE","struct s800A5AC0*, UNK_TYPE"),
|
||||
0x800B863C:("func_800B863C","UNK_RET","struct s800A5AC0*, UNK_TYPE"),
|
||||
0x800B867C:("func_800B867C","UNK_TYPE","struct s800A5AC0*"),
|
||||
0x800BDFC0:("func_800BDFC0","UNK_RET","UNK_TYPE, UNK_TYPE, UNK_TYPE, struct s800A5AC0*"),
|
||||
0x800C6024:("func_800C6024","UNK_TYPE","UNK_TYPE"),
|
||||
0x800C6248:("func_800C6248","UNK_TYPE","UNK_TYPE, UNK_TYPE"),
|
||||
0x800CAAD0:("func_800CAAD0","UNK_RET","UNK_TYPE, UNK_TYPE, UNK_TYPE"),
|
||||
0x800CAC0C:("func_800CAC0C","UNK_RET","UNK_TYPE, UNK_TYPE, UNK_TYPE"),
|
||||
0x800CACA0:("func_800CACA0","UNK_RET","UNK_TYPE, UNK_TYPE, UNK_TYPE"),
|
||||
0x800CAD2C:("func_800CAD2C","UNK_TYPE","UNK_TYPE, UNK_TYPE, UNK_TYPE"),
|
||||
0x800CAE88:("func_800CAE88","UNK_RET","UNK_TYPE"),
|
||||
0x800CAF24:("func_800CAF24","UNK_RET","UNK_TYPE"),
|
||||
0x800CAF38:("func_800CAF38","UNK_RET","UNK_TYPE"),
|
||||
0x800E11EC:("func_800E11EC","UNK_RET","UNK_TYPE, UNK_PTR"),
|
||||
0x800E1374:("func_800E1374","UNK_RET","UNK_TYPE, UNK_PTR, struct s800A5AC0*, UNK_PTR"),
|
||||
0x800E2928:("func_800E2928","UNK_RET","UNK_TYPE, UNK_TYPE, UNK_PTR"),
|
||||
0x800E7DF8:("func_800E7DF8","UNK_RET","struct s800A5AC0*, UNK_PTR"),
|
||||
0x800FFADC:("func_800FFADC","UNK_RET","struct s800A5AC0*, UNK_PTR"),
|
||||
0x80138C88:("func_80138C88","UNK_RET","UNK_PTR, UNK_PTR, UNK_PTR"),
|
||||
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"),
|
||||
0x8018349C:("func_8018349C","UNK_RET","UNK_TYPE, UNK_TYPE"),
|
||||
|
||||
# ovl_En_Test
|
||||
#0x80862B70:("func_80862B70","void","void* a0"),
|
||||
#0x80862CBC:("func_80862CBC","UNK_RET","UNK_ARGS"),
|
||||
#0x80862EDC:("func_80862EDC","UNK_RET","UNK_ARGS"),
|
||||
#0x80863048:("func_80863048","UNK_RET","UNK_ARGS"),
|
||||
#0x80863188:("func_80863188","UNK_RET","UNK_ARGS"),
|
||||
#0x80863310:("func_80863310","UNK_RET","UNK_ARGS"),
|
||||
#0x8086333C:("func_8086333C","UNK_RET","UNK_ARGS"),
|
||||
#0x808634B8:("func_808634B8","UNK_RET","UNK_ARGS"),
|
||||
#0x808636A8:("func_808636A8","UNK_RET","UNK_ARGS"),
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
#ifndef _ULTRATYPES_H_
|
||||
#define _ULTRATYPES_H_
|
||||
|
||||
typedef unsigned char u8;
|
||||
typedef unsigned short u16;
|
||||
typedef unsigned long u32;
|
||||
typedef unsigned long long u64;
|
||||
typedef signed char s8;
|
||||
typedef short s16;
|
||||
typedef long s32;
|
||||
typedef long long s64;
|
||||
|
||||
typedef volatile unsigned char vu8;
|
||||
typedef volatile unsigned short vu16;
|
||||
typedef volatile unsigned long vu32;
|
||||
typedef volatile unsigned long long vu64;
|
||||
typedef volatile signed char vs8;
|
||||
typedef volatile short vs16;
|
||||
typedef volatile long vs32;
|
||||
typedef volatile long long vs64;
|
||||
|
||||
typedef float f32;
|
||||
typedef double f64;
|
||||
|
||||
#define NULL ((void*)0)
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,4 @@
|
||||
#ifndef _ASSERT_H_
|
||||
#define _ASSERT_H_
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,4 @@
|
||||
#ifndef _BSTRING_H_
|
||||
#define _BSTRING_H_
|
||||
|
||||
#endif
|
||||
+19489
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
#ifndef _GLOBAL_H_
|
||||
#define _GLOBAL_H_
|
||||
|
||||
#include "structs.h"
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
#endif
|
||||
+227
@@ -0,0 +1,227 @@
|
||||
#ifndef _OS_H_
|
||||
#define _OS_H_
|
||||
|
||||
#include <PR/ultratypes.h>
|
||||
|
||||
typedef s32 OSPri;
|
||||
|
||||
typedef s32 OSId;
|
||||
|
||||
typedef union {
|
||||
/* 0 */ struct {
|
||||
/* 0 */ f32 f_odd;
|
||||
/* 4 */ f32 f_even;
|
||||
} f;
|
||||
/* 0 */ f64 d;
|
||||
} __OSfp;
|
||||
|
||||
|
||||
typedef struct {
|
||||
/* 0 */ u64 at;
|
||||
/* 8 */ u64 v0;
|
||||
/* 16 */ u64 v1;
|
||||
/* 24 */ u64 a0;
|
||||
/* 32 */ u64 a1;
|
||||
/* 40 */ u64 a2;
|
||||
/* 48 */ u64 a3;
|
||||
/* 56 */ u64 t0;
|
||||
/* 64 */ u64 t1;
|
||||
/* 72 */ u64 t2;
|
||||
/* 80 */ u64 t3;
|
||||
/* 88 */ u64 t4;
|
||||
/* 96 */ u64 t5;
|
||||
/* 104 */ u64 t6;
|
||||
/* 112 */ u64 t7;
|
||||
/* 120 */ u64 s0;
|
||||
/* 128 */ u64 s1;
|
||||
/* 136 */ u64 s2;
|
||||
/* 144 */ u64 s3;
|
||||
/* 152 */ u64 s4;
|
||||
/* 160 */ u64 s5;
|
||||
/* 168 */ u64 s6;
|
||||
/* 176 */ u64 s7;
|
||||
/* 184 */ u64 t8;
|
||||
/* 192 */ u64 t9;
|
||||
/* 200 */ u64 gp;
|
||||
/* 208 */ u64 sp;
|
||||
/* 216 */ u64 s8;
|
||||
/* 224 */ u64 ra;
|
||||
/* 232 */ u64 lo;
|
||||
/* 240 */ u64 hi;
|
||||
/* 248 */ u32 sr;
|
||||
/* 252 */ u32 pc;
|
||||
/* 256 */ u32 cause;
|
||||
/* 260 */ u32 badvaddr;
|
||||
/* 264 */ u32 rcp;
|
||||
/* 268 */ u32 fpcsr;
|
||||
/* 272 */ __OSfp fp0;
|
||||
/* 280 */ __OSfp fp2;
|
||||
/* 288 */ __OSfp fp4;
|
||||
/* 296 */ __OSfp fp6;
|
||||
/* 304 */ __OSfp fp8;
|
||||
/* 312 */ __OSfp fp10;
|
||||
/* 320 */ __OSfp fp12;
|
||||
/* 328 */ __OSfp fp14;
|
||||
/* 336 */ __OSfp fp16;
|
||||
/* 344 */ __OSfp fp18;
|
||||
/* 352 */ __OSfp fp20;
|
||||
/* 360 */ __OSfp fp22;
|
||||
/* 368 */ __OSfp fp24;
|
||||
/* 376 */ __OSfp fp26;
|
||||
/* 384 */ __OSfp fp28;
|
||||
/* 392 */ __OSfp fp30;
|
||||
} __OSThreadContext;
|
||||
|
||||
|
||||
typedef struct OSThread_s {
|
||||
/* 0 */ struct OSThread_s* next;
|
||||
/* 4 */ OSPri priority;
|
||||
/* 8 */ struct OSThread_s** queue;
|
||||
/* 12 */ struct OSThread_s* tlnext;
|
||||
/* 16 */ u16 state;
|
||||
/* 18 */ u16 flags;
|
||||
/* 20 */ OSId id;
|
||||
/* 24 */ int fp;
|
||||
/* 32 */ __OSThreadContext context;
|
||||
} OSThread;
|
||||
|
||||
typedef u32 OSEvent;
|
||||
|
||||
typedef u32 OSIntMask;
|
||||
|
||||
typedef u32 OSPageMask;
|
||||
|
||||
typedef void* OSMesg;
|
||||
|
||||
typedef struct {
|
||||
/* 0 */ OSThread* mtqueue;
|
||||
/* 4 */ OSThread* fullqueue;
|
||||
/* 8 */ s32 validCount;
|
||||
/* 12 */ s32 first;
|
||||
/* 16 */ s32 msgCount;
|
||||
/* 20 */ OSMesg* msg;
|
||||
} OSMesgQueue;
|
||||
|
||||
|
||||
typedef struct {
|
||||
/* 0 */ u16 type;
|
||||
/* 2 */ u8 pri;
|
||||
/* 3 */ u8 status;
|
||||
/* 4 */ OSMesgQueue* retQueue;
|
||||
} OSIoMesgHdr;
|
||||
|
||||
|
||||
typedef struct {
|
||||
/* 0 */ OSIoMesgHdr hdr;
|
||||
/* 8 */ void* dramAddr;
|
||||
/* 12 */ u32 devAddr;
|
||||
/* 16 */ u32 size;
|
||||
} OSIoMesg;
|
||||
|
||||
|
||||
typedef struct {
|
||||
/* 0 */ s32 active;
|
||||
/* 4 */ OSThread* thread;
|
||||
/* 8 */ OSMesgQueue* cmdQueue;
|
||||
/* 12 */ OSMesgQueue* evtQueue;
|
||||
/* 16 */ OSMesgQueue* acsQueue;
|
||||
/* 20 */ s32 (*dma)(... /* ECOFF does not store param types */);
|
||||
} OSDevMgr;
|
||||
|
||||
|
||||
typedef struct {
|
||||
/* 0 */ u32 ctrl;
|
||||
/* 4 */ u32 width;
|
||||
/* 8 */ u32 burst;
|
||||
/* 12 */ u32 vSync;
|
||||
/* 16 */ u32 hSync;
|
||||
/* 20 */ u32 leap;
|
||||
/* 24 */ u32 hStart;
|
||||
/* 28 */ u32 xScale;
|
||||
/* 32 */ u32 vCurrent;
|
||||
} OSViCommonRegs;
|
||||
|
||||
|
||||
typedef struct {
|
||||
/* 0 */ u32 origin;
|
||||
/* 4 */ u32 yScale;
|
||||
/* 8 */ u32 vStart;
|
||||
/* 12 */ u32 vBurst;
|
||||
/* 16 */ u32 vIntr;
|
||||
} OSViFieldRegs;
|
||||
|
||||
|
||||
typedef struct {
|
||||
/* 0 */ u8 type;
|
||||
/* 4 */ OSViCommonRegs comRegs;
|
||||
/* 40 */ OSViFieldRegs fldRegs[2];
|
||||
} OSViMode;
|
||||
|
||||
typedef u64 OSTime;
|
||||
|
||||
|
||||
typedef struct OSTimer_s {
|
||||
/* 0 */ struct OSTimer_s* next;
|
||||
/* 4 */ struct OSTimer_s* prev;
|
||||
/* 8 */ OSTime interval;
|
||||
/* 16 */ OSTime value;
|
||||
/* 24 */ OSMesgQueue* mq;
|
||||
/* 28 */ OSMesg msg;
|
||||
} OSTimer;
|
||||
|
||||
|
||||
typedef struct {
|
||||
/* 0 */ u16 type;
|
||||
/* 2 */ u8 status;
|
||||
/* 3 */ u8 errno;
|
||||
} OSContStatus;
|
||||
|
||||
|
||||
typedef struct {
|
||||
/* 0 */ u16 button;
|
||||
/* 2 */ s8 stick_x;
|
||||
/* 3 */ s8 stick_y;
|
||||
/* 4 */ u8 errno;
|
||||
} OSContPad;
|
||||
|
||||
|
||||
typedef struct {
|
||||
/* 0 */ void* address;
|
||||
/* 4 */ u8 databuffer[32];
|
||||
/* 36 */ u8 addressCrc;
|
||||
/* 37 */ u8 dataCrc;
|
||||
/* 38 */ u8 errno;
|
||||
} OSContRamIo;
|
||||
|
||||
|
||||
typedef struct {
|
||||
/* 0 */ int status;
|
||||
/* 4 */ OSMesgQueue* queue;
|
||||
/* 8 */ int channel;
|
||||
/* 12 */ u8 id[32];
|
||||
/* 44 */ u8 backup_id[32];
|
||||
/* 76 */ u8 label[32];
|
||||
/* 108 */ int pack_size;
|
||||
/* 112 */ int version;
|
||||
/* 116 */ int dir_size;
|
||||
/* 120 */ int inode_start_page;
|
||||
} OSPfs;
|
||||
|
||||
|
||||
typedef struct {
|
||||
/* 0 */ u32 file_size;
|
||||
/* 4 */ u16 company_code;
|
||||
/* 6 */ u16 game_code;
|
||||
/* 8 */ unsigned char ext_name[4];
|
||||
/* 12 */ unsigned char game_name[16];
|
||||
} OSPfsState;
|
||||
|
||||
|
||||
typedef struct {
|
||||
/* 0 */ u16* histo_base;
|
||||
/* 4 */ u32 histo_size;
|
||||
/* 8 */ u32* text_start;
|
||||
/* 12 */ u32* text_end;
|
||||
} OSProf;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,4 @@
|
||||
#ifndef _OS_INTERNAL_H_
|
||||
#define _OS_INTERNAL_H_
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,28 @@
|
||||
#ifndef _OSINT_H_
|
||||
#define _OSINT_H_
|
||||
|
||||
// TODO should be in libultra/os
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <os.h>
|
||||
#include <os_internal.h>
|
||||
#include <ultraerror.h>
|
||||
#include <ultralog.h>
|
||||
#include <sptask.h>
|
||||
|
||||
typedef struct {
|
||||
/* 0 */ OSMesgQueue* messageQueue;
|
||||
/* 4 */ OSMesg message;
|
||||
} __OSEventState;
|
||||
|
||||
|
||||
typedef struct {
|
||||
/* 0 */ OSThread* next;
|
||||
/* 4 */ OSPri priority;
|
||||
} __OSThreadTail;
|
||||
|
||||
#include <variables.h> // TODO all variables should be moved to the file that logically defines them
|
||||
// maybe put externs here?
|
||||
#include <functions.h>
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,4 @@
|
||||
#ifndef _RMON_H_
|
||||
#define _RMON_H_
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,33 @@
|
||||
#ifndef _SPTASK_H_
|
||||
#define _SPTASK_H_
|
||||
|
||||
#include <PR/ultratypes.h>
|
||||
|
||||
typedef struct {
|
||||
/* 0 */ u32 type;
|
||||
/* 4 */ u32 flags;
|
||||
/* 8 */ u64* ucode_boot;
|
||||
/* 12 */ u32 ucode_boot_size;
|
||||
/* 16 */ u64* ucode;
|
||||
/* 20 */ u32 ucode_size;
|
||||
/* 24 */ u64* ucode_data;
|
||||
/* 28 */ u32 ucode_data_size;
|
||||
/* 32 */ u64* dram_stack;
|
||||
/* 36 */ u32 dram_stack_size;
|
||||
/* 40 */ u64* output_buff;
|
||||
/* 44 */ u64* output_buff_size;
|
||||
/* 48 */ u64* data_ptr;
|
||||
/* 52 */ u32 data_size;
|
||||
/* 56 */ u64* yield_data_ptr;
|
||||
/* 60 */ u32 yield_data_size;
|
||||
} OSTask_t;
|
||||
|
||||
|
||||
typedef union {
|
||||
/* 0 */ OSTask_t t;
|
||||
/* 0 */ long long force_structure_alignment;
|
||||
} OSTask;
|
||||
|
||||
typedef u32 OSYieldResult;
|
||||
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user