Skip to content

Whos there#156

Merged
wrjones104 merged 27 commits into
ff6wc:devfrom
wrjones104:whos-there
Jun 23, 2026
Merged

Whos there#156
wrjones104 merged 27 commits into
ff6wc:devfrom
wrjones104:whos-there

Conversation

@wrjones104

Copy link
Copy Markdown
Collaborator

Feature: Who's There?

Summary

Implements the -who flag, which replaces all boss sprites with the standard Imp sprite and replaces their display names with ??????.

Technical Implementation

  1. Name Obfuscation
  • nIterates through the bosses.enemy_name index mapping.
  • Replaces boss name strings in the ROM with ?????? (hex 0xBF).

2. Assembly Graphics Hook

  • Injects a custom 65816 assembly subroutine into Bank C0.
  • Patches the battle graphics loading routine at ROM offset 0x01207B (Bank C1).
  • Logic: The routine reads the 16-bit monster ID from WRAM $2001,X (indexed by slot) and compares it against a 384-byte boss_table in Bank F0. If a match is found, it forces the graphics pointer to the Imp index (#$0816).

3. VRAM/Tilemap Corruption Fix

  • Issue: Large or multi-part bosses (e.g., Tentacles, Whelk) use custom tilemap dimensions. Forcing the small Imp sprite into these large maps causes PPU read errors and VRAM corruption.
  • Solution: Within the .is_imp branch, the routine overwrites the active graphics index array ($812F,X) with 0 (Guard ID). This forces the dimension calculator (JSR $202F) to assign standard 32x32 properties, ensuring multi-part components render as individual, stable Imps.

Exceptions & Edge Cases

  • Included: SrBehemoth (ID 282) was manually added to the lookup table to ensure both phases are transformed. Final Kefka (ID 298) is also transformed.
  • Excluded: Final Battle Tiers (IDs 343–351) to preserve end-game aesthetics.
    Phantom Train (rendered as a background layer rather than a sprite object).

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the "Who's There?" feature, which visually transforms bosses into Imps and obfuscates their names to "??????". The changes span command-line argument configuration, documentation updates, and a custom assembly subroutine in data/enemies.py to hook the graphics loader. The review feedback highlights several critical issues in the assembly generation code, including an IndentationError from duplicated loop headers, potential CPU register corruption due to unpreserved Y register modifications, and multiple instances of duplicated code, imports, and ROM space allocations.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread data/enemies.py
Comment thread data/enemies.py
Comment thread data/enemies.py Outdated
Comment thread data/enemies.py Outdated
Comment thread data/enemies.py Outdated
Comment thread data/enemies.py
wrjones104 and others added 10 commits June 4, 2026 15:46
* Bump version to 1.4.4d

* STEVE!

* changes based on PR comments

* Fix graphics menu alignment and visual sprite loader hook Z flag propagation

* Fix Steveify flags menu display of None and support dynamic Arguments propagation

* Change default Steveify name override to all-caps STEVE
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
- Improved validation of `steveify` argument.
- Updated `Espers.get_name` to use internal data directly.
- Enhanced `Lores.mod` method for dynamic name modification based on regex.
… in `enemies.py`

- Added validation for character names length in `graphics.py`.
- Removed redundant code in `who_there_assembly` method of `enemies.py`.
- Simplified the boss table exclusion logic.
- Removed duplicate patching code for the graphics loader hook.
@wrjones104

Copy link
Copy Markdown
Collaborator Author

/gemini review

1 similar comment
@wrjones104

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces two new features: 'Who's There?' (--who-there), which obfuscates boss names and forces them to render as Imps, and 'Steveify' (--steveify), which replaces various in-game names with a custom string. It also updates documentation regarding assembly hooks and register preservation. However, several critical issues must be addressed: the custom assembly subroutine in data/enemies.py contains bugs that lead to register corruption and an overwritten return value, the graphics loader patch leaves garbage bytes that will cause a crash, and the --steveify command-line argument is missing from the parser in args/graphics.py.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread data/enemies.py
Comment thread data/enemies.py
Comment thread args/graphics.py

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the 'Who's There?' feature, which makes bosses look like Imps and obscures their names, and the 'Steveify' feature, which allows renaming various game elements to a custom string. However, several critical issues were identified during the review: the command-line argument for 'Steveify' is missing from the parser, which will cause an immediate startup crash; the custom assembly subroutine for 'Who's There?' contains register corruption, a truncation bug for 16-bit monster IDs, and a processor status register bug; and the graphics loader patch overwrites too many bytes, corrupting the instruction stream and using an incorrect branch offset.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread args/graphics.py
Comment thread data/enemies.py
Comment thread data/enemies.py
… in `enemies.py`

- Added validation for character names length in `graphics.py`.
- Removed redundant code in `who_there_assembly` method of `enemies.py`.
- Simplified the boss table exclusion logic.
- Removed duplicate patching code for the graphics loader hook.
@wrjones104

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the "Who's There?" (-who / --who-there) option, which obfuscates boss names to "??????" and dynamically renders them as Imps. This is achieved via a custom assembly subroutine in Bank C0 hooked into the graphics loader at ROM offset 0x01207B. The documentation in agents.md and llms.md has been updated to reflect assembly hook guidelines and implementation details. Feedback on the changes highlights a critical bug where the graphics loader patch only overwrites 9 bytes instead of 10, leaving a stray byte that corrupts the instruction stream; adding a fourth NOP is recommended. Additionally, a redundant block of code for parsing and validating character names in args/graphics.py should be removed.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread data/enemies.py
Comment thread args/graphics.py Outdated
wrjones104 and others added 3 commits June 23, 2026 13:57
- Removed redundant name processing logic from `graphics.py`.
- Added an additional NOP instruction in the enemy graphics loading sequence in `enemies.py`.
@wrjones104 wrjones104 merged commit 67e2bda into ff6wc:dev Jun 23, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant