Skip to content

Commit

Permalink
Add st0 codesharing for various files (#2041)
Browse files Browse the repository at this point in the history
Adds full PSP code sharing for files in my earlier PRs #2022 #2027 #2033

Would have done this earlier but didn't know it was possible until I saw
some of Xeeynamo/bismurphy's recent PRs
  • Loading branch information
JoshSchreuder authored Jan 8, 2025
1 parent 0424463 commit 3754cc3
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 117 deletions.
2 changes: 1 addition & 1 deletion Makefile.psp.mk
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ $(BUILD_DIR)/dra.elf: $(BUILD_DIR)/dra.ld $(addprefix $(BUILD_DIR)/src/dra/,$(ad
$(BUILD_DIR)/tt_%.elf: $(BUILD_DIR)/tt_%.ld $$(call list_o_files_psp,servant/tt_$$*) $(BUILD_DIR)/assets/servant/tt_%/mwo_header.bin.o
$(call link_with_deadstrip,tt_$*,$@)

ST_ST0_MERGE = title_card popup e_room_fg st_common
ST_ST0_MERGE = title_card popup e_room_fg st_common collision e_lock_camera st_update
$(BUILD_DIR)/stst0.elf: $(BUILD_DIR)/stst0.ld $(addprefix $(BUILD_DIR)/src/st/st0/,$(addsuffix .c.o,$(ST_ST0_MERGE))) $$(call list_o_files_psp,st/st0_psp) $(BUILD_DIR)/assets/st/st0/mwo_header.bin.o
$(call link_with_deadstrip,stst0,$@)
ST_WRP_MERGE = st_update e_particles e_room_fg st_common st_debug e_breakable popup warp e_red_door
Expand Down
12 changes: 6 additions & 6 deletions config/splat.pspeu.stst0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@ segments:
- [0xF560, c, st0_psp/2850C]
- [0xFD18, c, st0_psp/st_debug]
- [0xFDF8, c, st0_psp/2A218]
- [0x10678, c, st0_psp/e_lock_camera]
- [0x10678, c, st0/e_lock_camera]
- [0x10A00, c, st0_psp/create_entity]
- [0x119A8, c, st0_psp/e_red_door]
- [0x12CB0, c, st0_psp/st_update]
- [0x12CB0, c, st0/st_update]
- [0x131E8, c, st0_psp/e_particles_maria1]
- [0x13770, c, st0_psp/e_particles_maria2]
- [0x13C00, c, st0_psp/e_particles]
- [0x14160, c, st0_psp/e_collect]
- [0x15CC8, c, st0_psp/e_misc]
- [0x16278, c, st0_psp/collision]
- [0x16278, c, st0/collision]
- [0x18000, c, st0/popup]
- [0x185F8, c, st0/e_room_fg]
- [0x18710, c, st0/st_common]
Expand All @@ -77,11 +77,11 @@ segments:
- [0x1B268, data, header]
- [0x1B538, data, e_init]
- [0x1B700, data]
- [0x41BF0, .data, st0_psp/e_lock_camera]
- [0x41BF0, .data, st0/e_lock_camera]
- [0x41C08, data]
- [0x41C20, .data, st0_psp/st_update]
- [0x41C20, .data, st0/st_update]
- [0x41C50, data]
- [0x41F98, .data, st0_psp/collision]
- [0x41F98, .data, st0/collision]
- [0x42308, data, e_room_fg]
- [0x423A8, data]
- [0x42400, .rodata, st0_psp/30030]
Expand Down
48 changes: 0 additions & 48 deletions src/st/st0/collision.c
Original file line number Diff line number Diff line change
@@ -1,53 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
#include "st0.h"

static u16 g_testCollEnemyLookup[] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x001E, 0x0000, 0x0000,
0x002B, 0x0000, 0x0010, 0x0000, 0x000D, 0x0068, 0x0068, 0x0016, 0x0000,
0x0000, 0x0000, 0x003E, 0x0000, 0x0023, 0x0050, 0x0000, 0x0000, 0x0000,
0x0006, 0x0000, 0x000A, 0x0000, 0x007D, 0x0000, 0x0000, 0x002D, 0x0000,
0x0000, 0x006D, 0x007B, 0x0000, 0x0017, 0x0041, 0x0000, 0x0073, 0x0000,
0x004C, 0x0000, 0x0000, 0x0038, 0x0014, 0x005C, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0046, 0x0000,
0x0000, 0x0003, 0x0058, 0x0044, 0x0024, 0x0037, 0x0000, 0x0002, 0x0059,
0x0000, 0x0000, 0x0000, 0x0007, 0x0000, 0x0056, 0x0000, 0x007C, 0x0000,
0x000B, 0x0000, 0x0026, 0x0000, 0x001D, 0x0000, 0x0000, 0x002A, 0x0000,
0x0000, 0x0000, 0x0000, 0x0027, 0x0000, 0x0000, 0x0000, 0x001C, 0x0000,
0x0031, 0x0000, 0x0000, 0x001A, 0x0000, 0x008D, 0x0009, 0x002C, 0x0030,
0x0020, 0x0000, 0x0005, 0x0047, 0x0000, 0x005E, 0x0035, 0x0034, 0x006A,
0x0000, 0x003A, 0x0000, 0x0066, 0x0000, 0x0045, 0x0000, 0x0019, 0x0000,
0x0071, 0x0000, 0x0029, 0x0039, 0x0000, 0x0051, 0x0000, 0x004D, 0x0000,
0x0000, 0x003F, 0x0000, 0x0077, 0x0000, 0x0000, 0x0072, 0x0000, 0x0000,
0x006F, 0x0000, 0x002F, 0x0000, 0x0074, 0x0000, 0x0000, 0x0079, 0x0000,
0x007A, 0x0000, 0x0000, 0x0013, 0x0011, 0x0036, 0x0036, 0x0000, 0x005F,
0x005F, 0x0000, 0x0000, 0x0067, 0x0000, 0x0075, 0x0000, 0x0001, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0000, 0x0000, 0x000E, 0x0000,
0x002E, 0x0000, 0x0069, 0x0021, 0x0000, 0x0000, 0x0055, 0x0000, 0x0054,
0x0000, 0x0053, 0x0000, 0x0000, 0x000F, 0x0000, 0x0076, 0x0000, 0x0000,
0x008E, 0x0000, 0x0000, 0x0000, 0x0000, 0x004A, 0x0000, 0x0000, 0x004B,
0x0000, 0x0000, 0x0000, 0x0000, 0x0043, 0x0000, 0x0000, 0x003D, 0x0000,
0x0078, 0x008A, 0x0000, 0x0000, 0x0000, 0x0052, 0x0000, 0x0000, 0x0089,
0x0048, 0x0000, 0x003C, 0x0040, 0x008B, 0x0000, 0x0000, 0x0000, 0x001F,
0x0000, 0x0000, 0x007E, 0x0000, 0x0000, 0x0049, 0x0000, 0x0000, 0x0000,
0x0015, 0x0000, 0x0000, 0x000C, 0x0028, 0x0000, 0x0000, 0x0000, 0x0032,
0x0000, 0x0022, 0x0012, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0033, 0x0060, 0x0000, 0x0064, 0x0000, 0x0000, 0x007F, 0x0000, 0x0000,
0x0000, 0x004E, 0x0000, 0x006E, 0x0000, 0x0000, 0x0000, 0x004F, 0x0000,
0x0000, 0x0057, 0x0000, 0x0000, 0x0000, 0x0086, 0x0065, 0x0000, 0x003B,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0025, 0x0062, 0x0062,
0x0000, 0x0000, 0x0000, 0x0042, 0x0000, 0x0000, 0x0018, 0x001B, 0x006B,
0x0000, 0x008C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0061, 0x0063,
0x0088, 0x0000, 0x0000, 0x0000, 0x0085, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0084, 0x0000, 0x0000, 0x0087, 0x0000, 0x0000, 0x0000, 0x0000,
0x005D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x005B,
0x0091, 0x0000, 0x0000, 0x0000, 0x0000, 0x0090, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x005A, 0x0000, 0x0000, 0x0082, 0x0000, 0x0000,
0x0000, 0x0083, 0x0000, 0x0081, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0092, 0x0000, 0x0000, 0x0000, 0x0000, 0x0004, 0x0000, 0x0070,
0x0000, 0x0000, 0x006C, 0x0000, 0x0000, 0x0080, 0x0080, 0x0000, 0x0000,
0x008F, 0x0000, 0x0000, 0x0000,
};

#include "../st0_hit_detection.h"
#include "../entity_damage_display.h"
97 changes: 97 additions & 0 deletions src/st/st0_hit_detection.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,103 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
#include <stage.h>

#ifdef VERSION_PSP
static u16 g_testCollEnemyLookup[] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x001E, 0x0000, 0x0000,
0x002A, 0x0000, 0x0011, 0x0000, 0x000E, 0x0068, 0x0068, 0x0016, 0x0000,
0x0000, 0x0000, 0x003D, 0x0000, 0x0028, 0x0052, 0x0000, 0x0000, 0x0000,
0x0008, 0x0000, 0x000B, 0x0000, 0x007B, 0x0000, 0x0000, 0x002D, 0x0000,
0x0000, 0x006F, 0x007A, 0x0000, 0x0018, 0x0041, 0x0000, 0x0070, 0x0000,
0x004D, 0x0000, 0x0000, 0x0035, 0x0015, 0x005C, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0046, 0x0000,
0x0000, 0x0005, 0x0056, 0x0042, 0x0025, 0x0034, 0x0000, 0x0002, 0x0059,
0x0000, 0x0000, 0x0000, 0x0007, 0x0000, 0x0057, 0x0000, 0x007D, 0x0000,
0x0009, 0x0000, 0x0023, 0x0000, 0x001D, 0x0000, 0x0000, 0x002B, 0x0000,
0x0000, 0x0000, 0x0000, 0x0021, 0x0000, 0x0000, 0x0000, 0x001B, 0x0000,
0x0031, 0x0000, 0x0000, 0x0019, 0x0000, 0x008E, 0x000A, 0x002C, 0x0030,
0x0020, 0x0000, 0x0004, 0x0048, 0x0000, 0x005E, 0x0037, 0x0036, 0x0069,
0x0000, 0x003B, 0x0000, 0x0065, 0x0000, 0x0045, 0x0000, 0x001A, 0x0000,
0x006E, 0x0000, 0x0026, 0x0038, 0x0000, 0x004F, 0x0000, 0x004C, 0x0000,
0x0000, 0x0040, 0x0000, 0x0076, 0x0000, 0x0000, 0x006D, 0x0000, 0x0000,
0x0071, 0x0000, 0x002F, 0x0000, 0x0075, 0x0000, 0x0000, 0x0079, 0x0000,
0x007C, 0x0000, 0x0000, 0x0013, 0x000F, 0x0039, 0x0039, 0x0000, 0x005B,
0x005B, 0x0000, 0x0000, 0x0067, 0x0000, 0x0077, 0x0000, 0x0001, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0006, 0x0000, 0x0000, 0x000D, 0x0000,
0x002E, 0x0000, 0x006A, 0x0029, 0x0000, 0x0000, 0x0054, 0x0000, 0x0053,
0x0000, 0x0055, 0x0000, 0x0000, 0x0010, 0x0000, 0x0074, 0x0000, 0x0000,
0x008F, 0x0000, 0x0000, 0x0000, 0x0000, 0x004A, 0x0000, 0x0000, 0x0047,
0x0000, 0x0000, 0x0000, 0x0000, 0x0043, 0x0000, 0x0000, 0x003F, 0x0000,
0x0078, 0x008B, 0x0000, 0x0000, 0x0000, 0x004E, 0x0000, 0x0000, 0x008A,
0x004B, 0x0000, 0x003E, 0x003C, 0x0089, 0x0000, 0x0000, 0x0000, 0x001F,
0x0000, 0x0000, 0x007E, 0x0000, 0x0000, 0x0049, 0x0000, 0x0000, 0x0000,
0x0014, 0x0000, 0x0000, 0x000C, 0x0027, 0x0000, 0x0000, 0x0000, 0x0033,
0x0000, 0x0024, 0x0012, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0032, 0x0061, 0x0000, 0x0063, 0x0000, 0x0000, 0x0082, 0x0000, 0x0000,
0x0000, 0x0051, 0x0000, 0x0073, 0x0000, 0x0000, 0x0000, 0x0050, 0x0000,
0x0000, 0x0058, 0x0000, 0x0000, 0x0000, 0x0084, 0x0066, 0x0000, 0x003A,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0022, 0x0064, 0x0064,
0x0000, 0x0000, 0x0000, 0x0044, 0x0000, 0x0000, 0x0017, 0x001C, 0x006B,
0x0000, 0x008D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0060, 0x0062,
0x0088, 0x0000, 0x0000, 0x0000, 0x0086, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0085, 0x0000, 0x0000, 0x0087, 0x0000, 0x0000, 0x0000, 0x0000,
0x005F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x005D,
0x0092, 0x0000, 0x0000, 0x0000, 0x0000, 0x0091, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x005A, 0x0000, 0x0000, 0x0083, 0x0000, 0x0000,
0x0000, 0x0080, 0x0000, 0x007F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0093, 0x0000, 0x0000, 0x0000, 0x0000, 0x0003, 0x0000, 0x0072,
0x0000, 0x0000, 0x006C, 0x0000, 0x0000, 0x0081, 0x0081, 0x0000, 0x0000,
0x0090, 0x0000, 0x0000, 0x0000, 0x008C, 0x0000, 0x0000, 0x0000};
#else
static u16 g_testCollEnemyLookup[] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x001E, 0x0000, 0x0000,
0x002B, 0x0000, 0x0010, 0x0000, 0x000D, 0x0068, 0x0068, 0x0016, 0x0000,
0x0000, 0x0000, 0x003E, 0x0000, 0x0023, 0x0050, 0x0000, 0x0000, 0x0000,
0x0006, 0x0000, 0x000A, 0x0000, 0x007D, 0x0000, 0x0000, 0x002D, 0x0000,
0x0000, 0x006D, 0x007B, 0x0000, 0x0017, 0x0041, 0x0000, 0x0073, 0x0000,
0x004C, 0x0000, 0x0000, 0x0038, 0x0014, 0x005C, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0046, 0x0000,
0x0000, 0x0003, 0x0058, 0x0044, 0x0024, 0x0037, 0x0000, 0x0002, 0x0059,
0x0000, 0x0000, 0x0000, 0x0007, 0x0000, 0x0056, 0x0000, 0x007C, 0x0000,
0x000B, 0x0000, 0x0026, 0x0000, 0x001D, 0x0000, 0x0000, 0x002A, 0x0000,
0x0000, 0x0000, 0x0000, 0x0027, 0x0000, 0x0000, 0x0000, 0x001C, 0x0000,
0x0031, 0x0000, 0x0000, 0x001A, 0x0000, 0x008D, 0x0009, 0x002C, 0x0030,
0x0020, 0x0000, 0x0005, 0x0047, 0x0000, 0x005E, 0x0035, 0x0034, 0x006A,
0x0000, 0x003A, 0x0000, 0x0066, 0x0000, 0x0045, 0x0000, 0x0019, 0x0000,
0x0071, 0x0000, 0x0029, 0x0039, 0x0000, 0x0051, 0x0000, 0x004D, 0x0000,
0x0000, 0x003F, 0x0000, 0x0077, 0x0000, 0x0000, 0x0072, 0x0000, 0x0000,
0x006F, 0x0000, 0x002F, 0x0000, 0x0074, 0x0000, 0x0000, 0x0079, 0x0000,
0x007A, 0x0000, 0x0000, 0x0013, 0x0011, 0x0036, 0x0036, 0x0000, 0x005F,
0x005F, 0x0000, 0x0000, 0x0067, 0x0000, 0x0075, 0x0000, 0x0001, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0000, 0x0000, 0x000E, 0x0000,
0x002E, 0x0000, 0x0069, 0x0021, 0x0000, 0x0000, 0x0055, 0x0000, 0x0054,
0x0000, 0x0053, 0x0000, 0x0000, 0x000F, 0x0000, 0x0076, 0x0000, 0x0000,
0x008E, 0x0000, 0x0000, 0x0000, 0x0000, 0x004A, 0x0000, 0x0000, 0x004B,
0x0000, 0x0000, 0x0000, 0x0000, 0x0043, 0x0000, 0x0000, 0x003D, 0x0000,
0x0078, 0x008A, 0x0000, 0x0000, 0x0000, 0x0052, 0x0000, 0x0000, 0x0089,
0x0048, 0x0000, 0x003C, 0x0040, 0x008B, 0x0000, 0x0000, 0x0000, 0x001F,
0x0000, 0x0000, 0x007E, 0x0000, 0x0000, 0x0049, 0x0000, 0x0000, 0x0000,
0x0015, 0x0000, 0x0000, 0x000C, 0x0028, 0x0000, 0x0000, 0x0000, 0x0032,
0x0000, 0x0022, 0x0012, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0033, 0x0060, 0x0000, 0x0064, 0x0000, 0x0000, 0x007F, 0x0000, 0x0000,
0x0000, 0x004E, 0x0000, 0x006E, 0x0000, 0x0000, 0x0000, 0x004F, 0x0000,
0x0000, 0x0057, 0x0000, 0x0000, 0x0000, 0x0086, 0x0065, 0x0000, 0x003B,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0025, 0x0062, 0x0062,
0x0000, 0x0000, 0x0000, 0x0042, 0x0000, 0x0000, 0x0018, 0x001B, 0x006B,
0x0000, 0x008C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0061, 0x0063,
0x0088, 0x0000, 0x0000, 0x0000, 0x0085, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0084, 0x0000, 0x0000, 0x0087, 0x0000, 0x0000, 0x0000, 0x0000,
0x005D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x005B,
0x0091, 0x0000, 0x0000, 0x0000, 0x0000, 0x0090, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x005A, 0x0000, 0x0000, 0x0082, 0x0000, 0x0000,
0x0000, 0x0083, 0x0000, 0x0081, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0092, 0x0000, 0x0000, 0x0000, 0x0000, 0x0004, 0x0000, 0x0070,
0x0000, 0x0000, 0x006C, 0x0000, 0x0000, 0x0080, 0x0080, 0x0000, 0x0000,
0x008F, 0x0000, 0x0000, 0x0000,
};
#endif

static u8 g_testColluCoords[] = {
0x80, 0x80, 0xA0, 0xA0, 0xC0, 0xC0, 0x00, 0x00,
};
Expand Down
52 changes: 0 additions & 52 deletions src/st/st0_psp/collision.c

This file was deleted.

5 changes: 0 additions & 5 deletions src/st/st0_psp/e_lock_camera.c

This file was deleted.

3 changes: 0 additions & 3 deletions src/st/st0_psp/st_common.c

This file was deleted.

2 changes: 0 additions & 2 deletions src/st/st0_psp/st_update.c

This file was deleted.

0 comments on commit 3754cc3

Please sign in to comment.