Last active
March 9, 2017 22:00
-
-
Save gnacu/c9844b0db2987c2cbe89a3ab99b8ff8c 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
rootpg .byte 0 | |
defpage .byte 0 | |
defpgcnt .byte 0 | |
;.x .y pointer to filename string. | |
mnuload ;Frees old memory. Allocs mem. | |
;Loads menu file and parses it. | |
.block | |
lda rootpg | |
beq load ;Nothing to free | |
tya ;Backup filename ptr | |
pha | |
txa | |
pha | |
;Free definitions memory | |
lda defpage | |
ldy defpgcnt | |
jsr pgfree | |
;Free structured memory | |
lda rootpg | |
sta ptr+1 ;Set hi ptr byte | |
lda #0 | |
sta ptr ;Set lo ptr byte | |
jsr freemenu ;Call recursively | |
pla ;Restore filename ptr | |
tax | |
pla | |
tay | |
jmp load |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment