Last active
March 9, 2017 21:59
-
-
Save gnacu/52ba7861ccb00fd814437f9c0993d019 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
headrow lda #0 | |
sta (tptr),y ;Terminate string | |
#incptr tptr ;Points to length | |
lda children ;Backup current | |
pha ;child count | |
lda (tptr),y ;Load child count | |
sec | |
sbc #$40 ;Shift a,x to 1,24 | |
sta children ;sub-child count | |
#writeptr tptr,ptr,codeptr | |
ldy #titleptr | |
lda (ptr),y | |
tax | |
iny | |
lda (ptr),y | |
tay | |
jsr strlen ;Get title length | |
iny | |
iny ;plus 2 for " >" | |
tya | |
ldy #0 | |
sta (tptr),y ;Set mnu row width | |
#incptr tptr | |
lda #0 ;Set .A closed | |
sta (tptr),y ;Save menu state | |
#incptr tptr ;Points to nxt row | |
#saveptr lptr | |
#saveptr child | |
#saveptr ptr | |
lda #0 | |
sta lptr | |
sta lptr+1 | |
jsr alloc ;Recurse!! | |
#fetchptr ptr | |
#writeptr child,ptr,childptr | |
#fetchptr child | |
#fetchptr lptr | |
pla | |
sta children | |
jmp nextnode |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment