temporary strings are now freed when needed

This commit is contained in:
FeralChild64 committed 2020-07-19 09:46:04 +02:00
1 parent 09f85cea8a
commit 92359c64f2
14 files changed
+36 -15

No files matched your search

+2 -1
View File
@@ -29,8 +29,9 @@ cmd_print_loop:
cmd_print_after_comma:
// Now evaluate the expression
// Now evaluate the expression and check what to print
jsr tmpstr_free_all
jsr FRMEVL
lda VALTYP
bpl cmd_print_float
+1
View File
@@ -25,6 +25,7 @@
.label JREADST = KERNAL_0.JREADST
.label plot_set = KERNAL_0.plot_set
.label init_oldtxt = BASIC_0.init_oldtxt
.label tmpstr_free_all_reset = BASIC_0.tmpstr_free_all_reset
.label rom_revision_basic_string = BASIC_0.rom_revision_basic_string
.label print_hex_byte = BASIC_0.proxy_B1_print_hex_byte
.label print_integer = BASIC_0.proxy_B1_print_integer
@@ -71,10 +71,7 @@ do_clr:
// This is a good place to reset the temporary string stack
lda #$19
sta TEMPPT
lda #$16
sta LASTPT
jsr tmpstr_free_all_reset
// FALLTROUGH (confirmed on real C64 that CLR indeed resets DATPTR)
+1 -1
View File
@@ -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
+23 -3
View File
@@ -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
+4 -2
View File
@@ -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