Skip to content

Commit

Permalink
Merge branch 'master' into func_80171ED4-PSP
Browse files Browse the repository at this point in the history
Xeeynamo authored May 4, 2024
2 parents 787782c + d18f185 commit 83d3b58
Showing 8 changed files with 36 additions and 37 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -128,6 +128,7 @@ format:
black tools/split_jpt_yaml/*.py
VERSION=us $(PYTHON) ./tools/symbols.py sort
VERSION=hd $(PYTHON) ./tools/symbols.py sort
VERSION=pspeu $(PYTHON) ./tools/symbols.py sort
./tools/symbols.py remove-orphans config/splat.us.dra.yaml
./tools/symbols.py remove-orphans config/splat.hd.dra.yaml
./tools/symbols.py remove-orphans config/splat.us.ric.yaml
4 changes: 1 addition & 3 deletions Makefile.psp.mk
Original file line number Diff line number Diff line change
@@ -35,9 +35,7 @@ bin/mwccpsp.exe: bin/wibo bin/mwccpsp_3.0.1_147

$(PSP_BUILD_DIR)/%.c.o: %.c bin/mwccpsp.exe
mkdir -p $(dir $@)
$(MWCPP_APP) $< -o $<.post.c
$(CCPSP) -gccinc -Iinclude -D_internal_version_$(VERSION) -O0 -c -lang c -sdatathreshold 0 -o $@ $<.post.c
rm $<.post.c || true
$(MWCPP_APP) $< -o $<.post.c && (($(CCPSP) -gccinc -Iinclude -D_internal_version_$(VERSION) -O0 -c -lang c -sdatathreshold 0 -o $@ $<.post.c && rm $<.post.c) || (rm $<.post.c && exit 1))
$(PSP_BUILD_DIR)/asm/psp%.s.o: asm/psp%.s
mkdir -p $(dir $@)
$(ASPSP) -o $@ $<
3 changes: 2 additions & 1 deletion config/splat.pspeu.tt_000.yaml
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@ options:
- ".rodata"
- ".bss"
ld_bss_is_noload: True
# disasm_unknown: True
segments:
- [0x0, bin, header]
- name: tt_000
@@ -32,7 +33,7 @@ segments:
vram: 0x092E7680
bss_size: 0x500
align: 128
subalign: 4
subalign: 8
subsegments:
- [0x80, c, 10E8]
- [0x4C80, data]
19 changes: 11 additions & 8 deletions config/symbols.pspeu.tt_000.txt
Original file line number Diff line number Diff line change
@@ -30,19 +30,22 @@ ProcessEvent = 0x092eba98;
CreateEventEntity = 0x092ebec8;
func_801746A0 = 0x092ebfb8;
func_80174864 = 0x092ec150;
D_801530AC = 0x092EC2E0;
D_80170448 = 0x092EC280;
D_80170040 = 0x092EC2E0;
D_801704A8 = 0x092EC768;
D_80170608 = 0x092EC8d0;
g_EventQueue = 0x092ed358;
g_CurrentServant = 0x092ed808;
g_CurrentRoomX = 0x092ed810;
g_CurrentRoomY = 0x092ed818;
D_80174D3C = 0x092ed828;
D_80174C30 = 0x092ed930;
D_801704E0 = 0x092EC7A0;
D_80170514 = 0x092EC7D8;
D_8017054C = 0x092EC810;
D_801705EC = 0x092EC8B0;
D_801705F4 = 0x092EC8B8;
D_80170608 = 0x092EC8d0;
D_80170658 = 0x092EC920;
D_80170720 = 0x092EC9E8;
g_Events = 0x092ECA28;
g_EventQueue = 0x092ed358;
g_ServantDesc = 0x092ED360;
g_CurrentServant = 0x092ed808;
g_CurrentRoomX = 0x092ed810;
g_CurrentRoomY = 0x092ed818;
D_80174D3C = 0x092ed828;
D_80174C30 = 0x092ed930;
15 changes: 9 additions & 6 deletions config/symbols.pspeu.txt
Original file line number Diff line number Diff line change
@@ -5,6 +5,11 @@ rcos = 0x08927e0c;
rsin = 0x08927f2c;
g_StageId = 0x091ce5b8;
g_Servant = 0x091cf028;
g_Player = 0x91CF030;
g_Player_pl_vram_flag = 0x91CF380;
g_Player_unk50 = 0x91CF3D0;
g_Player_unk52 = 0x91CF3D2;
g_api = 0x091cf738;
g_api_FreePrimitives = 0x091cf778;
g_api_AllocPrimitives = 0x091cf77c;
g_api_PlaySfx = 0x091cf7a0;
@@ -18,14 +23,12 @@ g_Tilemap_scrollY_i_hi = 0x091e1636;
g_Tilemap_left = 0x091e1654;
g_Tilemap_top = 0x091e1658;
g_Entities = 0x091e1680;
g_Entities_0_zPriority = 0x091e16a4;
g_Entities_0_facingLeft = 0x091e1694;
g_Player = 0x91CF030;
g_Player_unk50 = 0x91CF3D0;
g_Player_unk52 = 0x91CF3D2;
D_8006F3CC = 0x091f8658;
PLAYER_velocityX = 0x91E1688;
PLAYER_velocityY = 0x91E168C;
g_Entities_0_facingLeft = 0x091e1694;
g_Entities_0_zPriority = 0x091e16a4;
PLAYER_step = 0x91E16AC;
PLAYER_step_s = 0x91E16AE;
g_Clut = 0x091F5DF8;
g_Clut_2800 = 0x091F85F8;
g_Clut_2860 = 0x091F8658;
1 change: 1 addition & 0 deletions config/undefined_syms.pspeu.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
g_StageId = 0x091CE5B8;
g_Player = 0x091CF030;
g_api = 0x091CF738;
D_8003C708 = 0x091E1308;
g_Tilemap = 0x091E1628;
g_Entities = 0x091E1680;
18 changes: 9 additions & 9 deletions diff_settings.py
Original file line number Diff line number Diff line change
@@ -19,24 +19,24 @@ def add_custom_arguments(parser):


def apply_psx_base(config, version, name):
config["baseimg"] = f"disks/{version}" + (f"{name}.bin").upper()
config["myimg"] = f"build/{version}" + (f"{name}.bin").upper()
config["baseimg"] = f"disks/{version}/" + (f"{name}.bin").upper()
config["myimg"] = f"build/{version}/" + (f"{name}.bin").upper()
config["mapfile"] = f"build/{version}/{name}.map"
config["source_directories"] = [f"src/{name}", "include", f"asm/{version}/{name}"]
config["objdump_executable"] = "mipsel-linux-gnu-objdump"


def apply_psx_bin(config, version, name):
config["baseimg"] = f"disks/{version}" + (f"BIN/{name}.BIN").upper()
config["myimg"] = f"build/{version}" + (f"{name}.bin").upper()
config["baseimg"] = f"disks/{version}/" + (f"BIN/{name}.BIN").upper()
config["myimg"] = f"build/{version}/" + (f"{name}.bin").upper()
config["mapfile"] = f"build/{version}/{name}.map"
config["source_directories"] = [f"src/{name}", "include", f"asm/{version}/{name}"]
config["objdump_executable"] = "mipsel-linux-gnu-objdump"


def apply_psx_servant(config, version, name):
config["baseimg"] = f"disks/{version}" + (f"SERVANT/{name}.bin").upper()
config["myimg"] = f"build/{version}" + (f"{name}.bin").upper()
config["baseimg"] = f"disks/{version}/" + (f"SERVANT/{name}.bin").upper()
config["myimg"] = f"build/{version}/" + (f"{name}.bin").upper()
config["mapfile"] = f"build/{version}/{name}.map"
config["source_directories"] = [
f"src/servant/{name}",
@@ -47,7 +47,7 @@ def apply_psx_servant(config, version, name):


def apply_psx_weapon(config, version, name):
config["baseimg"] = f"disks/{version}" + (f"SERVANT/{name}.bin").upper()
config["baseimg"] = f"disks/{version}/" + (f"SERVANT/{name}.bin").upper()
config["myimg"] = f"build/{version}/weapon/w0_{name[2:]}.bin"
config["mapfile"] = f"build/{version}/weapon/w0_{name[2:]}.map"
config["source_directories"] = [
@@ -59,8 +59,8 @@ def apply_psx_weapon(config, version, name):


def apply_psx_stage(config, version, name):
config["baseimg"] = f"disks/{version}" + (f"ST/{name}/{name}.BIN").upper()
config["myimg"] = f"build/{version}" + (f"{name}.bin").upper()
config["baseimg"] = f"disks/{version}/" + (f"ST/{name}/{name}.BIN").upper()
config["myimg"] = f"build/{version}/" + (f"{name}.bin").upper()
config["mapfile"] = f"build/{version}/st{name}.map"
config["source_directories"] = [
f"src/st/{name}",
12 changes: 2 additions & 10 deletions src/servant/tt_000/10E8.c
Original file line number Diff line number Diff line change
@@ -1123,11 +1123,7 @@ u32 UpdateAnim(Entity* self, s8* frameProps, AnimationFrame** frames) {
}
#endif

#ifdef VERSION_PSP
INCLUDE_ASM("servant/tt_000/nonmatchings/10E8", DestroyEntity);
#else
#include "../../destroy_entity.h"
#endif

#ifndef VERSION_PSP
s32 func_80173E78(s32 arg0, s32 arg1) {
@@ -1421,9 +1417,6 @@ void CreateEventEntity(Entity* entityParent, s32 entityId, s32 params) {
}
}

#ifdef VERSION_PSP
INCLUDE_ASM("servant/tt_000/nonmatchings/10E8", func_801746A0);
#else
s32 func_801746A0(s32 arg0) {
if (PLAYER.velocityY < 0 && !(g_Player.pl_vram_flag & 1)) {
return 1;
@@ -1442,18 +1435,17 @@ s32 func_801746A0(s32 arg0) {
if (arg0 == 0)
return 0;

if (g_Player.unk50 != PLAYER.step || g_Player.unk50 != 0)
if (g_Player.unk50 != PLAYER.step || PLAYER.step != 0)
return 1;

if (g_Player.unk52 != PLAYER.step_s)
return 1;

if (g_Player.unk52 != 0 && g_Player.unk52 != 4)
if (PLAYER.step_s != 0 && PLAYER.step_s != 4)
return 1;

return 0;
}
#endif

#ifndef VERSION_PSP
s32 func_801747B8(void) {

0 comments on commit 83d3b58

Please sign in to comment.