Closed blazer82 closed 2 years ago
Hi, thanks for the feedback. My initial guess would be that's a bug in the PPU. While the CPU/ Timer/ PSG are well tested, the PPU isn't. But the fact that the PPU stays in IDLE tends to suggest that the PPU is turned off for some reason. Just by looking at the PPU logic, it would exit IDLE when vblank comes and the LCD is enabled. HV timing counter is always running regardless of the other states or registers, so the Vblank would always come. That means the LCD is disabled. So the next step would be:
@zephray thanks for the very fast reply! π
That means the LCD is disabled
From looking at the code, that's my current best guess, too. I'll try to verify that and if successful try to answer the to follow-up questions you mentioned.
Very helpful, thank you! I'll update this thread with any findings.
- Verify if LCD is really disabled or not.
I confirmed that the LCDC goes to 0x00
, so the LCD really is disabled at that point.
I found this reddit post that seems to suggest that
the LCD enters Mode 0
when disabled which would provide an answer to
- If it should be disabled, should STAT register indicate the LCD is in VBlank or not?
while most likely also resolving the issue.
I'll be back with updates...
Fixed it! I'll create a pull request.
As you know, I use your VerilogBoy with real cartridges instead of ROM images and I ran into an issue with Super Mario Land that I'm not sure where it's originating.
Issue
When Super Mario Land is supposed to enter the bonus game (triggered by exiting through the upper door in level 1 and 2 or by finishing level 3), the execution of the game hangs.
So far I have determined that:
0x97
and0x9C
which is basically the following loop:0xFF41
keeps a constant value of0x41
and the PPU state stays ons_IDLE
forever.Steps to reproduce
Exit level 1 or 2 through the upper door or finish level 3.
Further considerations
I'm not sure yet whether this is a general issue with VerilogBoy or whether this only arises when using real cartridges. It may be helpful to know if you can reproduce this behavior at all.
I'll keep looking for the root cause but any suggestions on what might be the issue are very welcome π