Decompile SetStageOverlayAddress (#315)

This match seems odd since I would have expected the addresses to be
literals. With @sonicdcer

I'll rebase when the other PR is merged.

https://decomp.me/scratch/KYz2v
https://decomp.me/scratch/MyAL
This commit is contained in:
sozud 2023-07-05 16:14:09 -07:00 committed by GitHub
parent 4c974b633a
commit 6b2f2c43ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 3 deletions

View File

@ -449,6 +449,7 @@ build_saturn_copy_files:
cp ./src/saturn/game.c $(SATURN_BUILD_DIR)
cp ./src/saturn/t_bat.c $(SATURN_BUILD_DIR)
cp ./src/saturn/zero.c $(SATURN_BUILD_DIR)
cp ./src/saturn/zero.h $(SATURN_BUILD_DIR)
cp ./src/saturn/stage_02.c $(SATURN_BUILD_DIR)
cp ./src/saturn/stage_02.h $(SATURN_BUILD_DIR)
cp ./src/saturn/warp.c $(SATURN_BUILD_DIR)
@ -478,14 +479,14 @@ build_saturn_dosemu_docker:
docker run --rm -e FILENAME=warp -v $(SATURN_BUILD_ABS):/build -w /build dosemu:latest /bin/bash -c "./compile_dosemu.sh"
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 zero_li.o -Map zero.map -T zero.ld -T all_syms.txt -verbose zero.o --no-check-sections -nostdlib -s"
docker run --rm -v $(SATURN_BUILD_ABS):/build -w /build binutils-sh-elf:latest /bin/bash -c "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 --no-check-sections -nostdlib -s"
docker run --rm -v $(SATURN_BUILD_ABS):/build -w /build binutils-sh-elf:latest /bin/bash -c "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"
docker run --rm -v $(SATURN_BUILD_ABS):/build -w /build binutils-sh-elf:latest /bin/bash -c "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"
docker run --rm -v $(SATURN_BUILD_ABS):/build -w /build binutils-sh-elf:latest /bin/bash -c "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"
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 -verbose zero.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 --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
@ -500,6 +501,7 @@ build_saturn_link_copy:
cp ./config/saturn/game_user_syms.txt ./build/saturn/
cp ./config/saturn/stage_02_user_syms.txt ./build/saturn/
cp ./config/saturn/warp_user_syms.txt ./build/saturn/
cp ./config/saturn/zero_user_syms.txt ./build/saturn/
cp ./config/saturn/*.ld ./build/saturn

View File

@ -0,0 +1,8 @@
_DAT_0601ac28 = 0x6064648;
_DAT_0601ac2c = 0x60dc000;
_DAT_0601ac30 = 0x60dc004;
_DAT_0601ac34 = 0x60645ec;
_DAT_0601ac38 = 0x60dc008;
_DAT_0601ac3c = 0x60645e4;
_DAT_0601ac40 = 0x60dc00c;
_DAT_0601ac44 = 0x60645f8;

View File

@ -1,5 +1,7 @@
#include "zero.h"
#include "inc_asm.h"
#include "sattypes.h"
INCLUDE_ASM("asm/saturn/zero/data", d6004080, d_06004080);
INCLUDE_ASM("asm/saturn/zero/f_nonmat", f60040D8, func_060040D8);
@ -545,7 +547,12 @@ INCLUDE_ASM("asm/saturn/zero/f_nonmat", f6019FE4, func_06019FE4);
INCLUDE_ASM("asm/saturn/zero/f_nonmat", f601A020, func_0601A020);
// _SET_STAGE_OVERLAYADDR
INCLUDE_ASM("asm/saturn/zero/f_nonmat", f601AC00, func_0601AC00);
void SetStageOverlayAddress() {
*DAT_0601ac28 = *DAT_0601ac2c; // 0x60dc000
*DAT_0601ac34 = *DAT_0601ac30; // 0x60dc004
*DAT_0601ac3c = *DAT_0601ac38; // 0x60dc008
*DAT_0601ac44 = *DAT_0601ac40; // 0x60dc00c
}
// _SET_SCL_OVERLAYADDR
INCLUDE_ASM("asm/saturn/zero/f_nonmat", f601AC48, func_0601AC48);

12
src/saturn/zero.h Normal file
View File

@ -0,0 +1,12 @@
#ifndef ZERO_BIN_H
#define ZERO_BIN_H
#include "sattypes.h"
extern s32 DAT_0601ac28[];
extern s32 DAT_0601ac2c[];
extern s32 DAT_0601ac30[];
extern s32 DAT_0601ac34[];
extern s32 DAT_0601ac38[];
extern s32 DAT_0601ac3c[];
extern s32 DAT_0601ac40[];
extern s32 DAT_0601ac44[];
#endif