Repository navigation
Repair ten Spanish dialogue rows the reference patch got wrong - #6
Merged
TechnicallyComputers merged 1 commit intoSep 4, 2026
Merged
Conversation
The reported symptom - Spanish second lines rendering blank - is not a defect. A pre_quote capture in es showed line 1 complete and line 2 empty, but that is the inter-line pause: polling the box with no input shows line 1 settling at ~1.6s and line 2 typing from ~2.4s. Spanish rows are shorter than English ones, so they finish earlier and sit in that gap longer, which is what made a fixed-offset capture look language-specific. Both lines render. Sweeping all 162 rows in all six pages did turn up two real Spanish-only defects, and this fixes them at the source: * Seven rows the Max1323 patch never translated, still holding the English bytes: 0x017900, 0x026d00, 0x026d80, 0x027100, 0x027180, 0x02c900, 0x02d900. * Three rows whose top and bottom halves encode DIFFERENT text, so from the first divergent column the screen draws the top 8px of one letter over the bottom 8px of another: 0x017e00 (guera/guerra), 0x027580 (Quieres/Quirees), 0x02cf80 (Soy/soy). decode_reference_tilemaps.py already flagged these as bottom-row validation failures; it now reports zero. An `es` string in endless_duel_dialogue_targets.toml is now an override that re-encodes the row through encode_line, which derives the bottom tile as top + 0x10 and so can never desync again. Delivering it needs the generator to own the row outright. A repaired row cannot be co-owned with the imported IPS fragments: they are byte-granular, they straddle row boundaries, and they do not tile a row, because an IPS record exists only where the reference differs from the cart. Every partial scheme was tried and fails - rewriting only the fragments' es payload makes the row patch's guard reject the result (a silent no-op, visible only as a rising guard-skip count), and filling the uncovered bytes separately is worse, since a 1-byte guard matches by coincidence in every language and a switch strands a few Spanish bytes inside the previous language's row. So the fragments are split around each repaired row (12 split, 79 dropped) and the dialogue patch carries source + one payload per language, exactly as generate_intro_caption_patch.py already does for the caption rectangles. --check now proves it. It replays the table for all ten languages plus off, asserts every one of the 162 rows against its expected payload, and walks nine language-switch sequences, because the engine re-applies rom_patches over the current cart image - a guard that stops recognising the live row fails only after a switch. Seventeen rows that already lost a switch back to Spanish before this work are pinned in KNOWN_SWITCH_LOSS as a burn-down list; any new one fails the check. 0x02cf80 was on that list and its repair removes it. Old-vs-new replay: en, fr, it, pt, tl, id, zh, ko, th and off are byte-identical. es differs by 344 bytes, all inside the ten repaired rows. Guard-skips are unchanged for every language (off improves 163 -> 153). The intro caption's es digest moves for the second time, documented in place beside the first. Also corrects two things this investigation proved wrong in the docs: battle_dialogue_0 IS a staged surface (it copies to $7f:0000), and a fixed-offset capture of a typewriter scene is not evidence. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The reported bug was a capture artifact
Spanish second lines were reported as blank. They are not. A
pre_quotecapture inesshowed line 1 complete and line 2 empty, which read as a dropped line; polling the same box with no input shows the real sequence:Line 1 settles at ~1.6 s, line 2 starts at ~2.4 s. Spanish rows are shorter than English ones, so they finish earlier and sit in that ~0.8 s gap longer — which is exactly why a fixed-offset capture made the artifact look language-specific. Also disproved along the way: the
es_hexpayloads were not lossy (fragments-only and full-table replays are byte-identical across all 162 rows), padding style is irrelevant, and the es/en images share identical code.What is actually broken
Sweeping all 162 rows across all six pages found two Spanish-only defect classes in the imported Max1323 data.
0x017900Sorry...(English)Lo siento...0x017e00Esta guera parece/ halves desyncedEsta guerra parece0x026d00We're all incredible(English)Todos somos unos0x026d80fools...(English)tontos increibles...0x027100Sorry, but I don't have(English)Lo siento, pero no tengo0x027180the time for this.(English)tiempo para esto.0x027580¿Quieres otra?/ halves desynced¿Quieres otra?0x02c900On your feet!(English)¡En pie!0x02cf80final,¡Soy el vencedor!/ halves desyncedfinal,¡Soy el vencedor!0x02d900I fight for Duke Treize!(English)¡Lucho por el Duque Treize!Seven rows were never translated. Three encode different text in their top and bottom halves (
guera/guerra,Quieres/Quirees,Soy/soy), so from the first divergent column the screen draws the top 8px of one letter over the bottom 8px of another — 11 corrupt cells.decode_reference_tilemaps.pyalready reported these as bottom-row validation failures; it now reports zero.0x026c00looks untranslated but is......in every language, so it is left alone. Spanish is written unaccented throughout, which is the reference corpus's own convention (Cumplire,mision) and a hard constraint:esallocates no accent cells, only the inverted marks¿/¡.Fix
An
esstring inendless_duel_dialogue_targets.tomlis now an override, re-encoded throughencode_line, which derives the bottom tile astop + 0x10and so cannot desync again. Each override records thees_reference_hexit replaces.Delivering it requires the generator to own the row outright. A repaired row cannot be co-owned with the imported IPS fragments: they are byte-granular (91 touch these ten rows), they straddle row boundaries, and they do not tile a row — an IPS record exists only where the reference differs from the cart, leaving 81 bytes here covered by nothing. Both partial approaches were built and both fail:
espayload makes the row patch's guard reject the result — a silent no-op whose only symptom is a rising guard-skip count;So the fragments are split around each repaired row (12 split, 79 dropped) and the dialogue patch carries
sourceplus one payload per language — the same split-and-provegenerate_intro_caption_patch.pyalready applies to the caption rectangles.Validation
All headless.
esdiffers by 344 bytes, all inside the ten repaired rows. Guard-skips unchanged per language (offimproves 163 → 153).--checknow replays all ten languages plusoff, asserts each of the 162 rows against its expected payload, and walks nine language-switch sequences (es→fr,es→off,off→es,fr→es,en→es,es→ko,ko→es,es→en,off→fr→es→off→es) — switching matters because the engine re-applies rom_patches over the current cart image, so a stale guard fails only after a switch. Seventeen rows that already lost a switch back to Spanish before this work are pinned inKNOWN_SWITCH_LOSSas a burn-down list; any new one fails.0x02cf80was on that list and its repair removes it.decode_reference_tilemaps.py --from-table: bottom-row validation failures 3 → 0.--checkgreen;check_localization.pygreen;git diff --checkclean; generators idempotent (second--writesplits 0, drops 0).esdialogue previews now render (its only authored rows are the ten repairs, so the preview is the review sheet).The intro caption's
esdigest moves for the second time, documented in place beside the first;enis unchanged.Docs corrected
Two things this investigation proved wrong:
battle_dialogue_0is a staged surface (it copies to$7f:0000, row stride0x80), and a fixed-offset capture of a typewriter scene is not evidence — poll until it settles, and never press A in the sampling loop.🤖 Generated with Claude Code