temporary strings are now freed when needed
This commit is contained in:
1 parent
09f85cea8a
commit
92359c64f2
14 files changed
+36
-15
No files matched your search
@@ -67,7 +67,7 @@ tmpstr_free_loop:
|
||||
|
||||
sty DSCPNT+0
|
||||
phx_trash_a
|
||||
jsr varstr_free
|
||||
jsr varstr_free_non_0
|
||||
plx_trash_a
|
||||
|
||||
// Mark empty string as free and quit
|
||||
|
||||
@@ -9,12 +9,32 @@ tmpstr_free_all:
|
||||
|
||||
ldx #$19
|
||||
|
||||
// XXX implement this
|
||||
|
||||
//FALLTROUGH
|
||||
|
||||
tmpstr_free_all_loop:
|
||||
|
||||
// XXX finish, deduplicate part with CLR
|
||||
// Free all the strings, one by one
|
||||
|
||||
cpx TEMPPT
|
||||
beq tmpstr_free_all_reset
|
||||
|
||||
lda $00, x
|
||||
beq !+
|
||||
|
||||
phx_trash_a
|
||||
jsr varstr_free_non_0
|
||||
plx_trash_a
|
||||
!:
|
||||
inx
|
||||
bne tmpstr_free_all_loop // branch always
|
||||
|
||||
tmpstr_free_all_reset: // entry point for CLR
|
||||
|
||||
// RESET TEMPPT and LASTPT to default values
|
||||
|
||||
lda #$19
|
||||
sta TEMPPT
|
||||
lda #$16
|
||||
sta LASTPT
|
||||
|
||||
rts
|
||||
@@ -16,9 +16,11 @@ varstr_free:
|
||||
// Check the string size - do not do anything if 0
|
||||
|
||||
lda DSCPNT+0
|
||||
bne !+
|
||||
bne varstr_free_non_0
|
||||
rts
|
||||
!:
|
||||
|
||||
varstr_free_non_0: // entry point to be used when it is clear that string is not empty
|
||||
|
||||
// Check if string is above FRETOP (in string area)
|
||||
// XXX move this check out of the routine
|
||||
|
||||
|
||||
Reference in new issue
Block a user