Track the active character with the battle name highlight - #35
Merged
manz merged 1 commit intoSep 10, 2026
Merged
Conversation
Two defects, both measured against a Palom / Cecil / Porom party. The walk read which character a row shows out of CharOrderTbl and wrote a tilemap row per display index. Neither holds. `DrawCharNames` ($02:A20C) takes both from `$02:A1CD`, the table of battle-struct pointers it indexes by display position: a first byte of zero is the empty slot it skips, and it skips without taking a row, so the names compact upward. The order table disagrees with those pointers - it calls display 0 slot 1 while the pointer reads $2080, slot 2 - which is what lit the wrong name. Slot now comes from the pointer, (base - $2000) / $40, and rows count only the names actually drawn. It also ran from the writer shim, at the instant the engine stores $1822. That is too early to ask what is on screen, and it never came back to check: measured there, four of five slots report hidden, while the same bytes read clear once the battle is running. The shim now just invalidates a key and a per-frame refresh re-applies when the active character or the drawn-name set moves - a compare on an idle frame, still a ~300-cycle palette flip when it fires, never a re-render. Verified by forcing $1822 and reading the ink colour off the framebuffer: Cecil highlights Cecil's row, Palom highlights Palom's.
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.
Stacked on #34.
The highlight is a tilemap palette flip — ~300 cycles, not a re-render — and it stopped following the active character. Two defects, both measured on a Palom / Cecil / Porom party.
Wrong source for row to character. It read the slot from
CharOrderTbland wrote one tilemap row per display index.DrawCharNames($02:A20C) uses neither: both come from$02:A1CD, the table of battle-struct pointers it indexes by display position. A first byte of zero is the empty slot it skips, and it skips without taking a row, so names compact upward. The two tables disagree — the order table calls display 0 slot 1 while its pointer reads $2080, slot 2 — which is what lit the wrong name.Applied before the engine was ready. It ran once from the writer shim at the
sta $1822instant and never revisited. Measured there, four of five slots report hidden; the same bytes read clear once the battle runs. The shim now invalidates a key and a per-frame refresh re-applies whenever the active character or the drawn-name set moves: a compare on an idle frame, the flip when it fires. Self-healing, so it cannot get wedged on stale state again.Verified by forcing
$1822and reading ink colour off the framebuffer: Cecil highlights Cecil's row, Palom highlights Palom's. A natural ATB rotation could not be driven in either savestate I have — one has Cecil at agility 55 against 8, so the queue only ever holds him.