From 28f6a96ff30ecdc46584e8dae4aeba776d94ddf6 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Thu, 23 Jul 2020 19:43:28 +0200 Subject: [PATCH] more work towards array creating --- src/basic/engine_variables/array_create.s | 40 +++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/basic/engine_variables/array_create.s b/src/basic/engine_variables/array_create.s index 14d4a750..811de49a 100644 --- a/src/basic/engine_variables/array_create.s +++ b/src/basic/engine_variables/array_create.s @@ -16,6 +16,46 @@ array_create: jsr varstr_garbage_collect + // Now, create the array structure + + lda STREND+0 + sta INDEX+0 + lda STREND+1 + sta INDEX+1 + + // XXX check if there is enough distance between INDEX and FRETOP + + // Store: + // - the array name (2 bytes) + // - offset to the next array (2 bytes) - 0 to mark the last one + // - initial array dimension - 0 + +#if CONFIG_MEMORY_MODEL_60K + + // XXX: implement this + +#else // CONFIG_MEMORY_MODEL_38K || CONFIG_MEMORY_MODEL_46K || CONFIG_MEMORY_MODEL_50K + + ldy #$00 + lda VARNAM+0 + sta (STREND), y + iny + lda VARNAM+1 + sta (STREND), y + iny + lda #$00 + sta (STREND),y + iny + sta (STREND),y + iny + sta (STREND),y + +#endif + + // + + + // XXX bit DIMFLG, bmi = use default params