diff --git a/README.md b/README.md index ed96c5b8..2472cd42 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,13 @@ A project to create unencumbered open-source ROMs for use on selected retro comp * [implementation status](./STATUS.md) of various APIs and functionalities * [configuration options](./CONFIG.md) for those willing to compile their own, customized ROM set -* [BASIC extensions](doc/Extended-BASIC.md) +* [BASIC extensions](./doc/Extended-BASIC.md) * [development guide](./doc/Development.md) for those interested in technical aspects * [license](./LICENSE) information and list of major contributors * [credits](./CREDITS.md) to people whose work was of great help to us +To download pre-built ROM images, go [here](./bin). + # Problem Statement and Motivation The copyrights of various old computer system ROMs are still alive, and together with trademarks, can present significant diff --git a/STATUS.md b/STATUS.md index 276414db..66547f2a 100644 --- a/STATUS.md +++ b/STATUS.md @@ -11,6 +11,12 @@ Here are the features of the Open ROMs not found in the original ROMs from the 8 * JiffyDOS and DolphinDOS protocols support * DOS wedge (direct mode only) - `@`, `@`, `@$`, `@$`, `@` * BASIC extensions, see the [documentation](doc/Extended-BASIC.md) +* extended / tweaked `LOAD` / `VERIFY` commands + * start/end addresses are displayed, in the Final cartridge style + * command with just the file name tries to use the last device if it's number seems sane; otherwise uses 8 + * command without parameters tries to load first file from drive chosen as above +* `LIST` command should never damage the screen if trying to list memory content which is not a BASIC program +* high performance garbage collector * turbo tape load support (as device 7, or using `←L` / `←M`, optionally with a file name), quite sophisticated: up to 250 blocks (can store bytes under I/O), automatically adjusts for tape speed differences * normal tape load error log is limited by free stack space only (no artificial limitation like in original ROMs) @@ -18,12 +24,6 @@ Here are the features of the Open ROMs not found in the original ROMs from the 8 * improved support for tape adapters (for using regular casette players and other audio devices instead of Datasette) and emulators * built-in tape head align tool (only feasible to use on machines with extended memory, like Mega65) -* extended / tweaked `LOAD` / `VERIFY` commands - * start/end addresses are displayed, in the Final cartridge style - * command with just the file name tries to use the last device if it's number seems sane; otherwise uses 8 - * command without parameters tries to load first file from drive chosen as above -* `LIST` command should never damage the screen if trying to list memory content which is not a BASIC program - * uses RAM under ROM and I/O: 51199 bytes free (up to `$CFFF`) by default, but 61438 is also possible * cold/warm start silences multiple SID chips * warm start due to BRK prints out the instruction address @@ -42,7 +42,7 @@ The following ROM features are currently missing and are not planned due to spac The following ROM features are currently missing: * most BASIC commands -* BASIC variables +* BASIC variables (work in progress, strings partially work now) * BASIC expression handling * most floating point routines * RS-232 support diff --git a/bin/basic_generic.rom b/bin/basic_generic.rom index 8e9caf1c..62954140 100644 Binary files a/bin/basic_generic.rom and b/bin/basic_generic.rom differ diff --git a/bin/basic_ultimate64.rom b/bin/basic_ultimate64.rom index a8010f7e..697d6d9e 100644 Binary files a/bin/basic_ultimate64.rom and b/bin/basic_ultimate64.rom differ diff --git a/bin/kernal_generic.rom b/bin/kernal_generic.rom index 57116e02..90ede62c 100644 Binary files a/bin/kernal_generic.rom and b/bin/kernal_generic.rom differ diff --git a/bin/kernal_ultimate64.rom b/bin/kernal_ultimate64.rom index 80a270c8..74418042 100644 Binary files a/bin/kernal_ultimate64.rom and b/bin/kernal_ultimate64.rom differ diff --git a/bin/mega65.rom b/bin/mega65.rom index 563284aa..aa8a0643 100644 Binary files a/bin/mega65.rom and b/bin/mega65.rom differ diff --git a/bin/mega65_pxlfont.rom b/bin/mega65_pxlfont.rom index 896f68ff..cabc4485 100644 Binary files a/bin/mega65_pxlfont.rom and b/bin/mega65_pxlfont.rom differ diff --git a/src/,,config_custom.s b/src/,,config_custom.s index ad83a50a..da689381 100644 --- a/src/,,config_custom.s +++ b/src/,,config_custom.s @@ -39,9 +39,9 @@ // Memory model -// #define CONFIG_MEMORY_MODEL_38K +#define CONFIG_MEMORY_MODEL_38K // #define CONFIG_MEMORY_MODEL_46K -#define CONFIG_MEMORY_MODEL_50K +// #define CONFIG_MEMORY_MODEL_50K // #define CONFIG_MEMORY_MODEL_60K diff --git a/src/basic/basic_operators/oper_add.s b/src/basic/basic_operators/oper_add.s index d1f6401b..46d124c7 100644 --- a/src/basic/basic_operators/oper_add.s +++ b/src/basic/basic_operators/oper_add.s @@ -52,21 +52,81 @@ oper_add_strings: jmp FRMEVL_continue !: - // Allocate memory for concatenated string + // Allocate memory for the concatenated string clc adc __FAC2+0 bcs_16 do_STRING_TOO_LONG_error -.break - jsr tmpstr_alloc + // Copy the temporary string pointer to INDEX + ldy #$01 + lda (VARPNT), y + sta INDEX+0 + iny + lda (VARPNT), y + sta INDEX+1 + // Perform the concatenation - // XXX finish the implementation +#if CONFIG_MEMORY_MODEL_60K + + // XXX + // XXX + // XXX +#elif CONFIG_MEMORY_MODEL_46K || CONFIG_MEMORY_MODEL_50K + // XXX consider optimized version without multiple JSRs + + // XXX + // XXX + // XXX + +#else // CONFIG_MEMORY_MODEL_38K + + // Copy data from the first string + + ldy #$00 +!: + lda (__FAC2+1),y + sta (INDEX),y + iny + cpy __FAC2+0 + bne !- + + // Increase INDEX pointer by the size of the 1st string + + tya + jsr varstr_INDEX_up_A + + // Copy data from the second string + + ldy #$00 +!: + lda (__FAC1+1),y + sta (INDEX),y + iny + cpy __FAC1+0 + bne !- + +#endif + + // Free old strings - if they are temporary + + // XXX + // XXX + // XXX + + // Copy the descriptor to __FAC1 + + ldy #$02 +!: + lda (VARPNT), y + sta __FAC1, y + dey + bpl !- oper_add_strings_end: diff --git a/src/basic/engine/tmpstr_alloc.s b/src/basic/engine/tmpstr_alloc.s index b5b3698e..8d94899f 100644 --- a/src/basic/engine/tmpstr_alloc.s +++ b/src/basic/engine/tmpstr_alloc.s @@ -8,14 +8,38 @@ // Input: // -.A desired string length, has to be > 0 // +// Output: +// - VARPNT points to the newly alocated descriptor // tmpstr_alloc: + tax + // First we need to find a free temporary string descriptor - // XXX TEMPPT-> LASTPT + lda TEMPPT + cmp #$22 + bcs_16 do_FORMULA_TOO_COMPLEX_error - // XXX implement this + tay + sta LASTPT + clc + adc #$03 + sta TEMPPT - rts + // Store desired string length + + stx $00, y + + // Store descriptor address + + lda LASTPT + sta VARPNT+0 + lda #$00 + sta VARPNT+1 + + // Jump to alocation routine + // XXX consider falltrough + + jmp varstr_alloc diff --git a/src/basic/engine/varstr_alloc.s b/src/basic/engine/varstr_alloc.s index d5bc5e04..ee06e329 100644 --- a/src/basic/engine/varstr_alloc.s +++ b/src/basic/engine/varstr_alloc.s @@ -20,7 +20,6 @@ // - fills-in pointer in the string descriptor // -// XXX test this routine varstr_alloc: