9 Commits
Author SHA1 Message Date
Adubbz f0a359ea9b Publish PC build artifacts and notify Discord of commits 2026-10-06 23:52:21 +11:00
Adubbz b05e32f1a8 PAL fixes 2026-09-30 22:59:44 +10:00
AdubbzandAlessandro Suha ccec0abd2e PAL (#41)
* Name the discs by region and put every build input and output under a region directory

The disc images are rom/Dark Cloud (NTSC).iso and rom/Dark Cloud (PAL).iso;
each region's checksums and extracted files live under rom/ntsc and rom/pal.
scripts/build/region.py turns REGION (NTSC by default, or PAL) into the paths
every script and CMake use: config/<region> holds the split configuration,
symbol lists, fixups and linker script, splat writes asm/<region>, and CMake
builds into build/<region>. The overlay headers and pads are splat pad
segments, so no assets/ tree is written, and the unused config/reference_asm
and reference_asm.py are gone. overlay_private.sh places a private-repository
file still kept under rom/extracted/ in rom/ntsc/extracted/.


* Carry PR 40's PAL source differences; NTSC unchanged

The PAL prototype's small divergences sit inline under #ifdef PAL in 30
units; common.h gains the per-region screen geometry and GS Y offset,
clsmes.hpp the message window width and ClsMes size. The twenty PAL-only
functions stand as stubs at their retail positions, dataread's four
tree-building functions are NTSC-only, and PAL compiler-state pragma
blocks sit beside NTSC's. config/pal/splice.txt lists the 213 functions
whose PAL bytes are not yet expressed in C. Every unit compiles with
-DPAL; every NTSC object is byte-identical.

Co-authored-by: Alessandro Suha <plarpoon@zandark.eu>

* Generate the PAL split configuration from NTSC's

scripts/build/splat_config.py writes a release's symbol lists from its own
executable and carries NTSC's yaml, linker script and object fixups over to
another release by symbol and relocation pairing: the overlay entry points by
the retail name they note, _gp from .reginfo, @ORDER comments and the dun text
start, and function-local statics through the function that owns them. The
carried files are written once and maintained by hand; --check compares the
symbol lists and, on NTSC, proves the carry is the identity. region.paths()
names any release's files.

config/pal holds the PAL prototype's yaml, symbol lists, linker script, fixups
and expression-node overrides. NTSC unchanged.

Co-authored-by: Alessandro Suha <plarpoon@zandark.eu>

* Supply the PAL prototype's undecompiled functions from INCLUDE_ASM markers

Each PAL function not yet in C is `#ifdef PAL INCLUDE_ASM("asm/pal/nonmatchings/
<unit>", <symbol>)` beside its NTSC body (207 markers); include_asm.h and the
mwccgap marker path are back for PAL, with the name counter pinned where a
marker stands so later compiler constants keep their names. PAL-differing data
is C under #ifdef PAL in the owning units. datacheck.py reads a relocation's
target section from the REL entry's info field. docs/PAL.md describes the PAL
build. NTSC is byte-identical; PAL links with 120 functions and 2 data bytes
still to reconcile.

Co-authored-by: Alessandro Suha <plarpoon@zandark.eu>

* Carry PR 40's PAL data and layout; every PAL image verifies

The PAL linker script places EditGaijiTbl at 0x0025f02c, aligns _dun_end to
128, drops dngmessageman's small-data line (PAL's LanguageStr is in
hitvalue.cpp) and aligns editmapscript's .sbss to 16 over retail's unnamed
pad at 0x002a9f3c. title/op_c loads the Chara__3 entries NTSC does in
OpC_InitProcess2/5; battlemenu loads wepstatus and reloads DrawAallWeapon's
textures from BtlMenuExtBlock under PAL.

datacheck.py resolves retail's name__N spellings (Names), scores each voted
anchor on its own layout and resolves a pointer word by its exact name.

PAL: SCUS_971.11 3048 perfect / 154 asm, TITLE.BIN 126 / 44, DUN.BIN 52 / 9,
data perfect. NTSC unchanged.

Co-authored-by: Alessandro Suha <plarpoon@zandark.eu>

* PAL: 29 main-executable functions in C from PR 40; NTSC unchanged

battle_globals, battlemenu (9), memcard (2), menu_dungeon, shot_freefuncs,
clsmes, dataread (2), edit, editloop, fireomni, frame, mglib, texture (3),
stockitem, chararead, dungeonmap and spritetable express their PAL
differences under #ifdef PAL instead of INCLUDE_ASM markers; editloop's PAL
argument-flag indices follow. mglib.hpp declares PAL's mgTopVRAM and
mgZBufferAdr.

Co-authored-by: Alessandro Suha <plarpoon@zandark.eu>

* PAL: 10 title-overlay functions in C from PR 40; NTSC unchanged

op_a (2), op_b, op_c (2), op_d, opening, rushmovi (2) and title express their
PAL differences under #ifdef PAL. A string retail shares with a function
still supplied by a marker is reached through PAL_POOLED, so the compiled
function does not emit a second copy.

Co-authored-by: Alessandro Suha <plarpoon@zandark.eu>

* PAL: dun, gamepad, eastking, menu_draw and collisiondata functions in C from PR 40

dun/gameloop (2), gamepad (3), eastking (2), menu_draw (2) and collisiondata
express their PAL differences under #ifdef PAL; dun/gameloop takes PR 40's
PAL argument-flag block, InitEastKingEvent returns int under PAL, and the
PAL expression-node overrides carry PR 40's five entries. The PAL fixups
follow every unit's renumbered statics. All three PAL images verify with
158 functions still supplied by markers; NTSC unchanged.

Co-authored-by: Alessandro Suha <plarpoon@zandark.eu>

* Make decompile.sh's m2c context parse again

m2ctx.py spells a C++ template-id as a plain identifier, and now declares each
one it spells as an opaque struct, so CDataAlloc<1, 1690000> no longer breaks
m2c's C parser. decompile.sh generates a missing context with the container's
venv Python, which has libclang's bindings.


* Work on the PAL version

---------

Co-authored-by: Alessandro Suha <plarpoon@zandark.eu>
2026-09-30 21:49:16 +10:00
Adubbz df6ea5ada9 More editloop progress 2026-09-09 10:15:00 +10:00
Adubbz 6233cd48f3 Cleaner progress 2026-09-08 13:10:31 +10:00
Adubbz 51dd7f7bdd Yet even more progress formatting changes 2026-09-08 13:05:12 +10:00
Adubbz 61135684fe More discord progress message tweaks 2026-09-08 12:15:13 +10:00
Adubbz 9831dffc30 Simplified formatting 2026-09-08 11:16:00 +10:00
Adubbz a376840c7a Added a discord progress message 2026-09-08 11:03:06 +10:00