BUTTONS .rs 1 ; currently pressed buttons BUTTONS_TMP .rs 1 ; temporary variable for buttons BUTTONS_HOLD_TIME .rs 1 ; up/down/left/right buttons hold time KONAMI_CODE_STATE .rs 1 ; Konami Code state .if GAMES_COUNT >= 11 MAXIMUM_SCROLL .equ GAMES_COUNT - 11 .else MAXIMUM_SCROLL .equ 0 .endif ; controller reading, two times read_controller: pha tya pha txa pha jsr .real ; first read ldx > 8) & $FF sta > 8) & $FF bne .button_down_not_ovf lda > 8) & $FF bne .button_right_bleep jmp .button_end .button_right_bleep: .if ENABLE_SOUND!=0 jsr bleep .endif lda > 8) & $FF bcs .button_right_ovf .button_right_not_ovf: jmp .button_right2 .button_right_ovf: lda #MAXIMUM_SCROLL & $FF sta > 8) & $FF sta > 8) & $FF bcs .button_right_ovf2 .button_right_not_ovf2: jsr check_separator_up jmp .button_end .button_right_ovf2: lda #GAMES_COUNT & $FF sec sbc #1 sta > 8) & $FF sbc #0 sta > 8) & $FF bne check_separator_down lda > 8) & $FF sta