Skip to content

Commit

Permalink
Rearrange some files to remove padding (#819)
Browse files Browse the repository at this point in the history
As mentioned in the previous PR, this removes a few rodata_padding
variables by simply un-splitting the files involved here.

There are two more paddings I found in other places; I will look into
those next but don't want to do too much file reshuffling in one PR.
This PR takes 3 files and merges them into one, removing the padding in
the process.
  • Loading branch information
bismurphy authored Dec 8, 2023
1 parent 80e9af2 commit b541bba
Show file tree
Hide file tree
Showing 24 changed files with 6,098 additions and 6,151 deletions.
2 changes: 1 addition & 1 deletion Makefile.pc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ LD_FLAGS_PC := -fsanitize=address -lc -lm -lSDL2
C_FILES_PC := main.c log.c stubs.c sotn.c
C_FILES_PC += pc.c sdl2.c
C_FILES_PSX_SDK := libapi.c libetc.c libgpu.c libgte.c libgs.c libcd.c libcard.c libspu.c libsnd.c cdc.c
C_FILES_DRA := 42398.c play.c gameover.c loading.c 46FD4.c
C_FILES_DRA := 42398.c play.c loading.c
C_FILES_DRA += 91EBC.c 92F60.c 93290.c 93BDC.c 94F50.c 953A0.c

OBJS := $(C_FILES_PC:%.c=$(PC_BUILD_DIR)/src/pc/%.o)
Expand Down
35 changes: 15 additions & 20 deletions config/splat.hd.dra.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ segments:
- [0x510, data]
- [0x1F18, .data, save_mgr]
- [0x2178, data]
- [0x2CF4, .data, 5298C] # array of strings
- [0x2D1C, .data, 5298C] # HD exclusive array of strings
- [0x2CF4, .data, 5087C] # array of strings
- [0x2D1C, .data, 5087C] # HD exclusive array of strings
- [0x2D88, data]
- [0x2ED0, .data, 5D6C4]
- [0x2EF8, data]
Expand All @@ -57,9 +57,9 @@ segments:
- [0x20A20, data]
- [0x3B458, .rodata, 42398]
- [0x3B618, .rodata, play]
- [0x3B648, rodata, gameover] # jtbl_800DB648
- [0x3B648, rodata, play] # jtbl_800DB648
- [0x3B808, .rodata, loading]
- [0x3B8D0, .rodata, 46FD4]
- [0x3B8D0, .rodata, loading]
- [0x3B938, .rodata, 47BB8] # SimFile strings
- [0x3BCF0, .rodata, 47BB8] # VSyncHandler
- [0x3BD08, .rodata, 47BB8] # func_800E7E08
Expand All @@ -72,16 +72,16 @@ segments:
- [0x3C204, .rodata, collider]
- [0x3C404, .rodata, demo]
- [0x3C488, .rodata, 5087C] # func_800F0940
- [0x3C4A8, .rodata, 52860]
- [0x3C4D0, .rodata, 5298C] # func_800F298C
- [0x3C548, .rodata, 5298C] # strings
- [0x3C658, .rodata, 5298C] # HD exclusive array of strings
- [0x3C6F8, .rodata, 5298C] # DrawMenuFamiliars
- [0x3C718, .rodata, 5298C] # DrawMenu
- [0x3C758, .rodata, 5298C] # func_800F9F40
- [0x3C788, .rodata, 5298C] # MenuHandleCursorInput
- [0x3C7A0, .rodata, 5298C] # HandleMenu str
- [0x3C7C8, .rodata, 5298C] # HandleMenu jtbl
- [0x3C4A8, .rodata, 5087C]
- [0x3C4D0, .rodata, 5087C] # func_800F298C
- [0x3C548, .rodata, 5087C] # strings
- [0x3C658, .rodata, 5087C] # HD exclusive array of strings
- [0x3C6F8, .rodata, 5087C] # DrawMenuFamiliars
- [0x3C718, .rodata, 5087C] # DrawMenu
- [0x3C758, .rodata, 5087C] # func_800F9F40
- [0x3C788, .rodata, 5087C] # MenuHandleCursorInput
- [0x3C7A0, .rodata, 5087C] # HandleMenu str
- [0x3C7C8, .rodata, 5087C] # HandleMenu jtbl
- [0x3CC18, .rodata, 5D6C4]
- [0x3CC60, rodata]
- [0x3CC78, .rodata, 627C4] # jtbl_800DCC78
Expand All @@ -103,7 +103,7 @@ segments:
- [0x414A4, .rodata, 72BB0] # jtbl_800E14A4
- [0x4166C, .rodata, 72BB0] # jtbl_800E166C
- [0x417E4, .rodata, 72BB0] # jtbl_800E17E4
- [0x417FC, .rodata, 73AAC]
- [0x417FC, .rodata, 72BB0]
- [0x41810, rodata]
- [0x41824, rodata] # jtbl_800E1824
- [0x41864, rodata] # jtbl_800E1864
Expand Down Expand Up @@ -156,17 +156,13 @@ segments:
- [0x42270, .rodata, 953A0]
- [0x422B4, c, 42398]
- [0x44EC8, c, play]
- [0x458E4, c, gameover]
- [0x463E4, c, loading]
- [0x47688, c, 46FD4]
- [0x48250, c, 47BB8]
- [0x4957C, c, save_mgr]
- [0x4ABF0, c, 4A538]
- [0x4FAE0, c, collider]
- [0x5027C, c, demo]
- [0x50F00, c, 5087C]
- [0x52EE4, c, 52860]
- [0x53010, c, 5298C]
- [0x5D678, c, 5D6C4]
- [0x62654, c, 627C4]
- [0x63D1C, c, 63ED4]
Expand All @@ -176,7 +172,6 @@ segments:
- [0x7021C, c, 704D0]
- [0x71574, c, 71830]
- [0x7291C, c, 72BB0]
- [0x7379C, c, 73AAC]
- [0x75A90, c, 75DA0]
- [0x75C44, c, 75F54]
- [0x7A1C8, c, 7A4D0]
Expand Down
28 changes: 11 additions & 17 deletions config/splat.us.dra.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ segments:
- [0x1F18, .data, save_mgr]
- [0x21B8, data]
- [0x2BC0, data]
- [0x2D48, .data, 5298C]
- [0x2D48, .data, 5087C]
- [0x2D70, data]
- [0x2EC0, .data, 5D6C4]
- [0x2EE8, data]
Expand Down Expand Up @@ -69,9 +69,8 @@ segments:
- [0x3B3B0, rodata]
- [0x3B3B4, .rodata, 42398]
- [0x3B530, .rodata, play]
- [0x3B560, .rodata, gameover]
- [0x3B720, .rodata, loading]
- [0x3B7E8, .rodata, 46FD4]
- [0x3B7E8, .rodata, loading]
- [0x3B9B8, .rodata, 47BB8] # SimFile strings
- [0x3BD70, .rodata, 47BB8] # VSyncHandler
- [0x3BD88, .rodata, 47BB8] # func_800E7E08
Expand All @@ -84,14 +83,14 @@ segments:
- [0x3C290, .rodata, collider]
- [0x3C490, .rodata, demo]
- [0x3C514, .rodata, 5087C] # func_800F0940
- [0x3C534, .rodata, 52860] # func_800F2860
- [0x3C55C, .rodata, 5298C] # func_800F298C
- [0x3C5D4, .rodata, 5298C] # strings
- [0x3C68C, .rodata, 5298C] # DrawMenuFamiliars
- [0x3C6AC, .rodata, 5298C] # DrawMenu
- [0x3C71C, .rodata, 5298C] # MenuHandleCursorInput
- [0x3C734, .rodata, 5298C] # HandleMenu str
- [0x3C75C, .rodata, 5298C] # HandleMenu jtbl
- [0x3C534, .rodata, 5087C] # func_800F2860
- [0x3C55C, .rodata, 5087C] # func_800F298C
- [0x3C5D4, .rodata, 5087C] # strings
- [0x3C68C, .rodata, 5087C] # DrawMenuFamiliars
- [0x3C6AC, .rodata, 5087C] # DrawMenu
- [0x3C71C, .rodata, 5087C] # MenuHandleCursorInput
- [0x3C734, .rodata, 5087C] # HandleMenu str
- [0x3C75C, .rodata, 5087C] # HandleMenu jtbl
- [0x3CBAC, .rodata, 5D6C4] # func_800FD6C4
- [0x3CBF4, rodata]
- [0x3CC0C, .rodata, 627C4]
Expand All @@ -109,7 +108,7 @@ segments:
- [0x41588, .rodata, 72BB0] # func_80112BB0
- [0x41750, .rodata, 72BB0] # func_801131C4
- [0x418C8, .rodata, 72BB0] # func_801131C4
- [0x418E0, .rodata, 73AAC]
- [0x418E0, .rodata, 72BB0]
- [0x418F4, rodata]
- [0x41908, rodata] # AlucardHandleDamage
- [0x41948, rodata] # AlucardHandleDamage
Expand Down Expand Up @@ -162,17 +161,13 @@ segments:
- [0x42354, .rodata, 953A0]
- [0x42398, c, 42398]
- [0x4493C, c, play]
- [0x45358, c, gameover]
- [0x45D30, c, loading]
- [0x46FD4, c, 46FD4]
- [0x47BB8, c, 47BB8]
- [0x48EE4, c, save_mgr]
- [0x4A538, c, 4A538]
- [0x4F45C, c, collider]
- [0x4FBF8, c, demo]
- [0x5087C, c, 5087C]
- [0x52860, c, 52860]
- [0x5298C, c, 5298C]
- [0x5D6C4, c, 5D6C4]
- [0x627C4, c, 627C4]
- [0x63ED4, c, 63ED4]
Expand All @@ -182,7 +177,6 @@ segments:
- [0x704D0, c, 704D0]
- [0x71830, c, 71830]
- [0x72BB0, c, 72BB0]
- [0x73AAC, c, 73AAC]
- [0x75DA0, c, 75DA0]
- [0x75F54, c, 75F54]
- [0x7A4D0, c, 7A4D0]
Expand Down
2 changes: 0 additions & 2 deletions config/splat.us.stdre.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ segments:
- [0x16C0, data]
- [0x1171C, .rodata, 11A64]
- [0x11728, .rodata, succubus] # EntitySuccubus
- [0x117F0, .rodata, 13B3C]
- [0x11808, .rodata, 14774]
- [0x1181C, rodata]
- [0x118D0, rodata]
Expand All @@ -56,7 +55,6 @@ segments:
- [0x11A28, rodata]
- [0x11A64, c]
- [0x11A64, c, succubus]
- [0x13B3C, c]
- [0x14774, c]
- [0x1697C, c]
- [0x16F90, c, random]
Expand Down
1 change: 0 additions & 1 deletion config/symbols.us.dra.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ g_PalEquipIcon = 0x800D88D4;
D_800DBFFC = 0x800DBFFC; // ignore:true
aXXVQ = 0x800DCBF4;
aAxearmor = 0x800DCC00;
jpt_80102918 = 0x800DCC2C;
aGold = 0x800DD0A8;
aNz0 = 0x800DD0B0;
aFNz0 = 0x800DD0B4;
Expand Down
4 changes: 4 additions & 0 deletions src/dra/42398.c
Original file line number Diff line number Diff line change
Expand Up @@ -1239,6 +1239,10 @@ void HandleTitle(void) {
}
}

// This indicates that in HD, this file and the next one (play.c)
// are one continues C file. In US, they are not. rodata for functions
// in the same file has four 00 bytes separating them, and the fact that
// they exist in one version and not the other is indicative of a file split.
#if defined(VERSION_HD)
const int filesplit_42398_rodata = 0x00000000;
#endif
Loading

0 comments on commit b541bba

Please sign in to comment.