Hi,
I'd like to implement a check for the pause key (F1) within my game.
The problem is that I am not sure where to put it ...
My first thought was to implement it in the interrupt management routine :
[1] Check for a strike on F1 (Yes : goto [2], No : goto [3])
[2] Disable interrupts, loop to wait for a second strike to get out of pause, enable interrupts
[3] Rest of the interrupt management routine ...
But if I do it that way, when the 2nd strike on pause releases the interrupts and jump to the main interrupt management, I am completely out of sync with VBLANK, which means that I can be interrupted by VBLANK within the interrupt management routine ... Which is a mess.
The other solution I thought of is to implement the check for F1 within a global wait routine which I uses quite frequently during the game in order to slow down the CPU to sync with the player actions. But I am well aware that although I need frequently this wait routine at this stage of development, it will probably vanishes progressively as I increase the CPU load ...
Any remarks ?
Is there another solution ?
Thanks.
PS : I need the pause check not for the sake of it, but rather to implement a developer menu which will allow me to navigate thru the game, change levels as I want and view VRAM pages
