I'm thinking this question could probably be applied to anywhere but I'm posting it here because this is what I'm doing with it.
I'm having trouble understating the basic layout of entire game logic. Ultimately, I'm trying to incorporate a jump table (as many games do) for the "game mode" of a demo I made to test metasprites but I can't figure out the placing of it. Such as, 00 being the title screen, 01 being phase 1, 02 being regular gameplay etc. The problem I'm having with it is understanding the whole structure of it. The way I have my code set up it initializes the NES and then kick starts to showing the sprite on screen. After searching around and reading a little it seems as if a lot of people suggest "don't do logic in NMI" albeit I'm learning from SMB1's source and if I traced it right it runs game mode routine smack dab in the middle of NMI time.
Also, question number 2 is a lot of places teach the "infinite jump at the end of the main routine" technique. However, I found the need to do this within my main:
Is this good practice or not?
tl;dr: Can someone make me a basic outline of how a simple game with a title screen and game over screen is structured?
I'm having trouble understating the basic layout of entire game logic. Ultimately, I'm trying to incorporate a jump table (as many games do) for the "game mode" of a demo I made to test metasprites but I can't figure out the placing of it. Such as, 00 being the title screen, 01 being phase 1, 02 being regular gameplay etc. The problem I'm having with it is understanding the whole structure of it. The way I have my code set up it initializes the NES and then kick starts to showing the sprite on screen. After searching around and reading a little it seems as if a lot of people suggest "don't do logic in NMI" albeit I'm learning from SMB1's source and if I traced it right it runs game mode routine smack dab in the middle of NMI time.
Also, question number 2 is a lot of places teach the "infinite jump at the end of the main routine" technique. However, I found the need to do this within my main:
Code:
GameLoop:
LDX #$04 ;wait 4 vblanks
.c
BIT $2002
BPL .c
DEX
BNE .c
INC GameTimer
;do other stuff
JMP GameLoop
LDX #$04 ;wait 4 vblanks
.c
BIT $2002
BPL .c
DEX
BNE .c
INC GameTimer
;do other stuff
JMP GameLoop
Is this good practice or not?
tl;dr: Can someone make me a basic outline of how a simple game with a title screen and game over screen is structured?