From 6c930e8367394194572770a55cd6b4b0ae223cba Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Fri, 17 Jul 2020 18:37:22 +0200 Subject: [PATCH] fixed bug in string free preserving size in wrong place --- src/basic/engine/varstr_free.s | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/basic/engine/varstr_free.s b/src/basic/engine/varstr_free.s index e9a30778..6eef2046 100644 --- a/src/basic/engine/varstr_free.s +++ b/src/basic/engine/varstr_free.s @@ -59,18 +59,9 @@ varstr_free_inside: // This is not the lowest string; mark it as free // First preserve the string size, it will make it easier for the garbage collector - lda DSCPNT+0 - tay - dey + // Increase DSCPNT+1/+2 to point to the back-pointer minus 1 -#if CONFIG_MEMORY_MODEL_60K - ldx # $01 + // Now fill-in the back-pointer with 0's + + tya + iny + +#if CONFIG_MEMORY_MODEL_60K + jsr poke_under_roms +#else // CONFIG_MEMORY_MODEL_38K || CONFIG_MEMORY_MODEL_46K || CONFIG_MEMORY_MODEL_50K + sta (DSCPNT+1), y +#endif + + iny #if CONFIG_MEMORY_MODEL_60K jmp poke_under_roms