I am looking for a pattern to implement a pause functionality, using CC65. My current pattern works some kind of random. Some times it pauses the game, sometimes not. In a simplified model, I implemented my pause functionality as follows:
Code: Select all
static unsigned char pause = 0; /* 0 = no pause, 1 = pause */
void input_routine(void){
...
if(input&PAD_START){
pause = (pause == 1) ? 0 : 1;
}
...
}
void main(void){
...
while(1){
input_routine();
if(!pause){
update_routine();
}
render_routine();
ppu_wait_nmi();
}
}
Regards
Sebastian