+Propane13 Posted June 18, 2012 Share Posted June 18, 2012 Maybe my synapses just aren't firing today. I can't seem to find the info on how to implement the Pause buttonin 7800 code when I search the forums and the 7800 programmer's guide-- but it's gotta be somewhere, so I must just be overlooking it.. Could someone point me in the right direction? Regards, -John Quote Link to comment Share on other sites More sharing options...
GroovyBee Posted June 18, 2012 Share Posted June 18, 2012 It on port SWCHB data bit three. When you press the console's PAUSE switch the data bit goes low. If that happens put your game into pause mode. If the player presses PAUSE again then go back to game mode. You might need a bit of switch debouncing too. Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted June 18, 2012 Share Posted June 18, 2012 AFAIK it's the same as reading the color/B&W switch for 2600 programming...bit 3 of SWCHB (address $0282). What you need to do is use an additional ram bit of storage to hold a current game state (i.e. paused or not paused) as well as a bit to hold a copy of what the switch state was on the previous frame...and only flip the former when the latter changes from %1000 to %0000 (i.e. the switch is initially being pressed). Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted June 18, 2012 Share Posted June 18, 2012 An example here. To keep things simple, I stored SWCHB to a full byte...but you can probably notice how to trim that down to a single bit. lda SWCHB ;get new switches tax ;save for later eor old_copy ;compare with old and #$08 ;keep only pause switch beq QUIT ;branch if no change and old_copy ;was it on (and now off)? beq QUIT ;branch if not lda game_state eor #PAUSE_FLAG ;flip pause status sta game_state ;and update game state QUIT stx old_copy ;save current switches Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.