I'm once again trying to make the DKC(R) sprite status bar appear when the game is paused. Last time I tried I failed, and I'm still not making huge progress, because drawing sprite tiles in a paused game is unexpectedly tricky.
Here's what I currently have, excluding unnecessary parts:
So the first thing I did was hijack code that runs when the game is paused and run my status bar routines in there. That promptly crashed the game (I assume this is because I'm drawing sprite tiles). When I add the call to $7F8000, the game no longer crashes, but then removes tiles or draws garbled ones, which I also don't want.
It makes sense that you can't call $7F8000 when paused, because all the other sprite tiles won't be redrawn. But why does not calling it, then drawing sprite tiles, crash the game? That's kind of my first question. All the does is erase all on-screen sprite tiles, after all.
My second question is more important, but also more vague: what's up with pausing and the OAM? For example, why does my current code also draw a handful of garbled tiles at random positions? Is there some other routine you're supposed to be calling?
I can delve into p4's code for SMWCP2's status bar which pulled it off, but I was hoping someone already familiar with this whole thing could point me in the right direction before I reinvent the wheel.
Here's what I currently have, excluding unnecessary parts:
Code
org $00A25B ; runs when the game is paused autoclean JML Paused freecode Paused: JSL $7F8000 JSR StatusBarMain_handleLivesCounter ; this draws sprite tiles ; (restore hijacked code and return)
So the first thing I did was hijack code that runs when the game is paused and run my status bar routines in there. That promptly crashed the game (I assume this is because I'm drawing sprite tiles). When I add the call to $7F8000, the game no longer crashes, but then removes tiles or draws garbled ones, which I also don't want.
It makes sense that you can't call $7F8000 when paused, because all the other sprite tiles won't be redrawn. But why does not calling it, then drawing sprite tiles, crash the game? That's kind of my first question. All the does is erase all on-screen sprite tiles, after all.
My second question is more important, but also more vague: what's up with pausing and the OAM? For example, why does my current code also draw a handful of garbled tiles at random positions? Is there some other routine you're supposed to be calling?
I can delve into p4's code for SMWCP2's status bar which pulled it off, but I was hoping someone already familiar with this whole thing could point me in the right direction before I reinvent the wheel.