For an arcade style game, the 6502 works out nicely. One fo the fastest arcade games in thew world that I know of called Tempest uses a 1 MHz 6502 inside. Almost all Atari games up until Gauntlet used the 6502.
One way of thinking which I use in my arcade design is what Apple calls an event loop. Here it is quite simplified for conceptual. I am using it right now for programming a pinball machine (yup, am STILL on that project, gang)
SETUP
Init variables
LOOP
Get inputs (read the ports)
Process inputs (into memory variables)
Logical processing (game and output rules)
Push outputs (screen, sound, etc)
Goto LOOP
(Personal aside here)
On the pinball loop, it runs either 30 or 60 times a second, I forget which offhand. I actually do the get inputs and outputs simultaneously on the pinball because it requires strobing a matrix like mad, so the loop is more like:
LOOP
Matrix = 1
Get Inputs
Push Outputs
Increment Matrix
Matrix = 2
Get Inputs
Push Outputs
Increment Matrix
and so on up to 7. The reason I dont use a logical is because of the unique switches and lights at each matrix point So on the simplifiy, it is:
Loop
Inputs/Outputs
Game Logic
Goto Loop
So far, it is looking good. The matrix loop is ocmpeltely written and the display part seems to work fantastic. I had written up a nice attract mode display show animation set which works like a champ in realtime.
Had just compeltely rewrote thhe display routine from the ground up. I had wanted to add flashing capability at any speed, but it was proving to be kludgy so it got a rewrite. It is inline code like everything in this program, so it gets called to init and show on the display, and it counts down the length of time the message or animation shows, and uses a XOR setup to strobe the display off and on at a set speed. In fact, for whatever it is worth. NOTE: This part of the routine isnt tested as of yet. I still have to redo the animation tables in order to test it out...
if it helps anyone with ideas, party on
; And now, the message center for displaying messages on the score display.
; The main flag to be checked is the MessageCenterStatusFlag
; 00 = do nothing, skip routine
; 01 = load in message with the InitMessageDisplay routine
; 02 = message status running. This is on while you are displaying the desired message
; 03 = End the message (instantly, as an over-ride)
; the display will clear depending on the MessageClearAtEnd flag.
; 00 = do not clear display
; 01 or more, clear display
; as a rule, this flag should hang out at 00 all the time except when showing a message or animation.
MessageCenter
LDA MessageCenterStatusFlag
BEQ MessageCenterSkip ; Just skip the entire message center if it is 00.
CMP #$01 ; Check to see if I need to init and load a message
BEQ MessageCenterInit
CMP #$02 ; Is the message current and showing?
BEQ MessageCenterShowJump
CMP #$03 ; EndMessageDisplay?
BEQ MessageCenterEndJump
MessageCenterSkip
JMP MainSwitchBoard
MessageCenterShowJump
JMP MessageCenterShow
MessageCenterEndJump
JMP MessageCenterEnd
; This is the InitMessageDisplay. Get things all set up.
MessageCenterInit
LDA MessageCenter1
STA Display1
EOR #$FF
STA Display1Mask
LDA MessageCenter2
STA Display2
EOR #$ff
STA Display2Mask
LDA MessageCenter3
STA Display3
EOR #$ff
STA Display3Mask
LDA MessageCenter4
STA Display4
EOR #$ff
STA Display4Mask
LDA MessageCenter5
STA Display5
EOR #$ff
STA Display5Mask
LDA MessageCenter6
STA Display6
EOR #$ff
STA Display6Mask
LDA #$02
STA MessageCenterStatusFlag
JMP MainSwitchBoard
; This is the show routine which is called 60 times a second.
MessageCenterShow
LDA MessageCenterTimerFlag ; Main countdown. At 0, it jumps to end of routine.
CMP #$00
BEQ MessageCenterEnd
DEC MessageCenterTimerFlag
LDA MessageCenterFlickerRateFlagTemp ; count down the flicker rate to flash the display
CMP #$00
BEQ MessageCenterShowToggle
DEC MessageCenterFlickerRateFlagTemp
JMP MainSwitchBoard
MessageCenterShowToggle
LDA Display1 ; This clever routine uses the mask to change what is inside of it.
EOR #$ff
AND Display1Mask
STA Display1
LDA Display2
EOR #$ff
AND Display2Mask
STA Display2
LDA Display3
EOR #$ff
AND Display3Mask
STA Display3
LDA Display4
EOR #$ff
AND Display4Mask
STA Display4
LDA Display5
EOR #$ff
AND Display5Mask
STA Display5
LDA Display6
EOR #$ff
AND Display6Mask
STA Display6
LDA MessageCenterFlickerRateFlag ; Restore flicker rate
STA MessageCenterFlickerRateFlagTemp
JMP MainSwitchBoard
; Here are the end clearing routines.
MessageCenterEnd
LDA MessageClearAtEnd ; 0 is dont clear, 1 or more, clear display
BEQ MessageCenterEndNoClearDisplay
LDA #$00 ; this clears out the main display
STA Display1
STA Display2
STA Display3
STA Display4
STA Display5
STA Display6
MessageCenterEndNoClearDisplay
LDA #$00
STA MessageCenterStatusFlag
STA MessageCenterTimerFlag
STA MessageCenter1
STA MessageCenter2
STA MessageCenter3
STA MessageCenter4
STA MessageCenter5
STA MessageCenter6
STA Display1Mask
STA Display2Mask
STA Display3Mask
STA Display4Mask
STA Display5Mask
STA Display6Mask