diff --git a/.gitignore b/.gitignore index 40dc1c36..bd558ebd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ -# Image which is illegal to distribute +# Image which is illegal to distribute - just for extra safety kernal_hybrid.rom diff --git a/bin/README.txt b/bin/README.txt index d3a254bc..de60839c 100644 --- a/bin/README.txt +++ b/bin/README.txt @@ -4,7 +4,12 @@ Follow these rules, or bad things will happen! - Don't mix ROMs for different platforms - use generic BASIC with generic KERNAL, Mega65 BASIC with Mega65 KERNAL, etc. -- Don't mix these ROMs with any other ROMs; the only exception is CHARGEN, this one is fully interchangeable. +- Don't mix these ROMs with any other ROMs; exceptions: + + - kernal_hybrid.rom, which is meant to be used (and has to be used) with the original BASIC ROM; + however, this hybrid ROM cannot be distributed due to legal/copyright reasons + + - chargen.rom - this one is fully interchangeable - Don't mix ROMs from different builds/versions (again, CHARGEN is an exception). diff --git a/bin/basic_generic.rom b/bin/basic_generic.rom index ef561550..57475055 100644 Binary files a/bin/basic_generic.rom and b/bin/basic_generic.rom differ diff --git a/bin/basic_mega65.rom b/bin/basic_mega65.rom index 62f86610..2b665a44 100644 Binary files a/bin/basic_mega65.rom and b/bin/basic_mega65.rom differ diff --git a/bin/basic_ultimate64.rom b/bin/basic_ultimate64.rom index 4bb5d792..c0f41ac9 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 77e70507..95444870 100644 Binary files a/bin/kernal_generic.rom and b/bin/kernal_generic.rom differ diff --git a/bin/kernal_mega65.rom b/bin/kernal_mega65.rom index 60c1d313..e6925302 100644 Binary files a/bin/kernal_mega65.rom and b/bin/kernal_mega65.rom differ diff --git a/bin/kernal_ultimate64.rom b/bin/kernal_ultimate64.rom index 6f0041a7..f2e21005 100644 Binary files a/bin/kernal_ultimate64.rom and b/bin/kernal_ultimate64.rom differ diff --git a/c64/,,config_generic.s b/c64/,,config_generic.s index 909a70ed..3843ec00 100644 --- a/c64/,,config_generic.s +++ b/c64/,,config_generic.s @@ -22,6 +22,7 @@ #define CONFIG_DOS_WEDGE #define CONFIG_BCD_SAFE_INTERRUPTS +#define CONFIG_EXTENDED_SCNKEY // for now has to be enabled // #define CONFIG_DBG_STUBS_BRK // #define CONFIG_DBG_PRINTF diff --git a/c64/,,config_mega65.s b/c64/,,config_mega65.s index f292a412..e856a52c 100644 --- a/c64/,,config_mega65.s +++ b/c64/,,config_mega65.s @@ -22,6 +22,7 @@ #define CONFIG_DOS_WEDGE #define CONFIG_BCD_SAFE_INTERRUPTS +#define CONFIG_EXTENDED_SCNKEY // for now has to be enabled // #define CONFIG_DBG_STUBS_BRK // #define CONFIG_DBG_PRINTF diff --git a/c64/,,config_ultimate64.s b/c64/,,config_ultimate64.s index 1c075909..f7ce1b93 100644 --- a/c64/,,config_ultimate64.s +++ b/c64/,,config_ultimate64.s @@ -22,6 +22,7 @@ #define CONFIG_DOS_WEDGE #define CONFIG_BCD_SAFE_INTERRUPTS +#define CONFIG_EXTENDED_SCNKEY // for now has to be enabled // #define CONFIG_DBG_STUBS_BRK // #define CONFIG_DBG_PRINTF diff --git a/c64/aliases/,aliases_ram_lowmem.s b/c64/aliases/,aliases_ram_lowmem.s index 8a90a931..bc391aae 100644 --- a/c64/aliases/,aliases_ram_lowmem.s +++ b/c64/aliases/,aliases_ram_lowmem.s @@ -105,43 +105,51 @@ .label BUFPNT = $A6 // -- NOT IMPLEMENTED -- .label INBIT = $A7 // -- NOT IMPLEMENTED -- -// #if CONFIG_EXTENDED_SCNKEY +#if CONFIG_EXTENDED_SCNKEY // Reuse RS232 variables, since they should not be used by other things. // Carefully avoid $A7 which is used by 64NET .label KeyQuantity = $A8 // 1 byte .label BufferNew = $A9 // 3 bytes -// #endif // CONFIG_EXTENDED_SCNKEY -// .label BITCI = $A8 // -- NOT IMPLEMENTED -- -// .label RINONE = $A9 // -- NOT IMPLEMENTED -- -// .label RIDDATA = $AA // -- NOT IMPLEMENTED -- -// .label RIPRTY = $AB // -- NOT IMPLEMENTED -- +#else + .label BITCI = $A8 // -- NOT IMPLEMENTED -- + .label RINONE = $A9 // -- NOT IMPLEMENTED -- + .label RIDDATA = $AA // -- NOT IMPLEMENTED -- + .label RIPRTY = $AB // -- NOT IMPLEMENTED -- + +#endif .label SAL = $AC // $AC-$AD -- NOT IMPLEMENTED -- (implemented screen part) .label EAL = $AE // $AE-$AF -- NOT IMPLEMENTED -- [!] used also by screen editor, for temporary color storage when scrolling .label CMP0 = $B0 // $B0-$B1 temporary tape storage, [!] here used for BRK instruction address .label TAPE1 = $B2 // $B2-$B3 tape buffer pointer -// #if CONFIG_EXTENDED_SCNKEY +#if CONFIG_EXTENDED_SCNKEY // Reuse RS232 variables, since they should not be used by other things. // This one should be initialized in cinit to $FF .label BufferQuantity = $B4 // 1 byte -// #endif // CONFIG_EXTENDED_SCNKEY -// .label BITTS = $B4 // -- NOT IMPLEMENTED -- +#else + + .label BITTS = $B4 // -- NOT IMPLEMENTED -- + +#endif .label NXTBIT = $B5 // -- NOT IMPLEMENTED -- -// #if CONFIG_EXTENDED_SCNKEY +#if CONFIG_EXTENDED_SCNKEY // Reuse RS232 variables, since they should not be used by other things. // Carefully avoiding $A7 which is used by 64NET .label TempZP = $B6 // 1 byte -// #endif // CONFIG_EXTENDED_SCNKEY -// .label RODATA = $B6 // -- NOT IMPLEMENTED -- +#else + + .label RODATA = $B6 // -- NOT IMPLEMENTED -- + +#endif .label FNLEN = $B7 // current file name length .label LA = $B8 // current logical_file number @@ -192,13 +200,13 @@ .label BUF = $200 // $200-$250, BASIC line editor input buffer (81 bytes) -// #if CONFIG_EXTENDED_SCNKEY +#if CONFIG_EXTENDED_SCNKEY // $250-$258 is the 81st - 88th characters in BASIC input, a carry over from VIC-20 // and not used on C64, so safe for us to use, probably. .label ScanResult = $250 // 8 bytes -// #endif // CONFIG_EXTENDED_SCNKEY +#endif // [!] XXX document $251-$258 usage .label LAT = $259 // $259-$262, logical file numbers (table, 10 bytes) @@ -221,20 +229,23 @@ .label MODE = $291 // flag, is case switch allowed .label AUTODN = $292 // -- NOT IMPLEMENTED -- screen scroll disable -// #if CONFIG_EXTENDED_SCNKEY +#if CONFIG_EXTENDED_SCNKEY // Reuse RS232 variables, since they should not be used by other things. // This one should be initialized in cinit to $FF .label BufferOld = $293 // 3 bytes .label Buffer = $297 // 4 bytes -// #endif // CONFIG_EXTENDED_SCNKEY -// .label M51CRT = $293 // -- NOT IMPLEMENTED -- mock 6551 -// .label M51CDR = $294 // -- NOT IMPLEMENTED -- mock 6551 -// .label M51AJB = $295 // $295-$296 -- NOT IMPLEMENTED -- mock 6551 -// .label RSSTAT = $297 // -- NOT IMPLEMENTED -- mock 6551, RS-232 status -// .label BITNUM = $298 // -- NOT IMPLEMENTED -- -// .label BAUDOF = $299 // $299-$29A -- NOT IMPLEMENTED -- +#else + + .label M51CRT = $293 // -- NOT IMPLEMENTED -- mock 6551 + .label M51CDR = $294 // -- NOT IMPLEMENTED -- mock 6551 + .label M51AJB = $295 // $295-$296 -- NOT IMPLEMENTED -- mock 6551 + .label RSSTAT = $297 // -- NOT IMPLEMENTED -- mock 6551, RS-232 status + .label BITNUM = $298 // -- NOT IMPLEMENTED -- + .label BAUDOF = $299 // $299-$29A -- NOT IMPLEMENTED -- + +#endif .label RIDBE = $29B // -- NOT IMPLEMENTED -- .label RIDBS = $29C // -- NOT IMPLEMENTED -- diff --git a/c64/basic/cmd_load.s b/c64/basic/cmd_load.s index cc4698d7..374943f1 100644 --- a/c64/basic/cmd_load.s +++ b/c64/basic/cmd_load.s @@ -95,12 +95,15 @@ got_devicenumber: bne got_loadaddress got_secondaryaddress: - ldx #<$0801 // XXX use start text vector - ldy #>$0801 + ldx TXTTAB+0 + ldy TXTTAB+1 got_loadaddress: lda #$00 // LOAD not verify - jsr via_ILOAD + jsr JLOAD + php + jsr print_return + plp bcc !+ // A = KERNAL error code, which also almost match @@ -218,6 +221,3 @@ end_of_line_search: sta OLDTXT+0 jmp basic_relink_loop - -via_ILOAD: - jmp (ILOAD) diff --git a/c64/kernal/lvs_helpers.s b/c64/kernal/lvs_helpers.s index 996fbfa8..4548f58e 100644 --- a/c64/kernal/lvs_helpers.s +++ b/c64/kernal/lvs_helpers.s @@ -124,8 +124,7 @@ lvs_display_done: bpl lvs_display_end ldx #__MSG_KERNAL_TO_HEX - jsr !- - jmp print_return + jmp !- lvs_wrap_around_error: // This error is probably not even detected by C64 Kernal;