Skip to content

Instantly share code, notes, and snippets.

@gnacu
Last active March 9, 2017 21:59
Show Gist options
  • Save gnacu/292c9c3c39100e67008874558d72a3c0 to your computer and use it in GitHub Desktop.
Save gnacu/292c9c3c39100e67008874558d72a3c0 to your computer and use it in GitHub Desktop.
;See Modifier Keys bit flags to under-
;stand these numbers. eg, " *^Q"
modlen .byte 0 ;Extra length for mods
modlens .byte 0,3,3,4,3,4,4,5
actrow lda #0
sta (ptr),y ;Terminate String
#incptr tptr ;Points to modkeys
#writeptr tptr,ptr,codeptr
lda (tptr),y
pha ;Backup modkeys
tax
lda modlens,x
sta modlen ;Space for modkeys
ldy #titleptr
lda (ptr),y
tax
iny
lda (ptr),y
tay
jsr strlen ;Get title length
tya
clc
adc modlen ;Space for modkeys
ldy #0
sta (tptr),y ;Set mnu row width
#incptr tptr ;Points to petval
#incptr tptr ;Points to actcode
#incptr tptr ;Points to modkeys
pla ;Restore modkeys
sta (tptr),y
#incptr tptr ;Points to nxt row
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment