Saturn: Decompile entrypoint, don't strip elfs (#659)

I removed the stripping so these can be loaded into Ghidra with symbols.
This commit is contained in:
sozud 2023-10-02 06:47:44 -07:00 committed by GitHub
parent 0e81d9a723
commit db74ae3b91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 8 deletions

View File

@ -587,12 +587,12 @@ build_saturn_link_docker_ld:
docker run --rm -v $(SATURN_BUILD_ABS):/build -w /build binutils-sh-elf:latest /bin/bash -c "sh-elf-ld -o warp_li.o -Map warp.map -T warp.ld -T all_syms.txt -T warp_user_syms.txt -verbose warp.o --no-check-sections -nostdlib -s"
build_saturn_link_native_ld:
cd build/saturn && sh-elf-ld -o zero_li.o -Map zero.map -T zero.ld -T all_syms.txt -T zero_user_syms.txt -verbose zero.o lib/gfs.o lib/spr.o lib/dma.o lib/scl.o lib/csh.o lib/per.o lib/cdc.o lib/mth.o lib/bup.o lib/sys.o --no-check-sections -nostdlib -s
cd build/saturn && sh-elf-ld -o t_bat_li.o -Map t_bat.map -T t_bat.ld -T all_syms.txt -T t_bat_user_syms.txt -verbose t_bat.o --no-check-sections -nostdlib -s
cd build/saturn && sh-elf-ld -o game_li.o -Map game.map -T game.ld -T all_syms.txt -T game_user_syms.txt -verbose game.o --no-check-sections -nostdlib -s
cd build/saturn && sh-elf-ld -o stage_02_li.o -Map stage_02.map -T stage_02.ld -T all_syms.txt -T stage_02_user_syms.txt -verbose stage_02.o --no-check-sections -nostdlib -s
cd build/saturn && sh-elf-ld -o warp_li.o -Map warp.map -T warp.ld -T all_syms.txt -T warp_user_syms.txt -verbose warp.o --no-check-sections -nostdlib -s
cd build/saturn && sh-elf-ld -o alucard_li.o -Map alucard.map -T alucard.ld -T all_syms.txt -T alucard_user_syms.txt -verbose alucard.o --no-check-sections -nostdlib -s
cd build/saturn && sh-elf-ld -o zero_li.o -Map zero.map -T zero.ld -T all_syms.txt -T zero_user_syms.txt -verbose zero.o lib/gfs.o lib/spr.o lib/dma.o lib/scl.o lib/csh.o lib/per.o lib/cdc.o lib/mth.o lib/bup.o lib/sys.o --no-check-sections -nostdlib
cd build/saturn && sh-elf-ld -o t_bat_li.o -Map t_bat.map -T t_bat.ld -T all_syms.txt -T t_bat_user_syms.txt -verbose t_bat.o --no-check-sections -nostdlib
cd build/saturn && sh-elf-ld -o game_li.o -Map game.map -T game.ld -T all_syms.txt -T game_user_syms.txt -verbose game.o --no-check-sections -nostdlib
cd build/saturn && sh-elf-ld -o stage_02_li.o -Map stage_02.map -T stage_02.ld -T all_syms.txt -T stage_02_user_syms.txt -verbose stage_02.o --no-check-sections -nostdlib
cd build/saturn && sh-elf-ld -o warp_li.o -Map warp.map -T warp.ld -T all_syms.txt -T warp_user_syms.txt -verbose warp.o --no-check-sections -nostdlib
cd build/saturn && sh-elf-ld -o alucard_li.o -Map alucard.map -T alucard.ld -T all_syms.txt -T alucard_user_syms.txt -verbose alucard.o --no-check-sections -nostdlib
build_saturn_link_copy:
# link

View File

@ -275,3 +275,7 @@ _s_chainTopCmdR = 0x66666666;
_SPR_SlaveCommand = 0x11111111;
_SPR_SlaveParam = 0x22222222;
_func_06030df0 = 0x06030df0;
_DAT_0605cea2 = 0x0605cea2;
_DAT_0605c658 = 0x0605c658;

View File

@ -1,9 +1,20 @@
#include "zero.h"
#include "inc_asm.h"
#include "sattypes.h"
#include "saturn/scl.h"
#include "lib/scl.h"
INCLUDE_ASM("asm/saturn/zero/data", d6004080, d_06004080);
// func_06004080
void entrypoint(void) {
func_06030df0();
Scl_s_reg.tvmode = Scl_s_reg.tvmode & 0x7eff;
SclProcess = 1;
func_060044D0();
DAT_0605cea2 = 0;
DAT_0605c658 = 1;
do {
func_060040D8();
} while (true);
}
INCLUDE_ASM("asm/saturn/zero/f_nonmat", f60040D8, func_060040D8);
INCLUDE_ASM("asm/saturn/zero/f_nonmat", f60044D0, func_060044D0);

View File

@ -146,4 +146,10 @@ void func_0600B254(void);
extern s32 DAT_06064214;
extern s8 DAT_060644C0;
extern u16 DAT_0605cea2;
extern u32 DAT_0605c658;
void func_06030df0();
void func_060044D0();
void func_060040D8();
#endif