9Panzer
Well-known member
So the Pause script eluded me for quite some time. I'm in my 10th month of game development with nesmakers and have solved (with the help of the community) most of my challenges. This one I had basically given up on as I just couldn't get anything to work. Fortunately @SpiderDave gave me a code he used in a previous version that I managed to pull apart and make work perfectly in 4.5.6. I spruced it up a little using @Mugi code to soften the screen palette when it is triggered as well. I wasn't able to get an SFX to work with it though.
This should just be a quick copy and paste for usage in an input script (Most likely start) Hopefully someone else can find this useful!
Make sure to create a User Variable called "pause_game"
Also, The input should be set to RELEASE rather then push. For whatever reason it doesn't like push.
This should just be a quick copy and paste for usage in an input script (Most likely start) Hopefully someone else can find this useful!
Make sure to create a User Variable called "pause_game"
Also, The input should be set to RELEASE rather then push. For whatever reason it doesn't like push.
doPause:
INC pause_game
LDA pause_game
CMP #$02
BNE +IsNotPaused
LDA #$00
STA pause_game
LDA soft2001
AND #%00011111
STA soft2001
RTS
+IsNotPaused
LDA pause_game
CMP #$01
BNE +IsPaused
-
LDA soft2001
ORA #%11100000
STA soft2001
JSR GamePadCheck
LDA gamepad
AND #%00001000
BEQ -
LDA #$01
STA pause_game
+IsPaused
RTS
Last edited: