Skip to content

Instantly share code, notes, and snippets.

@gnacu
Created April 17, 2024 21:20
Show Gist options
  • Save gnacu/8f1a77929ca82d595d6d33251c0b1e16 to your computer and use it in GitHub Desktop.
Save gnacu/8f1a77929ca82d595d6d33251c0b1e16 to your computer and use it in GitHub Desktop.
menuenq ;X -> Menu Command Code
.block
txa
#switch 2
.text "wf"
.rta a_wrapchk,a_footchk
;Current Tab
cmp #"4"
bcs done ;>"3"
cmp #"1"
bcc done ;<"1"
;C <- Set
sbc #"1" ;"1" -> 0... "3" -> 2
cmp seltab
bne done
lda #mnu_sel ;Enabled, Selected
rts
done lda #0 ;enabled, not selected
rts
a_wrapchk
#storeget tstviews,8
bne chkptr
a_footchk
#storeget tstviews,9
chkptr #stxy ptr
ldy #cflags
lda (ptr),y
and #cf_state
beq done
lda #mnu_sel ;Enabled, Selected
rts
.bend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment