Skip to content

Conversation

@parasyte
Copy link
Contributor

This took a long time to track down. I'm not entirely certain what the real solution should be, but this seems to fix it.

These screenshots show the problem. The disassembly prematurely ends at an LD instruction:

Screenshot 2024-12-23 at 8 51 53 PM Screenshot 2024-12-23 at 8 55 26 PM

I found the problem was that None was being returned as the first Cursor for this specific instruction pattern.

While tracking this down, I also noticed a bizarre use of RefCell that isn't needed. So I removed that in a second commit.

This doesn't do anything at all. It just makes the code harder to understand.
@Rodrigodd
Copy link
Owner

Thanks! I believe that is the correct solution.

The code is trying to detect if a bank switch happens at that instruction, but the value is unknown so is uncertain if that will happen or not. But other parts of the code already makes the assumption that a program will very unlikely change the bank under itself, so this fix is fine.

@Rodrigodd Rodrigodd merged commit 35c2798 into Rodrigodd:master Dec 24, 2024
3 of 4 checks passed
@parasyte parasyte deleted the fix/disassembler-tracing-ld branch December 24, 2024 23:59
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.

2 participants