Fix imp sprite issues#164
Conversation
…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`.
There was a problem hiding this comment.
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.
| asm.LDA(0x0000, asm.IMM16), | ||
| asm.STA(0x812F, asm.ABS_X), |
There was a problem hiding this comment.
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.
| asm.LDA(0x0000, asm.IMM16), | |
| asm.STA(0x812F, asm.ABS_X), | |
| asm.STZ(0x812F, asm.ABS_X), |
PHPandPLPin custom check subroutine.PHP.