pjumps

by snydej

Game:

Description: Momentary pswitch while jumping

!game_mode = $7e0100
!buttons1 = $7e0016
!buttons2 = $7e0018
!ground_stand = $7e13ef
!sprite_stand = $7e1471
!pswitch_timer = $7e14ad


	lda !game_mode
	cmp #$14
	bne end
	
	lda !pswitch_timer
	cmp #$1
	bne +
	dec
	sta !pswitch_timer
	
+	lda !carl_initialized
	beq jump_listen
	
	dec
	sta !carl_initialized
	bne end

; Trigger pswitch
	lda #$7
	sta !pswitch_timer

jump_listen:	
;Test if the player is on the ground.
	lda !ground_stand
	ora !sprite_stand
	beq end

;a jump test
	lda !buttons2
	bit #$80
	bne +

;b jump test
	lda !buttons1
	bit #$80
	beq end
	
; jumped
+	lda #$1
	sta !carl_initialized

end:
	lda #$00
	rtl
back to listings