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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -36,9 +36,9 @@
|
|||||||
|
|
||||||
// Memory model
|
// Memory model
|
||||||
|
|
||||||
// #define CONFIG_MEMORY_MODEL_38K
|
#define CONFIG_MEMORY_MODEL_38K
|
||||||
// #define CONFIG_MEMORY_MODEL_46K
|
// #define CONFIG_MEMORY_MODEL_46K
|
||||||
#define CONFIG_MEMORY_MODEL_50K
|
// #define CONFIG_MEMORY_MODEL_50K
|
||||||
// #define CONFIG_MEMORY_MODEL_60K
|
// #define CONFIG_MEMORY_MODEL_60K
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -36,9 +36,9 @@
|
|||||||
|
|
||||||
// Memory model
|
// Memory model
|
||||||
|
|
||||||
// #define CONFIG_MEMORY_MODEL_38K
|
#define CONFIG_MEMORY_MODEL_38K
|
||||||
// #define CONFIG_MEMORY_MODEL_46K
|
// #define CONFIG_MEMORY_MODEL_46K
|
||||||
#define CONFIG_MEMORY_MODEL_50K
|
// #define CONFIG_MEMORY_MODEL_50K
|
||||||
// #define CONFIG_MEMORY_MODEL_60K
|
// #define CONFIG_MEMORY_MODEL_60K
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -29,8 +29,9 @@ cmd_print_loop:
|
|||||||
|
|
||||||
cmd_print_after_comma:
|
cmd_print_after_comma:
|
||||||
|
|
||||||
// Now evaluate the expression
|
// Now evaluate the expression and check what to print
|
||||||
|
|
||||||
|
jsr tmpstr_free_all
|
||||||
jsr FRMEVL
|
jsr FRMEVL
|
||||||
lda VALTYP
|
lda VALTYP
|
||||||
bpl cmd_print_float
|
bpl cmd_print_float
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
.label JREADST = KERNAL_0.JREADST
|
.label JREADST = KERNAL_0.JREADST
|
||||||
.label plot_set = KERNAL_0.plot_set
|
.label plot_set = KERNAL_0.plot_set
|
||||||
.label init_oldtxt = BASIC_0.init_oldtxt
|
.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 rom_revision_basic_string = BASIC_0.rom_revision_basic_string
|
||||||
.label print_hex_byte = BASIC_0.proxy_B1_print_hex_byte
|
.label print_hex_byte = BASIC_0.proxy_B1_print_hex_byte
|
||||||
.label print_integer = BASIC_0.proxy_B1_print_integer
|
.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
|
// This is a good place to reset the temporary string stack
|
||||||
|
|
||||||
lda #$19
|
jsr tmpstr_free_all_reset
|
||||||
sta TEMPPT
|
|
||||||
lda #$16
|
|
||||||
sta LASTPT
|
|
||||||
|
|
||||||
// FALLTROUGH (confirmed on real C64 that CLR indeed resets DATPTR)
|
// FALLTROUGH (confirmed on real C64 that CLR indeed resets DATPTR)
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ tmpstr_free_loop:
|
|||||||
|
|
||||||
sty DSCPNT+0
|
sty DSCPNT+0
|
||||||
phx_trash_a
|
phx_trash_a
|
||||||
jsr varstr_free
|
jsr varstr_free_non_0
|
||||||
plx_trash_a
|
plx_trash_a
|
||||||
|
|
||||||
// Mark empty string as free and quit
|
// Mark empty string as free and quit
|
||||||
|
|||||||
@@ -9,12 +9,32 @@ tmpstr_free_all:
|
|||||||
|
|
||||||
ldx #$19
|
ldx #$19
|
||||||
|
|
||||||
// XXX implement this
|
|
||||||
|
|
||||||
//FALLTROUGH
|
//FALLTROUGH
|
||||||
|
|
||||||
tmpstr_free_all_loop:
|
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
|
rts
|
||||||
@@ -16,9 +16,11 @@ varstr_free:
|
|||||||
// Check the string size - do not do anything if 0
|
// Check the string size - do not do anything if 0
|
||||||
|
|
||||||
lda DSCPNT+0
|
lda DSCPNT+0
|
||||||
bne !+
|
bne varstr_free_non_0
|
||||||
rts
|
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)
|
// Check if string is above FRETOP (in string area)
|
||||||
// XXX move this check out of the routine
|
// XXX move this check out of the routine
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user