From 49830a2281b9b1f9bd9a17ed611952e5e17f6b3b Mon Sep 17 00:00:00 2001 From: Schindler Date: Mon, 16 Nov 2026 04:22:38 -0500 Subject: [PATCH 01/13] Bartz's Dissidia (2008) moves as new abilities, with an on/off switch in Settings > Mods - tools/d1_objx.py: a D1 moveset (objx) in the 012 layout (actions, commands, hits, projectiles, effect placements, event ops) - tools/d1_moves.py (+ d1_moves_studio.js): builds mods/bartz-dff from both discs with the Move Studio's copy-a-move run headless; names, help, CP/AP, learn levels, D1 voice lines for the slots 012's bank left empty - retail mods may add abilities: charmod.py exports their copy entries, roster_mainbin.retail_named builds them for the retail charId, /retail_moves.txt lists them; a removed / disabled mod keeps them as disabled records (save safety) - runtime: retail moves are taught to the save record (on) or hidden and inert (off); Settings > Mods row per line (next start) - Move Studio copy: same-character sources keep voices and face textures; effect placements stay bound to the copied animation; every motion-bound placement of an effect id comes along; full motion names - battle_test: Bartz in the Player Select grid Co-Authored-By: Claude Opus 5.5 --- mods/README.md | 2 + .../games/dissidia/docs/character-mods.md | 44 +++ .../games/dissidia/runtime/package_mods.cpp | 2 +- psprecomp/games/dissidia/runtime/roster.cpp | 106 ++++++- psprecomp/games/dissidia/tools/battle_test.py | 4 +- psprecomp/games/dissidia/tools/charmod.py | 52 +++- psprecomp/games/dissidia/tools/d1_moves.py | 226 +++++++++++++++ .../games/dissidia/tools/d1_moves_studio.js | 82 ++++++ psprecomp/games/dissidia/tools/d1_objx.py | 261 ++++++++++++++++++ .../games/dissidia/tools/roster_mainbin.py | 29 +- psprecomp/runtime/src/psp_settings.cpp | 39 ++- studio/copy.js | 52 ++-- 12 files changed, 867 insertions(+), 32 deletions(-) create mode 100644 psprecomp/games/dissidia/tools/d1_moves.py create mode 100644 psprecomp/games/dissidia/tools/d1_moves_studio.js create mode 100644 psprecomp/games/dissidia/tools/d1_objx.py diff --git a/mods/README.md b/mods/README.md index bfd7a70..eda5b8a 100644 --- a/mods/README.md +++ b/mods/README.md @@ -20,6 +20,8 @@ mods// skins// bodies and weapons that replace the default ones ``` +**Bartz's moves from the first Dissidia:** `psprecomp/games/dissidia/tools/d1_moves.py --d1 --iso012 <012 ISO>` makes `mods/bartz-dff` from your own two discs: eight moves 012 dropped come back as new abilities. Settings > Mods switches them on and off (next start). Details: [docs/character-mods.md](../psprecomp/games/dissidia/docs/character-mods.md) (*New moves for a retail character*). + A folder with `"kind": "retail"` in its `mod.json` changes one of the game's own characters instead of adding one (the Move Studio's *Save as mod* makes those); its body can be swapped for your own model, and `"skin": "retail"` puts the game's back. A folder whose name starts with `_`, or whose `mod.json` has `"enabled": false`, is never built. `_template/` is the template. ## By hand diff --git a/psprecomp/games/dissidia/docs/character-mods.md b/psprecomp/games/dissidia/docs/character-mods.md index f6d7709..fb99aae 100644 --- a/psprecomp/games/dissidia/docs/character-mods.md +++ b/psprecomp/games/dissidia/docs/character-mods.md @@ -30,6 +30,50 @@ with the add-on 0.32+), Blender (Character mods > Model), or `charmod.py body cl duellum`. It goes on the first costume and its assist; the other costumes keep their own bodies. Weapons are not covered for retail characters yet. +### New moves for a retail character + +A retail folder may also add abilities: `move_names` entries with `"copy"` (as an added character's, see *move_names +fields*) become new 'ablt' records of the retail charId (`roster_mainbin.retail_named`); the retail entries in the same +map are left alone. The build lists each such folder in `/retail_moves.txt`: + +``` +bartz-dff 9 0910,0911,0912,0913,0914,0915,0916,0917 nm=Bartz:_Dissidia_(2008)_moves +``` + +and the runtime (`roster.cpp`, retail moves) reads it at start: +- **on**: the abilities are taught to the character's save record whenever the game fetches it (FUN_088CB164), so a save of + any level has them at once (AP still has to be earned to master them); +- **off** (`#off# ` in front of the line; **Settings > Mods** switches it, at the next start): the records are hidden and + inert the way `"disabled"` makes them (owner 0xFE, command -2), so a save that learnt or equipped them stays valid (an + equipped slot shows empty). The folder's files stay installed: only the new commands use what they add. + +A rebuild keeps a line's `#off#`. A folder deleted or set `"enabled": false` keeps its new abilities as disabled records +(from the previous `extra_abilities.json`), for the same reason. Settings > Mods shows one row per line instead of the +folder's own row. + +**Bartz's Dissidia (2008) moves** (`mods/bartz-dff`, made by `tools/d1_moves.py` from your own two discs): Ascendant +Lance, Climbarrel, Storm Shot, Slidehazzard, Soul Eater, Flood, Wind Shear and Paladin Force, the eight moves 012 took +away, as abilities 0910..0917 next to his 012 kit. + +``` +tools/d1_moves.py --d1 "Dissidia Final Fantasy (USA).iso" --iso012 "Dissidia 012 (USA).iso" # writes mods/bartz-dff +``` + +It converts D1's moveset to the 012 layout (`tools/d1_objx.py`: action records 112 -> 116 bytes, the command table, +hits 60 -> 68 bytes with 012's hit-stop bytes filled in, projectile parameters from floats to the float pool, effect +placements 248 -> 260 bytes, and the six event ops whose value count grew, learnt from the moves both games share), then +runs the Move Studio's copy-a-move headless (`tools/d1_moves_studio.js`: Node.js + playwright-core + Chrome) and adds the +names, help texts, CP / AP, learn levels and D1's voice lines for the slots 012's bank left empty (same slot numbers in +both banks). Tested 16 Nov 2026 on the USA discs: every move plays with its animation, hits, effects, banner and damage +(test driver `action 3024..3039`), the Abilities screen lists them, a pressed Soul Eater plays in Quick Battle, and the +switch hides and restores them. + +Move Studio changes made for it (help every copy): the source's voices and face textures come along when it is the same +character (a mod folder whose `character.based_on` is the target's code); an effect placement bound to the animation it +belongs to (FEPA +0xC8, which the game plays and ends with that animation) is bound to the copied animation instead of +cleared (cleared, a looping hand effect outlived its move), and every placement of the effect id bound to a copied +animation comes along; copied animations get their whole name (`cpSetChunkName`). + ## A character folder (`mods//`) | Path | What | Edit it to | diff --git a/psprecomp/games/dissidia/runtime/package_mods.cpp b/psprecomp/games/dissidia/runtime/package_mods.cpp index aeae890..e2cc5e2 100644 --- a/psprecomp/games/dissidia/runtime/package_mods.cpp +++ b/psprecomp/games/dissidia/runtime/package_mods.cpp @@ -216,7 +216,7 @@ bool PackageMods::build(const std::vector& original_index, uint64_t pac if (!parse_hex8(stem, &crc)) { note("[MODS] skip (bad by_crc name): " + rel); continue; } } else { if (norm.find('/') == std::string::npos && - (norm.compare(0, 6, "readme") == 0 || norm == "roster.txt")) continue; // roster.txt: roster.cpp config + (norm.compare(0, 6, "readme") == 0 || norm == "roster.txt" || norm == "retail_moves.txt")) continue; // roster.cpp config // textures/… is the texture-pack tree (psp_tex_pack.cpp serves it by xxhash id); the game never // requests those paths, and a dump of 1,000+ PNGs would otherwise flood the package index below. if (norm.compare(0, 9, "textures/") == 0) continue; diff --git a/psprecomp/games/dissidia/runtime/roster.cpp b/psprecomp/games/dissidia/runtime/roster.cpp index 678122a..7e5f569 100644 --- a/psprecomp/games/dissidia/runtime/roster.cpp +++ b/psprecomp/games/dissidia/runtime/roster.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -951,9 +952,15 @@ void learn_all_own(uint8_t* rdram, uint8_t* rec, const Entry& e) { } } } +void retail_moves_teach(uint8_t* rdram, uint32_t rec, int charId); void saverec_hook(uint8_t* rdram, recomp_context* ctx) { const Entry* e = extra_of(static_cast(ctx->r[5])); - if (!e) { g_orig_saverec(rdram, ctx); return; } + if (!e) { + const int charId = static_cast(ctx->r[5]); + g_orig_saverec(rdram, ctx); + retail_moves_teach(rdram, static_cast(ctx->r[2]), charId); + return; + } ctx->r[5] = e->like; g_orig_saverec(rdram, ctx); const uint32_t src = static_cast(ctx->r[2]); @@ -5469,7 +5476,7 @@ void dissidia_roster_grid_install() { g_orig_textcreate = psp_dispatch_probe_lookup(0x0887B3ECu); g_orig_textlit = psp_dispatch_probe_lookup(0x0887D868u); if (g_orig_textcreate && g_orig_textlit && !std::getenv("PSPRECOMP_ROSTER_TRACE")) psp_dispatch_register(0x0887B3ECu, oppinfo_name_hook); - g_orig_saverec = psp_dispatch_probe_lookup(0x088CB164u); + if (!g_orig_saverec) g_orig_saverec = psp_dispatch_probe_lookup(0x088CB164u); // (already hooked for retail moves) if (g_orig_saverec) psp_dispatch_register(0x088CB164u, saverec_hook); { // the extras' own records in a sidecar of each save (savedata import stubs, bound by psp_hle_init before this) const uint32_t init = psp_hle_stub_addr_for_nid(NID_SD_INIT), status = psp_hle_stub_addr_for_nid(NID_SD_STATUS), @@ -5593,6 +5600,88 @@ void objentry_load_hook(uint8_t* rdram, recomp_context* ctx) { g_orig_obj_load(rdram, ctx); } +// ---- Retail moves: new abilities a "kind": "retail" mod gives a retail character (Bartz's Dissidia (2008) moves, +// mods/bartz-dff). tools/charmod.py builds their 'ablt' records into main.bin like an added character's and lists them in +// /retail_moves.txt, one line per mod: "[#off# ] ,,... nm=