Skip to content

Conversation

@wendelscardua
Copy link
Contributor

Fixes #405

Saves original bank to the hardware stack instead of using the y register

pha
tya
jsr set_prg_bank
pha
Copy link
Member

Choose a reason for hiding this comment

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

This adds two pha but only a single pla, which definitely seems wrong.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, I wrote the code one way but then moved stuff around and forgot to remove the old pha 😅

Fixed it now

(y register can be modified by the called function)
@mysterymath mysterymath merged commit 123c542 into llvm-mos:main Aug 12, 2025
@wendelscardua wendelscardua deleted the fix-405-banked-call-bug branch August 13, 2025 03:24
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.

Potential bug in nes-unrom's banked_call()

2 participants