Skip to content

Fix imp sprite issues#164

Merged
wrjones104 merged 1 commit into
ff6wc:devfrom
wrjones104:fix-whos-there
Jun 23, 2026
Merged

Fix imp sprite issues#164
wrjones104 merged 1 commit into
ff6wc:devfrom
wrjones104:fix-whos-there

Conversation

@wrjones104

Copy link
Copy Markdown
Collaborator
  • Clarify exception handling for subroutines used as conditional hooks.
  • Remove redundant PHP and PLP in custom check subroutine.
  • Ensure consistent accumulator size setup after entry or PHP.

…onal hooks

- Clarify exception handling for subroutines used as conditional hooks.
- Remove redundant `PHP` and `PLP` in custom check subroutine.
- Ensure consistent accumulator size setup after entry or `PHP`.

@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 refactors the 'Who's There?' graphics loader hook and its custom assembly subroutine in data/enemies.py to avoid using PHP and PLP, ensuring comparison status flags are correctly returned to the caller. Corresponding documentation in agents.md and llms.md has been updated to reflect this change. Feedback is provided to optimize the assembly code in data/enemies.py by using the STZ instruction instead of loading and storing zero, which saves ROM space and avoids modifying the accumulator.

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 on lines 505 to 506
asm.LDA(0x0000, asm.IMM16),
asm.STA(0x812F, asm.ABS_X),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

In 16-bit accumulator mode (A16), you can use the STZ (Store Zero) instruction directly instead of loading 0x0000 into the accumulator and then storing it. This is more efficient, saving 3 bytes of ROM space and avoiding modifying the accumulator register.

Suggested change
asm.LDA(0x0000, asm.IMM16),
asm.STA(0x812F, asm.ABS_X),
asm.STZ(0x812F, asm.ABS_X),

@wrjones104 wrjones104 merged commit 34abad1 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