Start decompiling rarezip binary

This commit is contained in:
Ryan Dwyer
2019-09-10 17:54:17 +10:00
parent 5f2ffa680e
commit f27cf33efb
8 changed files with 2251 additions and 2 deletions
+39 -1
View File
@@ -19,7 +19,27 @@ else
TOOLCHAIN := mips64-elf
endif
CFLAGS := -Wo,-loopunroll,0 -Wab,-r4300_mul -non_shared -G 0 -Xcpluscomm -woff 819,820,852,821 -signed -I . -I include -mips2
ifeq ($(REGION),ntsc)
VERSION_CFLAGS := -DNTSC=1 -DPAL=0 -DJAP=0
endif
ifeq ($(REGION),pal)
VERSION_CFLAGS := -DNTSC=0 -DPAL=1 -DJAP=0
endif
ifeq ($(REGION),jap)
VERSION_CFLAGS := -DNTSC=0 -DPAL=0 -DJAP=1
endif
ifeq ($(RELEASE),beta)
RELEASE_CFLAGS := -DBETA=1 -DREL1_0 -DFINAL=0
endif
ifeq ($(RELEASE),1.0)
RELEASE_CFLAGS := -DBETA=0 -DREL1_1 -DFINAL=0
endif
ifeq ($(RELEASE),final)
RELEASE_CFLAGS := -DBETA=0 -DREL1_0 -DFINAL=1
endif
CFLAGS := $(VERSION_CFLAGS) $(RELEASE_CFLAGS) -Wo,-loopunroll,0 -Wab,-r4300_mul -non_shared -G 0 -Xcpluscomm -woff 819,820,852,821 -signed -I . -I include -mips2
default: all
@@ -111,6 +131,22 @@ $(B_DIR)/globals.elf: $(B_DIR)/globals.o
$(B_DIR)/Uglobals: $(B_DIR)/globals.elf
$(TOOLCHAIN)-objcopy $< $@ -O binary
################################################################################
# Rarezip
$(B_DIR)/ucode/rarezip.o: src/rarezip/rarezip.c
mkdir -p $(B_DIR)/ucode
python tools/asmpreproc/asm-processor.py -O2 $< | $(QEMU_IRIX) -silent -L $(IRIX_ROOT) $(IRIX_ROOT)/usr/bin/cc -c $(CFLAGS) tools/asmpreproc/include-stdin.c -o $@ -O2
python tools/asmpreproc/asm-processor.py -O2 $< --post-process $@ --assembler "$(TOOLCHAIN)-as -march=vr4300 -mabi=32" --asm-prelude tools/asmpreproc/prelude.s
$(B_DIR)/ucode/rarezip.elf: $(B_DIR)/ucode/rarezip.o
cp $< build/rarezip.tmp.o
$(TOOLCHAIN)-ld -T ld/rarezip.ld -o $@
rm -f build/rarezip.tmp.o
$(B_DIR)/ucode/rarezip.bin: $(B_DIR)/ucode/rarezip.elf
$(TOOLCHAIN)-objcopy $< $@ -O binary
################################################################################
# Test related
@@ -119,7 +155,9 @@ test: $(B_SETUP_BINZ_FILES) $(B_LANG_BINZ_FILES)
@diff -rq --exclude='*.bin' \
--exclude=chrs \
--exclude=guns \
--exclude=lang \
--exclude=props \
--exclude=setup \
--exclude='A*' \
--exclude='C*' \
--exclude='G*' \