diff --git a/0001-sim65-common-define-for-paravirt-hooks-base-location.patch b/0001-sim65-common-define-for-paravirt-hooks-base-location.patch deleted file mode 100644 index fd79a58..0000000 --- a/0001-sim65-common-define-for-paravirt-hooks-base-location.patch +++ /dev/null @@ -1,119 +0,0 @@ -From 52695523465cb8bc72a0728b1f5b46ffc3eb2eef Mon Sep 17 00:00:00 2001 -From: bbbradsmith -Date: Thu, 30 May 2019 15:34:05 -0400 -Subject: [PATCH 001/170] sim65 common define for paravirt hooks base location - allows the loaded binary to take up as much space as possible restored some - documentation of the hooks but without reference to specific location - ---- - doc/sim65.sgml | 25 ++++++++++--------------- - src/sim65/main.c | 4 ++-- - src/sim65/paravirt.c | 6 +++--- - src/sim65/paravirt.h | 11 +++++++++++ - 4 files changed, 26 insertions(+), 20 deletions(-) - -diff --git a/doc/sim65.sgml b/doc/sim65.sgml -index 8a7329b0..075d9584 100644 ---- a/doc/sim65.sgml -+++ b/doc/sim65.sgml -@@ -115,22 +115,12 @@ The -- int open (const char* name, int flags, ...); -- int __fastcall__ close (int fd); -- int __fastcall__ read (int fd, void* buf, unsigned count); -- int __fastcall__ write (int fd, const void* buf, unsigned count); -- -- --These built-in functions can be used with --). - - - Creating a Test in Assembly

-@@ -169,6 +159,11 @@ pre-loaded with the given The -+Several bytes immediately below the vector table are reserved for paravirtualization functions. -+Except for = PARAVIRT_BASE) { -+ Error ("'%s': To large to fit into $%04X-$%04X", ProgramFile, Addr, PARAVIRT_BASE); - } - MemWriteByte (Addr++, (unsigned char) Val); - } -diff --git a/src/sim65/paravirt.c b/src/sim65/paravirt.c -index c9f6e61b..603a07e9 100644 ---- a/src/sim65/paravirt.c -+++ b/src/sim65/paravirt.c -@@ -318,13 +318,13 @@ void ParaVirtHooks (CPURegs* Regs) - /* Potentially execute paravirtualization hooks */ - { - /* Check for paravirtualization address range */ -- if (Regs->PC < 0xFFF4 || -- Regs->PC >= 0xFFF4 + sizeof (Hooks) / sizeof (Hooks[0])) { -+ if (Regs->PC < PARAVIRT_BASE || -+ Regs->PC >= PARAVIRT_BASE + sizeof (Hooks) / sizeof (Hooks[0])) { - return; - } - - /* Call paravirtualization hook */ -- Hooks[Regs->PC - 0xFFF4] (Regs); -+ Hooks[Regs->PC - PARAVIRT_BASE] (Regs); - - /* Simulate RTS */ - Regs->PC = Pop(Regs) + (Pop(Regs) << 8) + 1; -diff --git a/src/sim65/paravirt.h b/src/sim65/paravirt.h -index cd491539..99c28fa0 100644 ---- a/src/sim65/paravirt.h -+++ b/src/sim65/paravirt.h -@@ -38,6 +38,17 @@ - - - -+/*****************************************************************************/ -+/* Data */ -+/*****************************************************************************/ -+ -+ -+ -+#define PARAVIRT_BASE 0xFFF4 -+/* Lowest address used by a paravirtualization hook */ -+ -+ -+ - /*****************************************************************************/ - /* Code */ - /*****************************************************************************/ --- -2.26.0 - diff --git a/0002-Reduced-shadow-for-h2-to-improve-readability.patch b/0002-Reduced-shadow-for-h2-to-improve-readability.patch deleted file mode 100644 index 5dc6342..0000000 --- a/0002-Reduced-shadow-for-h2-to-improve-readability.patch +++ /dev/null @@ -1,25 +0,0 @@ -From e34ee329738b5b8f54e62e7dd63deff5e1088bff Mon Sep 17 00:00:00 2001 -From: Oliver Schmidt -Date: Tue, 4 Jun 2019 11:43:07 +0200 -Subject: [PATCH 002/170] Reduced shadow for h2 to improve readability. - ---- - doc/doc.css | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/doc/doc.css b/doc/doc.css -index 232599a7..e4c316e1 100644 ---- a/doc/doc.css -+++ b/doc/doc.css -@@ -26,7 +26,7 @@ h1 { - - h2 { - font-size: 160%; -- text-shadow: 2px 2px 6px #303030; -+ text-shadow: 1px 1px 3px #303030; - letter-spacing: 1px; - margin-top: 2em; - margin-bottom: 1em; --- -2.26.0 - diff --git a/0003-Replace-GIT_SHA-with-a-more-versatile-BUILD_ID-defin.patch b/0003-Replace-GIT_SHA-with-a-more-versatile-BUILD_ID-defin.patch deleted file mode 100644 index 8957a2c..0000000 --- a/0003-Replace-GIT_SHA-with-a-more-versatile-BUILD_ID-defin.patch +++ /dev/null @@ -1,74 +0,0 @@ -From 83e0c70de509e0be2825fae1deadfcefb6366270 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= -Date: Sun, 9 Jun 2019 01:19:53 +0200 -Subject: [PATCH 003/170] Replace GIT_SHA with a more versatile BUILD_ID - definition. - -When compiling cc65, it will by default place the git hash (if available) of -the checked out commit in the version string. This isn't useful when building -a package for a Linux distribution, since there either won't be an upstream -git hash if there is one at all. - -Thus we replace GIT_SHA with a more versatile BUILD_ID, which can be defined -to any arbitrary string. When building, its contents will be appended to the -version string instead of the git hash. - -If BUILD_ID is not defined by the user the behaviour will be exactly the same -as before. That means BUILD_ID gets automatically defined to Git , -if it can be determined from a checkout. ---- - src/Makefile | 14 +++++++------- - src/common/version.c | 4 ++-- - 2 files changed, 9 insertions(+), 9 deletions(-) - -diff --git a/src/Makefile b/src/Makefile -index c93a8645..bbf594aa 100644 ---- a/src/Makefile -+++ b/src/Makefile -@@ -52,13 +52,13 @@ ifdef USER_CFLAGS - $(info USER_CFLAGS: $(USER_CFLAGS)) - endif - --ifdef GIT_SHA -- $(info GIT_SHA: $(GIT_SHA)) -+ifdef BUILD_ID -+ $(info BUILD_ID: $(BUILD_ID)) - else -- GIT_SHA := $(shell git rev-parse --short HEAD 2>$(NULLDEV) || svnversion 2>$(NULLDEV)) -- ifneq ($(words $(GIT_SHA)),1) -- GIT_SHA := N/A -- $(info GIT_SHA: N/A) -+ BUILD_ID := Git $(shell git rev-parse --short HEAD 2>$(NULLDEV) || svnversion 2>$(NULLDEV)) -+ ifneq ($(words $(BUILD_ID)),2) -+ BUILD_ID := N/A -+ $(info BUILD_ID: N/A) - endif - endif - -@@ -66,7 +66,7 @@ CFLAGS += -MMD -MP -O3 -I common \ - -Wall -Wextra -Wno-char-subscripts $(USER_CFLAGS) \ - -DCA65_INC="$(CA65_INC)" -DCC65_INC="$(CC65_INC)" -DCL65_TGT="$(CL65_TGT)" \ - -DLD65_LIB="$(LD65_LIB)" -DLD65_OBJ="$(LD65_OBJ)" -DLD65_CFG="$(LD65_CFG)" \ -- -DGIT_SHA=$(GIT_SHA) -+ -DBUILD_ID="$(BUILD_ID)" - - LDLIBS += -lm - -diff --git a/src/common/version.c b/src/common/version.c -index c76a3993..202c61cc 100644 ---- a/src/common/version.c -+++ b/src/common/version.c -@@ -61,8 +61,8 @@ const char* GetVersionAsString (void) - /* Returns the version number as a string in a static buffer */ - { - static char Buf[60]; --#if defined(GIT_SHA) -- xsnprintf (Buf, sizeof (Buf), "%u.%u - Git %s", VER_MAJOR, VER_MINOR, STRINGIZE (GIT_SHA)); -+#if defined(BUILD_ID) -+ xsnprintf (Buf, sizeof (Buf), "%u.%u - %s", VER_MAJOR, VER_MINOR, STRINGIZE (BUILD_ID)); - #else - xsnprintf (Buf, sizeof (Buf), "%u.%u", VER_MAJOR, VER_MINOR); - #endif --- -2.26.0 - diff --git a/0004-test-ref-otccex-Fix-ramdomly-occurring-segfault.patch b/0004-test-ref-otccex-Fix-ramdomly-occurring-segfault.patch deleted file mode 100644 index 1c1fb3f..0000000 --- a/0004-test-ref-otccex-Fix-ramdomly-occurring-segfault.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 9faca05e6a028915bc4d6e3b2e5993bdf1fc1ada Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= -Date: Sun, 9 Jun 2019 17:46:31 +0200 -Subject: [PATCH 004/170] test/ref/otccex: Fix ramdomly occurring segfault. - -The variables named tab and p are used in the context of pointers -and thus must be declared as such. Determining the purpose they -serve, using char over int seems more feasible here as well. ---- - test/ref/otccex.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/test/ref/otccex.c b/test/ref/otccex.c -index aa5df158..645078ef 100644 ---- a/test/ref/otccex.c -+++ b/test/ref/otccex.c -@@ -58,7 +58,7 @@ long fact(n) - /* Well, we could use printf, but it would be too easy */ - print_num(long n,int b) - { -- int tab, p, c; -+ char *tab, *p, c; - /* Numbers can be entered in decimal, hexadecimal ('0x' prefix) and - octal ('0' prefix) */ - /* more complex programs use malloc */ -@@ -71,7 +71,7 @@ print_num(long n,int b) - c = c + 'a' - 10; - else - c = c + '0'; -- *(char *)p = c; -+ *p = c; - p++; - n = n / b; - /* 'break' is supported */ --- -2.26.0 - diff --git a/0005-util-zlib-deflater-Fix-several-compiler-warnings.patch b/0005-util-zlib-deflater-Fix-several-compiler-warnings.patch deleted file mode 100644 index 20bc093..0000000 --- a/0005-util-zlib-deflater-Fix-several-compiler-warnings.patch +++ /dev/null @@ -1,36 +0,0 @@ -From e0ac9d5d8e843c0a14f22da0ba1922ae18bccbb9 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= -Date: Sun, 9 Jun 2019 21:07:33 +0200 -Subject: [PATCH 005/170] util/zlib/deflater: Fix several compiler warnings. - ---- - util/zlib/deflater.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/util/zlib/deflater.c b/util/zlib/deflater.c -index 32d01a36..7e13600a 100644 ---- a/util/zlib/deflater.c -+++ b/util/zlib/deflater.c -@@ -16,8 +16,8 @@ - int main(int argc, char* argv[]) - { - FILE* fp; -- char* inbuf; -- char* outbuf; -+ unsigned char* inbuf; -+ unsigned char* outbuf; - size_t inlen; - size_t outlen; - z_stream stream; -@@ -84,7 +84,7 @@ int main(int argc, char* argv[]) - } - - /* display summary */ -- printf("Compressed %s (%d bytes) to %s (%d bytes)\n", -+ printf("Compressed %s (%zu bytes) to %s (%zu bytes)\n", - argv[1], inlen, argv[2], outlen); - return 0; - } --- -2.26.0 - diff --git a/0006-zlib-Use-correct-un-signedness-of-char-in-prototypes.patch b/0006-zlib-Use-correct-un-signedness-of-char-in-prototypes.patch deleted file mode 100644 index 2fa4b59..0000000 --- a/0006-zlib-Use-correct-un-signedness-of-char-in-prototypes.patch +++ /dev/null @@ -1,86 +0,0 @@ -From 93b6efcb2f969c6de0fd1eca5b07dbce18046c0a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= -Date: Sat, 15 Jun 2019 06:53:27 +0200 -Subject: [PATCH 006/170] zlib: Use correct (un)signedness of char in - prototypes and functions. - -Also ensure we are using the same constness qualifiers. ---- - include/zlib.h | 7 ++++--- - libsrc/zlib/inflatemem.s | 3 ++- - libsrc/zlib/uncompress.c | 9 ++++----- - 3 files changed, 10 insertions(+), 9 deletions(-) - -diff --git a/include/zlib.h b/include/zlib.h -index 8ced8980..3f6c2b27 100644 ---- a/include/zlib.h -+++ b/include/zlib.h -@@ -48,7 +48,8 @@ - #define Z_NULL 0 - - --unsigned __fastcall__ inflatemem (char* dest, const char* source); -+unsigned __fastcall__ inflatemem (unsigned char* dest, -+ const unsigned char* source); - /* - Decompresses the source buffer into the destination buffer. - Returns the size of the uncompressed data (number of bytes written starting -@@ -83,8 +84,8 @@ unsigned __fastcall__ inflatemem (char* dest, const char* source); - */ - - --int __fastcall__ uncompress (char* dest, unsigned* destLen, -- const char* source, unsigned sourceLen); -+int __fastcall__ uncompress (unsigned char* dest, unsigned* destLen, -+ const unsigned char* source, unsigned sourceLen); - /* - Original zlib description: - -diff --git a/libsrc/zlib/inflatemem.s b/libsrc/zlib/inflatemem.s -index bc89f201..80c19f22 100644 ---- a/libsrc/zlib/inflatemem.s -+++ b/libsrc/zlib/inflatemem.s -@@ -1,7 +1,8 @@ - ; - ; 2017-11-07, Piotr Fusik - ; --; unsigned __fastcall__ inflatemem (char* dest, const char* source); -+; unsigned __fastcall__ inflatemem (unsigned char* dest, -+; const unsigned char* source); - ; - ; NOTE: Be extremely careful with modifications, because this code is heavily - ; optimized for size (for example assumes certain register and flag values -diff --git a/libsrc/zlib/uncompress.c b/libsrc/zlib/uncompress.c -index 4e449a3e..61838b47 100644 ---- a/libsrc/zlib/uncompress.c -+++ b/libsrc/zlib/uncompress.c -@@ -6,11 +6,11 @@ - - #include - --int __fastcall__ uncompress (char* dest, unsigned* destLen, -- const char* source, unsigned sourceLen) -+int __fastcall__ uncompress (unsigned char* dest, unsigned* destLen, -+ const unsigned char* source, unsigned sourceLen) - { - unsigned len; -- unsigned char* ptr; -+ const unsigned char* ptr = source + sourceLen - 4; - unsigned long csum; - /* source[0]: Compression method and flags - bits 0 to 3: Compression method (must be Z_DEFLATED) -@@ -22,10 +22,9 @@ int __fastcall__ uncompress (char* dest, unsigned* destLen, - */ - if ((source[0] & 0x8f) != Z_DEFLATED || source[1] & 0x20) - return Z_DATA_ERROR; -- if ((((unsigned) source[0] << 8) | (unsigned char) source[1]) % 31) -+ if ((((unsigned) source[0] << 8) | source[1]) % 31) - return Z_DATA_ERROR; - *destLen = len = inflatemem(dest, source + 2); -- ptr = (unsigned char*) source + sourceLen - 4; - csum = adler32(adler32(0L, Z_NULL, 0), dest, len); - if ((unsigned char) csum != ptr[3] - || (unsigned char) (csum >> 8) != ptr[2] --- -2.26.0 - diff --git a/0007-Made-the-ld65-configure-file-s-segment-offset-attrib.patch b/0007-Made-the-ld65-configure-file-s-segment-offset-attrib.patch deleted file mode 100644 index e367a4d..0000000 --- a/0007-Made-the-ld65-configure-file-s-segment-offset-attrib.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 28584b31f1b3560173c16487f45aad23dc6f9fb5 Mon Sep 17 00:00:00 2001 -From: Greg King -Date: Sun, 30 Jun 2019 22:44:10 -0400 -Subject: [PATCH 007/170] Made the ld65 configure file's segment offset - attribute accept zero as a value. - -Expressions are allowed as values. Therefore, zero might be set explicitly by some conditions. ---- - src/ld65/config.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/ld65/config.c b/src/ld65/config.c -index f8bff2ac..b8699a87 100644 ---- a/src/ld65/config.c -+++ b/src/ld65/config.c -@@ -732,7 +732,7 @@ static void ParseSegments (void) - - case CFGTOK_OFFSET: - FlagAttr (&S->Attr, SA_OFFSET, "OFFSET"); -- S->Addr = CfgCheckedConstExpr (1, 0x1000000); -+ S->Addr = CfgCheckedConstExpr (0, 0x1000000); - S->Flags |= SF_OFFSET; - break; - --- -2.26.0 - diff --git a/0008-Minor-URL-update.patch b/0008-Minor-URL-update.patch deleted file mode 100644 index d7c465c..0000000 --- a/0008-Minor-URL-update.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 9be25dab9ce05434978ff16fd1761f3502bbd03e Mon Sep 17 00:00:00 2001 -From: Oliver Schmidt -Date: Mon, 15 Jul 2019 12:29:09 +0200 -Subject: [PATCH 008/170] Minor URL update. - ---- - samples/Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/samples/Makefile b/samples/Makefile -index 6c94495f..ad81c247 100644 ---- a/samples/Makefile -+++ b/samples/Makefile -@@ -90,7 +90,7 @@ ifneq ($(filter disk samples.%,$(MAKECMDGOALS)),) - # For this one, see https://applecommander.github.io/ - AC ?= ac.jar - -- # For this one, see http://www.horus.com/~hias/atari/ -+ # For this one, see https://www.horus.com/~hias/atari/ - DIR2ATR ?= dir2atr - - DISK_c64 = samples.d64 --- -2.26.0 - diff --git a/0009-src-Makefile-Simplify-BUILD_ID-logic.patch b/0009-src-Makefile-Simplify-BUILD_ID-logic.patch deleted file mode 100644 index 3ae8c88..0000000 --- a/0009-src-Makefile-Simplify-BUILD_ID-logic.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 2f3955dbc7fe97e4415231bc0204c5a4a3a9447b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= -Date: Sun, 14 Jul 2019 09:28:49 +0200 -Subject: [PATCH 009/170] src/Makefile: Simplify BUILD_ID logic. - ---- - src/Makefile | 6 ++---- - 1 file changed, 2 insertions(+), 4 deletions(-) - -diff --git a/src/Makefile b/src/Makefile -index bbf594aa..87f1e823 100644 ---- a/src/Makefile -+++ b/src/Makefile -@@ -52,15 +52,13 @@ ifdef USER_CFLAGS - $(info USER_CFLAGS: $(USER_CFLAGS)) - endif - --ifdef BUILD_ID -- $(info BUILD_ID: $(BUILD_ID)) --else -+ifndef BUILD_ID - BUILD_ID := Git $(shell git rev-parse --short HEAD 2>$(NULLDEV) || svnversion 2>$(NULLDEV)) - ifneq ($(words $(BUILD_ID)),2) - BUILD_ID := N/A -- $(info BUILD_ID: N/A) - endif - endif -+$(info BUILD_ID: $(BUILD_ID)) - - CFLAGS += -MMD -MP -O3 -I common \ - -Wall -Wextra -Wno-char-subscripts $(USER_CFLAGS) \ --- -2.26.0 - diff --git a/0010-Changed-empty-parameter-lists-into-void-lists-on-fun.patch b/0010-Changed-empty-parameter-lists-into-void-lists-on-fun.patch deleted file mode 100644 index 8e6ff88..0000000 --- a/0010-Changed-empty-parameter-lists-into-void-lists-on-fun.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 88c6dd2da81c10eb36bdc76f236ef3d428d9312e Mon Sep 17 00:00:00 2001 -From: Greg King -Date: Tue, 16 Jul 2019 13:16:02 -0400 -Subject: [PATCH 010/170] Changed empty parameter lists into (void) lists on - functions with asm() statements. - -The fix avoids any possible problems with how cc65 will handle old-style (K & R) function declarations, in the future. ---- - test/val/trampoline-params.c | 2 +- - test/val/trampoline-varargs.c | 2 +- - test/val/trampoline.c | 6 +++--- - 3 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/test/val/trampoline-params.c b/test/val/trampoline-params.c -index c05d8c06..9dbbba07 100644 ---- a/test/val/trampoline-params.c -+++ b/test/val/trampoline-params.c -@@ -9,7 +9,7 @@ - - static unsigned char flag; - --static void trampoline_set() { -+static void trampoline_set(void) { - asm("ldy tmp4"); - asm("sty %v", flag); - asm("jsr callptr4"); -diff --git a/test/val/trampoline-varargs.c b/test/val/trampoline-varargs.c -index e2db839c..0e6be49c 100644 ---- a/test/val/trampoline-varargs.c -+++ b/test/val/trampoline-varargs.c -@@ -9,7 +9,7 @@ - - static unsigned char flag; - --static void trampoline_set() { -+static void trampoline_set(void) { - // The Y register is used for variadics - save and restore - asm("sty tmp3"); - -diff --git a/test/val/trampoline.c b/test/val/trampoline.c -index b2010f6f..8f1e1547 100644 ---- a/test/val/trampoline.c -+++ b/test/val/trampoline.c -@@ -7,13 +7,13 @@ - - static unsigned char flag; - --static void trampoline_set() { -+static void trampoline_set(void) { - asm("ldy tmp4"); - asm("sty %v", flag); - asm("jsr callptr4"); - } - --void trampoline_inc() { -+void trampoline_inc(void) { - asm("inc %v", flag); - asm("jsr callptr4"); - } -@@ -35,7 +35,7 @@ void func1(void); - #pragma wrapped-call(pop) - #pragma wrapped-call(pop) - --void func1() { -+void func1(void) { - func2(); - } - --- -2.26.0 - diff --git a/0011-Add-page-0-variables-from-Telemon-2.4.patch b/0011-Add-page-0-variables-from-Telemon-2.4.patch deleted file mode 100644 index 77a9e18..0000000 --- a/0011-Add-page-0-variables-from-Telemon-2.4.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 99de3cb6ea5ae3bfed01cb9139dc68939b3909ef Mon Sep 17 00:00:00 2001 -From: jede -Date: Sat, 20 Jul 2019 11:28:33 +0200 -Subject: [PATCH 011/170] Add page 0 variables from Telemon 2.4 - ---- - asminc/telestrat.inc | 29 +++++++++++++++++++++++++++-- - 1 file changed, 27 insertions(+), 2 deletions(-) - -diff --git a/asminc/telestrat.inc b/asminc/telestrat.inc -index f2eb42ff..3bd8a1f5 100644 ---- a/asminc/telestrat.inc -+++ b/asminc/telestrat.inc -@@ -119,14 +119,39 @@ RS232T := $59 - RS232C := $5A - INDRS := $5B - -+; Float and integer management - ACC1E := $60 - ACC1M := $61 -- - ACC1S := $65 -- -+ACC1EX := $66 -+ACC1J := $67 -+ACC2E := $68 -+ACC2M := $69 -+ACC2S := $6D -+ACCPS := $6E -+ACC3 := $6F -+ -+ACC4E := $73 -+ACC4M := $74 -+ -+ -+FLDT0 := $74 -+FLDT1 := $75 -+FLDT2 := $76 -+FLSVY := $77 -+FLTR0 := $7D -+FLTR1 := $7E -+ -+; Menu management -+MENDDY := $62 -+MENDFY := $63 -+MENX := $64 -+MENDY := $66 - FLGMEN := $68 - ADMEN := $69 - -+FLSGN := $8A -+FLINT := $88 - FLSVS := $89 - FLERR := $8B - --- -2.26.0 - diff --git a/0012-Add-XSCROH-XSCROB-value.patch b/0012-Add-XSCROH-XSCROB-value.patch deleted file mode 100644 index b18acb1..0000000 --- a/0012-Add-XSCROH-XSCROB-value.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 76fe064e03a909be3139cf2daae48d8ded0fe269 Mon Sep 17 00:00:00 2001 -From: jede -Date: Sat, 20 Jul 2019 11:31:00 +0200 -Subject: [PATCH 012/170] Add XSCROH & XSCROB value - ---- - asminc/telestrat.inc | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/asminc/telestrat.inc b/asminc/telestrat.inc -index 3bd8a1f5..3526c6f9 100644 ---- a/asminc/telestrat.inc -+++ b/asminc/telestrat.inc -@@ -266,6 +266,8 @@ XECRPR = $33 ; Displays prompt - XCOSCR = $34 ; Switch off cursor - XCSSCR = $35 ; Switch on cursor - XSCRSE = $36 -+XSCROH = $37 ; Scroll up text screen -+XSCROB = $38 ; Scroll down text screen - XSCRNE = $39 ; Load charset from rom to ram - XCLOSE = $3A ; Only in TELEMON 3.x close file (bank 7 of Orix) - XFWRITE = $3B ; Only in TELEMON 3.x write file (bank 7 of Orix) --- -2.26.0 - diff --git a/0013-cc65-Add-support-for-binary-literals.patch b/0013-cc65-Add-support-for-binary-literals.patch deleted file mode 100644 index 1fb3dfd..0000000 --- a/0013-cc65-Add-support-for-binary-literals.patch +++ /dev/null @@ -1,579 +0,0 @@ -From 925ea9d5443949cfd916504a9ed04ada8b750e27 Mon Sep 17 00:00:00 2001 -From: Lauri Kasanen -Date: Tue, 16 Jul 2019 18:39:37 +0300 -Subject: [PATCH 013/170] cc65: Add support for binary literals - -Binary literals, 0b001, are a GCC extension in C and a C++14 feature. ---- - src/cc65/scanner.c | 7 +- - test/val/binlit.c | 533 +++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 538 insertions(+), 2 deletions(-) - create mode 100644 test/val/binlit.c - -diff --git a/src/cc65/scanner.c b/src/cc65/scanner.c -index 695085e9..3e829aab 100644 ---- a/src/cc65/scanner.c -+++ b/src/cc65/scanner.c -@@ -464,8 +464,8 @@ static void NumericConst (void) - unsigned DigitVal; - unsigned long IVal; /* Value */ - -- /* Check for a leading hex or octal prefix and determine the possible -- ** integer types. -+ /* Check for a leading hex, octal or binary prefix and determine the -+ ** possible integer types. - */ - if (CurC == '0') { - /* Gobble 0 and examine next char */ -@@ -473,6 +473,9 @@ static void NumericConst (void) - if (toupper (CurC) == 'X') { - Base = Prefix = 16; - NextChar (); /* gobble "x" */ -+ } else if (toupper (CurC) == 'B' && IS_Get (&Standard) >= STD_CC65) { -+ Base = Prefix = 2; -+ NextChar (); /* gobble 'b' */ - } else { - Base = 10; /* Assume 10 for now - see below */ - Prefix = 8; /* Actual prefix says octal */ -diff --git a/test/val/binlit.c b/test/val/binlit.c -new file mode 100644 -index 00000000..2b6c1ca8 ---- /dev/null -+++ b/test/val/binlit.c -@@ -0,0 +1,533 @@ -+static unsigned char small[256]; -+static unsigned big[256]; -+ -+int main() { -+ -+ unsigned i; -+ -+ small[0] = 0b0; -+ small[1] = 0b1; -+ small[2] = 0b10; -+ small[3] = 0b11; -+ small[4] = 0b100; -+ small[5] = 0b101; -+ small[6] = 0b110; -+ small[7] = 0b111; -+ small[8] = 0b1000; -+ small[9] = 0b1001; -+ small[10] = 0b1010; -+ small[11] = 0b1011; -+ small[12] = 0b1100; -+ small[13] = 0b1101; -+ small[14] = 0b1110; -+ small[15] = 0b1111; -+ small[16] = 0b10000; -+ small[17] = 0b10001; -+ small[18] = 0b10010; -+ small[19] = 0b10011; -+ small[20] = 0b10100; -+ small[21] = 0b10101; -+ small[22] = 0b10110; -+ small[23] = 0b10111; -+ small[24] = 0b11000; -+ small[25] = 0b11001; -+ small[26] = 0b11010; -+ small[27] = 0b11011; -+ small[28] = 0b11100; -+ small[29] = 0b11101; -+ small[30] = 0b11110; -+ small[31] = 0b11111; -+ small[32] = 0b100000; -+ small[33] = 0b100001; -+ small[34] = 0b100010; -+ small[35] = 0b100011; -+ small[36] = 0b100100; -+ small[37] = 0b100101; -+ small[38] = 0b100110; -+ small[39] = 0b100111; -+ small[40] = 0b101000; -+ small[41] = 0b101001; -+ small[42] = 0b101010; -+ small[43] = 0b101011; -+ small[44] = 0b101100; -+ small[45] = 0b101101; -+ small[46] = 0b101110; -+ small[47] = 0b101111; -+ small[48] = 0b110000; -+ small[49] = 0b110001; -+ small[50] = 0b110010; -+ small[51] = 0b110011; -+ small[52] = 0b110100; -+ small[53] = 0b110101; -+ small[54] = 0b110110; -+ small[55] = 0b110111; -+ small[56] = 0b111000; -+ small[57] = 0b111001; -+ small[58] = 0b111010; -+ small[59] = 0b111011; -+ small[60] = 0b111100; -+ small[61] = 0b111101; -+ small[62] = 0b111110; -+ small[63] = 0b111111; -+ small[64] = 0b1000000; -+ small[65] = 0b1000001; -+ small[66] = 0b1000010; -+ small[67] = 0b1000011; -+ small[68] = 0b1000100; -+ small[69] = 0b1000101; -+ small[70] = 0b1000110; -+ small[71] = 0b1000111; -+ small[72] = 0b1001000; -+ small[73] = 0b1001001; -+ small[74] = 0b1001010; -+ small[75] = 0b1001011; -+ small[76] = 0b1001100; -+ small[77] = 0b1001101; -+ small[78] = 0b1001110; -+ small[79] = 0b1001111; -+ small[80] = 0b1010000; -+ small[81] = 0b1010001; -+ small[82] = 0b1010010; -+ small[83] = 0b1010011; -+ small[84] = 0b1010100; -+ small[85] = 0b1010101; -+ small[86] = 0b1010110; -+ small[87] = 0b1010111; -+ small[88] = 0b1011000; -+ small[89] = 0b1011001; -+ small[90] = 0b1011010; -+ small[91] = 0b1011011; -+ small[92] = 0b1011100; -+ small[93] = 0b1011101; -+ small[94] = 0b1011110; -+ small[95] = 0b1011111; -+ small[96] = 0b1100000; -+ small[97] = 0b1100001; -+ small[98] = 0b1100010; -+ small[99] = 0b1100011; -+ small[100] = 0b1100100; -+ small[101] = 0b1100101; -+ small[102] = 0b1100110; -+ small[103] = 0b1100111; -+ small[104] = 0b1101000; -+ small[105] = 0b1101001; -+ small[106] = 0b1101010; -+ small[107] = 0b1101011; -+ small[108] = 0b1101100; -+ small[109] = 0b1101101; -+ small[110] = 0b1101110; -+ small[111] = 0b1101111; -+ small[112] = 0b1110000; -+ small[113] = 0b1110001; -+ small[114] = 0b1110010; -+ small[115] = 0b1110011; -+ small[116] = 0b1110100; -+ small[117] = 0b1110101; -+ small[118] = 0b1110110; -+ small[119] = 0b1110111; -+ small[120] = 0b1111000; -+ small[121] = 0b1111001; -+ small[122] = 0b1111010; -+ small[123] = 0b1111011; -+ small[124] = 0b1111100; -+ small[125] = 0b1111101; -+ small[126] = 0b1111110; -+ small[127] = 0b1111111; -+ small[128] = 0b10000000; -+ small[129] = 0b10000001; -+ small[130] = 0b10000010; -+ small[131] = 0b10000011; -+ small[132] = 0b10000100; -+ small[133] = 0b10000101; -+ small[134] = 0b10000110; -+ small[135] = 0b10000111; -+ small[136] = 0b10001000; -+ small[137] = 0b10001001; -+ small[138] = 0b10001010; -+ small[139] = 0b10001011; -+ small[140] = 0b10001100; -+ small[141] = 0b10001101; -+ small[142] = 0b10001110; -+ small[143] = 0b10001111; -+ small[144] = 0b10010000; -+ small[145] = 0b10010001; -+ small[146] = 0b10010010; -+ small[147] = 0b10010011; -+ small[148] = 0b10010100; -+ small[149] = 0b10010101; -+ small[150] = 0b10010110; -+ small[151] = 0b10010111; -+ small[152] = 0b10011000; -+ small[153] = 0b10011001; -+ small[154] = 0b10011010; -+ small[155] = 0b10011011; -+ small[156] = 0b10011100; -+ small[157] = 0b10011101; -+ small[158] = 0b10011110; -+ small[159] = 0b10011111; -+ small[160] = 0b10100000; -+ small[161] = 0b10100001; -+ small[162] = 0b10100010; -+ small[163] = 0b10100011; -+ small[164] = 0b10100100; -+ small[165] = 0b10100101; -+ small[166] = 0b10100110; -+ small[167] = 0b10100111; -+ small[168] = 0b10101000; -+ small[169] = 0b10101001; -+ small[170] = 0b10101010; -+ small[171] = 0b10101011; -+ small[172] = 0b10101100; -+ small[173] = 0b10101101; -+ small[174] = 0b10101110; -+ small[175] = 0b10101111; -+ small[176] = 0b10110000; -+ small[177] = 0b10110001; -+ small[178] = 0b10110010; -+ small[179] = 0b10110011; -+ small[180] = 0b10110100; -+ small[181] = 0b10110101; -+ small[182] = 0b10110110; -+ small[183] = 0b10110111; -+ small[184] = 0b10111000; -+ small[185] = 0b10111001; -+ small[186] = 0b10111010; -+ small[187] = 0b10111011; -+ small[188] = 0b10111100; -+ small[189] = 0b10111101; -+ small[190] = 0b10111110; -+ small[191] = 0b10111111; -+ small[192] = 0b11000000; -+ small[193] = 0b11000001; -+ small[194] = 0b11000010; -+ small[195] = 0b11000011; -+ small[196] = 0b11000100; -+ small[197] = 0b11000101; -+ small[198] = 0b11000110; -+ small[199] = 0b11000111; -+ small[200] = 0b11001000; -+ small[201] = 0b11001001; -+ small[202] = 0b11001010; -+ small[203] = 0b11001011; -+ small[204] = 0b11001100; -+ small[205] = 0b11001101; -+ small[206] = 0b11001110; -+ small[207] = 0b11001111; -+ small[208] = 0b11010000; -+ small[209] = 0b11010001; -+ small[210] = 0b11010010; -+ small[211] = 0b11010011; -+ small[212] = 0b11010100; -+ small[213] = 0b11010101; -+ small[214] = 0b11010110; -+ small[215] = 0b11010111; -+ small[216] = 0b11011000; -+ small[217] = 0b11011001; -+ small[218] = 0b11011010; -+ small[219] = 0b11011011; -+ small[220] = 0b11011100; -+ small[221] = 0b11011101; -+ small[222] = 0b11011110; -+ small[223] = 0b11011111; -+ small[224] = 0b11100000; -+ small[225] = 0b11100001; -+ small[226] = 0b11100010; -+ small[227] = 0b11100011; -+ small[228] = 0b11100100; -+ small[229] = 0b11100101; -+ small[230] = 0b11100110; -+ small[231] = 0b11100111; -+ small[232] = 0b11101000; -+ small[233] = 0b11101001; -+ small[234] = 0b11101010; -+ small[235] = 0b11101011; -+ small[236] = 0b11101100; -+ small[237] = 0b11101101; -+ small[238] = 0b11101110; -+ small[239] = 0b11101111; -+ small[240] = 0b11110000; -+ small[241] = 0b11110001; -+ small[242] = 0b11110010; -+ small[243] = 0b11110011; -+ small[244] = 0b11110100; -+ small[245] = 0b11110101; -+ small[246] = 0b11110110; -+ small[247] = 0b11110111; -+ small[248] = 0b11111000; -+ small[249] = 0b11111001; -+ small[250] = 0b11111010; -+ small[251] = 0b11111011; -+ small[252] = 0b11111100; -+ small[253] = 0b11111101; -+ small[254] = 0b11111110; -+ small[255] = 0b11111111; -+ -+ for (i = 0; i < 256; i++) { -+ if (small[i] != i) -+ return 1; -+ } -+ -+ big[0] = 0b1111111100000000; -+ big[1] = 0b1111111100000001; -+ big[2] = 0b1111111100000010; -+ big[3] = 0b1111111100000011; -+ big[4] = 0b1111111100000100; -+ big[5] = 0b1111111100000101; -+ big[6] = 0b1111111100000110; -+ big[7] = 0b1111111100000111; -+ big[8] = 0b1111111100001000; -+ big[9] = 0b1111111100001001; -+ big[10] = 0b1111111100001010; -+ big[11] = 0b1111111100001011; -+ big[12] = 0b1111111100001100; -+ big[13] = 0b1111111100001101; -+ big[14] = 0b1111111100001110; -+ big[15] = 0b1111111100001111; -+ big[16] = 0b1111111100010000; -+ big[17] = 0b1111111100010001; -+ big[18] = 0b1111111100010010; -+ big[19] = 0b1111111100010011; -+ big[20] = 0b1111111100010100; -+ big[21] = 0b1111111100010101; -+ big[22] = 0b1111111100010110; -+ big[23] = 0b1111111100010111; -+ big[24] = 0b1111111100011000; -+ big[25] = 0b1111111100011001; -+ big[26] = 0b1111111100011010; -+ big[27] = 0b1111111100011011; -+ big[28] = 0b1111111100011100; -+ big[29] = 0b1111111100011101; -+ big[30] = 0b1111111100011110; -+ big[31] = 0b1111111100011111; -+ big[32] = 0b1111111100100000; -+ big[33] = 0b1111111100100001; -+ big[34] = 0b1111111100100010; -+ big[35] = 0b1111111100100011; -+ big[36] = 0b1111111100100100; -+ big[37] = 0b1111111100100101; -+ big[38] = 0b1111111100100110; -+ big[39] = 0b1111111100100111; -+ big[40] = 0b1111111100101000; -+ big[41] = 0b1111111100101001; -+ big[42] = 0b1111111100101010; -+ big[43] = 0b1111111100101011; -+ big[44] = 0b1111111100101100; -+ big[45] = 0b1111111100101101; -+ big[46] = 0b1111111100101110; -+ big[47] = 0b1111111100101111; -+ big[48] = 0b1111111100110000; -+ big[49] = 0b1111111100110001; -+ big[50] = 0b1111111100110010; -+ big[51] = 0b1111111100110011; -+ big[52] = 0b1111111100110100; -+ big[53] = 0b1111111100110101; -+ big[54] = 0b1111111100110110; -+ big[55] = 0b1111111100110111; -+ big[56] = 0b1111111100111000; -+ big[57] = 0b1111111100111001; -+ big[58] = 0b1111111100111010; -+ big[59] = 0b1111111100111011; -+ big[60] = 0b1111111100111100; -+ big[61] = 0b1111111100111101; -+ big[62] = 0b1111111100111110; -+ big[63] = 0b1111111100111111; -+ big[64] = 0b1111111101000000; -+ big[65] = 0b1111111101000001; -+ big[66] = 0b1111111101000010; -+ big[67] = 0b1111111101000011; -+ big[68] = 0b1111111101000100; -+ big[69] = 0b1111111101000101; -+ big[70] = 0b1111111101000110; -+ big[71] = 0b1111111101000111; -+ big[72] = 0b1111111101001000; -+ big[73] = 0b1111111101001001; -+ big[74] = 0b1111111101001010; -+ big[75] = 0b1111111101001011; -+ big[76] = 0b1111111101001100; -+ big[77] = 0b1111111101001101; -+ big[78] = 0b1111111101001110; -+ big[79] = 0b1111111101001111; -+ big[80] = 0b1111111101010000; -+ big[81] = 0b1111111101010001; -+ big[82] = 0b1111111101010010; -+ big[83] = 0b1111111101010011; -+ big[84] = 0b1111111101010100; -+ big[85] = 0b1111111101010101; -+ big[86] = 0b1111111101010110; -+ big[87] = 0b1111111101010111; -+ big[88] = 0b1111111101011000; -+ big[89] = 0b1111111101011001; -+ big[90] = 0b1111111101011010; -+ big[91] = 0b1111111101011011; -+ big[92] = 0b1111111101011100; -+ big[93] = 0b1111111101011101; -+ big[94] = 0b1111111101011110; -+ big[95] = 0b1111111101011111; -+ big[96] = 0b1111111101100000; -+ big[97] = 0b1111111101100001; -+ big[98] = 0b1111111101100010; -+ big[99] = 0b1111111101100011; -+ big[100] = 0b1111111101100100; -+ big[101] = 0b1111111101100101; -+ big[102] = 0b1111111101100110; -+ big[103] = 0b1111111101100111; -+ big[104] = 0b1111111101101000; -+ big[105] = 0b1111111101101001; -+ big[106] = 0b1111111101101010; -+ big[107] = 0b1111111101101011; -+ big[108] = 0b1111111101101100; -+ big[109] = 0b1111111101101101; -+ big[110] = 0b1111111101101110; -+ big[111] = 0b1111111101101111; -+ big[112] = 0b1111111101110000; -+ big[113] = 0b1111111101110001; -+ big[114] = 0b1111111101110010; -+ big[115] = 0b1111111101110011; -+ big[116] = 0b1111111101110100; -+ big[117] = 0b1111111101110101; -+ big[118] = 0b1111111101110110; -+ big[119] = 0b1111111101110111; -+ big[120] = 0b1111111101111000; -+ big[121] = 0b1111111101111001; -+ big[122] = 0b1111111101111010; -+ big[123] = 0b1111111101111011; -+ big[124] = 0b1111111101111100; -+ big[125] = 0b1111111101111101; -+ big[126] = 0b1111111101111110; -+ big[127] = 0b1111111101111111; -+ big[128] = 0b1111111110000000; -+ big[129] = 0b1111111110000001; -+ big[130] = 0b1111111110000010; -+ big[131] = 0b1111111110000011; -+ big[132] = 0b1111111110000100; -+ big[133] = 0b1111111110000101; -+ big[134] = 0b1111111110000110; -+ big[135] = 0b1111111110000111; -+ big[136] = 0b1111111110001000; -+ big[137] = 0b1111111110001001; -+ big[138] = 0b1111111110001010; -+ big[139] = 0b1111111110001011; -+ big[140] = 0b1111111110001100; -+ big[141] = 0b1111111110001101; -+ big[142] = 0b1111111110001110; -+ big[143] = 0b1111111110001111; -+ big[144] = 0b1111111110010000; -+ big[145] = 0b1111111110010001; -+ big[146] = 0b1111111110010010; -+ big[147] = 0b1111111110010011; -+ big[148] = 0b1111111110010100; -+ big[149] = 0b1111111110010101; -+ big[150] = 0b1111111110010110; -+ big[151] = 0b1111111110010111; -+ big[152] = 0b1111111110011000; -+ big[153] = 0b1111111110011001; -+ big[154] = 0b1111111110011010; -+ big[155] = 0b1111111110011011; -+ big[156] = 0b1111111110011100; -+ big[157] = 0b1111111110011101; -+ big[158] = 0b1111111110011110; -+ big[159] = 0b1111111110011111; -+ big[160] = 0b1111111110100000; -+ big[161] = 0b1111111110100001; -+ big[162] = 0b1111111110100010; -+ big[163] = 0b1111111110100011; -+ big[164] = 0b1111111110100100; -+ big[165] = 0b1111111110100101; -+ big[166] = 0b1111111110100110; -+ big[167] = 0b1111111110100111; -+ big[168] = 0b1111111110101000; -+ big[169] = 0b1111111110101001; -+ big[170] = 0b1111111110101010; -+ big[171] = 0b1111111110101011; -+ big[172] = 0b1111111110101100; -+ big[173] = 0b1111111110101101; -+ big[174] = 0b1111111110101110; -+ big[175] = 0b1111111110101111; -+ big[176] = 0b1111111110110000; -+ big[177] = 0b1111111110110001; -+ big[178] = 0b1111111110110010; -+ big[179] = 0b1111111110110011; -+ big[180] = 0b1111111110110100; -+ big[181] = 0b1111111110110101; -+ big[182] = 0b1111111110110110; -+ big[183] = 0b1111111110110111; -+ big[184] = 0b1111111110111000; -+ big[185] = 0b1111111110111001; -+ big[186] = 0b1111111110111010; -+ big[187] = 0b1111111110111011; -+ big[188] = 0b1111111110111100; -+ big[189] = 0b1111111110111101; -+ big[190] = 0b1111111110111110; -+ big[191] = 0b1111111110111111; -+ big[192] = 0b1111111111000000; -+ big[193] = 0b1111111111000001; -+ big[194] = 0b1111111111000010; -+ big[195] = 0b1111111111000011; -+ big[196] = 0b1111111111000100; -+ big[197] = 0b1111111111000101; -+ big[198] = 0b1111111111000110; -+ big[199] = 0b1111111111000111; -+ big[200] = 0b1111111111001000; -+ big[201] = 0b1111111111001001; -+ big[202] = 0b1111111111001010; -+ big[203] = 0b1111111111001011; -+ big[204] = 0b1111111111001100; -+ big[205] = 0b1111111111001101; -+ big[206] = 0b1111111111001110; -+ big[207] = 0b1111111111001111; -+ big[208] = 0b1111111111010000; -+ big[209] = 0b1111111111010001; -+ big[210] = 0b1111111111010010; -+ big[211] = 0b1111111111010011; -+ big[212] = 0b1111111111010100; -+ big[213] = 0b1111111111010101; -+ big[214] = 0b1111111111010110; -+ big[215] = 0b1111111111010111; -+ big[216] = 0b1111111111011000; -+ big[217] = 0b1111111111011001; -+ big[218] = 0b1111111111011010; -+ big[219] = 0b1111111111011011; -+ big[220] = 0b1111111111011100; -+ big[221] = 0b1111111111011101; -+ big[222] = 0b1111111111011110; -+ big[223] = 0b1111111111011111; -+ big[224] = 0b1111111111100000; -+ big[225] = 0b1111111111100001; -+ big[226] = 0b1111111111100010; -+ big[227] = 0b1111111111100011; -+ big[228] = 0b1111111111100100; -+ big[229] = 0b1111111111100101; -+ big[230] = 0b1111111111100110; -+ big[231] = 0b1111111111100111; -+ big[232] = 0b1111111111101000; -+ big[233] = 0b1111111111101001; -+ big[234] = 0b1111111111101010; -+ big[235] = 0b1111111111101011; -+ big[236] = 0b1111111111101100; -+ big[237] = 0b1111111111101101; -+ big[238] = 0b1111111111101110; -+ big[239] = 0b1111111111101111; -+ big[240] = 0b1111111111110000; -+ big[241] = 0b1111111111110001; -+ big[242] = 0b1111111111110010; -+ big[243] = 0b1111111111110011; -+ big[244] = 0b1111111111110100; -+ big[245] = 0b1111111111110101; -+ big[246] = 0b1111111111110110; -+ big[247] = 0b1111111111110111; -+ big[248] = 0b1111111111111000; -+ big[249] = 0b1111111111111001; -+ big[250] = 0b1111111111111010; -+ big[251] = 0b1111111111111011; -+ big[252] = 0b1111111111111100; -+ big[253] = 0b1111111111111101; -+ big[254] = 0b1111111111111110; -+ big[255] = 0b1111111111111111; -+ -+ for (i = 0; i < 256; i++) { -+ if (big[i] != i + 65280U) -+ return 1; -+ } -+ -+ return 0; -+} --- -2.26.0 - diff --git a/0014-binlit-Add-a-few-random-leading-zeros.patch b/0014-binlit-Add-a-few-random-leading-zeros.patch deleted file mode 100644 index 87056b9..0000000 --- a/0014-binlit-Add-a-few-random-leading-zeros.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 1bfdce55edf0184ef9e9f8318977253da78c3748 Mon Sep 17 00:00:00 2001 -From: Lauri Kasanen -Date: Tue, 16 Jul 2019 19:06:34 +0300 -Subject: [PATCH 014/170] binlit: Add a few random leading zeros - ---- - test/val/binlit.c | 18 +++++++++--------- - 1 file changed, 9 insertions(+), 9 deletions(-) - -diff --git a/test/val/binlit.c b/test/val/binlit.c -index 2b6c1ca8..47e7a196 100644 ---- a/test/val/binlit.c -+++ b/test/val/binlit.c -@@ -12,21 +12,21 @@ int main() { - small[4] = 0b100; - small[5] = 0b101; - small[6] = 0b110; -- small[7] = 0b111; -+ small[7] = 0b000111; - small[8] = 0b1000; - small[9] = 0b1001; -- small[10] = 0b1010; -- small[11] = 0b1011; -+ small[10] = 0b0001010; -+ small[11] = 0b0001011; - small[12] = 0b1100; - small[13] = 0b1101; - small[14] = 0b1110; - small[15] = 0b1111; - small[16] = 0b10000; - small[17] = 0b10001; -- small[18] = 0b10010; -- small[19] = 0b10011; -- small[20] = 0b10100; -- small[21] = 0b10101; -+ small[18] = 0b00010010; -+ small[19] = 0b00010011; -+ small[20] = 0b00010100; -+ small[21] = 0b00010101; - small[22] = 0b10110; - small[23] = 0b10111; - small[24] = 0b11000; -@@ -37,8 +37,8 @@ int main() { - small[29] = 0b11101; - small[30] = 0b11110; - small[31] = 0b11111; -- small[32] = 0b100000; -- small[33] = 0b100001; -+ small[32] = 0b00000000100000; -+ small[33] = 0b00000000100001; - small[34] = 0b100010; - small[35] = 0b100011; - small[36] = 0b100100; --- -2.26.0 - diff --git a/0015-Document-binary-literals.patch b/0015-Document-binary-literals.patch deleted file mode 100644 index fff51e7..0000000 --- a/0015-Document-binary-literals.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 5cbbb4597fee58a1b22b751e9f3e49d53892f863 Mon Sep 17 00:00:00 2001 -From: Lauri Kasanen -Date: Wed, 17 Jul 2019 09:28:14 +0300 -Subject: [PATCH 015/170] Document binary literals - ---- - doc/cc65.sgml | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/doc/cc65.sgml b/doc/cc65.sgml -index 86b61ae4..601e364e 100644 ---- a/doc/cc65.sgml -+++ b/doc/cc65.sgml -@@ -814,6 +814,14 @@ This cc65 version has some extensions to the ISO C standard. - In the jump table, no expressions are supported. The array index - used in the goto must be a simple variable or a constant. - -+ Binary literals, a C++14 feature and a GCC C extension, are accepted. -+ They can be disabled with the option. -+ -+ -+ unsigned char foo = 0b101; // sets it to 5 -+ -+ - -

- --- -2.26.0 - diff --git a/0016-Fix-bug-gotoxy-does-not-working-because-Y-does-not-u.patch b/0016-Fix-bug-gotoxy-does-not-working-because-Y-does-not-u.patch deleted file mode 100644 index f0dc61c..0000000 --- a/0016-Fix-bug-gotoxy-does-not-working-because-Y-does-not-u.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 14ac1a7ff6cd26b862de76f4feab27be1f4974d4 Mon Sep 17 00:00:00 2001 -From: jede -Date: Wed, 3 Jul 2019 01:13:59 +0200 -Subject: [PATCH 016/170] Fix bug : gotoxy does not working because Y does not - update the adress on the screen - ---- - libsrc/telestrat/gotoxy.s | 20 +++++++++++++++++++- - 1 file changed, 19 insertions(+), 1 deletion(-) - -diff --git a/libsrc/telestrat/gotoxy.s b/libsrc/telestrat/gotoxy.s -index e1470f84..03d0a215 100644 ---- a/libsrc/telestrat/gotoxy.s -+++ b/libsrc/telestrat/gotoxy.s -@@ -18,9 +18,27 @@ gotoxy: jsr popa ; Get Y - - ; This function moves only the display cursor; it does not move the prompt position. - ; In telemon, there is a position for the prompt, and another for the cursor. -- - sta SCRY - jsr popa - sta SCRX -+ -+ lda #SCREEN -+ sta ADSCRL+1 -+ -+ ldy SCRY -+loop: -+ lda ADSCRL -+ clc -+ adc #$28 -+ bcc skip -+ inc ADSCRH -+skip: -+ sta ADSCRL -+ dey -+ bne loop -+ - rts - .endproc --- -2.26.0 - diff --git a/0017-Add-textcolor-and-bgcolor.s.patch b/0017-Add-textcolor-and-bgcolor.s.patch deleted file mode 100644 index 5302bba..0000000 --- a/0017-Add-textcolor-and-bgcolor.s.patch +++ /dev/null @@ -1,297 +0,0 @@ -From 7f9e73a1ce42ca5489f7b533d942a4d8b3193148 Mon Sep 17 00:00:00 2001 -From: jede -Date: Sat, 6 Jul 2019 10:16:57 +0200 -Subject: [PATCH 017/170] Add textcolor and bgcolor.s - ---- - asminc/telestrat.inc | 1 + - doc/telestrat.sgml | 10 ++++++++-- - libsrc/telestrat/bgcolor.s | 28 +++++++++++++++++++++++++++ - libsrc/telestrat/clrscr.s | 15 ++++++++++++--- - libsrc/telestrat/cputc.s | 37 +++++++++++++++++++++++++++++++++--- - libsrc/telestrat/gotoxy.s | 21 +++++++++++++++----- - libsrc/telestrat/gotoy.s | 3 ++- - libsrc/telestrat/textcolor.s | 28 +++++++++++++++++++++++++++ - 8 files changed, 129 insertions(+), 14 deletions(-) - create mode 100644 libsrc/telestrat/bgcolor.s - create mode 100644 libsrc/telestrat/textcolor.s - -diff --git a/asminc/telestrat.inc b/asminc/telestrat.inc -index 3526c6f9..2036574a 100644 ---- a/asminc/telestrat.inc -+++ b/asminc/telestrat.inc -@@ -286,6 +286,7 @@ XZAP = $46 ; Send Zap sound to PSG - XSHOOT = $47 - XMKDIR = $4B ; Create a folder. Only available in TELEMON 3.x (bank 7 of Orix) - XRM = $4D ; Remove a folder or a file. Only available in TELEMON 3.x (bank 7 of Orix) -+XFWR = $4E ; Put a char on the first screen. Only available in TELEMON 3.x (bank 7 of Orix) - XGOKBD = $52 - - ; Buffer management -diff --git a/doc/telestrat.sgml b/doc/telestrat.sgml -index e52b183d..0cb40c50 100644 ---- a/doc/telestrat.sgml -+++ b/doc/telestrat.sgml -@@ -212,7 +212,8 @@ RS232 port with Telemon calls (see XSOUT primitive for example) - Telemon 3.0 handles fopen, fread, fclose primitives. It means that this - function will crash the Telestrat because Telemon 2.4 does not have these - primitives. By the way, Telemon 3.0 uses an extension "ch376 card" which --handles sdcard and FAT 32 usb key. In the next version of Telemon, FT DOS, Sedoric, Stratsed will be handled in these 3 primitives (fopen, fread, fclose). -+handles sdcard and FAT 32 usb key. In the next version of Telemon, FT DOS, -+Sedoric, Stratsed will be handled in these 3 primitives (fopen, fread, fclose). - - - fclose -@@ -220,7 +221,12 @@ handles sdcard and FAT 32 usb key. In the next version of Telemon, FT DOS, Sedor - fread - - -- -+conio

-+Functions textcolor and bgcolor are available only with Telemon 3.0 (Orix). -+Telemon 2.4 primitives can't handle any change of colors in text mode except with XINK or -+XPAPER primitives which put on the first and second columns ink and paper attributes. -+The only way to change color on the same line for text is to handle it in pure assembly -+without systems calls. - - Other hints

- -diff --git a/libsrc/telestrat/bgcolor.s b/libsrc/telestrat/bgcolor.s -new file mode 100644 -index 00000000..4af0ef76 ---- /dev/null -+++ b/libsrc/telestrat/bgcolor.s -@@ -0,0 +1,28 @@ -+; 2019-07-02, Jede (jede@oric.org) -+; -+ -+ .export _bgcolor -+ .import BGCOLOR -+ .import BGCOLOR_CHANGE -+ .include "telestrat.inc" -+ -+.proc _bgcolor -+ cmp BGCOLOR ; Do we set the same color? if we don't detect it, we loose one char on the screen for each textcolor call with the same color -+ bne out ; Yes -+ lda #$00 -+ sta BGCOLOR_CHANGE -+ -+ lda BGCOLOR ; Return last color -+ -+ rts -+out: -+ ldx BGCOLOR ; Get last color in order to return it -+ sta BGCOLOR -+ -+ lda #$01 ; Notify the change color -+ sta BGCOLOR_CHANGE -+ txa ; Return previous color -+ rts -+.endproc -+ -+ -diff --git a/libsrc/telestrat/clrscr.s b/libsrc/telestrat/clrscr.s -index 1f90a7ca..a24647f8 100644 ---- a/libsrc/telestrat/clrscr.s -+++ b/libsrc/telestrat/clrscr.s -@@ -4,15 +4,15 @@ - - .export _clrscr - -- .importzp sp - -+ .import CHARCOLOR_CHANGE, CHARCOLOR, BGCOLOR, BGCOLOR_CHANGE - .include "telestrat.inc" - - .proc _clrscr - ; Switch to text mode - BRK_TELEMON(XTEXT) - -- lda #SCREEN - sta RES - sty RES+1 -@@ -20,7 +20,7 @@ - ldy #<(SCREEN+SCREEN_XSIZE*SCREEN_YSIZE) - ldx #>(SCREEN+SCREEN_XSIZE*SCREEN_YSIZE) - lda #' ' -- BRK_TELEMON XFILLM -+ BRK_TELEMON XFILLM ; Calls XFILLM : it fills A value from RES address and size of X and Y value - - - ; reset prompt position -@@ -34,5 +34,14 @@ - sta SCRY - lda #$00 - sta SCRX -+ -+ lda #$00 -+ sta CHARCOLOR_CHANGE -+ sta BGCOLOR_CHANGE -+ -+ lda #$07 -+ sta CHARCOLOR -+ sta BGCOLOR -+ - rts - .endproc -diff --git a/libsrc/telestrat/cputc.s b/libsrc/telestrat/cputc.s -index b4f2966a..f38db8a1 100644 ---- a/libsrc/telestrat/cputc.s -+++ b/libsrc/telestrat/cputc.s -@@ -4,12 +4,43 @@ - ; void cputc (char c); - ; - -- .export _cputc -+ .export _cputc, CHARCOLOR, CHARCOLOR_CHANGE, BGCOLOR, BGCOLOR_CHANGE - - .include "telestrat.inc" - - .proc _cputc -- BRK_TELEMON XWR0 ; macro send char to screen (channel 0 in telemon terms) -+ ldx CHARCOLOR_CHANGE -+ beq do_not_change_color_foreground -+ -+ pha -+ lda CHARCOLOR -+ BRK_TELEMON $4E ; Change color on the screen (foreground) -+ lda #$00 -+ sta CHARCOLOR_CHANGE -+ pla -+ -+do_not_change_color_foreground: -+ ldx BGCOLOR_CHANGE -+ beq do_not_change_color -+ -+ pha -+ lda BGCOLOR -+ ORA #%00010000 ; Add 16 because background color is an attribute between 16 and 23. 17 is red background for example -+ BRK_TELEMON XFWR ; Change color on the screen (background) -+ lda #$00 -+ sta BGCOLOR_CHANGE -+ -+ pla -+ -+do_not_change_color: -+ BRK_TELEMON XFWR ; Macro send char to screen (channel 0) - rts - .endproc -- -+CHARCOLOR: -+ .res 1 -+CHARCOLOR_CHANGE: -+ .res 1 -+BGCOLOR: -+ .res 1 -+BGCOLOR_CHANGE: -+ .res 1 -diff --git a/libsrc/telestrat/gotoxy.s b/libsrc/telestrat/gotoxy.s -index 03d0a215..0a3db00b 100644 ---- a/libsrc/telestrat/gotoxy.s -+++ b/libsrc/telestrat/gotoxy.s -@@ -5,10 +5,10 @@ - ; void gotoxy (unsigned char x, unsigned char y); - ; - -- .export gotoxy, _gotoxy -+ .export gotoxy, _gotoxy, _update_adscr -+ -+ .import popa,CHARCOLOR_CHANGE,BGCOLOR_CHANGE - -- .import popa -- .importzp sp - - .include "telestrat.inc" - -@@ -22,6 +22,16 @@ gotoxy: jsr popa ; Get Y - jsr popa - sta SCRX - -+ jsr _update_adscr ; Update adress video ram position when SCRY et SCRX are modified -+ ; Force to put again attribute when it moves on the screen -+ lda #$01 -+ sta CHARCOLOR_CHANGE -+ sta BGCOLOR_CHANGE -+ rts -+.endproc -+ -+ -+.proc _update_adscr - lda # -Date: Sat, 6 Jul 2019 10:19:45 +0200 -Subject: [PATCH 018/170] Fix gotoy changecolor - ---- - libsrc/telestrat/gotoy.s | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/libsrc/telestrat/gotoy.s b/libsrc/telestrat/gotoy.s -index c6010cc2..99ab3ec6 100644 ---- a/libsrc/telestrat/gotoy.s -+++ b/libsrc/telestrat/gotoy.s -@@ -10,5 +10,11 @@ - .proc _gotoy - sta SCRY - jsr _update_adscr -+ -+ ; We change the current line, it means that we need to put color attributes again. -+ ; That is not the case with _gotox because, it's on the same line attribute are already set -+ lda #$01 -+ sta CHARCOLOR_CHANGE -+ sta BGCOLOR_CHANGE - rts - .endproc --- -2.26.0 - diff --git a/0019-fix-typo.patch b/0019-fix-typo.patch deleted file mode 100644 index e40034f..0000000 --- a/0019-fix-typo.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 7767a0e88e28882c03e9072b72995205d30cd1ea Mon Sep 17 00:00:00 2001 -From: jede -Date: Sat, 6 Jul 2019 10:26:19 +0200 -Subject: [PATCH 019/170] fix typo - ---- - libsrc/telestrat/gotoxy.s | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/libsrc/telestrat/gotoxy.s b/libsrc/telestrat/gotoxy.s -index 0a3db00b..a73ab5ff 100644 ---- a/libsrc/telestrat/gotoxy.s -+++ b/libsrc/telestrat/gotoxy.s -@@ -7,8 +7,7 @@ - - .export gotoxy, _gotoxy, _update_adscr - -- .import popa,CHARCOLOR_CHANGE,BGCOLOR_CHANGE -- -+ .import popa, CHARCOLOR_CHANGE, BGCOLOR_CHANGE - - .include "telestrat.inc" - --- -2.26.0 - diff --git a/0020-fix-import.patch b/0020-fix-import.patch deleted file mode 100644 index c837333..0000000 --- a/0020-fix-import.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 28eba8bff9688173257a7c537b3e2533cf1e7012 Mon Sep 17 00:00:00 2001 -From: jede -Date: Sat, 6 Jul 2019 10:33:39 +0200 -Subject: [PATCH 020/170] fix import - ---- - libsrc/telestrat/gotoxy.s | 2 +- - libsrc/telestrat/gotoy.s | 1 + - 2 files changed, 2 insertions(+), 1 deletion(-) - -diff --git a/libsrc/telestrat/gotoxy.s b/libsrc/telestrat/gotoxy.s -index a73ab5ff..73e7d272 100644 ---- a/libsrc/telestrat/gotoxy.s -+++ b/libsrc/telestrat/gotoxy.s -@@ -35,7 +35,7 @@ gotoxy: jsr popa ; Get Y - sta ADSCRL - - lda #>SCREEN -- sta ADSCRL+1 -+ sta ADSCRH - - ldy SCRY - beq out -diff --git a/libsrc/telestrat/gotoy.s b/libsrc/telestrat/gotoy.s -index 99ab3ec6..ee437f00 100644 ---- a/libsrc/telestrat/gotoy.s -+++ b/libsrc/telestrat/gotoy.s -@@ -2,6 +2,7 @@ - ; jede jede@oric.org 2017-02-25 - ; - .export _gotoy -+ .import CHARCOLOR_CHANGE, BGCOLOR_CHANGE - - .import _update_adscr - --- -2.26.0 - diff --git a/0021-Fix-typo-and-optimize.patch b/0021-Fix-typo-and-optimize.patch deleted file mode 100644 index e0abe08..0000000 --- a/0021-Fix-typo-and-optimize.patch +++ /dev/null @@ -1,169 +0,0 @@ -From a0a6537bdaa29743ceea170ee4884ab018da7369 Mon Sep 17 00:00:00 2001 -From: jede -Date: Sun, 7 Jul 2019 22:02:48 +0200 -Subject: [PATCH 021/170] Fix typo and optimize - ---- - libsrc/telestrat/bgcolor.s | 9 +++------ - libsrc/telestrat/cputc.s | 7 +++++-- - libsrc/telestrat/gotoxy.s | 8 ++++---- - libsrc/telestrat/gotoy.s | 4 ++-- - libsrc/telestrat/textcolor.s | 15 +++++++-------- - 5 files changed, 21 insertions(+), 22 deletions(-) - -diff --git a/libsrc/telestrat/bgcolor.s b/libsrc/telestrat/bgcolor.s -index 4af0ef76..14ecf4bd 100644 ---- a/libsrc/telestrat/bgcolor.s -+++ b/libsrc/telestrat/bgcolor.s -@@ -7,12 +7,11 @@ - .include "telestrat.inc" - - .proc _bgcolor -- cmp BGCOLOR ; Do we set the same color? if we don't detect it, we loose one char on the screen for each textcolor call with the same color -+ cmp BGCOLOR ; Do we set the same color? If we don't detect it, we loose one char on the screen for each bgcolor call with the same color - bne out ; Yes -- lda #$00 -- sta BGCOLOR_CHANGE - -- lda BGCOLOR ; Return last color -+ ldy #$00 -+ sty BGCOLOR_CHANGE - - rts - out: -@@ -24,5 +23,3 @@ out: - txa ; Return previous color - rts - .endproc -- -- -diff --git a/libsrc/telestrat/cputc.s b/libsrc/telestrat/cputc.s -index f38db8a1..96763caf 100644 ---- a/libsrc/telestrat/cputc.s -+++ b/libsrc/telestrat/cputc.s -@@ -11,18 +11,20 @@ - .proc _cputc - ldx CHARCOLOR_CHANGE - beq do_not_change_color_foreground -- -+ dec SCRX -+ dec SCRX - pha - lda CHARCOLOR - BRK_TELEMON $4E ; Change color on the screen (foreground) - lda #$00 - sta CHARCOLOR_CHANGE -+ inc SCRX - pla - - do_not_change_color_foreground: - ldx BGCOLOR_CHANGE - beq do_not_change_color -- -+ dec SCRX ; Dec SCRX in order to place attribute before the right position - pha - lda BGCOLOR - ORA #%00010000 ; Add 16 because background color is an attribute between 16 and 23. 17 is red background for example -@@ -36,6 +38,7 @@ do_not_change_color: - BRK_TELEMON XFWR ; Macro send char to screen (channel 0) - rts - .endproc -+.bss - CHARCOLOR: - .res 1 - CHARCOLOR_CHANGE: -diff --git a/libsrc/telestrat/gotoxy.s b/libsrc/telestrat/gotoxy.s -index 73e7d272..8dcb69e8 100644 ---- a/libsrc/telestrat/gotoxy.s -+++ b/libsrc/telestrat/gotoxy.s -@@ -5,7 +5,7 @@ - ; void gotoxy (unsigned char x, unsigned char y); - ; - -- .export gotoxy, _gotoxy, _update_adscr -+ .export gotoxy, _gotoxy, update_adscr - - .import popa, CHARCOLOR_CHANGE, BGCOLOR_CHANGE - -@@ -21,7 +21,7 @@ gotoxy: jsr popa ; Get Y - jsr popa - sta SCRX - -- jsr _update_adscr ; Update adress video ram position when SCRY et SCRX are modified -+ jsr update_adscr ; Update adress video ram position when SCRY et SCRX are modified - ; Force to put again attribute when it moves on the screen - lda #$01 - sta CHARCOLOR_CHANGE -@@ -30,7 +30,7 @@ gotoxy: jsr popa ; Get Y - .endproc - - --.proc _update_adscr -+.proc update_adscr - lda # -Date: Wed, 10 Jul 2019 21:44:07 +0200 -Subject: [PATCH 022/170] Fix label, optimize code - ---- - libsrc/telestrat/clrscr.s | 15 +++++++-------- - libsrc/telestrat/cputc.s | 2 +- - libsrc/telestrat/gotoxy.s | 9 ++++++--- - libsrc/telestrat/gotoy.s | 4 ---- - libsrc/telestrat/textcolor.s | 4 ++-- - 5 files changed, 16 insertions(+), 18 deletions(-) - -diff --git a/libsrc/telestrat/clrscr.s b/libsrc/telestrat/clrscr.s -index a24647f8..22a88012 100644 ---- a/libsrc/telestrat/clrscr.s -+++ b/libsrc/telestrat/clrscr.s -@@ -30,14 +30,13 @@ - sta ADSCRH - - ; reset display position -- lda #$01 -- sta SCRY -- lda #$00 -- sta SCRX -- -- lda #$00 -- sta CHARCOLOR_CHANGE -- sta BGCOLOR_CHANGE -+ ldx #$01 -+ stx SCRY -+ dex -+ stx SCRX -+ -+ stx CHARCOLOR_CHANGE -+ stx BGCOLOR_CHANGE - - lda #$07 - sta CHARCOLOR -diff --git a/libsrc/telestrat/cputc.s b/libsrc/telestrat/cputc.s -index 96763caf..d313d778 100644 ---- a/libsrc/telestrat/cputc.s -+++ b/libsrc/telestrat/cputc.s -@@ -15,7 +15,7 @@ - dec SCRX - pha - lda CHARCOLOR -- BRK_TELEMON $4E ; Change color on the screen (foreground) -+ BRK_TELEMON XFWR ; Change color on the screen (foreground) - lda #$00 - sta CHARCOLOR_CHANGE - inc SCRX -diff --git a/libsrc/telestrat/gotoxy.s b/libsrc/telestrat/gotoxy.s -index 8dcb69e8..7a53a77a 100644 ---- a/libsrc/telestrat/gotoxy.s -+++ b/libsrc/telestrat/gotoxy.s -@@ -23,14 +23,17 @@ gotoxy: jsr popa ; Get Y - - jsr update_adscr ; Update adress video ram position when SCRY et SCRX are modified - ; Force to put again attribute when it moves on the screen -- lda #$01 -- sta CHARCOLOR_CHANGE -- sta BGCOLOR_CHANGE -+ - rts - .endproc - - - .proc update_adscr -+ -+ lda #$01 -+ sta CHARCOLOR_CHANGE -+ sta BGCOLOR_CHANGE -+ - lda # -Date: Wed, 17 Jul 2019 21:48:53 +0200 -Subject: [PATCH 023/170] Fix bug with bgcolor and textcolor - ---- - libsrc/telestrat/bgcolor.s | 15 +-------- - libsrc/telestrat/clrscr.s | 14 ++++---- - libsrc/telestrat/cputc.s | 31 +++++++++-------- - libsrc/telestrat/gotox.s | 5 --- - libsrc/telestrat/gotoxy.s | 64 +++++++++++++++++++----------------- - libsrc/telestrat/gotoy.s | 9 ++--- - libsrc/telestrat/textcolor.s | 16 --------- - 7 files changed, 62 insertions(+), 92 deletions(-) - -diff --git a/libsrc/telestrat/bgcolor.s b/libsrc/telestrat/bgcolor.s -index 14ecf4bd..2f602922 100644 ---- a/libsrc/telestrat/bgcolor.s -+++ b/libsrc/telestrat/bgcolor.s -@@ -3,23 +3,10 @@ - - .export _bgcolor - .import BGCOLOR -- .import BGCOLOR_CHANGE -+ - .include "telestrat.inc" - - .proc _bgcolor -- cmp BGCOLOR ; Do we set the same color? If we don't detect it, we loose one char on the screen for each bgcolor call with the same color -- bne out ; Yes -- -- ldy #$00 -- sty BGCOLOR_CHANGE -- -- rts --out: -- ldx BGCOLOR ; Get last color in order to return it - sta BGCOLOR -- -- lda #$01 ; Notify the change color -- sta BGCOLOR_CHANGE -- txa ; Return previous color - rts - .endproc -diff --git a/libsrc/telestrat/clrscr.s b/libsrc/telestrat/clrscr.s -index 22a88012..f44000d1 100644 ---- a/libsrc/telestrat/clrscr.s -+++ b/libsrc/telestrat/clrscr.s -@@ -3,9 +3,8 @@ - ; - - .export _clrscr -- -- -- .import CHARCOLOR_CHANGE, CHARCOLOR, BGCOLOR, BGCOLOR_CHANGE -+ .import OLD_CHARCOLOR, OLD_BGCOLOR, CHARCOLOR, BGCOLOR -+ - .include "telestrat.inc" - - .proc _clrscr -@@ -34,13 +33,14 @@ - stx SCRY - dex - stx SCRX -- -- stx CHARCOLOR_CHANGE -- stx BGCOLOR_CHANGE -+ -+ ; X is equal to 0 -+ stx BGCOLOR -+ stx OLD_BGCOLOR - - lda #$07 - sta CHARCOLOR -- sta BGCOLOR -+ sta OLD_CHARCOLOR - - rts - .endproc -diff --git a/libsrc/telestrat/cputc.s b/libsrc/telestrat/cputc.s -index d313d778..4b8e4fef 100644 ---- a/libsrc/telestrat/cputc.s -+++ b/libsrc/telestrat/cputc.s -@@ -4,34 +4,39 @@ - ; void cputc (char c); - ; - -- .export _cputc, CHARCOLOR, CHARCOLOR_CHANGE, BGCOLOR, BGCOLOR_CHANGE -+ .export _cputc, CHARCOLOR, OLD_CHARCOLOR, BGCOLOR, OLD_BGCOLOR - - .include "telestrat.inc" - - .proc _cputc -- ldx CHARCOLOR_CHANGE -+ ldx CHARCOLOR -+ cpx OLD_CHARCOLOR - beq do_not_change_color_foreground -+ -+ stx OLD_CHARCOLOR ; Store CHARCOLOR into OLD_CHARCOLOR -+ - dec SCRX - dec SCRX -+ - pha -- lda CHARCOLOR -+ txa ; Swap X to A because, X contains CHARCOLOR - BRK_TELEMON XFWR ; Change color on the screen (foreground) -- lda #$00 -- sta CHARCOLOR_CHANGE - inc SCRX - pla - - do_not_change_color_foreground: -- ldx BGCOLOR_CHANGE -+ ldx BGCOLOR -+ cpx OLD_BGCOLOR - beq do_not_change_color -+ -+ stx OLD_BGCOLOR -+ - dec SCRX ; Dec SCRX in order to place attribute before the right position -+ - pha -- lda BGCOLOR -+ txa ; Swap X to A because, X contains CHARCOLOR - ORA #%00010000 ; Add 16 because background color is an attribute between 16 and 23. 17 is red background for example - BRK_TELEMON XFWR ; Change color on the screen (background) -- lda #$00 -- sta BGCOLOR_CHANGE -- - pla - - do_not_change_color: -@@ -41,9 +46,9 @@ do_not_change_color: - .bss - CHARCOLOR: - .res 1 --CHARCOLOR_CHANGE: -+OLD_CHARCOLOR: - .res 1 - BGCOLOR: -- .res 1 --BGCOLOR_CHANGE: - .res 1 -+OLD_BGCOLOR: -+ .res 1 -diff --git a/libsrc/telestrat/gotox.s b/libsrc/telestrat/gotox.s -index f16c05b7..cd8828d6 100644 ---- a/libsrc/telestrat/gotox.s -+++ b/libsrc/telestrat/gotox.s -@@ -3,13 +3,8 @@ - ; - .export _gotox - -- .import popa -- -- .importzp sp -- - .include "telestrat.inc" - -- - .proc _gotox - sta SCRX - rts -diff --git a/libsrc/telestrat/gotoxy.s b/libsrc/telestrat/gotoxy.s -index 7a53a77a..04a680e6 100644 ---- a/libsrc/telestrat/gotoxy.s -+++ b/libsrc/telestrat/gotoxy.s -@@ -7,7 +7,7 @@ - - .export gotoxy, _gotoxy, update_adscr - -- .import popa, CHARCOLOR_CHANGE, BGCOLOR_CHANGE -+ .import popa, OLD_CHARCOLOR, OLD_BGCOLOR - - .include "telestrat.inc" - -@@ -17,41 +17,43 @@ gotoxy: jsr popa ; Get Y - - ; This function moves only the display cursor; it does not move the prompt position. - ; In telemon, there is a position for the prompt, and another for the cursor. -- sta SCRY -- jsr popa -- sta SCRX -- -- jsr update_adscr ; Update adress video ram position when SCRY et SCRX are modified -- ; Force to put again attribute when it moves on the screen -- -- rts --.endproc -- -- --.proc update_adscr - -- lda #$01 -- sta CHARCOLOR_CHANGE -- sta BGCOLOR_CHANGE -+ sta SCRY -+ jsr update_adscr ; Update adress video ram position when SCRY is modified - -- lda #SCREEN -- sta ADSCRH -+ rts -+.endproc - -- ldy SCRY -- beq out -+.proc update_adscr -+; Force to set again color if cursor moves -+; $FF is used because we know that it's impossible to have this value with a color -+; It prevents a bug : If bgcolor or textcolor is set to black for example with no char displays, -+; next cputsxy will not set the attribute if y coordinate changes -+ lda #$FF -+ sta OLD_CHARCOLOR -+ sta OLD_BGCOLOR -+ -+ lda #SCREEN -+ sta ADSCRH -+ -+ ldy SCRY -+ beq out - loop: -- lda ADSCRL -- clc -- adc #$28 -- bcc skip -- inc ADSCRH -+ lda ADSCRL -+ clc -+ adc #$28 -+ bcc skip -+ inc ADSCRH - skip: -- sta ADSCRL -- dey -- bne loop -+ sta ADSCRL -+ dey -+ bne loop - out: -- rts -+ rts - .endproc -diff --git a/libsrc/telestrat/gotoy.s b/libsrc/telestrat/gotoy.s -index 13be8e42..182e3f74 100644 ---- a/libsrc/telestrat/gotoy.s -+++ b/libsrc/telestrat/gotoy.s -@@ -8,10 +8,7 @@ - .include "telestrat.inc" - - .proc _gotoy -- sta SCRY -- jsr update_adscr -- -- ; We change the current line, it means that we need to put color attributes again. -- ; That is not the case with _gotox because, it's on the same line attribute are already set -- rts -+ sta SCRY -+ jsr update_adscr -+ rts - .endproc -diff --git a/libsrc/telestrat/textcolor.s b/libsrc/telestrat/textcolor.s -index ee6ba729..77bf6c71 100644 ---- a/libsrc/telestrat/textcolor.s -+++ b/libsrc/telestrat/textcolor.s -@@ -3,25 +3,9 @@ - - .export _textcolor - .import CHARCOLOR -- .import CHARCOLOR_CHANGE - .include "telestrat.inc" - - .proc _textcolor -- cmp CHARCOLOR ; Do we set the same color? If we don't detect it, we loose one char on the screen for each textcolor call with the same color -- bne out ; yes -- -- ldy #$00 -- sty CHARCOLOR_CHANGE -- -- ; Return last color -- -- rts --out: -- ldx CHARCOLOR ; Get last color in order to return it - sta CHARCOLOR -- -- lda #$01 -- sta CHARCOLOR_CHANGE -- txa ; Return previous color - rts - .endproc --- -2.26.0 - diff --git a/0024-jmp-instead-of-jsr.patch b/0024-jmp-instead-of-jsr.patch deleted file mode 100644 index cd81889..0000000 --- a/0024-jmp-instead-of-jsr.patch +++ /dev/null @@ -1,45 +0,0 @@ -From f9e13abc11ed85418e288eefdfb031766ee90b3b Mon Sep 17 00:00:00 2001 -From: jede -Date: Wed, 17 Jul 2019 22:53:49 +0200 -Subject: [PATCH 024/170] jmp instead of jsr - ---- - libsrc/telestrat/gotoxy.s | 5 +++-- - libsrc/telestrat/gotoy.s | 3 +-- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/libsrc/telestrat/gotoxy.s b/libsrc/telestrat/gotoxy.s -index 04a680e6..890970eb 100644 ---- a/libsrc/telestrat/gotoxy.s -+++ b/libsrc/telestrat/gotoxy.s -@@ -19,12 +19,13 @@ gotoxy: jsr popa ; Get Y - ; In telemon, there is a position for the prompt, and another for the cursor. - - sta SCRY -- jsr update_adscr ; Update adress video ram position when SCRY is modified -+ - - jsr popa - sta SCRX - -- rts -+ jmp update_adscr ; Update adress video ram position when SCRY is modified -+ - .endproc - - .proc update_adscr -diff --git a/libsrc/telestrat/gotoy.s b/libsrc/telestrat/gotoy.s -index 182e3f74..008d4413 100644 ---- a/libsrc/telestrat/gotoy.s -+++ b/libsrc/telestrat/gotoy.s -@@ -9,6 +9,5 @@ - - .proc _gotoy - sta SCRY -- jsr update_adscr -- rts -+ jmp update_adscr - .endproc --- -2.26.0 - diff --git a/0025-Fix-bgcolor-and-textcolor-must-return-last-color-jmp.patch b/0025-Fix-bgcolor-and-textcolor-must-return-last-color-jmp.patch deleted file mode 100644 index a4c2f1d..0000000 --- a/0025-Fix-bgcolor-and-textcolor-must-return-last-color-jmp.patch +++ /dev/null @@ -1,85 +0,0 @@ -From 0fe98a7ca862d42456a5b9cdba4daf22b94de843 Mon Sep 17 00:00:00 2001 -From: jede -Date: Thu, 18 Jul 2019 20:48:10 +0200 -Subject: [PATCH 025/170] Fix bgcolor and textcolor must return last color, jmp - remove. - ---- - libsrc/telestrat/bgcolor.s | 2 ++ - libsrc/telestrat/clrscr.s | 8 ++------ - libsrc/telestrat/gotoxy.s | 6 +++--- - libsrc/telestrat/textcolor.s | 2 ++ - 4 files changed, 9 insertions(+), 9 deletions(-) - -diff --git a/libsrc/telestrat/bgcolor.s b/libsrc/telestrat/bgcolor.s -index 2f602922..90a63e6d 100644 ---- a/libsrc/telestrat/bgcolor.s -+++ b/libsrc/telestrat/bgcolor.s -@@ -7,6 +7,8 @@ - .include "telestrat.inc" - - .proc _bgcolor -+ ldx BGCOLOR ; Get previous color - sta BGCOLOR -+ txa ; Return previous color - rts - .endproc -diff --git a/libsrc/telestrat/clrscr.s b/libsrc/telestrat/clrscr.s -index f44000d1..52f34dca 100644 ---- a/libsrc/telestrat/clrscr.s -+++ b/libsrc/telestrat/clrscr.s -@@ -34,12 +34,8 @@ - dex - stx SCRX - -- ; X is equal to 0 -- stx BGCOLOR -- stx OLD_BGCOLOR -- -- lda #$07 -- sta CHARCOLOR -+ lda #$FF -+ sta OLD_BGCOLOR - sta OLD_CHARCOLOR - - rts -diff --git a/libsrc/telestrat/gotoxy.s b/libsrc/telestrat/gotoxy.s -index 890970eb..3387efe4 100644 ---- a/libsrc/telestrat/gotoxy.s -+++ b/libsrc/telestrat/gotoxy.s -@@ -24,8 +24,8 @@ gotoxy: jsr popa ; Get Y - jsr popa - sta SCRX - -- jmp update_adscr ; Update adress video ram position when SCRY is modified -- -+; Update adress video ram position when SCRY is modified (update_adscr) -+; Fall through - .endproc - - .proc update_adscr -@@ -48,7 +48,7 @@ gotoxy: jsr popa ; Get Y - loop: - lda ADSCRL - clc -- adc #$28 -+ adc #SCREEN_XSIZE - bcc skip - inc ADSCRH - skip: -diff --git a/libsrc/telestrat/textcolor.s b/libsrc/telestrat/textcolor.s -index 77bf6c71..7d16c9e1 100644 ---- a/libsrc/telestrat/textcolor.s -+++ b/libsrc/telestrat/textcolor.s -@@ -6,6 +6,8 @@ - .include "telestrat.inc" - - .proc _textcolor -+ ldx CHARCOLOR ; Get previous color - sta CHARCOLOR -+ txa ; Return previous color - rts - .endproc --- -2.26.0 - diff --git a/0026-Optimize-Clrscr.patch b/0026-Optimize-Clrscr.patch deleted file mode 100644 index 7d3b818..0000000 --- a/0026-Optimize-Clrscr.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 848df36f6b766835f6a560447341037448d54478 Mon Sep 17 00:00:00 2001 -From: jede -Date: Sun, 21 Jul 2019 10:56:32 +0200 -Subject: [PATCH 026/170] Optimize Clrscr - ---- - libsrc/telestrat/clrscr.s | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libsrc/telestrat/clrscr.s b/libsrc/telestrat/clrscr.s -index 52f34dca..2adc905b 100644 ---- a/libsrc/telestrat/clrscr.s -+++ b/libsrc/telestrat/clrscr.s -@@ -34,7 +34,7 @@ - dex - stx SCRX - -- lda #$FF -+ dex - sta OLD_BGCOLOR - sta OLD_CHARCOLOR - --- -2.26.0 - diff --git a/0027-Cleaning-import-variables.patch b/0027-Cleaning-import-variables.patch deleted file mode 100644 index 3e7f57a..0000000 --- a/0027-Cleaning-import-variables.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 996537282c6c9c3eb4565f03ce8653c5889bbab1 Mon Sep 17 00:00:00 2001 -From: jede -Date: Sun, 21 Jul 2019 10:57:17 +0200 -Subject: [PATCH 027/170] Cleaning import variables - ---- - libsrc/telestrat/clrscr.s | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libsrc/telestrat/clrscr.s b/libsrc/telestrat/clrscr.s -index 2adc905b..aa2eae68 100644 ---- a/libsrc/telestrat/clrscr.s -+++ b/libsrc/telestrat/clrscr.s -@@ -3,7 +3,7 @@ - ; - - .export _clrscr -- .import OLD_CHARCOLOR, OLD_BGCOLOR, CHARCOLOR, BGCOLOR -+ .import OLD_CHARCOLOR, OLD_BGCOLOR - - .include "telestrat.inc" - --- -2.26.0 - diff --git a/0028-Fix-comment-and-gotox-force-colour-change.patch b/0028-Fix-comment-and-gotox-force-colour-change.patch deleted file mode 100644 index 366cc18..0000000 --- a/0028-Fix-comment-and-gotox-force-colour-change.patch +++ /dev/null @@ -1,46 +0,0 @@ -From e7bb0aad19ca0636e1fba54c6f9b7dae55f91e08 Mon Sep 17 00:00:00 2001 -From: jede -Date: Sun, 21 Jul 2019 11:01:14 +0200 -Subject: [PATCH 028/170] Fix comment and gotox force colour change - ---- - libsrc/telestrat/cputc.s | 2 +- - libsrc/telestrat/gotox.s | 5 +++++ - 2 files changed, 6 insertions(+), 1 deletion(-) - -diff --git a/libsrc/telestrat/cputc.s b/libsrc/telestrat/cputc.s -index 4b8e4fef..38f8af84 100644 ---- a/libsrc/telestrat/cputc.s -+++ b/libsrc/telestrat/cputc.s -@@ -34,7 +34,7 @@ do_not_change_color_foreground: - dec SCRX ; Dec SCRX in order to place attribute before the right position - - pha -- txa ; Swap X to A because, X contains CHARCOLOR -+ txa ; Swap X to A because, X contains BGCOLOR - ORA #%00010000 ; Add 16 because background color is an attribute between 16 and 23. 17 is red background for example - BRK_TELEMON XFWR ; Change color on the screen (background) - pla -diff --git a/libsrc/telestrat/gotox.s b/libsrc/telestrat/gotox.s -index cd8828d6..7a172071 100644 ---- a/libsrc/telestrat/gotox.s -+++ b/libsrc/telestrat/gotox.s -@@ -2,10 +2,15 @@ - ; jede jede@oric.org 2017-02-25 - ; - .export _gotox -+ .import OLD_CHARCOLOR, OLD_BGCOLOR - - .include "telestrat.inc" - - .proc _gotox - sta SCRX -+ -+ lda #$FF -+ sta OLD_CHARCOLOR -+ sta OLD_BGCOLOR - rts - .endproc --- -2.26.0 - diff --git a/0029-Fix-bug-FF.patch b/0029-Fix-bug-FF.patch deleted file mode 100644 index f4a2b1f..0000000 --- a/0029-Fix-bug-FF.patch +++ /dev/null @@ -1,30 +0,0 @@ -From cceffbdb8c5f90302d0a89f6524fe71dd5489001 Mon Sep 17 00:00:00 2001 -From: jede -Date: Sun, 21 Jul 2019 18:38:17 +0200 -Subject: [PATCH 029/170] Fix bug $FF - ---- - libsrc/telestrat/clrscr.s | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/libsrc/telestrat/clrscr.s b/libsrc/telestrat/clrscr.s -index aa2eae68..39c2f772 100644 ---- a/libsrc/telestrat/clrscr.s -+++ b/libsrc/telestrat/clrscr.s -@@ -34,9 +34,11 @@ - dex - stx SCRX - -+ ; At this step X is equal to $00 - dex -- sta OLD_BGCOLOR -- sta OLD_CHARCOLOR -+ ; At this step X is equal to $FF -+ stx OLD_BGCOLOR -+ stx OLD_CHARCOLOR - - rts - .endproc --- -2.26.0 - diff --git a/0030-Allowed-old-style-K-and-R-function-declarations-to-b.patch b/0030-Allowed-old-style-K-and-R-function-declarations-to-b.patch deleted file mode 100644 index bdb7081..0000000 --- a/0030-Allowed-old-style-K-and-R-function-declarations-to-b.patch +++ /dev/null @@ -1,382 +0,0 @@ -From a0db846a9772ef82cf7163670e7a2fc109ec4b53 Mon Sep 17 00:00:00 2001 -From: Greg King -Date: Mon, 22 Jul 2019 09:05:01 -0400 -Subject: [PATCH 030/170] Allowed old-style (K and R) function declarations to - be fastcall. - -That lets them match old-style definitions. It avoids "Type conflict" error messages. It allows shorter function calls. - -Fixed the types of some variables in "test/ref/otccex.c". It avoids crashes on 64-bit Windows (32-bit Windows with 64-bit pointers). ---- - doc/cc65-intern.sgml | 12 ++++---- - src/cc65/compile.c | 3 +- - src/cc65/declare.c | 20 ++++++------- - src/cc65/expr.c | 17 +++++++---- - test/ref/Makefile | 10 ------- - test/ref/otccex.c | 69 ++++++++++++++++++++++++-------------------- - test/val/Makefile | 10 ------- - 7 files changed, 66 insertions(+), 75 deletions(-) - -diff --git a/doc/cc65-intern.sgml b/doc/cc65-intern.sgml -index ec6c48ca..8e36578b 100644 ---- a/doc/cc65-intern.sgml -+++ b/doc/cc65-intern.sgml -@@ -42,7 +42,7 @@ The standard compliant variations Prologue, before the function call

-@@ -61,8 +61,8 @@ The rightmost parameter will have the lowest address on the stack, - and multi-byte parameters will have their least significant byte at the lower address. - - The -@@ -108,8 +108,9 @@ The C-stack pointer -- -diff --git a/src/cc65/compile.c b/src/cc65/compile.c -index bf9ada83..d914afb9 100644 ---- a/src/cc65/compile.c -+++ b/src/cc65/compile.c -@@ -171,8 +171,9 @@ static void Parse (void) - (CurTok.Tok != TOK_SEMI)) { - - FuncDesc* D = GetFuncDesc (Decl.Type); -+ - if (D->Flags & FD_EMPTY) { -- D->Flags = (D->Flags & ~(FD_EMPTY | FD_VARIADIC)) | FD_VOID_PARAM; -+ D->Flags = (D->Flags & ~FD_EMPTY) | FD_VOID_PARAM; - } - } - -diff --git a/src/cc65/declare.c b/src/cc65/declare.c -index e3b5edfe..35ce5d0b 100644 ---- a/src/cc65/declare.c -+++ b/src/cc65/declare.c -@@ -1132,7 +1132,7 @@ static Type* ParamTypeCvt (Type* T) - - - static void ParseOldStyleParamList (FuncDesc* F) --/* Parse an old style (K&R) parameter list */ -+/* Parse an old-style (K&R) parameter list */ - { - /* Some fix point tokens that are used for error recovery */ - static const token_t TokenList[] = { TOK_COMMA, TOK_RPAREN, TOK_SEMI }; -@@ -1234,7 +1234,7 @@ static void ParseOldStyleParamList (FuncDesc* F) - - - static void ParseAnsiParamList (FuncDesc* F) --/* Parse a new style (ANSI) parameter list */ -+/* Parse a new-style (ANSI) parameter list */ - { - /* Parse params */ - while (CurTok.Tok != TOK_RPAREN) { -@@ -1330,32 +1330,30 @@ static FuncDesc* ParseFuncDecl (void) - - /* Check for several special parameter lists */ - if (CurTok.Tok == TOK_RPAREN) { -- /* Parameter list is empty */ -- F->Flags |= (FD_EMPTY | FD_VARIADIC); -+ /* Parameter list is empty (K&R-style) */ -+ F->Flags |= FD_EMPTY; - } else if (CurTok.Tok == TOK_VOID && NextTok.Tok == TOK_RPAREN) { - /* Parameter list declared as void */ - NextToken (); - F->Flags |= FD_VOID_PARAM; - } else if (CurTok.Tok == TOK_IDENT && - (NextTok.Tok == TOK_COMMA || NextTok.Tok == TOK_RPAREN)) { -- /* If the identifier is a typedef, we have a new style parameter list, -- ** if it's some other identifier, it's an old style parameter list. -+ /* If the identifier is a typedef, we have a new-style parameter list; -+ ** if it's some other identifier, it's an old-style parameter list. - */ - Sym = FindSym (CurTok.Ident); - if (Sym == 0 || !SymIsTypeDef (Sym)) { -- /* Old style (K&R) function. */ -+ /* Old-style (K&R) function. */ - F->Flags |= FD_OLDSTYLE; - } - } - - /* Parse params */ - if ((F->Flags & FD_OLDSTYLE) == 0) { -- -- /* New style function */ -+ /* New-style function */ - ParseAnsiParamList (F); -- - } else { -- /* Old style function */ -+ /* Old-style function */ - ParseOldStyleParamList (F); - } - -diff --git a/src/cc65/expr.c b/src/cc65/expr.c -index e6522f94..904c3af0 100644 ---- a/src/cc65/expr.c -+++ b/src/cc65/expr.c -@@ -359,8 +359,8 @@ static unsigned FunctionParamList (FuncDesc* Func, int IsFastcall) - CHECK ((Param->Flags & SC_PARAM) != 0); - } - } else if (!Ellipsis) { -- /* Too many arguments. Do we have an open param list? */ -- if ((Func->Flags & FD_VARIADIC) == 0) { -+ /* Too many arguments. Do we have an open or empty param. list? */ -+ if ((Func->Flags & (FD_VARIADIC | FD_EMPTY)) == 0) { - /* End of param list reached, no ellipsis */ - Error ("Too many arguments in function call"); - } -@@ -401,8 +401,9 @@ static unsigned FunctionParamList (FuncDesc* Func, int IsFastcall) - Flags |= TypeOf (Expr.Type); - - /* If this is a fastcall function, don't push the last argument */ -- if (ParamCount != Func->ParamCount || !IsFastcall) { -+ if ((CurTok.Tok == TOK_COMMA && NextTok.Tok != TOK_RPAREN) || !IsFastcall) { - unsigned ArgSize = sizeofarg (Flags); -+ - if (FrameSize > 0) { - /* We have the space already allocated, store in the frame. - ** Because of invalid type conversions (that have produced an -@@ -472,8 +473,14 @@ static void FunctionCall (ExprDesc* Expr) - /* Handle function pointers transparently */ - IsFuncPtr = IsTypeFuncPtr (Expr->Type); - if (IsFuncPtr) { -- /* Check whether it's a fastcall function that has parameters */ -- IsFastcall = (Func->Flags & FD_VARIADIC) == 0 && Func->ParamCount > 0 && -+ /* Check whether it's a fastcall function that has parameters. -+ ** Note: if a function is forward-declared in the old K & R style, then -+ ** it may be called with any number of arguments, even though its -+ ** parameter count is zero. Handle K & R functions as though there are -+ ** parameters. -+ */ -+ IsFastcall = (Func->Flags & FD_VARIADIC) == 0 && -+ (Func->ParamCount > 0 || (Func->Flags & FD_EMPTY)) && - (AutoCDecl ? - IsQualFastcall (Expr->Type + 1) : - !IsQualCDecl (Expr->Type + 1)); -diff --git a/test/ref/Makefile b/test/ref/Makefile -index 3c2e582e..5f0b8616 100644 ---- a/test/ref/Makefile -+++ b/test/ref/Makefile -@@ -60,16 +60,6 @@ $(WORKDIR)/%.ref: %.c | $(WORKDIR) - $(DIFF): ../bdiff.c | $(WORKDIR) - $(CC) $(CFLAGS) -o $@ $< - --# Some files have "K & R"-style syntax. Therefore, some forward --# function-declarations don't match the later function definitions. --# Those programs fail when fastcall is used; but, the cdecl calling convention --# tolerates those conflicts. Therefore, make their functions default to cdecl. --# --$(WORKDIR)/init.%.prg \ --$(WORKDIR)/switch.%.prg \ --$(WORKDIR)/yacc.%.prg \ --$(WORKDIR)/yaccdbg.%.prg: CC65FLAGS += -Wc --all-cdecl -- - # "yaccdbg.c" includes "yacc.c". - # yaccdbg's built files must depend on both of them. - # -diff --git a/test/ref/otccex.c b/test/ref/otccex.c -index 645078ef..12a8b9bf 100644 ---- a/test/ref/otccex.c -+++ b/test/ref/otccex.c -@@ -8,31 +8,31 @@ - - /* - * Sample OTCC C example. You can uncomment the first line and install -- * otcc in /usr/local/bin to make otcc scripts ! -+ * otcc in /usr/local/bin to make otcc scripts ! - */ - - /* Any preprocessor directive except #define are ignored. We put this - include so that a standard C compiler can compile this code too. */ - #include --#include - - /* defines are handled, but macro arguments cannot be given. No - recursive defines are tolerated */ - #define DEFAULT_BASE 10 - - #ifdef NO_IMPLICIT_FUNC_PROTOTYPES --help(char *name); -+void help(char *name); - #endif - - /* -- * Only old style K&R prototypes are parsed. Only int arguments are -+ * Only old-style K&R prototypes are parsed. Only int arguments are - * allowed (implicit types). -- * -+ * - * By benchmarking the execution time of this function (for example - * for fib(35)), you'll notice that OTCC is quite fast because it -- * generates native i386 machine code. -+ * generates native i386 machine code. - */ --fib(n) -+int fib(n) -+ int n; - { - printf("[fib(%d)]", n); - if (n <= 2) -@@ -42,12 +42,14 @@ fib(n) - } - - /* Identifiers are parsed the same way as C: begins with letter or -- '_', and then letters, '_' or digits */ -+ '_', and then letters, '_', or digits. */ - long fact(n) -+ int n; - { - /* local variables can be declared. Only 'int' type is supported */ - int i; - long r; -+ - r = 1; - /* 'while' and 'for' loops are supported */ - for(i=2;i<=n;i++) -@@ -56,13 +58,15 @@ long fact(n) - } - - /* Well, we could use printf, but it would be too easy */ --print_num(long n,int b) -+void print_num(n, b) -+ long n; int b; - { - char *tab, *p, c; -- /* Numbers can be entered in decimal, hexadecimal ('0x' prefix) and -- octal ('0' prefix) */ -- /* more complex programs use malloc */ -- tab = malloc(0x100); -+ -+ /* Numbers can be entered in decimal, hexadecimal ('0x' prefix), and -+ octal ('0' prefix). */ -+ /* More complex programs use malloc(). */ -+ tab = malloc(0x100); - p = tab; - while (1) { - c = n % b; -@@ -80,29 +84,30 @@ print_num(long n,int b) - } - while (p != tab) { - p--; -- printf("%c", *(char *)p); -+ printf("%c", *p); - } - free(tab); - } - - /* 'main' takes standard 'argc' and 'argv' parameters */ --mymain(int argc,char **argv) -+int mymain(argc, argv) -+ int argc; char **argv; - { -- /* no local name space is supported, but local variables ARE -+ /* No local name space is supported, but local variables ARE - supported. As long as you do not use a globally defined -- variable name as local variable (which is a bad habbit), you -- won't have any problem */ -- int s, n, f, base; -- -- -+ variable name as a local variable (which is a bad habit), you -+ won't have any problems. */ -+ size_t s, f; -+ int n, base; -+ - /* && and || operator have the same semantics as C (left to right - evaluation and early exit) */ - if (argc != 2 && argc != 3) { - /* '*' operator is supported with explicit casting to 'int *', -- 'char *' or 'int (*)()' (function pointer). Of course, 'int' -- are supposed to be used as pointers too. */ -- s = *(int *)argv; -- help(s); -+ 'char *', or 'int (*)()' (function pointer). Of course, 'int' -+ are supposed to be used as pointers, too. */ -+ s = *(size_t *)argv; -+ help((char *)s); - return 1; - } - /* Any libc function can be used because OTCC uses dynamic linking */ -@@ -125,15 +130,15 @@ mymain(int argc,char **argv) - printf("Overflow"); - } else { - /* why not using a function pointer ? */ -- f = &fact; -- print_num((*(long (*)(int))f)(n), base); -+ f = (size_t)&fact; -+ print_num((*(long (*)())f)(n), base); - } - printf("\n"); - return 0; - } - - /* functions can be used before being defined */ --help(char *name) -+void help(char *name) - { - printf("usage: %s n [base]\n", name); - printf("Compute fib(n) and fact(n) and output the result in base 'base'\n"); -@@ -142,9 +147,9 @@ help(char *name) - int main(void) - { - char *argv[3]; -- argv[0]=""; -+ -+ argv[0]="otccex"; - argv[1]="10"; /* n */ - argv[2]="8"; /* base */ -- mymain(3, argv); -- return 0; --} -\ No newline at end of file -+ return mymain(3, argv); -+} -diff --git a/test/val/Makefile b/test/val/Makefile -index fe194d89..df1d314e 100644 ---- a/test/val/Makefile -+++ b/test/val/Makefile -@@ -44,16 +44,6 @@ all: $(TESTS) - $(WORKDIR): - $(call MKDIR,$(WORKDIR)) - --# Some files have "K & R"-style syntax. Therefore, some forward --# function-declarations don't match the later function definitions. --# Those programs fail when fastcall is used; but, the cdecl calling convention --# tolerates those conflicts. Therefore, make their functions default to cdecl. --# --$(WORKDIR)/cq4.%.prg \ --$(WORKDIR)/cq71.%.prg \ --$(WORKDIR)/cq81.%.prg \ --$(WORKDIR)/cq84.%.prg: CC65FLAGS += -Wc --all-cdecl -- - define PRG_template - - $(WORKDIR)/%.$1.$2.prg: %.c | $(WORKDIR) --- -2.26.0 - diff --git a/0031-Add-cclear-and-cclearxy.patch b/0031-Add-cclear-and-cclearxy.patch deleted file mode 100644 index 1c04d35..0000000 --- a/0031-Add-cclear-and-cclearxy.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 3b07b8b8e3771ab297707facc043bbf78a542029 Mon Sep 17 00:00:00 2001 -From: jede -Date: Fri, 26 Jul 2019 23:04:54 +0200 -Subject: [PATCH 031/170] Add cclear and cclearxy - ---- - libsrc/telestrat/cclear.s | 35 +++++++++++++++++++++++++++++++++++ - 1 file changed, 35 insertions(+) - create mode 100644 libsrc/telestrat/cclear.s - -diff --git a/libsrc/telestrat/cclear.s b/libsrc/telestrat/cclear.s -new file mode 100644 -index 00000000..bf875ec1 ---- /dev/null -+++ b/libsrc/telestrat/cclear.s -@@ -0,0 +1,35 @@ -+; -+; 2019-07-07, Jede (jede@oric.org) -+; -+; void cclearxy (unsigned char x, unsigned char y, unsigned char length); -+; void cclear (unsigned char length); -+; -+ -+ .export _cclearxy, _cclear -+ .import update_adscr -+ -+ .importzp tmp1 -+ .import popax -+ .include "telestrat.inc" -+ -+ -+_cclearxy: -+ pha ; Save the length -+ jsr popax ; Get X and Y -+ sta SCRY ; Store Y -+ stx SCRX ; Store X -+ jsr update_adscr -+ pla ; Restore the length and run into _cclear -+ -+_cclear: -+ tax ; Is the length zero? -+ beq @L9 ; Jump if done -+@L1: -+ stx tmp1 -+ lda #' ' -+ BRK_TELEMON XFWR -+ ldx tmp1 -+ dex -+ bne @L1 -+@L9: -+ rts --- -2.26.0 - diff --git a/0032-Cleaning.patch b/0032-Cleaning.patch deleted file mode 100644 index 927146c..0000000 --- a/0032-Cleaning.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 3d63a8bb6233875d985f4658612878c6016d9dbd Mon Sep 17 00:00:00 2001 -From: jede -Date: Fri, 26 Jul 2019 23:11:34 +0200 -Subject: [PATCH 032/170] Cleaning - ---- - libsrc/telestrat/cclear.s | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - -diff --git a/libsrc/telestrat/cclear.s b/libsrc/telestrat/cclear.s -index bf875ec1..a3291996 100644 ---- a/libsrc/telestrat/cclear.s -+++ b/libsrc/telestrat/cclear.s -@@ -8,7 +8,7 @@ - .export _cclearxy, _cclear - .import update_adscr - -- .importzp tmp1 -+ .importzp tmp1 - .import popax - .include "telestrat.inc" - -@@ -22,14 +22,14 @@ _cclearxy: - pla ; Restore the length and run into _cclear - - _cclear: -- tax ; Is the length zero? -- beq @L9 ; Jump if done -+ tax ; Is the length equal to zero? -+ beq @L2 ; Yes we skip - @L1: -- stx tmp1 -- lda #' ' -+ stx tmp1 ; Save X -+ lda #' ' ; Erase current char - BRK_TELEMON XFWR - ldx tmp1 - dex - bne @L1 --@L9: -+@L2: - rts --- -2.26.0 - diff --git a/0033-doc-clarify-need-for-.IMPORT-on-some-special-symbols.patch b/0033-doc-clarify-need-for-.IMPORT-on-some-special-symbols.patch deleted file mode 100644 index 65296e5..0000000 --- a/0033-doc-clarify-need-for-.IMPORT-on-some-special-symbols.patch +++ /dev/null @@ -1,36 +0,0 @@ -From cc373cc41dc4387e9936288047e892daafc44217 Mon Sep 17 00:00:00 2001 -From: Jeremy Chadwick -Date: Fri, 23 Aug 2019 23:36:43 -0700 -Subject: [PATCH 033/170] doc: clarify need for .IMPORT on some special symbols - ---- - doc/ld65.sgml | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/doc/ld65.sgml b/doc/ld65.sgml -index 36489b0c..6add0f0f 100644 ---- a/doc/ld65.sgml -+++ b/doc/ld65.sgml -@@ -562,7 +562,8 @@ segment, where this attribute is true, the linker will export three symbols. - - - Replace .IMPORT directive. - - Now, as we've configured the linker to write the first three segments and - create symbols for the last one, there's only one question left: Where does -@@ -766,7 +767,8 @@ useful for things like a software stack, or an I/O area. - } - - --This will define some external symbols that may be used in your code: -+This will define some external symbols that may be used in your code once -+the symbol has imported using the .IMPORT directive: - - - __STACK_START__ This is set to the start of the memory --- -2.26.0 - diff --git a/0034-Grammatical-modifications.patch b/0034-Grammatical-modifications.patch deleted file mode 100644 index f0f572f..0000000 --- a/0034-Grammatical-modifications.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 57b997355fd97565d4a6a9713832afd5fdaf4f83 Mon Sep 17 00:00:00 2001 -From: Jeremy Chadwick -Date: Sat, 24 Aug 2019 03:49:32 -0700 -Subject: [PATCH 034/170] Grammatical modifications - ---- - doc/ld65.sgml | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/doc/ld65.sgml b/doc/ld65.sgml -index 6add0f0f..97233271 100644 ---- a/doc/ld65.sgml -+++ b/doc/ld65.sgml -@@ -562,8 +562,8 @@ segment, where this attribute is true, the linker will export three symbols. - - - Replace .IMPORT directive. -+be .IMPORT directive. - - Now, as we've configured the linker to write the first three segments and - create symbols for the last one, there's only one question left: Where does -@@ -767,8 +767,8 @@ useful for things like a software stack, or an I/O area. - } - - --This will define some external symbols that may be used in your code once --the symbol has imported using the .IMPORT directive: -+This will define some external symbols that may be used in your code when -+imported using the .IMPORT directive: - - - __STACK_START__ This is set to the start of the memory --- -2.26.0 - diff --git a/0035-Use-the-word-macros-universally-not-macroes.patch b/0035-Use-the-word-macros-universally-not-macroes.patch deleted file mode 100644 index 5b6f068..0000000 --- a/0035-Use-the-word-macros-universally-not-macroes.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 4e3abf417fc485b89edf2a591cd4e22432d62ed1 Mon Sep 17 00:00:00 2001 -From: Jeremy Chadwick -Date: Mon, 26 Aug 2019 12:16:22 -0700 -Subject: [PATCH 035/170] Use the word 'macros' universally (not macroes) - ---- - doc/ca65.sgml | 8 ++++---- - doc/cl65.sgml | 2 +- - 2 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/doc/ca65.sgml b/doc/ca65.sgml -index 21103999..af2ce825 100644 ---- a/doc/ca65.sgml -+++ b/doc/ca65.sgml -@@ -3444,8 +3444,8 @@ Here's a list of all control commands and a description, what they do: - atari Defines the scrcode macro. - cbm Defines the scrcode macro. - cpu Defines constants for the .CPU variable. -- generic Defines generic macroes like add, sub, and blt. -- longbranch Defines conditional long-jump macroes. -+ generic Defines generic macros like add, sub, and blt. -+ longbranch Defines conditional long-jump macros. - - - Including a macro package twice, or including a macro package that -@@ -4479,8 +4479,8 @@ are: - - .MACPACK generic

- --This macro package defines macroes that are useful in almost any program. --Currently defined macroes are: -+This macro package defines macros that are useful in almost any program. -+Currently defined macros are: - - - .macro add Arg ; add without carry -diff --git a/doc/cl65.sgml b/doc/cl65.sgml -index 0291f2eb..989dce70 100644 ---- a/doc/cl65.sgml -+++ b/doc/cl65.sgml -@@ -138,7 +138,7 @@ There are a few remaining options that control the behaviour of cl65: - - This option is passed to the cc65 compiler; and, it forces cl65 to stop - before the assembly step. That means that C-level preprocessor directives -- are obeyed; and, macroes are expanded. But, the C source isn't compiled. -+ are obeyed; and, macros are expanded. But, the C source isn't compiled. - If the -Date: Sat, 7 Sep 2019 18:50:11 -0400 -Subject: [PATCH 036/170] Added a charmap header that converts no character - encodings. - -It can be used in programs, on non-ASCII machines, that need to send/write ASCII strings. ---- - include/ascii_charmap.h | 295 ++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 295 insertions(+) - create mode 100644 include/ascii_charmap.h - -diff --git a/include/ascii_charmap.h b/include/ascii_charmap.h -new file mode 100644 -index 00000000..876dab18 ---- /dev/null -+++ b/include/ascii_charmap.h -@@ -0,0 +1,295 @@ -+/*****************************************************************************/ -+/* */ -+/* ascii_charmap.h */ -+/* */ -+/* No translations, encodings are stored as they were typed in the host. */ -+/* */ -+/* */ -+/* 2019-09-07, Greg King */ -+/* */ -+/* This software is provided "as-is", without any expressed or implied */ -+/* warranty. In no event will the authors be held liable for any damages */ -+/* arising from the use of this software. */ -+/* */ -+/* Permission is granted to anyone to use this software for any purpose, */ -+/* including commercial applications, and to alter it and redistribute it */ -+/* freely, subject to the following restrictions: */ -+/* */ -+/* 1. The origin of this software must not be misrepresented; you must not */ -+/* claim that you wrote the original software. If you use this software */ -+/* in a product, an acknowledgment in the product documentation would be */ -+/* appreciated, but is not required. */ -+/* 2. Altered source versions must be plainly marked as such, and must not */ -+/* be misrepresented as being the original software. */ -+/* 3. This notice must not be removed or altered from any source */ -+/* distribution. */ -+/* */ -+/*****************************************************************************/ -+ -+/* No include guard here. Each charnap header -+** may be included many times in a source file. -+*/ -+ -+#pragma warn (remap-zero, push, off) -+ -+/* ASCII */ -+#pragma charmap (0x00, 0x00) -+#pragma charmap (0x01, 0x01) -+#pragma charmap (0x02, 0x02) -+#pragma charmap (0x03, 0x03) -+#pragma charmap (0x04, 0x04) -+#pragma charmap (0x05, 0x05) -+#pragma charmap (0x06, 0x06) -+#pragma charmap (0x07, 0x07) -+#pragma charmap (0x08, 0x08) -+#pragma charmap (0x09, 0x09) -+#pragma charmap (0x0A, 0x0A) -+#pragma charmap (0x0B, 0x0B) -+#pragma charmap (0x0C, 0x0C) -+#pragma charmap (0x0D, 0x0D) -+#pragma charmap (0x0E, 0x0E) -+#pragma charmap (0x0F, 0x0F) -+#pragma charmap (0x10, 0x10) -+#pragma charmap (0x11, 0x11) -+#pragma charmap (0x12, 0x12) -+#pragma charmap (0x13, 0x13) -+#pragma charmap (0x14, 0x14) -+#pragma charmap (0x15, 0x15) -+#pragma charmap (0x16, 0x16) -+#pragma charmap (0x17, 0x17) -+#pragma charmap (0x18, 0x18) -+#pragma charmap (0x19, 0x19) -+#pragma charmap (0x1A, 0x1A) -+#pragma charmap (0x1B, 0x1B) -+#pragma charmap (0x1C, 0x1C) -+#pragma charmap (0x1D, 0x1D) -+#pragma charmap (0x1E, 0x1E) -+#pragma charmap (0x1F, 0x1F) -+#pragma charmap (0x20, 0x20) -+#pragma charmap (0x21, 0x21) -+#pragma charmap (0x22, 0x22) -+#pragma charmap (0x23, 0x23) -+#pragma charmap (0x24, 0x24) -+#pragma charmap (0x25, 0x25) -+#pragma charmap (0x26, 0x26) -+#pragma charmap (0x27, 0x27) -+#pragma charmap (0x28, 0x28) -+#pragma charmap (0x29, 0x29) -+#pragma charmap (0x2A, 0x2A) -+#pragma charmap (0x2B, 0x2B) -+#pragma charmap (0x2C, 0x2C) -+#pragma charmap (0x2D, 0x2D) -+#pragma charmap (0x2E, 0x2E) -+#pragma charmap (0x2F, 0x2F) -+#pragma charmap (0x30, 0x30) -+#pragma charmap (0x31, 0x31) -+#pragma charmap (0x32, 0x32) -+#pragma charmap (0x33, 0x33) -+#pragma charmap (0x34, 0x34) -+#pragma charmap (0x35, 0x35) -+#pragma charmap (0x36, 0x36) -+#pragma charmap (0x37, 0x37) -+#pragma charmap (0x38, 0x38) -+#pragma charmap (0x39, 0x39) -+#pragma charmap (0x3A, 0x3A) -+#pragma charmap (0x3B, 0x3B) -+#pragma charmap (0x3C, 0x3C) -+#pragma charmap (0x3D, 0x3D) -+#pragma charmap (0x3E, 0x3E) -+#pragma charmap (0x3F, 0x3F) -+#pragma charmap (0x40, 0x40) -+#pragma charmap (0x41, 0x41) -+#pragma charmap (0x42, 0x42) -+#pragma charmap (0x43, 0x43) -+#pragma charmap (0x44, 0x44) -+#pragma charmap (0x45, 0x45) -+#pragma charmap (0x46, 0x46) -+#pragma charmap (0x47, 0x47) -+#pragma charmap (0x48, 0x48) -+#pragma charmap (0x49, 0x49) -+#pragma charmap (0x4A, 0x4A) -+#pragma charmap (0x4B, 0x4B) -+#pragma charmap (0x4C, 0x4C) -+#pragma charmap (0x4D, 0x4D) -+#pragma charmap (0x4E, 0x4E) -+#pragma charmap (0x4F, 0x4F) -+#pragma charmap (0x50, 0x50) -+#pragma charmap (0x51, 0x51) -+#pragma charmap (0x52, 0x52) -+#pragma charmap (0x53, 0x53) -+#pragma charmap (0x54, 0x54) -+#pragma charmap (0x55, 0x55) -+#pragma charmap (0x56, 0x56) -+#pragma charmap (0x57, 0x57) -+#pragma charmap (0x58, 0x58) -+#pragma charmap (0x59, 0x59) -+#pragma charmap (0x5A, 0x5A) -+#pragma charmap (0x5B, 0x5B) -+#pragma charmap (0x5C, 0x5C) -+#pragma charmap (0x5D, 0x5D) -+#pragma charmap (0x5E, 0x5E) -+#pragma charmap (0x5F, 0x5F) -+#pragma charmap (0x60, 0x60) -+#pragma charmap (0x61, 0x61) -+#pragma charmap (0x62, 0x62) -+#pragma charmap (0x63, 0x63) -+#pragma charmap (0x64, 0x64) -+#pragma charmap (0x65, 0x65) -+#pragma charmap (0x66, 0x66) -+#pragma charmap (0x67, 0x67) -+#pragma charmap (0x68, 0x68) -+#pragma charmap (0x69, 0x69) -+#pragma charmap (0x6A, 0x6A) -+#pragma charmap (0x6B, 0x6B) -+#pragma charmap (0x6C, 0x6C) -+#pragma charmap (0x6D, 0x6D) -+#pragma charmap (0x6E, 0x6E) -+#pragma charmap (0x6F, 0x6F) -+#pragma charmap (0x70, 0x70) -+#pragma charmap (0x71, 0x71) -+#pragma charmap (0x72, 0x72) -+#pragma charmap (0x73, 0x73) -+#pragma charmap (0x74, 0x74) -+#pragma charmap (0x75, 0x75) -+#pragma charmap (0x76, 0x76) -+#pragma charmap (0x77, 0x77) -+#pragma charmap (0x78, 0x78) -+#pragma charmap (0x79, 0x79) -+#pragma charmap (0x7A, 0x7A) -+#pragma charmap (0x7B, 0x7B) -+#pragma charmap (0x7C, 0x7C) -+#pragma charmap (0x7D, 0x7D) -+#pragma charmap (0x7E, 0x7E) -+#pragma charmap (0x7F, 0x7F) -+ -+/* beyond ASCII */ -+#pragma charmap (0x80, 0x80) -+#pragma charmap (0x81, 0x81) -+#pragma charmap (0x82, 0x82) -+#pragma charmap (0x83, 0x83) -+#pragma charmap (0x84, 0x84) -+#pragma charmap (0x85, 0x85) -+#pragma charmap (0x86, 0x86) -+#pragma charmap (0x87, 0x87) -+#pragma charmap (0x88, 0x88) -+#pragma charmap (0x89, 0x89) -+#pragma charmap (0x8A, 0x8A) -+#pragma charmap (0x8B, 0x8B) -+#pragma charmap (0x8C, 0x8C) -+#pragma charmap (0x8D, 0x8D) -+#pragma charmap (0x8E, 0x8E) -+#pragma charmap (0x8F, 0x8F) -+#pragma charmap (0x90, 0x90) -+#pragma charmap (0x91, 0x91) -+#pragma charmap (0x92, 0x92) -+#pragma charmap (0x93, 0x93) -+#pragma charmap (0x94, 0x94) -+#pragma charmap (0x95, 0x95) -+#pragma charmap (0x96, 0x96) -+#pragma charmap (0x97, 0x97) -+#pragma charmap (0x98, 0x98) -+#pragma charmap (0x99, 0x99) -+#pragma charmap (0x9A, 0x9A) -+#pragma charmap (0x9B, 0x9B) -+#pragma charmap (0x9C, 0x9C) -+#pragma charmap (0x9D, 0x9D) -+#pragma charmap (0x9E, 0x9E) -+#pragma charmap (0x9F, 0x9F) -+#pragma charmap (0xA0, 0xA0) -+#pragma charmap (0xA1, 0xA1) -+#pragma charmap (0xA2, 0xA2) -+#pragma charmap (0xA3, 0xA3) -+#pragma charmap (0xA4, 0xA4) -+#pragma charmap (0xA5, 0xA5) -+#pragma charmap (0xA6, 0xA6) -+#pragma charmap (0xA7, 0xA7) -+#pragma charmap (0xA8, 0xA8) -+#pragma charmap (0xA9, 0xA9) -+#pragma charmap (0xAA, 0xAA) -+#pragma charmap (0xAB, 0xAB) -+#pragma charmap (0xAC, 0xAC) -+#pragma charmap (0xAD, 0xAD) -+#pragma charmap (0xAE, 0xAE) -+#pragma charmap (0xAF, 0xAF) -+#pragma charmap (0xB0, 0xB0) -+#pragma charmap (0xB1, 0xB1) -+#pragma charmap (0xB2, 0xB2) -+#pragma charmap (0xB3, 0xB3) -+#pragma charmap (0xB4, 0xB4) -+#pragma charmap (0xB5, 0xB5) -+#pragma charmap (0xB6, 0xB6) -+#pragma charmap (0xB7, 0xB7) -+#pragma charmap (0xB8, 0xB8) -+#pragma charmap (0xB9, 0xB9) -+#pragma charmap (0xBA, 0xBA) -+#pragma charmap (0xBB, 0xBB) -+#pragma charmap (0xBC, 0xBC) -+#pragma charmap (0xBD, 0xBD) -+#pragma charmap (0xBE, 0xBE) -+#pragma charmap (0xBF, 0xBF) -+#pragma charmap (0xC0, 0xC0) -+#pragma charmap (0xC1, 0xC1) -+#pragma charmap (0xC2, 0xC2) -+#pragma charmap (0xC3, 0xC3) -+#pragma charmap (0xC4, 0xC4) -+#pragma charmap (0xC5, 0xC5) -+#pragma charmap (0xC6, 0xC6) -+#pragma charmap (0xC7, 0xC7) -+#pragma charmap (0xC8, 0xC8) -+#pragma charmap (0xC9, 0xC9) -+#pragma charmap (0xCA, 0xCA) -+#pragma charmap (0xCB, 0xCB) -+#pragma charmap (0xCC, 0xCC) -+#pragma charmap (0xCD, 0xCD) -+#pragma charmap (0xCE, 0xCE) -+#pragma charmap (0xCF, 0xCF) -+#pragma charmap (0xD0, 0xD0) -+#pragma charmap (0xD1, 0xD1) -+#pragma charmap (0xD2, 0xD2) -+#pragma charmap (0xD3, 0xD3) -+#pragma charmap (0xD4, 0xD4) -+#pragma charmap (0xD5, 0xD5) -+#pragma charmap (0xD6, 0xD6) -+#pragma charmap (0xD7, 0xD7) -+#pragma charmap (0xD8, 0xD8) -+#pragma charmap (0xD9, 0xD9) -+#pragma charmap (0xDA, 0xDA) -+#pragma charmap (0xDB, 0xDB) -+#pragma charmap (0xDC, 0xDC) -+#pragma charmap (0xDD, 0xDD) -+#pragma charmap (0xDE, 0xDE) -+#pragma charmap (0xDF, 0xDF) -+#pragma charmap (0xE0, 0xE0) -+#pragma charmap (0xE1, 0xE1) -+#pragma charmap (0xE2, 0xE2) -+#pragma charmap (0xE3, 0xE3) -+#pragma charmap (0xE4, 0xE4) -+#pragma charmap (0xE5, 0xE5) -+#pragma charmap (0xE6, 0xE6) -+#pragma charmap (0xE7, 0xE7) -+#pragma charmap (0xE8, 0xE8) -+#pragma charmap (0xE9, 0xE9) -+#pragma charmap (0xEA, 0xEA) -+#pragma charmap (0xEB, 0xEB) -+#pragma charmap (0xEC, 0xEC) -+#pragma charmap (0xED, 0xED) -+#pragma charmap (0xEE, 0xEE) -+#pragma charmap (0xEF, 0xEF) -+#pragma charmap (0xF0, 0xF0) -+#pragma charmap (0xF1, 0xF1) -+#pragma charmap (0xF2, 0xF2) -+#pragma charmap (0xF3, 0xF3) -+#pragma charmap (0xF4, 0xF4) -+#pragma charmap (0xF5, 0xF5) -+#pragma charmap (0xF6, 0xF6) -+#pragma charmap (0xF7, 0xF7) -+#pragma charmap (0xF8, 0xF8) -+#pragma charmap (0xF9, 0xF9) -+#pragma charmap (0xFA, 0xFA) -+#pragma charmap (0xFB, 0xFB) -+#pragma charmap (0xFC, 0xFC) -+#pragma charmap (0xFD, 0xFD) -+#pragma charmap (0xFE, 0xFE) -+#pragma charmap (0xFF, 0xFF) -+ -+#pragma warn (remap-zero, pop) --- -2.26.0 - diff --git a/0037-Use-MACHID-to-check-for-realtime-clock.patch b/0037-Use-MACHID-to-check-for-realtime-clock.patch deleted file mode 100644 index a479a2c..0000000 --- a/0037-Use-MACHID-to-check-for-realtime-clock.patch +++ /dev/null @@ -1,113 +0,0 @@ -From 3b128ba59f6bfc943bfdc9a971daa00f612f1193 Mon Sep 17 00:00:00 2001 -From: Oliver Schmidt -Date: Tue, 10 Sep 2019 09:49:06 +0200 -Subject: [PATCH 037/170] Use MACHID to check for realtime clock. - -There's no need to do guesswork to know if a realtime clock is present/active. ---- - doc/apple2.sgml | 18 ++++++++---------- - doc/apple2enh.sgml | 18 ++++++++---------- - libsrc/apple2/getres.s | 8 ++++---- - libsrc/apple2/settime.s | 8 ++++---- - 4 files changed, 24 insertions(+), 28 deletions(-) - -diff --git a/doc/apple2.sgml b/doc/apple2.sgml -index 648ee56d..91c02c7a 100644 ---- a/doc/apple2.sgml -+++ b/doc/apple2.sgml -@@ -500,16 +500,14 @@ From that perspective it makes most sense to not set both the date and the time - rather only set the date and have the time just stay zero. Then files show up in a - directory as day_res - -- ; Check for existing minutes or hours -- lda TIMELO -- ora TIMELO+1 -- beq :+ -+ ; Check for realtme clock -+ lda MACHID -+ lsr a -+ bcc :+ - - ; Switch to minute resolution - ldx # -Date: Wed, 11 Sep 2019 17:55:49 -0400 -Subject: [PATCH 038/170] Added a .ORG keyword to ca65 structs/unions. - -Allow 24-bit numbers as operands in ca65 structs/unions. ---- - doc/ca65.sgml | 137 ++++++++++++++++++++++++++++------------------ - src/ca65/struct.c | 45 ++++++++------- - 2 files changed, 111 insertions(+), 71 deletions(-) - -diff --git a/doc/ca65.sgml b/doc/ca65.sgml -index af2ce825..8a5e307d 100644 ---- a/doc/ca65.sgml -+++ b/doc/ca65.sgml -@@ -1,4 +1,4 @@ -- -+ - -

- ca65 Users Guide -@@ -1752,18 +1752,18 @@ either a string or an expression. - - <sect1><tt>.SIZEOF</tt><label id=".SIZEOF"><p> - -- <tt/.SIZEOF/ is a pseudo function that returns the size of its argument. The -- argument can be a struct/union, a struct member, a procedure, or a label. In -- case of a procedure or label, its size is defined by the amount of data -- placed in the segment where the label is relative to. If a line of code -- switches segments (for example in a macro) data placed in other segments -- does not count for the size. -+ <tt/.SIZEOF()/ is a pseudo function that returns the size of its argument. -+ The argument can be a struct/union, a struct member, a scope/procedure, or a -+ label. In the case of a procedure or label, its size is defined by the -+ amount of data placed in the segment where the label is relative to. If a -+ line of code switches segments (for example, in a macro), data placed in -+ other segments does not count for the size. - -- Please note that a symbol or scope must exist, before it is used together with -- <tt/.SIZEOF/ (this may get relaxed later, but will always be true for scopes). -- A scope has preference over a symbol with the same name, so if the last part -- of a name represents both, a scope and a symbol, the scope is chosen over the -- symbol. -+ Please note that a symbol or scope must exist before it can be used together -+ with <tt/.SIZEOF()/ (that may get relaxed later, but always will be true for -+ scopes). A scope has preference over a symbol with the same name; so, if the -+ last part of a name represents both a scope and a symbol, then the scope is -+ chosen over the symbol. - - After the following code: - -@@ -2496,7 +2496,7 @@ Here's a list of all control commands and a description, what they do: - - <sect1><tt>.ENDPROC</tt><label id=".ENDPROC"><p> - -- End of local lexical level (see <tt><ref id=".PROC" name=".PROC"></tt>). -+ End of the local lexical level (see <tt><ref id=".PROC" name=".PROC"></tt>). - - - <sect1><tt>.ENDREP, .ENDREPEAT</tt><label id=".ENDREPEAT"><p> -@@ -2506,7 +2506,7 @@ Here's a list of all control commands and a description, what they do: - - <sect1><tt>.ENDSCOPE</tt><label id=".ENDSCOPE"><p> - -- End of local lexical level (see <tt/<ref id=".SCOPE" name=".SCOPE">/). -+ End of the local lexical level (see <tt/<ref id=".SCOPE" name=".SCOPE">/). - - - <sect1><tt>.ENDSTRUCT</tt><label id=".ENDSTRUCT"><p> -@@ -2530,8 +2530,8 @@ Here's a list of all control commands and a description, what they do: - otherwise the enumeration members are placed in the enclosing scope. - - In the enumeration body, symbols are declared. The first symbol has a value -- of zero, and each following symbol will get the value of the preceding plus -- one. This behaviour may be overridden by an explicit assignment. Two symbols -+ of zero, and each following symbol will get the value of the preceding, plus -+ one. That behaviour may be overridden by an explicit assignment. Two symbols - may have the same value. - - Example: -@@ -2544,9 +2544,9 @@ Here's a list of all control commands and a description, what they do: - .endenum - </verb></tscreen> - -- Above example will create a new scope named <tt/errorcodes/ with three -- symbols in it that get the values 0, 1 and 2 respectively. Another way -- to write this would have been: -+ The above example will create a new scope named <tt/errorcodes/ with three -+ symbols in it that get the values 0, 1, and 2 respectively. Another way -+ to write that would have been: - - <tscreen><verb> - .scope errorcodes -@@ -2575,12 +2575,12 @@ Here's a list of all control commands and a description, what they do: - .endenum - </verb></tscreen> - -- In this example, the enumeration does not have a name, which means that the -- members will be visible in the enclosing scope and can be used in this scope -+ In that example, the enumeration does not have a name, which means that the -+ members will be visible in the enclosing scope, and can be used in that scope - without explicit scoping. The first member (<tt/EUNKNOWN/) has the value -1. -- The value for the following members is incremented by one, so <tt/EOK/ would -- be zero and so on. <tt/EWOULDBLOCK/ is an alias for <tt/EGAIN/, so it has an -- override for the value using an already defined symbol. -+ The values for the following members are incremented by one; so, <tt/EOK/ -+ would be zero, and so on. <tt/EWOULDBLOCK/ is an alias for <tt/EAGAIN/; so, -+ it has an override for the value, using an already defined symbol. - - - <sect1><tt>.ERROR</tt><label id=".ERROR"><p> -@@ -4672,22 +4672,22 @@ compiler, depending on the target system selected: - </itemize> - - -+ - <sect>Structs and unions<label id="structs"><p> - - <sect1>Structs and unions Overview<p> - - Structs and unions are special forms of <ref id="scopes" name="scopes">. They --are to some degree comparable to their C counterparts. Both have a list of --members. Each member allocates storage and may optionally have a name, which, --in case of a struct, is the offset from the beginning and, in case of a union, --is always zero. -+are, to some degree, comparable to their C counterparts. Both have a list of -+members. Each member allocates storage, and optionally may have a name whose -+value, in the case of a struct, usually is the storage offset from the -+beginning, and in the case of a union, doesn't change, and usually is zero. - - - <sect1>Declaration<p> - - Here is an example for a very simple struct with two members and a total size - of 4 bytes: -- - <tscreen><verb> - .struct Point - xcoord .word -@@ -4695,10 +4695,9 @@ of 4 bytes: - .endstruct - </verb></tscreen> - --A union shares the total space between all its members, its size is the same -+A union shares the total space between all its members; its size is the same - as that of the largest member. The offset of all members relative to the union - is zero. -- - <tscreen><verb> - .union Entry - index .word -@@ -4706,13 +4705,12 @@ is zero. - .endunion - </verb></tscreen> - --A struct or union must not necessarily have a name. If it is anonymous, no --local scope is opened, the identifiers used to name the members are placed -+A struct or union may not necessarily have a name. If it is anonymous, no -+local scope is opened; the identifiers used to name the members are placed - into the current scope instead. - --A struct may contain unnamed members and definitions of local structs. The --storage allocators may contain a multiplier, as in the example below: -- -+A struct may contain unnamed members and definitions of local structs/unions. -+The storage allocators may contain a multiplier, as in the example below: - <tscreen><verb> - .struct Circle - .struct Point -@@ -4721,13 +4719,51 @@ storage allocators may contain a multiplier, as in the example below: - Radius .word - .endstruct - </verb></tscreen> -+The size of the Circle struct is 6 (three words). - - --<sect1>The <tt/.TAG/ keyword<p> -+<sect1>The storage allocator keywords<p> -+ -+ <descrip> -+ -+ <tag/.BYTE, .RES/ -+ Allocates multiples of 1 byte. <tt/.RES/ requires an operand. -+ -+ <tag/.DBYTE, .WORD, .ADDR/ -+ Allocates multiples of 2 bytes. - --Using the <ref id=".TAG" name=".TAG"> keyword, it is possible to reserve space --for an already defined struct or unions within another struct: -+ <tag/.FARADDR/ -+ Allocates multiples of 3 bytes. -+ -+ <tag/.DWORD/ -+ Allocates multiples of 4 bytes. -+ -+ </descrip> - -+ -+<sect1>The <tt/.ORG/ keyword<p> -+ -+The <tt/.ORG/ keyword changes the offset value that is assigned to subsequent -+member names. It's useful when using a struct to define the names of the -+registers in an I/O chip. Example: -+<tscreen><verb> -+; 6551 -+.struct ACIA ; Asynchronous Communications Interface Adapter -+ .org $031C -+DATA .byte -+STATUS .byte -+CMD .byte ; Command register -+CTRL .byte ; Control register -+.endstruct -+ -+ lda ACIA::DATA ; Get an RS-232 character -+</verb></tscreen> -+ -+ -+<sect1>The <tt/.TAG/ keyword<p> -+ -+By using the <ref id=".TAG" name=".TAG"> keyword, it is possible to reserve -+space for an already defined struct or union within another struct: - <tscreen><verb> - .struct Point - xcoord .word -@@ -4740,33 +4776,30 @@ for an already defined struct or unions within another struct: - .endstruct - </verb></tscreen> - --Space for a struct or union may be allocated using the <ref id=".TAG" -+Actual space for a struct or union may be allocated by using the <ref id=".TAG" - name=".TAG"> directive. -- - <tscreen><verb> -- C: .tag Circle -+C: .tag Circle - </verb></tscreen> - - Currently, members are just offsets from the start of the struct or union. To --access a field of a struct, the member offset has to be added to the address --of the struct itself: -- -+access a field of a struct, the member offset must be added to the address of -+the struct variable itself: - <tscreen><verb> - lda C+Circle::Radius ; Load circle radius into A - </verb></tscreen> -- --This may change in a future version of the assembler. -+That may change in a future version of the assembler. - - - <sect1>Limitations<p> - --Structs and unions are currently implemented as nested symbol tables (in fact, -+Structs and unions currently are implemented as nested symbol tables (in fact, - they were a by-product of the improved scoping rules). Currently, the --assembler has no idea of types. This means that the <ref id=".TAG" --name=".TAG"> keyword will only allocate space. You won't be able to initialize --variables declared with <ref id=".TAG" name=".TAG">, and adding an embedded -+assembler has no idea of types. That means that the <ref id=".TAG" -+name=".TAG"> keyword only will allocate space. You won't be able to initialize -+variables declared with <ref id=".TAG" name=".TAG">; and, adding an embedded - structure to another structure with <ref id=".TAG" name=".TAG"> will not make --this structure accessible by using the '::' operator. -+that added structure accessible by using the '::' operator. - - - -diff --git a/src/ca65/struct.c b/src/ca65/struct.c -index 5ea7a18e..6d279a70 100644 ---- a/src/ca65/struct.c -+++ b/src/ca65/struct.c -@@ -5,7 +5,6 @@ - /* .STRUCT/.UNION commands */ - /* */ - /* */ --/* */ - /* (C) 2003-2011, Ullrich von Bassewitz */ - /* Roemerstrasse 52 */ - /* D-70794 Filderstadt */ -@@ -73,20 +72,20 @@ enum { - static long Member (long AllocSize) - /* Read one struct member and return its size */ - { -- long Multiplicator; -+ long Multiplier; - -- /* A multiplicator may follow */ -+ /* A multiplier may follow */ - if (CurTok.Tok != TOK_SEP) { -- Multiplicator = ConstExpression (); -- if (Multiplicator <= 0) { -+ Multiplier = ConstExpression (); -+ if (Multiplier <= 0) { - ErrorSkip ("Range error"); -- Multiplicator = 1; -+ Multiplier = 1; - } -- AllocSize *= Multiplicator; -+ AllocSize *= Multiplier; - } - - /* Check the size for a reasonable value */ -- if (AllocSize >= 0x10000) { -+ if (AllocSize >= 0x1000000) { - ErrorSkip ("Range error"); - } - -@@ -102,10 +101,11 @@ static long DoStructInternal (long Offs, unsigned Type) - long Size = 0; - - /* Outside of other structs, we need a name. Inside another struct or -- ** union, the struct may be anonymous, in which case no new lexical level -+ ** union, the struct may be anonymous; in which case, no new lexical level - ** is started. - */ - int Anon = (CurTok.Tok != TOK_IDENT); -+ - if (!Anon) { - /* Enter a new scope, then skip the name */ - SymEnterLevel (&CurTok.SVal, SCOPE_STRUCT, ADDR_SIZE_ABS, 0); -@@ -121,7 +121,6 @@ static long DoStructInternal (long Offs, unsigned Type) - while (CurTok.Tok != TOK_ENDSTRUCT && - CurTok.Tok != TOK_ENDUNION && - CurTok.Tok != TOK_EOF) { -- - long MemberSize; - SymTable* Struct; - SymEntry* Sym; -@@ -132,14 +131,14 @@ static long DoStructInternal (long Offs, unsigned Type) - continue; - } - -- /* The format is "[identifier] storage-allocator [, multiplicator]" */ -+ /* The format is "[identifier ].storage-allocator[ multiplier]" */ - Sym = 0; - if (CurTok.Tok == TOK_IDENT) { -- -- /* Beware: An identifier may also be a macro, in which case we have -- ** to start over. -+ /* Beware: An identifier may be a macro also; -+ ** in which case, we must start over. - */ - Macro* M = FindMacro (&CurTok.SVal); -+ - if (M) { - MacExpandStart (M); - continue; -@@ -155,10 +154,9 @@ static long DoStructInternal (long Offs, unsigned Type) - NextTok (); - } - -- /* Read storage allocators */ -- MemberSize = 0; /* In case of errors, use zero */ -+ /* Read the storage allocator */ -+ MemberSize = 0; /* In case of errors or .ORG, use zero */ - switch (CurTok.Tok) { -- - case TOK_BYTE: - NextTok (); - MemberSize = Member (1); -@@ -190,6 +188,15 @@ static long DoStructInternal (long Offs, unsigned Type) - } - break; - -+ case TOK_ORG: -+ NextTok (); -+ if (CurTok.Tok == TOK_SEP) { -+ ErrorSkip ("Address is missing"); -+ } else { -+ Offs = Member (1); -+ } -+ break; -+ - case TOK_TAG: - NextTok (); - Struct = ParseScopedSymTable (); -@@ -244,8 +251,8 @@ static long DoStructInternal (long Offs, unsigned Type) - ConsumeSep (); - } - -- /* If this is not a anon struct, enter a special symbol named ".size" -- ** into the symbol table of the struct that holds the size of the -+ /* If this is not an anon. struct, enter a special symbol named ".size" -+ ** into the symbol table, of the struct, that holds the size of the - ** struct. Since the symbol starts with a dot, it cannot be accessed - ** by user code. - ** Leave the struct scope level. --- -2.26.0 - diff --git a/0039-Created-a-target-and-a-library-for-the-Commander-X16.patch b/0039-Created-a-target-and-a-library-for-the-Commander-X16.patch deleted file mode 100644 index cbac42d..0000000 --- a/0039-Created-a-target-and-a-library-for-the-Commander-X16.patch +++ /dev/null @@ -1,3106 +0,0 @@ -From 18afc7c7038280e2443c64e31cf2f0092a484004 Mon Sep 17 00:00:00 2001 -From: Greg King <gregdk@users.sf.net> -Date: Fri, 27 Sep 2019 03:38:51 -0400 -Subject: [PATCH 039/170] Created a target and a library for the Commander X16 - prototype computer. - ---- - asminc/cbm_kernal.inc | 36 ++-- - asminc/cx16.inc | 316 ++++++++++++++++++++++++++++++++++ - cfg/cx16-asm.cfg | 37 ++++ - cfg/cx16-bank.cfg | 112 ++++++++++++ - cfg/cx16.cfg | 45 +++++ - doc/ca65.sgml | 3 +- - doc/cc65.sgml | 4 + - doc/cx16.sgml | 311 +++++++++++++++++++++++++++++++++ - doc/index.sgml | 3 + - doc/intro.sgml | 27 ++- - include/cbm.h | 4 +- - include/cx16.h | 189 ++++++++++++++++++++ - libsrc/Makefile | 1 + - libsrc/cx16/_scrsize.s | 14 ++ - libsrc/cx16/bankramaddr.s | 50 ++++++ - libsrc/cx16/bordercolor.s | 27 +++ - libsrc/cx16/break.s | 109 ++++++++++++ - libsrc/cx16/cgetc.s | 72 ++++++++ - libsrc/cx16/clrscr.s | 26 +++ - libsrc/cx16/color.s | 43 +++++ - libsrc/cx16/conio.s | 9 + - libsrc/cx16/cpeekc.s | 48 ++++++ - libsrc/cx16/cpeekcolor.s | 27 +++ - libsrc/cx16/cpeekrevers.s | 32 ++++ - libsrc/cx16/cpeeks.s | 0 - libsrc/cx16/cputc.s | 98 +++++++++++ - libsrc/cx16/crt0.s | 115 +++++++++++++ - libsrc/cx16/devnum.s | 8 + - libsrc/cx16/get_ostype.s | 20 +++ - libsrc/cx16/get_tv.s | 31 ++++ - libsrc/cx16/irq.s | 48 ++++++ - libsrc/cx16/joy/cx16-stdjoy.s | 119 +++++++++++++ - libsrc/cx16/joy_stat_stddrv.s | 10 ++ - libsrc/cx16/joy_stddrv.s | 13 ++ - libsrc/cx16/kbhit.s | 17 ++ - libsrc/cx16/kernal.s | 59 +++++++ - libsrc/cx16/libref.s | 18 ++ - libsrc/cx16/mainargs.s | 137 +++++++++++++++ - libsrc/cx16/revers.s | 23 +++ - libsrc/cx16/set_tv.s | 32 ++++ - libsrc/cx16/status.s | 6 + - libsrc/cx16/sysuname.s | 37 ++++ - libsrc/cx16/videomode.s | 30 ++++ - libsrc/cx16/waitvsync.s | 17 ++ - src/ca65/main.c | 6 +- - src/cc65/main.c | 4 + - src/common/target.c | 16 +- - src/common/target.h | 4 +- - testcode/lib/joy-test.c | 86 +++++---- - 49 files changed, 2440 insertions(+), 59 deletions(-) - create mode 100644 asminc/cx16.inc - create mode 100644 cfg/cx16-asm.cfg - create mode 100644 cfg/cx16-bank.cfg - create mode 100644 cfg/cx16.cfg - create mode 100644 doc/cx16.sgml - create mode 100644 include/cx16.h - create mode 100644 libsrc/cx16/_scrsize.s - create mode 100644 libsrc/cx16/bankramaddr.s - create mode 100644 libsrc/cx16/bordercolor.s - create mode 100644 libsrc/cx16/break.s - create mode 100644 libsrc/cx16/cgetc.s - create mode 100644 libsrc/cx16/clrscr.s - create mode 100644 libsrc/cx16/color.s - create mode 100644 libsrc/cx16/conio.s - create mode 100644 libsrc/cx16/cpeekc.s - create mode 100644 libsrc/cx16/cpeekcolor.s - create mode 100644 libsrc/cx16/cpeekrevers.s - create mode 100644 libsrc/cx16/cpeeks.s - create mode 100644 libsrc/cx16/cputc.s - create mode 100644 libsrc/cx16/crt0.s - create mode 100644 libsrc/cx16/devnum.s - create mode 100644 libsrc/cx16/get_ostype.s - create mode 100644 libsrc/cx16/get_tv.s - create mode 100644 libsrc/cx16/irq.s - create mode 100644 libsrc/cx16/joy/cx16-stdjoy.s - create mode 100644 libsrc/cx16/joy_stat_stddrv.s - create mode 100644 libsrc/cx16/joy_stddrv.s - create mode 100644 libsrc/cx16/kbhit.s - create mode 100644 libsrc/cx16/kernal.s - create mode 100644 libsrc/cx16/libref.s - create mode 100644 libsrc/cx16/mainargs.s - create mode 100644 libsrc/cx16/revers.s - create mode 100644 libsrc/cx16/set_tv.s - create mode 100644 libsrc/cx16/status.s - create mode 100644 libsrc/cx16/sysuname.s - create mode 100644 libsrc/cx16/videomode.s - create mode 100644 libsrc/cx16/waitvsync.s - -diff --git a/asminc/cbm_kernal.inc b/asminc/cbm_kernal.inc -index 29a6e5dd..79edce06 100644 ---- a/asminc/cbm_kernal.inc -+++ b/asminc/cbm_kernal.inc -@@ -1,30 +1,45 @@ - ; - ; Olli Savia <ops@iki.fi> - ; --; Commodore kernal functions -+; Commodore Kernal functions - ; - -+.if .def(__CX16__) -+ ; CX16 extended jump table -+ GETJOY := $FF06 -+.endif -+ - .if .def(__C128__) -- ; C128 Extended jump table -+ ; C128 extended jump table - C64MODE := $FF4D -- SWAPPER := $FF5F - SETBNK := $FF68 - .endif - --.if .def(__C64__) || .def(__C128__) || .def(__C16__) -+.if .def(__C128__) || .def(__CX16__) -+ ; Extended jump table -+ CLSALL := $FF4A -+ SWAPPER := $FF5F -+ JSRFAR := $FF6E -+ INDFET := $FF74 -+ INDSTA := $FF77 -+ INDCMP := $FF7A -+ PRIMM := $FF7D -+.endif -+ -+.if .def(__C64__) || .def(__C128__) || .def(__C16__) || .def(__CX16__) - CINT := $FF81 - IOINIT := $FF84 - RAMTAS := $FF87 - .elseif .def(__VIC20__) -- CINT := $E518 ; No entries are in the kernal jump table of the Vic20 for these three (3) functions. -+ CINT := $E518 ; No entries are in the Kernal jump table of the VIC-20 for these three (3) functions. - IOINIT := $FDF9 ; The entries for these functions have been set to point directly to the functions -- RAMTAS := $FD8D ; in the kernal to maintain compatibility with the other Commodore platforms. -+ RAMTAS := $FD8D ; in the Kernal, to maintain compatibility with the other Commodore platforms. - .elseif .def(__CBM510__) || .def(__CBM610__) - IOINIT := $FF7B - CINT := $FF7E - .endif - --.if .def(__VIC20__) || .def(__C64__) || .def(__C128__) || .def(__C16__) -+.if .def(__VIC20__) || .def(__C64__) || .def(__C128__) || .def(__C16__) || .def(__CX16__) - RESTOR := $FF8A - VECTOR := $FF8D - .elseif .def(__CBM510__) || .def(__CBM610__) -@@ -32,7 +47,7 @@ - RESTOR := $FF87 - .endif - --.if .def(__CBM510__) || .def(__CBM610__) || .def(__VIC20__) || .def(__C64__) || .def(__C128__) || .def(__C16__) -+.if .def(__CBM510__) || .def(__CBM610__) || .def(__VIC20__) || .def(__C64__) || .def(__C128__) || .def(__C16__) || .def(__CX16__) - SETMSG := $FF90 - SECOND := $FF93 - TKSA := $FF96 -@@ -64,7 +79,7 @@ CHRIN := $FFCF - BSOUT := $FFD2 - CHROUT := $FFD2 - --.if .def(__CBM510__) || .def(__CBM610__) || .def(__VIC20__) || .def(__C64__) || .def(__C128__) || .def(__C16__) -+.if .def(__CBM510__) || .def(__CBM610__) || .def(__VIC20__) || .def(__C64__) || .def(__C128__) || .def(__C16__) || .def(__CX16__) - LOAD := $FFD5 - SAVE := $FFD8 - SETTIM := $FFDB -@@ -77,7 +92,7 @@ GETIN := $FFE4 - CLALL := $FFE7 - UDTIM := $FFEA - --.if .def(__CBM510__) || .def(__CBM610__) || .def(__VIC20__) || .def(__C64__) || .def(__C128__) || .def(__C16__) -+.if .def(__CBM510__) || .def(__CBM610__) || .def(__VIC20__) || .def(__C64__) || .def(__C128__) || .def(__C16__) || .def(__CX16__) - SCREEN := $FFED - PLOT := $FFF0 - IOBASE := $FFF3 -@@ -102,7 +117,6 @@ UDTIM := $FFEA - CURS_SET := $CD57 - CURS_ON := $CD6F - CURS_OFF := $CD9F -- INDFET := $FF74 - .elseif .def(__C16__) - CLRSCR := $D88B - KBDREAD := $D8C1 -diff --git a/asminc/cx16.inc b/asminc/cx16.inc -new file mode 100644 -index 00000000..6f3f1c73 ---- /dev/null -+++ b/asminc/cx16.inc -@@ -0,0 +1,316 @@ -+; -+; CX16 definitions -+; -+ -+; --------------------------------------------------------------------------- -+; Constants -+ -+.enum COLOR -+ BLACK = $00 -+ WHITE -+ RED -+ CYAN -+ VIOLET -+ PURPLE = VIOLET -+ GREEN -+ BLUE -+ YELLOW -+ ORANGE -+ BROWN -+ LIGHTRED -+ GRAY1 -+ GRAY2 -+ LIGHTGREEN -+ LIGHTBLUE -+ GRAY3 -+.endenum -+ -+; Special keys -+.enum KEY -+ F1 = $85 -+ F3 -+ F5 -+ F7 -+ F2 -+ F4 -+ F6 -+ F8 -+ F9 = $10 -+ F10 = $15 -+ F11 -+ F12 -+.endenum -+ -+; --------------------------------------------------------------------------- -+; Zero page -+ -+; BASIC -+VARTAB := $2D ; Pointer to start of BASIC variables -+MEMSIZE := $37 ; Pointer to highest BASIC RAM location (+1) -+TXTPTR := $7A ; Pointer into BASIC source code -+ -+; Kernal -+IN_DEV := $99 ; Current input device number -+OUT_DEV := $9A ; Current output device number -+IMPARM := $9B ; Pointer for PRIMM function -+TIME := $A0 ; 60 Hz. clock -+FNAM_LEN := $B7 ; Length of filename -+SECADR := $B9 ; Secondary address -+DEVNUM := $BA ; Device number -+FNAM := $BB ; Pointer to filename -+KEY_COUNT := $C6 ; Number of keys in input buffer -+RVS := $C7 ; Reverse flag -+CURS_FLAG := $CC ; 1 = cursor off -+CURS_BLINK := $CD ; Blink counter -+CURS_CHAR := $CE ; Character under the cursor -+CURS_STATE := $CF ; Cursor blink state -+SCREEN_PTR := $D1 ; Pointer to current row on text screen (16 bits) -+CURS_X := $D3 ; Cursor column -+CURS_Y := $D6 ; Cursor row -+LLEN := $D9 ; Line length -+NLINES := $DA ; Number of screen lines -+JOY1 := $EF ; 3 bytes of NES/SNES gamepad data -+JOY2 := $F2 -+FREKZP := $FB ; Five unused bytes -+ -+; Page two -+ -+BASIC_BUF := $200 ; Location of command-line -+BASIC_BUF_LEN = 89 ; Maximum length of command-line -+ -+CHARCOLOR := $286 -+CURS_COLOR := $287 ; Color under the cursor -+ -+; --------------------------------------------------------------------------- -+; Vector and other locations -+ -+IRQVec := $0314 -+BRKVec := $0316 -+NMIVec := $0318 -+ -+; --------------------------------------------------------------------------- -+; I/O locations -+ -+; Video Enhanced Retro Adapter -+; Has audio, SPI, and UART. -+.scope VERA -+ ; External registers -+ .struct -+ .org $9F20 -+ ADDR .faraddr ; Address for data port access -+ DATA0 .byte ; First data port -+ DATA1 .byte ; Second data port -+ CTRL .byte ; Control register -+ IRQ_EN .byte ; Interrupt enable bits -+ IRQ_FLAGS .byte ; Interrupt flags -+ .endstruct -+ .enum ; Address automatic increment amounts -+ INC0 = 0 << 4 -+ INC1 = 1 << 4 -+ INC2 = 2 << 4 -+ INC4 = 3 << 4 -+ INC8 = 4 << 4 -+ INC16 = 5 << 4 -+ INC32 = 6 << 4 -+ INC64 = 7 << 4 -+ INC128 = 8 << 4 -+ INC256 = 9 << 4 -+ INC512 = 10 << 4 -+ INC1024 = 11 << 4 -+ INC2048 = 12 << 4 -+ INC4096 = 13 << 4 -+ INC8192 = 14 << 4 -+ INC16384 = 15 << 4 -+ .endenum -+ ; Internal RAM and registers -+ VRAM := $000000 -+ .scope COMPOSER ; Display composer -+ .struct -+ .org $0F0000 -+ VIDEO .byte -+ HSCALE .byte -+ VSCALE .byte -+ FRAME .byte -+ HSTART_LO .byte -+ HSTOP_LO .byte -+ VSTART_LO .byte -+ VSTOP_LO .byte -+ STRTSTOP_HI .byte -+ IRQ_LINE .word -+ .endstruct -+ .enum MODE ; Output mode -+ DISABLE = 0 -+ VGA -+ NTSC -+ RGB ; Interlaced, composite sync -+ .endenum -+ .enum -+ ENABLE_COLOR = 0 << 2 -+ DISABLE_COLOR = 1 << 2 ; NTSC monochrome -+ .endenum -+ .endscope -+ PALETTE := $0F1000 -+ .struct L0 ; Layer 0 registers -+ .org $0F2000 -+ CTRL0 .byte ; Display mode control -+ CTRL1 .byte ; Geometry control -+ MAP_BASE .addr -+ TILE_BASE .addr -+ HSCROLL .word ; Horizontal scroll -+ VSCROLL .word ; Vertical scroll -+ .endstruct -+ .struct L1 ; Layer 1 registers (same as layer 0) -+ .org $0F3000 -+ CTRL0 .byte -+ CTRL1 .byte -+ MAP_BASE .addr -+ TILE_BASE .addr -+ HSCROLL .word -+ VSCROLL .word -+ .endstruct -+ .enum MAP ; Map geometry -+ WIDTH32 = 0 -+ WIDTH64 -+ WIDTH128 -+ WIDTH256 -+ HEIGHT32 = 0 << 2 -+ HEIGHT64 = 1 << 2 -+ HEIGHT128 = 2 << 2 -+ HEIGHT256 = 3 << 2 -+ .endenum -+ .scope TILE ; Tile geometry -+ .enum -+ WIDTH8 = 0 << 4 -+ WIDTH16 = 1 << 4 -+ WIDTH320 = WIDTH8 -+ WIDTH640 = WIDTH16 -+ HEIGHT8 = 0 << 5 -+ HEIGHT16 = 1 << 5 -+ .endenum -+ .enum FLIP -+ NONE = 0 << 2 -+ HORIZ = 1 << 2 -+ VERT = 2 << 2 -+ BOTH = 3 << 2 -+ .endenum -+ .endscope -+ .enum DMODE ; Display modes -+ TEXT16 = 0 << 5 -+ TEXT256 = 1 << 5 -+ TILE4 = 2 << 5 -+ TILE16 = 3 << 5 -+ TILE256 = 4 << 5 -+ BITMAP4 = 5 << 5 -+ BITMAP16 = 6 << 5 -+ BITMAP256 = 7 << 5 -+ .endenum -+ .scope SPRITE -+ .struct -+ .org $0F4000 -+ CTRL .byte ; Enables sprites -+ COLLISION .byte -+ .endstruct -+ .enum FLIP -+ NONE = 0 -+ HORIZ -+ VERT -+ BOTH -+ .endenum -+ .enum ; Sprite geometry -+ WIDTH8 = 0 << 4 -+ WIDTH16 = 1 << 4 -+ WIDTH32 = 2 << 4 -+ WIDTH64 = 3 << 4 -+ HEIGHT8 = 0 << 6 -+ HEIGHT16 = 1 << 6 -+ HEIGHT32 = 2 << 6 -+ HEIGHT64 = 3 << 6 -+ COLORS16 = 0 << 7 -+ COLORS256 = 1 << 7 -+ .endenum -+ .enum DEPTH -+ DISABLE = 0 << 2 -+ CANVAS = 1 << 2 -+ LAYER0 = 2 << 2 -+ LAYER1 = 3 << 2 -+ .endenum -+ ATTRIB := $0F5000 ; Sprite attributes -+ .endscope -+ AUDIO := $0F6000 -+ .scope SPI -+ .struct -+ .org $0F7000 -+ DATA .byte -+ CONTROL .byte -+ .endstruct -+ .enum -+ DESELECT = 0 -+ SELECT -+ BUSY_MASK = 1 << 1 -+ .endenum -+ .endscope -+ .scope UART ; Universal Asyncronous Receiver Transmitter -+ .struct -+ .org $0F8000 -+ DATA .byte -+ STATUS .byte -+ BPS_DIV .word -+ .endstruct -+ .enum MASK -+ RECEIVE = 1 << 0 -+ TRANSMIT = 1 << 1 -+ .endenum -+ .endscope -+.endscope -+ -+; 65c22 -+.struct VIA1 ; Versatile Interface Adapter -+ .org $9F60 -+ PRB .byte ; ROM bank, IEC (Port Register B) -+ PRA .byte ; RAM bank (Port Register A) -+ DDRB .byte ; (Data Direction Register B) -+ DDRA .byte ; (Data Direction Register A) -+ T1 .word ; (Timer 1) -+ T1L .word ; (Timer 1 Latch) -+ T2 .word ; (Timer 2) -+ SR .byte ; (Shift Register) -+ ACR .byte ; (Auxiliary Control Register) -+ PCR .byte ; (Peripheral Control Register) -+ IFR .byte ; (Interrupt Flags Register) -+ IER .byte ; (Interrupt Enable Register) -+ PRA2 .byte ; RAM bank (Port Register A without handshaking) -+.endstruct -+ -+; 65c22 -+.struct VIA2 -+ .org $9F70 -+ PRB .byte -+ PRA .byte ; NES controller communication -+ DDRB .byte -+ DDRA .byte -+ T1 .word -+ T1L .word -+ T2 .word -+ SR .byte -+ ACR .byte -+ PCR .byte -+ IFR .byte -+ IER .byte -+ PRA2 .byte -+.endstruct -+ -+; Real-Time Clock -+ -+; X16 Emulator device -+; This device doesn't exist on the real machine. -+.struct EMULATOR -+ .org $9FB0 -+ DEBUG .byte ; Boolean: debugging enabled -+ VIDACCESSLOG .byte ; Boolean: log VERA activity -+ KEYBOARDLOG .byte ; Boolean: log keyboard data -+ ECHO .byte ; Boolean: echo enabled -+ SAVEXIT .byte ; Boolean: save on exit -+ .res $D - $5 -+ KEYMAP .byte ; Current keyboard layout number -+ DETECT .byte 2 ; If is "16" string, then running on emulator -+.endstruct -diff --git a/cfg/cx16-asm.cfg b/cfg/cx16-asm.cfg -new file mode 100644 -index 00000000..53f6da17 ---- /dev/null -+++ b/cfg/cx16-asm.cfg -@@ -0,0 +1,37 @@ -+FEATURES { -+ STARTADDRESS: default = $0801; -+} -+SYMBOLS { -+ __LOADADDR__: type = import; -+ __HIMEM__: type = weak, value = $9F00; -+} -+MEMORY { -+ ZP: file = "", start = $0004, size = $0090 - $0004, define = yes; -+ LOADADDR: file = %O, start = %S - 2, size = $0002; -+ MAIN: file = %O, start = %S, size = __HIMEM__ - %S; -+} -+SEGMENTS { -+ ZEROPAGE: load = ZP, type = zp; -+ LOADADDR: load = LOADADDR, type = ro; -+ EXEHDR: load = MAIN, type = ro, optional = yes; -+ LOWCODE: load = MAIN, type = ro, optional = yes; -+ CODE: load = MAIN, type = ro; -+ RODATA: load = MAIN, type = ro; -+ DATA: load = MAIN, type = rw; -+ BSS: load = MAIN, type = bss, define = yes; -+} -+FEATURES { -+ CONDES: type = constructor, -+ label = __CONSTRUCTOR_TABLE__, -+ count = __CONSTRUCTOR_COUNT__, -+ segment = ONCE; -+ CONDES: type = destructor, -+ label = __DESTRUCTOR_TABLE__, -+ count = __DESTRUCTOR_COUNT__, -+ segment = RODATA; -+ CONDES: type = interruptor, -+ label = __INTERRUPTOR_TABLE__, -+ count = __INTERRUPTOR_COUNT__, -+ segment = RODATA, -+ import = __CALLIRQ__; -+} -diff --git a/cfg/cx16-bank.cfg b/cfg/cx16-bank.cfg -new file mode 100644 -index 00000000..52438fba ---- /dev/null -+++ b/cfg/cx16-bank.cfg -@@ -0,0 +1,112 @@ -+FEATURES { -+ STARTADDRESS: default = $0801; -+} -+SYMBOLS { -+ __LOADADDR__: type = import; -+ __EXEHDR__: type = import; -+ __BANKRAMADDR__: type = import; -+ __STACKSIZE__: type = weak, value = $0800; # 2K stack -+ __HIMEM__: type = weak, value = $9F00; -+ __BANKRAMSTART__: type = export, value = $A000; -+ __BANKRAMSIZE__: type = weak, value = $2000; # 8K banked RAM -+} -+MEMORY { -+ ZP: file = "", define = yes, start = $0004, size = $0090 - $0004; -+ LOADADDR: file = %O, start = %S - 2, size = $0002; -+ HEADER: file = %O, define = yes, start = %S, size = $000D; -+ MAIN: file = %O, define = yes, start = __HEADER_LAST__, size = __HIMEM__ - __HEADER_LAST__; -+ BSS: file = "", start = __ONCE_RUN__, size = __HIMEM__ - __ONCE_RUN__ - __STACKSIZE__; -+ BRAM00ADDR: file = "%O.00", start = __BANKRAMSTART__ - 2, size = $0002; -+ BRAM00: file = "%O.00", start = __BANKRAMSTART__, size = __BANKRAMSIZE__; -+ BRAM01ADDR: file = "%O.01", start = __BANKRAMSTART__ - 2, size = $0002; -+ BRAM01: file = "%O.01", start = __BANKRAMSTART__, size = __BANKRAMSIZE__; -+ BRAM02ADDR: file = "%O.02", start = __BANKRAMSTART__ - 2, size = $0002; -+ BRAM02: file = "%O.02", start = __BANKRAMSTART__, size = __BANKRAMSIZE__; -+ BRAM03ADDR: file = "%O.03", start = __BANKRAMSTART__ - 2, size = $0002; -+ BRAM03: file = "%O.03", start = __BANKRAMSTART__, size = __BANKRAMSIZE__; -+ BRAM04ADDR: file = "%O.04", start = __BANKRAMSTART__ - 2, size = $0002; -+ BRAM04: file = "%O.04", start = __BANKRAMSTART__, size = __BANKRAMSIZE__; -+ BRAM05ADDR: file = "%O.05", start = __BANKRAMSTART__ - 2, size = $0002; -+ BRAM05: file = "%O.05", start = __BANKRAMSTART__, size = __BANKRAMSIZE__; -+ BRAM06ADDR: file = "%O.06", start = __BANKRAMSTART__ - 2, size = $0002; -+ BRAM06: file = "%O.06", start = __BANKRAMSTART__, size = __BANKRAMSIZE__; -+ BRAM07ADDR: file = "%O.07", start = __BANKRAMSTART__ - 2, size = $0002; -+ BRAM07: file = "%O.07", start = __BANKRAMSTART__, size = __BANKRAMSIZE__; -+ BRAM08ADDR: file = "%O.08", start = __BANKRAMSTART__ - 2, size = $0002; -+ BRAM08: file = "%O.08", start = __BANKRAMSTART__, size = __BANKRAMSIZE__; -+ BRAM09ADDR: file = "%O.09", start = __BANKRAMSTART__ - 2, size = $0002; -+ BRAM09: file = "%O.09", start = __BANKRAMSTART__, size = __BANKRAMSIZE__; -+ BRAM0AADDR: file = "%O.0a", start = __BANKRAMSTART__ - 2, size = $0002; -+ BRAM0A: file = "%O.0a", start = __BANKRAMSTART__, size = __BANKRAMSIZE__; -+ BRAM0BADDR: file = "%O.0b", start = __BANKRAMSTART__ - 2, size = $0002; -+ BRAM0B: file = "%O.0b", start = __BANKRAMSTART__, size = __BANKRAMSIZE__; -+ BRAM0CADDR: file = "%O.0c", start = __BANKRAMSTART__ - 2, size = $0002; -+ BRAM0C: file = "%O.0c", start = __BANKRAMSTART__, size = __BANKRAMSIZE__; -+ BRAM0DADDR: file = "%O.0d", start = __BANKRAMSTART__ - 2, size = $0002; -+ BRAM0D: file = "%O.0d", start = __BANKRAMSTART__, size = __BANKRAMSIZE__; -+ BRAM0EADDR: file = "%O.0e", start = __BANKRAMSTART__ - 2, size = $0002; -+ BRAM0E: file = "%O.0e", start = __BANKRAMSTART__, size = __BANKRAMSIZE__; -+ BRAM0FADDR: file = "%O.0f", start = __BANKRAMSTART__ - 2, size = $0002; -+ BRAM0F: file = "%O.0f", start = __BANKRAMSTART__, size = __BANKRAMSIZE__; -+} -+SEGMENTS { -+ ZEROPAGE: load = ZP, type = zp; -+ EXTZP: load = ZP, type = zp, optional = yes; -+ LOADADDR: load = LOADADDR, type = ro; -+ EXEHDR: load = HEADER, type = ro; -+ STARTUP: load = MAIN, type = ro; -+ LOWCODE: load = MAIN, type = ro, optional = yes; -+ CODE: load = MAIN, type = ro; -+ RODATA: load = MAIN, type = ro; -+ DATA: load = MAIN, type = rw; -+ INIT: load = MAIN, type = rw; -+ ONCE: load = MAIN, type = ro, define = yes; -+ BSS: load = BSS, type = bss, define = yes; -+ BRAM00ADDR: load = BRAM00ADDR, type = ro, optional = yes; -+ BANKRAM00: load = BRAM00, type = rw, define = yes, optional = yes; -+ BRAM01ADDR: load = BRAM01ADDR, type = ro, optional = yes; -+ BANKRAM01: load = BRAM01, type = rw, define = yes, optional = yes; -+ BRAM02ADDR: load = BRAM02ADDR, type = ro, optional = yes; -+ BANKRAM02: load = BRAM02, type = rw, define = yes, optional = yes; -+ BRAM03ADDR: load = BRAM03ADDR, type = ro, optional = yes; -+ BANKRAM03: load = BRAM03, type = rw, define = yes, optional = yes; -+ BRAM04ADDR: load = BRAM04ADDR, type = ro, optional = yes; -+ BANKRAM04: load = BRAM04, type = rw, define = yes, optional = yes; -+ BRAM05ADDR: load = BRAM05ADDR, type = ro, optional = yes; -+ BANKRAM05: load = BRAM05, type = rw, define = yes, optional = yes; -+ BRAM06ADDR: load = BRAM06ADDR, type = ro, optional = yes; -+ BANKRAM06: load = BRAM06, type = rw, define = yes, optional = yes; -+ BRAM07ADDR: load = BRAM07ADDR, type = ro, optional = yes; -+ BANKRAM07: load = BRAM07, type = rw, define = yes, optional = yes; -+ BRAM08ADDR: load = BRAM08ADDR, type = ro, optional = yes; -+ BANKRAM08: load = BRAM08, type = rw, define = yes, optional = yes; -+ BRAM09ADDR: load = BRAM09ADDR, type = ro, optional = yes; -+ BANKRAM09: load = BRAM09, type = rw, define = yes, optional = yes; -+ BRAM0AADDR: load = BRAM0AADDR, type = ro, optional = yes; -+ BANKRAM0A: load = BRAM0A, type = rw, define = yes, optional = yes; -+ BRAM0BADDR: load = BRAM0BADDR, type = ro, optional = yes; -+ BANKRAM0B: load = BRAM0B, type = rw, define = yes, optional = yes; -+ BRAM0CADDR: load = BRAM0CADDR, type = ro, optional = yes; -+ BANKRAM0C: load = BRAM0C, type = rw, define = yes, optional = yes; -+ BRAM0DADDR: load = BRAM0DADDR, type = ro, optional = yes; -+ BANKRAM0D: load = BRAM0D, type = rw, define = yes, optional = yes; -+ BRAM0EADDR: load = BRAM0EADDR, type = ro, optional = yes; -+ BANKRAM0E: load = BRAM0E, type = rw, define = yes, optional = yes; -+ BRAM0FADDR: load = BRAM0FADDR, type = ro, optional = yes; -+ BANKRAM0F: load = BRAM0F, type = rw, define = yes, optional = yes; -+} -+FEATURES { -+ CONDES: type = constructor, -+ label = __CONSTRUCTOR_TABLE__, -+ count = __CONSTRUCTOR_COUNT__, -+ segment = ONCE; -+ CONDES: type = destructor, -+ label = __DESTRUCTOR_TABLE__, -+ count = __DESTRUCTOR_COUNT__, -+ segment = RODATA; -+ CONDES: type = interruptor, -+ label = __INTERRUPTOR_TABLE__, -+ count = __INTERRUPTOR_COUNT__, -+ segment = RODATA, -+ import = __CALLIRQ__; -+} -diff --git a/cfg/cx16.cfg b/cfg/cx16.cfg -new file mode 100644 -index 00000000..f912e0f8 ---- /dev/null -+++ b/cfg/cx16.cfg -@@ -0,0 +1,45 @@ -+FEATURES { -+ STARTADDRESS: default = $0801; -+} -+SYMBOLS { -+ __LOADADDR__: type = import; -+ __EXEHDR__: type = import; -+ __STACKSIZE__: type = weak, value = $0800; # 2k stack -+ __HIMEM__: type = weak, value = $9F00; -+} -+MEMORY { -+ ZP: file = "", define = yes, start = $0004, size = $0090 - $0004; -+ LOADADDR: file = %O, start = %S - 2, size = $0002; -+ HEADER: file = %O, define = yes, start = %S, size = $000D; -+ MAIN: file = %O, define = yes, start = __HEADER_LAST__, size = __HIMEM__ - __HEADER_LAST__; -+ BSS: file = "", start = __ONCE_RUN__, size = __HIMEM__ - __ONCE_RUN__ - __STACKSIZE__; -+} -+SEGMENTS { -+ ZEROPAGE: load = ZP, type = zp; -+ EXTZP: load = ZP, type = zp, optional = yes; -+ LOADADDR: load = LOADADDR, type = ro; -+ EXEHDR: load = HEADER, type = ro; -+ STARTUP: load = MAIN, type = ro; -+ LOWCODE: load = MAIN, type = ro, optional = yes; -+ CODE: load = MAIN, type = ro; -+ RODATA: load = MAIN, type = ro; -+ DATA: load = MAIN, type = rw; -+ INIT: load = MAIN, type = rw; -+ ONCE: load = MAIN, type = ro, define = yes; -+ BSS: load = BSS, type = bss, define = yes; -+} -+FEATURES { -+ CONDES: type = constructor, -+ label = __CONSTRUCTOR_TABLE__, -+ count = __CONSTRUCTOR_COUNT__, -+ segment = ONCE; -+ CONDES: type = destructor, -+ label = __DESTRUCTOR_TABLE__, -+ count = __DESTRUCTOR_COUNT__, -+ segment = RODATA; -+ CONDES: type = interruptor, -+ label = __INTERRUPTOR_TABLE__, -+ count = __INTERRUPTOR_COUNT__, -+ segment = RODATA, -+ import = __CALLIRQ__; -+} -diff --git a/doc/ca65.sgml b/doc/ca65.sgml -index 8a5e307d..ad72189c 100644 ---- a/doc/ca65.sgml -+++ b/doc/ca65.sgml -@@ -4653,9 +4653,10 @@ compiler, depending on the target system selected: - <item><tt/__C128__/ - Target system is <tt/c128/ - <item><tt/__C16__/ - Target system is <tt/c16/ or <tt/plus4/ - <item><tt/__C64__/ - Target system is <tt/c64/ --<item><tt/__CBM__/ - Target is a Commodore system -+<item><tt/__CBM__/ - Target is a Commodore or Commodore-alike system - <item><tt/__CBM510__/ - Target system is <tt/cbm510/ - <item><tt/__CBM610__/ - Target system is <tt/cbm610/ -+<item><tt/__CX16__/ - Target system is <tt/cx16/ - <item><tt/__GEOS__/ - Target is a GEOS system - <item><tt/__GEOS_APPLE__/ - Target system is <tt/geos-apple/ - <item><tt/__GEOS_CBM__/ - Target system is <tt/geos-cbm/ -diff --git a/doc/cc65.sgml b/doc/cc65.sgml -index 601e364e..8691f947 100644 ---- a/doc/cc65.sgml -+++ b/doc/cc65.sgml -@@ -901,6 +901,10 @@ The compiler defines several macros at startup: - <item><tt/__CC65_STD_CC65__/ - </itemize> - -+ <tag><tt>__CX16__</tt></tag> -+ -+ This macro is defined if the target is the Commander X16 (-t cx16). -+ - <tag><tt>__DATE__</tt></tag> - - This macro expands to the date of translation of the preprocessing -diff --git a/doc/cx16.sgml b/doc/cx16.sgml -new file mode 100644 -index 00000000..077458bf ---- /dev/null -+++ b/doc/cx16.sgml -@@ -0,0 +1,311 @@ -+<!doctype linuxdoc system> -+ -+<article> -+<title>Commander X16-specific information for cc65 -+<author><url url="mailto:greg.king5@verizon.net" name="Greg King"> -+ -+<abstract> -+An overview over the CX16 run-time system as it's implemented for the cc65 C -+compiler. -+</abstract> -+ -+<!-- Table of contents --> -+<toc> -+ -+<!-- Begin the document --> -+ -+<sect>Overview<p> -+ -+The Commander X16 is a modern small computer with firmware that is based on -+the ROMs in Commodore's VIC-20 and 64C. It has a couple of the I/O chips that -+are in the VIC-20. -+ -+This file contains an overview of the CX16 run-time system as it comes with the -+cc65 C compiler. It describes the memory layout, CX16-specific header files, -+available drivers, and any pitfalls specific to that platform. -+ -+Please note that CX16-specific functions just are mentioned here; they are -+described in detail in the separate <url url="funcref.html" name="function -+reference">. Even functions marked as "platform dependent" may be available on -+more than one platform. Please see the function reference for more -+information. -+ -+ -+ -+<sect>Binary format<p> -+ -+The standard binary output format generated by the linker for the CX16 target -+is a machine language program with a one-line BASIC stub which calls the -+machine language part via SYS. That means that a program can be loaded as a -+BASIC program, and started with RUN. It is, of course, possible to change that -+behaviour by using a modified start-up file and linker config. -+ -+ -+ -+<sect>Memory layout<p> -+ -+cc65-generated programs with the default setup run with the I/O area and the -+Kernal ROM visible. That means that Kernal entry points can be called directly. -+The usable memory ranges are $0800 - $9EFF and $A000 - -+$BFFF. -+ -+Special locations: -+ -+<descrip> -+ <tag/Stack/ -+ The C run-time stack is located at $9EFF, and grows downward. -+ -+ <tag/Heap/ -+ The C heap is located at the end of the program, and grows toward the C -+ run-time stack. -+ -+ <tag/Bank RAM/ -+ Bank RAM is located at $A000 - $BFFF. It's an eight-Kibibyte -+ window into a half Mibibyte or two Mibibytes of banked RAM. -+ -+ <tag/Bank ROM/ -+ Bank ROM is located at $C000 - $FFFF. It's a sixteen-Kibibyte -+ window into 128 Kibibytes of banked ROM. -+</descrip><p> -+ -+ -+ -+<sect>Linker configurations<p> -+ -+The ld65 linker comes with a default config. file for the Commander X16, which -+is used via <tt/-t cx16/. The cx16 package comes with additional secondary -+linker config. files which are used via <tt/-t cx16 -C <configfile>/. -+ -+ -+<sect1>Default config. file (<tt/cx16.cfg/)<p> -+ -+The default configuration is tailored to C programs. It supplies the load -+address and a small BASIC stub that starts the compiled program using a SYS -+command. -+ -+ -+<sect1><tt/cx16-asm.cfg/<p> -+ -+This configuration is made for Assembly programmers who don't need a special -+setup. The default start address is $0801. It can be changed with the -+linker command-line option <tt/--start-addr/ or <tt/-S/. All standard segments, -+with the exception of <tt/ZEROPAGE/, are written to the output file; -+and, a two-byte load address is prepended. -+ -+To use that config. file, assemble with <tt/-t cx16/, and link with <tt/-C -+cx16-asm.cfg/. The former will make sure that the correct character -+translations are in effect, while the latter supplies the actual config. -+When using <tt/cl65/, use both command-line options. -+ -+Sample command line for <tt/cl65/: -+<tscreen><verb> -+cl65 -o file.prg -t cx16 -C cx16-asm.cfg source.s -+</verb></tscreen> -+ -+To generate code that loads to $A000: -+<tscreen><verb> -+cl65 -o file.prg -Wl -S,$A000 -t cX16 -C cX16-asm.cfg source.s -+</verb></tscreen> -+ -+It also is possible to add a small BASIC header to the program, that uses SYS -+to jump to the program entry point (which is the start of the code segment). -+The advantage is that the program can be started using RUN. -+ -+To generate a program with a BASIC SYS header, use -+<tscreen><verb> -+cl65 -o file.prg -u __EXEHDR__ -t cx16 -C cx16-asm.cfg source.s -+</verb></tscreen> -+ -+Please note that, in this case, a changed start address doesn't make sense, -+because the program must be loaded to BASIC's start address. -+ -+ -+ -+<sect>Platform-specific header files<p> -+ -+Programs containing CX16-specific code may use the <tt/cx16.h/ or <tt/cbm.h/ -+header files. Using the later may be an option when writing code for more than -+one CBM-like platform, because it includes <tt/cx16.h/, and declares several -+functions common to all CBM-like platforms. -+ -+ -+<sect1>CX16-specific functions<p> -+ -+The functions listed below are special for the CX16. See the <url -+url="funcref.html" name="function reference"> for declarations and usage. -+ -+<itemize> -+<item>get_ostype() -+<item>set_tv() -+<item>videomode() -+<item>waitvsync() -+</itemize> -+ -+ -+<sect1>CBM-specific functions<p> -+ -+Some functions are available for all (or, at least most) of the Commodore-like -+machines. See the <url url="funcref.html" name="function reference"> for -+declarations and usage. -+ -+<itemize> -+<item>cbm_close() -+<item>cbm_closedir() -+<item>cbm_k_basin() -+<item>cbm_k_bsout() -+<item>cbm_k_chkin() -+<item>cbm_k_ckout() -+<item>cbm_k_close() -+<item>cbm_k_clrch() -+<item>cbm_k_load() -+<item>cbm_k_open() -+<item>cbm_k_readst() -+<item>cbm_k_save() -+<item>cbm_k_second() -+<item>cbm_k_setlfs() -+<item>cbm_k_setnam() -+<item>cbm_k_tksa() -+<item>cbm_load() -+<item>cbm_open() -+<item>cbm_opendir() -+<item>cbm_read() -+<item>cbm_readdir() -+<item>cbm_save() -+<item>cbm_write() -+<item>get_tv() -+</itemize> -+ -+ -+<sect1>Hardware access<p> -+ -+The following pseudo variables declared in the <tt/cx16.h/ header file do allow -+access to hardware located in the address space. Some variables are -+structures, accessing the struct fields will access the chip registers. -+ -+<descrip> -+ <tag><tt/VERA/</tag> -+ The <tt/VERA/ structure allows access -+ to the Video Enhanced Retro Adapter chip. -+ -+ <tag><tt/VIA1, VIA2/</tag> -+ Access to the two VIA (Versatile Interface Adapter) chips is available via -+ the <tt/VIA1/ and <tt/VIA2/ variables. The structure behind those variables -+ is explained in <tt/_6522.h/. -+ -+ <tag><tt/BANK_RAM/</tag> -+ A character array that mirrors the eight-Kibibyte window, at $A000, -+ into banked RAM. -+</descrip><p> -+ -+ -+ -+<sect>Loadable drivers<p> -+ -+The names in the parentheses denote the symbols to be used for static linking of the drivers. -+ -+ -+<sect1>Graphics drivers<p> -+ -+No graphics drivers are available currently for the CX16. -+ -+ -+<sect1>Extended memory drivers<p> -+ -+No extended memory drivers are available currently for the CX16. -+ -+ -+<sect1>Joystick drivers<p> -+ -+The default drivers, <tt/joy_stddrv (joy_static_stddrv)/, -+point to <tt/cX16-stdjoy.joy (cx16_stdjoy_joy)/. -+ -+<descrip> -+ <tag><tt/cX16-stdjoy.joy (cX16_stdjoy_joy)/</tag> -+ Supports up to two NES and SNES controllers connected to the joystick ports -+ of the CX16. It reads the four directions, and the A, B, Select, and Start -+ buttons. Button A is the primary fire button. -+</descrip><p> -+ -+ -+<sect1>Mouse drivers<p> -+ -+No mouse drivers are available currently for the CX16. -+ -+ -+<sect1>RS232 device drivers<p> -+ -+No serial drivers are available currently for the CX16. -+ -+ -+ -+<sect>Limitations<p> -+ -+The Commander X16 still is being designed. It's configuration can change at -+any time. Some changes could make old programs fail to work. -+ -+ -+ -+<sect>Other hints<p> -+ -+ -+<sect1>Escape code<p> -+ -+For an Esc, press <tt/Ctrl/ and the <tt/[/ key. -+ -+ -+<sect1>Passing arguments to the program<p> -+ -+Command-line arguments can be passed to <tt/main()/. Because that is not -+supported directly by BASIC, the following syntax was chosen: -+<tscreen><verb> -+ RUN:REM ARG1 " ARG2 IS QUOTED" ARG3 "" ARG5 -+</verb></tscreen> -+ -+<enum> -+<item>Arguments are separated by spaces. -+<item>Arguments may be quoted. -+<item>Leading and trailing spaces around an argument are ignored. Spaces within -+ a quoted argument are allowed. -+<item>The first argument passed to <tt/main()/ is the program name. -+<item>A maximum number of 10 arguments (including the program name) are -+ supported. -+</enum> -+ -+ -+<sect1>Program return code<p> -+ -+The program return code (low byte) is passed back to BASIC by use of the -+<tt/ST/ variable. -+ -+ -+<sect1>Interrupts<p> -+ -+The run-time for the CX16 uses routines marked as <tt/.INTERRUPTOR/ for -+interrupt handlers. Such routines must be written as simple machine language -+subroutines, and will be called automatically by the interrupt handler code -+if they are linked into a program. See the discussion of the <tt/.CONDES/ -+feature in the <url url="ca65.html" name="assembler manual">. -+ -+ -+ -+<sect>License<p> -+ -+This software is provided "as-is", without any expressed or implied -+warranty. In no event will the authors be held liable for any damages -+arising from the use of this software. -+ -+Permission is granted to anyone to use this software for any purpose, -+including commercial applications, and to alter it and redistribute it -+freely, subject to the following restrictions: -+<enum> -+<item> The origin of this software must not be misrepresented; you must not -+ claim that you wrote the original software. If you use this software -+ in a product, an acknowledgment in the product documentation would be -+ appreciated, but is not required. -+<item> Altered source versions must be plainly marked as such, and must not -+ be misrepresented as being the original software. -+<item> This notice may not be removed or altered from any source -+ distribution. -+</enum> -+ -+</article> -diff --git a/doc/index.sgml b/doc/index.sgml -index aecfb7de..01325529 100644 ---- a/doc/index.sgml -+++ b/doc/index.sgml -@@ -145,6 +145,9 @@ - <tag><htmlurl url="creativision.html" name="creativision.html"></tag> - Topics specific to the Creativision Console. - -+ <tag><htmlurl url="cx16.html" name="cx16.html"></tag> -+ Topics specific to the Commander X16. -+ - <tag><htmlurl url="gamate.html" name="gamate.html"></tag> - Topics specific to the Bit Corporation Gamate Console. - -diff --git a/doc/intro.sgml b/doc/intro.sgml -index 994d30bc..b2b141d1 100644 ---- a/doc/intro.sgml -+++ b/doc/intro.sgml -@@ -402,11 +402,36 @@ RUN - The emulation, also, supports that method. - - -+<sect1>Commander X16 -+ -+<sect2>x16-emulator<p> -+Available at <url -+url="https://github.com/commanderx16/x16-emulator/releases">: -+ -+Emulates the Commander X16 Single Board Computer, with sound, SD card images, -+VGA and NTSC video, and a NES game controller emulation. Includes a monitor. -+It runs on all SDL2 platforms. -+ -+Compile the tutorial with -+<tscreen><verb> -+cl65 -O -t cx16 hello.c text.s -+</verb></tscreen> -+ -+Start the emulator. Then, type -+<tscreen><verb> -+LOAD"HELLO",1 -+RUN -+</verb></tscreen> -+(Type those lines in lower-case; but, they will appear as upper-case.) -+ -+On a real computer, you would type an <tt/8/ instead of a <tt/1/. -+ -+ - <sect1>Commodore - - <sect2>VICE<p> - Available at <url --url="http://vice-emu.sourceforge.net/">: -+url="https://vice-emu.sourceforge.net/">: - - Emulates Commodore 64/128/VIC-20/PET/CBM II/Plus 4 computers. Supports - printers, serial port and adapters, stereo sound, disk drives and images, RAM expansions, -diff --git a/include/cbm.h b/include/cbm.h -index 0a2d6469..d9b31543 100644 ---- a/include/cbm.h -+++ b/include/cbm.h -@@ -65,6 +65,8 @@ - # include <cbm610.h> - #elif defined(__PET__) && !defined(_PET_H) - # include <pet.h> -+#elif defined(__CX16__) && !defined(_CX16_H) -+# include <cx16.h> - #endif - - /* Include definitions for CBM file types */ -@@ -300,5 +302,3 @@ void __fastcall__ cbm_closedir (unsigned char lfn); - - /* End of cbm.h */ - #endif -- -- -diff --git a/include/cx16.h b/include/cx16.h -new file mode 100644 -index 00000000..db32d846 ---- /dev/null -+++ b/include/cx16.h -@@ -0,0 +1,189 @@ -+/*****************************************************************************/ -+/* */ -+/* cx16.h */ -+/* */ -+/* CX16 system-specific definitions */ -+/* */ -+/* */ -+/* This software is provided "as-is", without any expressed or implied */ -+/* warranty. In no event will the authors be held liable for any damages */ -+/* arising from the use of this software. */ -+/* */ -+/* Permission is granted to anyone to use this software for any purpose, */ -+/* including commercial applications, and to alter it and redistribute it */ -+/* freely, subject to the following restrictions: */ -+/* */ -+/* 1. The origin of this software must not be misrepresented; you must not */ -+/* claim that you wrote the original software. If you use this software */ -+/* in a product, an acknowledgment in the product documentation would be */ -+/* appreciated, but is not required. */ -+/* 2. Altered source versions must be plainly marked as such, and must not */ -+/* be misrepresented as being the original software. */ -+/* 3. This notice may not be removed or altered from any source */ -+/* distribution. */ -+/* */ -+/*****************************************************************************/ -+ -+ -+ -+#ifndef _CX16_H -+#define _CX16_H -+ -+ -+ -+/* Check for errors */ -+#ifndef __CX16__ -+# error This module may be used only when compiling for the CX16! -+#endif -+ -+ -+ -+/*****************************************************************************/ -+/* Data */ -+/*****************************************************************************/ -+ -+ -+ -+/* Additional key defines */ -+#define CH_F1 0x85 -+#define CH_F2 0x89 -+#define CH_F3 0x86 -+#define CH_F4 0x8A -+#define CH_F5 0x87 -+#define CH_F6 0x8B -+#define CH_F7 0x88 -+#define CH_F8 0x8C -+#define CH_F9 0x10 -+#define CH_F10 0x15 -+#define CH_F11 0x16 -+#define CH_F12 0x17 -+ -+/* Color defines */ -+#define COLOR_BLACK 0x00 -+#define COLOR_WHITE 0x01 -+#define COLOR_RED 0x02 -+#define COLOR_CYAN 0x03 -+#define COLOR_VIOLET 0x04 -+#define COLOR_PURPLE COLOR_VIOLET -+#define COLOR_GREEN 0x05 -+#define COLOR_BLUE 0x06 -+#define COLOR_YELLOW 0x07 -+#define COLOR_ORANGE 0x08 -+#define COLOR_BROWN 0x09 -+#define COLOR_LIGHTRED 0x0A -+#define COLOR_GRAY1 0x0B -+#define COLOR_GRAY2 0x0C -+#define COLOR_LIGHTGREEN 0x0D -+#define COLOR_LIGHTBLUE 0x0E -+#define COLOR_GRAY3 0x0F -+ -+/* Masks for joy_read() */ -+#define JOY_BTN_1_MASK 0x80 -+#define JOY_BTN_2_MASK 0x40 -+#define JOY_BTN_3_MASK 0x20 -+#define JOY_BTN_4_MASK 0x10 -+#define JOY_UP_MASK 0x08 -+#define JOY_DOWN_MASK 0x04 -+#define JOY_LEFT_MASK 0x02 -+#define JOY_RIGHT_MASK 0x01 -+ -+#define JOY_BTN_A_MASK JOY_BTN_1_MASK -+#define JOY_BTN_B_MASK JOY_BTN_2_MASK -+#define JOY_SELECT_MASK JOY_BTN_3_MASK -+#define JOY_START_MASK JOY_BTN_4_MASK -+ -+#define JOY_BTN_A(v) ((v) & JOY_BTN_A_MASK) -+#define JOY_BTN_B(v) ((v) & JOY_BTN_B_MASK) -+#define JOY_SELECT(v) ((v) & JOY_SELECT_MASK) -+#define JOY_START(v) ((v) & JOY_START_MASK) -+ -+#define JOY_FIRE2_MASK JOY_BTN_2_MASK -+#define JOY_FIRE2(v) ((v) & JOY_FIRE2_MASK) -+ -+/* get_tv() return codes -+** set_tv() argument codes -+*/ -+#define TV_NONE 0 -+#define TV_VGA 1 -+#define TV_NTSC_COLOR 2 -+#define TV_RGB 3 -+#define TV_NONE2 4 -+#define TV_VGA2 5 -+#define TV_NTSC_MONO 6 -+#define TV_RGB2 7 -+ -+/* Video mode defines */ -+#define VIDEOMODE_40x30 40u -+#define VIDEOMODE_80x60 80u -+#define VIDEOMODE_40COL VIDEOMODE_40x30 -+#define VIDEOMODE_80COL VIDEOMODE_80x60 -+ -+ -+/* Define hardware */ -+ -+/* Define a structure with the Video Enhanced Retro Adapter's -+** external registers. -+*/ -+struct __vera { -+ unsigned short address; /* Address for data ports */ -+ unsigned char address_hi; -+ unsigned char data0; /* Data port 0 */ -+ unsigned char data1; /* Data port 1 */ -+ unsigned char control; /* Control register */ -+ unsigned char irq_enable; /* Interrupt enable bits */ -+ unsigned char irq_flags; /* Interrupt flags */ -+}; -+#define VERA (*(volatile struct __vera *)0x9F20) -+ -+#include <_6522.h> -+#define VIA1 (*(volatile struct __6522 *)0x9F60) -+#define VIA2 (*(volatile struct __6522 *)0x9F70) -+ -+/* Define a structure with the x16emu's settings registers. */ -+struct __emul { -+ unsigned char debug; /* Boolean: debugging enabled */ -+ unsigned char vera_action; /* Boolean: displaying VERA activity */ -+ unsigned char keyboard; /* Boolean: displaying typed keys */ -+ unsigned char echo; /* Boolean: Kernal output echoed to host */ -+ unsigned char save_on_exit; /* Boolean: save SD card when quitting */ -+ unsigned char unused[0xD - 0x5]; -+ unsigned char keymap; /* Keyboard layout number */ -+ const char detect[2]; /* "16" if running on x16emu */ -+}; -+#define EMULATOR (*(volatile struct __emul)0x9FB0) -+ -+ -+ -+/* The addresses of the static drivers */ -+ -+extern void cx16_stdjoy_joy[]; /* Referred to by joy_static_stddrv[] */ -+ -+ -+ -+/*****************************************************************************/ -+/* Code */ -+/*****************************************************************************/ -+ -+ -+ -+signed char get_ostype (void); -+/* Get the ROM build version. -+** -1 -- custom build -+** Negative -- prerelease build -+** Positive -- release build -+*/ -+ -+void __fastcall__ set_tv (unsigned char); -+/* Set the video mode the machine will use. -+** Call with a TV_xx constant. -+*/ -+ -+unsigned char __fastcall__ videomode (unsigned char Mode); -+/* Set the video mode, return the old mode. Call with one of the VIDEOMODE_xx -+** constants. -+*/ -+ -+ -+ -+/* End of cX16.h */ -+#endif -diff --git a/libsrc/Makefile b/libsrc/Makefile -index 0ebec46b..d9ddb3cc 100644 ---- a/libsrc/Makefile -+++ b/libsrc/Makefile -@@ -7,6 +7,7 @@ CBMS = c128 \ - c64 \ - cbm510 \ - cbm610 \ -+ cx16 \ - pet \ - plus4 \ - vic20 -diff --git a/libsrc/cx16/_scrsize.s b/libsrc/cx16/_scrsize.s -new file mode 100644 -index 00000000..8059f04d ---- /dev/null -+++ b/libsrc/cx16/_scrsize.s -@@ -0,0 +1,14 @@ -+; -+; 2019-09-16, Greg King -+; -+; Screen size info -+; -+ -+ .export screensize -+ -+ .include "cx16.inc" -+ -+screensize: -+ ldx LLEN -+ ldy NLINES -+ rts -diff --git a/libsrc/cx16/bankramaddr.s b/libsrc/cx16/bankramaddr.s -new file mode 100644 -index 00000000..53d96e91 ---- /dev/null -+++ b/libsrc/cx16/bankramaddr.s -@@ -0,0 +1,50 @@ -+; -+; 2019-09-16, Greg King -+; -+; This module supplies the load addresses that are expected -+; by a Commander X16 in the first two bytes of banked RAM load files. -+; -+ -+ ; The following symbol is used by a linker config. to force -+ ; this module to get included into the output files. -+ .export __BANKRAMADDR__: abs = 1 -+ -+.segment "BRAM00ADDR" -+ -+ .addr *+2 -+ -+.segment "BRAM01ADDR" -+ -+ .addr *+2 -+ -+.segment "BRAM02ADDR" -+ -+ .addr *+2 -+ -+.segment "BRAM03ADDR" -+ -+ .addr *+2 -+ -+.segment "BRAM04ADDR" -+ -+ .addr *+2 -+ -+.segment "BRAM05ADDR" -+ -+ .addr *+2 -+ -+.segment "BRAM06ADDR" -+ -+ .addr *+2 -+ -+.segment "BRAM07ADDR" -+ -+ .addr *+2 -+ -+.segment "BRAM08ADDR" -+ -+ .addr *+2 -+ -+.segment "BRAM09ADDR" -+ -+ .addr *+2 -diff --git a/libsrc/cx16/bordercolor.s b/libsrc/cx16/bordercolor.s -new file mode 100644 -index 00000000..6691e2ec ---- /dev/null -+++ b/libsrc/cx16/bordercolor.s -@@ -0,0 +1,27 @@ -+; -+; 2019-09-23, Greg King -+; -+; unsigned char __fastcall__ bordercolor (unsigned char color); -+; /* Set the color for the border. The old color setting is returned. */ -+; -+ -+ .export _bordercolor -+ -+ .include "cx16.inc" -+ -+_bordercolor: -+ tax -+ -+ ; Point to the border color register. -+ -+ stz VERA::CTRL ; Use port 0 -+ lda #<VERA::COMPOSER::FRAME -+ sta VERA::ADDR -+ lda #>VERA::COMPOSER::FRAME -+ sta VERA::ADDR+1 -+ ldy #^VERA::COMPOSER::FRAME | VERA::INC0 -+ sty VERA::ADDR+2 -+ -+ lda VERA::DATA0 ; get old value -+ stx VERA::DATA0 ; set new value -+ rts -diff --git a/libsrc/cx16/break.s b/libsrc/cx16/break.s -new file mode 100644 -index 00000000..ec569b9a ---- /dev/null -+++ b/libsrc/cx16/break.s -@@ -0,0 +1,109 @@ -+; -+; 1998-09-27, Ullrich von Bassewitz -+; 2019-09-08, Greg King -+; -+; void __fastcall__ set_brk (unsigned Addr); -+; void reset_brk (void); -+; -+ -+ .export _set_brk, _reset_brk -+ .destructor _reset_brk -+ .export _brk_a, _brk_x, _brk_y, _brk_sr, _brk_pc -+ -+ .include "cx16.inc" -+ -+ -+.bss -+_brk_a: .res 1 -+_brk_x: .res 1 -+_brk_y: .res 1 -+_brk_sr: .res 1 -+_brk_pc: .res 2 -+ -+oldvec: .res 2 ; Old vector -+ -+ -+.data -+uservec: jmp $FFFF ; Patched at runtime -+ -+ -+.code -+ -+; Set the break vector -+.proc _set_brk -+ -+ sta uservec+1 -+ stx uservec+2 ; Set the user vector -+ -+ lda oldvec -+ ora oldvec+1 ; Did we save the vector already? -+ bne L1 ; Jump if we installed the handler already -+ -+ lda BRKVec -+ sta oldvec -+ lda BRKVec+1 -+ sta oldvec+1 ; Save the old vector -+ -+L1: lda #<brk_handler ; Set the break vector to our routine -+ ldx #>brk_handler -+ sta BRKVec -+ stx BRKVec+1 -+ rts -+ -+.endproc -+ -+ -+; Reset the break vector -+.proc _reset_brk -+ -+ lda oldvec -+ ldx oldvec+1 -+ beq @L9 ; Jump if vector not installed -+ sta BRKVec -+ stx BRKVec+1 -+ lda #$00 -+ sta oldvec ; Clear the old vector -+ stx oldvec+1 -+@L9: rts -+ -+.endproc -+ -+ -+ -+; Break handler, called if a break occurs -+ -+.proc brk_handler -+ -+ pla -+ sta _brk_y -+ pla -+ sta _brk_x -+ pla -+ sta _brk_a -+ pla -+ and #$EF ; Clear break bit -+ sta _brk_sr -+ pla ; PC low -+ sec -+ sbc #2 ; Point to start of brk -+ sta _brk_pc -+ pla ; PC high -+ sbc #0 -+ sta _brk_pc+1 -+ -+ jsr uservec ; Call the user's routine -+ -+ lda _brk_pc+1 -+ pha -+ lda _brk_pc -+ pha -+ lda _brk_sr -+ pha -+ ldx _brk_x -+ ldy _brk_y -+ lda _brk_a -+ rti ; Jump back... -+ -+.endproc -+ -+ -diff --git a/libsrc/cx16/cgetc.s b/libsrc/cx16/cgetc.s -new file mode 100644 -index 00000000..14cad5f5 ---- /dev/null -+++ b/libsrc/cx16/cgetc.s -@@ -0,0 +1,72 @@ -+; -+; 2019-09-23, Greg King -+; -+; char cgetc (void); -+; /* Return a character from the keyboard. */ -+; -+ -+ .export _cgetc -+ -+ .import cursor, GETIN -+ -+ .include "cx16.inc" -+ .macpack generic -+ -+ -+_cgetc: ldx KEY_COUNT ; Get number of characters -+ bnz L3 ; Jump if there are already chars waiting -+ -+; Switch the cursor on if wanted. -+ -+ lda CURS_FLAG ; Save cursor's current enable flag -+ tay -+ lda cursor -+ jsr setcursor -+L1: lda KEY_COUNT -+ bze L1 ; Wait for key -+ tya -+ eor #%00000001 ; (Cursor flag uses negative logic) -+ jsr setcursor ; Restore previous cursor condition -+ -+; An internal Kernal function can't be used because it might be moved in future -+; revisions. Use an official function; but, make sure that it reads -+; the keyboard. -+ -+L3: ldy IN_DEV ; Save current input device -+ stz IN_DEV ; Keyboard -+ jsr GETIN ; Read char, and return in .A -+ sty IN_DEV ; Restore input device -+ ldx #>$0000 -+ rts -+ -+; Switch the cursor on or off. -+ -+setcursor: -+ tax ; On or off? -+ bnz seton ; Go set it on -+ lda CURS_FLAG ; Is the cursor currently off? -+ bnz crs9 ; Jump if yes -+ inc CURS_FLAG ; Mark it as off -+ ldx CURS_STATE ; Cursor currently displayed? -+ bze crs9 ; Jump if not -+ -+; Restore the current character in video RAM. -+; Restore that character's colors. -+ -+ stz VERA::CTRL ; Use port 0 -+ lda CURS_Y -+ sta VERA::ADDR+1 ; Set row number -+ lda #VERA::INC1 ; Increment address by one -+ sta VERA::ADDR+2 -+ lda CURS_X ; Get character column -+ asl a -+ sta VERA::ADDR -+ ldx CURS_CHAR -+ stx VERA::DATA0 -+ ldx CURS_COLOR -+ stx VERA::DATA0 -+ stz CURS_STATE ; Cursor not displayed -+crs9: rts -+ -+seton: stz CURS_FLAG -+ rts -diff --git a/libsrc/cx16/clrscr.s b/libsrc/cx16/clrscr.s -new file mode 100644 -index 00000000..51fae6bf ---- /dev/null -+++ b/libsrc/cx16/clrscr.s -@@ -0,0 +1,26 @@ -+; -+; 2019-09-22, Greg King -+; -+; void clrscr (void); -+; /* Clear the screen. */ -+; -+ -+ .export _clrscr -+ -+ .import CHROUT -+ -+ .include "cx16.inc" -+ -+ -+; An internal Kernal function can't be used because it might be moved in future -+; revisions. Use an official function; but, make sure that it prints -+; to the screen. -+ -+_clrscr: -+ ldy OUT_DEV ; Save current output device -+ ldx #$03 ; Screen device -+ stx OUT_DEV -+ lda #$93 -+ jsr CHROUT ; Print clear-screen character -+ sty OUT_DEV ; Restore output device -+ rts -diff --git a/libsrc/cx16/color.s b/libsrc/cx16/color.s -new file mode 100644 -index 00000000..1be01c47 ---- /dev/null -+++ b/libsrc/cx16/color.s -@@ -0,0 +1,43 @@ -+; -+; 2019-09-16, Greg King -+; -+; unsigned char __fastcall__ textcolor (unsigned char color); -+; unsigned char __fastcall__ bgcolor (unsigned char color); -+; -+ -+ -+ .export _textcolor, _bgcolor -+ -+ .importzp tmp1 -+ .include "cx16.inc" -+ -+_textcolor: -+ and #$0F -+ sta tmp1 -+ ldx CHARCOLOR ; get old values -+ txa -+ and #<~$0F ; keep screen color, remove text color -+ ora tmp1 -+ sta CHARCOLOR ; set new values -+ txa -+ and #$0F -+ rts -+ -+ -+_bgcolor: -+ asl a ; move number to screen-color nybble -+ asl a -+ asl a -+ asl a -+ sta tmp1 -+ ldx CHARCOLOR ; get old values -+ txa -+ and #<~$F0 ; remove screen color, keep text color -+ ora tmp1 -+ sta CHARCOLOR ; set new values -+ txa -+ lsr a ; get screen color -+ lsr a -+ lsr a -+ lsr a -+ rts -diff --git a/libsrc/cx16/conio.s b/libsrc/cx16/conio.s -new file mode 100644 -index 00000000..e760af21 ---- /dev/null -+++ b/libsrc/cx16/conio.s -@@ -0,0 +1,9 @@ -+; -+; 2019-09-23, Greg King -+; -+; Low-level stuff for screen output/console input -+; -+ -+ .exportzp CURS_X, CURS_Y -+ -+ .include "cx16.inc" -diff --git a/libsrc/cx16/cpeekc.s b/libsrc/cx16/cpeekc.s -new file mode 100644 -index 00000000..2f02623b ---- /dev/null -+++ b/libsrc/cx16/cpeekc.s -@@ -0,0 +1,48 @@ -+; -+; 2016-02-28, Groepaz -+; 2019-09-25, Greg King -+; -+; char cpeekc (void); -+; /* Return the character from the current cursor position. */ -+; -+ -+ .export _cpeekc -+ -+ .include "cx16.inc" -+ -+ -+_cpeekc: -+ php -+ sei ; don't let cursor blinking interfere -+ stz VERA::CTRL ; use port 0 -+ lda CURS_Y -+ sta VERA::ADDR+1 ; set row number -+ stz VERA::ADDR+2 -+ lda CURS_X ; get character column -+ asl a -+ sta VERA::ADDR -+ lda VERA::DATA0 ; get screen code -+ plp -+ ldx #>$0000 -+ and #<~%10000000 ; remove reverse bit -+ -+; Convert the screen code into a PetSCII code. -+; $00 - $1F: +$40 -+; $20 - $3F -+; $40 - $5f: +$20 -+; $60 - $7F: +$40 -+ -+ cmp #$20 -+ bcs @sk1 ;(bge) -+ ora #$40 -+ rts -+ -+@sk1: cmp #$40 -+ bcc @end ;(blt) -+ cmp #$60 -+ bcc @sk2 ;(blt) -+ ;sec -+ adc #$20 - $01 -+@sk2: ;clc ; both above cmp and adc clear carry flag -+ adc #$20 -+@end: rts -diff --git a/libsrc/cx16/cpeekcolor.s b/libsrc/cx16/cpeekcolor.s -new file mode 100644 -index 00000000..4e3a39a2 ---- /dev/null -+++ b/libsrc/cx16/cpeekcolor.s -@@ -0,0 +1,27 @@ -+; -+; 2019-09-25, Greg King -+; -+; unsigned char cpeekcolor (void); -+; /* Return the colors from the current cursor position. */ -+; -+ -+ .export _cpeekcolor -+ -+ .include "cx16.inc" -+ -+ -+_cpeekcolor: -+ php -+ sei ; don't let cursor blinking interfere -+ stz VERA::CTRL ; use port 0 -+ lda CURS_Y -+ sta VERA::ADDR+1 ; set row number -+ stz VERA::ADDR+2 -+ lda CURS_X ; get character column -+ sec ; color attribute is second byte -+ rol a -+ sta VERA::ADDR -+ lda VERA::DATA0 ; get color -+ plp -+ ldx #>$0000 -+ rts -diff --git a/libsrc/cx16/cpeekrevers.s b/libsrc/cx16/cpeekrevers.s -new file mode 100644 -index 00000000..d67dd295 ---- /dev/null -+++ b/libsrc/cx16/cpeekrevers.s -@@ -0,0 +1,32 @@ -+; -+; 2016-02-28, Groepaz -+; 2019-09-25, Greg King -+; -+; unsigned char cpeekrevers (void); -+; /* Return the reverse attribute from the current cursor position. -+; ** If the character is reversed, then return 1; return 0 otherwise. -+; */ -+; -+ -+ .export _cpeekrevers -+ -+ .include "cx16.inc" -+ -+ -+_cpeekrevers: -+ php -+ sei ; don't let cursor blinking interfere -+ stz VERA::CTRL ; use port 0 -+ lda CURS_Y -+ sta VERA::ADDR+1 ; set row number -+ stz VERA::ADDR+2 -+ lda CURS_X ; get character column -+ asl a -+ sta VERA::ADDR -+ lda VERA::DATA0 ; get screen code -+ plp -+ and #%10000000 ; get reverse bit -+ asl a -+ tax ; ldx #>$0000 -+ rol a ; return boolean value -+ rts -diff --git a/libsrc/cx16/cpeeks.s b/libsrc/cx16/cpeeks.s -new file mode 100644 -index 00000000..e69de29b -diff --git a/libsrc/cx16/cputc.s b/libsrc/cx16/cputc.s -new file mode 100644 -index 00000000..cf0a5fa2 ---- /dev/null -+++ b/libsrc/cx16/cputc.s -@@ -0,0 +1,98 @@ -+; -+; 2019-09-23, Greg King -+; -+; void __fastcall__ cputcxy (unsigned char x, unsigned char y, char c); -+; void __fastcall__ cputc (char c); -+; -+ -+ .export _cputcxy, _cputc, cputdirect, putchar -+ .export newline, plot -+ -+ .import gotoxy, PLOT -+ -+ .include "cx16.inc" -+ .macpack generic -+ -+ -+; First, move to a new position. -+ -+_cputcxy: -+ pha ; Save C -+ jsr gotoxy ; Set cursor, drop x and y -+ pla ; Restore C -+ -+; Print a character. -+ -+_cputc: cmp #$0D ; LF? -+ beq newline -+ cmp #$0A ; CR? -+ beq plotx0 -+ -+; Printable char of some sort -+ -+ cmp #' ' -+ blt cputdirect ; Other control char -+ tay -+ bmi L10 -+ cmp #$60 -+ blt L2 -+ and #<~%00100000 -+ bra cputdirect -+ -+; Handle character if high bit set -+ -+L10: and #<~%10000000 ; Remove high bit -+ ora #%01000000 -+ bra cputdirect -+ -+L2: and #<~%01000000 -+ -+cputdirect: -+ jsr putchar ; Write character to screen, return .Y -+ -+; Advance cursor position. -+ -+ iny -+ cpy LLEN ; Reached end of line? -+ bne L3 -+ jsr newline ; Next line -+ ldy #$00 ; + CR -+L3: sty CURS_X -+ rts -+ -+; Move down. -+ -+newline: -+ inc SCREEN_PTR+1 -+ inc CURS_Y -+ rts -+ -+ -+; Set the cursor's position, calculate RAM pointer. -+ -+plotx0: stz CURS_X -+plot: ldy CURS_X -+ ldx CURS_Y -+ clc -+ jmp PLOT ; Set the new cursor -+ -+ -+; Write one screen-code and color to the video RAM without doing anything else. -+; Return the x position in Y. -+ -+putchar: -+ ora RVS ; Set revers bit -+ tax -+ stz VERA::CTRL ; Use port 0 -+ lda CURS_Y -+ sta VERA::ADDR+1 ; Set row number -+ lda #VERA::INC1 ; Increment address by one -+ sta VERA::ADDR+2 -+ ldy CURS_X ; Get character column -+ tya -+ asl a -+ sta VERA::ADDR -+ stx VERA::DATA0 -+ lda CHARCOLOR -+ sta VERA::DATA0 -+ rts -diff --git a/libsrc/cx16/crt0.s b/libsrc/cx16/crt0.s -new file mode 100644 -index 00000000..181e6308 ---- /dev/null -+++ b/libsrc/cx16/crt0.s -@@ -0,0 +1,115 @@ -+; -+; Start-up code for cc65 (CX16 version) -+; -+ -+ .export _exit -+ .export __STARTUP__ : absolute = 1 ; Mark as start-up -+ -+ .import initlib, donelib -+ .import zerobss, callmain -+ .import BSOUT -+ .import __MAIN_START__, __MAIN_SIZE__ ; Linker-generated -+ .importzp ST -+ -+ .include "zeropage.inc" -+ .include "cx16.inc" -+ -+ -+; ------------------------------------------------------------------------ -+; Start-up code -+ -+.segment "STARTUP" -+ -+Start: tsx -+ stx spsave ; Save the system stack ptr -+ -+; Save space by putting some of the start-up code in the ONCE segment, -+; which will be re-used by the BSS segment, the heap, and the C stack. -+ -+ jsr init -+ -+; Clear the BSS data. -+ -+ jsr zerobss -+ -+; Push the command-line arguments; and, call main(). -+ -+ jsr callmain -+ -+; Back from main() [this is also the exit() entry]. Run the module destructors. -+ -+_exit: pha ; Save the return code on stack -+ jsr donelib -+ -+; Copy back the zero-page stuff. -+ -+ ldx #zpspace-1 -+L2: lda zpsave,x -+ sta sp,x -+ dex -+ bpl L2 -+ -+; Place the program return code into BASIC's status variable. -+ -+ pla -+ sta ST -+ -+; Restore the system stuff. -+ -+ ldx spsave -+ txs ; Restore stack pointer -+ ldx banksave -+ stx VIA1::PRA2 ; Restore former RAM bank -+ -+; Back to BASIC. -+ -+ rts -+ -+ -+; ------------------------------------------------------------------------ -+ -+.segment "ONCE" -+ -+init: -+ -+; Change to the first RAM bank. -+ -+ lda VIA1::PRA2 -+ sta banksave ; Save the current bank number -+ lda #$00 ; Choose RAM bank zero -+ sta VIA1::PRA2 -+ -+; Save the zero-page locations that we need. -+ -+ ldx #zpspace-1 -+L1: lda sp,x -+ sta zpsave,x -+ dex -+ bpl L1 -+ -+; Set up the stack. -+ -+ lda #<(__MAIN_START__ + __MAIN_SIZE__) -+ ldx #>(__MAIN_START__ + __MAIN_SIZE__) -+ sta sp -+ stx sp+1 ; Set argument stack ptr -+ -+; Switch to the second charset. -+ -+ lda #$0E -+ jsr BSOUT -+ -+; Call the module constructors. -+ -+ jmp initlib -+ -+ -+; ------------------------------------------------------------------------ -+; Data -+ -+.segment "INIT" -+ -+banksave: -+ .res 1 -+spsave: .res 1 -+zpsave: .res zpspace -diff --git a/libsrc/cx16/devnum.s b/libsrc/cx16/devnum.s -new file mode 100644 -index 00000000..6a59d6ec ---- /dev/null -+++ b/libsrc/cx16/devnum.s -@@ -0,0 +1,8 @@ -+; -+; 2010-02-14, Oliver Schmidt -+; 2019-09-08, Greg King -+; -+ -+ .include "cx16.inc" -+ -+ .exportzp devnum := DEVNUM -diff --git a/libsrc/cx16/get_ostype.s b/libsrc/cx16/get_ostype.s -new file mode 100644 -index 00000000..a778b6ea ---- /dev/null -+++ b/libsrc/cx16/get_ostype.s -@@ -0,0 +1,20 @@ -+; -+; 2019-09-09, Greg King -+; -+; signed char get_ostype(void) -+; /* Return a "build version". */ -+; -+; Positive number -- release build -+; Negative number -- prerelease build -+; -1 -- custom build -+; -+ -+ .export _get_ostype -+ -+.proc _get_ostype -+ ldx #>$0000 -+ lda $ff80 -+ bpl :+ -+ dex ; negative -+: rts -+.endproc -diff --git a/libsrc/cx16/get_tv.s b/libsrc/cx16/get_tv.s -new file mode 100644 -index 00000000..79a577df ---- /dev/null -+++ b/libsrc/cx16/get_tv.s -@@ -0,0 +1,31 @@ -+; -+; 2019-09-20, Greg King -+; -+; unsigned char get_tv (void); -+; /* Return the video mode the machine is using. */ -+; -+ -+ .export _get_tv -+ -+ .include "cx16.inc" -+ -+ -+.proc _get_tv -+ php -+ sei ; Don't let interrupts interfere -+ -+ ; Point to the video output register. -+ -+ stz VERA::CTRL ; Use port 0 -+ lda #<VERA::COMPOSER::VIDEO -+ ldx #>VERA::COMPOSER::VIDEO -+ ldy #^VERA::COMPOSER::VIDEO -+ sta VERA::ADDR -+ stx VERA::ADDR+1 -+ sty VERA::ADDR+2 -+ -+ lda VERA::DATA0 -+ plp ; Re-enable interrupts -+ and #$07 ; Get the type of output signal -+ rts -+.endproc -diff --git a/libsrc/cx16/irq.s b/libsrc/cx16/irq.s -new file mode 100644 -index 00000000..0d9d54c6 ---- /dev/null -+++ b/libsrc/cx16/irq.s -@@ -0,0 +1,48 @@ -+; -+; IRQ handling (CX16 version) -+; -+ -+ .export initirq, doneirq -+ .import callirq -+ -+ .include "cx16.inc" -+ -+; ------------------------------------------------------------------------ -+ -+.segment "ONCE" -+ -+initirq: -+ lda IRQVec -+ ldx IRQVec+1 -+ sta IRQInd+1 -+ stx IRQInd+2 -+ lda #<IRQStub -+ ldx #>IRQStub -+ jmp setvec -+ -+; ------------------------------------------------------------------------ -+ -+.code -+ -+doneirq: -+ lda IRQInd+1 -+ ldx IRQInd+2 -+setvec: sei -+ sta IRQVec -+ stx IRQVec+1 -+ cli -+ rts -+ -+; ------------------------------------------------------------------------ -+ -+.segment "LOWCODE" -+ -+IRQStub: -+ jsr callirq ; Call the functions -+ jmp IRQInd ; Jump to the saved IRQ vector -+ -+; ------------------------------------------------------------------------ -+ -+.data -+ -+IRQInd: jmp $0000 -diff --git a/libsrc/cx16/joy/cx16-stdjoy.s b/libsrc/cx16/joy/cx16-stdjoy.s -new file mode 100644 -index 00000000..8c7ddd2f ---- /dev/null -+++ b/libsrc/cx16/joy/cx16-stdjoy.s -@@ -0,0 +1,119 @@ -+; -+; Standard joystick driver for the CX16. -+; May be used multiple times when statically linked to the application. -+; -+; 2019-09-23, Greg King -+; -+ -+ .include "joy-kernel.inc" -+ .include "joy-error.inc" -+ -+ .include "cbm_kernal.inc" -+ .include "cx16.inc" -+ -+ .macpack generic -+ .macpack module -+ -+ -+; ------------------------------------------------------------------------ -+; Header. Includes jump table -+ -+ module_header _cx16_stdjoy_joy -+ -+; Driver signature -+ -+ .byte $6A, $6F, $79 ; ASCII "joy" -+ .byte JOY_API_VERSION ; Driver API version number -+ -+; Library reference -+ -+ .addr $0000 -+ -+; Jump table. -+ -+ .addr INSTALL -+ .addr UNINSTALL -+ .addr COUNT -+ .addr READ -+ -+; ------------------------------------------------------------------------ -+; Constant -+ -+JOY_COUNT = 2 ; Number of joysticks we support -+ -+; ------------------------------------------------------------------------ -+; Data. -+ -+ -+.code -+ -+; ------------------------------------------------------------------------ -+; INSTALL routine. Is called after the driver is loaded into memory. -+; If possible, check if the hardware is present, and determine the amount -+; of memory available. -+; Must return a JOY_ERR_xx code in a/x. -+; -+ -+INSTALL: -+ lda #<JOY_ERR_OK -+ ldx #>JOY_ERR_OK -+; rts ; Run into UNINSTALL instead -+ -+; ------------------------------------------------------------------------ -+; UNINSTALL routine. Is called before the driver is removed from memory. -+; Can do clean-up or whatever. Must not return anything. -+; -+ -+UNINSTALL: -+ rts -+ -+; ------------------------------------------------------------------------ -+; COUNT: Return the total number of possible joysticks in a/x. -+; -+ -+COUNT: lda #<JOY_COUNT -+ ldx #>JOY_COUNT -+ rts -+ -+; ------------------------------------------------------------------------ -+; READ: Read a particular joystick passed in A. -+; -+; TODO: Find a way to report the SNES controller's extra four lines. -+; -+ -+READ: pha -+ jsr GETJOY -+ pla -+ bne pad2 -+ -+; Read game pad 1 -+ -+pad1: lda JOY1 + 1 -+ bit #%00001110 -+ beq nes1 -+ asl JOY1 ; Get SNES's B button -+ ror a ; Put it next to the A button -+ asl JOY1 ; Drop SNES's Y button -+ asl a ; Get the B button -+ ror JOY1 -+ asl a ; Get SNES's A button -+ ror JOY1 ; Make byte look like NES pad -+nes1: lda JOY1 -+ eor #%11111111 ; We don't want the pad's negative logic -+ rts -+ -+; Read game pad 2 -+ -+pad2: lda JOY2 + 1 -+ bit #%00001110 -+ beq nes2 -+ asl JOY2 -+ ror a -+ asl JOY2 -+ asl a -+ ror JOY2 -+ asl a -+ ror JOY2 -+nes2: lda JOY2 -+ eor #%11111111 -+ rts -diff --git a/libsrc/cx16/joy_stat_stddrv.s b/libsrc/cx16/joy_stat_stddrv.s -new file mode 100644 -index 00000000..0e1a3e94 ---- /dev/null -+++ b/libsrc/cx16/joy_stat_stddrv.s -@@ -0,0 +1,10 @@ -+; -+; Address of the static standard joystick driver -+; -+; 2019-09-19, Greg King -+; -+; const void joy_static_stddrv[]; -+; -+ -+ .import _cx16_stdjoy_joy -+ .export _joy_static_stddrv := _cx16_stdjoy_joy -diff --git a/libsrc/cx16/joy_stddrv.s b/libsrc/cx16/joy_stddrv.s -new file mode 100644 -index 00000000..4edf9afc ---- /dev/null -+++ b/libsrc/cx16/joy_stddrv.s -@@ -0,0 +1,13 @@ -+; -+; Name of the standard joystick driver -+; -+; 2019-09-19, Greg King -+; -+; const char joy_stddrv[]; -+; -+ -+ .export _joy_stddrv -+ -+.rodata -+ -+_joy_stddrv: .asciiz "cx16-stdjoy.joy" -diff --git a/libsrc/cx16/kbhit.s b/libsrc/cx16/kbhit.s -new file mode 100644 -index 00000000..8ceba64b ---- /dev/null -+++ b/libsrc/cx16/kbhit.s -@@ -0,0 +1,17 @@ -+; -+; 2019-09-20, Greg King -+; -+; unsigned char kbhit (void); -+; /* Returns non-zero (true) if a typed character is waiting. */ -+; -+ -+ .export _kbhit -+ -+ .include "cx16.inc" -+ -+ -+.proc _kbhit -+ ldx #>$0000 ; High byte of return -+ lda KEY_COUNT ; Get number of characters -+ rts -+.endproc -diff --git a/libsrc/cx16/kernal.s b/libsrc/cx16/kernal.s -new file mode 100644 -index 00000000..faf91385 ---- /dev/null -+++ b/libsrc/cx16/kernal.s -@@ -0,0 +1,59 @@ -+; -+; 2019-09-22, Greg King -+; -+; CX16 Kernal functions -+; -+ -+ .include "cbm_kernal.inc" -+ -+ .export GETJOY -+ -+ .export CLSALL -+ .export SWAPPER -+ .export JSRFAR -+ .export INDFET -+ .export INDSTA -+ .export INDCMP -+ .export PRIMM -+ -+ .export CINT -+ .export IOINIT -+ .export RAMTAS -+ .export RESTOR -+ .export VECTOR -+ .export SETMSG -+ .export SECOND -+ .export TKSA -+ .export MEMTOP -+ .export MEMBOT -+ .export SCNKEY -+ .export SETTMO -+ .export ACPTR -+ .export CIOUT -+ .export UNTLK -+ .export UNLSN -+ .export LISTEN -+ .export TALK -+ .export READST -+ .export SETLFS -+ .export SETNAM -+ .export OPEN -+ .export CLOSE -+ .export CHKIN -+ .export CKOUT -+ .export CLRCH -+ .export BASIN -+ .export CHRIN -+ .export BSOUT -+ .export CHROUT -+ .export LOAD -+ .export SAVE -+ .export SETTIM -+ .export RDTIM -+ .export STOP -+ .export GETIN -+ .export CLALL -+ .export UDTIM -+ .export SCREEN -+ .export PLOT -+ .export IOBASE -diff --git a/libsrc/cx16/libref.s b/libsrc/cx16/libref.s -new file mode 100644 -index 00000000..54ebb91d ---- /dev/null -+++ b/libsrc/cx16/libref.s -@@ -0,0 +1,18 @@ -+; -+; 2013-05-31, Oliver Schmidt -+; 2019-09-22, Greg King -+; -+ -+ .export em_libref -+ .export joy_libref -+ .export mouse_libref -+ .export ser_libref -+ .export tgi_libref -+ -+ .import _exit -+ -+em_libref := _exit -+joy_libref := _exit -+mouse_libref := _exit -+ser_libref := _exit -+tgi_libref := _exit -diff --git a/libsrc/cx16/mainargs.s b/libsrc/cx16/mainargs.s -new file mode 100644 -index 00000000..fe4a071c ---- /dev/null -+++ b/libsrc/cx16/mainargs.s -@@ -0,0 +1,137 @@ -+; mainargs.s -+; -+; Ullrich von Bassewitz, 2003-03-07 -+; Based on code from Stefan A. Haubenthal, <polluks@web.de> -+; 2005-02-26, Ullrich von Bassewitz -+; 2019-09-08, Greg King -+; -+; Scan a group of arguments that are in BASIC's input-buffer. -+; Build an array that points to the beginning of each argument. -+; Send, to main(), that array and the count of the arguments. -+; -+; Command-lines look like these lines: -+; -+; run -+; run : rem -+; run:rem arg1 " arg 2 is quoted " arg3 "" arg5 -+; -+; "run" and "rem" are entokenned; the args. are not. Leading and trailing -+; spaces outside of quotes are ignored. -+; -+; TO-DO: -+; - The "file-name" might be a path-name; don't copy the directory-components. -+; - Add a control-character quoting mechanism. -+ -+ .constructor initmainargs, 24 -+ .import __argc, __argv -+ -+ .include "cx16.inc" -+ -+ -+MAXARGS = 10 ; Maximum number of arguments allowed -+REM = $8f ; BASIC token-code -+NAME_LEN = 16 ; Maximum length of command-name -+ -+; Get possible command-line arguments. Goes into the special ONCE segment, -+; which may be reused after the startup code is run -+ -+.segment "ONCE" -+ -+initmainargs: -+ -+; Assume that the program was loaded, a moment ago, by the traditional LOAD -+; statement. Save the "most-recent filename" as argument #0. -+ -+ lda #0 ; The terminating NUL character -+ ldy FNAM_LEN -+ cpy #NAME_LEN + 1 -+ bcc L1 -+ ldy #NAME_LEN ; Limit the length -+ bne L1 ; Branch always -+L0: lda (FNAM),y -+L1: sta name,y -+ dey -+ bpl L0 -+ inc __argc ; argc always is equal to, at least, 1 -+ -+; Find the "rem" token. -+ -+ ldx #0 -+L2: lda BASIC_BUF,x -+ beq done ; No "rem," no args. -+ inx -+ cmp #REM -+ bne L2 -+ ldy #1 * 2 -+ -+; Find the next argument -+ -+next: lda BASIC_BUF,x -+ beq done ; End of line reached -+ inx -+ cmp #' ' ; Skip leading spaces -+ beq next -+ -+; Found start of next argument. We've incremented the pointer in X already, so -+; it points to the second character of the argument. This is useful since we -+; will check now for a quoted argument, in which case we will have to skip this -+; first character. -+ -+found: cmp #'"' ; Is the argument quoted? -+ beq setterm ; Jump if so -+ dex ; Reset pointer to first argument character -+ lda #' ' ; A space ends the argument -+setterm:sta term ; Set end of argument marker -+ -+; Now store a pointer to the argument into the next slot. Since the BASIC -+; input buffer is located at the start of a RAM page, no calculations are -+; necessary. -+ -+ txa ; Get low byte -+ sta argv,y ; argv[y]= &arg -+ iny -+ lda #>BASIC_BUF -+ sta argv,y -+ iny -+ inc __argc ; Found another arg -+ -+; Search for the end of the argument -+ -+argloop:lda BASIC_BUF,x -+ beq done -+ inx -+ cmp term -+ bne argloop -+ -+; We've found the end of the argument. X points one character behind it, and -+; A contains the terminating character. To make the argument a valid C string, -+; replace the terminating character by a zero. -+ -+ lda #0 -+ sta BASIC_BUF-1,x -+ -+; Check if the maximum number of command line arguments is reached. If not, -+; parse the next one. -+ -+ lda __argc ; Get low byte of argument count -+ cmp #MAXARGS ; Maximum number of arguments reached? -+ bcc next ; Parse next one if not -+ -+; (The last vector in argv[] already is NULL.) -+ -+done: lda #<argv -+ ldx #>argv -+ sta __argv -+ stx __argv + 1 -+ rts -+ -+.segment "INIT" -+ -+term: .res 1 -+name: .res NAME_LEN + 1 -+ -+.data -+ -+; char* argv[MAXARGS+1]={name}; -+argv: .addr name -+ .res MAXARGS * 2 -diff --git a/libsrc/cx16/revers.s b/libsrc/cx16/revers.s -new file mode 100644 -index 00000000..300237ee ---- /dev/null -+++ b/libsrc/cx16/revers.s -@@ -0,0 +1,23 @@ -+; -+; 2019-09-16, Greg King -+; -+; unsigned char __fastcall__ revers (unsigned char onoff); -+; -+ -+ .export _revers -+ -+ .include "cx16.inc" -+ -+.proc _revers -+ ldy #$00 ; Assume revers off -+ tax ; Test on/off -+ beq :+ ; Jump if off -+ ldy #$80 ; Load "on" value -+ ldx #>$0000 ; Zero high byte of result -+: lda RVS ; Load old value -+ sty RVS ; Set new value -+ clc -+ rol a ; Convert bit-mask into boolean -+ rol a -+ rts -+.endproc -diff --git a/libsrc/cx16/set_tv.s b/libsrc/cx16/set_tv.s -new file mode 100644 -index 00000000..0cf49aff ---- /dev/null -+++ b/libsrc/cx16/set_tv.s -@@ -0,0 +1,32 @@ -+; -+; 2019-09-20, Greg King -+; -+; void __fastcall__ set_tv (unsigned char); -+; /* Set the video mode the machine will use. */ -+; -+ -+ .export _set_tv -+ -+ .include "cx16.inc" -+ -+ -+.proc _set_tv -+ php -+ pha -+ sei ; Don't let interrupts interfere -+ -+ ; Point to the video output register. -+ -+ stz VERA::CTRL ; Use port 0 -+ lda #<VERA::COMPOSER::VIDEO -+ ldx #>VERA::COMPOSER::VIDEO -+ ldy #^VERA::COMPOSER::VIDEO -+ sta VERA::ADDR -+ stx VERA::ADDR+1 -+ sty VERA::ADDR+2 -+ -+ pla -+ sta VERA::DATA0 -+ plp ; Re-enable interrupts -+ rts -+.endproc -diff --git a/libsrc/cx16/status.s b/libsrc/cx16/status.s -new file mode 100644 -index 00000000..6292dc27 ---- /dev/null -+++ b/libsrc/cx16/status.s -@@ -0,0 +1,6 @@ -+; -+; 2012-09-30, Oliver Schmidt -+; 2019-09-08, Greg King -+; -+ -+ .exportzp ST := $90 ; IEC status byte -diff --git a/libsrc/cx16/sysuname.s b/libsrc/cx16/sysuname.s -new file mode 100644 -index 00000000..f8500936 ---- /dev/null -+++ b/libsrc/cx16/sysuname.s -@@ -0,0 +1,37 @@ -+; -+; 2003-08-12, Ullrich von Bassewitz -+; 2019-09-08, Greg King -+; -+; unsigned char __fastcall__ _sysuname (struct utsname* buf); -+; -+ -+ .export __sysuname, utsdata -+ -+ .import utscopy -+ -+__sysuname := utscopy -+ -+;-------------------------------------------------------------------------- -+; Data. We define a fixed utsname struct here, and just copy it. -+ -+.rodata -+ -+utsdata: -+ ; sysname -+ .asciiz "cc65" -+ -+ ; nodename -+ .asciiz "" -+ -+ ; release -+ .byte ((.VERSION >> 8) & $0F) + '0' -+ .byte '.' -+ .byte ((.VERSION >> 4) & $0F) + '0' -+ .byte $00 -+ -+ ; version -+ .byte (.VERSION & $0F) + '0' -+ .byte $00 -+ -+ ; machine -+ .asciiz "Commander X16" -diff --git a/libsrc/cx16/videomode.s b/libsrc/cx16/videomode.s -new file mode 100644 -index 00000000..4582ec1b ---- /dev/null -+++ b/libsrc/cx16/videomode.s -@@ -0,0 +1,30 @@ -+; -+; 2009-09-07, Ullrich von Bassewitz -+; 2019-09-23, Greg King -+; -+; unsigned __fastcall__ videomode (unsigned Mode); -+; /* Set the video mode, return the old mode. */ -+; -+ -+ .export _videomode -+ .import SWAPPER -+ -+ .include "cx16.inc" -+ -+ -+.proc _videomode -+ cmp LLEN ; Do we have this mode already? -+ beq @L9 -+ -+ lda LLEN ; Get current mode ... -+ pha ; ... and save it -+ -+ jsr SWAPPER ; Toggle the mode -+ -+ pla ; Get old mode into A -+ -+; Done, old mode is in .A -+ -+@L9: ldx #>$0000 ; Clear high byte -+ rts -+.endproc -diff --git a/libsrc/cx16/waitvsync.s b/libsrc/cx16/waitvsync.s -new file mode 100644 -index 00000000..3fb6354f ---- /dev/null -+++ b/libsrc/cx16/waitvsync.s -@@ -0,0 +1,17 @@ -+; -+; 2019-09-26, Greg King -+; -+; void waitvsync (void); -+; -+; VERA's vertical sync. causes IRQs which increment the jiffy clock. -+; -+ -+ .export _waitvsync -+ -+ .include "cx16.inc" -+ -+_waitvsync: -+ lda TIME + 2 -+: cmp TIME + 2 -+ beq :- ; Wait for next jiffy -+ rts -diff --git a/src/ca65/main.c b/src/ca65/main.c -index 33e0a74b..ab19d0b4 100644 ---- a/src/ca65/main.c -+++ b/src/ca65/main.c -@@ -296,7 +296,7 @@ static void SetSys (const char* Sys) - - case TGT_ATMOS: - NewSymbol ("__ATMOS__", 1); -- break; -+ break; - - case TGT_TELESTRAT: - NewSymbol ("__TELESTRAT__", 1); -@@ -330,6 +330,10 @@ static void SetSys (const char* Sys) - NewSymbol ("__PCE__", 1); - break; - -+ case TGT_CX16: -+ CBMSystem ("__CX16__"); -+ break; -+ - default: - AbEnd ("Invalid target name: '%s'", Sys); - -diff --git a/src/cc65/main.c b/src/cc65/main.c -index 871e21eb..a4f794fb 100644 ---- a/src/cc65/main.c -+++ b/src/cc65/main.c -@@ -285,6 +285,10 @@ static void SetSys (const char* Sys) - DefineNumericMacro ("__PCE__", 1); - break; - -+ case TGT_CX16: -+ cbmsys ("__CX16__"); -+ break; -+ - default: - AbEnd ("Unknown target system type %d", Target); - } -diff --git a/src/common/target.c b/src/common/target.c -index 56ea0a2f..a21ef212 100644 ---- a/src/common/target.c -+++ b/src/common/target.c -@@ -135,11 +135,11 @@ static const unsigned char CTPET[256] = { - typedef struct TargetEntry TargetEntry; - struct TargetEntry { - char Name[13]; /* Target name */ -- target_t Id; /* Target id */ -+ target_t Id; /* Target ID */ - }; - --/* Table that maps target names to ids. Sorted alphabetically for bsearch. --** Allows multiple entries for one target id (target name aliases). -+/* Table that maps target names to IDs. Sorted alphabetically for bsearch(). -+** Allows multiple entries for one target ID (target name aliases). - */ - static const TargetEntry TargetMap[] = { - { "apple2", TGT_APPLE2 }, -@@ -157,6 +157,7 @@ static const TargetEntry TargetMap[] = { - { "cbm510", TGT_CBM510 }, - { "cbm610", TGT_CBM610 }, - { "creativision", TGT_CREATIVISION }, -+ { "cx16", TGT_CX16 }, - { "gamate", TGT_GAMATE }, - { "geos", TGT_GEOS_CBM }, - { "geos-apple", TGT_GEOS_APPLE }, -@@ -179,7 +180,7 @@ static const TargetEntry TargetMap[] = { - #define MAP_ENTRY_COUNT (sizeof (TargetMap) / sizeof (TargetMap[0])) - - --/* Table with target properties by target id */ -+/* Table with target properties by target ID */ - static const TargetProperties PropertyTable[TGT_COUNT] = { - { "none", CPU_6502, BINFMT_BINARY, CTNone }, - { "module", CPU_6502, BINFMT_O65, CTNone }, -@@ -213,6 +214,7 @@ static const TargetProperties PropertyTable[TGT_COUNT] = { - { "pce", CPU_HUC6280, BINFMT_BINARY, CTNone }, - { "gamate", CPU_6502, BINFMT_BINARY, CTNone }, - { "c65", CPU_4510, BINFMT_BINARY, CTPET }, -+ { "cx16", CPU_65C02, BINFMT_BINARY, CTPET }, - }; - - /* Target system */ -@@ -235,7 +237,7 @@ static int Compare (const void* Key, const void* Entry) - - - target_t FindTarget (const char* Name) --/* Find a target by name and return the target id. TGT_UNKNOWN is returned if -+/* Find a target by name and return the target ID. TGT_UNKNOWN is returned if - ** the given name is no valid target. - */ - { -@@ -243,7 +245,7 @@ target_t FindTarget (const char* Name) - const TargetEntry* T; - T = bsearch (Name, TargetMap, MAP_ENTRY_COUNT, sizeof (TargetMap[0]), Compare); - -- /* Return the target id */ -+ /* Return the target ID */ - return (T == 0)? TGT_UNKNOWN : T->Id; - } - -@@ -252,7 +254,7 @@ target_t FindTarget (const char* Name) - const TargetProperties* GetTargetProperties (target_t Target) - /* Return the properties for a target */ - { -- /* Must have a valid target id */ -+ /* Must have a valid target ID */ - PRECONDITION (Target >= 0 && Target < TGT_COUNT); - - /* Return the array entry */ -diff --git a/src/common/target.h b/src/common/target.h -index 5b086e40..50c400e2 100644 ---- a/src/common/target.h -+++ b/src/common/target.h -@@ -84,6 +84,7 @@ typedef enum { - TGT_PCENGINE, - TGT_GAMATE, - TGT_C65, -+ TGT_CX16, - TGT_COUNT /* Number of target systems */ - } target_t; - -@@ -102,7 +103,7 @@ extern target_t Target; - /* Types of available output formats */ - #define BINFMT_DEFAULT 0 /* Default (binary) */ - #define BINFMT_BINARY 1 /* Straight binary format */ --#define BINFMT_O65 2 /* Andre Fachats o65 format */ -+#define BINFMT_O65 2 /* Andre Fachat's o65 format */ - #define BINFMT_ATARIEXE 3 /* Standard Atari binary load */ - - -@@ -127,5 +128,4 @@ const char* GetTargetName (target_t Target); - - - /* End of target.h */ -- - #endif -diff --git a/testcode/lib/joy-test.c b/testcode/lib/joy-test.c -index 3d584bf9..53d63c5c 100644 ---- a/testcode/lib/joy-test.c -+++ b/testcode/lib/joy-test.c -@@ -1,4 +1,3 @@ --#include <stdio.h> - #include <stdlib.h> - #include <string.h> - #include <errno.h> -@@ -14,16 +13,15 @@ - # define DYN_DRV 0 - - /* --** link existing drivers like this: -+** Link existing drivers this way: - ** - ** cl65 -DJOYSTICK_DRIVER=c64_hitjoy_joy -o joy-test.prg joy-test.c - ** --** for testing a new driver you will have to uncomment the define below, and --** link your driver like this: -+** For testing a new driver, you need to uncomment the declaration below, -+** and link your driver this way: - ** - ** co65 ../../target/c64/drv/joy/c64-hitjoy.joy -o hitjoy.s --code-label _hitjoy - ** cl65 -DJOYSTICK_DRIVER=hitjoy -o joy-test.prg joy-test.c hitjoy.s --** - */ - - /* extern char JOYSTICK_DRIVER; */ -@@ -40,10 +38,8 @@ - int main (void) - { - unsigned char j; -- unsigned char count; -- unsigned char i; -+ unsigned char i, count; - unsigned char Res; -- unsigned char ch, kb; - - clrscr (); - -@@ -58,47 +54,69 @@ int main (void) - if (Res != JOY_ERR_OK) { - cprintf ("Error in joy_load_driver: %u\r\n", Res); - #if DYN_DRV -- cprintf ("os: %u, %s\r\n", _oserror, _stroserror (_oserror)); -+ cprintf ("OS: %u, %s\r\n", _oserror, _stroserror (_oserror)); - #endif -- exit (EXIT_FAILURE); -+ return EXIT_FAILURE; - } - - count = joy_count (); - #if defined(__ATARI5200__) || defined(__CREATIVISION__) -- cprintf ("JOYSTICKS: %d", count); -+ cprintf ("JOYSTICKS: %u.", count); - #else -- cprintf ("Driver supports %d joystick(s)", count); -+ cprintf ("Driver supports %u joystick%s", count, count == 1 ? "." : "s."); - #endif - while (1) { - for (i = 0; i < count; ++i) { -- gotoxy (0, i+1); - j = joy_read (i); --#if defined(__ATARI5200__) || defined(__CREATIVISION__) -- cprintf ("%1d:%-3s%-3s%-3s%-3s%-3s %02x", -+#if defined(__NES__) || defined(__CX16__) -+ /* two lines for each device */ -+ gotoxy (0, i * 2 +1); -+ cprintf ("%2u:%-6s%-6s%-6s%-6s\r\n" -+ " %-6s%-6s%-6s%-6s $%02X", - i, -- JOY_UP(j)? " U " : " - ", -- JOY_DOWN(j)? " D " : " - ", -- JOY_LEFT(j)? " L " : " - ", -- JOY_RIGHT(j)? " R " : " - ", -- JOY_BTN_1(j)? " 1 " : " - ", j); -+ JOY_UP(j) ? " up " : " ---- ", -+ JOY_DOWN(j) ? " down " : " ---- ", -+ JOY_LEFT(j) ? " left " : " ---- ", -+ JOY_RIGHT(j) ? " right" : " ---- ", -+ JOY_BTN_1(j) ? "btn A " : " ---- ", -+ JOY_BTN_2(j) ? "btn B " : " ---- ", -+ JOY_BTN_3(j) ? "select" : " ---- ", -+ JOY_BTN_4(j) ? " start" : " ---- ", -+ j); - #else -- cprintf ("%2d: %-6s%-6s%-6s%-6s%-6s %02x", -+ /* one line for each device */ -+ gotoxy (0, i + 1); -+# if defined(__ATARI5200__) || defined(__CREATIVISION__) -+ cprintf ("%1u:%-3s%-3s%-3s%-3s%-3s %02X", - i, -- JOY_UP(j)? " up " : " ---- ", -- JOY_DOWN(j)? " down " : " ---- ", -- JOY_LEFT(j)? " left " : " ---- ", -- JOY_RIGHT(j)? "right " : " ---- ", -- JOY_BTN_1(j)? "button" : " ---- ", j); -+ JOY_UP(j) ? " U " : " - ", -+ JOY_DOWN(j) ? " D " : " - ", -+ JOY_LEFT(j) ? " L " : " - ", -+ JOY_RIGHT(j) ? " R " : " - ", -+ JOY_BTN_1(j) ? " 1 " : " - ", -+ j); -+# else -+ cprintf ("%2u: %-6s%-6s%-6s%-6s%-6s $%02X", -+ i, -+ JOY_UP(j) ? " up " : " ---- ", -+ JOY_DOWN(j) ? " down " : " ---- ", -+ JOY_LEFT(j) ? " left " : " ---- ", -+ JOY_RIGHT(j) ? "right " : " ---- ", -+ JOY_BTN_1(j) ? "button" : " ---- ", -+ j); -+# endif - #endif - } - -- /* show pressed key, so we can verify keyboard is working */ -- kb = kbhit (); -- ch = kb ? cgetc () : ' '; -- gotoxy (1, i+2); -- revers (kb); -- cprintf ("kbd: %c", ch); -- revers (0); -+ /* Show any pressed keys; so that we can verify that the keyboard is working. */ -+ if (kbhit ()) { -+#if defined(__NES__) || defined(__CX16__) -+ gotoxy (1, i * 2 + 2); -+#else -+ gotoxy (1, i + 2); -+#endif -+ cprintf ("keyboard: $%02X", cgetc ()); -+ } - } -- return 0; -+ return EXIT_SUCCESS; - } --- -2.26.0 - diff --git a/0040-Updated-the-cx16-start-up-to-the-emulator-s-release-.patch b/0040-Updated-the-cx16-start-up-to-the-emulator-s-release-.patch deleted file mode 100644 index 5324868..0000000 --- a/0040-Updated-the-cx16-start-up-to-the-emulator-s-release-.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 6cae84a25da68d0970c54e55d3faf6efa28b0da1 Mon Sep 17 00:00:00 2001 -From: Greg King <gregdk@users.sf.net> -Date: Sat, 28 Sep 2019 00:54:27 -0400 -Subject: [PATCH 040/170] Updated the cx16 start-up to the emulator's release - 32. - -Made the Kernal ROM be visible when programs start. ---- - libsrc/cx16/crt0.s | 18 +++++++++++++----- - 1 file changed, 13 insertions(+), 5 deletions(-) - -diff --git a/libsrc/cx16/crt0.s b/libsrc/cx16/crt0.s -index 181e6308..a3a613bd 100644 ---- a/libsrc/cx16/crt0.s -+++ b/libsrc/cx16/crt0.s -@@ -7,7 +7,7 @@ - - .import initlib, donelib - .import zerobss, callmain -- .import BSOUT -+ .import CHROUT - .import __MAIN_START__, __MAIN_SIZE__ ; Linker-generated - .importzp ST - -@@ -58,8 +58,11 @@ L2: lda zpsave,x - - ldx spsave - txs ; Restore stack pointer -- ldx banksave -+ ldx ramsave - stx VIA1::PRA2 ; Restore former RAM bank -+ lda VIA1::PRB -+ and #<~$07 -+ sta VIA1::PRB ; Change back to BASIC ROM - - ; Back to BASIC. - -@@ -71,11 +74,16 @@ L2: lda zpsave,x - .segment "ONCE" - - init: -+; Change from BASIC's ROM to Kernal's ROM. -+ -+ lda VIA1::PRB -+ ora #$07 -+ sta VIA1::PRB - - ; Change to the first RAM bank. - - lda VIA1::PRA2 -- sta banksave ; Save the current bank number -+ sta ramsave ; Save the current RAM bank number - lda #$00 ; Choose RAM bank zero - sta VIA1::PRA2 - -@@ -97,7 +105,7 @@ L1: lda sp,x - ; Switch to the second charset. - - lda #$0E -- jsr BSOUT -+ jsr CHROUT - - ; Call the module constructors. - -@@ -109,7 +117,7 @@ L1: lda sp,x - - .segment "INIT" - --banksave: -+ramsave: - .res 1 - spsave: .res 1 - zpsave: .res zpspace --- -2.26.0 - diff --git a/0041-Put-the-C64-code-into-cx16-_scrsize.s.patch b/0041-Put-the-C64-code-into-cx16-_scrsize.s.patch deleted file mode 100644 index fe3c70e..0000000 --- a/0041-Put-the-C64-code-into-cx16-_scrsize.s.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 2546c6ba1c985d3280c4f9539af3080ec2233b1e Mon Sep 17 00:00:00 2001 -From: Greg King <gregdk@users.sf.net> -Date: Sat, 28 Sep 2019 01:38:16 -0400 -Subject: [PATCH 041/170] Put the C64 code into cx16/_scrsize.s. - -(I forgot that SCREEN is an official jumptable function. ---- - libsrc/cx16/_scrsize.s | 12 ++++-------- - 1 file changed, 4 insertions(+), 8 deletions(-) - -diff --git a/libsrc/cx16/_scrsize.s b/libsrc/cx16/_scrsize.s -index 8059f04d..f240b1e5 100644 ---- a/libsrc/cx16/_scrsize.s -+++ b/libsrc/cx16/_scrsize.s -@@ -1,14 +1,10 @@ - ; --; 2019-09-16, Greg King -+; Ullrich von Bassewitz, 26.10.2000 - ; --; Screen size info -+; Screen size variables - ; - - .export screensize -+ .import SCREEN - -- .include "cx16.inc" -- --screensize: -- ldx LLEN -- ldy NLINES -- rts -+screensize := SCREEN --- -2.26.0 - diff --git a/0042-Fixed-a-typo-in-the-cx16-document.patch b/0042-Fixed-a-typo-in-the-cx16-document.patch deleted file mode 100644 index 725c3c6..0000000 --- a/0042-Fixed-a-typo-in-the-cx16-document.patch +++ /dev/null @@ -1,25 +0,0 @@ -From d7ec817f0a472d9e812a5e7c5da298a16c228168 Mon Sep 17 00:00:00 2001 -From: Greg King <gregdk@users.sf.net> -Date: Mon, 30 Sep 2019 10:41:21 -0400 -Subject: [PATCH 042/170] Fixed a typo in the cx16 document. - ---- - doc/cx16.sgml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/doc/cx16.sgml b/doc/cx16.sgml -index 077458bf..b739e6a9 100644 ---- a/doc/cx16.sgml -+++ b/doc/cx16.sgml -@@ -240,7 +240,7 @@ No serial drivers are available currently for the CX16. - - <sect>Limitations<p> - --The Commander X16 still is being designed. It's configuration can change at -+The Commander X16 still is being designed. Its configuration can change at - any time. Some changes could make old programs fail to work. - - --- -2.26.0 - diff --git a/0043-Added-character-codes-to-change-between-the-two-CBM-.patch b/0043-Added-character-codes-to-change-between-the-two-CBM-.patch deleted file mode 100644 index 4a9ca52..0000000 --- a/0043-Added-character-codes-to-change-between-the-two-CBM-.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 3cece61525cec3def39ac4791b04cdaccb45c85b Mon Sep 17 00:00:00 2001 -From: Greg King <gregdk@users.sf.net> -Date: Tue, 1 Oct 2019 04:16:44 -0400 -Subject: [PATCH 043/170] Added character codes to change between the two CBM - fonts. - ---- - include/cbm.h | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/include/cbm.h b/include/cbm.h -index d9b31543..96eb675c 100644 ---- a/include/cbm.h -+++ b/include/cbm.h -@@ -121,6 +121,8 @@ extern char _filetype; /* Defaults to 's' */ - #define CH_STOP 3 - #define CH_LIRA 92 - #define CH_ESC 27 -+#define CH_FONT_LOWER 14 -+#define CH_FONT_UPPER 142 - - - --- -2.26.0 - diff --git a/0044-Fixed-cgetc.patch b/0044-Fixed-cgetc.patch deleted file mode 100644 index 94735dc..0000000 --- a/0044-Fixed-cgetc.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 9dfc8f84bcc8b5ad4b50c16615a84b76cb7bedca Mon Sep 17 00:00:00 2001 -From: Greg King <gregdk@users.sf.net> -Date: Tue, 1 Oct 2019 05:30:36 -0400 -Subject: [PATCH 044/170] Fixed cgetc(). - -The GETIN function doesn't protect CPU registers. ---- - libsrc/cx16/cgetc.s | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/libsrc/cx16/cgetc.s b/libsrc/cx16/cgetc.s -index 14cad5f5..2c5ea76d 100644 ---- a/libsrc/cx16/cgetc.s -+++ b/libsrc/cx16/cgetc.s -@@ -1,5 +1,5 @@ - ; --; 2019-09-23, Greg King -+; 2019-10-01, Greg King - ; - ; char cgetc (void); - ; /* Return a character from the keyboard. */ -@@ -34,7 +34,9 @@ L1: lda KEY_COUNT - - L3: ldy IN_DEV ; Save current input device - stz IN_DEV ; Keyboard -+ phy - jsr GETIN ; Read char, and return in .A -+ ply - sty IN_DEV ; Restore input device - ldx #>$0000 - rts --- -2.26.0 - diff --git a/0045-Made-the-none-CPU-allow-all-address-sizes.patch b/0045-Made-the-none-CPU-allow-all-address-sizes.patch deleted file mode 100644 index 5868737..0000000 --- a/0045-Made-the-none-CPU-allow-all-address-sizes.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 2e5fbe89cd3f67b06b292936dfdf4fdb104b7112 Mon Sep 17 00:00:00 2001 -From: Greg King <gregdk@users.sf.net> -Date: Wed, 2 Oct 2019 10:09:48 -0400 -Subject: [PATCH 045/170] Made the "none" CPU allow all address sizes. - ---- - src/common/cpu.c | 16 ++++++++-------- - 1 file changed, 8 insertions(+), 8 deletions(-) - -diff --git a/src/common/cpu.c b/src/common/cpu.c -index b055fae8..c1ff400b 100644 ---- a/src/common/cpu.c -+++ b/src/common/cpu.c -@@ -95,20 +95,20 @@ int ValidAddrSizeForCPU (unsigned char AddrSize) - return 1; - - case ADDR_SIZE_ZP: -- /* Not supported by None and Sweet16 */ -- return (CPU != CPU_NONE && CPU != CPU_SWEET16); -+ /* Not supported by Sweet16 */ -+ return (CPU != CPU_SWEET16); - - case ADDR_SIZE_ABS: -- /* Not supported by None */ -- return (CPU != CPU_NONE); -+ /* Always supported */ -+ return 1; - - case ADDR_SIZE_FAR: -- /* Only supported by 65816 */ -- return (CPU == CPU_65816); -+ /* Supported by "none" and 65816 */ -+ return (CPU == CPU_NONE && CPU == CPU_65816); - - case ADDR_SIZE_LONG: -- /* Not supported by any CPU */ -- return 0; -+ /* "none" supports all sizes */ -+ return (CPU == CPU_NONE); - - default: - FAIL ("Invalid address size"); --- -2.26.0 - diff --git a/0046-Fix-Gamate-RVS.patch b/0046-Fix-Gamate-RVS.patch deleted file mode 100644 index b11f76e..0000000 --- a/0046-Fix-Gamate-RVS.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 9bd92178b6b122727ad23179b8edb59759e9f999 Mon Sep 17 00:00:00 2001 -From: Fabrizio Caruso <fabrizio_caruso@hotmail.com> -Date: Thu, 3 Oct 2019 18:47:10 +0200 -Subject: [PATCH 046/170] Fix Gamate RVS - ---- - libsrc/gamate/conio.s | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/libsrc/gamate/conio.s b/libsrc/gamate/conio.s -index 18d5da67..6ac43949 100644 ---- a/libsrc/gamate/conio.s -+++ b/libsrc/gamate/conio.s -@@ -13,6 +13,7 @@ initconio: - lda #0 - sta LCD_XPOS - sta LCD_YPOS -+ sta RVS - - lda #LCD_MODE_INC_Y - sta LCD_MODE --- -2.26.0 - diff --git a/0047-Fix-colors-for-948.patch b/0047-Fix-colors-for-948.patch deleted file mode 100644 index e22dd90..0000000 --- a/0047-Fix-colors-for-948.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 96547d1dd46694ff940fa36e9fc4ac02472fb26b Mon Sep 17 00:00:00 2001 -From: Stefan <stefan.haubenthal@gmail.com> -Date: Wed, 9 Oct 2019 10:03:38 +0200 -Subject: [PATCH 047/170] Fix colors for #948 - ---- - include/creativision.h | 32 ++++++++++++++++---------------- - 1 file changed, 16 insertions(+), 16 deletions(-) - -diff --git a/include/creativision.h b/include/creativision.h -index a9710902..40b9ee03 100644 ---- a/include/creativision.h -+++ b/include/creativision.h -@@ -52,22 +52,22 @@ - #define DYN_DRV 0 - - /* Colours - from TMS9918 */ --#define C_TRANSPARENT 0 --#define C_BLACK 1 --#define C_MED_GREEN 2 --#define C_LIGHT_GREEN 3 --#define C_DARK_BLUE 4 --#define C_LIGHT_BLUE 5 --#define C_DARK_RED 6 --#define C_CYAN 7 --#define C_MED_RED 8 --#define C_LIGHT_RED 9 --#define C_DARK_YELLOW 10 --#define C_LIGHT_YELLOW 11 --#define C_DARK_GREEN 12 --#define C_MAGENTA 13 --#define C_GREY 14 --#define C_WHITE 15 -+#define COLOR_TRANSPARENT 0 -+#define COLOR_BLACK 1 -+#define COLOR_MED_GREEN 2 -+#define COLOR_LIGHT_GREEN 3 -+#define COLOR_DARK_BLUE 4 -+#define COLOR_LIGHT_BLUE 5 -+#define COLOR_DARK_RED 6 -+#define COLOR_CYAN 7 -+#define COLOR_MED_RED 8 -+#define COLOR_LIGHT_RED 9 -+#define COLOR_DARK_YELLOW 10 -+#define COLOR_LIGHT_YELLOW 11 -+#define COLOR_DARK_GREEN 12 -+#define COLOR_MAGENTA 13 -+#define COLOR_GREY 14 -+#define COLOR_WHITE 15 - - /* Protos */ - void __fastcall__ psg_outb(unsigned char b); --- -2.26.0 - diff --git a/0048-Hello-world-example-for-the-Supervision.patch b/0048-Hello-world-example-for-the-Supervision.patch deleted file mode 100644 index 05fa097..0000000 --- a/0048-Hello-world-example-for-the-Supervision.patch +++ /dev/null @@ -1,91 +0,0 @@ -From 74a904be54d357d6010cb24d9d1d69d488a558b1 Mon Sep 17 00:00:00 2001 -From: Fabrizio Caruso <fabrizio_caruso@hotmail.com> -Date: Thu, 3 Oct 2019 22:46:34 +0200 -Subject: [PATCH 048/170] Hello world example for the Supervision - ---- - samples/supervisionhello.c | 72 ++++++++++++++++++++++++++++++++++++++ - 1 file changed, 72 insertions(+) - create mode 100755 samples/supervisionhello.c - -diff --git a/samples/supervisionhello.c b/samples/supervisionhello.c -new file mode 100755 -index 00000000..9b09a773 ---- /dev/null -+++ b/samples/supervisionhello.c -@@ -0,0 +1,72 @@ -+#include <supervision.h> -+#include <peekpoke.h> -+ -+#define SV_OFFSET 0x0A -+#define SV_INIT_POSITION (SV_VIDEO+0x0A*48+0x0A) -+ -+unsigned char h_char[] = {0x66,0x66,0x66,0x7e,0x66,0x66,0x66,0x00}; -+unsigned char e_char[] = {0x7e,0x60,0x60,0x78,0x60,0x60,0x7e,0x00}; -+unsigned char l_char[] = {0x60,0x60,0x60,0x60,0x60,0x60,0x7e,0x00}; -+unsigned char o_char[] = {0x3c,0x66,0x66,0x66,0x66,0x66,0x3c,0x00}; -+unsigned char w_char[] = {0x63,0x63,0x63,0x6b,0x7f,0x77,0x63,0x00}; -+unsigned char r_char[] = {0x7c,0x66,0x66,0x7c,0x78,0x6c,0x66,0x00}; -+unsigned char d_char[] = {0x78,0x6c,0x66,0x66,0x66,0x6c,0x78,0x00}; -+ -+ -+void clear_screen(void) -+{ -+ unsigned short i; -+ -+ for(i=0;i<0x2000;++i) -+ { -+ POKE(SV_VIDEO+i,0); -+ } -+} -+ -+unsigned char bit_reverse_lookup[16] = -+{ -+ 0x0, 0x8, 0x4, 0xC, 0x2, 0xA, 0x6, 0xE, -+ 0x1, 0x9, 0x5, 0xD, 0x3, 0xB, 0x7, 0xF -+}; -+ -+unsigned char bit_reverse(unsigned char n) -+{ -+ return (bit_reverse_lookup[n&0b1111] << 4) | bit_reverse_lookup[n>>4]; -+} -+ -+void init_screen(void) -+{ -+ SV_LCD.height = 0xA0; -+ SV_LCD.width = 0xA0; -+ SV_BANK = 0xC9; -+} -+ -+int main() -+{ -+ unsigned char i; -+ -+ init_screen(); -+ -+ clear_screen(); -+ -+ for(i=0;i<8;++i) -+ { -+ POKE(SV_INIT_POSITION+1 +i*48,bit_reverse(h_char[i])); -+ POKE(SV_INIT_POSITION+2 +i*48,bit_reverse(e_char[i])); -+ POKE(SV_INIT_POSITION+3 +i*48,bit_reverse(l_char[i])); -+ POKE(SV_INIT_POSITION+4 +i*48,bit_reverse(l_char[i])); -+ POKE(SV_INIT_POSITION+5 +i*48,bit_reverse(o_char[i])); -+ -+ POKE(SV_INIT_POSITION+7 +i*48,bit_reverse(w_char[i])); -+ POKE(SV_INIT_POSITION+8 +i*48,bit_reverse(o_char[i])); -+ POKE(SV_INIT_POSITION+9 +i*48,bit_reverse(r_char[i])); -+ POKE(SV_INIT_POSITION+10+i*48,bit_reverse(l_char[i])); -+ POKE(SV_INIT_POSITION+11+i*48,bit_reverse(d_char[i])); -+ } -+ -+ while(1) {}; -+ -+ return 0; -+} -+ -+ --- -2.26.0 - diff --git a/0049-Move-screen-init-into-crt0.s.patch b/0049-Move-screen-init-into-crt0.s.patch deleted file mode 100644 index 6dcd972..0000000 --- a/0049-Move-screen-init-into-crt0.s.patch +++ /dev/null @@ -1,67 +0,0 @@ -From cdb8035cf0228a2194c7bfe9216e4897777b60a9 Mon Sep 17 00:00:00 2001 -From: Fabrizio Caruso <fabrizio_caruso@hotmail.com> -Date: Thu, 3 Oct 2019 23:32:16 +0200 -Subject: [PATCH 049/170] Move screen init into crt0.s - ---- - cfg/supervision.cfg | 2 +- - libsrc/supervision/crt0.s | 5 ++++- - samples/supervisionhello.c | 9 --------- - 3 files changed, 5 insertions(+), 11 deletions(-) - -diff --git a/cfg/supervision.cfg b/cfg/supervision.cfg -index d9f189f2..6a71f468 100644 ---- a/cfg/supervision.cfg -+++ b/cfg/supervision.cfg -@@ -19,7 +19,7 @@ SEGMENTS { - CODE: load = ROM, type = ro, define = yes; - RODATA: load = ROM, type = ro, define = yes; - DATA: load = ROM, run = RAM, type = rw, define = yes; -- FFF0: load = ROM, type = ro, offset = $7FF0; -+ FFF0: load = ROM, type = ro, offset = $7FEA; - VECTOR: load = ROM, type = ro, offset = $7FFA; - BSS: load = RAM, type = bss, define = yes; - } -diff --git a/libsrc/supervision/crt0.s b/libsrc/supervision/crt0.s -index 6c128786..ab147efb 100644 ---- a/libsrc/supervision/crt0.s -+++ b/libsrc/supervision/crt0.s -@@ -67,7 +67,10 @@ not_dma: - ; Removing this segment gives only a warning. - .segment "FFF0" - .proc reset32kcode -- lda #(6<<5) -+ lda #$A0 -+ sta lcd_width -+ sta lcd_height -+ lda #$C9 - sta sv_bank - ; Now, the 32Kbyte image can reside in the top of 64Kbyte and 128Kbyte ROMs. - jmp reset -diff --git a/samples/supervisionhello.c b/samples/supervisionhello.c -index 9b09a773..5996d219 100755 ---- a/samples/supervisionhello.c -+++ b/samples/supervisionhello.c -@@ -34,19 +34,10 @@ unsigned char bit_reverse(unsigned char n) - return (bit_reverse_lookup[n&0b1111] << 4) | bit_reverse_lookup[n>>4]; - } - --void init_screen(void) --{ -- SV_LCD.height = 0xA0; -- SV_LCD.width = 0xA0; -- SV_BANK = 0xC9; --} -- - int main() - { - unsigned char i; - -- init_screen(); -- - clear_screen(); - - for(i=0;i<8;++i) --- -2.26.0 - diff --git a/0050-Improve-init-code-readability.patch b/0050-Improve-init-code-readability.patch deleted file mode 100644 index 413fc13..0000000 --- a/0050-Improve-init-code-readability.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 915836b3ec888445eb290f61456a4e23f947bc6a Mon Sep 17 00:00:00 2001 -From: Fabrizio Caruso <fabrizio_caruso@hotmail.com> -Date: Sun, 6 Oct 2019 13:00:37 +0200 -Subject: [PATCH 050/170] Improve init code readability - ---- - cfg/supervision.cfg | 2 +- - libsrc/supervision/crt0.s | 4 ++-- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/cfg/supervision.cfg b/cfg/supervision.cfg -index 6a71f468..95f04976 100644 ---- a/cfg/supervision.cfg -+++ b/cfg/supervision.cfg -@@ -19,7 +19,7 @@ SEGMENTS { - CODE: load = ROM, type = ro, define = yes; - RODATA: load = ROM, type = ro, define = yes; - DATA: load = ROM, run = RAM, type = rw, define = yes; -- FFF0: load = ROM, type = ro, offset = $7FEA; -+ FFEA: load = ROM, type = ro, offset = $7FEA; - VECTOR: load = ROM, type = ro, offset = $7FFA; - BSS: load = RAM, type = bss, define = yes; - } -diff --git a/libsrc/supervision/crt0.s b/libsrc/supervision/crt0.s -index ab147efb..a474cfbe 100644 ---- a/libsrc/supervision/crt0.s -+++ b/libsrc/supervision/crt0.s -@@ -65,12 +65,12 @@ not_dma: - .endproc - - ; Removing this segment gives only a warning. -- .segment "FFF0" -+ .segment "FFEA" - .proc reset32kcode - lda #$A0 - sta lcd_width - sta lcd_height -- lda #$C9 -+ lda #(6<<5) | SV_LCD_ON | SV_NMI_ENABLE_ON - sta sv_bank - ; Now, the 32Kbyte image can reside in the top of 64Kbyte and 128Kbyte ROMs. - jmp reset --- -2.26.0 - diff --git a/0051-Improve-helloworld-example-for-Supervision.patch b/0051-Improve-helloworld-example-for-Supervision.patch deleted file mode 100644 index 77d78f8..0000000 --- a/0051-Improve-helloworld-example-for-Supervision.patch +++ /dev/null @@ -1,112 +0,0 @@ -From eb83a3fd0f1f55910353bb6cb329b1a7f7d5137c Mon Sep 17 00:00:00 2001 -From: Fabrizio Caruso <fabrizio_caruso@hotmail.com> -Date: Sun, 6 Oct 2019 13:41:02 +0200 -Subject: [PATCH 051/170] Improve helloworld example for Supervision - ---- - samples/supervisionhello.c | 71 +++++++++++++++++++++----------------- - 1 file changed, 40 insertions(+), 31 deletions(-) - -diff --git a/samples/supervisionhello.c b/samples/supervisionhello.c -index 5996d219..c1832179 100755 ---- a/samples/supervisionhello.c -+++ b/samples/supervisionhello.c -@@ -1,17 +1,15 @@ - #include <supervision.h> - #include <peekpoke.h> - --#define SV_OFFSET 0x0A --#define SV_INIT_POSITION (SV_VIDEO+0x0A*48+0x0A) -- --unsigned char h_char[] = {0x66,0x66,0x66,0x7e,0x66,0x66,0x66,0x00}; --unsigned char e_char[] = {0x7e,0x60,0x60,0x78,0x60,0x60,0x7e,0x00}; --unsigned char l_char[] = {0x60,0x60,0x60,0x60,0x60,0x60,0x7e,0x00}; --unsigned char o_char[] = {0x3c,0x66,0x66,0x66,0x66,0x66,0x3c,0x00}; --unsigned char w_char[] = {0x63,0x63,0x63,0x6b,0x7f,0x77,0x63,0x00}; --unsigned char r_char[] = {0x7c,0x66,0x66,0x7c,0x78,0x6c,0x66,0x00}; --unsigned char d_char[] = {0x78,0x6c,0x66,0x66,0x66,0x6c,0x78,0x00}; -+#define BYTES_PER_LINE 48 - -+const unsigned char h_char[] = {0x66,0x66,0x66,0x7E,0x66,0x66,0x66,0x00}; -+const unsigned char e_char[] = {0x7E,0x60,0x60,0x78,0x60,0x60,0x7E,0x00}; -+const unsigned char l_char[] = {0x60,0x60,0x60,0x60,0x60,0x60,0x7E,0x00}; -+const unsigned char o_char[] = {0x3C,0x66,0x66,0x66,0x66,0x66,0x3C,0x00}; -+const unsigned char w_char[] = {0x63,0x63,0x63,0x6B,0x7F,0x77,0x63,0x00}; -+const unsigned char r_char[] = {0x7C,0x66,0x66,0x7C,0x78,0x6C,0x66,0x00}; -+const unsigned char d_char[] = {0x78,0x6C,0x66,0x66,0x66,0x6C,0x78,0x00}; - - void clear_screen(void) - { -@@ -23,37 +21,48 @@ void clear_screen(void) - } - } - --unsigned char bit_reverse_lookup[16] = -+unsigned char reversed_map_one_to_two_lookup[16] = - { -- 0x0, 0x8, 0x4, 0xC, 0x2, 0xA, 0x6, 0xE, -- 0x1, 0x9, 0x5, 0xD, 0x3, 0xB, 0x7, 0xF -+ 0x00, 0xC0, 0x30, 0xF0, 0x0C, 0xCC, 0x3C, 0xFC, -+ 0x03, 0xC3, 0x33, 0xF3, 0x0F, 0xCF, 0x3F, 0xFF - }; - --unsigned char bit_reverse(unsigned char n) -+unsigned char left_map_one_to_two(unsigned char n) - { -- return (bit_reverse_lookup[n&0b1111] << 4) | bit_reverse_lookup[n>>4]; -+ return reversed_map_one_to_two_lookup[n >> 4]; - } - --int main() -+unsigned char right_map_one_to_two(unsigned char n) -+{ -+ return reversed_map_one_to_two_lookup[n&0x0F]; -+} -+ -+void display_char(const unsigned char x, const unsigned char y, const unsigned char *ch) - { -- unsigned char i; -+ unsigned char k; - -+ for(k=0;k<8;++k) -+ { \ -+ SV_VIDEO[2*(y)+BYTES_PER_LINE*k+BYTES_PER_LINE*(x<<3)] = left_map_one_to_two(ch[k]); -+ SV_VIDEO[2*(y)+BYTES_PER_LINE*k+BYTES_PER_LINE*(x<<3)+1] = right_map_one_to_two(ch[k]); -+ } -+} -+ -+int main() -+{ - clear_screen(); - -- for(i=0;i<8;++i) -- { -- POKE(SV_INIT_POSITION+1 +i*48,bit_reverse(h_char[i])); -- POKE(SV_INIT_POSITION+2 +i*48,bit_reverse(e_char[i])); -- POKE(SV_INIT_POSITION+3 +i*48,bit_reverse(l_char[i])); -- POKE(SV_INIT_POSITION+4 +i*48,bit_reverse(l_char[i])); -- POKE(SV_INIT_POSITION+5 +i*48,bit_reverse(o_char[i])); -- -- POKE(SV_INIT_POSITION+7 +i*48,bit_reverse(w_char[i])); -- POKE(SV_INIT_POSITION+8 +i*48,bit_reverse(o_char[i])); -- POKE(SV_INIT_POSITION+9 +i*48,bit_reverse(r_char[i])); -- POKE(SV_INIT_POSITION+10+i*48,bit_reverse(l_char[i])); -- POKE(SV_INIT_POSITION+11+i*48,bit_reverse(d_char[i])); -- } -+ display_char(3,2, h_char); -+ display_char(3,3, e_char); -+ display_char(3,4, l_char); -+ display_char(3,5, l_char); -+ display_char(3,6, o_char); -+ -+ display_char(3,8, w_char); -+ display_char(3,9, o_char); -+ display_char(3,10,r_char); -+ display_char(3,11,l_char); -+ display_char(3,12,d_char); - - while(1) {}; - --- -2.26.0 - diff --git a/0052-Add-supervisionhello-in-samples-Makefile.patch b/0052-Add-supervisionhello-in-samples-Makefile.patch deleted file mode 100644 index 7d2d56a..0000000 --- a/0052-Add-supervisionhello-in-samples-Makefile.patch +++ /dev/null @@ -1,26 +0,0 @@ -From b051c913e9ae0b6d87c92e438d091e0c61da98f6 Mon Sep 17 00:00:00 2001 -From: Fabrizio Caruso <fabrizio_caruso@hotmail.com> -Date: Sun, 6 Oct 2019 15:19:45 +0200 -Subject: [PATCH 052/170] Add supervisionhello in samples/Makefile - ---- - samples/Makefile | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/samples/Makefile b/samples/Makefile -index ad81c247..69efbe43 100644 ---- a/samples/Makefile -+++ b/samples/Makefile -@@ -198,6 +198,9 @@ EXELIST_atarixl = $(EXELIST_atari) - - EXELIST_atari2600 = \ - atari2600hello -+ -+EXELIST_supervision = \ -+ supervisionhello - - # Unlisted targets will try to build everything. - # That lets us learn what they cannot build, and what settings --- -2.26.0 - diff --git a/0053-Use-decimal-for-lcd-size-initialization.patch b/0053-Use-decimal-for-lcd-size-initialization.patch deleted file mode 100644 index cebdf09..0000000 --- a/0053-Use-decimal-for-lcd-size-initialization.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 40cf719068f69da617bc448b031160d47a914c2a Mon Sep 17 00:00:00 2001 -From: Fabrizio Caruso <fabrizio_caruso@hotmail.com> -Date: Sun, 6 Oct 2019 20:30:30 +0200 -Subject: [PATCH 053/170] Use decimal for lcd size initialization - ---- - libsrc/supervision/crt0.s | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libsrc/supervision/crt0.s b/libsrc/supervision/crt0.s -index a474cfbe..f1c65538 100644 ---- a/libsrc/supervision/crt0.s -+++ b/libsrc/supervision/crt0.s -@@ -67,7 +67,7 @@ not_dma: - ; Removing this segment gives only a warning. - .segment "FFEA" - .proc reset32kcode -- lda #$A0 -+ lda #160 - sta lcd_width - sta lcd_height - lda #(6<<5) | SV_LCD_ON | SV_NMI_ENABLE_ON --- -2.26.0 - diff --git a/0054-Comments.patch b/0054-Comments.patch deleted file mode 100644 index c5ffe4a..0000000 --- a/0054-Comments.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 1b1d29ca9e8de2f323ac7e2492741034f0227872 Mon Sep 17 00:00:00 2001 -From: Fabrizio Caruso <fabrizio_caruso@hotmail.com> -Date: Mon, 7 Oct 2019 11:36:57 +0200 -Subject: [PATCH 054/170] Comments - ---- - samples/supervisionhello.c | 11 +++++++++++ - 1 file changed, 11 insertions(+) - -diff --git a/samples/supervisionhello.c b/samples/supervisionhello.c -index c1832179..3d2c2602 100755 ---- a/samples/supervisionhello.c -+++ b/samples/supervisionhello.c -@@ -1,8 +1,18 @@ -+/*****************************************************************************/ -+/* */ -+/* Watara Supervision sample C program */ -+/* */ -+/* Fabrizio Caruso (fabrizio_caruso@hotmail.com), 2019 */ -+/* */ -+/*****************************************************************************/ -+ - #include <supervision.h> - #include <peekpoke.h> - -+// Last 8 bytes are not displayed - #define BYTES_PER_LINE 48 - -+// Characters definitions in 8x8 format - const unsigned char h_char[] = {0x66,0x66,0x66,0x7E,0x66,0x66,0x66,0x00}; - const unsigned char e_char[] = {0x7E,0x60,0x60,0x78,0x60,0x60,0x7E,0x00}; - const unsigned char l_char[] = {0x60,0x60,0x60,0x60,0x60,0x60,0x7E,0x00}; -@@ -21,6 +31,7 @@ void clear_screen(void) - } - } - -+// Necessary conversion to have 2 bits per pixel with darkest hue - unsigned char reversed_map_one_to_two_lookup[16] = - { - 0x00, 0xC0, 0x30, 0xF0, 0x0C, 0xCC, 0x3C, 0xFC, --- -2.26.0 - diff --git a/0055-Improve-comments.patch b/0055-Improve-comments.patch deleted file mode 100644 index 686e84d..0000000 --- a/0055-Improve-comments.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 7706ea2f133287fb0d107d6c7a9f1e99e3b0e4df Mon Sep 17 00:00:00 2001 -From: Fabrizio Caruso <fabrizio_caruso@hotmail.com> -Date: Mon, 7 Oct 2019 11:41:29 +0200 -Subject: [PATCH 055/170] Improve comments - ---- - samples/supervisionhello.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/samples/supervisionhello.c b/samples/supervisionhello.c -index 3d2c2602..7cc866e5 100755 ---- a/samples/supervisionhello.c -+++ b/samples/supervisionhello.c -@@ -9,10 +9,10 @@ - #include <supervision.h> - #include <peekpoke.h> - --// Last 8 bytes are not displayed -+// Number of bytes per screen line (Remark: Last 8 bytes are not displayed) - #define BYTES_PER_LINE 48 - --// Characters definitions in 8x8 format -+// Character definitions in 8x8 format - const unsigned char h_char[] = {0x66,0x66,0x66,0x7E,0x66,0x66,0x66,0x00}; - const unsigned char e_char[] = {0x7E,0x60,0x60,0x78,0x60,0x60,0x7E,0x00}; - const unsigned char l_char[] = {0x60,0x60,0x60,0x60,0x60,0x60,0x7E,0x00}; -@@ -32,6 +32,7 @@ void clear_screen(void) - } - - // Necessary conversion to have 2 bits per pixel with darkest hue -+// Remark: The Supervision uses 2 bits per pixel and bits are mapped into pixel in reversed order - unsigned char reversed_map_one_to_two_lookup[16] = - { - 0x00, 0xC0, 0x30, 0xF0, 0x0C, 0xCC, 0x3C, 0xFC, --- -2.26.0 - diff --git a/0056-Init-is-no-longer-in-crt0.s.patch b/0056-Init-is-no-longer-in-crt0.s.patch deleted file mode 100644 index 21bde87..0000000 --- a/0056-Init-is-no-longer-in-crt0.s.patch +++ /dev/null @@ -1,65 +0,0 @@ -From fb260ef17f28305321a9932b710bd8f30f243dfc Mon Sep 17 00:00:00 2001 -From: Fabrizio Caruso <fabrizio_caruso@hotmail.com> -Date: Wed, 9 Oct 2019 09:23:57 +0200 -Subject: [PATCH 056/170] Init is no longer in crt0.s - ---- - cfg/supervision.cfg | 2 +- - libsrc/supervision/crt0.s | 5 +---- - samples/supervisionhello.c | 9 ++++++++- - 3 files changed, 10 insertions(+), 6 deletions(-) - -diff --git a/cfg/supervision.cfg b/cfg/supervision.cfg -index 95f04976..d9f189f2 100644 ---- a/cfg/supervision.cfg -+++ b/cfg/supervision.cfg -@@ -19,7 +19,7 @@ SEGMENTS { - CODE: load = ROM, type = ro, define = yes; - RODATA: load = ROM, type = ro, define = yes; - DATA: load = ROM, run = RAM, type = rw, define = yes; -- FFEA: load = ROM, type = ro, offset = $7FEA; -+ FFF0: load = ROM, type = ro, offset = $7FF0; - VECTOR: load = ROM, type = ro, offset = $7FFA; - BSS: load = RAM, type = bss, define = yes; - } -diff --git a/libsrc/supervision/crt0.s b/libsrc/supervision/crt0.s -index f1c65538..ac61c821 100644 ---- a/libsrc/supervision/crt0.s -+++ b/libsrc/supervision/crt0.s -@@ -65,11 +65,8 @@ not_dma: - .endproc - - ; Removing this segment gives only a warning. -- .segment "FFEA" -+ .segment "FFF0" - .proc reset32kcode -- lda #160 -- sta lcd_width -- sta lcd_height - lda #(6<<5) | SV_LCD_ON | SV_NMI_ENABLE_ON - sta sv_bank - ; Now, the 32Kbyte image can reside in the top of 64Kbyte and 128Kbyte ROMs. -diff --git a/samples/supervisionhello.c b/samples/supervisionhello.c -index 7cc866e5..db2b5f66 100755 ---- a/samples/supervisionhello.c -+++ b/samples/supervisionhello.c -@@ -60,8 +60,15 @@ void display_char(const unsigned char x, const unsigned char y, const unsigned c - } - } - -+void init_lcd(void) -+{ -+ SV_LCD.width = 160; -+ SV_LCD.height = 160; -+} -+ - int main() --{ -+{ -+ init_lcd(); - clear_screen(); - - display_char(3,2, h_char); --- -2.26.0 - diff --git a/0057-Significantly-faster-rand-implementation.patch b/0057-Significantly-faster-rand-implementation.patch deleted file mode 100644 index 5a4378c..0000000 --- a/0057-Significantly-faster-rand-implementation.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 3994fee595605c5981d023c29b5d9d8e170d9adc Mon Sep 17 00:00:00 2001 -From: LRFLEW <LRFLEW@aol.com> -Date: Mon, 7 Oct 2019 22:37:34 -0500 -Subject: [PATCH 057/170] Significantly faster rand() implementation - ---- - libsrc/common/rand.s | 22 ++++++---------------- - 1 file changed, 6 insertions(+), 16 deletions(-) - -diff --git a/libsrc/common/rand.s b/libsrc/common/rand.s -index 102dd5be..fc23b6ee 100644 ---- a/libsrc/common/rand.s -+++ b/libsrc/common/rand.s -@@ -35,27 +35,17 @@ rand: .dword 1 - .code - - _rand: clc -- lda rand+0 ; SEED *= $01010101 -- adc rand+1 -- sta rand+1 -- adc rand+2 -- sta rand+2 -- adc rand+3 -- sta rand+3 -- clc -- lda rand+0 ; SEED += $31415927 -- adc #$27 -+ lda rand+0 ; SEED += $B3 -+ adc #$B3 - sta rand+0 -- lda rand+1 -- adc #$59 -+ adc rand+1 ; SEED *= $01010101 - sta rand+1 -- lda rand+2 -- adc #$41 -+ adc rand+2 - sta rand+2 - and #$7f ; Suppress sign bit (make it positive) - tax -- lda rand+3 -- adc #$31 -+ lda rand+2 -+ adc rand+3 - sta rand+3 - rts ; return bit (16-22,24-31) in (X,A) - --- -2.26.0 - diff --git a/0058-Update-comments-in-rand.s.patch b/0058-Update-comments-in-rand.s.patch deleted file mode 100644 index 8eb42b2..0000000 --- a/0058-Update-comments-in-rand.s.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 216105f6df0f24ee656de3cf3abca4591ed3723d Mon Sep 17 00:00:00 2001 -From: LRFLEW <LRFLEW@aol.com> -Date: Wed, 9 Oct 2019 01:42:50 -0500 -Subject: [PATCH 058/170] Update comments in rand.s - ---- - libsrc/common/rand.s | 16 ++++++++++++++-- - 1 file changed, 14 insertions(+), 2 deletions(-) - -diff --git a/libsrc/common/rand.s b/libsrc/common/rand.s -index fc23b6ee..a272af80 100644 ---- a/libsrc/common/rand.s -+++ b/libsrc/common/rand.s -@@ -3,6 +3,7 @@ - ; - ; Written and donated by Sidney Cadot - sidney@ch.twi.tudelft.nl - ; 2016-11-07, modified by Brad Smith -+; 2019-10-07, modified by Lewis "LRFLEW" Fox - ; - ; May be distributed with the cc65 runtime using the same license. - ; -@@ -22,6 +23,17 @@ - ; The best 8 bits, 24-31 are returned in the - ; low byte A to provide the best entropy in the - ; most commonly used part of the return value. -+; -+; Uses the following LCG values for ax + c (mod m) -+; a = $01010101 -+; c = $B3B3B3B3 -+; m = $100000000 (32-bit truncation) -+; -+; The multiplier was carefully chosen such that it can -+; be computed with 3 adc instructions, and the increment -+; was chosen to have the same value in each byte to allow -+; the addition to be performed in conjunction with the -+; multiplication, adding only 1 additional adc instruction. - ; - - .export _rand, _srand -@@ -35,10 +47,10 @@ rand: .dword 1 - .code - - _rand: clc -- lda rand+0 ; SEED += $B3 -+ lda rand+0 - adc #$B3 - sta rand+0 -- adc rand+1 ; SEED *= $01010101 -+ adc rand+1 - sta rand+1 - adc rand+2 - sta rand+2 --- -2.26.0 - diff --git a/0059-Added-new-program-descriptions-to-the-list.patch b/0059-Added-new-program-descriptions-to-the-list.patch deleted file mode 100644 index 08adfe0..0000000 --- a/0059-Added-new-program-descriptions-to-the-list.patch +++ /dev/null @@ -1,185 +0,0 @@ -From 39b10f9599b15a5256db22fe386472fa6ec0e12f Mon Sep 17 00:00:00 2001 -From: Greg King <gregdk@users.sf.net> -Date: Fri, 11 Oct 2019 10:48:56 -0400 -Subject: [PATCH 059/170] Added new program descriptions to the list. - ---- - samples/README | 80 ++++++++++++++++++++++++++++++-------------------- - 1 file changed, 48 insertions(+), 32 deletions(-) - -diff --git a/samples/README b/samples/README -index 88a6021c..7ace7da3 100644 ---- a/samples/README -+++ b/samples/README -@@ -1,19 +1,20 @@ - - This directory contains sample programs for the cc65 compiler. - --Below is a short description for each of the programs together with a list of --the supported platforms. -+Below is a short description for each of the programs, together with a list -+of the supported platforms. - - Please note: - -- * The supplied makefile needs GNU make. It works out of the box on Linux -- and similar systems. If you're using Windows, consider installing Cygwin. -+ * The supplied makefile needs GNU make. It works out of the box on Linux and -+ similar systems. If you're using Windows, then consider installing Cygwin -+ or MSys2. - -- * The makefile specifies the C64 as the default target system, because all -- but one of the programs run on this platform. When compiling for another -+ * The makefile specifies the C64 as the default target system because all -+ but three of the programs run on that platform. When compiling for another - system, you will have to change the line that specifies the target system - at the top of the makefile, specify the system with SYS=<target> on the -- make command line or set a SYS env var. -+ make command line, or set a SYS environment variable. - - - List of supplied sample programs: -@@ -22,87 +23,95 @@ List of supplied sample programs: - Name: ascii - Description: Shows the ASCII (or ATASCII, PETSCII) codes of typed - characters. Written and contributed by Greg King -- <gngking@erols.com>. -+ <greg.king5@verizon.com>. - Platforms: All platforms with conio or stdio (compile time configurable). - -+----------------------------------------------------------------------------- -+Name: atari2600hello -+Description: A "Hello world" type program. -+Platforms: Runs on only the Atari 2600 Video Console System. -+ - ----------------------------------------------------------------------------- - Name: diodemo - Description: A disc copy program written and contributed by Oliver - Schmidt, <ol.sc@web.de>. Supports single or dual disc copy. - Platforms: The program does depend on conio and dio (direct disk i/o), -- so it does currently compile for the Atari and Apple ][ -+ so it currently does compile for only the Atari and Apple ][ - machines. - - ----------------------------------------------------------------------------- - Name: enumdevdir --Description: Enumerates all devices, directories and files. Written and -+Description: Enumerates all devices, directories, and files. Written and - contributed by Oliver Schmidt, <ol.sc@web.de>. - Platforms: All systems with device enumeration and directory access -- (currently the C64, the C128 and the Apple ][). -+ (currently the Commodore machines, the Commander X16, -+ and the Apple ][). - - ----------------------------------------------------------------------------- - Name: fire - Description: Another graphics demo written by groepaz/hitmen. --Platforms: The program is currently only running on the C64, but should -+Platforms: The program currently is running on only the C64, but should - be portable to the C128 and CBM510 (and maybe more machines). - - ----------------------------------------------------------------------------- - Name: gunzip65 --Description: A gunzip utility for 6502 based machines written by Piotr -+Description: A gunzip utility for 6502-based machines, written by Piotr - Fusik <fox@scene.pl>. - Platforms: Runs on all platforms with file I/O (currently the Atari, the -- Apple ][ and most Commodore machines). -+ Apple ][, Commodore machines, and the Commander X16). - - ----------------------------------------------------------------------------- - Name: hello - Description: A nice "Hello world" type program that uses the conio - console I/O library for output. - Platforms: Runs on all platforms that support conio, which means: -- Apple ][, Atari, C16, C64, C128, CBM510, CBM610, PET, Plus/4 -+ Apple ][, Atari, Commodore machines, Commander X16, -+ Creativision, Gamate, NES. - - ----------------------------------------------------------------------------- - Name: mandelbrot - Description: A mandelbrot demo using integer arithmetic. The demo was -- written by groepaz/hitmen and converted to cc65 using TGI -+ written by groepaz/hitmen, and converted to cc65 using TGI - graphics by Stephan Haubenthal. - Platforms: Runs on all platforms that have TGI support: -- Apple ][, C64, C128, Oric Atmos, Geos and Lynx. -+ Apple ][, Atari, C64, C128, Oric Atmos and Telestrat, GEOS, -+ NES, and Lynx. - - ----------------------------------------------------------------------------- - Name: mousedemo - Description: Shows how to use the mouse. - Platforms: All systems with mouse and conio support: -- C64, C128, CBM510, Atari, Apple ][ -+ C64, C128, CBM510, Atari, Apple ][. - - ----------------------------------------------------------------------------- - Name: multidemo - Description: Shows how to combine multiple cc65 features incl. overlays - and extended memory drivers. Written and contributed by - Oliver Schmidt, <ol.sc@web.de>. --Platforms: All systems with an overlay linker config, disk directory -- access and EMD support (currently the C64, the C128, -- the Atari and the Apple ][). -+Platforms: All systems with an overlay linker config., disk directory -+ access, and EMD support (currently the C64, the C128, -+ the Atari, and the Apple ][). - - ----------------------------------------------------------------------------- - Name: nachtm --Description: Plays "Eine kleine Nachtmusik" by Wolfgang Amadeus Mozart -+Description: Plays "Eine kleine Nachtmusik" by Wolfgang Amadeus Mozart. - Platforms: All systems that have the Commodore SID (Sound Interface - Device): -- C64, C128, CBM510, CBM610 -+ C64, C128, CBM510, CBM610. - - ----------------------------------------------------------------------------- - Name: overlaydemo - Description: Shows how to load overlay files from disk. Written and - contributed by Oliver Schmidt, <ol.sc@web.de>. --Platforms: All systems with an overlay linker config (currently the C64, -- the C128, the Atari and the Apple ][). -+Platforms: All systems with an overlay linker config. (currently the C64, -+ the C128, the Atari, and the Apple ][). - - ----------------------------------------------------------------------------- - Name: plasma - Description: A fancy graphics demo written by groepaz/hitmen. --Platforms: The program needs a VIC, or a TED, so it runs on the following -+Platforms: The program needs a VIC-II or a TED, so it runs on the following - systems: -- C64, C128, CBM510, Plus/4 -+ C64, C128, CBM510, Plus/4. - - ----------------------------------------------------------------------------- - Name: sieve -@@ -110,12 +119,19 @@ Description: Implements the "Sieve of Eratosthenes" as a way to find all - prime numbers in a specific number interval. Often used as - a benchmark program. - Platforms: All systems with conio and clock support: -- Atari, C16, C64, C128, CBM510, CBM610, PET, Plus/4, -- Apple ][ (without timing due to missing clock support) -+ Atari, Commodore machines (VIC-20 needs memory expansion), -+ Commander X16, Apple ][ (without timing due to missing clock -+ support). -+ -+----------------------------------------------------------------------------- -+Name: supervisionhello -+Description: A "Hello world" type program. -+Platforms: Runs on only the Watara Supervision game console. - - ----------------------------------------------------------------------------- - Name: tgidemo --Description: Shows some of the graphics capabilities of the "tiny graphics -- interface". -+Description: Shows some of the graphics capabilities of the "Tiny Graphics -+ Interface". - Platforms: Runs on all platforms that have TGI support: -- Apple ][, C64, C128, Oric Atmos, Geos and Lynx. -+ Apple ][, Atari, C64, C128, Oric Atmos and Telestrat, GEOS, -+ NES, and Lynx. --- -2.26.0 - diff --git a/0060-Fixed-problems-with-the-Atari-Lynx-s-TGI-driver.patch b/0060-Fixed-problems-with-the-Atari-Lynx-s-TGI-driver.patch deleted file mode 100644 index 8dcce44..0000000 --- a/0060-Fixed-problems-with-the-Atari-Lynx-s-TGI-driver.patch +++ /dev/null @@ -1,157 +0,0 @@ -From f3f15cfd25dc5379ca48021884f4b96471dd895e Mon Sep 17 00:00:00 2001 -From: Greg King <gregdk@users.sf.net> -Date: Sat, 12 Oct 2019 04:01:03 -0400 -Subject: [PATCH 060/170] Fixed problems with the Atari Lynx's TGI driver. - -* The sprite-types for black and transparent backgrounds were swapped. -* A filler-byte for text output isn't printed. (A hardware bug might not need that work-around in most cases.) ---- - libsrc/lynx/tgi/lynx-160-102-16.s | 52 +++++++++++++++++-------------- - 1 file changed, 28 insertions(+), 24 deletions(-) - -diff --git a/libsrc/lynx/tgi/lynx-160-102-16.s b/libsrc/lynx/tgi/lynx-160-102-16.s -index 04bdaae0..0728e687 100644 ---- a/libsrc/lynx/tgi/lynx-160-102-16.s -+++ b/libsrc/lynx/tgi/lynx-160-102-16.s -@@ -1,10 +1,10 @@ - ; - ; Graphics driver for the 160x102x16 mode on the Lynx. - ; --; All the drawing functions are simply done by sprites as the sprite -+; All the drawing functions simply are done by sprites, as the sprite - ; engine is the only way to do fast graphics on a Lynx. - ; --; This code is written by Karri Kaksonen, 2004 for the cc65 compiler. -+; This code was written by Karri Kaksonen, 2004 for the cc65 compiler. - ; - - .include "zeropage.inc" -@@ -104,8 +104,10 @@ BGINDEX: .res 1 ; Pen to use for text background - DRAWPAGE: .res 1 - SWAPREQUEST: .res 1 - -+; 8 rows with (one offset-byte plus 20 character bytes plus one fill-byte) plus one 0-offset-byte. -+; (As an experiment, the fill-byte isn't being generated. -+; It might not be needed to work around a Suzy bug.) - text_bitmap: .res 8*(1+20+1)+1 --; 8 rows with (one offset-byte plus 20 character bytes plus one fill-byte) plus one 0-offset-byte - - ; Constants and tables - -@@ -830,7 +832,7 @@ TEXTSTYLE: - - ; ------------------------------------------------------------------------ - ; OUTTEXT: Output text at X/Y = ptr1/ptr2 using the current color and the --; current text style. The text to output is given as a zero terminated -+; current text style. The text to output is given as a zero-terminated - ; string with address in ptr3. - ; - ; Must set an error code: NO -@@ -842,12 +844,11 @@ OUTTEXT: - lda TEXTMAGY - sta text_sy+1 - -- stz text_sprite ; Set normal sprite - lda BGINDEX -- bne @L1 -- lda #4 -- sta text_sprite ; Set opaque sprite -+ beq @L1 ; Choose opaque black sprite? -+ lda #$04 ; No, choose normal sprite - @L1: -+ sta text_sprite - lda DRAWINDEX ; Set color - asl - asl -@@ -875,15 +876,18 @@ OUTTEXT: - ldy #20 - @L3: - sty STRLEN -+ tya - bne @L4 -- rts ; Zero length string -+ rts ; Zero-length string - @L4: - iny ; Prepare text_bitmap -- iny -+ -+; The next instruction is commented because the code won't include a fill-byte. -+; iny - sty STROFF - - ldy #8-1 ; 8 pixel lines per character -- ldx #0 -+ ldx #$00 - clc - @L5: - lda STROFF -@@ -891,45 +895,45 @@ OUTTEXT: - txa - adc STROFF - tax -- lda #$ff -- sta text_bitmap-1,x -+ -+; This was the fill-byte. -+; lda #$FF -+; sta text_bitmap-1,x - dey - bpl @L5 - stz text_bitmap,x - - stz tmp2 -- iny -+ iny ;(ldy #$00) - @L6: - lda (STRPTR),y - sty tmp1 - -- sec ; (ch-' ') * 8 -- sbc #32 -- stz FONTOFF -+ sub #' ' ; (ch - ' ') * 8 - stz FONTOFF+1 - asl - asl - rol FONTOFF+1 - asl - rol FONTOFF+1 -- clc ; Choose font -- adc #<font -+ ;clc ; (cleared by rol) -+ adc #<font ; Choose font - sta FONTOFF - lda FONTOFF+1 - adc #>font - sta FONTOFF+1 - --; and now copy the 8 bytes of that char -+; And now, copy the 8 bytes of that glyph. - - ldx tmp2 - inx - stx tmp2 - --; draw char from top to bottom, reading char-data from offset 8-1 to offset 0 -+; Draw char. from top to bottom, reading char-data from offset 8-1 to offset 0. - ldy #8-1 - @L7: -- lda (FONTOFF),y ; *chptr -- sta text_bitmap,x ;textbuf[y*(1+len+1)+1+x] -+ lda (FONTOFF),y ; *chptr -+ sta text_bitmap,x ; textbuf[y*(1+len+1)+1+x] - - txa - adc STROFF -@@ -938,7 +942,7 @@ OUTTEXT: - dey - bpl @L7 - -- ; goto next char -+ ; Goto next char. - ldy tmp1 - iny - dec STRLEN --- -2.26.0 - diff --git a/0061-cx16-Update-ROM-banks-to-new-mapping.patch b/0061-cx16-Update-ROM-banks-to-new-mapping.patch deleted file mode 100644 index f61159b..0000000 --- a/0061-cx16-Update-ROM-banks-to-new-mapping.patch +++ /dev/null @@ -1,33 +0,0 @@ -From e660a4934791d046a2034257619148a72841a2ab Mon Sep 17 00:00:00 2001 -From: LRFLEW <LRFLEW@aol.com> -Date: Mon, 7 Oct 2019 13:36:54 -0500 -Subject: [PATCH 061/170] [cx16] Update ROM banks to new mapping - ---- - libsrc/cx16/crt0.s | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/libsrc/cx16/crt0.s b/libsrc/cx16/crt0.s -index a3a613bd..873fd706 100644 ---- a/libsrc/cx16/crt0.s -+++ b/libsrc/cx16/crt0.s -@@ -62,6 +62,7 @@ L2: lda zpsave,x - stx VIA1::PRA2 ; Restore former RAM bank - lda VIA1::PRB - and #<~$07 -+ ora #$04 - sta VIA1::PRB ; Change back to BASIC ROM - - ; Back to BASIC. -@@ -77,7 +78,7 @@ init: - ; Change from BASIC's ROM to Kernal's ROM. - - lda VIA1::PRB -- ora #$07 -+ and #<~$07 - sta VIA1::PRB - - ; Change to the first RAM bank. --- -2.26.0 - diff --git a/0062-Fixed-error-handling-for-missing-names-in-ld65-confi.patch b/0062-Fixed-error-handling-for-missing-names-in-ld65-confi.patch deleted file mode 100644 index 68a0d18..0000000 --- a/0062-Fixed-error-handling-for-missing-names-in-ld65-confi.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 4f24a06f0e06ea420ef6ec995ed86260aba8749a Mon Sep 17 00:00:00 2001 -From: Greg King <gregdk@users.sf.net> -Date: Sat, 12 Oct 2019 07:59:49 -0400 -Subject: [PATCH 062/170] Fixed error handling for missing names in ld65 - configure files. - ---- - src/ld65/scanner.c | 8 +++++--- - 1 file changed, 5 insertions(+), 3 deletions(-) - -diff --git a/src/ld65/scanner.c b/src/ld65/scanner.c -index 31f1c7a4..d6278abb 100644 ---- a/src/ld65/scanner.c -+++ b/src/ld65/scanner.c -@@ -490,7 +490,6 @@ void CfgSpecialToken (const IdentTok* Table, unsigned Size, const char* Name) - - /* We need an identifier */ - if (CfgTok == CFGTOK_IDENT) { -- - /* Make it upper case */ - SB_ToUpper (&CfgSVal); - -@@ -502,10 +501,13 @@ void CfgSpecialToken (const IdentTok* Table, unsigned Size, const char* Name) - } - } - -+ /* Not found */ -+ CfgError (&CfgErrorPos, "%s expected, got '%s'", Name, SB_GetConstBuf(&CfgSVal)); -+ return; - } - -- /* Not found or no identifier */ -- CfgError (&CfgErrorPos, "%s expected, got '%s'", Name, SB_GetConstBuf(&CfgSVal)); -+ /* No identifier */ -+ CfgError (&CfgErrorPos, "%s expected", Name); - } - - --- -2.26.0 - diff --git a/0063-Fix-char-35-38-42-47-52.patch b/0063-Fix-char-35-38-42-47-52.patch deleted file mode 100644 index fe36c60..0000000 --- a/0063-Fix-char-35-38-42-47-52.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 5eda1c256cdda5fda1c8ee17a1036a84782a00b3 Mon Sep 17 00:00:00 2001 -From: Fabrizio Caruso <fabrizio_caruso@hotmail.com> -Date: Sun, 13 Oct 2019 10:27:09 +0200 -Subject: [PATCH 063/170] Fix char 35 38 42 47 52 - ---- - libsrc/lynx/tgi/lynx-160-102-16.s | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/libsrc/lynx/tgi/lynx-160-102-16.s b/libsrc/lynx/tgi/lynx-160-102-16.s -index 0728e687..cc85060c 100644 ---- a/libsrc/lynx/tgi/lynx-160-102-16.s -+++ b/libsrc/lynx/tgi/lynx-160-102-16.s -@@ -979,24 +979,24 @@ font: - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ;32 - .byte $FF, $E7, $FF, $FF, $E7, $E7, $E7, $E7 ;33 - .byte $FF, $FF, $FF, $FF, $FF, $99, $99, $99 ;34 -- .byte $FF, $99, $99, $00, $99, $00, $99, $99 ;35 -+ .byte $FF, $D7, $D7, $01, $D7, $01, $D7, $D7 ;35 - .byte $FF, $E7, $83, $F9, $C3, $9F, $C1, $E7 ;36 - .byte $FF, $B9, $99, $CF, $E7, $F3, $99, $9D ;37 -- .byte $FF, $C0, $99, $98, $C7, $C3, $99, $C3 ;38 -+ .byte $81, $B3, $31, $8F, $87, $33, $87, $FF ;38 - .byte $FF, $FF, $FF, $FF, $FF, $E7, $F3, $F9 ;39 - .byte $FF, $F3, $E7, $CF, $CF, $CF, $E7, $F3 ;40 - .byte $FF, $CF, $E7, $F3, $F3, $F3, $E7, $CF ;41 -- .byte $FF, $FF, $99, $C3, $00, $C3, $99, $FF ;42 -+ .byte $FF, $99, $C3, $81, $C3, $99, $FF, $FF ;42 - .byte $FF, $FF, $E7, $E7, $81, $E7, $E7, $FF ;43 - .byte $CF, $E7, $E7, $FF, $FF, $FF, $FF, $FF ;44 - .byte $FF, $FF, $FF, $FF, $81, $FF, $FF, $FF ;45 - .byte $FF, $E7, $E7, $FF, $FF, $FF, $FF, $FF ;46 -- .byte $FF, $9F, $CF, $E7, $F3, $F9, $FC, $FF ;47 -+ .byte $FF, $BF, $9F, $CF, $E7, $F3, $F9, $FD ;47 - .byte $FF, $C3, $99, $99, $89, $91, $99, $C3 ;48 - .byte $FF, $81, $E7, $E7, $E7, $C7, $E7, $E7 ;49 - .byte $FF, $81, $9F, $CF, $F3, $F9, $99, $C3 ;50 - .byte $FF, $C3, $99, $F9, $E3, $F9, $99, $C3 ;51 -- .byte $FF, $F9, $F9, $80, $99, $E1, $F1, $F9 ;52 -+ .byte $F3, $F3, $01, $33, $C3, $E3, $FB, $FF ;52 - .byte $FF, $C3, $99, $F9, $F9, $83, $9F, $81 ;53 - .byte $FF, $C3, $99, $99, $83, $9F, $99, $C3 ;54 - .byte $FF, $E7, $E7, $E7, $E7, $F3, $99, $81 ;55 --- -2.26.0 - diff --git a/0064-Fix-4.patch b/0064-Fix-4.patch deleted file mode 100644 index 291b4f4..0000000 --- a/0064-Fix-4.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 0210d76694bad683f5fb6d384f619c0975d5f14d Mon Sep 17 00:00:00 2001 -From: Fabrizio Caruso <fabrizio_caruso@hotmail.com> -Date: Sun, 13 Oct 2019 10:41:44 +0200 -Subject: [PATCH 064/170] Fix 4 - ---- - libsrc/lynx/tgi/lynx-160-102-16.s | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libsrc/lynx/tgi/lynx-160-102-16.s b/libsrc/lynx/tgi/lynx-160-102-16.s -index cc85060c..f749fc57 100644 ---- a/libsrc/lynx/tgi/lynx-160-102-16.s -+++ b/libsrc/lynx/tgi/lynx-160-102-16.s -@@ -996,7 +996,7 @@ font: - .byte $FF, $81, $E7, $E7, $E7, $C7, $E7, $E7 ;49 - .byte $FF, $81, $9F, $CF, $F3, $F9, $99, $C3 ;50 - .byte $FF, $C3, $99, $F9, $E3, $F9, $99, $C3 ;51 -- .byte $F3, $F3, $01, $33, $C3, $E3, $FB, $FF ;52 -+ .byte $FF, $F3, $F3, $01, $33, $C3, $E3, $FB ;52 - .byte $FF, $C3, $99, $F9, $F9, $83, $9F, $81 ;53 - .byte $FF, $C3, $99, $99, $83, $9F, $99, $C3 ;54 - .byte $FF, $E7, $E7, $E7, $E7, $F3, $99, $81 ;55 --- -2.26.0 - diff --git a/0065-M-N-fixed.patch b/0065-M-N-fixed.patch deleted file mode 100644 index 2cd32b5..0000000 --- a/0065-M-N-fixed.patch +++ /dev/null @@ -1,34 +0,0 @@ -From d04f7935c30b4b7aacb5670a968f51981c0c90df Mon Sep 17 00:00:00 2001 -From: Fabrizio Caruso <fabrizio_caruso@hotmail.com> -Date: Sun, 13 Oct 2019 11:23:09 +0200 -Subject: [PATCH 065/170] M N fixed - ---- - libsrc/lynx/tgi/lynx-160-102-16.s | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/libsrc/lynx/tgi/lynx-160-102-16.s b/libsrc/lynx/tgi/lynx-160-102-16.s -index f749fc57..463a322a 100644 ---- a/libsrc/lynx/tgi/lynx-160-102-16.s -+++ b/libsrc/lynx/tgi/lynx-160-102-16.s -@@ -1023,7 +1023,7 @@ font: - .byte $FF, $C7, $93, $F3, $F3, $F3, $F3, $E1 ;10 - .byte $FF, $99, $93, $87, $8F, $87, $93, $99 ;11 - .byte $FF, $81, $9F, $9F, $9F, $9F, $9F, $9F ;12 -- .byte $FF, $9C, $9C, $9C, $94, $80, $88, $9C ;13 -+ .byte $FF, $39, $39, $39, $29, $01, $11, $39 ;13 - .byte $FF, $99, $99, $91, $81, $81, $89, $99 ;14 - .byte $FF, $C3, $99, $99, $99, $99, $99, $C3 ;15 - .byte $FF, $9F, $9F, $9F, $83, $99, $99, $83 ;16 -@@ -1033,7 +1033,7 @@ font: - .byte $FF, $E7, $E7, $E7, $E7, $E7, $E7, $81 ;20 - .byte $FF, $C3, $99, $99, $99, $99, $99, $99 ;21 - .byte $FF, $E7, $C3, $99, $99, $99, $99, $99 ;22 -- .byte $FF, $9C, $88, $80, $94, $9C, $9C, $9C ;23 -+ .byte $FF, $39, $11, $01, $29, $39, $39, $39 ;23 - .byte $FF, $99, $99, $C3, $E7, $C3, $99, $99 ;24 - .byte $FF, $E7, $E7, $E7, $C3, $99, $99, $99 ;25 - .byte $FF, $81, $9F, $CF, $E7, $F3, $F9, $81 ;26 --- -2.26.0 - diff --git a/0066-Fix-left-arrow-char-77-13-64.patch b/0066-Fix-left-arrow-char-77-13-64.patch deleted file mode 100644 index ec28c5e..0000000 --- a/0066-Fix-left-arrow-char-77-13-64.patch +++ /dev/null @@ -1,25 +0,0 @@ -From b91e2337146cab57a3a481a152c1b3051999696d Mon Sep 17 00:00:00 2001 -From: Fabrizio Caruso <fabrizio_caruso@hotmail.com> -Date: Sun, 13 Oct 2019 11:30:21 +0200 -Subject: [PATCH 066/170] Fix left arrow (char 77=13+64) - ---- - libsrc/lynx/tgi/lynx-160-102-16.s | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libsrc/lynx/tgi/lynx-160-102-16.s b/libsrc/lynx/tgi/lynx-160-102-16.s -index 463a322a..53597b7d 100644 ---- a/libsrc/lynx/tgi/lynx-160-102-16.s -+++ b/libsrc/lynx/tgi/lynx-160-102-16.s -@@ -1041,7 +1041,7 @@ font: - .byte $FF, $03, $9D, $CF, $83, $CF, $ED, $F3 ;28 - .byte $FF, $C3, $F3, $F3, $F3, $F3, $F3, $C3 ;29 - .byte $E7, $E7, $E7, $E7, $81, $C3, $E7, $FF ;30 -- .byte $FF, $EF, $CF, $80, $80, $CF, $EF, $FF ;31 -+ .byte $FF, $DF, $9F, $01, $01, $9F, $DF, $FF ;31 - - - ; gemena --- -2.26.0 - diff --git a/0067-Fix-127-second-left-arrow.patch b/0067-Fix-127-second-left-arrow.patch deleted file mode 100644 index 9d73512..0000000 --- a/0067-Fix-127-second-left-arrow.patch +++ /dev/null @@ -1,22 +0,0 @@ -From bac6f94929497f28d8a15a996e4fb578a6ff80d5 Mon Sep 17 00:00:00 2001 -From: Fabrizio Caruso <fabrizio_caruso@hotmail.com> -Date: Sun, 13 Oct 2019 12:13:46 +0200 -Subject: [PATCH 067/170] Fix 127 (second left arrow) - ---- - libsrc/lynx/tgi/lynx-160-102-16.s | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libsrc/lynx/tgi/lynx-160-102-16.s b/libsrc/lynx/tgi/lynx-160-102-16.s -index 53597b7d..00b7364c 100644 ---- a/libsrc/lynx/tgi/lynx-160-102-16.s -+++ b/libsrc/lynx/tgi/lynx-160-102-16.s -@@ -1076,4 +1076,4 @@ font: - .byte $FF, $03, $9D, $CF, $83, $CF, $ED, $F3 ;252 - .byte $FF, $C3, $F3, $F3, $F3, $F3, $F3, $C3 ;253 - .byte $E7, $E7, $E7, $E7, $81, $C3, $E7, $FF ;254 -- .byte $FF, $EF, $CF, $80, $80, $CF, $EF, $FF ;255 -+ .byte $FF, $DF, $9F, $01, $01, $9F, $DF, $FF ;255 --- -2.26.0 - diff --git a/0068-small-m-and-n-fixed.patch b/0068-small-m-and-n-fixed.patch deleted file mode 100644 index 6188eb0..0000000 --- a/0068-small-m-and-n-fixed.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 9a3e521358a31d7764988101e1da674b390ba49a Mon Sep 17 00:00:00 2001 -From: Fabrizio Caruso <fabrizio_caruso@hotmail.com> -Date: Sun, 13 Oct 2019 12:32:54 +0200 -Subject: [PATCH 068/170] small m and n fixed - ---- - libsrc/lynx/tgi/lynx-160-102-16.s | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/libsrc/lynx/tgi/lynx-160-102-16.s b/libsrc/lynx/tgi/lynx-160-102-16.s -index 00b7364c..903d8f25 100644 ---- a/libsrc/lynx/tgi/lynx-160-102-16.s -+++ b/libsrc/lynx/tgi/lynx-160-102-16.s -@@ -1058,7 +1058,7 @@ font: - .byte $C3, $F9, $F9, $F9, $F9, $FF, $F9, $FF ;234 - .byte $FF, $99, $93, $87, $93, $9F, $9F, $FF ;235 - .byte $FF, $C3, $E7, $E7, $E7, $E7, $C7, $FF ;236 -- .byte $FF, $9C, $94, $80, $80, $99, $FF, $FF ;237 -+ .byte $FF, $39, $29, $01, $83, $93, $FF, $FF ;237 - .byte $FF, $99, $99, $99, $99, $83, $FF, $FF ;238 - .byte $FF, $C3, $99, $99, $99, $C3, $FF, $FF ;239 - .byte $9F, $9F, $83, $99, $99, $83, $FF, $FF ;240 -@@ -1068,7 +1068,7 @@ font: - .byte $FF, $F1, $E7, $E7, $E7, $81, $E7, $FF ;244 - .byte $FF, $C1, $99, $99, $99, $99, $FF, $FF ;245 - .byte $FF, $E7, $C3, $99, $99, $99, $FF, $FF ;246 -- .byte $FF, $C9, $C1, $80, $94, $9C, $FF, $FF ;247 -+ .byte $FF, $93, $83, $01, $29, $39, $FF, $FF ;247 - .byte $FF, $99, $C3, $E7, $C3, $99, $FF, $FF ;248 - .byte $87, $F3, $C1, $99, $99, $99, $FF, $FF ;249 - .byte $FF, $81, $CF, $E7, $F3, $81, $FF, $FF ;250 --- -2.26.0 - diff --git a/0069-New-OSI-input-routine-based-on-disassembly-of-ROM-co.patch b/0069-New-OSI-input-routine-based-on-disassembly-of-ROM-co.patch deleted file mode 100644 index eb23fc6..0000000 --- a/0069-New-OSI-input-routine-based-on-disassembly-of-ROM-co.patch +++ /dev/null @@ -1,267 +0,0 @@ -From e2007d074312c2f8600d8da87b2c55a724f4b128 Mon Sep 17 00:00:00 2001 -From: Jeff Tranter <tranter@pobox.com> -Date: Thu, 4 Jan 2018 19:04:13 -0500 -Subject: [PATCH 069/170] New OSI input routine based on disassembly of ROM - code. - ---- - libsrc/osic1p/cgetc.s | 189 ++++++++++++++++++++++++++++++++++++++- - libsrc/osic1p/kbhit.s | 3 +- - libsrc/osic1p/osic1p.inc | 1 - - 3 files changed, 190 insertions(+), 3 deletions(-) - -diff --git a/libsrc/osic1p/cgetc.s b/libsrc/osic1p/cgetc.s -index f05ad33e..d99f69a7 100644 ---- a/libsrc/osic1p/cgetc.s -+++ b/libsrc/osic1p/cgetc.s -@@ -4,17 +4,34 @@ - - .constructor initcgetc - .export _cgetc -+ .export inputc - .import cursor - - .include "osic1p.inc" - .include "extzp.inc" - .include "zeropage.inc" - -+; Internal state that needs to be preserved across calls. -+; These variables are named after the original memory locations used by the -+; 65V PROM MONITOR, until the actual meaning is determined. -+.segment "EXTZP" : zeropage -+ -+KB0213: .res 1 -+KB0214: .res 1 -+KB0215: .res 1 -+KB0216: .res 1 -+ - ; Initialize one-character buffer that is filled by kbhit() - .segment "ONCE" - initcgetc: - lda #$00 - sta CHARBUF ; No character in buffer initially -+ -+ sta KB0213 ; Initialize keyboard state -+ sta KB0214 -+ sta KB0215 -+ sta KB0216 -+ - rts - - ; Input routine from 65V PROM MONITOR, show cursor if enabled -@@ -35,7 +52,7 @@ nobuffer: - lda #$A1 ; full white square - sta (SCREEN_PTR),y ; store at cursor position - nocursor: -- jsr INPUTC ; get input character in A -+ jsr inputc ; get input character in A - ldx cursor - beq done ; was cursor on? - tax ; save A in X -@@ -48,3 +65,173 @@ restorex: - done: - ldx #$00 ; high byte of int return value - rts -+ -+; Routine to get character from keyboard and return it in A. -+; Based on the OSI ROM routine at $FD00 but uses different -+; storage locations to avoid corrupting CC65 run-time code. -+ -+inputc: txa ; Save X on stack. -+ pha -+ tya ; Save Y on stack. -+ pha -+LFD04: lda #$80 ; Bit mask for initial keyboard row -+LFD06: jsr LFCBE ; Write keyboard row -+ jsr LFCC6 ; Read keyboard column -+ bne LFD13 ; Branch if a key in this column was pressed -+ lsr a ; Otherwise shift mask to next row -+ bne LFD06 ; If not done yet, check next row -+ beq LFD3A ; Branch if last row reached and no key pressed -+LFD13: lsr a ; Have a key press. Shift LSB into carry -+ bcc LFD1F ; Branch if no key pressed in column 0 -+ txa ; Key pressed in row zero. Get the column data -+ and #$20 ; Mask only the bit for <ESC> as it is the only key in row zero that returns key press -+ beq LFD3A ; Branch if <ESC> was not the key -+ lda #$1B ; Set character to <ESC> -+ bne LFD50 ; Do more processing -+LFD1F: jsr LFE86 ; Shift to find bit that is set (in Y) -+ tya ; Get bit -+ sta KB0215 ; Save it -+ asl a ; Multiply by 7 by shifting left three times (X8)... -+ asl a -+ asl a -+ sec ; ...then subtracting one -+ sbc KB0215 -+ sta KB0215 ; Save value*7 for later lookup in table -+ txa ; Get the keyboard column -+ lsr a ; Shift out bit zero (only key there is <SHIFT LOCK>) -+ asl a ; And shift back -+ jsr LFE86 ; Shift to find bit that is set (in Y) -+ beq LFD47 ; Branch if no keys pressed -+ lda #$00 -+LFD3A: sta KB0216 ; Save state of <CTRL> and shift keys -+LFD3D: sta KB0213 -+ lda #$02 ; Count used for key debouncing -+ sta KB0214 -+ bne LFD04 ; Go back and scan keyboard again -+LFD47: clc -+ tya ; Get bit number of pressed key -+ adc KB0215 ; Add previously calculated offset for keyboard row*7 -+ tay -+ lda LFF3B,y ; Read ASCII code for key from table -+LFD50: cmp KB0213 ; Debounce - same as last key scan? -+ bne LFD3D ; If not, try again -+ dec KB0214 ; Decrement debounce counter -+ beq LFD5F ; Branch if done debouncing -+ jsr LFCDF ; Wait for short delay to debounce keyboard -+ beq LFD04 ; Go back and scan keyboard. -+LFD5F: ldx #$64 ; Was <CONTROL> key down? -+ cmp KB0216 -+ bne LFD68 ; Branch if not -+ ldx #$0F -+LFD68: stx KB0214 -+ sta KB0216 -+ cmp #$21 -+ bmi LFDD0 ; Done, return key -+ cmp #$5F -+ beq LFDD0 ; Done, return key -+ lda #$01 -+ jsr LFCBE ; Write keyboard row -+ jsr LFCCF ; Read keyboard column -+ sta KB0215 -+ and #$01 -+ tax -+ lda KB0215 -+ and #$06 -+ bne LFDA2 -+ bit KB0213 -+ bvc LFDBB -+ txa -+ eor #$01 -+ and #$01 -+ beq LFDBB -+ lda #$20 -+ bit KB0215 -+ bvc LFDC3 -+ lda #$C0 -+ bne LFDC3 -+LFDA2: bit KB0213 -+ bvc LFDAA -+ txa -+ beq LFDBB -+LFDAA: ldy KB0213 -+ cpy #$31 -+ bcc LFDB9 -+ cpy #$3C -+ bcs LFDB9 -+ lda #$F0 -+ bne LFDBB -+LFDB9: lda #$10 -+LFDBB: bit KB0215 -+ bvc LFDC3 -+ clc -+ adc #$C0 -+LFDC3: clc -+ adc KB0213 -+ and #$7F -+ bit KB0215 -+ bpl LFDD0 -+ ora #$80 -+LFDD0: sta KB0215 ; Save pressed key -+ pla -+ tay ; Restore saved Y value -+ pla -+ tax ; Restore saved Y value -+ lda KB0215 ; Get pressed key and return in A -+ rts -+ -+; Write keyboard row with value in A. -+; Invert the bits before writing. -+; Returns original value of A. -+ -+LFCBE: eor #$FF -+ sta KBD -+ eor #$FF -+ rts -+ -+; Read keyboard column and return in X. -+; Sets Z flag if no keys were pressed. -+; Saves current value of A. -+ -+LFCC6: pha ; Save A -+ jsr LFCCF ; Read keyboard column -+ tax ; Save in X -+ pla ; Restore A -+ dex ; Decrement and then increment to -+ inx ; preserve value of X but set flags -+ rts -+ -+; Read keyboard column. -+; Invert the bits (pressed key(s) will show up as ones). -+ -+LFCCF: lda KBD ; Read keyboard hardware -+ eor #$FF ; Invert the bits -+ rts -+ -+; Short fixed delay routine. -+ -+LFCDF: ldy #$10 -+LFCE1: ldx #$40 -+LFCE3: dex -+ bne LFCE3 -+ dey -+ bne LFCE1 -+ rts -+ -+; Shift A left until we find a 1 in the most significant bit. -+; Return the bit number in Y. -+ -+LFE86: ldy #$08 -+LFE88: dey -+ asl a -+ bcc LFE88 -+ rts -+ -+; Lookup table of keyboard keys for each scan row. -+LFF3B: .byte $BD -+ .byte 'P', ';', '/', ' ', 'Z', 'A', 'Q' -+ .byte ',', 'M', 'N', 'B', 'V', 'C', 'X' -+ .byte 'K', 'J', 'H', 'G', 'F', 'D', 'S' -+ .byte 'I', 'U', 'Y', 'T', 'R', 'E', 'W' -+ .byte $00, $00, $0D, $0A, 'O', 'L', '.' -+ .byte $00, '_', '-', ':', '0', '9', '8' -+ .byte '7', '6', '5', '4', '3', '2', '1' -diff --git a/libsrc/osic1p/kbhit.s b/libsrc/osic1p/kbhit.s -index b616b4a3..1ecfa104 100644 ---- a/libsrc/osic1p/kbhit.s -+++ b/libsrc/osic1p/kbhit.s -@@ -11,6 +11,7 @@ - ; - - .export _kbhit -+ .import inputc - .include "osic1p.inc" - .include "extzp.inc" - .include "zeropage.inc" -@@ -40,7 +41,7 @@ scan: - sta CHARBUF ; No character in buffer - rts - keypressed: -- jsr INPUTC ; Get input character in A -+ jsr inputc ; Get input character in A - sta CHARBUF ; Save in buffer - ldx #$00 ; High byte of return is always zero - lda #$01 ; Return true -diff --git a/libsrc/osic1p/osic1p.inc b/libsrc/osic1p/osic1p.inc -index aaa03ba6..9f8620dc 100644 ---- a/libsrc/osic1p/osic1p.inc -+++ b/libsrc/osic1p/osic1p.inc -@@ -1,4 +1,3 @@ - ; Addresses --INPUTC := $FD00 ; Input character from keyboard - RESET := $FF00 ; Reset address, show boot prompt - KBD := $DF00 ; Polled keyboard register --- -2.26.0 - diff --git a/0070-Restructured-according-to-review.patch b/0070-Restructured-according-to-review.patch deleted file mode 100644 index 20908dd..0000000 --- a/0070-Restructured-according-to-review.patch +++ /dev/null @@ -1,502 +0,0 @@ -From eb2317d01400f361c396b4626b41894139060983 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stephan=20M=C3=BChlstrasser?= <stephan.muehlstrasser@web.de> -Date: Mon, 2 Sep 2019 20:52:16 +0200 -Subject: [PATCH 070/170] Restructured according to review - -Restructured according to review in pull request #567. - -The "inputc" function was moved in slightly modified form -to kbhit.s and replaces the old keyboard scanner. -cgetc() uses the new kbhit() to read a character. ---- - libsrc/osic1p/cgetc.s | 222 +++--------------------------------------- - libsrc/osic1p/kbhit.s | 214 ++++++++++++++++++++++++++++++++++------ - 2 files changed, 199 insertions(+), 237 deletions(-) - -diff --git a/libsrc/osic1p/cgetc.s b/libsrc/osic1p/cgetc.s -index d99f69a7..56209ff6 100644 ---- a/libsrc/osic1p/cgetc.s -+++ b/libsrc/osic1p/cgetc.s -@@ -2,236 +2,40 @@ - ; char cgetc (void); - ; - -- .constructor initcgetc - .export _cgetc -- .export inputc - .import cursor -+ .import _kbhit - - .include "osic1p.inc" - .include "extzp.inc" - .include "zeropage.inc" - --; Internal state that needs to be preserved across calls. --; These variables are named after the original memory locations used by the --; 65V PROM MONITOR, until the actual meaning is determined. --.segment "EXTZP" : zeropage -- --KB0213: .res 1 --KB0214: .res 1 --KB0215: .res 1 --KB0216: .res 1 -- --; Initialize one-character buffer that is filled by kbhit() -- .segment "ONCE" --initcgetc: -- lda #$00 -- sta CHARBUF ; No character in buffer initially -- -- sta KB0213 ; Initialize keyboard state -- sta KB0214 -- sta KB0215 -- sta KB0216 -- -- rts -- --; Input routine from 65V PROM MONITOR, show cursor if enabled -+; Input routine, show cursor if enabled - .code - _cgetc: -- lda CHARBUF ; character in buffer available? -- beq nobuffer -- tax ; save character in X -- lda #$00 -- sta CHARBUF ; empty buffer -- beq restorex ; restore X and return --nobuffer: -+ ldx CHARBUF ; character in buffer available? -+ bne done - lda cursor ; show cursor? - beq nocursor - ldy CURS_X - lda (SCREEN_PTR),y ; fetch current character - sta tmp1 ; save it - lda #$A1 ; full white square -- sta (SCREEN_PTR),y ; store at cursor position -+ sta (SCREEN_PTR),y ; store at cursor position^ -+ - nocursor: -- jsr inputc ; get input character in A -- ldx cursor -+ jsr _kbhit ; get input character in A -+ tax ; save A in X, set flags -+ beq nocursor ; until a key is actually pressed -+ lda cursor - beq done ; was cursor on? -- tax ; save A in X - lda tmp1 ; fetch saved character - ldy CURS_X - sta (SCREEN_PTR),y ; store at cursor position - --restorex: -- txa ; restore saved character from X - done: -- ldx #$00 ; high byte of int return value -- rts -- --; Routine to get character from keyboard and return it in A. --; Based on the OSI ROM routine at $FD00 but uses different --; storage locations to avoid corrupting CC65 run-time code. -- --inputc: txa ; Save X on stack. -- pha -- tya ; Save Y on stack. -- pha --LFD04: lda #$80 ; Bit mask for initial keyboard row --LFD06: jsr LFCBE ; Write keyboard row -- jsr LFCC6 ; Read keyboard column -- bne LFD13 ; Branch if a key in this column was pressed -- lsr a ; Otherwise shift mask to next row -- bne LFD06 ; If not done yet, check next row -- beq LFD3A ; Branch if last row reached and no key pressed --LFD13: lsr a ; Have a key press. Shift LSB into carry -- bcc LFD1F ; Branch if no key pressed in column 0 -- txa ; Key pressed in row zero. Get the column data -- and #$20 ; Mask only the bit for <ESC> as it is the only key in row zero that returns key press -- beq LFD3A ; Branch if <ESC> was not the key -- lda #$1B ; Set character to <ESC> -- bne LFD50 ; Do more processing --LFD1F: jsr LFE86 ; Shift to find bit that is set (in Y) -- tya ; Get bit -- sta KB0215 ; Save it -- asl a ; Multiply by 7 by shifting left three times (X8)... -- asl a -- asl a -- sec ; ...then subtracting one -- sbc KB0215 -- sta KB0215 ; Save value*7 for later lookup in table -- txa ; Get the keyboard column -- lsr a ; Shift out bit zero (only key there is <SHIFT LOCK>) -- asl a ; And shift back -- jsr LFE86 ; Shift to find bit that is set (in Y) -- beq LFD47 ; Branch if no keys pressed - lda #$00 --LFD3A: sta KB0216 ; Save state of <CTRL> and shift keys --LFD3D: sta KB0213 -- lda #$02 ; Count used for key debouncing -- sta KB0214 -- bne LFD04 ; Go back and scan keyboard again --LFD47: clc -- tya ; Get bit number of pressed key -- adc KB0215 ; Add previously calculated offset for keyboard row*7 -- tay -- lda LFF3B,y ; Read ASCII code for key from table --LFD50: cmp KB0213 ; Debounce - same as last key scan? -- bne LFD3D ; If not, try again -- dec KB0214 ; Decrement debounce counter -- beq LFD5F ; Branch if done debouncing -- jsr LFCDF ; Wait for short delay to debounce keyboard -- beq LFD04 ; Go back and scan keyboard. --LFD5F: ldx #$64 ; Was <CONTROL> key down? -- cmp KB0216 -- bne LFD68 ; Branch if not -- ldx #$0F --LFD68: stx KB0214 -- sta KB0216 -- cmp #$21 -- bmi LFDD0 ; Done, return key -- cmp #$5F -- beq LFDD0 ; Done, return key -- lda #$01 -- jsr LFCBE ; Write keyboard row -- jsr LFCCF ; Read keyboard column -- sta KB0215 -- and #$01 -- tax -- lda KB0215 -- and #$06 -- bne LFDA2 -- bit KB0213 -- bvc LFDBB -- txa -- eor #$01 -- and #$01 -- beq LFDBB -- lda #$20 -- bit KB0215 -- bvc LFDC3 -- lda #$C0 -- bne LFDC3 --LFDA2: bit KB0213 -- bvc LFDAA -- txa -- beq LFDBB --LFDAA: ldy KB0213 -- cpy #$31 -- bcc LFDB9 -- cpy #$3C -- bcs LFDB9 -- lda #$F0 -- bne LFDBB --LFDB9: lda #$10 --LFDBB: bit KB0215 -- bvc LFDC3 -- clc -- adc #$C0 --LFDC3: clc -- adc KB0213 -- and #$7F -- bit KB0215 -- bpl LFDD0 -- ora #$80 --LFDD0: sta KB0215 ; Save pressed key -- pla -- tay ; Restore saved Y value -- pla -- tax ; Restore saved Y value -- lda KB0215 ; Get pressed key and return in A -- rts -- --; Write keyboard row with value in A. --; Invert the bits before writing. --; Returns original value of A. -- --LFCBE: eor #$FF -- sta KBD -- eor #$FF -- rts -- --; Read keyboard column and return in X. --; Sets Z flag if no keys were pressed. --; Saves current value of A. -- --LFCC6: pha ; Save A -- jsr LFCCF ; Read keyboard column -- tax ; Save in X -- pla ; Restore A -- dex ; Decrement and then increment to -- inx ; preserve value of X but set flags -- rts -- --; Read keyboard column. --; Invert the bits (pressed key(s) will show up as ones). -- --LFCCF: lda KBD ; Read keyboard hardware -- eor #$FF ; Invert the bits -- rts -- --; Short fixed delay routine. -- --LFCDF: ldy #$10 --LFCE1: ldx #$40 --LFCE3: dex -- bne LFCE3 -- dey -- bne LFCE1 -- rts -- --; Shift A left until we find a 1 in the most significant bit. --; Return the bit number in Y. -- --LFE86: ldy #$08 --LFE88: dey -- asl a -- bcc LFE88 -+ sta CHARBUF ; empty buffer -+ txa ; restore saved character from X -+ ldx #$00 ; high byte of int return value - rts -- --; Lookup table of keyboard keys for each scan row. --LFF3B: .byte $BD -- .byte 'P', ';', '/', ' ', 'Z', 'A', 'Q' -- .byte ',', 'M', 'N', 'B', 'V', 'C', 'X' -- .byte 'K', 'J', 'H', 'G', 'F', 'D', 'S' -- .byte 'I', 'U', 'Y', 'T', 'R', 'E', 'W' -- .byte $00, $00, $0D, $0A, 'O', 'L', '.' -- .byte $00, '_', '-', ':', '0', '9', '8' -- .byte '7', '6', '5', '4', '3', '2', '1' -diff --git a/libsrc/osic1p/kbhit.s b/libsrc/osic1p/kbhit.s -index 1ecfa104..db28854f 100644 ---- a/libsrc/osic1p/kbhit.s -+++ b/libsrc/osic1p/kbhit.s -@@ -10,39 +10,197 @@ - ; in tmp1 and that is set to zero after the first round. - ; - -+ .constructor initkbhit - .export _kbhit -- .import inputc - .include "osic1p.inc" - .include "extzp.inc" - .include "zeropage.inc" - --_kbhit: -- lda #%11011111 ; Mask for only checking the column for the -- sta tmp1 ; ESC key in the first keyboard row. -- -- lda #%11111110 ; Mask for first keyboard row --scan: -- sta KBD ; Select keyboard row -- tax ; Save A -- lda KBD ; Read keyboard columns -- ora tmp1 ; Mask out uninteresting keys (only relevant in -- ; first row) -- cmp #$FF ; No keys pressed? -- bne keypressed -- lda #$00 ; For remaining rows no keys masked -- sta tmp1 -- txa ; Restore A -- sec ; Want to shift in ones -- rol a ; Rotate row select to next bit position -- cmp #$FF ; Done? -- bne scan ; If not, continue -- lda #$00 ; Return false -- tax ; High byte of return is also zero -- sta CHARBUF ; No character in buffer -+; Internal state that needs to be preserved across calls. -+.segment "EXTZP" : zeropage -+ -+LASTSCAN: .res 1 ; Result of previous keyboard scan -+DBNCCNT: .res 1 ; Debounce counter -+KBDTMP: .res 1 ; Temporary values -+CTRLSHIFT: .res 1 ; State of CTRL and SHIFT keys -+ -+; Initialize one-character buffer that is filled by kbhit() -+ .segment "ONCE" -+initkbhit: -+ lda #$00 -+ sta CHARBUF ; No character in buffer initially -+ -+ sta LASTSCAN ; Initialize keyboard state -+ sta DBNCCNT -+ sta KBDTMP -+ sta CTRLSHIFT -+ - rts --keypressed: -- jsr inputc ; Get input character in A -- sta CHARBUF ; Save in buffer -+ -+; Routine to get character from keyboard and return it in A. -+; Based on the OSI ROM routine at $FD00 but uses different -+; storage locations to avoid corrupting CC65 run-time code. -+ -+_kbhit: lda CHARBUF ; Check for previously saved character -+ beq LFD05 - ldx #$00 ; High byte of return is always zero -- lda #$01 ; Return true -+ rts ; A contains non-zero character code meaning true -+LFD05: lda #$80 ; Bit mask for initial keyboard row -+LFD06: jsr LFCBE ; Write keyboard row -+ jsr LFCC6 ; Read keyboard column -+ bne LFD13 ; Branch if a key in this column was pressed -+ lsr a ; Otherwise shift mask to next row -+ bne LFD06 ; If not done yet, check next row -+ beq LFD3A ; Branch if last row reached and no key pressed -+LFD13: lsr a ; Have a key press. Shift LSB into carry -+ bcc LFD1F ; Branch if no key pressed in column 0 -+ txa ; Key pressed in row zero. Get the column data -+ and #$20 ; Mask only the bit for <ESC> as it is the only key in row zero that returns key press -+ beq LFD3A ; Branch if <ESC> was not the key -+ lda #$1B ; Set character to <ESC> -+ bne LFD50 ; Do more processing -+LFD1F: jsr LFE86 ; Shift to find bit that is set (in Y) -+ tya ; Get bit -+ sta KBDTMP ; Save it -+ asl a ; Multiply by 7 by shifting left three times (X8)... -+ asl a -+ asl a -+ sec ; ...then subtracting one -+ sbc KBDTMP -+ sta KBDTMP ; Save value*7 for later lookup in table -+ txa ; Get the keyboard column -+ lsr a ; Shift out bit zero (only key there is <SHIFT LOCK>) -+ asl a ; And shift back -+ jsr LFE86 ; Shift to find bit that is set (in Y) -+ beq LFD47 ; Branch if no keys pressed STM: IS THIS CORRECT? -+ lda #$00 -+LFD3A: sta CTRLSHIFT ; Save state of <CTRL> and shift keys -+LFD3D: sta LASTSCAN -+ lda #$02 ; Count used for key debouncing -+ sta DBNCCNT -+ ldx #$00 ; High byte of return is always zero -+ lda #$00 ; Return false -+ rts -+LFD47: clc -+ tya ; Get bit number of pressed key -+ adc KBDTMP ; Add previously calculated offset for keyboard row*7 -+ tay -+ lda LFF3B,y ; Read ASCII code for key from table -+LFD50: cmp LASTSCAN ; Debounce - same as last key scan? -+ bne LFD3D ; If not, try again -+ dec DBNCCNT ; Decrement debounce counter -+ beq LFD5F ; Branch if done debouncing -+ jsr LFCDF ; Wait for short delay to debounce keyboard -+ beq _kbhit ; Go back and scan keyboard. -+LFD5F: ldx #$64 ; Was <CONTROL> key down? -+ cmp CTRLSHIFT -+ bne LFD68 ; Branch if not -+ ldx #$0F -+LFD68: stx DBNCCNT -+ sta CTRLSHIFT -+ cmp #$21 -+ bmi LFDD0 ; Done, return key -+ cmp #$5F -+ beq LFDD0 ; Done, return key -+ lda #$01 -+ jsr LFCBE ; Write keyboard row -+ jsr LFCCF ; Read keyboard column -+ sta KBDTMP -+ and #$01 -+ tax -+ lda KBDTMP -+ and #$06 -+ bne LFDA2 -+ bit LASTSCAN -+ bvc LFDBB -+ txa -+ eor #$01 -+ and #$01 -+ beq LFDBB -+ lda #$20 -+ bit KBDTMP -+ bvc LFDC3 -+ lda #$C0 -+ bne LFDC3 -+LFDA2: bit LASTSCAN -+ bvc LFDAA -+ txa -+ beq LFDBB -+LFDAA: ldy LASTSCAN -+ cpy #$31 -+ bcc LFDB9 -+ cpy #$3C -+ bcs LFDB9 -+ lda #$F0 -+ bne LFDBB -+LFDB9: lda #$10 -+LFDBB: bit KBDTMP -+ bvc LFDC3 -+ clc -+ adc #$C0 -+LFDC3: clc -+ adc LASTSCAN -+ and #$7F -+ bit KBDTMP -+ bpl LFDD0 -+ ora #$80 -+LFDD0: sta KBDTMP ; Save pressed key and return in A -+ sta CHARBUF -+ rts -+ -+; Write keyboard row with value in A. -+; Invert the bits before writing. -+; Returns original value of A. -+ -+LFCBE: eor #$FF -+ sta KBD -+ eor #$FF - rts -+ -+; Read keyboard column and return in X. -+; Sets Z flag if no keys were pressed. -+; Saves current value of A. -+ -+LFCC6: pha ; Save A -+ jsr LFCCF ; Read keyboard column -+ tax ; Save in X -+ pla ; Restore A -+ dex ; Decrement and then increment to -+ inx ; preserve value of X but set flags -+ rts -+ -+; Read keyboard column. -+; Invert the bits (pressed key(s) will show up as ones). -+ -+LFCCF: lda KBD ; Read keyboard hardware -+ eor #$FF ; Invert the bits -+ rts -+ -+; Short fixed delay routine. -+ -+LFCDF: ldy #$10 -+LFCE1: ldx #$40 -+LFCE3: dex -+ bne LFCE3 -+ dey -+ bne LFCE1 -+ rts -+ -+; Shift A left until we find a 1 in the most significant bit. -+; Return the bit number in Y. -+ -+LFE86: ldy #$08 -+LFE88: dey -+ asl a -+ bcc LFE88 -+ rts -+ -+; Lookup table of keyboard keys for each scan row. -+LFF3B: .byte $BD -+ .byte 'P', ';', '/', ' ', 'Z', 'A', 'Q' -+ .byte ',', 'M', 'N', 'B', 'V', 'C', 'X' -+ .byte 'K', 'J', 'H', 'G', 'F', 'D', 'S' -+ .byte 'I', 'U', 'Y', 'T', 'R', 'E', 'W' -+ .byte $00, $00, $0D, $0A, 'O', 'L', '.' -+ .byte $00, '_', '-', ':', '0', '9', '8' -+ .byte '7', '6', '5', '4', '3', '2', '1' --- -2.26.0 - diff --git a/0071-Remove-obsolete-comment.patch b/0071-Remove-obsolete-comment.patch deleted file mode 100644 index 517b62e..0000000 --- a/0071-Remove-obsolete-comment.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 8704d42005f91e11257a34c94ff97485a9ba1379 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stephan=20M=C3=BChlstrasser?= <stephan.muehlstrasser@web.de> -Date: Tue, 3 Sep 2019 10:04:30 +0200 -Subject: [PATCH 071/170] Remove obsolete comment - ---- - kbhit.c | 19 +++++++++++++++++++ - 1 file changed, 19 insertions(+) - create mode 100644 kbhit.c - -diff --git a/kbhit.c b/kbhit.c -new file mode 100644 -index 00000000..4ce1894c ---- /dev/null -+++ b/kbhit.c -@@ -0,0 +1,19 @@ -+/* -+ * Keyboard test program. -+ */ -+ -+#include <conio.h> -+ -+int main(void) -+{ -+ unsigned char c; -+ -+ clrscr(); -+ cputs(" Keyboard Test\r\n"); -+ -+ while (1) { -+ c = cgetc(); -+ cputc(c); -+ } -+ return 0; -+} --- -2.26.0 - diff --git a/0072-Remove-source-file-that-was-only-used-for-testing.patch b/0072-Remove-source-file-that-was-only-used-for-testing.patch deleted file mode 100644 index 4323176..0000000 --- a/0072-Remove-source-file-that-was-only-used-for-testing.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 668273cdf5b402b78457bff3b8a6a1a275c0c404 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stephan=20M=C3=BChlstrasser?= <stephan.muehlstrasser@web.de> -Date: Wed, 4 Sep 2019 19:33:14 +0200 -Subject: [PATCH 072/170] Remove source file that was only used for testing - ---- - kbhit.c | 19 ------------------- - 1 file changed, 19 deletions(-) - delete mode 100644 kbhit.c - -diff --git a/kbhit.c b/kbhit.c -deleted file mode 100644 -index 4ce1894c..00000000 ---- a/kbhit.c -+++ /dev/null -@@ -1,19 +0,0 @@ --/* -- * Keyboard test program. -- */ -- --#include <conio.h> -- --int main(void) --{ -- unsigned char c; -- -- clrscr(); -- cputs(" Keyboard Test\r\n"); -- -- while (1) { -- c = cgetc(); -- cputc(c); -- } -- return 0; --} --- -2.26.0 - diff --git a/0073-Address-review-comments.patch b/0073-Address-review-comments.patch deleted file mode 100644 index 3dc8714..0000000 --- a/0073-Address-review-comments.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 7547c4c77c1feef64a247c3c091ba995ff1de03c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stephan=20M=C3=BChlstrasser?= <stephan.muehlstrasser@web.de> -Date: Tue, 17 Sep 2019 20:03:51 +0200 -Subject: [PATCH 073/170] Address review comments - -- removed typo from comment -- removed redundant AND instruction ---- - libsrc/osic1p/cgetc.s | 2 +- - libsrc/osic1p/kbhit.s | 3 +-- - 2 files changed, 2 insertions(+), 3 deletions(-) - -diff --git a/libsrc/osic1p/cgetc.s b/libsrc/osic1p/cgetc.s -index 56209ff6..380353b7 100644 ---- a/libsrc/osic1p/cgetc.s -+++ b/libsrc/osic1p/cgetc.s -@@ -21,7 +21,7 @@ _cgetc: - lda (SCREEN_PTR),y ; fetch current character - sta tmp1 ; save it - lda #$A1 ; full white square -- sta (SCREEN_PTR),y ; store at cursor position^ -+ sta (SCREEN_PTR),y ; store at cursor position - - nocursor: - jsr _kbhit ; get input character in A -diff --git a/libsrc/osic1p/kbhit.s b/libsrc/osic1p/kbhit.s -index db28854f..122a81c6 100644 ---- a/libsrc/osic1p/kbhit.s -+++ b/libsrc/osic1p/kbhit.s -@@ -72,7 +72,7 @@ LFD1F: jsr LFE86 ; Shift to find bit that is set (in Y) - lsr a ; Shift out bit zero (only key there is <SHIFT LOCK>) - asl a ; And shift back - jsr LFE86 ; Shift to find bit that is set (in Y) -- beq LFD47 ; Branch if no keys pressed STM: IS THIS CORRECT? -+ beq LFD47 ; Branch if no keys pressed - lda #$00 - LFD3A: sta CTRLSHIFT ; Save state of <CTRL> and shift keys - LFD3D: sta LASTSCAN -@@ -106,7 +106,6 @@ LFD68: stx DBNCCNT - jsr LFCBE ; Write keyboard row - jsr LFCCF ; Read keyboard column - sta KBDTMP -- and #$01 - tax - lda KBDTMP - and #$06 --- -2.26.0 - diff --git a/0074-Removed-redundant-LDA.patch b/0074-Removed-redundant-LDA.patch deleted file mode 100644 index babed15..0000000 --- a/0074-Removed-redundant-LDA.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 55444b8337bf163970f62ad1aa3f917a6f0719ce Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stephan=20M=C3=BChlstrasser?= <stephan.muehlstrasser@web.de> -Date: Tue, 17 Sep 2019 20:23:36 +0200 -Subject: [PATCH 074/170] Removed redundant LDA - -After the removal of the redundant AND in commit -704c8df04ffa3679f87fff019ad986fbd8801ca5 also the -subsequent LDA became redundant. ---- - libsrc/osic1p/kbhit.s | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/libsrc/osic1p/kbhit.s b/libsrc/osic1p/kbhit.s -index 122a81c6..8744baf6 100644 ---- a/libsrc/osic1p/kbhit.s -+++ b/libsrc/osic1p/kbhit.s -@@ -107,7 +107,6 @@ LFD68: stx DBNCCNT - jsr LFCCF ; Read keyboard column - sta KBDTMP - tax -- lda KBDTMP - and #$06 - bne LFDA2 - bit LASTSCAN --- -2.26.0 - diff --git a/0075-Added-the-GIF-switch-to-the-X16-emulator-s-control-p.patch b/0075-Added-the-GIF-switch-to-the-X16-emulator-s-control-p.patch deleted file mode 100644 index 0178ffa..0000000 --- a/0075-Added-the-GIF-switch-to-the-X16-emulator-s-control-p.patch +++ /dev/null @@ -1,44 +0,0 @@ -From f3d898d6a3e2f5a595e542c5fb27c06fd3e21fad Mon Sep 17 00:00:00 2001 -From: Greg King <gregdk@users.sf.net> -Date: Tue, 15 Oct 2019 12:10:34 -0400 -Subject: [PATCH 075/170] Added the GIF switch to the X16 emulator's control - port. - ---- - asminc/cx16.inc | 13 +++++++------ - 1 file changed, 7 insertions(+), 6 deletions(-) - -diff --git a/asminc/cx16.inc b/asminc/cx16.inc -index 6f3f1c73..5b46908d 100644 ---- a/asminc/cx16.inc -+++ b/asminc/cx16.inc -@@ -285,7 +285,7 @@ NMIVec := $0318 - .struct VIA2 - .org $9F70 - PRB .byte -- PRA .byte ; NES controller communication -+ PRA .byte ; NES controller communication - DDRB .byte - DDRA .byte - T1 .word -@@ -306,11 +306,12 @@ NMIVec := $0318 - .struct EMULATOR - .org $9FB0 - DEBUG .byte ; Boolean: debugging enabled -- VIDACCESSLOG .byte ; Boolean: log VERA activity -+ VERALOG .byte ; Boolean: log VERA activity - KEYBOARDLOG .byte ; Boolean: log keyboard data -- ECHO .byte ; Boolean: echo enabled -+ ECHO .byte ; Type of echo that's enabled - SAVEXIT .byte ; Boolean: save on exit -- .res $D - $5 -- KEYMAP .byte ; Current keyboard layout number -- DETECT .byte 2 ; If is "16" string, then running on emulator -+ GIFREC .byte ; Method of recording GIF movie -+ .org $9FBD -+ KEYMAP .byte ; Current keyboard layout number (Read-Only) -+ DETECT .byte 2 ; If is "16" string, then running on emulator (RO) - .endstruct --- -2.26.0 - diff --git a/0076-Tentative-solution-for-cgetc-in-Lynx.patch b/0076-Tentative-solution-for-cgetc-in-Lynx.patch deleted file mode 100644 index a215247..0000000 --- a/0076-Tentative-solution-for-cgetc-in-Lynx.patch +++ /dev/null @@ -1,33 +0,0 @@ -From da01286037dd1e396b15d756a401240c14b277a7 Mon Sep 17 00:00:00 2001 -From: Fabrizio Caruso <fabrizio_caruso@hotmail.com> -Date: Tue, 15 Oct 2019 22:25:26 +0200 -Subject: [PATCH 076/170] Tentative solution for cgetc in Lynx - ---- - libsrc/lynx/cgetc.s | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/libsrc/lynx/cgetc.s b/libsrc/lynx/cgetc.s -index b61fb44f..19cfdaff 100644 ---- a/libsrc/lynx/cgetc.s -+++ b/libsrc/lynx/cgetc.s -@@ -20,13 +20,13 @@ - ; So the keyboard returns '1', '2', '3', 'P', 'R', 'F' or '?'. - - _cgetc: -- lda KBSTL -- ora KBEDG -- bne @L1 - jsr _kbhit ; Check for char available -+ bne @L1 - tax ; Test result - bra _cgetc - @L1: -+ lda KBSTL -+ ora KBEDG - ldx #0 - and #1 - beq @L6 --- -2.26.0 - diff --git a/0077-Remove-useless-tax.patch b/0077-Remove-useless-tax.patch deleted file mode 100644 index c7c41d3..0000000 --- a/0077-Remove-useless-tax.patch +++ /dev/null @@ -1,24 +0,0 @@ -From e4b60e10682717360575c1d93885c72ab3dc86ea Mon Sep 17 00:00:00 2001 -From: Fabrizio Caruso <fabrizio_caruso@hotmail.com> -Date: Wed, 16 Oct 2019 13:30:58 +0200 -Subject: [PATCH 077/170] Remove useless tax - ---- - libsrc/lynx/cgetc.s | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/libsrc/lynx/cgetc.s b/libsrc/lynx/cgetc.s -index 19cfdaff..c81afa82 100644 ---- a/libsrc/lynx/cgetc.s -+++ b/libsrc/lynx/cgetc.s -@@ -22,7 +22,6 @@ - _cgetc: - jsr _kbhit ; Check for char available - bne @L1 -- tax ; Test result - bra _cgetc - @L1: - lda KBSTL --- -2.26.0 - diff --git a/0078-remove-bra.patch b/0078-remove-bra.patch deleted file mode 100644 index 7ab813b..0000000 --- a/0078-remove-bra.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 1074d35a1579ae1a6cc334455c0391fec6da416a Mon Sep 17 00:00:00 2001 -From: Fabrizio Caruso <fabrizio_caruso@hotmail.com> -Date: Wed, 16 Oct 2019 23:22:41 +0200 -Subject: [PATCH 078/170] remove bra - ---- - libsrc/lynx/cgetc.s | 32 +++++++++++++++----------------- - 1 file changed, 15 insertions(+), 17 deletions(-) - -diff --git a/libsrc/lynx/cgetc.s b/libsrc/lynx/cgetc.s -index c81afa82..ee489337 100644 ---- a/libsrc/lynx/cgetc.s -+++ b/libsrc/lynx/cgetc.s -@@ -21,49 +21,47 @@ - - _cgetc: - jsr _kbhit ; Check for char available -- bne @L1 -- bra _cgetc --@L1: -+ beq _cgetc - lda KBSTL - ora KBEDG - ldx #0 - and #1 -- beq @L6 -+ beq @L5 - lda KBEDG ; Pause button is pressed - and #$0c -- beq @L3 -+ beq @L2 - ora KBSTL --@L2: -+@L1: - bit #$04 -- beq @L4 ; Pause + Opt 1 = Reset -+ beq @L3 ; Pause + Opt 1 = Reset - bit #$08 -- beq @L5 ; Pause + Opt 2 = Flip -+ beq @L4 ; Pause + Opt 2 = Flip - lda #'?' ; All buttons pressed - rts --@L3: -+@L2: - lda KBSTL ; Pause alone was the last placed button - and #$0c -- bne @L2 -+ bne @L1 - lda #'P' ; Pause pressed - rts --@L4: -+@L3: - lda #'R' ; Reset pressed - rts --@L5: -+@L4: - lda #'F' ; Flip pressed - rts --@L6: -+@L5: - lda KBEDG ; No Pause pressed - ora KBSTL - bit #$08 -- beq @L8 -- bit #$04 - beq @L7 -+ bit #$04 -+ beq @L6 - lda #'3' ; opt 1 + opt 2 pressed - rts --@L7: -+@L6: - lda #'1' ; opt 1 pressed - rts --@L8: -+@L7: - lda #'2' ; opt 2 pressed - rts --- -2.26.0 - diff --git a/0079-Added-VERA-peek-and-poke-to-the-cx16-library.patch b/0079-Added-VERA-peek-and-poke-to-the-cx16-library.patch deleted file mode 100644 index ebd4b10..0000000 --- a/0079-Added-VERA-peek-and-poke-to-the-cx16-library.patch +++ /dev/null @@ -1,142 +0,0 @@ -From 9fa90e2265b0d54e3fd9e6ec0227821f6a09d9de Mon Sep 17 00:00:00 2001 -From: Greg King <gregdk@users.sf.net> -Date: Thu, 24 Oct 2019 05:15:42 -0400 -Subject: [PATCH 079/170] Added VERA peek() and poke() to the cx16 library. - -They simplify C programs' direct access to VERA's internal address space. ---- - include/cx16.h | 19 ++++++++++++++----- - libsrc/cx16/vpeek.s | 19 +++++++++++++++++++ - libsrc/cx16/vpoke.s | 21 +++++++++++++++++++++ - libsrc/cx16/vset.s | 20 ++++++++++++++++++++ - 4 files changed, 74 insertions(+), 5 deletions(-) - create mode 100644 libsrc/cx16/vpeek.s - create mode 100644 libsrc/cx16/vpoke.s - create mode 100644 libsrc/cx16/vset.s - -diff --git a/include/cx16.h b/include/cx16.h -index db32d846..a2f52850 100644 ---- a/include/cx16.h -+++ b/include/cx16.h -@@ -144,9 +144,10 @@ struct __emul { - unsigned char debug; /* Boolean: debugging enabled */ - unsigned char vera_action; /* Boolean: displaying VERA activity */ - unsigned char keyboard; /* Boolean: displaying typed keys */ -- unsigned char echo; /* Boolean: Kernal output echoed to host */ -+ unsigned char echo; /* How Kernal output should be echoed to host */ - unsigned char save_on_exit; /* Boolean: save SD card when quitting */ -- unsigned char unused[0xD - 0x5]; -+ unsigned char gif_method; /* How GIF movie is being recorded */ -+ unsigned char unused[0xD - 0x6]; - unsigned char keymap; /* Keyboard layout number */ - const char detect[2]; /* "16" if running on x16emu */ - }; -@@ -173,16 +174,24 @@ signed char get_ostype (void); - ** Positive -- release build - */ - --void __fastcall__ set_tv (unsigned char); --/* Set the video mode the machine will use. -+void __fastcall__ set_tv (unsigned char type); -+/* Set the video type that the machine will use. - ** Call with a TV_xx constant. - */ - --unsigned char __fastcall__ videomode (unsigned char Mode); -+unsigned char __fastcall__ videomode (unsigned char mode); - /* Set the video mode, return the old mode. Call with one of the VIDEOMODE_xx - ** constants. - */ - -+unsigned char __fastcall__ vpeek (unsigned long addr); -+/* Get a byte from a location in VERA's internal address space. */ -+ -+void __fastcall__ vpoke (unsigned char data, unsigned long addr); -+/* Put a byte into a location in VERA's internal address space. -+** (addr is second instead of first for the sake of code efficiency.) -+*/ -+ - - - /* End of cX16.h */ -diff --git a/libsrc/cx16/vpeek.s b/libsrc/cx16/vpeek.s -new file mode 100644 -index 00000000..0c1a9465 ---- /dev/null -+++ b/libsrc/cx16/vpeek.s -@@ -0,0 +1,19 @@ -+; -+; 2019-10-22, Greg King -+; -+; unsigned char fastcall vpeek (unsigned long addr); -+; /* Get a byte from a location in VERA's internal address space. */ -+; -+ -+ .export _vpeek -+ -+ .import vset -+ .include "cx16.inc" -+ -+ -+_vpeek: php ; (vset blocks interrupts) -+ jsr vset ; put VERA's address -+ ldx #>$0000 -+ lda VERA::DATA0 ; read VERA port zero -+ plp -+ rts -diff --git a/libsrc/cx16/vpoke.s b/libsrc/cx16/vpoke.s -new file mode 100644 -index 00000000..8c21e9b2 ---- /dev/null -+++ b/libsrc/cx16/vpoke.s -@@ -0,0 +1,21 @@ -+; -+; 2019-10-22, Greg King -+; -+; void fastcall vpoke (unsigned char data, unsigned long addr); -+; /* Put a byte into a location in VERA's internal address space. -+; ** (addr is second instead of first for the sake of code efficiency.) -+; */ -+; -+ -+ .export _vpoke -+ -+ .import vset, popa -+ .include "cx16.inc" -+ -+ -+_vpoke: php ; (vset blocks interrupts) -+ jsr vset ; put VERA's address -+ jsr popa -+ sta VERA::DATA0 ; write data to VERA port zero -+ plp -+ rts -diff --git a/libsrc/cx16/vset.s b/libsrc/cx16/vset.s -new file mode 100644 -index 00000000..9178850e ---- /dev/null -+++ b/libsrc/cx16/vset.s -@@ -0,0 +1,20 @@ -+; -+; 2019-10-22, Greg King -+; -+; Set the __far__ address that VERA will use for data access. -+; This is a support function for the fastcall functions vpeek() and vpoke(). -+; -+ -+ .export vset -+ -+ .importzp sreg -+ .include "cx16.inc" -+ -+ -+vset: ldy sreg -+ sei ; don't let interrupt handlers interfere -+ stz VERA::CTRL ; set address for VERA's data port zero -+ sta VERA::ADDR -+ stx VERA::ADDR+1 -+ sty VERA::ADDR+2 -+ rts --- -2.26.0 - diff --git a/0080-libsrc-kplot.s-Use-cbm_kernal.inc-symbols-not-hardco.patch b/0080-libsrc-kplot.s-Use-cbm_kernal.inc-symbols-not-hardco.patch deleted file mode 100644 index 249f9a9..0000000 --- a/0080-libsrc-kplot.s-Use-cbm_kernal.inc-symbols-not-hardco.patch +++ /dev/null @@ -1,144 +0,0 @@ -From 128991d868f94d471540a3964b682d902073460d Mon Sep 17 00:00:00 2001 -From: "Curt J. Sampson" <cjs@cynic.net> -Date: Thu, 24 Oct 2019 13:46:41 +0900 -Subject: [PATCH 080/170] libsrc/*/kplot.s: Use cbm_kernal.inc symbols, not - hardcoded addrs - -On C64, VIC-20 and Plus/4, the conio library PLOT routine uses direct -calls into the Kernal, including the Kernal PLOT routine that we're -replacing. These were previously hardcoded addresses; we change these -to use the symbols for those routines defined in cbm_kernal.inc. (This -changes no functionality.) - -To do this, we need to import cbm_kernal.inc in a namespace so we -don't have a collision between the PLOT that we're defining and the -Kernal definition. - -We also add a UPDCRAMPTR symbol (used by kplot for VIC-20 and C64) to -the direct entry kernal routines in in cbm_kernal.inc, and expand the -comments describing what the "direct entry" Kernal routines are. - -<greg.king5@verizon.net> (GitHub: greg-king5) came up with this idea -and did initial testing of it. - -This has been tested on VICE xvic, x64 and xplus4 emulators with a -program that does a cputs() call (github.com/0cjs/vic20cc65) to -confirm that it works the same way after as it did before. ---- - asminc/cbm_kernal.inc | 12 ++++++++++++ - libsrc/c64/kplot.s | 11 ++++++----- - libsrc/plus4/kplot.s | 9 +++++---- - libsrc/vic20/kplot.s | 10 ++++++---- - 4 files changed, 29 insertions(+), 13 deletions(-) - -diff --git a/asminc/cbm_kernal.inc b/asminc/cbm_kernal.inc -index 79edce06..6e1e1604 100644 ---- a/asminc/cbm_kernal.inc -+++ b/asminc/cbm_kernal.inc -@@ -100,14 +100,26 @@ UDTIM := $FFEA - - ; --------------------------------------------------------------------------- - ; Kernal routines, direct entries -+; -+; Unlike the above, these are not standard functions with entries in the jump -+; table. They do not exist in all Kernals, and where they do the entry point is -+; specific to that particular machine and possibly even Kernal version. -+; -+; This list is not comprehensive: missing items for particular machines -+; should be added as needed. -+; -+; UPDCRAMPTR: Updates the color RAM pointer to match the screen RAM pointer. -+; - - .if .def(__VIC20__) - CLRSCR := $E55F - KBDREAD := $E5CF -+ UPDCRAMPTR := $EAB2 - .elseif .def(__C64__) - CLRSCR := $E544 - KBDREAD := $E5B4 - NMIEXIT := $FEBC -+ UPDCRAMPTR := $EA24 - .elseif .def(__C128__) - CLRSCR := $C142 - KBDREAD := $C006 -diff --git a/libsrc/c64/kplot.s b/libsrc/c64/kplot.s -index 2d60fd4a..856bd148 100644 ---- a/libsrc/c64/kplot.s -+++ b/libsrc/c64/kplot.s -@@ -7,15 +7,16 @@ - - .export PLOT - -+.scope KERNAL -+ .include "cbm_kernal.inc" -+.endscope - - .proc PLOT - - bcs @L1 -- jsr $FFF0 ; Set cursor position -- jmp $EA24 ; Set pointer to color RAM -+ jsr KERNAL::PLOT ; Set cursor position using original ROM PLOT -+ jmp KERNAL::UPDCRAMPTR ; Set pointer to color RAM to match new cursor position - --@L1: jmp $FFF0 ; Get cursor position -+@L1: jmp KERNAL::PLOT ; Get cursor position - - .endproc -- -- -diff --git a/libsrc/plus4/kplot.s b/libsrc/plus4/kplot.s -index 7035b05d..7883c28a 100644 ---- a/libsrc/plus4/kplot.s -+++ b/libsrc/plus4/kplot.s -@@ -6,16 +6,17 @@ - - .export PLOT - -+.scope KERNAL -+ .include "cbm_kernal.inc" -+.endscope -+ - .include "plus4.inc" - - .segment "LOWCODE" ; Must go into low memory - - .proc PLOT - sta ENABLE_ROM ; Enable the ROM -- jsr $FFF0 ; Call the ROM routine -+ jsr KERNAL::PLOT ; Call the ROM routine - sta ENABLE_RAM ; Switch back to RAM - rts ; Return to caller - .endproc -- -- -- -diff --git a/libsrc/vic20/kplot.s b/libsrc/vic20/kplot.s -index f37ed8fc..1a943d37 100644 ---- a/libsrc/vic20/kplot.s -+++ b/libsrc/vic20/kplot.s -@@ -7,14 +7,16 @@ - - .export PLOT - -+.scope KERNAL -+ .include "cbm_kernal.inc" -+.endscope - - .proc PLOT - - bcs @L1 -- jsr $FFF0 ; Set cursor position -- jmp $EAB2 ; Set pointer to color RAM -+ jsr KERNAL::PLOT ; Set cursor position using original ROM PLOT -+ jmp KERNAL::UPDCRAMPTR ; Set pointer to color RAM to match new cursor position - --@L1: jmp $FFF0 ; Get cursor position -+@L1: jmp KERNAL::PLOT ; Get cursor position - - .endproc -- --- -2.26.0 - diff --git a/0081-vic20-cputc-Fix-incorrect-CRAM_PTR-at-startup-when-u.patch b/0081-vic20-cputc-Fix-incorrect-CRAM_PTR-at-startup-when-u.patch deleted file mode 100644 index 789d210..0000000 --- a/0081-vic20-cputc-Fix-incorrect-CRAM_PTR-at-startup-when-u.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 1d39863a602a728c83aa600a7929b76ce9d1bb06 Mon Sep 17 00:00:00 2001 -From: "Curt J. Sampson" <cjs@cynic.net> -Date: Wed, 9 Oct 2019 21:05:00 +0900 -Subject: [PATCH 081/170] vic20/cputc: Fix incorrect CRAM_PTR at startup when - using conio - -To do this we add a constructor call to UPDCRAMPTR, which is the ROM -routine that fixes up CRAM_PTR to match the screen location pointed to -by SCREEN_PTR. - -This adds two additional bytes to programs using cputc() or other -routines that call it. These are in theory recoverable, but the VIC-20 -does not yet free space used by constructors after the constructors -have been called. - -Thanks to <greg.king5@verizon.net> (GitHub: greg-king5) for -investigating the difference in the VIC-20 KERNAL from the C64 and -proposing this solution to the problem.[1] - -[1]: https://github.com/cc65/cc65/issues/946#issuecomment-538502820 ---- - libsrc/vic20/cputc.s | 21 +++++++++++++++++++++ - 1 file changed, 21 insertions(+) - -diff --git a/libsrc/vic20/cputc.s b/libsrc/vic20/cputc.s -index 43aacdae..1db81854 100644 ---- a/libsrc/vic20/cputc.s -+++ b/libsrc/vic20/cputc.s -@@ -10,8 +10,29 @@ - .import gotoxy - .import PLOT - -+.scope KERNAL -+ .include "cbm_kernal.inc" -+.endscope -+ - .include "vic20.inc" - -+; VIC-20 KERNAL routines (such as PLOT) do not always leave the color RAM -+; pointer CRAM_PTR pointing at the color RAM location matching the screen -+; RAM pointer SCREEN_PTR. Instead they update it when they need it to be -+; correct by calling UPDCRAMPTR. -+; -+; We make things more efficient by having conio always update CRAM_PTR when -+; we move the screen pointer to avoid extra calls to ensure it's updated -+; before doing screen output. (Among other things, We replace the ROM -+; version of PLOT with our own in libsrc/vic20/kplot.s to ensure this -+; precondition.) -+; -+; However, this means that CRAM_PTR may be (and is, after a cold boot) -+; incorrect for us at program startup, causing cputc() not to work. We fix -+; this with a constructor that ensures CRAM_PTR matches SCREEN_PTR. -+; -+ UPDCRAMPTR := KERNAL::UPDCRAMPTR ; .constructor doesn't understand namespaces -+ .constructor UPDCRAMPTR - - _cputcxy: - pha ; Save C --- -2.26.0 - diff --git a/0082-Second-tentative-fix.patch b/0082-Second-tentative-fix.patch deleted file mode 100644 index 1059271..0000000 --- a/0082-Second-tentative-fix.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 609f63ac749fc4bfc75720d5b27c5f7820dc741b Mon Sep 17 00:00:00 2001 -From: Fabrizio Caruso <fabrizio_caruso@hotmail.com> -Date: Mon, 28 Oct 2019 20:02:18 +0100 -Subject: [PATCH 082/170] Second tentative fix - ---- - libsrc/lynx/cgetc.s | 4 ++++ - libsrc/lynx/kbhit.s | 4 +--- - 2 files changed, 5 insertions(+), 3 deletions(-) - -diff --git a/libsrc/lynx/cgetc.s b/libsrc/lynx/cgetc.s -index ee489337..bb2840b1 100644 ---- a/libsrc/lynx/cgetc.s -+++ b/libsrc/lynx/cgetc.s -@@ -20,8 +20,10 @@ - ; So the keyboard returns '1', '2', '3', 'P', 'R', 'F' or '?'. - - _cgetc: -+ bne _start - jsr _kbhit ; Check for char available - beq _cgetc -+_start: - lda KBSTL - ora KBEDG - ldx #0 -@@ -52,6 +54,8 @@ _cgetc: - rts - @L5: - lda KBEDG ; No Pause pressed -+ ldx #$00 -+ stx KBEDG - ora KBSTL - bit #$08 - beq @L7 -diff --git a/libsrc/lynx/kbhit.s b/libsrc/lynx/kbhit.s -index b606fc49..a5126a7d 100644 ---- a/libsrc/lynx/kbhit.s -+++ b/libsrc/lynx/kbhit.s -@@ -49,8 +49,6 @@ _kbhit: - sta KBNPR ; inverted previous ones pressed - stx KBPRV - lda KBEDG -- beq @L1 -- jmp return1 ; Key hit -- - @L1: tax ; No new keys hit - rts -+ --- -2.26.0 - diff --git a/0083-stz.patch b/0083-stz.patch deleted file mode 100644 index cebc125..0000000 --- a/0083-stz.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 43f24afe297c93256f98dfae2e71613feeedb751 Mon Sep 17 00:00:00 2001 -From: Fabrizio Caruso <fabrizio_caruso@hotmail.com> -Date: Mon, 28 Oct 2019 21:25:41 +0100 -Subject: [PATCH 083/170] stz - ---- - libsrc/lynx/cgetc.s | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/libsrc/lynx/cgetc.s b/libsrc/lynx/cgetc.s -index bb2840b1..17943e2d 100644 ---- a/libsrc/lynx/cgetc.s -+++ b/libsrc/lynx/cgetc.s -@@ -54,8 +54,7 @@ _start: - rts - @L5: - lda KBEDG ; No Pause pressed -- ldx #$00 -- stx KBEDG -+ stz KBEDG - ora KBSTL - bit #$08 - beq @L7 --- -2.26.0 - diff --git a/0084-kbhit-checks-KBEDG-and-getc-resets-KBEDG.patch b/0084-kbhit-checks-KBEDG-and-getc-resets-KBEDG.patch deleted file mode 100644 index e4cfa8e..0000000 --- a/0084-kbhit-checks-KBEDG-and-getc-resets-KBEDG.patch +++ /dev/null @@ -1,86 +0,0 @@ -From 78d660da5571f29605dfdafe359527bf3c102823 Mon Sep 17 00:00:00 2001 -From: Fabrizio Caruso <fabrizio_caruso@hotmail.com> -Date: Wed, 30 Oct 2019 09:14:17 +0100 -Subject: [PATCH 084/170] kbhit checks KBEDG and getc resets KBEDG - ---- - libsrc/lynx/cgetc.s | 16 ++++++++++------ - libsrc/lynx/kbhit.s | 4 +++- - 2 files changed, 13 insertions(+), 7 deletions(-) - -diff --git a/libsrc/lynx/cgetc.s b/libsrc/lynx/cgetc.s -index 17943e2d..368a0e8d 100644 ---- a/libsrc/lynx/cgetc.s -+++ b/libsrc/lynx/cgetc.s -@@ -20,6 +20,7 @@ - ; So the keyboard returns '1', '2', '3', 'P', 'R', 'F' or '?'. - - _cgetc: -+ lda KBEDG - bne _start - jsr _kbhit ; Check for char available - beq _cgetc -@@ -39,19 +40,19 @@ _start: - bit #$08 - beq @L4 ; Pause + Opt 2 = Flip - lda #'?' ; All buttons pressed -- rts -+ bra reset_and_exit - @L2: - lda KBSTL ; Pause alone was the last placed button - and #$0c - bne @L1 - lda #'P' ; Pause pressed -- rts -+ bra reset_and_exit - @L3: - lda #'R' ; Reset pressed -- rts -+ bra reset_and_exit - @L4: - lda #'F' ; Flip pressed -- rts -+ bra reset_and_exit - @L5: - lda KBEDG ; No Pause pressed - stz KBEDG -@@ -61,10 +62,13 @@ _start: - bit #$04 - beq @L6 - lda #'3' ; opt 1 + opt 2 pressed -- rts -+ bra reset_and_exit - @L6: - lda #'1' ; opt 1 pressed -- rts -+ bra reset_and_exit - @L7: - lda #'2' ; opt 2 pressed -+ -+reset_and_exit: -+ stz KBEDG - rts -diff --git a/libsrc/lynx/kbhit.s b/libsrc/lynx/kbhit.s -index a5126a7d..a846c43e 100644 ---- a/libsrc/lynx/kbhit.s -+++ b/libsrc/lynx/kbhit.s -@@ -29,6 +29,8 @@ KBNPR: .byte 0 - - .code - _kbhit: -+ lda KBEDG -+ bne L1 - lda $FCB0 ; Read the Opt buttons - and #$0c - sta KBTMP -@@ -49,6 +51,6 @@ _kbhit: - sta KBNPR ; inverted previous ones pressed - stx KBPRV - lda KBEDG --@L1: tax ; No new keys hit -+L1: ldx #$00 - rts - --- -2.26.0 - diff --git a/0085-Optimizations.patch b/0085-Optimizations.patch deleted file mode 100644 index 018642b..0000000 --- a/0085-Optimizations.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 2bd798fa13fffa2a73df3ca46285a59fd020f6bc Mon Sep 17 00:00:00 2001 -From: Fabrizio Caruso <fabrizio_caruso@hotmail.com> -Date: Wed, 30 Oct 2019 18:32:35 +0100 -Subject: [PATCH 085/170] Optimizations - ---- - libsrc/lynx/cgetc.s | 9 ++------- - libsrc/lynx/kbhit.s | 2 +- - 2 files changed, 3 insertions(+), 8 deletions(-) - -diff --git a/libsrc/lynx/cgetc.s b/libsrc/lynx/cgetc.s -index 368a0e8d..362371ec 100644 ---- a/libsrc/lynx/cgetc.s -+++ b/libsrc/lynx/cgetc.s -@@ -19,14 +19,10 @@ - ; and Opt1 + Opt2 pressed '3'. - ; So the keyboard returns '1', '2', '3', 'P', 'R', 'F' or '?'. - --_cgetc: -- lda KBEDG -- bne _start -+_cgetc: - jsr _kbhit ; Check for char available - beq _cgetc --_start: -- lda KBSTL -- ora KBEDG -+ ora KBSTL - ldx #0 - and #1 - beq @L5 -@@ -55,7 +51,6 @@ _start: - bra reset_and_exit - @L5: - lda KBEDG ; No Pause pressed -- stz KBEDG - ora KBSTL - bit #$08 - beq @L7 -diff --git a/libsrc/lynx/kbhit.s b/libsrc/lynx/kbhit.s -index a846c43e..90d9061c 100644 ---- a/libsrc/lynx/kbhit.s -+++ b/libsrc/lynx/kbhit.s -@@ -51,6 +51,6 @@ _kbhit: - sta KBNPR ; inverted previous ones pressed - stx KBPRV - lda KBEDG --L1: ldx #$00 -+L1: tax - rts - --- -2.26.0 - diff --git a/0086-Reformat-comments-to-style-guide-rules.patch b/0086-Reformat-comments-to-style-guide-rules.patch deleted file mode 100644 index 5605ae5..0000000 --- a/0086-Reformat-comments-to-style-guide-rules.patch +++ /dev/null @@ -1,268 +0,0 @@ -From 0d21a2b5a4a71a39b730492068ca1cf01448b4d5 Mon Sep 17 00:00:00 2001 -From: Richard Halkyard <rhalkyard@gmail.com> -Date: Thu, 31 Oct 2019 11:23:15 -0500 -Subject: [PATCH 086/170] Reformat comments to style guide rules - ---- - libsrc/c64/tgi/c64-hi.s | 95 ++++++++++++++++++++--------------------- - 1 file changed, 47 insertions(+), 48 deletions(-) - -diff --git a/libsrc/c64/tgi/c64-hi.s b/libsrc/c64/tgi/c64-hi.s -index c9167b51..38faf3d7 100644 ---- a/libsrc/c64/tgi/c64-hi.s -+++ b/libsrc/c64/tgi/c64-hi.s -@@ -131,7 +131,7 @@ VBASE := $E000 ; Video memory base address - ; - - INSTALL: --; rts ; fall through -+; rts ; Fall through - - - ; ------------------------------------------------------------------------ -@@ -272,7 +272,7 @@ CLEAR: ldy #$00 - sta VBASE+$1C00,y - sta VBASE+$1D00,y - sta VBASE+$1E00,y -- sta VBASE+$1E40,y ; preserve vectors -+ sta VBASE+$1E40,y ; Preserve vectors - iny - bne @L1 - rts -@@ -285,7 +285,7 @@ CLEAR: ldy #$00 - ; - - SETVIEWPAGE: --; rts ; fall through -+; rts ; Fall through - - ; ------------------------------------------------------------------------ - ; SETDRAWPAGE: Set the drawable page. Called with the new page in A (0..n). -@@ -460,14 +460,14 @@ GETPIXEL: - - LINE: - --@CHECK: lda X2 ;Make sure x1<x2 -+@CHECK: lda X2 ; Make sure x1<x2 - sec - sbc X1 - tax - lda X2+1 - sbc X1+1 - bpl @CONT -- lda Y2 ;If not, swap P1 and P2 -+ lda Y2 ; If not, swap P1 and P2 - ldy Y1 - sta Y1 - sty Y2 -@@ -488,19 +488,19 @@ LINE: - @CONT: sta DX+1 - stx DX - -- ldx #$C8 ;INY -- lda Y2 ;Calculate dy -+ ldx #$C8 ; INY -+ lda Y2 ; Calculate dy - sec - sbc Y1 - tay - lda Y2+1 - sbc Y1+1 -- bpl @DYPOS ;Is y2>=y1? -- lda Y1 ;Otherwise dy=y1-y2 -+ bpl @DYPOS ; Is y2>=y1? -+ lda Y1 ; Otherwise dy=y1-y2 - sec - sbc Y2 - tay -- ldx #$88 ;DEY -+ ldx #$88 ; DEY - - @DYPOS: sty DY ; 8-bit DY -- FIX ME? - stx YINCDEC -@@ -516,8 +516,8 @@ LINE: - sta $01 - - ldx DY -- cpx DX ;Who's bigger: dy or dx? -- bcc STEPINX ;If dx, then... -+ cpx DX ; Who's bigger: dy or dx? -+ bcc STEPINX ; If dx, then... - lda DX+1 - bne STEPINX - -@@ -535,14 +535,14 @@ LINE: - ; Y1 AND #$07 - STEPINY: - lda #00 -- sta OLDCHUNK ;So plotting routine will work right -+ sta OLDCHUNK ; So plotting routine will work right - lda CHUNK -- lsr ;Strip the bit -+ lsr ; Strip the bit - eor CHUNK - sta CHUNK - txa -- beq YCONT2 ;If dy=0, it's just a point --@CONT: lsr ;Init counter to dy/2 -+ beq YCONT2 ; If dy=0, it's just a point -+@CONT: lsr ; Init counter to dy/2 - ; - ; Main loop - ; -@@ -554,17 +554,17 @@ YLOOP: sta TEMP - eor (POINT),y - sta (POINT),y - YINCDEC: -- iny ;Advance Y coordinate -+ iny ; Advance Y coordinate - cpy #8 -- bcc @CONT ;No prob if Y=0..7 -+ bcc @CONT ; No prob if Y=0..7 - jsr FIXY --@CONT: lda TEMP ;Restore A -+@CONT: lda TEMP ; Restore A - sec - sbc DX - bcc YFIXX --YCONT: dex ;X is counter -+YCONT: dex ; X is counter - bne YLOOP --YCONT2: lda (POINT),y ;Plot endpoint -+YCONT2: lda (POINT),y ; Plot endpoint - eor BITMASK - and CHUNK - eor (POINT),y -@@ -574,13 +574,13 @@ YCONT2: lda (POINT),y ;Plot endpoint - cli - rts - --YFIXX: ;x=x+1 -+YFIXX: ; X = X + 1 - adc DY - lsr CHUNK -- bne YCONT ;If we pass a column boundary... -- ror CHUNK ;then reset CHUNK to $80 -+ bne YCONT ; If we pass a column boundary... -+ ror CHUNK ; Then reset CHUNK to $80 - sta TEMP2 -- lda POINT ;And add 8 to POINT -+ lda POINT ; And add 8 to POINT - adc #8 - sta POINT - bcc @CONT -@@ -598,34 +598,33 @@ YFIXX: ;x=x+1 - - .bss - COUNTHI: -- .byte $00 ;Temporary counter -- ;only used once -+ .byte $00 ; Temporary counter, only used once - .code - STEPINX: - ldx DX - lda DX+1 - sta COUNTHI - cmp #$80 -- ror ;Need bit for initialization -- sta Y1 ;High byte of counter -+ ror ; Need bit for initialization -+ sta Y1 ; High byte of counter - txa -- bne @CONT ;Could be $100 -+ bne @CONT ; Could be $100 - dec COUNTHI - @CONT: ror - ; - ; Main loop - ; - XLOOP: lsr CHUNK -- beq XFIXC ;If we pass a column boundary... -+ beq XFIXC ; If we pass a column boundary... - XCONT1: sbc DY -- bcc XFIXY ;Time to step in Y? -+ bcc XFIXY ; Time to step in Y? - XCONT2: dex - bne XLOOP -- dec COUNTHI ;High bits set? -+ dec COUNTHI ; High bits set? - bpl XLOOP - -- lsr CHUNK ;Advance to last point -- jsr LINEPLOT ;Plot the last chunk -+ lsr CHUNK ; Advance to last point -+ jsr LINEPLOT ; Plot the last chunk - lda #$36 - sta $01 - cli -@@ -651,22 +650,22 @@ XFIXC: sta TEMP - ; Check to make sure there isn't a high bit, plot chunk, - ; and update Y-coordinate. - ; --XFIXY: dec Y1 ;Maybe high bit set -+XFIXY: dec Y1 ; Maybe high bit set - bpl XCONT2 - adc DX - sta TEMP - lda DX+1 -- adc #$FF ;Hi byte -+ adc #$FF ; Hi byte - sta Y1 - -- jsr LINEPLOT ;Plot chunk -+ jsr LINEPLOT ; Plot chunk - lda CHUNK - sta OLDCHUNK - - lda TEMP - XINCDEC: -- iny ;Y-coord -- cpy #8 ;0..7 is ok -+ iny ; Y-coord -+ cpy #8 ; 0..7 is ok - bcc XCONT2 - sta TEMP - jsr FIXY -@@ -691,11 +690,11 @@ LINEPLOT: ; Plot the line chunk - ; Subroutine to fix up pointer when Y decreases through - ; zero or increases through 7. - ; --FIXY: cpy #255 ;Y=255 or Y=8 -+FIXY: cpy #255 ; Y=255 or Y=8 - beq @DECPTR - --@INCPTR: ;Add 320 to pointer -- ldy #0 ;Y increased through 7 -+@INCPTR: ; Add 320 to pointer -+ ldy #0 ; Y increased through 7 - lda POINT - adc #<320 - sta POINT -@@ -704,8 +703,8 @@ FIXY: cpy #255 ;Y=255 or Y=8 - sta POINT+1 - rts - --@DECPTR: ;Okay, subtract 320 then -- ldy #7 ;Y decreased through 0 -+@DECPTR: ; Okay, subtract 320 then -+ ldy #7 ; Y decreased through 0 - lda POINT - sec - sbc #<320 -@@ -861,10 +860,10 @@ CALC: lda Y1 - ror POINT - cmp #$80 - ror -- ror POINT ; row*64 -- adc TEMP2 ; +row*256 -+ ror POINT ; Row * 64 -+ adc TEMP2 ; + Row * 256 - clc -- adc #>VBASE ; +bitmap base -+ adc #>VBASE ; + Bitmap base - sta POINT+1 - - lda X1 --- -2.26.0 - diff --git a/0087-Optimize-a-negation-in-signed-division.patch b/0087-Optimize-a-negation-in-signed-division.patch deleted file mode 100644 index 162cd0c..0000000 --- a/0087-Optimize-a-negation-in-signed-division.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 2bec637637df08ffa5a43c0e75fa04015934e0e3 Mon Sep 17 00:00:00 2001 -From: Piotr Fusik <fox@scene.pl> -Date: Tue, 5 Nov 2019 20:15:34 +0100 -Subject: [PATCH 087/170] Optimize a negation in signed division. - ---- - libsrc/runtime/idiv32by16r16.s | 11 +++++------ - 1 file changed, 5 insertions(+), 6 deletions(-) - -diff --git a/libsrc/runtime/idiv32by16r16.s b/libsrc/runtime/idiv32by16r16.s -index 12e7feb5..098e3dbf 100644 ---- a/libsrc/runtime/idiv32by16r16.s -+++ b/libsrc/runtime/idiv32by16r16.s -@@ -29,19 +29,18 @@ idiv32by16r16: - stx ptr3+1 - - lda ptr2+1 -+ cmp #$80 - eor tmp1 - sta tmp1 -- bit ptr2+1 -- bpl @L3 -+ bcc @L3 - - ; Negate the value in ptr1:ptr2 - - ldx #0 - ldy #4 -- sec --@L2: lda ptr1,x -- eor #$FF -- adc #$00 -+; sec -+@L2: lda #$00 -+ sbc ptr1,x - sta ptr1,x - inx - dey --- -2.26.0 - diff --git a/0088-Don-t-set-carry-when-already-set.patch b/0088-Don-t-set-carry-when-already-set.patch deleted file mode 100644 index 4f04689..0000000 --- a/0088-Don-t-set-carry-when-already-set.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 421c3f2b4fef1896316b0d8b0227727c50071fdb Mon Sep 17 00:00:00 2001 -From: Piotr Fusik <fox@scene.pl> -Date: Tue, 5 Nov 2019 20:16:21 +0100 -Subject: [PATCH 088/170] Don't set carry when already set. - ---- - libsrc/runtime/imul8x8r16.s | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/libsrc/runtime/imul8x8r16.s b/libsrc/runtime/imul8x8r16.s -index e1aea30a..72e6d03a 100644 ---- a/libsrc/runtime/imul8x8r16.s -+++ b/libsrc/runtime/imul8x8r16.s -@@ -1,6 +1,7 @@ - ; - ; 2010-11-02, Ullrich von Bassewitz - ; 2014-09-10, Greg King -+; 2019-11-05, Piotr Fusik - ; - ; CC65 runtime: 8x8 => 16 signed multiplication - ; -@@ -59,7 +60,8 @@ NegMult: - bnz @L2 ; Branch always - - @L0: tya ; Subtract current multiplicand -- sub ptr3 -+; sec -+ sbc ptr3 - tay - txa - sbc ptr3+1 --- -2.26.0 - diff --git a/0089-Swap-the-positive-negative-paths-to-save-a-branch.patch b/0089-Swap-the-positive-negative-paths-to-save-a-branch.patch deleted file mode 100644 index 2b78fe9..0000000 --- a/0089-Swap-the-positive-negative-paths-to-save-a-branch.patch +++ /dev/null @@ -1,94 +0,0 @@ -From 985371433b016b4412f115c852fd44e0cf6dba69 Mon Sep 17 00:00:00 2001 -From: Piotr Fusik <fox@scene.pl> -Date: Tue, 5 Nov 2019 20:26:02 +0100 -Subject: [PATCH 089/170] Swap the positive/negative paths to save a branch. - ---- - libsrc/runtime/imul8x8r16.s | 55 +++++++++++++++++++++---------------- - 1 file changed, 31 insertions(+), 24 deletions(-) - -diff --git a/libsrc/runtime/imul8x8r16.s b/libsrc/runtime/imul8x8r16.s -index 72e6d03a..fe939f66 100644 ---- a/libsrc/runtime/imul8x8r16.s -+++ b/libsrc/runtime/imul8x8r16.s -@@ -32,24 +32,7 @@ imul8x8r16m: - ldy #<$0000 ; Clear .XY accumulator - ldx #>$0000 - lda ptr1 -- bmi NegMult -- bpl @L2 ; Branch always -- --@L0: tya ; Add current multiplicand -- add ptr3 -- tay -- txa -- adc ptr3+1 -- tax -- --@L1: asl ptr3 -- rol ptr3+1 --@L2: lsr ptr1 ; Get next bit of Right-Hand Side into carry -- bcs @L0 -- bnz @L1 ; Loop if more one-bits in multiplier -- -- tya ; Put result into cc65's accumulator -- rts -+ bpl PosStart - - ; The multiplier is negative. - ; Therefore, make it positive; and, subtract when multiplying. -@@ -57,9 +40,10 @@ NegMult: - eor #%11111111 - sta ptr1 - inc ptr1 -- bnz @L2 ; Branch always -+ bnz NegStart ; Branch always - --@L0: tya ; Subtract current multiplicand -+NegAdd: -+ tya ; Subtract current multiplicand - ; sec - sbc ptr3 - tay -@@ -67,11 +51,34 @@ NegMult: - sbc ptr3+1 - tax - --@L1: asl ptr3 -+NegShift: -+ asl ptr3 -+ rol ptr3+1 -+NegStart: -+ lsr ptr1 ; Get next bit of Right-Hand Side into carry -+ bcs NegAdd -+ bnz NegShift ; Loop if more one-bits in multiplier -+ -+ tya ; Put result into cc65's accumulator -+ rts -+ -+; The multiplier is positive. -+ -+PosAdd: -+ tya ; Add current multiplicand -+ add ptr3 -+ tay -+ txa -+ adc ptr3+1 -+ tax -+ -+PosShift: -+ asl ptr3 - rol ptr3+1 --@L2: lsr ptr1 ; Get next bit of Right-Hand Side into carry -- bcs @L0 -- bnz @L1 ; Loop if more one-bits in multiplier -+PosStart: -+ lsr ptr1 ; Get next bit of Right-Hand Side into carry -+ bcs PosAdd -+ bnz PosShift ; Loop if more one-bits in multiplier - - tya ; Put result into cc65's accumulator - rts --- -2.26.0 - diff --git a/0090-Optimize-sign-extension.patch b/0090-Optimize-sign-extension.patch deleted file mode 100644 index 1ba93fb..0000000 --- a/0090-Optimize-sign-extension.patch +++ /dev/null @@ -1,40 +0,0 @@ -From d38417b347323ba73d2af5106316720f038e95fa Mon Sep 17 00:00:00 2001 -From: Piotr Fusik <fox@scene.pl> -Date: Tue, 5 Nov 2019 20:44:21 +0100 -Subject: [PATCH 090/170] Optimize sign extension. - ---- - libsrc/runtime/imul8x8r16.s | 16 ++++++++++------ - 1 file changed, 10 insertions(+), 6 deletions(-) - -diff --git a/libsrc/runtime/imul8x8r16.s b/libsrc/runtime/imul8x8r16.s -index fe939f66..fe08c855 100644 ---- a/libsrc/runtime/imul8x8r16.s -+++ b/libsrc/runtime/imul8x8r16.s -@@ -24,13 +24,17 @@ imul8x8r16: - sta ptr3 - - imul8x8r16m: -+; Extend sign of Left-Hand Side -+ lda #$7f -+ cmp ptr3 -+ adc #$80 -+ sta ptr3+1 -+ -+; Clear .XY accumulator -+ ldy #<$0000 - ldx #>$0000 -- bit ptr3 -- bpl @L7 -- dex --@L7: stx ptr3+1 ; Extend sign of Left-Hand Side -- ldy #<$0000 ; Clear .XY accumulator -- ldx #>$0000 -+ -+; Check the multiplier sign. - lda ptr1 - bpl PosStart - --- -2.26.0 - diff --git a/0091-Fixed-typos.patch b/0091-Fixed-typos.patch deleted file mode 100644 index 9ddec3d..0000000 --- a/0091-Fixed-typos.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 7f7db01e257be7215430f5eaaa95842f96e3f949 Mon Sep 17 00:00:00 2001 -From: Stefan <stefan.haubenthal@gmail.com> -Date: Sat, 9 Nov 2019 22:23:46 +0100 -Subject: [PATCH 091/170] Fixed typos - ---- - doc/funcref.sgml | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/doc/funcref.sgml b/doc/funcref.sgml -index 030c726c..6b39ad5e 100644 ---- a/doc/funcref.sgml -+++ b/doc/funcref.sgml -@@ -1360,8 +1360,8 @@ used in presence of a prototype. - <tag/Function/Test a condition and possibly abort. - <tag/Header/<tt/<ref id="assert.h" name="assert.h">/ - <tag/Declaration/<tt/void assert (int cond);/ --<tag/Description/<tt/assert/ is a macro that expands to a <tt/id/ --statement. If the condition evaluates t zero (false), assert prints a message -+<tag/Description/<tt/assert/ is a macro that expands to an <tt/id/ -+statement. If the condition evaluates to zero (false), assert prints a message - on stderr and aborts the program. - <tag/Notes/<itemize> - <item>The function is actually a macro. --- -2.26.0 - diff --git a/0092-Made-assert-send-SIGABRT-when-an-assertion-fails.patch b/0092-Made-assert-send-SIGABRT-when-an-assertion-fails.patch deleted file mode 100644 index 94b2e73..0000000 --- a/0092-Made-assert-send-SIGABRT-when-an-assertion-fails.patch +++ /dev/null @@ -1,118 +0,0 @@ -From ac4866c027b881b9cde2b4195cac0988eb3ca411 Mon Sep 17 00:00:00 2001 -From: Greg King <gregdk@users.sf.net> -Date: Sun, 10 Nov 2019 12:46:01 -0500 -Subject: [PATCH 092/170] Made assert() send SIGABRT when an assertion fails. - -A signal handler can catch it, and do anything needed to make stderr work. ---- - doc/funcref.sgml | 28 +++++++++++++++------------- - libsrc/common/_afailed.c | 7 +++---- - 2 files changed, 18 insertions(+), 17 deletions(-) - -diff --git a/doc/funcref.sgml b/doc/funcref.sgml -index 6b39ad5e..314c57d8 100644 ---- a/doc/funcref.sgml -+++ b/doc/funcref.sgml -@@ -1,4 +1,4 @@ --<!doctype linuxdoc system> <!-- -*- text-mode -*- --> -+<!doctype linuxdoc system> - - <article> - <title>cc65 function reference -@@ -1316,11 +1316,11 @@ disabled. - - <quote> - <descrip> --<tag/Function/Terminates a program abnormally. -+<tag/Function/Terminate a program abnormally. - <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/ - <tag/Declaration/<tt/void abort (void);/ --<tag/Description/<tt/abort/ raises <tt/SIGABRT/, writes a termination message --on stderr, then terminates the program with an exit code of 3. -+<tag/Description/<tt/abort()/ raises <tt/SIGABRT/, writes a termination message -+on <tt/stderr/, then terminates the program with an exit code of 3. - <tag/Availability/ISO 9899 - <tag/See also/ - <ref id="assert" name="assert">, -@@ -1357,19 +1357,20 @@ used in presence of a prototype. - - <quote> - <descrip> --<tag/Function/Test a condition and possibly abort. -+<tag/Function/Test a condition, and possibly abort. - <tag/Header/<tt/<ref id="assert.h" name="assert.h">/ - <tag/Declaration/<tt/void assert (int cond);/ --<tag/Description/<tt/assert/ is a macro that expands to an <tt/id/ --statement. If the condition evaluates to zero (false), assert prints a message --on stderr and aborts the program. -+<tag/Description/<tt/assert()/ is a macro that expands to an <tt/if/ statement. -+If the condition evaluates to zero (false), <tt/assert()/ raises <tt/SIGABRT/, -+prints a message on <tt/stderr/, then exits the program with an exit code of 2. - <tag/Notes/<itemize> - <item>The function is actually a macro. - </itemize> - <tag/Availability/ISO 9899 - <tag/See also/ - <ref id="abort" name="abort">, --<ref id="exit" name="exit"> -+<ref id="exit" name="exit">, -+<ref id="raise" name="raise"> - <tag/Example/None. - </descrip> - </quote> -@@ -5820,18 +5821,19 @@ calling convention. - <tag/Function/Send a signal to the executing program. - <tag/Header/<tt/<ref id="signal.h" name="signal.h">/ - <tag/Declaration/<tt/int __fastcall__ raise (int sig);/ --<tag/Description/<tt/raise/ sends the given signal to the program. If the -+<tag/Description/<tt/raise()/ sends the given signal to the program. If the - program has installed a signal handler for the signal, this signal handler - will be executed. If no handler has been installed, the default action for - the raised signal will be taken. The function returns zero on success, --nonzero otherwise. -+non-zero otherwise. - <tag/Notes/<itemize> --<item>The function is only available as fastcall function, so it may only --be used in presence of a prototype. -+<item>The function is available only as a fastcall function, -+so it may be used only in the presence of a prototype. - </itemize> - <tag/Availability/ISO 9899 - <tag/See also/ - <ref id="abort" name="abort">, -+<ref id="assert" name="assert">, - <ref id="signal" name="signal"> - <tag/Example/None. - </descrip> -diff --git a/libsrc/common/_afailed.c b/libsrc/common/_afailed.c -index 7c6df4a2..ed93fc12 100644 ---- a/libsrc/common/_afailed.c -+++ b/libsrc/common/_afailed.c -@@ -2,11 +2,12 @@ - ** _afailed.c - ** - ** 1998-06-06, Ullrich von Bassewitz --** 2015-03-13, Greg King -+** 2019-11-10, Greg King - */ - - - -+#include <signal.h> - #include <stdio.h> - #include <stdlib.h> - -@@ -14,9 +15,7 @@ - - void __fastcall__ _afailed (char* file, unsigned line) - { -+ raise (SIGABRT); - fprintf (stderr, "ASSERTION FAILED IN %s(%u)\n", file, line); - exit (2); - } -- -- -- --- -2.26.0 - diff --git a/0093-Fixed-exit-code-974.patch b/0093-Fixed-exit-code-974.patch deleted file mode 100644 index 220f15c..0000000 --- a/0093-Fixed-exit-code-974.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 659d1729eb4e8192f3ff76a8813d8944b4c3cb40 Mon Sep 17 00:00:00 2001 -From: Stefan <stefan.haubenthal@gmail.com> -Date: Tue, 12 Nov 2019 11:23:23 +0100 -Subject: [PATCH 093/170] Fixed exit code #974 - ---- - test/ref/yacc.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/test/ref/yacc.c b/test/ref/yacc.c -index f2c3e2a5..776e4f93 100644 ---- a/test/ref/yacc.c -+++ b/test/ref/yacc.c -@@ -409,7 +409,7 @@ yylook() - if(testbreak==5) - { - fprintf(yyout,"yylook: error, aborted after 5 loops\n"); -- exit(0); -+ exit(EXIT_FAILURE); - } - testbreak++; - --- -2.26.0 - diff --git a/0094-Changed-a-See-also-link-in-the-abort-and-assert-desc.patch b/0094-Changed-a-See-also-link-in-the-abort-and-assert-desc.patch deleted file mode 100644 index f50620e..0000000 --- a/0094-Changed-a-See-also-link-in-the-abort-and-assert-desc.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 4dda5d2173928271dd3d8b506b493e55088819c0 Mon Sep 17 00:00:00 2001 -From: Greg King <gregdk@users.sf.net> -Date: Tue, 12 Nov 2019 11:57:38 -0500 -Subject: [PATCH 094/170] Changed a "See also" link in the abort() and assert() - descriptions from raise() to signal(). - -Programmers might want to use signal() to catch the SIGABRT that's sent by abort() and assert(). ---- - doc/funcref.sgml | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/doc/funcref.sgml b/doc/funcref.sgml -index 314c57d8..72a44c7b 100644 ---- a/doc/funcref.sgml -+++ b/doc/funcref.sgml -@@ -1325,7 +1325,7 @@ on <tt/stderr/, then terminates the program with an exit code of 3. - <tag/See also/ - <ref id="assert" name="assert">, - <ref id="exit" name="exit">, --<ref id="raise" name="raise"> -+<ref id="signal" name="signal"> - <tag/Example/None. - </descrip> - </quote> -@@ -1370,7 +1370,7 @@ prints a message on <tt/stderr/, then exits the program with an exit code of 2. - <tag/See also/ - <ref id="abort" name="abort">, - <ref id="exit" name="exit">, --<ref id="raise" name="raise"> -+<ref id="signal" name="signal"> - <tag/Example/None. - </descrip> - </quote> -@@ -6656,6 +6656,7 @@ be used in presence of a prototype. - <tag/Availability/ISO 9899 - <tag/See also/ - <ref id="abort" name="abort">, -+<ref id="assert" name="assert">, - <ref id="raise" name="raise"> - <tag/Example/None. - </descrip> --- -2.26.0 - diff --git a/0095-Updated-cx16-to-match-the-Commander-X16-ROMs-and-emu.patch b/0095-Updated-cx16-to-match-the-Commander-X16-ROMs-and-emu.patch deleted file mode 100644 index df2c620..0000000 --- a/0095-Updated-cx16-to-match-the-Commander-X16-ROMs-and-emu.patch +++ /dev/null @@ -1,1540 +0,0 @@ -From d78133e1f00be19929ca6ee920c30f782c502e8b Mon Sep 17 00:00:00 2001 -From: Greg King <gregdk@users.sf.net> -Date: Sat, 16 Nov 2019 13:11:40 -0500 -Subject: [PATCH 095/170] Updated cx16 to match the Commander X16 ROMs and - emulator, release 34. - ---- - asminc/cbm_kernal.inc | 4 +- - asminc/cx16.inc | 87 ++++++++----- - cfg/cx16-asm.cfg | 3 +- - cfg/cx16-bank.cfg | 2 +- - cfg/cx16.cfg | 2 +- - doc/cx16.sgml | 50 ++++--- - include/cx16.h | 23 +++- - libsrc/cx16/break.s | 21 ++- - libsrc/cx16/conio.s | 9 -- - libsrc/cx16/cpeekc.s | 2 +- - libsrc/cx16/cpeekrevers.s | 2 +- - libsrc/cx16/cputc.s | 4 +- - libsrc/cx16/crt0.s | 22 ++-- - libsrc/cx16/devnum.s | 8 -- - libsrc/cx16/exec.c | 122 ++++++++++++++++++ - libsrc/cx16/execvars.s | 16 +++ - libsrc/cx16/filevars.s | 39 ++++++ - libsrc/cx16/getdevice.s | 67 ++++++++++ - libsrc/cx16/gotox.s | 13 ++ - libsrc/cx16/gotoxy.s | 18 +++ - libsrc/cx16/gotoy.s | 13 ++ - libsrc/cx16/joy/{cx16-stdjoy.s => cx16-std.s} | 76 ++++++----- - libsrc/cx16/joy_stat_stddrv.s | 7 +- - libsrc/cx16/joy_stddrv.s | 4 +- - libsrc/cx16/joyref.s | 20 +++ - libsrc/cx16/kbhit.s | 6 +- - libsrc/cx16/kernal.s | 5 +- - libsrc/cx16/libref.s | 4 +- - libsrc/cx16/mainargs.s | 8 +- - libsrc/cx16/set_tv.s | 16 +-- - libsrc/cx16/status.s | 16 ++- - libsrc/cx16/tgi_stat_stddrv.s | 11 ++ - libsrc/cx16/tgi_stddrv.s | 13 ++ - libsrc/cx16/videomode.s | 48 ++++--- - libsrc/cx16/waitvsync.s | 2 +- - libsrc/cx16/wherex.s | 15 +++ - libsrc/cx16/wherey.s | 15 +++ - 37 files changed, 609 insertions(+), 184 deletions(-) - delete mode 100644 libsrc/cx16/conio.s - delete mode 100644 libsrc/cx16/devnum.s - create mode 100644 libsrc/cx16/exec.c - create mode 100644 libsrc/cx16/execvars.s - create mode 100644 libsrc/cx16/filevars.s - create mode 100644 libsrc/cx16/getdevice.s - create mode 100644 libsrc/cx16/gotox.s - create mode 100644 libsrc/cx16/gotoxy.s - create mode 100644 libsrc/cx16/gotoy.s - rename libsrc/cx16/joy/{cx16-stdjoy.s => cx16-std.s} (58%) - create mode 100644 libsrc/cx16/joyref.s - create mode 100644 libsrc/cx16/tgi_stat_stddrv.s - create mode 100644 libsrc/cx16/tgi_stddrv.s - create mode 100644 libsrc/cx16/wherex.s - create mode 100644 libsrc/cx16/wherey.s - -diff --git a/asminc/cbm_kernal.inc b/asminc/cbm_kernal.inc -index 6e1e1604..a38836ce 100644 ---- a/asminc/cbm_kernal.inc -+++ b/asminc/cbm_kernal.inc -@@ -7,18 +7,20 @@ - .if .def(__CX16__) - ; CX16 extended jump table - GETJOY := $FF06 -+ MOUSE := $FF09 -+ SCRMOD := $FF5F - .endif - - .if .def(__C128__) - ; C128 extended jump table - C64MODE := $FF4D -+ SWAPPER := $FF5F - SETBNK := $FF68 - .endif - - .if .def(__C128__) || .def(__CX16__) - ; Extended jump table - CLSALL := $FF4A -- SWAPPER := $FF5F - JSRFAR := $FF6E - INDFET := $FF74 - INDSTA := $FF77 -diff --git a/asminc/cx16.inc b/asminc/cx16.inc -index 5b46908d..1c22c99b 100644 ---- a/asminc/cx16.inc -+++ b/asminc/cx16.inc -@@ -44,42 +44,55 @@ - ; --------------------------------------------------------------------------- - ; Zero page - --; BASIC --VARTAB := $2D ; Pointer to start of BASIC variables --MEMSIZE := $37 ; Pointer to highest BASIC RAM location (+1) --TXTPTR := $7A ; Pointer into BASIC source code -- - ; Kernal --IN_DEV := $99 ; Current input device number --OUT_DEV := $9A ; Current output device number --IMPARM := $9B ; Pointer for PRIMM function --TIME := $A0 ; 60 Hz. clock --FNAM_LEN := $B7 ; Length of filename --SECADR := $B9 ; Secondary address --DEVNUM := $BA ; Device number --FNAM := $BB ; Pointer to filename --KEY_COUNT := $C6 ; Number of keys in input buffer --RVS := $C7 ; Reverse flag --CURS_FLAG := $CC ; 1 = cursor off --CURS_BLINK := $CD ; Blink counter --CURS_CHAR := $CE ; Character under the cursor --CURS_STATE := $CF ; Cursor blink state --SCREEN_PTR := $D1 ; Pointer to current row on text screen (16 bits) --CURS_X := $D3 ; Cursor column --CURS_Y := $D6 ; Cursor row --LLEN := $D9 ; Line length --NLINES := $DA ; Number of screen lines --JOY1 := $EF ; 3 bytes of NES/SNES gamepad data --JOY2 := $F2 --FREKZP := $FB ; Five unused bytes -+FNAM := $84 ; Pointer to filename -+KTEMP2 := $86 ; 2 bytes for temporary storage -+SCREEN_PTR := $88 ; Pointer to current row on text screen (16 bits) -+IMPARM := $8A ; Pointer for PRIMM function -+ -+; BASIC -+TXTPTR := $EE ; Pointer into BASIC source code - - ; Page two - --BASIC_BUF := $200 ; Location of command-line --BASIC_BUF_LEN = 89 ; Maximum length of command-line -+BASIC_BUF := $0200 ; Location of command-line -+BASIC_BUF_LEN = 81 ; Maximum length of command-line - --CHARCOLOR := $286 --CURS_COLOR := $287 ; Color under the cursor -+CURS_COLOR := $027E ; Color under the cursor -+CHARCOLOR := $0286 ; Cursor's color nybbles (high: background, low: foreground) -+STATUS := $0287 ; Status from previous I/O operation -+IN_DEV := $028E ; Current input device number -+OUT_DEV := $028F ; Current output device number -+TIME := $0292 ; 60 Hz. clock (3 bytes, big-endian) -+FNAM_LEN := $0298 ; Length of filename -+SECADR := $029A ; Secondary address -+DEVNUM := $029B ; Device number -+KEY_COUNT := $029E ; Number of keys in input buffer -+RVS := $029F ; Reverse flag -+CURS_FLAG := $02A3 ; 1 = cursor off -+CURS_BLINK := $02A4 ; Blink counter -+CURS_CHAR := $02A5 ; Character under the cursor -+CURS_STATE := $02A6 ; Cursor blink state -+CURS_X := $02A8 ; Cursor column -+CURS_Y := $02AB ; Cursor row -+LLEN := $02AE ; Line length -+NLINES := $02AF ; Number of screen lines -+JOY1 := $02BC ; 3 bytes of NES/SNES gamepad data -+JOY2 := $02BF -+ -+; BASIC -+VARTAB := $02DD ; Pointer to start of BASIC variables -+MEMSIZE := $02E5 ; Pointer to highest BASIC RAM location (+1) -+ -+; Kernal mouse -+MSEPAR := $0371 ; mouse: $8x=sprite on, 1/2: scale -+MOUSEL := $0372 ; min. x co-ordinate -+MOUSER := $0374 ; max. x co-ordinate -+MOUSET := $0376 ; min. y co-ordinate -+MOUSEB := $0378 ; max. y co-ordinate -+MOUSEX := $037A ; x co-ordinate -+MOUSEY := $037C ; y co-ordinate -+MOUSEBT := $037E ; buttons (bits 2: middle, 1: right, 0: left) - - ; --------------------------------------------------------------------------- - ; Vector and other locations -@@ -122,6 +135,12 @@ NMIVec := $0318 - INC8192 = 14 << 4 - INC16384 = 15 << 4 - .endenum -+ .enum ; Interrupt request flags -+ VERT_SYNC = %00000001 -+ RASTER = %00000010 -+ SPR_COLLIDED = %00000100 -+ UART_IRQ = %00001000 -+ .endenum - ; Internal RAM and registers - VRAM := $000000 - .scope COMPOSER ; Display composer -@@ -263,7 +282,7 @@ NMIVec := $0318 - .endscope - .endscope - --; 65c22 -+; 65C22 - .struct VIA1 ; Versatile Interface Adapter - .org $9F60 - PRB .byte ; ROM bank, IEC (Port Register B) -@@ -281,10 +300,10 @@ NMIVec := $0318 - PRA2 .byte ; RAM bank (Port Register A without handshaking) - .endstruct - --; 65c22 -+; 65C22 - .struct VIA2 - .org $9F70 -- PRB .byte -+ PRB .byte ; Mouse communication ? - PRA .byte ; NES controller communication - DDRB .byte - DDRA .byte -diff --git a/cfg/cx16-asm.cfg b/cfg/cx16-asm.cfg -index 53f6da17..4228f6da 100644 ---- a/cfg/cx16-asm.cfg -+++ b/cfg/cx16-asm.cfg -@@ -6,12 +6,13 @@ SYMBOLS { - __HIMEM__: type = weak, value = $9F00; - } - MEMORY { -- ZP: file = "", start = $0004, size = $0090 - $0004, define = yes; -+ ZP: file = "", start = $0002, size = $0080 - $0002, define = yes; - LOADADDR: file = %O, start = %S - 2, size = $0002; - MAIN: file = %O, start = %S, size = __HIMEM__ - %S; - } - SEGMENTS { - ZEROPAGE: load = ZP, type = zp; -+ EXTZP: load = ZP, type = zp, optional = yes; - LOADADDR: load = LOADADDR, type = ro; - EXEHDR: load = MAIN, type = ro, optional = yes; - LOWCODE: load = MAIN, type = ro, optional = yes; -diff --git a/cfg/cx16-bank.cfg b/cfg/cx16-bank.cfg -index 52438fba..ff5dded3 100644 ---- a/cfg/cx16-bank.cfg -+++ b/cfg/cx16-bank.cfg -@@ -11,7 +11,7 @@ SYMBOLS { - __BANKRAMSIZE__: type = weak, value = $2000; # 8K banked RAM - } - MEMORY { -- ZP: file = "", define = yes, start = $0004, size = $0090 - $0004; -+ ZP: file = "", define = yes, start = $0002, size = $0080 - $0002; - LOADADDR: file = %O, start = %S - 2, size = $0002; - HEADER: file = %O, define = yes, start = %S, size = $000D; - MAIN: file = %O, define = yes, start = __HEADER_LAST__, size = __HIMEM__ - __HEADER_LAST__; -diff --git a/cfg/cx16.cfg b/cfg/cx16.cfg -index f912e0f8..c72f6c35 100644 ---- a/cfg/cx16.cfg -+++ b/cfg/cx16.cfg -@@ -8,7 +8,7 @@ SYMBOLS { - __HIMEM__: type = weak, value = $9F00; - } - MEMORY { -- ZP: file = "", define = yes, start = $0004, size = $0090 - $0004; -+ ZP: file = "", define = yes, start = $0002, size = $0080 - $0002; - LOADADDR: file = %O, start = %S - 2, size = $0002; - HEADER: file = %O, define = yes, start = %S, size = $000D; - MAIN: file = %O, define = yes, start = __HEADER_LAST__, size = __HIMEM__ - __HEADER_LAST__; -diff --git a/doc/cx16.sgml b/doc/cx16.sgml -index b739e6a9..16e43db9 100644 ---- a/doc/cx16.sgml -+++ b/doc/cx16.sgml -@@ -17,14 +17,14 @@ compiler. - <sect>Overview<p> - - The Commander X16 is a modern small computer with firmware that is based on --the ROMs in Commodore's VIC-20 and 64C. It has a couple of the I/O chips that --are in the VIC-20. -+the ROMs in Commodore's VIC-20 and 64C. It has a couple of I/O chips -+(WDC65C22 VIA) that are like the ones in the VIC-20. - - This file contains an overview of the CX16 run-time system as it comes with the --cc65 C compiler. It describes the memory layout, CX16-specific header files, -+cc65 C compiler. It describes the memory layout, CX16-specific header files, - available drivers, and any pitfalls specific to that platform. - --Please note that CX16-specific functions just are mentioned here; they are -+Please note that CX16-specific functions just are mentioned here; they might be - described in detail in the separate <url url="funcref.html" name="function - reference">. Even functions marked as "platform dependent" may be available on - more than one platform. Please see the function reference for more -@@ -35,19 +35,20 @@ information. - <sect>Binary format<p> - - The standard binary output format generated by the linker for the CX16 target --is a machine language program with a one-line BASIC stub which calls the --machine language part via SYS. That means that a program can be loaded as a --BASIC program, and started with RUN. It is, of course, possible to change that --behaviour by using a modified start-up file and linker config. -+is a machine language program that's prepended with a 16-bit load address and a -+one-line BASIC stub which calls the machine language part via SYS. That means -+that a program can be loaded as a BASIC program, and started with RUN. It is, -+of course, possible to change that behaviour by using a modified program-header -+file and linker config. - - - - <sect>Memory layout<p> - --cc65-generated programs with the default setup run with the I/O area and the --Kernal ROM visible. That means that Kernal entry points can be called directly. --The usable memory ranges are $0800 - $9EFF and $A000 - --$BFFF. -+cc65-generated programs with the default setup run with the I/O area, RAM bank -+zero, and the Kernal ROM visible. That means that Kernal entry points can be -+called directly. The usable memory ranges are $0800 - $9EFF and -+$A000 - $BFFF. - - Special locations: - -@@ -76,6 +77,9 @@ The ld65 linker comes with a default config. file for the Commander X16, which - is used via <tt/-t cx16/. The cx16 package comes with additional secondary - linker config. files which are used via <tt/-t cx16 -C <configfile>/. - -+Those files use 126 bytes in the zero page. (The rest of page zero is reserved -+for Kernal and BASIC.) -+ - - <sect1>Default config. file (<tt/cx16.cfg/)<p> - -@@ -138,6 +142,8 @@ url="funcref.html" name="function reference"> for declarations and usage. - <item>get_ostype() - <item>set_tv() - <item>videomode() -+<item>vpeek() -+<item>vpoke() - <item>waitvsync() - </itemize> - -@@ -157,6 +163,7 @@ declarations and usage. - <item>cbm_k_ckout() - <item>cbm_k_close() - <item>cbm_k_clrch() -+<item>cbm_k_getin() - <item>cbm_k_load() - <item>cbm_k_open() - <item>cbm_k_readst() -@@ -217,13 +224,13 @@ No extended memory drivers are available currently for the CX16. - <sect1>Joystick drivers<p> - - The default drivers, <tt/joy_stddrv (joy_static_stddrv)/, --point to <tt/cX16-stdjoy.joy (cx16_stdjoy_joy)/. -+point to <tt/cX16-std.joy (cx16_std_joy)/. - - <descrip> -- <tag><tt/cX16-stdjoy.joy (cX16_stdjoy_joy)/</tag> -- Supports up to two NES and SNES controllers connected to the joystick ports -+ <tag><tt/cX16-std.joy (cX16_std_joy)/</tag> -+ Supports up to two NES (and SNES) controllers connected to the joystick ports - of the CX16. It reads the four directions, and the A, B, Select, and Start -- buttons. Button A is the primary fire button. -+ buttons. Buttons A and B are the primary and secondary fire buttons. - </descrip><p> - - -@@ -248,9 +255,16 @@ any time. Some changes could make old programs fail to work. - <sect>Other hints<p> - - -+<sect1>STOP and RUN codes<p> -+ -+The <tt/Esc/ key acts as Commodore's <tt/STOP/ key -- or, you can press the -+<tt/Ctrl/ key and the <tt/C/ key together. Pressing the <tt/Shift/ and the -+<tt/Esc/ keys together will type Commodore's <tt/RUN/ key. -+ -+ - <sect1>Escape code<p> - --For an Esc, press <tt/Ctrl/ and the <tt/[/ key. -+For an <tt/Esc/, press the <tt/Ctrl/ key and the <tt/[/ key together. - - - <sect1>Passing arguments to the program<p> -@@ -274,7 +288,7 @@ supported directly by BASIC, the following syntax was chosen: - - <sect1>Program return code<p> - --The program return code (low byte) is passed back to BASIC by use of the -+The program return code (low byte) is passed back to BASIC by the use of its - <tt/ST/ variable. - - -diff --git a/include/cx16.h b/include/cx16.h -index a2f52850..a6f1b78f 100644 ---- a/include/cx16.h -+++ b/include/cx16.h -@@ -100,6 +100,9 @@ - #define JOY_FIRE2_MASK JOY_BTN_2_MASK - #define JOY_FIRE2(v) ((v) & JOY_FIRE2_MASK) - -+/* Additional mouse button mask */ -+#define MOUSE_BTN_MIDDLE 0x02 -+ - /* get_tv() return codes - ** set_tv() argument codes - */ -@@ -113,10 +116,12 @@ - #define TV_RGB2 7 - - /* Video mode defines */ --#define VIDEOMODE_40x30 40u --#define VIDEOMODE_80x60 80u -+#define VIDEOMODE_40x30 0x00 -+#define VIDEOMODE_80x60 0x02 - #define VIDEOMODE_40COL VIDEOMODE_40x30 - #define VIDEOMODE_80COL VIDEOMODE_80x60 -+#define VIDEOMODE_320x240 0x80 -+#define VIDEOMODE_SWAP (-1) - - - /* Define hardware */ -@@ -157,7 +162,7 @@ struct __emul { - - /* The addresses of the static drivers */ - --extern void cx16_stdjoy_joy[]; /* Referred to by joy_static_stddrv[] */ -+extern void cx16_std_joy[]; /* Referred to by joy_static_stddrv[] */ - - - -@@ -174,14 +179,20 @@ signed char get_ostype (void); - ** Positive -- release build - */ - -+unsigned char get_tv (void); -+/* Return the video type that the machine is using. -+** Return a TV_xx constant. -+*/ -+ - void __fastcall__ set_tv (unsigned char type); - /* Set the video type that the machine will use. - ** Call with a TV_xx constant. - */ - --unsigned char __fastcall__ videomode (unsigned char mode); --/* Set the video mode, return the old mode. Call with one of the VIDEOMODE_xx --** constants. -+signed char __fastcall__ videomode (signed char mode); -+/* Set the video mode, return the old mode. -+** Return -1 if Mode isn't valid. -+** Call with one of the VIDEOMODE_xx constants. - */ - - unsigned char __fastcall__ vpeek (unsigned long addr); -diff --git a/libsrc/cx16/break.s b/libsrc/cx16/break.s -index ec569b9a..6c79c903 100644 ---- a/libsrc/cx16/break.s -+++ b/libsrc/cx16/break.s -@@ -1,6 +1,6 @@ - ; - ; 1998-09-27, Ullrich von Bassewitz --; 2019-09-08, Greg King -+; 2019-11-06, Greg King - ; - ; void __fastcall__ set_brk (unsigned Addr); - ; void reset_brk (void); -@@ -30,6 +30,7 @@ uservec: jmp $FFFF ; Patched at runtime - .code - - ; Set the break vector -+ - .proc _set_brk - - sta uservec+1 -@@ -40,9 +41,9 @@ uservec: jmp $FFFF ; Patched at runtime - bne L1 ; Jump if we installed the handler already - - lda BRKVec -+ ldx BRKVec+1 - sta oldvec -- lda BRKVec+1 -- sta oldvec+1 ; Save the old vector -+ stx oldvec+1 ; Save the old vector - - L1: lda #<brk_handler ; Set the break vector to our routine - ldx #>brk_handler -@@ -54,6 +55,7 @@ L1: lda #<brk_handler ; Set the break vector to our routine - - - ; Reset the break vector -+ - .proc _reset_brk - - lda oldvec -@@ -61,15 +63,15 @@ L1: lda #<brk_handler ; Set the break vector to our routine - beq @L9 ; Jump if vector not installed - sta BRKVec - stx BRKVec+1 -+ - lda #$00 - sta oldvec ; Clear the old vector -- stx oldvec+1 -+ sta oldvec+1 - @L9: rts - - .endproc - - -- - ; Break handler, called if a break occurs - - .proc brk_handler -@@ -81,14 +83,13 @@ L1: lda #<brk_handler ; Set the break vector to our routine - pla - sta _brk_a - pla -- and #$EF ; Clear break bit - sta _brk_sr - pla ; PC low - sec -- sbc #2 ; Point to start of brk -+ sbc #<$0002 ; Point to start of BRK - sta _brk_pc - pla ; PC high -- sbc #0 -+ sbc #>$0002 - sta _brk_pc+1 - - jsr uservec ; Call the user's routine -@@ -99,11 +100,9 @@ L1: lda #<brk_handler ; Set the break vector to our routine - pha - lda _brk_sr - pha -- ldx _brk_x - ldy _brk_y -+ ldx _brk_x - lda _brk_a - rti ; Jump back... - - .endproc -- -- -diff --git a/libsrc/cx16/conio.s b/libsrc/cx16/conio.s -deleted file mode 100644 -index e760af21..00000000 ---- a/libsrc/cx16/conio.s -+++ /dev/null -@@ -1,9 +0,0 @@ --; --; 2019-09-23, Greg King --; --; Low-level stuff for screen output/console input --; -- -- .exportzp CURS_X, CURS_Y -- -- .include "cx16.inc" -diff --git a/libsrc/cx16/cpeekc.s b/libsrc/cx16/cpeekc.s -index 2f02623b..f7a7d208 100644 ---- a/libsrc/cx16/cpeekc.s -+++ b/libsrc/cx16/cpeekc.s -@@ -19,7 +19,7 @@ _cpeekc: - sta VERA::ADDR+1 ; set row number - stz VERA::ADDR+2 - lda CURS_X ; get character column -- asl a -+ asl a ; each character has two bytes - sta VERA::ADDR - lda VERA::DATA0 ; get screen code - plp -diff --git a/libsrc/cx16/cpeekrevers.s b/libsrc/cx16/cpeekrevers.s -index d67dd295..15131d34 100644 ---- a/libsrc/cx16/cpeekrevers.s -+++ b/libsrc/cx16/cpeekrevers.s -@@ -21,7 +21,7 @@ _cpeekrevers: - sta VERA::ADDR+1 ; set row number - stz VERA::ADDR+2 - lda CURS_X ; get character column -- asl a -+ asl a ; each character has two bytes - sta VERA::ADDR - lda VERA::DATA0 ; get screen code - plp -diff --git a/libsrc/cx16/cputc.s b/libsrc/cx16/cputc.s -index cf0a5fa2..11c4f578 100644 ---- a/libsrc/cx16/cputc.s -+++ b/libsrc/cx16/cputc.s -@@ -78,7 +78,7 @@ plot: ldy CURS_X - - - ; Write one screen-code and color to the video RAM without doing anything else. --; Return the x position in Y. -+; Return the x position in .Y . - - putchar: - ora RVS ; Set revers bit -@@ -90,7 +90,7 @@ putchar: - sta VERA::ADDR+2 - ldy CURS_X ; Get character column - tya -- asl a -+ asl a ; Each character has two bytes - sta VERA::ADDR - stx VERA::DATA0 - lda CHARCOLOR -diff --git a/libsrc/cx16/crt0.s b/libsrc/cx16/crt0.s -index 873fd706..bfb4de10 100644 ---- a/libsrc/cx16/crt0.s -+++ b/libsrc/cx16/crt0.s -@@ -9,7 +9,6 @@ - .import zerobss, callmain - .import CHROUT - .import __MAIN_START__, __MAIN_SIZE__ ; Linker-generated -- .importzp ST - - .include "zeropage.inc" - .include "cx16.inc" -@@ -36,11 +35,18 @@ Start: tsx - - jsr callmain - --; Back from main() [this is also the exit() entry]. Run the module destructors. -+; Back from main() [this is also the exit() entry]. -+ -+_exit: -+; Put the program return code into BASIC's status variable. -+ -+ sta STATUS -+ -+; Run the module destructors. - --_exit: pha ; Save the return code on stack - jsr donelib - -+.if 0 ; We no longer need to preserve zero-page space for cc65's variables. - ; Copy back the zero-page stuff. - - ldx #zpspace-1 -@@ -48,11 +54,7 @@ L2: lda zpsave,x - sta sp,x - dex - bpl L2 -- --; Place the program return code into BASIC's status variable. -- -- pla -- sta ST -+.endif - - ; Restore the system stuff. - -@@ -88,6 +90,7 @@ init: - lda #$00 ; Choose RAM bank zero - sta VIA1::PRA2 - -+.if 0 ; We no longer need to preserve zero-page space for cc65's variables. - ; Save the zero-page locations that we need. - - ldx #zpspace-1 -@@ -95,6 +98,7 @@ L1: lda sp,x - sta zpsave,x - dex - bpl L1 -+.endif - - ; Set up the stack. - -@@ -121,4 +125,6 @@ L1: lda sp,x - ramsave: - .res 1 - spsave: .res 1 -+.if 0 - zpsave: .res zpspace -+.endif -diff --git a/libsrc/cx16/devnum.s b/libsrc/cx16/devnum.s -deleted file mode 100644 -index 6a59d6ec..00000000 ---- a/libsrc/cx16/devnum.s -+++ /dev/null -@@ -1,8 +0,0 @@ --; --; 2010-02-14, Oliver Schmidt --; 2019-09-08, Greg King --; -- -- .include "cx16.inc" -- -- .exportzp devnum := DEVNUM -diff --git a/libsrc/cx16/exec.c b/libsrc/cx16/exec.c -new file mode 100644 -index 00000000..90af4e40 ---- /dev/null -+++ b/libsrc/cx16/exec.c -@@ -0,0 +1,122 @@ -+/* -+** Program-chaining function for Commodore platforms. -+** -+** 2019-11-08, Greg King -+** -+** This function exploits the program-chaining feature in Commander X16 BASIC's ROM. -+** -+** CC65's CBM programs have a BASIC program stub. We start those programs by -+** RUNning that stub; it SYSes to the Machine Language code. Normally, after -+** the ML code exits, the BASIC ROM continues running the stub. But, it has -+** no more statements; so, the program stops. -+** -+** This function puts the desired program's name and device number into a LOAD -+** statement. Then, it points BASIC to that statement, so that the ROM will run -+** that statement after this program quits. The ROM will load the next program, -+** and will execute it (because the LOAD will be seen in a running program). -+*/ -+ -+#include <fcntl.h> -+#include <unistd.h> -+#include <stdlib.h> -+#include <string.h> -+#include <errno.h> -+#include <device.h> -+ -+ -+/* The struct below is a line of BASIC code. It sits in the LOWCODE segment -+** to make sure that it won't be hidden by a ROM when BASIC is re-enabled. -+** The line is: -+** 0 CLR:LOAD""+"" ,01 -+** After this function has written into the line, it might look like this: -+** 0 CLR:LOAD""+"program name" ,08 -+** -+** When BASIC's LOAD command asks the Kernal to load a file, it gives the -+** Kernal a pointer to a file-name string. CC65's CBM programs use that -+** pointer to give a copy of the program's name to main()'s argv[0] parameter. -+** But, when BASIC uses a string literal that is in a program, it points -+** directly to that literal -- in the models that don't use banked RAM -+** (Pet/CBM, VIC-20, and 64). The literal is overwritten by the next program -+** that is loaded. So, argv[0] would point to machine code. String operations -+** create a new result string -- even when that operation changes nothing. The -+** result is put in the string space at the top of BASIC's memory. So, the ""+ -+** in this BASIC line guarantees that argv[0] will get a name from a safe place. -+*/ -+#pragma data-name(push, "LOWCODE") -+static struct line { -+ const char end_of_line; /* fake previous line */ -+ const struct line* const next; -+ const unsigned line_num; -+ const char CLR_token, colon, LOAD_token, quotes[2], add_token, quote; -+ char name[21]; -+ const char comma; -+ char unit[3]; -+} basic = { -+ '\0', &basic + 1, /* high byte of link must be non-zero */ -+ 0, 0x9C, ':', 0x93, "\"\"", 0xAA, '\"', -+ "\" ", /* format: "123:1234567890123456\"" */ -+ ',', "01" -+}; -+#pragma data-name(pop) -+ -+/* These values are platform-specific. */ -+extern const void* vartab; /* points to BASIC program variables */ -+extern const void* memsize; /* points to top of BASIC RAM */ -+extern const struct line* txtptr; /* points to BASIC code */ -+#pragma zpsym("txtptr") -+extern char basbuf[]; /* BASIC's input buffer */ -+extern void basbuf_len[]; -+#pragma zpsym("basbuf_len") -+ -+ -+int __fastcall__ exec (const char* progname, const char* cmdline) -+{ -+ static int fd; -+ static unsigned char dv, n; -+ -+ /* Exclude devices that can't load files. */ -+ /* (Use hand optimization, to make smaller code.) */ -+ dv = getcurrentdevice (); -+ if (dv < 8 && __AX__ != 1 || __AX__ > 30) { -+ return _mappederrno (9); /* illegal device number */ -+ } -+ utoa (dv, basic.unit, 10); -+ -+ /* Don't try to run a program that doesn't exist. */ -+ fd = open (progname, O_RDONLY); -+ if (fd < 0) { -+ return _mappederrno (4); /* file not found */ -+ } -+ close (fd); -+ -+ n = 0; -+ do { -+ if ((basic.name[n] = progname[n]) == '\0') { -+ break; -+ } -+ } while (++n < 20); /* truncate long names */ -+ basic.name[n] = '\"'; -+ -+ /* cc65 program loads might extend beyond the end of the RAM that is allowed -+ ** for BASIC. Then, the LOAD statement would complain that it is "out of -+ ** memory". Some pointers that say where to put BASIC program variables -+ ** must be changed, so that we do not get that error. One pointer is -+ ** changed here; a BASIC CLR statement changes the others. -+ */ -+ vartab = (char*)memsize - 256; -+ -+ /* Build the next program's argument list. */ -+ basbuf[0] = 0x8F; /* REM token */ -+ basbuf[1] = '\0'; -+ if (cmdline != NULL) { -+ strncat (basbuf, cmdline, (size_t)basbuf_len - 2); -+ } -+ -+ /* Tell the ROM where to find that BASIC program. */ -+ txtptr = &basic; -+ -+ /* (The return code, in STATUS, will be destroyed by LOAD. -+ ** So, don't bother to set it here.) -+ */ -+ exit (__AX__); -+} -diff --git a/libsrc/cx16/execvars.s b/libsrc/cx16/execvars.s -new file mode 100644 -index 00000000..2df647a5 ---- /dev/null -+++ b/libsrc/cx16/execvars.s -@@ -0,0 +1,16 @@ -+; -+; Platform-specific variables for the exec program-chaining function -+; -+ -+ .include "cx16.inc" -+ -+; exec() is written in C. -+; Provide the spellings that the C compiler wants to use. -+ -+.export _vartab := VARTAB -+.export _memsize := MEMSIZE -+ -+.exportzp _txtptr := TXTPTR -+ -+.export _basbuf := BASIC_BUF -+.exportzp _basbuf_len = BASIC_BUF_LEN -diff --git a/libsrc/cx16/filevars.s b/libsrc/cx16/filevars.s -new file mode 100644 -index 00000000..f3fa6466 ---- /dev/null -+++ b/libsrc/cx16/filevars.s -@@ -0,0 +1,39 @@ -+; -+; 2002-11-15, Ullrich von Bassewitz -+; 2019-11-08, Greg King -+; -+; Variables used for CBM file I/O -+; -+ -+ .export curunit -+ .constructor initcurunit, 30 -+ .destructor updatedevnum, 30 -+ -+ .include "cx16.inc" -+ -+ -+.segment "INIT" -+ -+curunit: -+ .res 1 -+ -+ -+.segment "ONCE" -+ -+.proc initcurunit -+ lda DEVNUM -+ bne L0 -+ lda #8 ; Default is SD card -+ sta DEVNUM -+L0: sta curunit -+ rts -+.endproc -+ -+ -+.code -+ -+.proc updatedevnum -+ lda curunit -+ sta DEVNUM -+ rts -+.endproc -diff --git a/libsrc/cx16/getdevice.s b/libsrc/cx16/getdevice.s -new file mode 100644 -index 00000000..9b554900 ---- /dev/null -+++ b/libsrc/cx16/getdevice.s -@@ -0,0 +1,67 @@ -+; -+; 2012-09-04, Oliver Schmidt -+; 2019-11-08, Greg King -+; -+; unsigned char getfirstdevice (void); -+; unsigned char __fastcall__ getnextdevice (unsigned char device); -+; -+ -+ .export _getfirstdevice -+ .export _getnextdevice -+ .import isdisk -+ .import opencmdchannel -+ .import closecmdchannel -+ .importzp tmp2 -+ -+ .include "cx16.inc" -+ -+;------------------------------------------------------------------------------ -+; getfirstdevice() -+ -+_getfirstdevice: -+ lda #$FF -+ ; Fall through -+ -+;------------------------------------------------------------------------------ -+; getnextdevice() -+ -+_getnextdevice: -+ tax -+next: inx -+ cpx #$FF -+ beq done -+ -+; [open|close]cmdchannel already call isdisk internally; but, they -+; interpret a non-disk as a no-op, while we need to interpret it -+; as an error here. -+ -+ jsr isdisk -+ bcs next -+ -+; [open|close]cmdchannel don't call into the Kernal, at all, if they -+; only [in|de]crement the reference count of the shared cmdchannel. -+; Therefore, we need to initiate STATUS explicitly here. -+ -+ lda #$00 -+ sta STATUS -+ -+ stx tmp2 -+ jsr opencmdchannel -+ ldx tmp2 -+ jsr closecmdchannel -+ ldx tmp2 -+ -+; As we had to reference ST above anyway, we can do so, as well, -+; here too (instead of calling READST). -+ -+ lda STATUS -+ -+; Either the Kernal calls above were successfull, or there was -+; already a cmdchannel to the device open -- which is a pretty -+; good indication of its existence. ;-) -+ -+ bmi next -+ -+done: txa -+ ldx #$00 -+ rts -diff --git a/libsrc/cx16/gotox.s b/libsrc/cx16/gotox.s -new file mode 100644 -index 00000000..1cd7c693 ---- /dev/null -+++ b/libsrc/cx16/gotox.s -@@ -0,0 +1,13 @@ -+; -+; 2019-11-06, Greg King -+; -+; void fastcall gotox (unsigned char x); -+; -+ -+ .export _gotox -+ -+ .import plot -+ .include "cx16.inc" -+ -+_gotox: sta CURS_X ; Set new position -+ jmp plot ; And activate it -diff --git a/libsrc/cx16/gotoxy.s b/libsrc/cx16/gotoxy.s -new file mode 100644 -index 00000000..1c1b60e2 ---- /dev/null -+++ b/libsrc/cx16/gotoxy.s -@@ -0,0 +1,18 @@ -+; -+; 2019-11-06, Greg King -+; -+; void fastcall gotoxy (unsigned char x, unsigned char y); -+; -+ -+ .export gotoxy, _gotoxy -+ -+ .import popa, plot -+ .include "cx16.inc" -+ -+gotoxy: jsr popa ; Get Y -+ -+_gotoxy: -+ sta CURS_Y ; Set Y -+ jsr popa ; Get X -+ sta CURS_X ; Set X -+ jmp plot ; Set the cursor position -diff --git a/libsrc/cx16/gotoy.s b/libsrc/cx16/gotoy.s -new file mode 100644 -index 00000000..487cfa79 ---- /dev/null -+++ b/libsrc/cx16/gotoy.s -@@ -0,0 +1,13 @@ -+; -+; 2019-11-06, Greg King -+; -+; void gotoy (unsigned char y); -+; -+ -+ .export _gotoy -+ -+ .import plot -+ .include "cx16.inc" -+ -+_gotoy: sta CURS_Y ; Set the new position -+ jmp plot ; And activate it -diff --git a/libsrc/cx16/joy/cx16-stdjoy.s b/libsrc/cx16/joy/cx16-std.s -similarity index 58% -rename from libsrc/cx16/joy/cx16-stdjoy.s -rename to libsrc/cx16/joy/cx16-std.s -index 8c7ddd2f..b41c6606 100644 ---- a/libsrc/cx16/joy/cx16-stdjoy.s -+++ b/libsrc/cx16/joy/cx16-std.s -@@ -1,8 +1,8 @@ - ; - ; Standard joystick driver for the CX16. --; May be used multiple times when statically linked to the application. -+; May be installed multiple times when statically linked to the application. - ; --; 2019-09-23, Greg King -+; 2019-11-15 Greg King - ; - - .include "joy-kernel.inc" -@@ -18,7 +18,7 @@ - ; ------------------------------------------------------------------------ - ; Header. Includes jump table - -- module_header _cx16_stdjoy_joy -+ module_header _cx16_std_joy - - ; Driver signature - -@@ -48,11 +48,10 @@ JOY_COUNT = 2 ; Number of joysticks we support - .code - - ; ------------------------------------------------------------------------ --; INSTALL routine. Is called after the driver is loaded into memory. -+; INSTALL routine -- is called after the driver is loaded into memory. - ; If possible, check if the hardware is present, and determine the amount - ; of memory available. --; Must return a JOY_ERR_xx code in a/x. --; -+; Must return a JOY_ERR_xx code in .XA . - - INSTALL: - lda #<JOY_ERR_OK -@@ -60,60 +59,67 @@ INSTALL: - ; rts ; Run into UNINSTALL instead - - ; ------------------------------------------------------------------------ --; UNINSTALL routine. Is called before the driver is removed from memory. --; Can do clean-up or whatever. Must not return anything. --; -+; UNINSTALL routine -- is called before the driver is removed from memory. -+; Can do clean-up or whatever. Shouldn't return anything. - - UNINSTALL: - rts - - ; ------------------------------------------------------------------------ --; COUNT: Return the total number of possible joysticks in a/x. --; -+; COUNT: Return the total number of possible joysticks, in .XA . - - COUNT: lda #<JOY_COUNT - ldx #>JOY_COUNT - rts - - ; ------------------------------------------------------------------------ --; READ: Read a particular joystick passed in A. --; --; TODO: Find a way to report the SNES controller's extra four lines. --; -+; READ: Read a particular joystick passed in .A . - --READ: pha -- jsr GETJOY -- pla -- bne pad2 -+READ: php -+ bit #JOY_COUNT - $01 -+ sei -+ bnz pad2 - - ; Read game pad 1 - --pad1: lda JOY1 + 1 -+pad1: ldy JOY1 ; Allow JOY1 to be reread between interrupts -+ sty JOY1 + 2 -+ -+ lda JOY1 + 1 - bit #%00001110 -- beq nes1 -- asl JOY1 ; Get SNES's B button -+ bze nes1 -+ -+ asl JOY1 + 2 ; Get SNES's B button - ror a ; Put it next to the A button -- asl JOY1 ; Drop SNES's Y button -- asl a ; Get the B button -- ror JOY1 -+ asl JOY1 + 2 ; Drop SNES's Y button -+ asl a ; Get back the B button -+ ror JOY1 + 2 - asl a ; Get SNES's A button -- ror JOY1 ; Make byte look like NES pad --nes1: lda JOY1 -- eor #%11111111 ; We don't want the pad's negative logic -+ ror JOY1 + 2 ; Make byte look like NES pad -+ -+nes1: lda JOY1 + 2 -+ plp -+ eor #%11111111 ; (The controllers use negative logic) - rts - - ; Read game pad 2 - --pad2: lda JOY2 + 1 -+pad2: ldy JOY2 -+ sty JOY2 + 2 -+ -+ lda JOY2 + 1 - bit #%00001110 -- beq nes2 -- asl JOY2 -+ bze nes2 -+ -+ asl JOY2 + 2 - ror a -- asl JOY2 -+ asl JOY2 + 2 - asl a -- ror JOY2 -+ ror JOY2 + 2 - asl a -- ror JOY2 --nes2: lda JOY2 -+ ror JOY2 + 2 -+ -+nes2: lda JOY2 + 2 -+ plp - eor #%11111111 - rts -diff --git a/libsrc/cx16/joy_stat_stddrv.s b/libsrc/cx16/joy_stat_stddrv.s -index 0e1a3e94..08cd2f95 100644 ---- a/libsrc/cx16/joy_stat_stddrv.s -+++ b/libsrc/cx16/joy_stat_stddrv.s -@@ -1,10 +1,11 @@ - ; - ; Address of the static standard joystick driver - ; --; 2019-09-19, Greg King -+; 2019-11-10, Greg King - ; - ; const void joy_static_stddrv[]; - ; - -- .import _cx16_stdjoy_joy -- .export _joy_static_stddrv := _cx16_stdjoy_joy -+ .import _cx16_std_joy -+ -+ .export _joy_static_stddrv := _cx16_std_joy -diff --git a/libsrc/cx16/joy_stddrv.s b/libsrc/cx16/joy_stddrv.s -index 4edf9afc..ff2f54de 100644 ---- a/libsrc/cx16/joy_stddrv.s -+++ b/libsrc/cx16/joy_stddrv.s -@@ -1,7 +1,7 @@ - ; - ; Name of the standard joystick driver - ; --; 2019-09-19, Greg King -+; 2019-11-10, Greg King - ; - ; const char joy_stddrv[]; - ; -@@ -10,4 +10,4 @@ - - .rodata - --_joy_stddrv: .asciiz "cx16-stdjoy.joy" -+_joy_stddrv: .asciiz "cx16-std.joy" -diff --git a/libsrc/cx16/joyref.s b/libsrc/cx16/joyref.s -new file mode 100644 -index 00000000..fb21918c ---- /dev/null -+++ b/libsrc/cx16/joyref.s -@@ -0,0 +1,20 @@ -+; -+; 2019-11-14, Greg King -+; -+; Link an interrupt handler if joysticks are used by a program. -+; -+ -+ .interruptor joy_libref, 9 -+ -+ .include "cbm_kernal.inc" -+ .include "cx16.inc" -+ -+ -+joy_libref: -+ lda VERA::IRQ_FLAGS -+ lsr a -+ bcc not_vsync -+ jsr GETJOY ; Bit-bang game controllers -+ clc ; Let other Jiffy handlers run -+not_vsync: -+ rts -diff --git a/libsrc/cx16/kbhit.s b/libsrc/cx16/kbhit.s -index 8ceba64b..a73533e2 100644 ---- a/libsrc/cx16/kbhit.s -+++ b/libsrc/cx16/kbhit.s -@@ -1,5 +1,5 @@ - ; --; 2019-09-20, Greg King -+; 2019-11-06, Greg King - ; - ; unsigned char kbhit (void); - ; /* Returns non-zero (true) if a typed character is waiting. */ -@@ -11,7 +11,7 @@ - - - .proc _kbhit -- ldx #>$0000 ; High byte of return - lda KEY_COUNT ; Get number of characters -- rts -+ tax ; High byte of return (only its zero/nonzero ... -+ rts ; ... state matters) - .endproc -diff --git a/libsrc/cx16/kernal.s b/libsrc/cx16/kernal.s -index faf91385..97443c82 100644 ---- a/libsrc/cx16/kernal.s -+++ b/libsrc/cx16/kernal.s -@@ -1,5 +1,5 @@ - ; --; 2019-09-22, Greg King -+; 2019-11-05, Greg King - ; - ; CX16 Kernal functions - ; -@@ -7,9 +7,10 @@ - .include "cbm_kernal.inc" - - .export GETJOY -+ .export MOUSE -+ .export SCRMOD - - .export CLSALL -- .export SWAPPER - .export JSRFAR - .export INDFET - .export INDSTA -diff --git a/libsrc/cx16/libref.s b/libsrc/cx16/libref.s -index 54ebb91d..0d85c7cd 100644 ---- a/libsrc/cx16/libref.s -+++ b/libsrc/cx16/libref.s -@@ -1,10 +1,9 @@ - ; - ; 2013-05-31, Oliver Schmidt --; 2019-09-22, Greg King -+; 2019-11-14, Greg King - ; - - .export em_libref -- .export joy_libref - .export mouse_libref - .export ser_libref - .export tgi_libref -@@ -12,7 +11,6 @@ - .import _exit - - em_libref := _exit --joy_libref := _exit - mouse_libref := _exit - ser_libref := _exit - tgi_libref := _exit -diff --git a/libsrc/cx16/mainargs.s b/libsrc/cx16/mainargs.s -index fe4a071c..1764b5e2 100644 ---- a/libsrc/cx16/mainargs.s -+++ b/libsrc/cx16/mainargs.s -@@ -33,7 +33,7 @@ REM = $8f ; BASIC token-code - NAME_LEN = 16 ; Maximum length of command-name - - ; Get possible command-line arguments. Goes into the special ONCE segment, --; which may be reused after the startup code is run -+; which may be reused after the startup code is run. - - .segment "ONCE" - -@@ -64,7 +64,7 @@ L2: lda BASIC_BUF,x - bne L2 - ldy #1 * 2 - --; Find the next argument -+; Find the next argument. - - next: lda BASIC_BUF,x - beq done ; End of line reached -@@ -74,7 +74,7 @@ next: lda BASIC_BUF,x - - ; Found start of next argument. We've incremented the pointer in X already, so - ; it points to the second character of the argument. This is useful since we --; will check now for a quoted argument, in which case we will have to skip this -+; will check now for a quoted argument, in which case, we will have to skip this - ; first character. - - found: cmp #'"' ; Is the argument quoted? -@@ -95,7 +95,7 @@ setterm:sta term ; Set end of argument marker - iny - inc __argc ; Found another arg - --; Search for the end of the argument -+; Search for the end of the argument. - - argloop:lda BASIC_BUF,x - beq done -diff --git a/libsrc/cx16/set_tv.s b/libsrc/cx16/set_tv.s -index 0cf49aff..8b802f32 100644 ---- a/libsrc/cx16/set_tv.s -+++ b/libsrc/cx16/set_tv.s -@@ -1,5 +1,5 @@ - ; --; 2019-09-20, Greg King -+; 2019-11-06, Greg King - ; - ; void __fastcall__ set_tv (unsigned char); - ; /* Set the video mode the machine will use. */ -@@ -12,20 +12,18 @@ - - .proc _set_tv - php -- pha - sei ; Don't let interrupts interfere - - ; Point to the video output register. - - stz VERA::CTRL ; Use port 0 -- lda #<VERA::COMPOSER::VIDEO -- ldx #>VERA::COMPOSER::VIDEO -- ldy #^VERA::COMPOSER::VIDEO -- sta VERA::ADDR -- stx VERA::ADDR+1 -- sty VERA::ADDR+2 -+ ldx #<VERA::COMPOSER::VIDEO -+ ldy #>VERA::COMPOSER::VIDEO -+ stx VERA::ADDR -+ sty VERA::ADDR+1 -+ ldx #^VERA::COMPOSER::VIDEO -+ stx VERA::ADDR+2 - -- pla - sta VERA::DATA0 - plp ; Re-enable interrupts - rts -diff --git a/libsrc/cx16/status.s b/libsrc/cx16/status.s -index 6292dc27..e3446637 100644 ---- a/libsrc/cx16/status.s -+++ b/libsrc/cx16/status.s -@@ -1,6 +1,16 @@ - ; --; 2012-09-30, Oliver Schmidt --; 2019-09-08, Greg King -+; 2019-11-05, Greg King - ; - -- .exportzp ST := $90 ; IEC status byte -+ .export ST: zp -+ -+.segment "EXTZP": zp -+ -+; This is a temporary hack. -+ -+; A zero-page copy of the IEC status byte. -+; This is needed because the Commander X16's Kernal's status -+; variable was moved out of the zero page. But, the common -+; CBM file function modules import this as a zero-page variable. -+ -+ST: .res 1 -diff --git a/libsrc/cx16/tgi_stat_stddrv.s b/libsrc/cx16/tgi_stat_stddrv.s -new file mode 100644 -index 00000000..566a3639 ---- /dev/null -+++ b/libsrc/cx16/tgi_stat_stddrv.s -@@ -0,0 +1,11 @@ -+; -+; Address of the static standard TGI driver -+; -+; 2019-11-06, Greg King -+; -+; const void tgi_static_stddrv[]; -+; -+ -+ .import _cx16_640x4c_tgi -+ -+ .export _tgi_static_stddrv := _cx16_640x4c_tgi -diff --git a/libsrc/cx16/tgi_stddrv.s b/libsrc/cx16/tgi_stddrv.s -new file mode 100644 -index 00000000..0f77e734 ---- /dev/null -+++ b/libsrc/cx16/tgi_stddrv.s -@@ -0,0 +1,13 @@ -+; -+; Name of the standard TGI driver -+; -+; 2019-11-06, Greg King -+; -+; const char tgi_stddrv[]; -+; -+ -+ .export _tgi_stddrv -+ -+.rodata -+ -+_tgi_stddrv: .asciiz "cx16-640x4c.tgi" -diff --git a/libsrc/cx16/videomode.s b/libsrc/cx16/videomode.s -index 4582ec1b..e3a777b8 100644 ---- a/libsrc/cx16/videomode.s -+++ b/libsrc/cx16/videomode.s -@@ -1,30 +1,44 @@ - ; --; 2009-09-07, Ullrich von Bassewitz --; 2019-09-23, Greg King -+; 2019-11-06, Greg King - ; --; unsigned __fastcall__ videomode (unsigned Mode); --; /* Set the video mode, return the old mode. */ -+; /* Video mode defines */ -+; #define VIDEOMODE_40x30 0x00 -+; #define VIDEOMODE_80x60 0x02 -+; #define VIDEOMODE_320x240 0x80 -+; #define VIDEOMODE_SWAP (-1) -+; -+; signed char __fastcall__ videomode (signed char Mode); -+; /* Set the video mode, return the old mode. -+; ** Return -1 if Mode isn't valid. -+; ** Call with one of the VIDEOMODE_xx constants. -+; */ - ; - - .export _videomode -- .import SWAPPER - -- .include "cx16.inc" -+ .import SCRMOD - - - .proc _videomode -- cmp LLEN ; Do we have this mode already? -- beq @L9 -- -- lda LLEN ; Get current mode ... -- pha ; ... and save it -- -- jsr SWAPPER ; Toggle the mode -- -- pla ; Get old mode into A -+ tax -+ clc ; (Get old mode) -+ jsr SCRMOD -+ pha -+ txa -+ -+ sec ; (Set new mode) -+ jsr SCRMOD -+ -+ pla ; Get back old mode -+ bcs @L1 -+ ldx #>$0000 ; Clear high byte -+ rts - --; Done, old mode is in .A -+; The new mode is invalid. Go back to the old mode. Return -1. - --@L9: ldx #>$0000 ; Clear high byte -+@L1: sec -+ jsr SCRMOD -+ lda #<-1 -+ tax - rts - .endproc -diff --git a/libsrc/cx16/waitvsync.s b/libsrc/cx16/waitvsync.s -index 3fb6354f..09d01c6a 100644 ---- a/libsrc/cx16/waitvsync.s -+++ b/libsrc/cx16/waitvsync.s -@@ -3,7 +3,7 @@ - ; - ; void waitvsync (void); - ; --; VERA's vertical sync. causes IRQs which increment the jiffy clock. -+; VERA's vertical sync causes IRQs which increment the jiffy clock. - ; - - .export _waitvsync -diff --git a/libsrc/cx16/wherex.s b/libsrc/cx16/wherex.s -new file mode 100644 -index 00000000..56f42359 ---- /dev/null -+++ b/libsrc/cx16/wherex.s -@@ -0,0 +1,15 @@ -+; -+; 2019-11-06, Greg King -+; -+; unsigned char wherex (void); -+; -+ -+ .export _wherex -+ -+ .include "cx16.inc" -+ -+.proc _wherex -+ lda CURS_X -+ ldx #>$0000 -+ rts -+.endproc -diff --git a/libsrc/cx16/wherey.s b/libsrc/cx16/wherey.s -new file mode 100644 -index 00000000..396a2d14 ---- /dev/null -+++ b/libsrc/cx16/wherey.s -@@ -0,0 +1,15 @@ -+; -+; 2019-11-06, Greg King -+; -+; unsigned char wherey (void); -+; -+ -+ .export _wherey -+ -+ .include "cx16.inc" -+ -+.proc _wherey -+ lda CURS_Y -+ ldx #>$0000 -+ rts -+.endproc --- -2.26.0 - diff --git a/0096-Added-a-standard-mouse-driver-to-the-cx16-library.patch b/0096-Added-a-standard-mouse-driver-to-the-cx16-library.patch deleted file mode 100644 index b339129..0000000 --- a/0096-Added-a-standard-mouse-driver-to-the-cx16-library.patch +++ /dev/null @@ -1,498 +0,0 @@ -From 5da525e0ea10987d9dbf1ad2ba5bad9548d23f59 Mon Sep 17 00:00:00 2001 -From: Greg King <gregdk@users.sf.net> -Date: Sat, 16 Nov 2019 14:51:24 -0500 -Subject: [PATCH 096/170] Added a standard mouse driver to the cx16 library. - ---- - doc/cx16.sgml | 9 +- - include/cx16.h | 9 +- - libsrc/cx16/mcbdefault.s | 65 +++++++ - libsrc/cx16/mou/cx16-std.s | 310 ++++++++++++++++++++++++++++++++ - libsrc/cx16/mouse_stat_stddrv.s | 11 ++ - libsrc/cx16/mouse_stddrv.s | 13 ++ - 6 files changed, 415 insertions(+), 2 deletions(-) - create mode 100644 libsrc/cx16/mcbdefault.s - create mode 100644 libsrc/cx16/mou/cx16-std.s - create mode 100644 libsrc/cx16/mouse_stat_stddrv.s - create mode 100644 libsrc/cx16/mouse_stddrv.s - -diff --git a/doc/cx16.sgml b/doc/cx16.sgml -index 16e43db9..7189e715 100644 ---- a/doc/cx16.sgml -+++ b/doc/cx16.sgml -@@ -236,7 +236,14 @@ point to <tt/cX16-std.joy (cx16_std_joy)/. - - <sect1>Mouse drivers<p> - --No mouse drivers are available currently for the CX16. -+The default drivers, <tt/mouse_stddrv (mouse_static_stddrv)/, -+point to <tt/cX16-std.mou (cx16_std_mou)/. -+ -+<descrip> -+ <tag><tt/cX16-std.mou (cX16_std_mou)/</tag> -+ Supports a standard 3-button mouse connected to the PS/2 mouse port of the -+ Commander X16. -+</descrip><p> - - - <sect1>RS232 device drivers<p> -diff --git a/include/cx16.h b/include/cx16.h -index a6f1b78f..b465378a 100644 ---- a/include/cx16.h -+++ b/include/cx16.h -@@ -115,7 +115,7 @@ - #define TV_NTSC_MONO 6 - #define TV_RGB2 7 - --/* Video mode defines */ -+/* Video modes */ - #define VIDEOMODE_40x30 0x00 - #define VIDEOMODE_80x60 0x02 - #define VIDEOMODE_40COL VIDEOMODE_40x30 -@@ -123,6 +123,12 @@ - #define VIDEOMODE_320x240 0x80 - #define VIDEOMODE_SWAP (-1) - -+/* VERA's interrupt flags */ -+#define VERA_IRQ_VSYNC 0b00000001 -+#define VERA_IRQ_RASTER 0b00000010 -+#define VERA_IRQ_SPR_COLL 0b00000100 -+#define VERA_IRQ_UART 0b00001000 -+ - - /* Define hardware */ - -@@ -163,6 +169,7 @@ struct __emul { - /* The addresses of the static drivers */ - - extern void cx16_std_joy[]; /* Referred to by joy_static_stddrv[] */ -+extern void cx16_std_mou[]; /* Referred to by mouse_static_stddrv[] */ - - - -diff --git a/libsrc/cx16/mcbdefault.s b/libsrc/cx16/mcbdefault.s -new file mode 100644 -index 00000000..d817b9ae ---- /dev/null -+++ b/libsrc/cx16/mcbdefault.s -@@ -0,0 +1,65 @@ -+; -+; Default mouse callbacks for the CX16 -+; -+; 2019-11-09, Greg King -+; -+; All functions in this module should be interrupt safe -+; because they might be called from an interrupt handler. -+; -+ -+ .export _mouse_def_callbacks -+ -+ .include "cbm_kernal.inc" -+ .include "cx16.inc" -+ -+; -------------------------------------------------------------------------- -+; Hide the mouse pointer. Always called with interrupts disabled. -+ -+.code -+ -+hide: ldx #$00 ; Don't change sprite's scale -+ lda #$00 ; Disable sprite -+ jmp MOUSE -+ -+; -------------------------------------------------------------------------- -+; Show the mouse pointer. Always called with interrupts disabled. -+ -+show: ldx #$00 -+ lda #<-$01 ; Enable sprite -+ jmp MOUSE -+ -+; -------------------------------------------------------------------------- -+; Prepare to move the mouse pointer. Always called with interrupts disabled. -+ -+prep: ; Fall through -+ -+; -------------------------------------------------------------------------- -+; Draw the mouse pointer. Always called with interrupts disabled. -+ -+draw: ; Fall through -+ -+; -------------------------------------------------------------------------- -+; Move the mouse pointer X position to the value in .XA . Always called with -+; interrupts disabled. -+ -+movex: ; Already set by drivers -+ ; Fall through -+ -+; -------------------------------------------------------------------------- -+; Move the mouse pointer Y position to the value in .XA . Always called with -+; interrupts disabled. -+ -+movey: rts ; Already set by drivers -+ -+; -------------------------------------------------------------------------- -+; Callback structure -+ -+.rodata -+ -+_mouse_def_callbacks: -+ .addr hide -+ .addr show -+ .addr prep -+ .addr draw -+ .addr movex -+ .addr movey -diff --git a/libsrc/cx16/mou/cx16-std.s b/libsrc/cx16/mou/cx16-std.s -new file mode 100644 -index 00000000..eb3f8316 ---- /dev/null -+++ b/libsrc/cx16/mou/cx16-std.s -@@ -0,0 +1,310 @@ -+; -+; Driver for the Commander X16 Kernal's mouse driver. -+; -+; 2019-11-16, Greg King -+; -+ -+ .include "zeropage.inc" -+ .include "mouse-kernel.inc" -+ .include "cx16.inc" -+ .include "cbm_kernal.inc" -+ -+ .macpack module -+ -+ -+; ------------------------------------------------------------------------ -+; Header. Includes jump table -+ -+ module_header _cx16_std_mou -+ -+HEADER: -+ -+; Driver signature -+ -+ .byte $6d, $6f, $75 ; ASCII "mou" -+ .byte MOUSE_API_VERSION ; Mouse driver API version number -+ -+; Library reference -+ -+ .addr $0000 -+ -+; Jump table -+ -+ .addr INSTALL -+ .addr UNINSTALL -+ .addr HIDE -+ .addr SHOW -+ .addr SETBOX -+ .addr GETBOX -+ .addr MOVE -+ .addr BUTTONS -+ .addr POS -+ .addr INFO -+ .addr IOCTL -+ .addr IRQ -+ -+; Mouse driver flags -+ -+ .byte $00 ; Don't need interrupts -+ -+; Callback table, set by the mouse kernel before INSTALL is called -+ -+CHIDE: jmp $0000 ; Hide the cursor -+CSHOW: jmp $0000 ; Show the cursor -+CPREP: jmp $0000 ; Prepare to move the cursor -+CDRAW: jmp $0000 ; Draw the cursor -+CMOVEX: jmp $0000 ; Move the cursor to X coord -+CMOVEY: jmp $0000 ; Move the cursor to Y coord -+ -+ -+;---------------------------------------------------------------------------- -+; Constants -+ -+SCREEN_WIDTH = 640 - 1 ; (origin is zero) -+SCREEN_HEIGHT = 480 - 1 -+ -+;---------------------------------------------------------------------------- -+; Global variables. -+ -+.bss -+ -+XPos := MOUSEX ; Current mouse position, X -+YPos := MOUSEY ; Current mouse position, Y -+ -+XMin := MOUSEL ; X1 value of bounding box -+XMax := MOUSER ; X2 value of bounding box -+YMin := MOUSET ; Y1 value of bounding box -+YMax := MOUSEB ; Y2 value of bounding box -+Box := XMin -+ -+Buttons := MOUSEBT ; button status bits -+ -+.rodata -+ -+; Default values for above variables -+; (We use ".proc" because we want to define both a label and a scope.) -+ -+.proc DefBox -+ .word 0 ; XMin -+ .word SCREEN_WIDTH ; XMax -+ .word 0 ; YMin -+ .word SCREEN_HEIGHT ; YMax -+.endproc -+ -+; These button masks are compatible with the CBM 1351 and the CMD SmartMouse. -+ -+ButtMask: -+ .byte %00000000 ; No buttons -+ .byte %00010000 ; Left -+ .byte %00000001 ; Right -+ .byte %00010001 ; Left, right -+ .byte %00000010 ; Middle -+ .byte %00010010 ; Left, middle -+ .byte %00000011 ; Middle, right -+ .byte %00010011 ; Left, middle, right -+ -+.code -+ -+;---------------------------------------------------------------------------- -+; INSTALL routine. Is called after the driver is loaded into memory. -+; If possible, check if the hardware is present. -+; Must return a MOUSE_ERR_xx code in .XA . -+ -+INSTALL: -+ -+; Initialize variables. Just copy the default stuff over. -+ -+ ldx #.sizeof(DefBox) - 1 -+@L1: lda DefBox,x -+ sta Box,x -+ dex -+ bpl @L1 -+ -+ ldx #$00 ; Don't change sprite's scale -+ lda #$01 ; Initiate and show sprite -+ jsr MOUSE -+ -+; Be sure the mouse cursor is invisible, and at the default location. We -+; need to do that here, because the mouse interrupt handler might not set -+; the mouse position if it hasn't changed. -+ -+ sei -+ jsr CHIDE -+ lda XPos -+ ldx XPos+1 -+ jsr CMOVEX -+ lda YPos -+ ldx YPos+1 -+ jsr CMOVEY -+ cli -+ -+; Done, return zero -+ -+ ldx #>MOUSE_ERR_OK -+ txa -+ rts -+ -+;---------------------------------------------------------------------------- -+; UNINSTALL routine -- is called before the driver is removed from memory. -+; No return code required (the driver is removed from memory on return). -+ -+UNINSTALL := HIDE ; Hide cursor on exit -+ -+;---------------------------------------------------------------------------- -+; HIDE routine -- is called to hide the mouse pointer. The mouse kernel manages -+; a counter for calls to show/hide, and the driver entry point is called only -+; if the mouse currently is visible, and should get hidden. For most drivers, -+; no special action is required besides disabling the mouse cursor. -+; No return code required. -+ -+HIDE: jmp CHIDE -+ -+;---------------------------------------------------------------------------- -+; SHOW routine -- is called to show the mouse pointer. The mouse kernel manages -+; a counter for calls to show/hide, and the driver entry point is called only -+; if the mouse currently is hidden, and should become visible. For most drivers, -+; no special action is required besides enabling the mouse cursor. -+; No return code required. -+ -+SHOW: jmp CSHOW -+ -+;---------------------------------------------------------------------------- -+; SETBOX: Set the mouse bounding box. The parameters are passed as they come -+; from the C program, that is, a pointer to a mouse_box struct in .XA . -+; No checks are done if the mouse is currently inside the box, that is the job -+; of the caller. It is not necessary to validate the parameters, trust the -+; caller, and save some code here. No return code required. -+ -+SETBOX: sta ptr1 -+ stx ptr1+1 ; Save data pointer -+ -+ lda (ptr1) -+ ldy #$01 -+ -+ sei -+ sta XMin -+ lda (ptr1),y -+ sta YMin -+ iny -+ lda (ptr1),y -+ sta XMax -+ iny -+ lda (ptr1),y -+ sta YMax -+ cli -+ -+ rts -+ -+;---------------------------------------------------------------------------- -+; GETBOX: Return the mouse bounding box. The parameters are passed as they -+; come from the C program, that is, a pointer to a mouse_box struct in .XA . -+ -+GETBOX: sta ptr1 -+ stx ptr1+1 ; Save data pointer -+ -+ lda XMin -+ sta (ptr1) -+ ldy #$01 -+ lda YMin -+ sta (ptr1),y -+ iny -+ lda XMax -+ sta (ptr1),y -+ iny -+ lda YMax -+ sta (ptr1),y -+ rts -+ -+;---------------------------------------------------------------------------- -+; MOVE: Put the mouse at a new position. That position is passed as it comes -+; from the C program, that is: X on the stack and Y in .XA . The C wrapper -+; will remove the parameter from the stack, on return. -+; No checks are done to see if the new position is valid (within -+; the bounding box or the screen). No return code required. -+ -+MOVE: sei ; No interrupts -+ -+ sta YPos -+ stx YPos+1 ; New Y position -+ jsr CMOVEY ; Set it -+ -+ ldy #$01 -+ lda (sp),y -+ sta XPos+1 -+ tax -+ dey -+ lda (sp),y -+ sta XPos ; New X position -+ jsr CMOVEX ; Move the cursor -+ -+ cli ; Allow interrupts -+ rts -+ -+;---------------------------------------------------------------------------- -+; BUTTONS: Return the CBM 1351 button mask in .XA . -+ -+BUTTONS: -+ lda Buttons -+ and #%00000111 -+ tax -+ lda ButtMask,x -+ ldx #>$0000 -+ rts -+ -+;---------------------------------------------------------------------------- -+; POS: Return the mouse position in the MOUSE_POS struct pointed to by ptr1. -+; No return code required. -+ -+POS: ldy #MOUSE_POS::XCOORD ; Structure offset -+ -+ sei ; Disable interrupts -+ lda XPos ; Transfer the position -+ sta (ptr1),y -+ lda XPos+1 -+ iny -+ sta (ptr1),y -+ lda YPos -+ iny -+ sta (ptr1),y -+ lda YPos+1 -+ cli ; Enable interrupts -+ -+ iny -+ sta (ptr1),y ; Store last byte -+ rts ; Done -+ -+;---------------------------------------------------------------------------- -+; INFO: Returns mouse position and current button mask in the MOUSE_INFO -+; struct pointed to by ptr1. No return code required. -+; -+; We're cheating here to keep the code smaller: The first fields of the -+; mouse_info struct are identical to the mouse_pos struct; so, we just will -+; call mouse_pos to initialize the struct pointer, and fill the position -+; fields. -+ -+INFO: jsr POS -+ -+; Fill in the button state -+ -+ jsr BUTTONS ; Will not touch ptr1 -+ ldy #MOUSE_INFO::BUTTONS -+ sta (ptr1),y -+ rts -+ -+;---------------------------------------------------------------------------- -+; IOCTL: Driver defined entry point. The wrapper will pass a pointer to ioctl -+; specific data in ptr1, and the ioctl code in A. -+; Must return an error code in .XA . -+; -+ -+IOCTL: lda #<MOUSE_ERR_INV_IOCTL ; We don't support ioctls, for now -+ ldx #>MOUSE_ERR_INV_IOCTL -+; rts ; Fall through -+ -+;---------------------------------------------------------------------------- -+; IRQ: Irq handler entry point. Called as a subroutine but in IRQ context -+; (so be careful). The routine MUST return carry set if the interrupt has been -+; 'handled' -- which means that the interrupt source is gone. Otherwise, it -+; MUST return carry clear. -+ -+IRQ: rts ; Kernal ROM does this routine's job -diff --git a/libsrc/cx16/mouse_stat_stddrv.s b/libsrc/cx16/mouse_stat_stddrv.s -new file mode 100644 -index 00000000..1ff8ad43 ---- /dev/null -+++ b/libsrc/cx16/mouse_stat_stddrv.s -@@ -0,0 +1,11 @@ -+; -+; Address of the static standard mouse driver -+; -+; 2019-11-08,Greg King -+; -+; const void mouse_static_stddrv[]; -+; -+ -+ .import _cx16_std_mou -+ -+ .export _mouse_static_stddrv := _cx16_std_mou -diff --git a/libsrc/cx16/mouse_stddrv.s b/libsrc/cx16/mouse_stddrv.s -new file mode 100644 -index 00000000..d708bb66 ---- /dev/null -+++ b/libsrc/cx16/mouse_stddrv.s -@@ -0,0 +1,13 @@ -+; -+; Name of the standard mouse driver -+; -+; 2019-11-08, Greg King -+; -+; const char mouse_stddrv[]; -+; -+ -+ .export _mouse_stddrv -+ -+.rodata -+ -+_mouse_stddrv: .asciiz "cx16-std.mou" --- -2.26.0 - diff --git a/0097-Fix-silent-crash-failure-on-warning-from-linker-comm.patch b/0097-Fix-silent-crash-failure-on-warning-from-linker-comm.patch deleted file mode 100644 index dabee6d..0000000 --- a/0097-Fix-silent-crash-failure-on-warning-from-linker-comm.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 788fbcc9c8cdd88ecaf6baacef9cd347e406b0fd Mon Sep 17 00:00:00 2001 -From: bbbradsmith <bbbradsmith@users.noreply.github.com> -Date: Sun, 17 Nov 2019 03:45:32 -0500 -Subject: [PATCH 097/170] Fix silent crash failure on warning from linker - command line define import size mismatch - ---- - src/ld65/exports.c | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/src/ld65/exports.c b/src/ld65/exports.c -index b83d8b49..be14f748 100644 ---- a/src/ld65/exports.c -+++ b/src/ld65/exports.c -@@ -694,10 +694,15 @@ static void CheckSymType (const Export* E) - GetString (E->Obj->Name), - GetSourceName (ExportLI), - GetSourceLine (ExportLI)); -- } else { -+ } else if (ExportLI) { - SB_Printf (&ExportLoc, "%s(%u)", - GetSourceName (ExportLI), - GetSourceLine (ExportLI)); -+ } else { -+ /* The export is linker generated and we don't have line -+ ** information (likely from command line define) -+ */ -+ SB_Printf (&ExportLoc, "linker"); - } - if (I->Obj) { - /* The import comes from an object file */ --- -2.26.0 - diff --git a/0098-make-linker-generated-export-warning-conistent-with-.patch b/0098-make-linker-generated-export-warning-conistent-with-.patch deleted file mode 100644 index b8fafa2..0000000 --- a/0098-make-linker-generated-export-warning-conistent-with-.patch +++ /dev/null @@ -1,26 +0,0 @@ -From c9355734f5acce3c06553d7b7b7ddbda50a7b495 Mon Sep 17 00:00:00 2001 -From: bbbradsmith <bbbradsmith@users.noreply.github.com> -Date: Mon, 18 Nov 2019 01:37:26 -0500 -Subject: [PATCH 098/170] make linker generated export warning conistent with - the import warning - ---- - src/ld65/exports.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/ld65/exports.c b/src/ld65/exports.c -index be14f748..5df7a37c 100644 ---- a/src/ld65/exports.c -+++ b/src/ld65/exports.c -@@ -702,7 +702,7 @@ static void CheckSymType (const Export* E) - /* The export is linker generated and we don't have line - ** information (likely from command line define) - */ -- SB_Printf (&ExportLoc, "linker"); -+ SB_Printf (&ExportLoc, "%s", GetObjFileName (E->Obj)); - } - if (I->Obj) { - /* The import comes from an object file */ --- -2.26.0 - diff --git a/0099-Replaced-plain-0-s-and-1-s-in-exit-statements-with-E.patch b/0099-Replaced-plain-0-s-and-1-s-in-exit-statements-with-E.patch deleted file mode 100644 index 6ebe0fd..0000000 --- a/0099-Replaced-plain-0-s-and-1-s-in-exit-statements-with-E.patch +++ /dev/null @@ -1,140 +0,0 @@ -From 7bae9038cfc1ff25a6845c050a4a0d6a98fd47a9 Mon Sep 17 00:00:00 2001 -From: mc78 <mc78@outlook.de> -Date: Mon, 11 Nov 2019 16:30:09 +0100 -Subject: [PATCH 099/170] Replaced plain 0's and 1's in exit statements with - EXIT_SUCCESS or EXIT_FAILURE - ---- - samples/geos/getid.c | 2 +- - samples/geos/hello1.c | 2 +- - samples/geos/hello2.c | 2 +- - test/ref/hanoi.c | 2 +- - test/ref/wf1.c | 2 +- - testcode/lib/getopt-test.c | 6 ++++-- - testcode/lib/shift-test.c | 6 +++--- - 7 files changed, 12 insertions(+), 10 deletions(-) - -diff --git a/samples/geos/getid.c b/samples/geos/getid.c -index 4331e27e..200a1478 100644 ---- a/samples/geos/getid.c -+++ b/samples/geos/getid.c -@@ -16,7 +16,7 @@ const graphicStr Table = { - - void Exit(void) - { -- exit(0); -+ exit(EXIT_SUCCESS); - } - - void Menu = { -diff --git a/samples/geos/hello1.c b/samples/geos/hello1.c -index fd46d157..8dc13d5b 100644 ---- a/samples/geos/hello1.c -+++ b/samples/geos/hello1.c -@@ -26,7 +26,7 @@ void main (void) - // MainLoop(); - // we can do: - // (nothing as this is the end of main function) -- // exit(0); -+ // exit(EXIT_SUCCESS); - // return; - - return; -diff --git a/samples/geos/hello2.c b/samples/geos/hello2.c -index d41bdb3c..3f148b0b 100644 ---- a/samples/geos/hello2.c -+++ b/samples/geos/hello2.c -@@ -44,7 +44,7 @@ void main (void) - // MainLoop(); - // we can do: - // (nothing as this is the end of main function) -- // exit(0); -+ // exit(EXIT_SUCCESS); - // return; - - return; -diff --git a/test/ref/hanoi.c b/test/ref/hanoi.c -index 5198c5c6..14bc60fa 100644 ---- a/test/ref/hanoi.c -+++ b/test/ref/hanoi.c -@@ -62,7 +62,7 @@ int main(int argc,char **argv) - #ifdef USECMDLINE - if (argc < 2) { - printf("Usage: %s [duration] [disks]\n", argv[0]); -- exit(1); -+ exit(EXIT_FAILURE); - } - else - { -diff --git a/test/ref/wf1.c b/test/ref/wf1.c -index 1c3bfbd3..e1ed7a41 100644 ---- a/test/ref/wf1.c -+++ b/test/ref/wf1.c -@@ -45,7 +45,7 @@ err(s) char *s; { - int err(char *s) { - #endif - printf("? %s\n", s); -- exit(1); -+ exit(EXIT_FAILURE); - } - - /* getword - get next input word into buf, return 0 on EOF */ -diff --git a/testcode/lib/getopt-test.c b/testcode/lib/getopt-test.c -index 2f115541..b5639b7c 100644 ---- a/testcode/lib/getopt-test.c -+++ b/testcode/lib/getopt-test.c -@@ -22,6 +22,8 @@ - #define BADCH '?' - #define ENDARGS "--" - -+#define NUMARGS 2 -+ - int main (int argc, char **argv) - { - char *optstring = argv[1]; -@@ -34,9 +36,9 @@ int main (int argc, char **argv) - - char *opi; - -- if (argc == 1) { -+ if (argc != NUMARGS) { - fprintf (stderr, "Usage: %s optstring args\n", argv0); -- exit (1); -+ exit (EXIT_FAILURE); - } - argv++; - argc--; -diff --git a/testcode/lib/shift-test.c b/testcode/lib/shift-test.c -index 5712f453..27c7d88a 100644 ---- a/testcode/lib/shift-test.c -+++ b/testcode/lib/shift-test.c -@@ -58,7 +58,7 @@ static void TestUnsignedLeftShift (void) - fprintf (stderr, - "Failed: %u << %u != %u (%u)\n", - L, R, V, L << R); -- exit (1); -+ exit (EXIT_FAILURE); - } - V = UnsignedShiftLeft1 (V); - } -@@ -85,7 +85,7 @@ static void TestUnsignedRightShift (void) - fprintf (stderr, - "Failed: %u >> %u != %u (%u)\n", - L, R, V, L >> R); -- exit (1); -+ exit (EXIT_FAILURE); - } - V = UnsignedShiftRight1 (V); - } -@@ -112,7 +112,7 @@ static void TestSignedRightShift (void) - fprintf (stderr, - "Failed: %d >> %d != %d (%d)\n", - L, R, V, L >> R); -- exit (1); -+ exit (EXIT_FAILURE); - } - V = SignedShiftRight1 (V); - } --- -2.26.0 - diff --git a/0100-Added-enum-for-cc65-exit-codes.-replaced-stdlib-exit.patch b/0100-Added-enum-for-cc65-exit-codes.-replaced-stdlib-exit.patch deleted file mode 100644 index 1faf0e0..0000000 --- a/0100-Added-enum-for-cc65-exit-codes.-replaced-stdlib-exit.patch +++ /dev/null @@ -1,129 +0,0 @@ -From 3daecfb3dd357047e12bdd002ab114bbeb29c85d Mon Sep 17 00:00:00 2001 -From: mc78 <mc78@outlook.de> -Date: Tue, 12 Nov 2019 13:08:33 +0100 -Subject: [PATCH 100/170] Added enum for cc65 exit codes. replaced stdlib exit - code names constants in libsrc with cc65 exit code named constants - ---- - include/cc65.h | 6 ++++++ - libsrc/common/_afailed.c | 2 +- - libsrc/common/abort.c | 2 +- - libsrc/dbg/dbg.c | 2 +- - libsrc/geos-apple/targetutil/convert.c | 5 +++-- - libsrc/geos-common/common/_afailed.c | 2 +- - libsrc/geos-common/common/abort.c | 3 ++- - 7 files changed, 15 insertions(+), 7 deletions(-) - -diff --git a/include/cc65.h b/include/cc65.h -index 7e9c2cae..99a8665c 100644 ---- a/include/cc65.h -+++ b/include/cc65.h -@@ -36,6 +36,12 @@ - #ifndef _CC65_H - #define _CC65_H - -+typedef enum { -+ CC65_EXIT_SUCCESS, -+ CC65_EXIT_FAILURE, -+ CC65_EXIT_AFAILED, -+ CC65_EXIT_ABORT -+} cc65_exit_codes_t; - - - /*****************************************************************************/ -diff --git a/libsrc/common/_afailed.c b/libsrc/common/_afailed.c -index ed93fc12..654025e1 100644 ---- a/libsrc/common/_afailed.c -+++ b/libsrc/common/_afailed.c -@@ -17,5 +17,5 @@ void __fastcall__ _afailed (char* file, unsigned line) - { - raise (SIGABRT); - fprintf (stderr, "ASSERTION FAILED IN %s(%u)\n", file, line); -- exit (2); -+ exit (CC65_EXIT_AFAILED); - } -diff --git a/libsrc/common/abort.c b/libsrc/common/abort.c -index 43ad676a..e59adb7d 100644 ---- a/libsrc/common/abort.c -+++ b/libsrc/common/abort.c -@@ -16,7 +16,7 @@ void abort (void) - { - raise (SIGABRT); - fputs ("ABNORMAL PROGRAM TERMINATION\n", stderr); -- exit (3); -+ exit (CC65_EXIT_ABORT); - } - - -diff --git a/libsrc/dbg/dbg.c b/libsrc/dbg/dbg.c -index 60b45279..1b08d775 100644 ---- a/libsrc/dbg/dbg.c -+++ b/libsrc/dbg/dbg.c -@@ -1580,7 +1580,7 @@ void DbgEntry (void) - case 'q': - /* Quit program */ - clrscr (); -- exit (1); -+ exit (CC65_EXIT_FAILURE); - - } - } -diff --git a/libsrc/geos-apple/targetutil/convert.c b/libsrc/geos-apple/targetutil/convert.c -index ea9273fc..a4d07ac0 100644 ---- a/libsrc/geos-apple/targetutil/convert.c -+++ b/libsrc/geos-apple/targetutil/convert.c -@@ -5,6 +5,7 @@ - #include <dirent.h> - #include <device.h> - #include <dio.h> -+#include <cc65.h> - - unsigned char info_signature[3] = {3, 21, 63 | 0x80}; - -@@ -69,7 +70,7 @@ static void err_exit(char *operation, unsigned char oserr) - operation); - } - getchar(); -- exit(EXIT_FAILURE); -+ exit(CC65_EXIT_FAILURE); - } - - -@@ -342,5 +343,5 @@ int main(int argc, char* argv[]) - printf("Convert to '%.*s' successful", dir_entry->storage_length.name_length, - dir_entry->file_name); - getchar(); -- return EXIT_SUCCESS; -+ return CC65_EXIT_SUCCESS; - } -diff --git a/libsrc/geos-common/common/_afailed.c b/libsrc/geos-common/common/_afailed.c -index 2448534c..ec21a6b4 100644 ---- a/libsrc/geos-common/common/_afailed.c -+++ b/libsrc/geos-common/common/_afailed.c -@@ -28,5 +28,5 @@ void _afailed (char* file, unsigned line) - - DlgBoxOk(CBOLDON "ASSERTION FAILED", "PROGRAM TERMINATED" CPLAINTEXT); - -- exit (2); -+ exit (CC65_EXIT_AFAILED); - } -diff --git a/libsrc/geos-common/common/abort.c b/libsrc/geos-common/common/abort.c -index b7cb35eb..665b7086 100644 ---- a/libsrc/geos-common/common/abort.c -+++ b/libsrc/geos-common/common/abort.c -@@ -6,10 +6,11 @@ - - #include <stdlib.h> - #include <geos.h> -+#include <cc65.h> - - void abort (void) - { - ExitTurbo(); - DlgBoxOk(CBOLDON "ABNORMAL PROGRAM", "TERMINATION." CPLAINTEXT); -- exit(3); -+ exit(CC65_EXIT_ABORT); - } --- -2.26.0 - diff --git a/0101-Added-comment-to-debugger-exit-with-error.patch b/0101-Added-comment-to-debugger-exit-with-error.patch deleted file mode 100644 index ea47433..0000000 --- a/0101-Added-comment-to-debugger-exit-with-error.patch +++ /dev/null @@ -1,79 +0,0 @@ -From 694dd9240fe42d9544af82ed161927c62971d95d Mon Sep 17 00:00:00 2001 -From: mc78 <mc78@outlook.de> -Date: Tue, 12 Nov 2019 20:48:43 +0100 -Subject: [PATCH 101/170] Added comment to debugger exit with error - ---- - libsrc/common/_afailed.c | 2 +- - libsrc/common/abort.c | 2 +- - libsrc/dbg/dbg.c | 7 +++++-- - libsrc/geos-common/common/_afailed.c | 1 + - 4 files changed, 8 insertions(+), 4 deletions(-) - -diff --git a/libsrc/common/_afailed.c b/libsrc/common/_afailed.c -index 654025e1..980045a6 100644 ---- a/libsrc/common/_afailed.c -+++ b/libsrc/common/_afailed.c -@@ -10,7 +10,7 @@ - #include <signal.h> - #include <stdio.h> - #include <stdlib.h> -- -+#include <cc65.h> - - - void __fastcall__ _afailed (char* file, unsigned line) -diff --git a/libsrc/common/abort.c b/libsrc/common/abort.c -index e59adb7d..43f4ab00 100644 ---- a/libsrc/common/abort.c -+++ b/libsrc/common/abort.c -@@ -9,7 +9,7 @@ - #include <stdio.h> - #include <stdlib.h> - #include <signal.h> -- -+#include <cc65.h> - - - void abort (void) -diff --git a/libsrc/dbg/dbg.c b/libsrc/dbg/dbg.c -index 1b08d775..a58e6c7a 100644 ---- a/libsrc/dbg/dbg.c -+++ b/libsrc/dbg/dbg.c -@@ -14,7 +14,7 @@ - #include <ctype.h> - #include <6502.h> - #include <dbg.h> -- -+#include <cc65.h> - - - /*****************************************************************************/ -@@ -1580,8 +1580,11 @@ void DbgEntry (void) - case 'q': - /* Quit program */ - clrscr (); -+ -+ /* Exit intentionally with error because one may -+ say that DbgEntry is always abnormal. */ - exit (CC65_EXIT_FAILURE); -- -+ - } - } - } -diff --git a/libsrc/geos-common/common/_afailed.c b/libsrc/geos-common/common/_afailed.c -index ec21a6b4..cc9610dd 100644 ---- a/libsrc/geos-common/common/_afailed.c -+++ b/libsrc/geos-common/common/_afailed.c -@@ -7,6 +7,7 @@ - #include <stdio.h> - #include <stdlib.h> - #include <geos.h> -+#include <cc65.h> - - void _afailed (char* file, unsigned line) - { --- -2.26.0 - diff --git a/0102-Replaced-enum-in-cc65.h-by-defines.-added-comment-th.patch b/0102-Replaced-enum-in-cc65.h-by-defines.-added-comment-th.patch deleted file mode 100644 index 89bca5f..0000000 --- a/0102-Replaced-enum-in-cc65.h-by-defines.-added-comment-th.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 16a66f19e10b85e5adc4b0c72de07cbd8dd2159f Mon Sep 17 00:00:00 2001 -From: mc78 <mc78@outlook.de> -Date: Fri, 15 Nov 2019 16:35:58 +0100 -Subject: [PATCH 102/170] Replaced enum in cc65.h by defines. added comment - that cc65 exit constants should not redefine 0 and 1 as they are reserved for - exit_success and exit_failure - ---- - include/cc65.h | 13 +++++++------ - libsrc/dbg/dbg.c | 3 +-- - libsrc/geos-apple/targetutil/convert.c | 4 ++-- - 3 files changed, 10 insertions(+), 10 deletions(-) - -diff --git a/include/cc65.h b/include/cc65.h -index 99a8665c..95de8e4a 100644 ---- a/include/cc65.h -+++ b/include/cc65.h -@@ -36,12 +36,13 @@ - #ifndef _CC65_H - #define _CC65_H - --typedef enum { -- CC65_EXIT_SUCCESS, -- CC65_EXIT_FAILURE, -- CC65_EXIT_AFAILED, -- CC65_EXIT_ABORT --} cc65_exit_codes_t; -+ -+/* Those cc65 exit constants definitions are in addition the the -+ constants defined in stdlib.h. The values 0 and 1 are still -+ reserved for EXIT_SUCCESS and EXIT_FAILURE and should not be -+ redefined */ -+#define CC65_EXIT_AFAILED 2 -+#define CC65_EXIT_ABORT 3 - - - /*****************************************************************************/ -diff --git a/libsrc/dbg/dbg.c b/libsrc/dbg/dbg.c -index a58e6c7a..a6f952f3 100644 ---- a/libsrc/dbg/dbg.c -+++ b/libsrc/dbg/dbg.c -@@ -14,7 +14,6 @@ - #include <ctype.h> - #include <6502.h> - #include <dbg.h> --#include <cc65.h> - - - /*****************************************************************************/ -@@ -1583,7 +1582,7 @@ void DbgEntry (void) - - /* Exit intentionally with error because one may - say that DbgEntry is always abnormal. */ -- exit (CC65_EXIT_FAILURE); -+ exit (EXIT_FAILURE); - - } - } -diff --git a/libsrc/geos-apple/targetutil/convert.c b/libsrc/geos-apple/targetutil/convert.c -index a4d07ac0..7798e004 100644 ---- a/libsrc/geos-apple/targetutil/convert.c -+++ b/libsrc/geos-apple/targetutil/convert.c -@@ -70,7 +70,7 @@ static void err_exit(char *operation, unsigned char oserr) - operation); - } - getchar(); -- exit(CC65_EXIT_FAILURE); -+ exit(EXIT_FAILURE); - } - - -@@ -343,5 +343,5 @@ int main(int argc, char* argv[]) - printf("Convert to '%.*s' successful", dir_entry->storage_length.name_length, - dir_entry->file_name); - getchar(); -- return CC65_EXIT_SUCCESS; -+ return EXIT_SUCCESS; - } --- -2.26.0 - diff --git a/0103-Removed-CC65_-prefixes-from-exit-statements-in-abort.patch b/0103-Removed-CC65_-prefixes-from-exit-statements-in-abort.patch deleted file mode 100644 index e62378f..0000000 --- a/0103-Removed-CC65_-prefixes-from-exit-statements-in-abort.patch +++ /dev/null @@ -1,78 +0,0 @@ -From a139c4057c4bcea6518ab3dc9c23db0171d2d4c5 Mon Sep 17 00:00:00 2001 -From: mc78 <mc78@outlook.de> -Date: Sun, 17 Nov 2019 13:13:43 +0100 -Subject: [PATCH 103/170] Removed CC65_ prefixes from exit statements in abort - and assert code as well from definition - ---- - include/cc65.h | 4 ++-- - libsrc/common/_afailed.c | 2 +- - libsrc/common/abort.c | 2 +- - libsrc/geos-common/common/_afailed.c | 2 +- - libsrc/geos-common/common/abort.c | 2 +- - 5 files changed, 6 insertions(+), 6 deletions(-) - -diff --git a/include/cc65.h b/include/cc65.h -index 95de8e4a..9506cf10 100644 ---- a/include/cc65.h -+++ b/include/cc65.h -@@ -41,8 +41,8 @@ - constants defined in stdlib.h. The values 0 and 1 are still - reserved for EXIT_SUCCESS and EXIT_FAILURE and should not be - redefined */ --#define CC65_EXIT_AFAILED 2 --#define CC65_EXIT_ABORT 3 -+#define EXIT_ASSERT 2 -+#define EXIT_ABORT 3 - - - /*****************************************************************************/ -diff --git a/libsrc/common/_afailed.c b/libsrc/common/_afailed.c -index 980045a6..7df2db60 100644 ---- a/libsrc/common/_afailed.c -+++ b/libsrc/common/_afailed.c -@@ -17,5 +17,5 @@ void __fastcall__ _afailed (char* file, unsigned line) - { - raise (SIGABRT); - fprintf (stderr, "ASSERTION FAILED IN %s(%u)\n", file, line); -- exit (CC65_EXIT_AFAILED); -+ exit (EXIT_ASSERT); - } -diff --git a/libsrc/common/abort.c b/libsrc/common/abort.c -index 43f4ab00..af0d8c31 100644 ---- a/libsrc/common/abort.c -+++ b/libsrc/common/abort.c -@@ -16,7 +16,7 @@ void abort (void) - { - raise (SIGABRT); - fputs ("ABNORMAL PROGRAM TERMINATION\n", stderr); -- exit (CC65_EXIT_ABORT); -+ exit (EXIT_ABORT); - } - - -diff --git a/libsrc/geos-common/common/_afailed.c b/libsrc/geos-common/common/_afailed.c -index cc9610dd..63f23496 100644 ---- a/libsrc/geos-common/common/_afailed.c -+++ b/libsrc/geos-common/common/_afailed.c -@@ -29,5 +29,5 @@ void _afailed (char* file, unsigned line) - - DlgBoxOk(CBOLDON "ASSERTION FAILED", "PROGRAM TERMINATED" CPLAINTEXT); - -- exit (CC65_EXIT_AFAILED); -+ exit (EXIT_ASSERT); - } -diff --git a/libsrc/geos-common/common/abort.c b/libsrc/geos-common/common/abort.c -index 665b7086..92ed745a 100644 ---- a/libsrc/geos-common/common/abort.c -+++ b/libsrc/geos-common/common/abort.c -@@ -12,5 +12,5 @@ void abort (void) - { - ExitTurbo(); - DlgBoxOk(CBOLDON "ABNORMAL PROGRAM", "TERMINATION." CPLAINTEXT); -- exit(CC65_EXIT_ABORT); -+ exit(EXIT_ABORT); - } --- -2.26.0 - diff --git a/0104-Removed-additional-exit-constants-definitions-from-c.patch b/0104-Removed-additional-exit-constants-definitions-from-c.patch deleted file mode 100644 index 43ab10b..0000000 --- a/0104-Removed-additional-exit-constants-definitions-from-c.patch +++ /dev/null @@ -1,108 +0,0 @@ -From 8d2617110facddc2ba709db28abd710e7ce2ca38 Mon Sep 17 00:00:00 2001 -From: mc78 <mc78@outlook.de> -Date: Sun, 17 Nov 2019 15:57:34 +0100 -Subject: [PATCH 104/170] Removed additional exit constants definitions from - cc65.h to stdlih.h. Guarded the definitions by #ifdef. Removed cc65.h - includes from abort and assert implementations. - ---- - include/cc65.h | 8 -------- - include/stdlib.h | 11 +++++++++++ - libsrc/common/_afailed.c | 1 - - libsrc/common/abort.c | 1 - - libsrc/geos-common/common/_afailed.c | 1 - - libsrc/geos-common/common/abort.c | 1 - - 6 files changed, 11 insertions(+), 12 deletions(-) - -diff --git a/include/cc65.h b/include/cc65.h -index 9506cf10..720f1cd0 100644 ---- a/include/cc65.h -+++ b/include/cc65.h -@@ -37,14 +37,6 @@ - #define _CC65_H - - --/* Those cc65 exit constants definitions are in addition the the -- constants defined in stdlib.h. The values 0 and 1 are still -- reserved for EXIT_SUCCESS and EXIT_FAILURE and should not be -- redefined */ --#define EXIT_ASSERT 2 --#define EXIT_ABORT 3 -- -- - /*****************************************************************************/ - /* Code */ - /*****************************************************************************/ -diff --git a/include/stdlib.h b/include/stdlib.h -index 3103172d..638cb475 100644 ---- a/include/stdlib.h -+++ b/include/stdlib.h -@@ -48,6 +48,17 @@ typedef unsigned size_t; - #define EXIT_SUCCESS 0 - #define EXIT_FAILURE 1 - -+#if __CC65_STD__ == __CC65_STD_CC65__ -+ -+/* Those non-standard cc65 exit constants definitions are in addition -+ to the EXIT_SUCCESS and EXIT_FAILURE constants, which should not be -+ redefined */ -+#define EXIT_ASSERT 2 -+#define EXIT_ABORT 3 -+ -+#endif -+ -+ - /* Return type of the div function */ - typedef struct { - int rem; -diff --git a/libsrc/common/_afailed.c b/libsrc/common/_afailed.c -index 7df2db60..ad50a875 100644 ---- a/libsrc/common/_afailed.c -+++ b/libsrc/common/_afailed.c -@@ -10,7 +10,6 @@ - #include <signal.h> - #include <stdio.h> - #include <stdlib.h> --#include <cc65.h> - - - void __fastcall__ _afailed (char* file, unsigned line) -diff --git a/libsrc/common/abort.c b/libsrc/common/abort.c -index af0d8c31..1dda559b 100644 ---- a/libsrc/common/abort.c -+++ b/libsrc/common/abort.c -@@ -9,7 +9,6 @@ - #include <stdio.h> - #include <stdlib.h> - #include <signal.h> --#include <cc65.h> - - - void abort (void) -diff --git a/libsrc/geos-common/common/_afailed.c b/libsrc/geos-common/common/_afailed.c -index 63f23496..97727d60 100644 ---- a/libsrc/geos-common/common/_afailed.c -+++ b/libsrc/geos-common/common/_afailed.c -@@ -7,7 +7,6 @@ - #include <stdio.h> - #include <stdlib.h> - #include <geos.h> --#include <cc65.h> - - void _afailed (char* file, unsigned line) - { -diff --git a/libsrc/geos-common/common/abort.c b/libsrc/geos-common/common/abort.c -index 92ed745a..90a65128 100644 ---- a/libsrc/geos-common/common/abort.c -+++ b/libsrc/geos-common/common/abort.c -@@ -6,7 +6,6 @@ - - #include <stdlib.h> - #include <geos.h> --#include <cc65.h> - - void abort (void) - { --- -2.26.0 - diff --git a/0105-added-additional-empty-line-after-header-guard-in-cc.patch b/0105-added-additional-empty-line-after-header-guard-in-cc.patch deleted file mode 100644 index c163f8e..0000000 --- a/0105-added-additional-empty-line-after-header-guard-in-cc.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 1dee2360fa5a5690271a347f782a214776550cab Mon Sep 17 00:00:00 2001 -From: mc78 <mc78@outlook.de> -Date: Sun, 17 Nov 2019 16:16:32 +0100 -Subject: [PATCH 105/170] added additional empty line after header guard in - cc65.h to conform to other headers - ---- - include/cc65.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/include/cc65.h b/include/cc65.h -index 720f1cd0..7e9c2cae 100644 ---- a/include/cc65.h -+++ b/include/cc65.h -@@ -37,6 +37,7 @@ - #define _CC65_H - - -+ - /*****************************************************************************/ - /* Code */ - /*****************************************************************************/ --- -2.26.0 - diff --git a/0106-Removed-unnecessary-include-cc65.h-from-convert.c.patch b/0106-Removed-unnecessary-include-cc65.h-from-convert.c.patch deleted file mode 100644 index c2f5ae5..0000000 --- a/0106-Removed-unnecessary-include-cc65.h-from-convert.c.patch +++ /dev/null @@ -1,57 +0,0 @@ -From db971d8a655c8f00109ba1d9403cf9838643b93a Mon Sep 17 00:00:00 2001 -From: mc78 <mc78@outlook.de> -Date: Tue, 19 Nov 2019 13:17:02 +0100 -Subject: [PATCH 106/170] Removed unnecessary #include <cc65.h> from convert.c - Adjusted block comments to predominant style - ---- - include/stdlib.h | 5 +++-- - libsrc/dbg/dbg.c | 3 ++- - libsrc/geos-apple/targetutil/convert.c | 1 - - 3 files changed, 5 insertions(+), 4 deletions(-) - -diff --git a/include/stdlib.h b/include/stdlib.h -index 638cb475..b929e8f0 100644 ---- a/include/stdlib.h -+++ b/include/stdlib.h -@@ -51,8 +51,9 @@ typedef unsigned size_t; - #if __CC65_STD__ == __CC65_STD_CC65__ - - /* Those non-standard cc65 exit constants definitions are in addition -- to the EXIT_SUCCESS and EXIT_FAILURE constants, which should not be -- redefined */ -+** to the EXIT_SUCCESS and EXIT_FAILURE constants, which should not be -+** redefined -+*/ - #define EXIT_ASSERT 2 - #define EXIT_ABORT 3 - -diff --git a/libsrc/dbg/dbg.c b/libsrc/dbg/dbg.c -index a6f952f3..27f2086e 100644 ---- a/libsrc/dbg/dbg.c -+++ b/libsrc/dbg/dbg.c -@@ -1581,7 +1581,8 @@ void DbgEntry (void) - clrscr (); - - /* Exit intentionally with error because one may -- say that DbgEntry is always abnormal. */ -+ ** say that DbgEntry is always abnormal. -+ */ - exit (EXIT_FAILURE); - - } -diff --git a/libsrc/geos-apple/targetutil/convert.c b/libsrc/geos-apple/targetutil/convert.c -index 7798e004..ea9273fc 100644 ---- a/libsrc/geos-apple/targetutil/convert.c -+++ b/libsrc/geos-apple/targetutil/convert.c -@@ -5,7 +5,6 @@ - #include <dirent.h> - #include <device.h> - #include <dio.h> --#include <cc65.h> - - unsigned char info_signature[3] = {3, 21, 63 | 0x80}; - --- -2.26.0 - diff --git a/0107-Fixed-C16-978.patch b/0107-Fixed-C16-978.patch deleted file mode 100644 index f0c587a..0000000 --- a/0107-Fixed-C16-978.patch +++ /dev/null @@ -1,20 +0,0 @@ -From d9a6fbac48d52e5765b0ac6e5531f7261561f61d Mon Sep 17 00:00:00 2001 -From: Stefan <stefan.haubenthal@gmail.com> -Date: Tue, 19 Nov 2019 18:59:18 +0100 -Subject: [PATCH 107/170] Fixed C16 #978 - ---- - libsrc/c16/waitvsync.s | 1 + - 1 file changed, 1 insertion(+) - create mode 100644 libsrc/c16/waitvsync.s - -diff --git a/libsrc/c16/waitvsync.s b/libsrc/c16/waitvsync.s -new file mode 100644 -index 00000000..c020976b ---- /dev/null -+++ b/libsrc/c16/waitvsync.s -@@ -0,0 +1 @@ -+.include "../plus4/waitvsync.s" --- -2.26.0 - diff --git a/0108-Update-c16.sgml.patch b/0108-Update-c16.sgml.patch deleted file mode 100644 index dc25fdd..0000000 --- a/0108-Update-c16.sgml.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 9ab614d764b5f524cb60fb65c0e3d7187b97fdd0 Mon Sep 17 00:00:00 2001 -From: Stefan <stefan.haubenthal@gmail.com> -Date: Tue, 19 Nov 2019 19:05:28 +0100 -Subject: [PATCH 108/170] Update c16.sgml - ---- - doc/c16.sgml | 5 +---- - 1 file changed, 1 insertion(+), 4 deletions(-) - -diff --git a/doc/c16.sgml b/doc/c16.sgml -index 462f9834..ae64da47 100644 ---- a/doc/c16.sgml -+++ b/doc/c16.sgml -@@ -123,6 +123,7 @@ declaration and usage. - <item>cbm_save - <item>cbm_write - <item>get_tv -+<item>waitvsync - </itemize> - - -@@ -270,7 +271,3 @@ freely, subject to the following restrictions: - </enum> - - </article> -- -- -- -- --- -2.26.0 - diff --git a/0109-Update-c128.sgml.patch b/0109-Update-c128.sgml.patch deleted file mode 100644 index f1cfc9d..0000000 --- a/0109-Update-c128.sgml.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 9bf2bf308aeb349b7693ed3feb64c29654c8d673 Mon Sep 17 00:00:00 2001 -From: Stefan <stefan.haubenthal@gmail.com> -Date: Tue, 19 Nov 2019 19:09:54 +0100 -Subject: [PATCH 109/170] Update c128.sgml - ---- - doc/c128.sgml | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/doc/c128.sgml b/doc/c128.sgml -index 1d8734fd..8c62b6ad 100644 ---- a/doc/c128.sgml -+++ b/doc/c128.sgml -@@ -133,6 +133,7 @@ declaration and usage. - <item>cbm_save - <item>cbm_write - <item>get_tv -+<item>waitvsync - </itemize> - - --- -2.26.0 - diff --git a/0110-Update-c64.sgml.patch b/0110-Update-c64.sgml.patch deleted file mode 100644 index 5428a2c..0000000 --- a/0110-Update-c64.sgml.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 94892231bcc60ba0b004b94ecd2a7002b7b29e90 Mon Sep 17 00:00:00 2001 -From: Stefan <stefan.haubenthal@gmail.com> -Date: Tue, 19 Nov 2019 19:10:32 +0100 -Subject: [PATCH 110/170] Update c64.sgml - ---- - doc/c64.sgml | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/doc/c64.sgml b/doc/c64.sgml -index c1186705..7cd9b2d8 100644 ---- a/doc/c64.sgml -+++ b/doc/c64.sgml -@@ -225,6 +225,7 @@ declaration and usage. - <item>cbm_save - <item>cbm_write - <item>get_tv -+<item>waitvsync - </itemize> - - --- -2.26.0 - diff --git a/0111-Update-cbm510.sgml.patch b/0111-Update-cbm510.sgml.patch deleted file mode 100644 index 1431870..0000000 --- a/0111-Update-cbm510.sgml.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 49ebac7ac1c6e563f481c6bdd585e724ae749763 Mon Sep 17 00:00:00 2001 -From: Stefan <stefan.haubenthal@gmail.com> -Date: Tue, 19 Nov 2019 19:11:11 +0100 -Subject: [PATCH 111/170] Update cbm510.sgml - ---- - doc/cbm510.sgml | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/doc/cbm510.sgml b/doc/cbm510.sgml -index 012a7b59..c208f3ea 100644 ---- a/doc/cbm510.sgml -+++ b/doc/cbm510.sgml -@@ -126,6 +126,7 @@ declaration and usage. - <item>cbm_save - <item>cbm_write - <item>get_tv -+<item>waitvsync - </itemize> - - --- -2.26.0 - diff --git a/0112-Update-cx16.sgml.patch b/0112-Update-cx16.sgml.patch deleted file mode 100644 index 79d4970..0000000 --- a/0112-Update-cx16.sgml.patch +++ /dev/null @@ -1,92 +0,0 @@ -From 63ab22f97f59953da5a38b265d3277dde163214c Mon Sep 17 00:00:00 2001 -From: Stefan <stefan.haubenthal@gmail.com> -Date: Tue, 19 Nov 2019 19:14:08 +0100 -Subject: [PATCH 112/170] Update cx16.sgml - ---- - doc/cx16.sgml | 62 +++++++++++++++++++++++++-------------------------- - 1 file changed, 31 insertions(+), 31 deletions(-) - -diff --git a/doc/cx16.sgml b/doc/cx16.sgml -index 7189e715..2136265b 100644 ---- a/doc/cx16.sgml -+++ b/doc/cx16.sgml -@@ -139,12 +139,11 @@ The functions listed below are special for the CX16. See the <url - url="funcref.html" name="function reference"> for declarations and usage. - - <itemize> --<item>get_ostype() --<item>set_tv() --<item>videomode() --<item>vpeek() --<item>vpoke() --<item>waitvsync() -+<item>get_ostype -+<item>set_tv -+<item>videomode -+<item>vpeek -+<item>vpoke - </itemize> - - -@@ -155,31 +154,32 @@ machines. See the <url url="funcref.html" name="function reference"> for - declarations and usage. - - <itemize> --<item>cbm_close() --<item>cbm_closedir() --<item>cbm_k_basin() --<item>cbm_k_bsout() --<item>cbm_k_chkin() --<item>cbm_k_ckout() --<item>cbm_k_close() --<item>cbm_k_clrch() --<item>cbm_k_getin() --<item>cbm_k_load() --<item>cbm_k_open() --<item>cbm_k_readst() --<item>cbm_k_save() --<item>cbm_k_second() --<item>cbm_k_setlfs() --<item>cbm_k_setnam() --<item>cbm_k_tksa() --<item>cbm_load() --<item>cbm_open() --<item>cbm_opendir() --<item>cbm_read() --<item>cbm_readdir() --<item>cbm_save() --<item>cbm_write() --<item>get_tv() -+<item>cbm_close -+<item>cbm_closedir -+<item>cbm_k_basin -+<item>cbm_k_bsout -+<item>cbm_k_chkin -+<item>cbm_k_ckout -+<item>cbm_k_close -+<item>cbm_k_clrch -+<item>cbm_k_getin -+<item>cbm_k_load -+<item>cbm_k_open -+<item>cbm_k_readst -+<item>cbm_k_save -+<item>cbm_k_second -+<item>cbm_k_setlfs -+<item>cbm_k_setnam -+<item>cbm_k_tksa -+<item>cbm_load -+<item>cbm_open -+<item>cbm_opendir -+<item>cbm_read -+<item>cbm_readdir -+<item>cbm_save -+<item>cbm_write -+<item>get_tv -+<item>waitvsync - </itemize> - - --- -2.26.0 - diff --git a/0113-Update-funcref.sgml.patch b/0113-Update-funcref.sgml.patch deleted file mode 100644 index a07e7a5..0000000 --- a/0113-Update-funcref.sgml.patch +++ /dev/null @@ -1,35 +0,0 @@ -From c08f1e4bfdc56bcdd7da4c6422246f6e5896e9c3 Mon Sep 17 00:00:00 2001 -From: Stefan <stefan.haubenthal@gmail.com> -Date: Tue, 19 Nov 2019 19:15:50 +0100 -Subject: [PATCH 113/170] Update funcref.sgml - ---- - doc/funcref.sgml | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/doc/funcref.sgml b/doc/funcref.sgml -index 72a44c7b..7a46736e 100644 ---- a/doc/funcref.sgml -+++ b/doc/funcref.sgml -@@ -213,8 +213,8 @@ function. - <!-- <item><ref id="cbm_save" name="cbm_save"> --> - <!-- <item><ref id="cbm_write" name="cbm_write"> --> - <!-- <item><ref id="get_tv" name="get_tv"> --> --<item><ref id="waitvsync" name="waitvsync"> - <item><ref id="kbrepeat" name="kbrepeat"> -+<item><ref id="waitvsync" name="waitvsync"> - </itemize> - - (incomplete) -@@ -7716,7 +7716,7 @@ name="toggle_videomode">. - <item>The function is only available as fastcall function, so it may only be - used in presence of a prototype. - </itemize> --<tag/Availability/C128 and enhanced Apple //e -+<tag/Availability/C128, enhanced Apple //e and CX16 - <tag/See also/ - <ref id="fast" name="fast">, - <ref id="isfast" name="isfast">, --- -2.26.0 - diff --git a/0114-Update-nes.sgml.patch b/0114-Update-nes.sgml.patch deleted file mode 100644 index f427432..0000000 --- a/0114-Update-nes.sgml.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 7361aa9959b8a869d18e4f457f00ea1bf449f0f9 Mon Sep 17 00:00:00 2001 -From: Stefan <stefan.haubenthal@gmail.com> -Date: Tue, 19 Nov 2019 19:16:31 +0100 -Subject: [PATCH 114/170] Update nes.sgml - ---- - doc/nes.sgml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/doc/nes.sgml b/doc/nes.sgml -index 3f8f7418..beb322fc 100644 ---- a/doc/nes.sgml -+++ b/doc/nes.sgml -@@ -67,8 +67,8 @@ Programs containing NES specific code may use the <tt/nes.h/ header file. - <sect1>NES specific functions<p> - - <itemize> --<item>waitvsync - wait until the start of the next frame</item> - <item>get_tv</item> -+<item>waitvsync - wait until the start of the next frame</item> - </itemize> - - --- -2.26.0 - diff --git a/0115-Update-pce.sgml.patch b/0115-Update-pce.sgml.patch deleted file mode 100644 index eac7d04..0000000 --- a/0115-Update-pce.sgml.patch +++ /dev/null @@ -1,26 +0,0 @@ -From ea16316e336f53c915bc038e0cd53f0e9895ab0f Mon Sep 17 00:00:00 2001 -From: Stefan <stefan.haubenthal@gmail.com> -Date: Tue, 19 Nov 2019 19:17:22 +0100 -Subject: [PATCH 115/170] Update pce.sgml - ---- - doc/pce.sgml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/doc/pce.sgml b/doc/pce.sgml -index a1866b8f..42a1ca9d 100644 ---- a/doc/pce.sgml -+++ b/doc/pce.sgml -@@ -114,8 +114,8 @@ Programs containing PCE-specific code may use the <tt/pce.h/ header file. - <sect1>PCE-specific functions<p> - - <itemize> --<item>waitvsync</item> - <item>get_tv (since all PCE systems are NTSC, this always returns TV_NTSC)</item> -+<item>waitvsync</item> - </itemize> - - --- -2.26.0 - diff --git a/0116-Update-plus4.sgml.patch b/0116-Update-plus4.sgml.patch deleted file mode 100644 index 6741c75..0000000 --- a/0116-Update-plus4.sgml.patch +++ /dev/null @@ -1,24 +0,0 @@ -From a56b176749bb6bf43a29e797e362a9596f5cb079 Mon Sep 17 00:00:00 2001 -From: Stefan <stefan.haubenthal@gmail.com> -Date: Tue, 19 Nov 2019 19:18:05 +0100 -Subject: [PATCH 116/170] Update plus4.sgml - ---- - doc/plus4.sgml | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/doc/plus4.sgml b/doc/plus4.sgml -index 11468bb3..645de516 100644 ---- a/doc/plus4.sgml -+++ b/doc/plus4.sgml -@@ -121,6 +121,7 @@ declaration and usage. - <item>cbm_save - <item>cbm_write - <item>get_tv -+<item>waitvsync - </itemize> - - --- -2.26.0 - diff --git a/0117-Update-vic20.sgml.patch b/0117-Update-vic20.sgml.patch deleted file mode 100644 index 17515e1..0000000 --- a/0117-Update-vic20.sgml.patch +++ /dev/null @@ -1,24 +0,0 @@ -From c9d2c10cbd43cf4e46aec6ec6489515742737daf Mon Sep 17 00:00:00 2001 -From: Stefan <stefan.haubenthal@gmail.com> -Date: Tue, 19 Nov 2019 19:18:39 +0100 -Subject: [PATCH 117/170] Update vic20.sgml - ---- - doc/vic20.sgml | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/doc/vic20.sgml b/doc/vic20.sgml -index e292e0a1..4fcd0079 100644 ---- a/doc/vic20.sgml -+++ b/doc/vic20.sgml -@@ -107,6 +107,7 @@ declaration and usage. - <item>cbm_save - <item>cbm_write - <item>get_tv -+<item>waitvsync - </itemize> - - --- -2.26.0 - diff --git a/0118-Update-color.s.patch b/0118-Update-color.s.patch deleted file mode 100644 index b4034ee..0000000 --- a/0118-Update-color.s.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 4497998944981862233914b75875590226021345 Mon Sep 17 00:00:00 2001 -From: Stefan <stefan.haubenthal@gmail.com> -Date: Tue, 19 Nov 2019 19:20:19 +0100 -Subject: [PATCH 118/170] Update color.s - ---- - libsrc/c16/color.s | 34 +--------------------------------- - 1 file changed, 1 insertion(+), 33 deletions(-) - -diff --git a/libsrc/c16/color.s b/libsrc/c16/color.s -index 2f3046e8..fbcc95a2 100644 ---- a/libsrc/c16/color.s -+++ b/libsrc/c16/color.s -@@ -1,33 +1 @@ --; --; Ullrich von Bassewitz, 06.08.1998 --; --; unsigned char __fastcall__ textcolor (unsigned char color); --; unsigned char __fastcall__ bgcolor (unsigned char color); --; unsigned char __fastcall__ bordercolor (unsigned char color); --; -- -- .export _textcolor, _bgcolor, _bordercolor -- -- .include "plus4.inc" -- --_textcolor: -- ldx CHARCOLOR ; get old value -- sta CHARCOLOR ; set new value -- txa -- rts -- -- --_bgcolor: -- ldx TED_BGCOLOR ; get old value -- sta TED_BGCOLOR ; set new value -- txa -- rts -- -- --_bordercolor: -- ldx TED_BORDERCOLOR ; get old value -- sta TED_BORDERCOLOR ; set new value -- txa -- rts -- -- -+.include "../plus4/color.s" --- -2.26.0 - diff --git a/0119-Update-conio.s.patch b/0119-Update-conio.s.patch deleted file mode 100644 index e0fd554..0000000 --- a/0119-Update-conio.s.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 06c98952fcd153d5ae4ac22477e8a51006481ee9 Mon Sep 17 00:00:00 2001 -From: Stefan <stefan.haubenthal@gmail.com> -Date: Tue, 19 Nov 2019 19:21:00 +0100 -Subject: [PATCH 119/170] Update conio.s - ---- - libsrc/c16/conio.s | 11 +---------- - 1 file changed, 1 insertion(+), 10 deletions(-) - -diff --git a/libsrc/c16/conio.s b/libsrc/c16/conio.s -index feca30c6..3ab372a2 100644 ---- a/libsrc/c16/conio.s -+++ b/libsrc/c16/conio.s -@@ -1,10 +1 @@ --; --; Ullrich von Bassewitz, 06.08.1998 --; --; Low level stuff for screen output/console input --; -- -- .exportzp CURS_X, CURS_Y -- -- .include "plus4.inc" -- -+.include "../plus4/conio.s" --- -2.26.0 - diff --git a/0120-Update-cputc.s.patch b/0120-Update-cputc.s.patch deleted file mode 100644 index 423e986..0000000 --- a/0120-Update-cputc.s.patch +++ /dev/null @@ -1,122 +0,0 @@ -From 3f360fe3ee04490dd1664e27066c1248f9e4de87 Mon Sep 17 00:00:00 2001 -From: Stefan <stefan.haubenthal@gmail.com> -Date: Tue, 19 Nov 2019 19:21:52 +0100 -Subject: [PATCH 120/170] Update cputc.s - ---- - libsrc/c16/cputc.s | 105 +-------------------------------------------- - 1 file changed, 1 insertion(+), 104 deletions(-) - -diff --git a/libsrc/c16/cputc.s b/libsrc/c16/cputc.s -index 49b3a84d..86959675 100644 ---- a/libsrc/c16/cputc.s -+++ b/libsrc/c16/cputc.s -@@ -1,104 +1 @@ --; --; Ullrich von Bassewitz, 06.08.1998 --; --; void cputcxy (unsigned char x, unsigned char y, char c); --; void cputc (char c); --; -- -- .export _cputcxy, _cputc, cputdirect, putchar -- .export newline, plot -- .import gotoxy -- .import PLOT -- -- .include "plus4.inc" -- -- --_cputcxy: -- pha ; Save C -- jsr gotoxy ; Set cursor, drop x and y -- pla ; Restore C -- --; Plot a character - also used as internal function -- --_cputc: cmp #$0A ; CR? -- bne L1 -- lda #0 -- sta CURS_X -- beq plot ; Recalculate pointers -- --L1: cmp #$0D ; LF? -- beq newline ; Recalculate pointers -- --; Printable char of some sort -- -- cmp #' ' -- bcc cputdirect ; Other control char -- tay -- bmi L10 -- cmp #$60 -- bcc L2 -- and #$DF -- bne cputdirect ; Branch always --L2: and #$3F -- --cputdirect: -- jsr putchar ; Write the character to the screen -- --; Advance cursor position -- --advance: -- iny -- cpy #XSIZE -- bne L3 -- jsr newline ; new line -- ldy #0 ; + cr --L3: sty CURS_X -- rts -- --newline: -- clc -- lda #XSIZE -- adc SCREEN_PTR -- sta SCREEN_PTR -- bcc L4 -- inc SCREEN_PTR+1 -- clc --L4: lda #XSIZE -- adc CRAM_PTR -- sta CRAM_PTR -- bcc L5 -- inc CRAM_PTR+1 --L5: inc CURS_Y -- rts -- --; Handle character if high bit set -- --L10: and #$7F -- cmp #$7E ; PI? -- bne L11 -- lda #$5E ; Load screen code for PI -- bne cputdirect --L11: ora #$40 -- bne cputdirect -- -- -- --; Set cursor position, calculate RAM pointers -- --plot: ldy CURS_X -- ldx CURS_Y -- clc -- jmp PLOT ; Set the new cursor -- -- -- --; Write one character to the screen without doing anything else, return X --; position in Y -- --putchar: -- ora RVS ; Set revers bit -- ldy CURS_X -- sta (SCREEN_PTR),y ; Set char -- lda CHARCOLOR -- sta (CRAM_PTR),y ; Set color -- rts -+.include "../plus4/cputc.s" --- -2.26.0 - diff --git a/0121-Update-fast.s.patch b/0121-Update-fast.s.patch deleted file mode 100644 index e7c1108..0000000 --- a/0121-Update-fast.s.patch +++ /dev/null @@ -1,40 +0,0 @@ -From df752ff7a58da5785f113c84cf946c5de75bbc58 Mon Sep 17 00:00:00 2001 -From: Stefan <stefan.haubenthal@gmail.com> -Date: Tue, 19 Nov 2019 19:22:28 +0100 -Subject: [PATCH 121/170] Update fast.s - ---- - libsrc/c16/fast.s | 23 +---------------------- - 1 file changed, 1 insertion(+), 22 deletions(-) - -diff --git a/libsrc/c16/fast.s b/libsrc/c16/fast.s -index e4881396..50924edb 100644 ---- a/libsrc/c16/fast.s -+++ b/libsrc/c16/fast.s -@@ -1,22 +1 @@ --; --; Marco van den Heuvel, 2018-03-20 --; --; void fast (void); --; /* Switch the CPU into double clock mode. */ --; -- -- .export _fast -- -- .include "plus4.inc" -- -- --.proc _fast -- -- lda TED_CLK -- and #%11111101 -- sta TED_CLK -- rts -- --.endproc -- -- -+.include "../plus4/fast.s" --- -2.26.0 - diff --git a/0122-Update-isfast.s.patch b/0122-Update-isfast.s.patch deleted file mode 100644 index fa40df1..0000000 --- a/0122-Update-isfast.s.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 2c34723a97631992dd6d00fa6e19bd49e05a7c87 Mon Sep 17 00:00:00 2001 -From: Stefan <stefan.haubenthal@gmail.com> -Date: Tue, 19 Nov 2019 19:22:53 +0100 -Subject: [PATCH 122/170] Update isfast.s - ---- - libsrc/c16/isfast.s | 23 +---------------------- - 1 file changed, 1 insertion(+), 22 deletions(-) - -diff --git a/libsrc/c16/isfast.s b/libsrc/c16/isfast.s -index ff104d97..03684075 100644 ---- a/libsrc/c16/isfast.s -+++ b/libsrc/c16/isfast.s -@@ -1,22 +1 @@ --; --; Marco van den Heuvel, 2018-03-20 --; --; unsigned char isfast (void); --; /* Returns 1 if the CPU is in double clock mode. */ --; -- -- .export _isfast -- -- .include "plus4.inc" -- -- --.proc _isfast -- -- lda TED_CLK -- lsr -- and #$01 -- ldx #$00 -- rts -- --.endproc -- -+.include "../plus4/isfast.s" --- -2.26.0 - diff --git a/0123-Update-revers.s.patch b/0123-Update-revers.s.patch deleted file mode 100644 index f5508e6..0000000 --- a/0123-Update-revers.s.patch +++ /dev/null @@ -1,45 +0,0 @@ -From eeefd10f8f8699e7ceb0d02840257dd56f6a0bbb Mon Sep 17 00:00:00 2001 -From: Stefan <stefan.haubenthal@gmail.com> -Date: Tue, 19 Nov 2019 19:23:31 +0100 -Subject: [PATCH 123/170] Update revers.s - ---- - libsrc/c16/revers.s | 28 +--------------------------- - 1 file changed, 1 insertion(+), 27 deletions(-) - -diff --git a/libsrc/c16/revers.s b/libsrc/c16/revers.s -index f1c0b4d6..3ce66876 100644 ---- a/libsrc/c16/revers.s -+++ b/libsrc/c16/revers.s -@@ -1,27 +1 @@ --; --; Ullrich von Bassewitz, 07.08.1998 --; --; unsigned char revers (unsigned char onoff); --; -- -- .export _revers -- -- .include "plus4.inc" -- --.proc _revers -- -- ldx #$00 ; Assume revers off -- tay ; Test onoff -- beq L1 ; Jump if off -- ldx #$80 ; Load on value -- ldy #$00 ; Assume old value is zero --L1: lda RVS ; Load old value -- stx RVS ; Set new value -- beq L2 ; Jump if old value zero -- iny ; Make old value = 1 --L2: ldx #$00 ; Load high byte of result -- tya ; Load low byte, set CC -- rts -- --.endproc -- -+.include "../plus4/revers.s" --- -2.26.0 - diff --git a/0124-Update-slow.s.patch b/0124-Update-slow.s.patch deleted file mode 100644 index ed7f753..0000000 --- a/0124-Update-slow.s.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 9d4d00737ec18db92ea395bef6185345eb353adb Mon Sep 17 00:00:00 2001 -From: Stefan <stefan.haubenthal@gmail.com> -Date: Tue, 19 Nov 2019 19:24:14 +0100 -Subject: [PATCH 124/170] Update slow.s - ---- - libsrc/c16/slow.s | 23 +---------------------- - 1 file changed, 1 insertion(+), 22 deletions(-) - -diff --git a/libsrc/c16/slow.s b/libsrc/c16/slow.s -index 18b8c231..70e461a9 100644 ---- a/libsrc/c16/slow.s -+++ b/libsrc/c16/slow.s -@@ -1,22 +1 @@ --; --; Marco van den Heuvel, 2018-03-28 --; --; void slow (void); --; /* Switch the CPU into single clock mode. */ --; -- -- .export _slow -- -- .include "plus4.inc" -- -- --.proc _slow -- -- lda TED_CLK -- ora #%00000010 -- sta TED_CLK -- rts -- --.endproc -- -- -+.include "../plus4/slow.s" --- -2.26.0 - diff --git a/0125-Update-status.s.patch b/0125-Update-status.s.patch deleted file mode 100644 index 05a7134..0000000 --- a/0125-Update-status.s.patch +++ /dev/null @@ -1,23 +0,0 @@ -From d1fd7ffc59f2aa06ec4f5af263c867d2907eaaa0 Mon Sep 17 00:00:00 2001 -From: Stefan <stefan.haubenthal@gmail.com> -Date: Tue, 19 Nov 2019 19:24:49 +0100 -Subject: [PATCH 125/170] Update status.s - ---- - libsrc/c16/status.s | 6 +----- - 1 file changed, 1 insertion(+), 5 deletions(-) - -diff --git a/libsrc/c16/status.s b/libsrc/c16/status.s -index c6f27923..04d97169 100644 ---- a/libsrc/c16/status.s -+++ b/libsrc/c16/status.s -@@ -1,5 +1 @@ --; --; Oliver Schmidt, 2012-09-30 --; -- -- .exportzp ST := $90 ; IEC status byte -+.include "../plus4/status.s" --- -2.26.0 - diff --git a/0126-Added-cx16.h-to-the-function-reference-document.patch b/0126-Added-cx16.h-to-the-function-reference-document.patch deleted file mode 100644 index e4b38b6..0000000 --- a/0126-Added-cx16.h-to-the-function-reference-document.patch +++ /dev/null @@ -1,104 +0,0 @@ -From f75657d7e250268c5a4c444ecd8b2ac2ea7815db Mon Sep 17 00:00:00 2001 -From: Greg King <gregdk@users.sf.net> -Date: Wed, 20 Nov 2019 12:11:47 -0500 -Subject: [PATCH 126/170] Added <cx16.h> to the function reference document. - ---- - doc/funcref.sgml | 59 ++++++++++++++++++++++++++++++++---------------- - 1 file changed, 40 insertions(+), 19 deletions(-) - -diff --git a/doc/funcref.sgml b/doc/funcref.sgml -index 7a46736e..c2b46f0f 100644 ---- a/doc/funcref.sgml -+++ b/doc/funcref.sgml -@@ -318,6 +318,20 @@ function. - </itemize> - - -+<sect1><tt/cx16.h/<label id="cx16.h"><p> -+ -+<itemize> -+<!-- <item><ref id="get_ostype" name="get_ostype"> --> -+<!-- <item><ref id="get_tv" name="get_tv"> --> -+<!-- <item><ref id="set_tv" name="set_tv"> --> -+<item><ref id="videomode" name="videomode"> -+<!-- <item><ref id="vpeek" name="vpeek"> --> -+<!-- <item><ref id="vpoke" name="vpoke"> --> -+</itemize> -+ -+(incomplete) -+ -+ - <sect1><tt/dbg.h/<label id="dbg.h"><p> - - <!-- <itemize> --> -@@ -7702,24 +7716,31 @@ used in presence of a prototype. - - <quote> - <descrip> --<tag/Function/Switch to either 40 or 80 column mode. --<tag/Header/<tt/<ref id="apple2enh.h" name="apple2enh.h">, --<ref id="c128.h" name="c128.h">/ --<tag/Declaration/<tt/unsigned __fastcall__ videomode (unsigned Mode);/ --<tag/Description/Switch to 40 or 80 column mode depending on the argument. If --the requested mode is already active, nothing happens. The old mode is returned --from the call. -+<tag/Function/Switch to either 40- or 80-column text mode, or a standard -+graphics mode. -+<tag/Header/<tt/ -+<ref id="apple2enh.h" name="apple2enh.h">, -+<ref id="c128.h" name="c128.h">, -+<ref id="cx16.h" name="cx16.h">/ -+<tag/Declaration/ -+<tt>unsigned __fastcall__ videomode (unsigned Mode); /* for apple2enh and c128 */</tt><newline> -+<tt>signed char __fastcall__ videomode (signed char Mode); /* for cx16 */</tt> -+<tag/Description/Switch to a 40- or 80-column text or graphics mode, depending -+on the argument. If the requested mode is already active, nothing happens. The -+old mode is returned from the call. - <tag/Notes/<itemize> --<item>The function is specific to the C128 and enhanced Apple //e. -+<item>The function is specific to the Commodore 128, the enhanced Apple //e, -+and the Commander X16. - <item>This function replaces <ref id="toggle_videomode" - name="toggle_videomode">. --<item>The function is only available as fastcall function, so it may only be --used in presence of a prototype. -+<item>The function is available as only a fastcall function, so it may be used -+only in the presence of a prototype. - </itemize> --<tag/Availability/C128, enhanced Apple //e and CX16 -+<tag/Availability/C128, enhanced Apple //e, and CX16 - <tag/See also/ - <ref id="fast" name="fast">, - <ref id="isfast" name="isfast">, -+<!-- <ref id="set_tv" name="set_tv">, --> - <ref id="slow" name="slow">, - <ref id="toggle_videomode" name="toggle_videomode"> - <tag/Example/None. -@@ -7731,15 +7752,15 @@ used in presence of a prototype. - - <quote> - <descrip> --<tag/Function/Wait until the start of the next frame. --<tag/Header/ --<tt/<ref id="cbm.h" name="cbm.h">/, --<tt/<ref id="gamate.h" name="gamate.h">/, --<tt/<ref id="nes.h" name="nes.h">/, --<tt/<ref id="pce.h" name="pce.h">/ -+<tag/Function/Wait until the start of the next video frame. -+<tag/Header/<tt/ -+<ref id="cbm.h" name="cbm.h">, -+<ref id="gamate.h" name="gamate.h">, -+<ref id="nes.h" name="nes.h">, -+<ref id="pce.h" name="pce.h">/ - <tag/Declaration/<tt/void waitvsync (void);/ --<tag/Description/Wait for vertical sync to reduce flickering. --<tag/Availability/Platforms above -+<tag/Description/Wait for vertical sync, to reduce flickering. -+<tag/Availability/Platforms served by the headers above - <tag/Example/None. - </descrip> - </quote> --- -2.26.0 - diff --git a/0127-Expanded-Sim65-zero-page.patch b/0127-Expanded-Sim65-zero-page.patch deleted file mode 100644 index 0743155..0000000 --- a/0127-Expanded-Sim65-zero-page.patch +++ /dev/null @@ -1,39 +0,0 @@ -From d5c804f851c2dcf187a640b320cc49d466bfc76d Mon Sep 17 00:00:00 2001 -From: Oliver Schmidt <ol.sc@web.de> -Date: Tue, 26 Nov 2019 22:18:12 +0100 -Subject: [PATCH 127/170] Expanded Sim65 zero page. - ---- - cfg/sim6502.cfg | 2 +- - cfg/sim65c02.cfg | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/cfg/sim6502.cfg b/cfg/sim6502.cfg -index c768ab4a..39c33581 100644 ---- a/cfg/sim6502.cfg -+++ b/cfg/sim6502.cfg -@@ -3,7 +3,7 @@ SYMBOLS { - __STACKSIZE__: type = weak, value = $0800; # 2k stack - } - MEMORY { -- ZP: file = "", start = $0000, size = $001B; -+ ZP: file = "", start = $0000, size = $0100; - HEADER: file = %O, start = $0000, size = $000C; - MAIN: file = %O, define = yes, start = $0200, size = $FDF0 - __STACKSIZE__; - } -diff --git a/cfg/sim65c02.cfg b/cfg/sim65c02.cfg -index c768ab4a..39c33581 100644 ---- a/cfg/sim65c02.cfg -+++ b/cfg/sim65c02.cfg -@@ -3,7 +3,7 @@ SYMBOLS { - __STACKSIZE__: type = weak, value = $0800; # 2k stack - } - MEMORY { -- ZP: file = "", start = $0000, size = $001B; -+ ZP: file = "", start = $0000, size = $0100; - HEADER: file = %O, start = $0000, size = $000C; - MAIN: file = %O, define = yes, start = $0200, size = $FDF0 - __STACKSIZE__; - } --- -2.26.0 - diff --git a/0128-Changed-sim65-s-internal-error-codes-from-9-bit-valu.patch b/0128-Changed-sim65-s-internal-error-codes-from-9-bit-valu.patch deleted file mode 100644 index 549a404..0000000 --- a/0128-Changed-sim65-s-internal-error-codes-from-9-bit-valu.patch +++ /dev/null @@ -1,31 +0,0 @@ -From fb0d09a277ce74959552fe1ce58f1b4d7ee8419f Mon Sep 17 00:00:00 2001 -From: Greg King <gregdk@users.sf.net> -Date: Fri, 6 Dec 2019 14:47:47 -0500 -Subject: [PATCH 128/170] Changed sim65's internal error codes from 9-bit - values to 7-bit values. - -Some shells truncate process return codes to 8 bits. And, the eigth bit often is used to show that a signal stopped the process. ---- - src/sim65/error.h | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/sim65/error.h b/src/sim65/error.h -index 5d6e8be2..cbb78587 100644 ---- a/src/sim65/error.h -+++ b/src/sim65/error.h -@@ -49,10 +49,10 @@ - - - --#define SIM65_ERROR 256 -+#define SIM65_ERROR 0x7F - /* Does not use EXIT_FAILURE because it may overlap with test results. */ - --#define SIM65_ERROR_TIMEOUT 257 -+#define SIM65_ERROR_TIMEOUT 0x7E - /* An error result for max CPU instructions exceeded. */ - - --- -2.26.0 - diff --git a/0129-Added-the-missing-BANK_RAM-array-to-the-Commander-X1.patch b/0129-Added-the-missing-BANK_RAM-array-to-the-Commander-X1.patch deleted file mode 100644 index cea62a9..0000000 --- a/0129-Added-the-missing-BANK_RAM-array-to-the-Commander-X1.patch +++ /dev/null @@ -1,80 +0,0 @@ -From cab4910a7d07029b3cc0ffd8abd4355f0365f5b7 Mon Sep 17 00:00:00 2001 -From: Greg King <gregdk@users.sf.net> -Date: Tue, 10 Dec 2019 05:59:33 -0500 -Subject: [PATCH 129/170] Added the missing BANK_RAM array to the Commander - X16's header. - ---- - include/cx16.h | 20 +++++++++++--------- - 1 file changed, 11 insertions(+), 9 deletions(-) - -diff --git a/include/cx16.h b/include/cx16.h -index b465378a..d7ed15d2 100644 ---- a/include/cx16.h -+++ b/include/cx16.h -@@ -77,7 +77,8 @@ - #define COLOR_LIGHTBLUE 0x0E - #define COLOR_GRAY3 0x0F - --/* Masks for joy_read() */ -+/* NES controller masks for joy_read() */ -+ - #define JOY_BTN_1_MASK 0x80 - #define JOY_BTN_2_MASK 0x40 - #define JOY_BTN_3_MASK 0x20 -@@ -101,7 +102,7 @@ - #define JOY_FIRE2(v) ((v) & JOY_FIRE2_MASK) - - /* Additional mouse button mask */ --#define MOUSE_BTN_MIDDLE 0x02 -+#define MOUSE_BTN_MIDDLE 0x02 - - /* get_tv() return codes - ** set_tv() argument codes -@@ -115,7 +116,7 @@ - #define TV_NTSC_MONO 6 - #define TV_RGB2 7 - --/* Video modes */ -+/* Video modes for videomode() */ - #define VIDEOMODE_40x30 0x00 - #define VIDEOMODE_80x60 0x02 - #define VIDEOMODE_40COL VIDEOMODE_40x30 -@@ -130,11 +131,9 @@ - #define VERA_IRQ_UART 0b00001000 - - --/* Define hardware */ -+/* Define hardware. */ - --/* Define a structure with the Video Enhanced Retro Adapter's --** external registers. --*/ -+/* A structure with the Video Enhanced Retro Adapter's external registers */ - struct __vera { - unsigned short address; /* Address for data ports */ - unsigned char address_hi; -@@ -150,7 +149,7 @@ struct __vera { - #define VIA1 (*(volatile struct __6522 *)0x9F60) - #define VIA2 (*(volatile struct __6522 *)0x9F70) - --/* Define a structure with the x16emu's settings registers. */ -+/* A structure with the x16emu's settings registers */ - struct __emul { - unsigned char debug; /* Boolean: debugging enabled */ - unsigned char vera_action; /* Boolean: displaying VERA activity */ -@@ -162,7 +161,10 @@ struct __emul { - unsigned char keymap; /* Keyboard layout number */ - const char detect[2]; /* "16" if running on x16emu */ - }; --#define EMULATOR (*(volatile struct __emul)0x9FB0) -+#define EMULATOR (*(volatile struct __emul)0x9FB0) -+ -+/* An array window into the half Mibibyte or two Mibibytes of banked RAM */ -+#define BANK_RAM ((unsigned char[0x2000])0xA000) - - - --- -2.26.0 - diff --git a/0130-Updated-the-cx16-library-to-the-Commander-X16-Kernal.patch b/0130-Updated-the-cx16-library-to-the-Commander-X16-Kernal.patch deleted file mode 100644 index a759404..0000000 --- a/0130-Updated-the-cx16-library-to-the-Commander-X16-Kernal.patch +++ /dev/null @@ -1,1534 +0,0 @@ -From 3fa253d31fbec8602e791345125e33efadd98cbf Mon Sep 17 00:00:00 2001 -From: Greg King <gregdk@users.sf.net> -Date: Wed, 25 Dec 2019 10:56:32 -0500 -Subject: [PATCH 130/170] Updated the cx16 library to the Commander X16 - Kernal's prerelease 35. - ---- - asminc/cbm_kernal.inc | 40 +++++- - asminc/cx16.inc | 217 ++++++++++++++++++++++++------- - cfg/cx16-asm.cfg | 2 +- - cfg/cx16-bank.cfg | 10 +- - cfg/cx16.cfg | 2 +- - doc/cx16.sgml | 10 +- - include/cbm.h | 2 +- - include/cx16.h | 14 +- - libsrc/cbm/clock.s | 19 ++- - libsrc/cx16/_scrsize.s | 6 +- - libsrc/cx16/bankramaddr.s | 6 +- - libsrc/cx16/cgetc.s | 8 +- - libsrc/cx16/clock.s | 36 +++++ - libsrc/cx16/crt0.s | 12 +- - libsrc/cx16/get_tv.s | 6 +- - libsrc/cx16/joy/cx16-std.s | 60 +++------ - libsrc/cx16/joyref.s | 4 +- - libsrc/cx16/kbhit.s | 7 +- - libsrc/cx16/kernal.s | 136 +++++++++++-------- - libsrc/cx16/mcbdefault.s | 48 ++++--- - libsrc/cx16/mou/cx16-std.s | 64 ++++----- - libsrc/cx16/mouse_stat_stddrv.s | 2 +- - libsrc/cx16/set_tv.s | 6 +- - libsrc/cx16/sysuname.s | 2 +- - libsrc/cx16/tgi_stat_stddrv.s | 7 +- - libsrc/cx16/tgi_stddrv.s | 5 +- - libsrc/cx16/{vset.s => vaddr0.s} | 9 +- - libsrc/cx16/vpeek.s | 8 +- - libsrc/cx16/vpoke.s | 8 +- - libsrc/cx16/waitvsync.s | 12 +- - src/ca65/struct.c | 9 +- - 31 files changed, 507 insertions(+), 270 deletions(-) - create mode 100644 libsrc/cx16/clock.s - rename libsrc/cx16/{vset.s => vaddr0.s} (60%) - -diff --git a/asminc/cbm_kernal.inc b/asminc/cbm_kernal.inc -index a38836ce..86a60d49 100644 ---- a/asminc/cbm_kernal.inc -+++ b/asminc/cbm_kernal.inc -@@ -6,9 +6,40 @@ - - .if .def(__CX16__) - ; CX16 extended jump table -- GETJOY := $FF06 -- MOUSE := $FF09 -- SCRMOD := $FF5F -+ FB_INIT := $FEF6 -+ FB_GET_INFO := $FEF9 -+ FB_SET_PALETTE := $FEFC -+ FB_CURSOR_POSITION := $FEFF -+ FB_CURSOR_NEXT_LINE := $FF02 -+ FB_GET_PIXEL := $FF05 -+ FB_GET_PIXELS := $FF08 -+ FB_SET_PIXEL := $FF0B -+ FB_SET_PIXELS := $FF0E -+ FB_SET_8_PIXELS := $FF11 -+ FB_SET_8_PIXELS_OPAQUE := $FF14 -+ FB_FILL_PIXELS := $FF17 -+ FB_FILTER_PIXELS := $FF1A -+ FB_MOVE_PIXELS := $FF1D -+ GRAPH_INIT := $FF20 -+ GRAPH_CLEAR := $FF23 -+ GRAPH_SET_WINDOW := $FF26 -+ GRAPH_SET_COLORS := $FF29 -+ GRAPH_DRAW_LINE := $FF2C -+ GRAPH_DRAW_RECT := $FF2F -+ GRAPH_MOVE_RECT := $FF32 -+ GRAPH_DRAW_OVAL := $FF35 -+ GRAPH_DRAW_IMAGE := $FF38 -+ GRAPH_SET_FONT := $FF3B -+ GRAPH_GET_CHAR_SIZE := $FF3E -+ GRAPH_PUT_CHAR := $FF41 -+ RESTORE_BASIC := $FF47 -+ CLOCK_SET_DATE_TIME := $FF4D -+ CLOCK_GET_DATE_TIME := $FF50 -+ JOYSTICK_SCAN := $FF53 -+ JOYSTICK_GET := $FF56 -+ SCRMOD := $FF5F -+ MOUSE_CONFIG := $FF68 -+ MOUSE_GET := $FF6B - .endif - - .if .def(__C128__) -@@ -21,6 +52,9 @@ - .if .def(__C128__) || .def(__CX16__) - ; Extended jump table - CLSALL := $FF4A -+ LKUPLA := $FF59 -+ LKUPSA := $FF5C -+ PFKEY := $FF65 - JSRFAR := $FF6E - INDFET := $FF74 - INDSTA := $FF77 -diff --git a/asminc/cx16.inc b/asminc/cx16.inc -index 1c22c99b..e08215df 100644 ---- a/asminc/cx16.inc -+++ b/asminc/cx16.inc -@@ -1,5 +1,5 @@ - ; --; CX16 definitions -+; CX16 r35 definitions - ; - - ; --------------------------------------------------------------------------- -@@ -44,11 +44,128 @@ - ; --------------------------------------------------------------------------- - ; Zero page - -+; GEOS and graphics pseudo-registers -+.struct gREG -+ .org $02 -+ .union -+ r0 .word -+ .struct -+ r0L .byte -+ r0H .byte -+ .endstruct -+ .endunion -+ .union -+ r1 .word -+ .struct -+ r1L .byte -+ r1H .byte -+ .endstruct -+ .endunion -+ .union -+ r2 .word -+ .struct -+ r2L .byte -+ r2H .byte -+ .endstruct -+ .endunion -+ .union -+ r3 .word -+ .struct -+ r3L .byte -+ r3H .byte -+ .endstruct -+ .endunion -+ .union -+ r4 .word -+ .struct -+ r4L .byte -+ r4H .byte -+ .endstruct -+ .endunion -+ .union -+ r5 .word -+ .struct -+ r5L .byte -+ r5H .byte -+ .endstruct -+ .endunion -+ .union -+ r6 .word -+ .struct -+ r6L .byte -+ r6H .byte -+ .endstruct -+ .endunion -+ .union -+ r7 .word -+ .struct -+ r7L .byte -+ r7H .byte -+ .endstruct -+ .endunion -+ .union -+ r8 .word -+ .struct -+ r8L .byte -+ r8H .byte -+ .endstruct -+ .endunion -+ .union -+ r9 .word -+ .struct -+ r9L .byte -+ r9H .byte -+ .endstruct -+ .endunion -+ .union -+ r10 .word -+ .struct -+ r10L .byte -+ r10H .byte -+ .endstruct -+ .endunion -+ .union -+ r11 .word -+ .struct -+ r11L .byte -+ r11H .byte -+ .endstruct -+ .endunion -+ .union -+ r12 .word -+ .struct -+ r12L .byte -+ r12H .byte -+ .endstruct -+ .endunion -+ .union -+ r13 .word -+ .struct -+ r13L .byte -+ r13H .byte -+ .endstruct -+ .endunion -+ .union -+ r14 .word -+ .struct -+ r14L .byte -+ r14H .byte -+ .endstruct -+ .endunion -+ .union -+ r15 .word -+ .struct -+ r15L .byte -+ r15H .byte -+ .endstruct -+ .endunion -+.endstruct -+ - ; Kernal - FNAM := $84 ; Pointer to filename - KTEMP2 := $86 ; 2 bytes for temporary storage --SCREEN_PTR := $88 ; Pointer to current row on text screen (16 bits) --IMPARM := $8A ; Pointer for PRIMM function -+IMPARM := $88 ; Pointer for PRIMM function -+SCREEN_PTR := $90 ; Pointer to current row on text screen (16 bits) - - ; BASIC - TXTPTR := $EE ; Pointer into BASIC source code -@@ -58,41 +175,27 @@ TXTPTR := $EE ; Pointer into BASIC source code - BASIC_BUF := $0200 ; Location of command-line - BASIC_BUF_LEN = 81 ; Maximum length of command-line - --CURS_COLOR := $027E ; Color under the cursor --CHARCOLOR := $0286 ; Cursor's color nybbles (high: background, low: foreground) --STATUS := $0287 ; Status from previous I/O operation --IN_DEV := $028E ; Current input device number --OUT_DEV := $028F ; Current output device number --TIME := $0292 ; 60 Hz. clock (3 bytes, big-endian) --FNAM_LEN := $0298 ; Length of filename --SECADR := $029A ; Secondary address --DEVNUM := $029B ; Device number --KEY_COUNT := $029E ; Number of keys in input buffer --RVS := $029F ; Reverse flag --CURS_FLAG := $02A3 ; 1 = cursor off --CURS_BLINK := $02A4 ; Blink counter --CURS_CHAR := $02A5 ; Character under the cursor --CURS_STATE := $02A6 ; Cursor blink state --CURS_X := $02A8 ; Cursor column --CURS_Y := $02AB ; Cursor row --LLEN := $02AE ; Line length --NLINES := $02AF ; Number of screen lines --JOY1 := $02BC ; 3 bytes of NES/SNES gamepad data --JOY2 := $02BF -+STATUS := $0275 ; Status from previous I/O operation -+IN_DEV := $0279 ; Current input device number -+OUT_DEV := $027A ; Current output device number -+FNAM_LEN := $027D ; Length of filename -+SECADR := $027F ; Secondary address -+DEVNUM := $0280 ; Device number -+CURS_COLOR := $0373 ; Color under the cursor -+CHARCOLOR := $0377 ; Cursor's color nybbles (high: background, low: foreground) -+RVS := $0378 ; Reverse flag -+CURS_FLAG := $037C ; 1 = cursor off -+CURS_BLINK := $037D ; Blink counter -+CURS_CHAR := $037E ; Character under the cursor -+CURS_STATE := $037F ; Cursor blink state -+CURS_X := $0381 ; Cursor column -+CURS_Y := $0384 ; Cursor row -+LLEN := $0387 ; Line length -+NLINES := $0388 ; Number of screen lines - - ; BASIC --VARTAB := $02DD ; Pointer to start of BASIC variables --MEMSIZE := $02E5 ; Pointer to highest BASIC RAM location (+1) -- --; Kernal mouse --MSEPAR := $0371 ; mouse: $8x=sprite on, 1/2: scale --MOUSEL := $0372 ; min. x co-ordinate --MOUSER := $0374 ; max. x co-ordinate --MOUSET := $0376 ; min. y co-ordinate --MOUSEB := $0378 ; max. y co-ordinate --MOUSEX := $037A ; x co-ordinate --MOUSEY := $037C ; y co-ordinate --MOUSEBT := $037E ; buttons (bits 2: middle, 1: right, 0: left) -+VARTAB := $03E3 ; Pointer to start of BASIC variables -+MEMSIZE := $03EB ; Pointer to highest BASIC RAM location (+1) - - ; --------------------------------------------------------------------------- - ; Vector and other locations -@@ -141,8 +244,13 @@ NMIVec := $0318 - SPR_COLLIDED = %00000100 - UART_IRQ = %00001000 - .endenum -+ - ; Internal RAM and registers -- VRAM := $000000 -+ -+ .struct -+ .org $000000 -+ VRAM .res $020000 ; 128 Kibibytes -+ .endstruct - .scope COMPOSER ; Display composer - .struct - .org $0F0000 -@@ -226,15 +334,29 @@ NMIVec := $0318 - .scope SPRITE - .struct - .org $0F4000 -- CTRL .byte ; Enables sprites -+ CTRL .byte ; Enables sprite engine - COLLISION .byte - .endstruct -+ .struct ATTRIB ; Sprite attributes -+ .org $0F5000 -+ ADDR .addr ; Address and color mode -+ XX .word -+ YY .word -+ Z_FLIP .byte -+ SIZE_PAL .byte -+ .endstruct - .enum FLIP - NONE = 0 - HORIZ - VERT - BOTH - .endenum -+ .enum DEPTH -+ DISABLE = 0 << 2 -+ CANVAS = 1 << 2 -+ LAYER0 = 2 << 2 -+ LAYER1 = 3 << 2 -+ .endenum - .enum ; Sprite geometry - WIDTH8 = 0 << 4 - WIDTH16 = 1 << 4 -@@ -247,13 +369,6 @@ NMIVec := $0318 - COLORS16 = 0 << 7 - COLORS256 = 1 << 7 - .endenum -- .enum DEPTH -- DISABLE = 0 << 2 -- CANVAS = 1 << 2 -- LAYER0 = 2 << 2 -- LAYER1 = 3 << 2 -- .endenum -- ATTRIB := $0F5000 ; Sprite attributes - .endscope - AUDIO := $0F6000 - .scope SPI -@@ -334,3 +449,15 @@ NMIVec := $0318 - KEYMAP .byte ; Current keyboard layout number (Read-Only) - DETECT .byte 2 ; If is "16" string, then running on emulator (RO) - .endstruct -+ -+; --------------------------------------------------------------------------- -+; Banked RAM and ROM -+ -+KEY_COUNT := $A00A ; (bank 0) Number of keys in input buffer -+TIMER := $A03E ; (bank 0) 60 Hz. timer (3 bytes, big-endian) -+ -+.struct BANK -+ .org $A000 -+ RAM .res $2000 ; 8 Kibibyte window into 512 Kibibytes or 2048 Kibibytes -+ ROM .res $4000 ; 16 Kibibyte window into 128 Kibibytes -+.endstruct -diff --git a/cfg/cx16-asm.cfg b/cfg/cx16-asm.cfg -index 4228f6da..3c24bd56 100644 ---- a/cfg/cx16-asm.cfg -+++ b/cfg/cx16-asm.cfg -@@ -6,7 +6,7 @@ SYMBOLS { - __HIMEM__: type = weak, value = $9F00; - } - MEMORY { -- ZP: file = "", start = $0002, size = $0080 - $0002, define = yes; -+ ZP: file = "", start = $0022, size = $0080 - $0022, define = yes; - LOADADDR: file = %O, start = %S - 2, size = $0002; - MAIN: file = %O, start = %S, size = __HIMEM__ - %S; - } -diff --git a/cfg/cx16-bank.cfg b/cfg/cx16-bank.cfg -index ff5dded3..1f998f18 100644 ---- a/cfg/cx16-bank.cfg -+++ b/cfg/cx16-bank.cfg -@@ -11,13 +11,13 @@ SYMBOLS { - __BANKRAMSIZE__: type = weak, value = $2000; # 8K banked RAM - } - MEMORY { -- ZP: file = "", define = yes, start = $0002, size = $0080 - $0002; -+ ZP: file = "", define = yes, start = $0022, size = $0080 - $0022; - LOADADDR: file = %O, start = %S - 2, size = $0002; - HEADER: file = %O, define = yes, start = %S, size = $000D; - MAIN: file = %O, define = yes, start = __HEADER_LAST__, size = __HIMEM__ - __HEADER_LAST__; - BSS: file = "", start = __ONCE_RUN__, size = __HIMEM__ - __ONCE_RUN__ - __STACKSIZE__; -- BRAM00ADDR: file = "%O.00", start = __BANKRAMSTART__ - 2, size = $0002; -- BRAM00: file = "%O.00", start = __BANKRAMSTART__, size = __BANKRAMSIZE__; -+# BRAM00ADDR: file = "%O.00", start = __BANKRAMSTART__ - 2, size = $0002; -+# BRAM00: file = "%O.00", start = __BANKRAMSTART__, size = __BANKRAMSIZE__; - BRAM01ADDR: file = "%O.01", start = __BANKRAMSTART__ - 2, size = $0002; - BRAM01: file = "%O.01", start = __BANKRAMSTART__, size = __BANKRAMSIZE__; - BRAM02ADDR: file = "%O.02", start = __BANKRAMSTART__ - 2, size = $0002; -@@ -62,8 +62,8 @@ SEGMENTS { - INIT: load = MAIN, type = rw; - ONCE: load = MAIN, type = ro, define = yes; - BSS: load = BSS, type = bss, define = yes; -- BRAM00ADDR: load = BRAM00ADDR, type = ro, optional = yes; -- BANKRAM00: load = BRAM00, type = rw, define = yes, optional = yes; -+# BRAM00ADDR: load = BRAM00ADDR, type = ro, optional = yes; -+# BANKRAM00: load = BRAM00, type = rw, define = yes, optional = yes; - BRAM01ADDR: load = BRAM01ADDR, type = ro, optional = yes; - BANKRAM01: load = BRAM01, type = rw, define = yes, optional = yes; - BRAM02ADDR: load = BRAM02ADDR, type = ro, optional = yes; -diff --git a/cfg/cx16.cfg b/cfg/cx16.cfg -index c72f6c35..72fc2fe9 100644 ---- a/cfg/cx16.cfg -+++ b/cfg/cx16.cfg -@@ -8,7 +8,7 @@ SYMBOLS { - __HIMEM__: type = weak, value = $9F00; - } - MEMORY { -- ZP: file = "", define = yes, start = $0002, size = $0080 - $0002; -+ ZP: file = "", define = yes, start = $0022, size = $0080 - $0022; - LOADADDR: file = %O, start = %S - 2, size = $0002; - HEADER: file = %O, define = yes, start = %S, size = $000D; - MAIN: file = %O, define = yes, start = __HEADER_LAST__, size = __HIMEM__ - __HEADER_LAST__; -diff --git a/doc/cx16.sgml b/doc/cx16.sgml -index 2136265b..ca9a50ed 100644 ---- a/doc/cx16.sgml -+++ b/doc/cx16.sgml -@@ -62,7 +62,7 @@ Special locations: - - <tag/Bank RAM/ - Bank RAM is located at $A000 - $BFFF. It's an eight-Kibibyte -- window into a half Mibibyte or two Mibibytes of banked RAM. -+ window into a half Mebibyte or two Mebibytes of banked RAM. - - <tag/Bank ROM/ - Bank ROM is located at $C000 - $FFFF. It's a sixteen-Kibibyte -@@ -229,8 +229,9 @@ point to <tt/cX16-std.joy (cx16_std_joy)/. - <descrip> - <tag><tt/cX16-std.joy (cX16_std_joy)/</tag> - Supports up to two NES (and SNES) controllers connected to the joystick ports -- of the CX16. It reads the four directions, and the A, B, Select, and Start -- buttons. Buttons A and B are the primary and secondary fire buttons. -+ of the CX16. It reads the four directions, and the <bf/A/, <bf/B/, -+ <bf/Select/, and <bf/Start/ buttons. Buttons <bf/A/ and <bf/B/ are -+ the first and second fire buttons. - </descrip><p> - - -@@ -243,6 +244,9 @@ point to <tt/cX16-std.mou (cx16_std_mou)/. - <tag><tt/cX16-std.mou (cX16_std_mou)/</tag> - Supports a standard 3-button mouse connected to the PS/2 mouse port of the - Commander X16. -+ -+ Currently (r35), this driver doesn't support <tt/mouse_move()/ -+ and <tt/mouse_setbox()/. - </descrip><p> - - -diff --git a/include/cbm.h b/include/cbm.h -index 96eb675c..56b5b294 100644 ---- a/include/cbm.h -+++ b/include/cbm.h -@@ -168,7 +168,7 @@ unsigned char __fastcall__ kbrepeat (unsigned char mode); - - #if !defined(__CBM610__) && !defined(__PET__) - void waitvsync (void); --/* Wait for the start of the next frame */ -+/* Wait for the start of the next video field. */ - #endif - - /*****************************************************************************/ -diff --git a/include/cx16.h b/include/cx16.h -index d7ed15d2..c6638cef 100644 ---- a/include/cx16.h -+++ b/include/cx16.h -@@ -44,7 +44,19 @@ - - - -+/* Additional output character codes */ -+#define CH_COLOR_SWAP 0x01 -+#define CH_UNDERLINE 0x04 -+#define CH_BOLD 0x06 -+#define CH_BACKSPACE 0x08 -+#define CH_ITALIC 0x0B -+#define CH_OUTLINE 0x0C -+#define CH_FONT_ISO 0x0F -+#define CH_FONT_PET 0x8F -+ - /* Additional key defines */ -+#define CH_SHIFT_TAB 0x18 -+#define CH_HELP 0x84 - #define CH_F1 0x85 - #define CH_F2 0x89 - #define CH_F3 0x86 -@@ -163,7 +175,7 @@ struct __emul { - }; - #define EMULATOR (*(volatile struct __emul)0x9FB0) - --/* An array window into the half Mibibyte or two Mibibytes of banked RAM */ -+/* An array window into the half Mebibyte or two Mebibytes of banked RAM */ - #define BANK_RAM ((unsigned char[0x2000])0xA000) - - -diff --git a/libsrc/cbm/clock.s b/libsrc/cbm/clock.s -index b5fa6e89..90e4263a 100644 ---- a/libsrc/cbm/clock.s -+++ b/libsrc/cbm/clock.s -@@ -1,19 +1,28 @@ - ; --; Ullrich von Bassewitz, 21.09.1998 -+; 1998-09-21, Ullrich von Bassewitz -+; 2019-12-25, Greg King - ; - ; clock_t clock (void); - ; - -- .include "cbm.inc" -- - .export _clock - .importzp sreg - -+ .include "cbm.inc" -+ .macpack cpu -+ - - .proc _clock - -- lda #0 ; Byte 3 is always zero -- sta sreg+1 -+; Some accelerator adaptors have CMOS ICs. -+ -+.if (.cpu & ::CPU_ISET_65SC02) -+ stz sreg + 1 -+.else -+ lda #$00 ; Byte 3 always is zero -+ sta sreg + 1 -+.endif -+ - jsr RDTIM - sty sreg - rts -diff --git a/libsrc/cx16/_scrsize.s b/libsrc/cx16/_scrsize.s -index f240b1e5..6b848078 100644 ---- a/libsrc/cx16/_scrsize.s -+++ b/libsrc/cx16/_scrsize.s -@@ -1,10 +1,6 @@ - ; --; Ullrich von Bassewitz, 26.10.2000 --; - ; Screen size variables - ; - -- .export screensize - .import SCREEN -- --screensize := SCREEN -+ .export screensize := SCREEN -diff --git a/libsrc/cx16/bankramaddr.s b/libsrc/cx16/bankramaddr.s -index 53d96e91..7736f869 100644 ---- a/libsrc/cx16/bankramaddr.s -+++ b/libsrc/cx16/bankramaddr.s -@@ -1,7 +1,7 @@ - ; --; 2019-09-16, Greg King -+; 2019-12-21, Greg King - ; --; This module supplies the load addresses that are expected -+; This module supplies some load addresses that are expected - ; by a Commander X16 in the first two bytes of banked RAM load files. - ; - -@@ -9,9 +9,11 @@ - ; this module to get included into the output files. - .export __BANKRAMADDR__: abs = 1 - -+.if 0 ; bank 0 is used by Kernal - .segment "BRAM00ADDR" - - .addr *+2 -+.endif - - .segment "BRAM01ADDR" - -diff --git a/libsrc/cx16/cgetc.s b/libsrc/cx16/cgetc.s -index 2c5ea76d..2372b431 100644 ---- a/libsrc/cx16/cgetc.s -+++ b/libsrc/cx16/cgetc.s -@@ -1,5 +1,5 @@ - ; --; 2019-10-01, Greg King -+; 2019-12-22, Greg King - ; - ; char cgetc (void); - ; /* Return a character from the keyboard. */ -@@ -7,13 +7,13 @@ - - .export _cgetc - -- .import cursor, GETIN -+ .import _kbhit, cursor, GETIN - - .include "cx16.inc" - .macpack generic - - --_cgetc: ldx KEY_COUNT ; Get number of characters -+_cgetc: jsr _kbhit - bnz L3 ; Jump if there are already chars waiting - - ; Switch the cursor on if wanted. -@@ -22,7 +22,7 @@ _cgetc: ldx KEY_COUNT ; Get number of characters - tay - lda cursor - jsr setcursor --L1: lda KEY_COUNT -+L1: jsr _kbhit - bze L1 ; Wait for key - tya - eor #%00000001 ; (Cursor flag uses negative logic) -diff --git a/libsrc/cx16/clock.s b/libsrc/cx16/clock.s -new file mode 100644 -index 00000000..9af215e0 ---- /dev/null -+++ b/libsrc/cx16/clock.s -@@ -0,0 +1,36 @@ -+; -+; 1998-09-21, Ullrich von Bassewitz -+; 2019-12-25, Greg King -+; -+; clock_t clock (void); -+; -+ -+ .constructor initclock -+ .export _clock -+ -+ .import SETTIM, RDTIM -+ .importzp sreg -+ -+ -+; clock() counts the amount of time that the process has run. -+; Therefore, reset it when the program begins. -+ -+.proc initclock -+ -+ lda #$00 -+ tax -+ tay -+ jmp SETTIM -+ -+.endproc -+ -+ -+ -+.proc _clock -+ -+ stz sreg + 1 ; Byte 3 always is zero -+ jsr RDTIM -+ sty sreg -+ rts -+ -+.endproc -diff --git a/libsrc/cx16/crt0.s b/libsrc/cx16/crt0.s -index bfb4de10..52deeb76 100644 ---- a/libsrc/cx16/crt0.s -+++ b/libsrc/cx16/crt0.s -@@ -1,5 +1,5 @@ - ; --; Start-up code for cc65 (CX16 version) -+; Start-up code for cc65 (CX16 r35 version) - ; - - .export _exit -@@ -46,7 +46,7 @@ _exit: - - jsr donelib - --.if 0 ; We no longer need to preserve zero-page space for cc65's variables. -+.if 0 ; We don't need to preserve zero-page space for cc65's variables. - ; Copy back the zero-page stuff. - - ldx #zpspace-1 -@@ -83,14 +83,14 @@ init: - and #<~$07 - sta VIA1::PRB - --; Change to the first RAM bank. -+; Change to the second RAM bank. - - lda VIA1::PRA2 - sta ramsave ; Save the current RAM bank number -- lda #$00 ; Choose RAM bank zero -+ lda #$01 - sta VIA1::PRA2 - --.if 0 ; We no longer need to preserve zero-page space for cc65's variables. -+.if 0 ; We don't need to preserve zero-page space for cc65's variables. - ; Save the zero-page locations that we need. - - ldx #zpspace-1 -@@ -107,7 +107,7 @@ L1: lda sp,x - sta sp - stx sp+1 ; Set argument stack ptr - --; Switch to the second charset. -+; Switch to the lower/UPPER PetSCII charset. - - lda #$0E - jsr CHROUT -diff --git a/libsrc/cx16/get_tv.s b/libsrc/cx16/get_tv.s -index 79a577df..291a32cd 100644 ---- a/libsrc/cx16/get_tv.s -+++ b/libsrc/cx16/get_tv.s -@@ -1,5 +1,5 @@ - ; --; 2019-09-20, Greg King -+; 2019-12-22, Greg King - ; - ; unsigned char get_tv (void); - ; /* Return the video mode the machine is using. */ -@@ -11,9 +11,6 @@ - - - .proc _get_tv -- php -- sei ; Don't let interrupts interfere -- - ; Point to the video output register. - - stz VERA::CTRL ; Use port 0 -@@ -25,7 +22,6 @@ - sty VERA::ADDR+2 - - lda VERA::DATA0 -- plp ; Re-enable interrupts - and #$07 ; Get the type of output signal - rts - .endproc -diff --git a/libsrc/cx16/joy/cx16-std.s b/libsrc/cx16/joy/cx16-std.s -index b41c6606..5c10c059 100644 ---- a/libsrc/cx16/joy/cx16-std.s -+++ b/libsrc/cx16/joy/cx16-std.s -@@ -1,8 +1,8 @@ - ; - ; Standard joystick driver for the CX16. --; May be installed multiple times when statically linked to the application. -+; May be installed multiple times when statically linked to an application. - ; --; 2019-11-15 Greg King -+; 2019-12-24, Greg King - ; - - .include "joy-kernel.inc" -@@ -14,6 +14,8 @@ - .macpack generic - .macpack module - -+ .importzp tmp1 -+ - - ; ------------------------------------------------------------------------ - ; Header. Includes jump table -@@ -75,51 +77,21 @@ COUNT: lda #<JOY_COUNT - ; ------------------------------------------------------------------------ - ; READ: Read a particular joystick passed in .A . - --READ: php -- bit #JOY_COUNT - $01 -- sei -- bnz pad2 -- --; Read game pad 1 -- --pad1: ldy JOY1 ; Allow JOY1 to be reread between interrupts -- sty JOY1 + 2 -+READ: and #%00000001 -+ jsr JOYSTICK_GET -+ sta tmp1 -+ txa -+ bit #%00001110 ; Is it NES or SNES controller? -+ bze nes - -- lda JOY1 + 1 -- bit #%00001110 -- bze nes1 -- -- asl JOY1 + 2 ; Get SNES's B button -+ asl tmp1 ; Get SNES's B button - ror a ; Put it next to the A button -- asl JOY1 + 2 ; Drop SNES's Y button -+ asl tmp1 ; Drop SNES's Y button - asl a ; Get back the B button -- ror JOY1 + 2 -+ ror tmp1 - asl a ; Get SNES's A button -- ror JOY1 + 2 ; Make byte look like NES pad -- --nes1: lda JOY1 + 2 -- plp -- eor #%11111111 ; (The controllers use negative logic) -- rts -- --; Read game pad 2 -- --pad2: ldy JOY2 -- sty JOY2 + 2 -- -- lda JOY2 + 1 -- bit #%00001110 -- bze nes2 -- -- asl JOY2 + 2 -- ror a -- asl JOY2 + 2 -- asl a -- ror JOY2 + 2 -- asl a -- ror JOY2 + 2 -+ ror tmp1 ; Make byte look like NES pad - --nes2: lda JOY2 + 2 -- plp -- eor #%11111111 -+nes: lda tmp1 ; The controllers give zeroes for "pressed" -+ eor #%11111111 ; We want ones for "pressed" - rts -diff --git a/libsrc/cx16/joyref.s b/libsrc/cx16/joyref.s -index fb21918c..edd89fba 100644 ---- a/libsrc/cx16/joyref.s -+++ b/libsrc/cx16/joyref.s -@@ -1,5 +1,5 @@ - ; --; 2019-11-14, Greg King -+; 2019-12-22, Greg King - ; - ; Link an interrupt handler if joysticks are used by a program. - ; -@@ -14,7 +14,7 @@ joy_libref: - lda VERA::IRQ_FLAGS - lsr a - bcc not_vsync -- jsr GETJOY ; Bit-bang game controllers -+ jsr JOYSTICK_SCAN ; Bit-bang game controllers - clc ; Let other Jiffy handlers run - not_vsync: - rts -diff --git a/libsrc/cx16/kbhit.s b/libsrc/cx16/kbhit.s -index a73533e2..34afdeba 100644 ---- a/libsrc/cx16/kbhit.s -+++ b/libsrc/cx16/kbhit.s -@@ -1,5 +1,5 @@ - ; --; 2019-11-06, Greg King -+; 2019-12-22, Greg King - ; - ; unsigned char kbhit (void); - ; /* Returns non-zero (true) if a typed character is waiting. */ -@@ -11,7 +11,10 @@ - - - .proc _kbhit -+ ldy VIA1::PRA2 ; (KEY_COUNT is in RAM bank 0) -+ stz VIA1::PRA2 - lda KEY_COUNT ; Get number of characters -+ sty VIA1::PRA2 - tax ; High byte of return (only its zero/nonzero ... -- rts ; ... state matters) -+ rts ; ... state matters) - .endproc -diff --git a/libsrc/cx16/kernal.s b/libsrc/cx16/kernal.s -index 97443c82..ccd52d63 100644 ---- a/libsrc/cx16/kernal.s -+++ b/libsrc/cx16/kernal.s -@@ -1,60 +1,94 @@ - ; --; 2019-11-05, Greg King -+; 2019-12-22, Greg King - ; - ; CX16 Kernal functions - ; - - .include "cbm_kernal.inc" - -- .export GETJOY -- .export MOUSE -- .export SCRMOD -+ .export FB_INIT -+ .export FB_GET_INFO -+ .export FB_SET_PALETTE -+ .export FB_CURSOR_POSITION -+ .export FB_CURSOR_NEXT_LINE -+ .export FB_GET_PIXEL -+ .export FB_GET_PIXELS -+ .export FB_SET_PIXEL -+ .export FB_SET_PIXELS -+ .export FB_SET_8_PIXELS -+ .export FB_SET_8_PIXELS_OPAQUE -+ .export FB_FILL_PIXELS -+ .export FB_FILTER_PIXELS -+ .export FB_MOVE_PIXELS -+ .export GRAPH_INIT -+ .export GRAPH_CLEAR -+ .export GRAPH_SET_WINDOW -+ .export GRAPH_SET_COLORS -+ .export GRAPH_DRAW_LINE -+ .export GRAPH_DRAW_RECT -+ .export GRAPH_MOVE_RECT -+ .export GRAPH_DRAW_OVAL -+ .export GRAPH_DRAW_IMAGE -+ .export GRAPH_SET_FONT -+ .export GRAPH_GET_CHAR_SIZE -+ .export GRAPH_PUT_CHAR -+ .export RESTORE_BASIC -+ .export CLOCK_SET_DATE_TIME -+ .export CLOCK_GET_DATE_TIME -+ .export JOYSTICK_SCAN -+ .export JOYSTICK_GET -+ .export SCRMOD -+ .export MOUSE_CONFIG -+ .export MOUSE_GET - -- .export CLSALL -- .export JSRFAR -- .export INDFET -- .export INDSTA -- .export INDCMP -- .export PRIMM -+ .export CLSALL -+ .export LKUPLA -+ .export LKUPSA -+ .export PFKEY -+ .export JSRFAR -+ .export INDFET -+ .export INDSTA -+ .export INDCMP -+ .export PRIMM - -- .export CINT -- .export IOINIT -- .export RAMTAS -- .export RESTOR -- .export VECTOR -- .export SETMSG -- .export SECOND -- .export TKSA -- .export MEMTOP -- .export MEMBOT -- .export SCNKEY -- .export SETTMO -- .export ACPTR -- .export CIOUT -- .export UNTLK -- .export UNLSN -- .export LISTEN -- .export TALK -- .export READST -- .export SETLFS -- .export SETNAM -- .export OPEN -- .export CLOSE -- .export CHKIN -- .export CKOUT -- .export CLRCH -- .export BASIN -- .export CHRIN -- .export BSOUT -- .export CHROUT -- .export LOAD -- .export SAVE -- .export SETTIM -- .export RDTIM -- .export STOP -- .export GETIN -- .export CLALL -- .export UDTIM -- .export SCREEN -- .export PLOT -- .export IOBASE -+ .export CINT -+ .export IOINIT -+ .export RAMTAS -+ .export RESTOR -+ .export VECTOR -+ .export SETMSG -+ .export SECOND -+ .export TKSA -+ .export MEMTOP -+ .export MEMBOT -+ .export SCNKEY -+ .export SETTMO -+ .export ACPTR -+ .export CIOUT -+ .export UNTLK -+ .export UNLSN -+ .export LISTEN -+ .export TALK -+ .export READST -+ .export SETLFS -+ .export SETNAM -+ .export OPEN -+ .export CLOSE -+ .export CHKIN -+ .export CKOUT -+ .export CLRCH -+ .export BASIN -+ .export CHRIN -+ .export BSOUT -+ .export CHROUT -+ .export LOAD -+ .export SAVE -+ .export SETTIM -+ .export RDTIM -+ .export STOP -+ .export GETIN -+ .export CLALL -+ .export UDTIM -+ .export SCREEN -+ .export PLOT -+ .export IOBASE -diff --git a/libsrc/cx16/mcbdefault.s b/libsrc/cx16/mcbdefault.s -index d817b9ae..3dda1c71 100644 ---- a/libsrc/cx16/mcbdefault.s -+++ b/libsrc/cx16/mcbdefault.s -@@ -1,53 +1,63 @@ - ; - ; Default mouse callbacks for the CX16 - ; --; 2019-11-09, Greg King -+; 2019-12-25, Greg King - ; --; All functions in this module should be interrupt safe -+; All functions in this module should be interrupt-safe - ; because they might be called from an interrupt handler. - ; - - .export _mouse_def_callbacks - -- .include "cbm_kernal.inc" - .include "cx16.inc" - --; -------------------------------------------------------------------------- --; Hide the mouse pointer. Always called with interrupts disabled. - --.code -+msprite: -+ stz VERA::CTRL ; set address for VERA's data port zero -+ lda #<(VERA::SPRITE::ATTRIB::Z_FLIP + 0 * 8) -+ ldx #>(VERA::SPRITE::ATTRIB::Z_FLIP + 0 * 8) -+ ldy #^(VERA::SPRITE::ATTRIB::Z_FLIP + 0 * 8) | VERA::INC0 -+ sta VERA::ADDR -+ stx VERA::ADDR+1 -+ sty VERA::ADDR+2 -+ rts -+ -+; -------------------------------------------------------------------------- -+; Hide the mouse pointer. - --hide: ldx #$00 ; Don't change sprite's scale -- lda #$00 ; Disable sprite -- jmp MOUSE -+hide: jsr msprite -+ lda VERA::DATA0 -+ and #<~VERA::SPRITE::DEPTH::LAYER1 -+ sta VERA::DATA0 -+ rts - - ; -------------------------------------------------------------------------- --; Show the mouse pointer. Always called with interrupts disabled. -+; Show the mouse pointer. - --show: ldx #$00 -- lda #<-$01 ; Enable sprite -- jmp MOUSE -+show: jsr msprite -+ lda VERA::DATA0 -+ ora #VERA::SPRITE::DEPTH::LAYER1 -+ sta VERA::DATA0 -+ rts - - ; -------------------------------------------------------------------------- --; Prepare to move the mouse pointer. Always called with interrupts disabled. -+; Prepare to move the mouse pointer. - - prep: ; Fall through - - ; -------------------------------------------------------------------------- --; Draw the mouse pointer. Always called with interrupts disabled. -+; Draw the mouse pointer. - - draw: ; Fall through - - ; -------------------------------------------------------------------------- --; Move the mouse pointer X position to the value in .XA . Always called with --; interrupts disabled. -+; Move the mouse pointer X position to the value in .XA . - - movex: ; Already set by drivers - ; Fall through - - ; -------------------------------------------------------------------------- --; Move the mouse pointer Y position to the value in .XA . Always called with --; interrupts disabled. -+; Move the mouse pointer Y position to the value in .XA . - - movey: rts ; Already set by drivers - -diff --git a/libsrc/cx16/mou/cx16-std.s b/libsrc/cx16/mou/cx16-std.s -index eb3f8316..0d046bbc 100644 ---- a/libsrc/cx16/mou/cx16-std.s -+++ b/libsrc/cx16/mou/cx16-std.s -@@ -1,7 +1,7 @@ - ; - ; Driver for the Commander X16 Kernal's mouse driver. - ; --; 2019-11-16, Greg King -+; 2019-12-25, Greg King - ; - - .include "zeropage.inc" -@@ -66,18 +66,16 @@ SCREEN_HEIGHT = 480 - 1 - ;---------------------------------------------------------------------------- - ; Global variables. - --.bss -- --XPos := MOUSEX ; Current mouse position, X --YPos := MOUSEY ; Current mouse position, Y -+XPos := ptr3 ; Current mouse position, X -+YPos := ptr4 ; Current mouse position, Y - --XMin := MOUSEL ; X1 value of bounding box --XMax := MOUSER ; X2 value of bounding box --YMin := MOUSET ; Y1 value of bounding box --YMax := MOUSEB ; Y2 value of bounding box --Box := XMin -+.bss - --Buttons := MOUSEBT ; button status bits -+Box: -+XMin: .res 2 ; X1 value of bounding box -+XMax: .res 2 ; X2 value of bounding box -+YMin: .res 2 ; Y1 value of bounding box -+YMax: .res 2 ; Y2 value of bounding box - - .rodata - -@@ -121,22 +119,22 @@ INSTALL: - bpl @L1 - - ldx #$00 ; Don't change sprite's scale -- lda #$01 ; Initiate and show sprite -- jsr MOUSE -+ lda #$01 ; Create sprite -+ jsr MOUSE_CONFIG - - ; Be sure the mouse cursor is invisible, and at the default location. We - ; need to do that here, because the mouse interrupt handler might not set - ; the mouse position if it hasn't changed. - -- sei - jsr CHIDE -+.if 0 - lda XPos - ldx XPos+1 - jsr CMOVEX - lda YPos - ldx YPos+1 - jsr CMOVEY -- cli -+.endif - - ; Done, return zero - -@@ -148,7 +146,10 @@ INSTALL: - ; UNINSTALL routine -- is called before the driver is removed from memory. - ; No return code required (the driver is removed from memory on return). - --UNINSTALL := HIDE ; Hide cursor on exit -+UNINSTALL: ; Disable mouse on exit -+ lda #$00 -+ tax -+ jmp MOUSE_CONFIG - - ;---------------------------------------------------------------------------- - ; HIDE routine -- is called to hide the mouse pointer. The mouse kernel manages -@@ -181,6 +182,7 @@ SETBOX: sta ptr1 - lda (ptr1) - ldy #$01 - -+ php - sei - sta XMin - lda (ptr1),y -@@ -191,10 +193,12 @@ SETBOX: sta ptr1 - iny - lda (ptr1),y - sta YMax -- cli -+ plp - - rts - -+;; Note: SETBOX and GETBOX currently have no effect! -+ - ;---------------------------------------------------------------------------- - ; GETBOX: Return the mouse bounding box. The parameters are passed as they - ; come from the C program, that is, a pointer to a mouse_box struct in .XA . -@@ -222,7 +226,10 @@ GETBOX: sta ptr1 - ; No checks are done to see if the new position is valid (within - ; the bounding box or the screen). No return code required. - --MOVE: sei ; No interrupts -+;; Note: This function currently has no effect! -+ -+MOVE: php -+ sei ; No interrupts - - sta YPos - stx YPos+1 ; New Y position -@@ -237,14 +244,16 @@ MOVE: sei ; No interrupts - sta XPos ; New X position - jsr CMOVEX ; Move the cursor - -- cli ; Allow interrupts -+ plp ; Allow interrupts - rts - - ;---------------------------------------------------------------------------- - ; BUTTONS: Return the CBM 1351 button mask in .XA . - - BUTTONS: -- lda Buttons -+ ldx #XPos -+ jsr MOUSE_GET -+ - and #%00000111 - tax - lda ButtMask,x -@@ -255,9 +264,9 @@ BUTTONS: - ; POS: Return the mouse position in the MOUSE_POS struct pointed to by ptr1. - ; No return code required. - --POS: ldy #MOUSE_POS::XCOORD ; Structure offset -+POS: jsr BUTTONS - -- sei ; Disable interrupts -+POS1: ldy #MOUSE_POS::XCOORD ; Structure offset - lda XPos ; Transfer the position - sta (ptr1),y - lda XPos+1 -@@ -267,8 +276,6 @@ POS: ldy #MOUSE_POS::XCOORD ; Structure offset - iny - sta (ptr1),y - lda YPos+1 -- cli ; Enable interrupts -- - iny - sta (ptr1),y ; Store last byte - rts ; Done -@@ -282,20 +289,15 @@ POS: ldy #MOUSE_POS::XCOORD ; Structure offset - ; call mouse_pos to initialize the struct pointer, and fill the position - ; fields. - --INFO: jsr POS -- --; Fill in the button state -- -- jsr BUTTONS ; Will not touch ptr1 -+INFO: jsr BUTTONS ; Will not touch ptr1 - ldy #MOUSE_INFO::BUTTONS - sta (ptr1),y -- rts -+ jmp POS1 - - ;---------------------------------------------------------------------------- - ; IOCTL: Driver defined entry point. The wrapper will pass a pointer to ioctl - ; specific data in ptr1, and the ioctl code in A. - ; Must return an error code in .XA . --; - - IOCTL: lda #<MOUSE_ERR_INV_IOCTL ; We don't support ioctls, for now - ldx #>MOUSE_ERR_INV_IOCTL -diff --git a/libsrc/cx16/mouse_stat_stddrv.s b/libsrc/cx16/mouse_stat_stddrv.s -index 1ff8ad43..8e0a3ed5 100644 ---- a/libsrc/cx16/mouse_stat_stddrv.s -+++ b/libsrc/cx16/mouse_stat_stddrv.s -@@ -1,7 +1,7 @@ - ; - ; Address of the static standard mouse driver - ; --; 2019-11-08,Greg King -+; 2019-11-08, Greg King - ; - ; const void mouse_static_stddrv[]; - ; -diff --git a/libsrc/cx16/set_tv.s b/libsrc/cx16/set_tv.s -index 8b802f32..c23568c6 100644 ---- a/libsrc/cx16/set_tv.s -+++ b/libsrc/cx16/set_tv.s -@@ -1,5 +1,5 @@ - ; --; 2019-11-06, Greg King -+; 2019-12-22, Greg King - ; - ; void __fastcall__ set_tv (unsigned char); - ; /* Set the video mode the machine will use. */ -@@ -11,9 +11,6 @@ - - - .proc _set_tv -- php -- sei ; Don't let interrupts interfere -- - ; Point to the video output register. - - stz VERA::CTRL ; Use port 0 -@@ -25,6 +22,5 @@ - stx VERA::ADDR+2 - - sta VERA::DATA0 -- plp ; Re-enable interrupts - rts - .endproc -diff --git a/libsrc/cx16/sysuname.s b/libsrc/cx16/sysuname.s -index f8500936..4aefb7cf 100644 ---- a/libsrc/cx16/sysuname.s -+++ b/libsrc/cx16/sysuname.s -@@ -9,7 +9,7 @@ - - .import utscopy - --__sysuname := utscopy -+__sysuname := utscopy - - ;-------------------------------------------------------------------------- - ; Data. We define a fixed utsname struct here, and just copy it. -diff --git a/libsrc/cx16/tgi_stat_stddrv.s b/libsrc/cx16/tgi_stat_stddrv.s -index 566a3639..e501f4c2 100644 ---- a/libsrc/cx16/tgi_stat_stddrv.s -+++ b/libsrc/cx16/tgi_stat_stddrv.s -@@ -1,11 +1,10 @@ - ; - ; Address of the static standard TGI driver - ; --; 2019-11-06, Greg King -+; 2019-12-22, Greg King - ; - ; const void tgi_static_stddrv[]; - ; - -- .import _cx16_640x4c_tgi -- -- .export _tgi_static_stddrv := _cx16_640x4c_tgi -+ .import _cx16_320x8b_tgi -+ .export _tgi_static_stddrv := _cx16_320x8b_tgi -diff --git a/libsrc/cx16/tgi_stddrv.s b/libsrc/cx16/tgi_stddrv.s -index 0f77e734..0e46a6cb 100644 ---- a/libsrc/cx16/tgi_stddrv.s -+++ b/libsrc/cx16/tgi_stddrv.s -@@ -1,7 +1,7 @@ - ; - ; Name of the standard TGI driver - ; --; 2019-11-06, Greg King -+; 2019-12-22, Greg King - ; - ; const char tgi_stddrv[]; - ; -@@ -9,5 +9,4 @@ - .export _tgi_stddrv - - .rodata -- --_tgi_stddrv: .asciiz "cx16-640x4c.tgi" -+_tgi_stddrv: .asciiz "cx16-320x8b.tgi" -diff --git a/libsrc/cx16/vset.s b/libsrc/cx16/vaddr0.s -similarity index 60% -rename from libsrc/cx16/vset.s -rename to libsrc/cx16/vaddr0.s -index 9178850e..384bf350 100644 ---- a/libsrc/cx16/vset.s -+++ b/libsrc/cx16/vaddr0.s -@@ -1,19 +1,18 @@ - ; --; 2019-10-22, Greg King -+; 2019-12-22, Greg King - ; - ; Set the __far__ address that VERA will use for data access. - ; This is a support function for the fastcall functions vpeek() and vpoke(). - ; - -- .export vset -+ .export vaddr0 - - .importzp sreg - .include "cx16.inc" - - --vset: ldy sreg -- sei ; don't let interrupt handlers interfere -- stz VERA::CTRL ; set address for VERA's data port zero -+vaddr0: stz VERA::CTRL ; set address for VERA's data port zero -+ ldy sreg - sta VERA::ADDR - stx VERA::ADDR+1 - sty VERA::ADDR+2 -diff --git a/libsrc/cx16/vpeek.s b/libsrc/cx16/vpeek.s -index 0c1a9465..80d4d536 100644 ---- a/libsrc/cx16/vpeek.s -+++ b/libsrc/cx16/vpeek.s -@@ -1,5 +1,5 @@ - ; --; 2019-10-22, Greg King -+; 2019-12-22, Greg King - ; - ; unsigned char fastcall vpeek (unsigned long addr); - ; /* Get a byte from a location in VERA's internal address space. */ -@@ -7,13 +7,11 @@ - - .export _vpeek - -- .import vset -+ .import vaddr0 - .include "cx16.inc" - - --_vpeek: php ; (vset blocks interrupts) -- jsr vset ; put VERA's address -+_vpeek: jsr vaddr0 ; put VERA's address - ldx #>$0000 - lda VERA::DATA0 ; read VERA port zero -- plp - rts -diff --git a/libsrc/cx16/vpoke.s b/libsrc/cx16/vpoke.s -index 8c21e9b2..2c8497a5 100644 ---- a/libsrc/cx16/vpoke.s -+++ b/libsrc/cx16/vpoke.s -@@ -1,5 +1,5 @@ - ; --; 2019-10-22, Greg King -+; 2019-12-22, Greg King - ; - ; void fastcall vpoke (unsigned char data, unsigned long addr); - ; /* Put a byte into a location in VERA's internal address space. -@@ -9,13 +9,11 @@ - - .export _vpoke - -- .import vset, popa -+ .import vaddr0, popa - .include "cx16.inc" - - --_vpoke: php ; (vset blocks interrupts) -- jsr vset ; put VERA's address -+_vpoke: jsr vaddr0 ; put VERA's address - jsr popa - sta VERA::DATA0 ; write data to VERA port zero -- plp - rts -diff --git a/libsrc/cx16/waitvsync.s b/libsrc/cx16/waitvsync.s -index 09d01c6a..e8176916 100644 ---- a/libsrc/cx16/waitvsync.s -+++ b/libsrc/cx16/waitvsync.s -@@ -1,9 +1,10 @@ - ; --; 2019-09-26, Greg King -+; 2019-12-23, Greg King - ; - ; void waitvsync (void); -+; /* Wait for the start of the next video field. */ - ; --; VERA's vertical sync causes IRQs which increment the jiffy clock. -+; VERA's vertical sync causes IRQs which increment the jiffy timer. - ; - - .export _waitvsync -@@ -11,7 +12,10 @@ - .include "cx16.inc" - - _waitvsync: -- lda TIME + 2 --: cmp TIME + 2 -+ ldx VIA1::PRA2 ; (TIMER is in RAM bank 0) -+ stz VIA1::PRA2 -+ lda TIMER + 2 -+: cmp TIMER + 2 - beq :- ; Wait for next jiffy -+ stx VIA1::PRA2 - rts -diff --git a/src/ca65/struct.c b/src/ca65/struct.c -index 6d279a70..ecbaa2a7 100644 ---- a/src/ca65/struct.c -+++ b/src/ca65/struct.c -@@ -87,6 +87,7 @@ static long Member (long AllocSize) - /* Check the size for a reasonable value */ - if (AllocSize >= 0x1000000) { - ErrorSkip ("Range error"); -+ AllocSize = 1; - } - - /* Return the size */ -@@ -193,7 +194,13 @@ static long DoStructInternal (long Offs, unsigned Type) - if (CurTok.Tok == TOK_SEP) { - ErrorSkip ("Address is missing"); - } else { -- Offs = Member (1); -+ Offs = ConstExpression (); -+ -+ /* Check the address for a reasonable value */ -+ if (Offs >= 0x1000000) { -+ ErrorSkip ("Range error"); -+ Offs = 0; -+ } - } - break; - --- -2.26.0 - diff --git a/0131-Made-the-program-chaining-exec-handle-the-X16-emulat.patch b/0131-Made-the-program-chaining-exec-handle-the-X16-emulat.patch deleted file mode 100644 index 08602ee..0000000 --- a/0131-Made-the-program-chaining-exec-handle-the-X16-emulat.patch +++ /dev/null @@ -1,47 +0,0 @@ -From f067c4530fb385137a7458011b082690ac1c705e Mon Sep 17 00:00:00 2001 -From: Greg King <gregdk@users.sf.net> -Date: Wed, 25 Dec 2019 14:53:32 -0500 -Subject: [PATCH 131/170] Made the program-chaining exec() handle the X16 - emulator's file-system. - ---- - libsrc/cx16/exec.c | 15 +++++++++------ - 1 file changed, 9 insertions(+), 6 deletions(-) - -diff --git a/libsrc/cx16/exec.c b/libsrc/cx16/exec.c -index 90af4e40..17a547e6 100644 ---- a/libsrc/cx16/exec.c -+++ b/libsrc/cx16/exec.c -@@ -1,7 +1,7 @@ - /* - ** Program-chaining function for Commodore platforms. - ** --** 2019-11-08, Greg King -+** 2019-12-25, Greg King - ** - ** This function exploits the program-chaining feature in Commander X16 BASIC's ROM. - ** -@@ -82,12 +82,15 @@ int __fastcall__ exec (const char* progname, const char* cmdline) - } - utoa (dv, basic.unit, 10); - -- /* Don't try to run a program that doesn't exist. */ -- fd = open (progname, O_RDONLY); -- if (fd < 0) { -- return _mappederrno (4); /* file not found */ -+ /* The emulator supports only loading and saving on its file-system. */ -+ if (dv != 1) { -+ /* Don't try to run a program that doesn't exist. */ -+ fd = open (progname, O_RDONLY); -+ if (fd < 0) { -+ return _mappederrno (4); /* file not found */ -+ } -+ close (fd); - } -- close (fd); - - n = 0; - do { --- -2.26.0 - diff --git a/0132-Added-real-time-clock-functions-to-the-cx16-library.patch b/0132-Added-real-time-clock-functions-to-the-cx16-library.patch deleted file mode 100644 index 26df28e..0000000 --- a/0132-Added-real-time-clock-functions-to-the-cx16-library.patch +++ /dev/null @@ -1,396 +0,0 @@ -From b56ba8f073c186339572b091033e1ebcd88191df Mon Sep 17 00:00:00 2001 -From: Greg King <gregdk@users.sf.net> -Date: Fri, 27 Dec 2019 18:07:37 -0500 -Subject: [PATCH 132/170] Added real-time clock functions to the cx16 library. - ---- - libsrc/cx16/getres.s | 36 +++++++++++++++++++ - libsrc/cx16/gettime.s | 56 +++++++++++++++++++++++++++++ - libsrc/cx16/settime.s | 55 +++++++++++++++++++++++++++++ - libsrc/cx16/status.s | 16 --------- - libsrc/cx16/tmcommon.s | 40 +++++++++++++++++++++ - testcode/lib/clock-test.c | 74 ++++++++++++++++++++++----------------- - 6 files changed, 229 insertions(+), 48 deletions(-) - create mode 100644 libsrc/cx16/getres.s - create mode 100644 libsrc/cx16/gettime.s - create mode 100644 libsrc/cx16/settime.s - delete mode 100644 libsrc/cx16/status.s - create mode 100644 libsrc/cx16/tmcommon.s - -diff --git a/libsrc/cx16/getres.s b/libsrc/cx16/getres.s -new file mode 100644 -index 00000000..dad23701 ---- /dev/null -+++ b/libsrc/cx16/getres.s -@@ -0,0 +1,36 @@ -+; -+; 2019-12-26, Greg King -+; -+; int __fastcall__ clock_getres (clockid_t clk_id, struct timespec *res); -+; -+ -+ .include "time.inc" -+ -+ .importzp ptr1 -+ .import incsp1, return0 -+ -+ -+;---------------------------------------------------------------------------- -+ -+.proc _clock_getres -+ -+ sta ptr1 -+ stx ptr1+1 -+ -+ ldy #.sizeof(timespec) - 1 -+@L1: lda time,y -+ sta (ptr1),y -+ dey -+ bpl @L1 -+ -+ jsr incsp1 -+ jmp return0 -+ -+.endproc -+ -+;---------------------------------------------------------------------------- -+; timespec struct with tv_nsec set to approximately 1/60 of a second -+.rodata -+ -+time: .dword 0 -+ .dword 17 * 1000 * 1000 -diff --git a/libsrc/cx16/gettime.s b/libsrc/cx16/gettime.s -new file mode 100644 -index 00000000..336b0f95 ---- /dev/null -+++ b/libsrc/cx16/gettime.s -@@ -0,0 +1,56 @@ -+; -+; 2019-12-27, Greg King -+; -+; int __fastcall__ clock_gettime (clockid_t clk_id, struct timespec *tp); -+; -+ -+ .include "time.inc" -+ .include "cx16.inc" -+ -+ .import pushax, pusheax, tosmul0ax, steaxspidx, incsp1, return0 -+ .import TM, load_jiffy -+ .import CLOCK_GET_DATE_TIME -+ -+ -+;---------------------------------------------------------------------------- -+ -+.proc _clock_gettime -+ -+ jsr pushax -+ jsr pushax -+ -+ jsr CLOCK_GET_DATE_TIME -+ -+ lda gREG::r0L -+ sta TM + tm::tm_year -+ lda gREG::r0H -+ dec a -+ sta TM + tm::tm_mon -+ lda gREG::r1L -+ sta TM + tm::tm_mday -+ -+ lda gREG::r1H -+ sta TM + tm::tm_hour -+ lda gREG::r2L -+ sta TM + tm::tm_min -+ lda gREG::r2H -+ sta TM + tm::tm_sec -+ -+ lda #<TM -+ ldx #>TM -+ jsr _mktime -+ ldy #timespec::tv_sec -+ jsr steaxspidx ; Pops address pushed by 2. pushax -+ -+ jsr load_jiffy -+ jsr pusheax -+ lda gREG::r3L -+ ldx #>$0000 -+ jsr tosmul0ax -+ ldy #timespec::tv_nsec -+ jsr steaxspidx ; Pops address pushed by 1. pushax -+ -+ jsr incsp1 -+ jmp return0 -+ -+.endproc -diff --git a/libsrc/cx16/settime.s b/libsrc/cx16/settime.s -new file mode 100644 -index 00000000..81749f50 ---- /dev/null -+++ b/libsrc/cx16/settime.s -@@ -0,0 +1,55 @@ -+; -+; 2019-12-27, Greg King -+; -+; int __fastcall__ clock_settime (clockid_t clk_id, const struct timespec *tp); -+; -+ -+ .include "time.inc" -+ .include "cx16.inc" -+ -+ .importzp ptr1 -+ .import pushax, pusheax, ldax0sp, ldeaxidx -+ .import tosdiveax, incsp3, return0 -+ .import load_jiffy -+ .import CLOCK_SET_DATE_TIME -+ -+ -+.macro COPY reg, offset -+ ldy #offset -+ lda (ptr1),y -+ sta gREG::reg -+.endmac -+ -+;---------------------------------------------------------------------------- -+ -+.proc _clock_settime -+ -+ jsr pushax -+ -+ .assert timespec::tv_sec = 0, error -+ jsr _localtime -+ sta ptr1 -+ stx ptr1+1 -+ -+ COPY r0L, tm::tm_year -+ COPY r0H, tm::tm_mon -+ inc gREG::r0H -+ COPY r1L, tm::tm_mday -+ COPY r1H, tm::tm_hour -+ COPY r2L, tm::tm_min -+ COPY r2H, tm::tm_sec -+ -+ jsr ldax0sp ; Get tp -+ ldy #timespec::tv_nsec+3 -+ jsr ldeaxidx ; Get nanoseconds -+ jsr pusheax -+ jsr load_jiffy -+ jsr tosdiveax -+ sta gREG::r3L ; Put number of jiffies -+ -+ jsr CLOCK_SET_DATE_TIME -+ -+ jsr incsp3 -+ jmp return0 -+ -+.endproc -diff --git a/libsrc/cx16/status.s b/libsrc/cx16/status.s -deleted file mode 100644 -index e3446637..00000000 ---- a/libsrc/cx16/status.s -+++ /dev/null -@@ -1,16 +0,0 @@ --; --; 2019-11-05, Greg King --; -- -- .export ST: zp -- --.segment "EXTZP": zp -- --; This is a temporary hack. -- --; A zero-page copy of the IEC status byte. --; This is needed because the Commander X16's Kernal's status --; variable was moved out of the zero page. But, the common --; CBM file function modules import this as a zero-page variable. -- --ST: .res 1 -diff --git a/libsrc/cx16/tmcommon.s b/libsrc/cx16/tmcommon.s -new file mode 100644 -index 00000000..0eed245d ---- /dev/null -+++ b/libsrc/cx16/tmcommon.s -@@ -0,0 +1,40 @@ -+; -+; 2019-12-27, Greg King -+; -+; Common stuff for the clock routines -+; -+ -+ .export TM, load_jiffy -+ -+ .importzp sreg -+ -+ -+;---------------------------------------------------------------------------- -+; Load .EAX with the approximate number of nanoseconds -+; in one jiffy (1/60th of a second). -+ -+.proc load_jiffy -+ -+ lda #<(17 * 1000 * 1000 / $10000) -+ ldx #>(17 * 1000 * 1000 / $10000) -+ sta sreg -+ stx sreg+1 -+ lda #<(17 * 1000 * 1000) -+ ldx #>(17 * 1000 * 1000) -+ rts -+ -+.endproc -+ -+;---------------------------------------------------------------------------- -+; TM struct with "is daylight-saving time" set to "unknown" -+.data -+ -+TM: .word 0 ; tm_sec -+ .word 0 ; tm_min -+ .word 0 ; tm_hour -+ .word 0 ; tm_mday -+ .word 0 ; tm_mon -+ .word 0 ; tm_year -+ .word 0 ; tm_wday -+ .word 0 ; tm_yday -+ .word .loword(-1) ; tm_isdst -diff --git a/testcode/lib/clock-test.c b/testcode/lib/clock-test.c -index e3115d2f..ba4b69e4 100644 ---- a/testcode/lib/clock-test.c -+++ b/testcode/lib/clock-test.c -@@ -1,7 +1,8 @@ --/* Clock test program -- * -- * 25-Sep-2018, chris@groessler.org -- */ -+/* Calendar-clock test program -+** -+** 2018-Sep-25, chris@groessler.org -+** 2019-Dec-27, Greg King -+*/ - - #include <stdio.h> - #include <stdlib.h> -@@ -10,74 +11,83 @@ - #include <errno.h> - - #ifdef __CC65__ --#include <conio.h> --#include <cc65.h> --#endif /* #ifdef __CC65__ */ -+ #include <conio.h> -+ #include <cc65.h> -+#endif - --static void print_time(void) -+static int print_time(void) - { - struct tm *cur_tm; - time_t cur_time = time(NULL); -+ - if (cur_time == -1) { - printf("time() failed: %s\n", strerror(errno)); -- return; -+ return 1; - } - cur_tm = localtime(&cur_time); - - printf("time: %s\n", asctime(cur_tm)); - // DEBUG: -- printf("mday=%d mon=%d year=%d\nhour=%d min=%d sec=%d\n", cur_tm->tm_mday, cur_tm->tm_mon, cur_tm->tm_year, cur_tm->tm_hour, cur_tm->tm_min, cur_tm->tm_sec); -+ printf("year=%d, mon=%d, mday=%d\nhour=%d, min=%d, sec=%d\n", -+ cur_tm->tm_year, cur_tm->tm_mon, cur_tm->tm_mday, -+ cur_tm->tm_hour, cur_tm->tm_min, cur_tm->tm_sec); -+ return 0; - } - - int main(int argc, char **argv) - { -- char c = 0; -+ char c; - int s; - struct tm cur_time; - struct timespec new_time; - - #ifdef __CC65__ -- /* if DOS will automatically clear the screen after the program exits, wait for a keypress... */ -+ /* If DOS automatically will clear the screen after the program exits, -+ ** then wait for a key-press. -+ */ - if (doesclrscrafterexit()) - atexit((void (*)(void))cgetc); - #endif - -- if (argc <= 1) { -- print_time(); -- return 0; -+ if (argc == 1) { -+ return print_time(); - } - -- if (argc != 3 || strcasecmp(*(argv + 1), "set")) { -- printf("usage: CLOCKTST [set DD-MM-YY-HH-MM-SS]\n"); -+ if (argc != 2) { -+#ifdef __CC65__ -+ printf("Usage: run:rem [YY-MM-DD-HH-MM-SS]\n"); -+#else -+ printf("Usage: %s [YY-MM-DD-HH-MM-SS]\n", argv[0]); -+#endif - return 1; - } - -- memset(&cur_time, 0, sizeof(cur_time)); -- s = sscanf(*(argv + 2), "%d-%d-%d-%d-%d-%d", &cur_time.tm_mday, &cur_time.tm_mon, &cur_time.tm_year, &cur_time.tm_hour, &cur_time.tm_min, &cur_time.tm_sec); -- if (s != 6 || cur_time.tm_year > 99 /* other input values aren't being verified... */) { -- printf("invalid time/date format\n"); -+ memset(&cur_time, 0, sizeof cur_time); -+ s = sscanf(argv[1], "%d-%d-%d-%d-%d-%d", -+ &cur_time.tm_year, &cur_time.tm_mon, &cur_time.tm_mday, -+ &cur_time.tm_hour, &cur_time.tm_min, &cur_time.tm_sec); -+ if (s != 6 || cur_time.tm_year > 99 /* other input values aren't being verified */) { -+ printf("Invalid date-time format\n"); - return 1; - } -+ cur_time.tm_year += 100; /* assume 21st century */ - --cur_time.tm_mon; -- if (cur_time.tm_year < 79) -- cur_time.tm_year += 100; /* adjust century */ - -- memset(&new_time, 0, sizeof(new_time)); -+ memset(&new_time, 0, sizeof new_time); - new_time.tv_sec = mktime(&cur_time); - -- printf("\nyou are about to set the time to\n--> %s\n\nContinue (y/n)?", ctime(&new_time.tv_sec)); -- -- while (c != 'y' && c != 'Y' && c != 'n' && c != 'N') { -+ printf("\nYou are about to set the time to\n--> %s\nContinue (y/n)? ", ctime(&new_time.tv_sec)); -+ do { - #ifdef __CC65__ - c = cgetc(); - #else - c = getchar(); - #endif -- } -+ } while (c != 'y' && c != 'Y' && c != 'n' && c != 'N'); - printf("%c\n", c); - - if (c == 'n' || c == 'N') { -- printf("user abort\n"); -+ printf("User abort\n"); - return 0; - } - -@@ -86,11 +96,11 @@ int main(int argc, char **argv) - printf("clock_settime() failed: %s\n", strerror(errno)); - return 1; - } -- printf("time set!\n"); -+ printf("Time set!\n\n"); -+ - //DEBUG test begin -- print_time(); -+ return print_time(); - //DEBUG test end -- return 0; - } - /* Local Variables: */ - /* c-file-style: "cpg" */ --- -2.26.0 - diff --git a/0133-Fixed-the-target-guards-around-the-usage-messages.patch b/0133-Fixed-the-target-guards-around-the-usage-messages.patch deleted file mode 100644 index 9e9399f..0000000 --- a/0133-Fixed-the-target-guards-around-the-usage-messages.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 00ab3c2d34b63cdadace7827e2f148db983d48eb Mon Sep 17 00:00:00 2001 -From: Greg King <gregdk@users.sf.net> -Date: Mon, 30 Dec 2019 19:53:39 -0500 -Subject: [PATCH 133/170] Fixed the target guards around the usage messages. - ---- - testcode/lib/clock-test.c | 8 +++++--- - 1 file changed, 5 insertions(+), 3 deletions(-) - -diff --git a/testcode/lib/clock-test.c b/testcode/lib/clock-test.c -index ba4b69e4..355e69d9 100644 ---- a/testcode/lib/clock-test.c -+++ b/testcode/lib/clock-test.c -@@ -1,7 +1,7 @@ - /* Calendar-clock test program - ** - ** 2018-Sep-25, chris@groessler.org --** 2019-Dec-27, Greg King -+** 2019-Dec-30, Greg King - */ - - #include <stdio.h> -@@ -54,8 +54,10 @@ int main(int argc, char **argv) - } - - if (argc != 2) { --#ifdef __CC65__ -- printf("Usage: run:rem [YY-MM-DD-HH-MM-SS]\n"); -+#if defined(__APPLE2__) -+ printf("USAGE: CALL2051 [:REM YY-MM-DD-HH-MM-SS]\n"); -+#elif defined(__ATMOS__) || defined(__CBM__) -+ printf("Usage: run [:rem YY-MM-DD-HH-MM-SS]\n"); - #else - printf("Usage: %s [YY-MM-DD-HH-MM-SS]\n", argv[0]); - #endif --- -2.26.0 - diff --git a/0134-Made-ca65-give-error-messages-when-it-sees-duplicate.patch b/0134-Made-ca65-give-error-messages-when-it-sees-duplicate.patch deleted file mode 100644 index d5d5dbf..0000000 --- a/0134-Made-ca65-give-error-messages-when-it-sees-duplicate.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 5109c0b68f7a2cd07ece07b6812affeab07ae17a Mon Sep 17 00:00:00 2001 -From: Greg King <gregdk@users.sf.net> -Date: Thu, 2 Jan 2020 04:26:02 -0500 -Subject: [PATCH 134/170] Made ca65 give error messages when it sees duplicate - .define commands. - ---- - src/ca65/pseudo.c | 21 +++++++++++++++------ - 1 file changed, 15 insertions(+), 6 deletions(-) - -diff --git a/src/ca65/pseudo.c b/src/ca65/pseudo.c -index a0eb2869..5b2ef057 100644 ---- a/src/ca65/pseudo.c -+++ b/src/ca65/pseudo.c -@@ -821,8 +821,17 @@ static void DoDebugInfo (void) - - - static void DoDefine (void) --/* Define a one line macro */ -+/* Define a one-line macro */ - { -+ /* The function is called with the .DEFINE token in place, because we need -+ ** to disable .define macro expansions before reading the next token. -+ ** Otherwise, the name of the macro might be expanded; therefore, -+ ** we never would see it. -+ */ -+ DisableDefineStyleMacros (); -+ NextTok (); -+ EnableDefineStyleMacros (); -+ - MacDef (MAC_STYLE_DEFINE); - } - -@@ -1871,12 +1880,12 @@ static void DoTag (void) - - - static void DoUnDef (void) --/* Undefine a define style macro */ -+/* Undefine a define-style macro */ - { - /* The function is called with the .UNDEF token in place, because we need - ** to disable .define macro expansions before reading the next token. -- ** Otherwise the name of the macro would be expanded, so we would never -- ** see it. -+ ** Otherwise, the name of the macro would be expanded; therefore, -+ ** we never would see it. - */ - DisableDefineStyleMacros (); - NextTok (); -@@ -1962,7 +1971,7 @@ static void DoZeropage (void) - /* Control commands flags */ - enum { - ccNone = 0x0000, /* No special flags */ -- ccKeepToken = 0x0001 /* Do not skip the current token */ -+ ccKeepToken = 0x0001 /* Do not skip the control token */ - }; - - /* Control command table */ -@@ -2001,7 +2010,7 @@ static CtrlDesc CtrlCmdTab [] = { - { ccNone, DoDbg, }, - { ccNone, DoDByt }, - { ccNone, DoDebugInfo }, -- { ccNone, DoDefine }, -+ { ccKeepToken, DoDefine }, - { ccNone, DoUnexpected }, /* .DEFINED */ - { ccNone, DoUnexpected }, /* .DEFINEDMACRO */ - { ccNone, DoDelMac }, --- -2.26.0 - diff --git a/0135-Changes-in-INSTALL-routine-from-emd-c128-vdc.s.patch b/0135-Changes-in-INSTALL-routine-from-emd-c128-vdc.s.patch deleted file mode 100644 index 32a9160..0000000 --- a/0135-Changes-in-INSTALL-routine-from-emd-c128-vdc.s.patch +++ /dev/null @@ -1,124 +0,0 @@ -From 2a421396740049244d85e1591fdec91ae6d5fa08 Mon Sep 17 00:00:00 2001 -From: mc78 <mc78@outlook.de> -Date: Fri, 29 Nov 2019 11:20:58 +0100 -Subject: [PATCH 135/170] Changes in INSTALL routine from emd/c128-vdc.s. tmp1 - was used at two places resulting in the bug that VDC_CSET was set to garbage - on 16k VDC. pagecount and curpage were not reset on INSTALL resulting in - non-reentrant code on static linkage of emd driver. - ---- - libsrc/c128/emd/c128-vdc.s | 48 +++++++++++++++++++++++--------------- - 1 file changed, 29 insertions(+), 19 deletions(-) - -diff --git a/libsrc/c128/emd/c128-vdc.s b/libsrc/c128/emd/c128-vdc.s -index d915fdf2..3f08b0a7 100644 ---- a/libsrc/c128/emd/c128-vdc.s -+++ b/libsrc/c128/emd/c128-vdc.s -@@ -52,13 +52,11 @@ VDC_DATA = 31 - ; ------------------------------------------------------------------------ - ; Data. - --.data -- --pagecount: .word 64 ; $0000-$3fff as 16k default --curpage: .word $ffff ; currently mapped-in page (invalid) -- - .bss - -+pagecount: .res 1 ; $0000-$3fff as 16k default -+curpage: .res 2 ; currently mapped-in page (invalid) -+vdc_cset_save: .res 1 - window: .res 256 ; memory window - - .code -@@ -71,11 +69,15 @@ window: .res 256 ; memory window - ; - - INSTALL: -+ ; reset mapped-in page to invalid -+ lda #$ff -+ sta curpage -+ sta curpage+1 -+ - ; do test for VDC presence here??? -- - ldx #VDC_CSET ; determine size of RAM... - jsr vdcgetreg -- sta tmp1 -+ sta vdc_cset_save - ora #%00010000 - jsr vdcputreg ; turn on 64k - -@@ -94,35 +96,39 @@ INSTALL: - lda tmp2 - jsr vdcputbyte ; restore original value of test byte - -+ ldx #0 ; prepare x with hi of default pagecount -+ - lda ptr1 ; do bytes match? - cmp ptr1+1 - bne @have64k - lda ptr2 - cmp ptr2+1 - bne @have64k -- -- ldx #VDC_CSET -- lda tmp1 -- jsr vdcputreg ; restore 16/64k flag -- jmp @endok ; and leave default values for 16k -- --@have64k: -- lda #<256 -- ldx #>256 -+ -+ lda #64 ; assumes x = 0, here -> p.c = 64 -+ bne @setpagecnt -+@have64k: -+ txa ; assumes x = 0, here -+ inx ; so that a/x becomes 0/1 -> p.c. = 256 -+@setpagecnt: - sta pagecount - stx pagecount+1 --@endok: -+ -+ ldx #VDC_CSET ; restore 16/64k flag -+ lda vdc_cset_save -+ jsr vdcputreg -+ - lda #<EM_ERR_OK - ldx #>EM_ERR_OK - rts - - test64k: -- sta tmp1 -+ sta tmp3 - sty ptr3 - lda #0 - sta ptr3+1 - jsr settestadr1 -- lda tmp1 -+ lda tmp3 - jsr vdcputbyte ; write $55 - jsr settestadr1 - jsr vdcgetbyte ; read here -@@ -199,6 +205,8 @@ transferin: - lda VDC_DATA_REG ; get 2 bytes at a time to speed-up - sta (ptr2),y ; (in fact up to 8 bytes could be fetched with special VDC config) - iny -+@L1: bit VDC_ADDR_REG ; XXX: Test waiting for register 31 -+ bpl @L1 - lda VDC_DATA_REG - sta (ptr2),y - iny -@@ -334,6 +342,8 @@ vdcsetsrcaddr: - dex - tya - stx VDC_ADDR_REG -+@L1: bit VDC_ADDR_REG ; XXX: Test waiting for register 18 -+ bpl @L1 - sta VDC_DATA_REG - rts - --- -2.26.0 - diff --git a/0136-Added-reservation-of-second-byte-for-pagecount.patch b/0136-Added-reservation-of-second-byte-for-pagecount.patch deleted file mode 100644 index e1235de..0000000 --- a/0136-Added-reservation-of-second-byte-for-pagecount.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 390878e831efdc73fc7698836762952dac53ffd9 Mon Sep 17 00:00:00 2001 -From: mc78 <mc78@outlook.de> -Date: Fri, 29 Nov 2019 11:47:34 +0100 -Subject: [PATCH 136/170] Added reservation of second byte for pagecount - ---- - libsrc/c128/emd/c128-vdc.s | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libsrc/c128/emd/c128-vdc.s b/libsrc/c128/emd/c128-vdc.s -index 3f08b0a7..842059c3 100644 ---- a/libsrc/c128/emd/c128-vdc.s -+++ b/libsrc/c128/emd/c128-vdc.s -@@ -54,7 +54,7 @@ VDC_DATA = 31 - - .bss - --pagecount: .res 1 ; $0000-$3fff as 16k default -+pagecount: .res 2 ; $0000-$3fff as 16k default - curpage: .res 2 ; currently mapped-in page (invalid) - vdc_cset_save: .res 1 - window: .res 256 ; memory window --- -2.26.0 - diff --git a/0137-Changed-the-order-in-which-lo-hi-bytes-of-vdc-addr-a.patch b/0137-Changed-the-order-in-which-lo-hi-bytes-of-vdc-addr-a.patch deleted file mode 100644 index 7255f3d..0000000 --- a/0137-Changed-the-order-in-which-lo-hi-bytes-of-vdc-addr-a.patch +++ /dev/null @@ -1,87 +0,0 @@ -From 244dc358e55a9b86a7281d40a576355c21268f30 Mon Sep 17 00:00:00 2001 -From: mc78 <mc78@outlook.de> -Date: Sun, 1 Dec 2019 13:25:14 +0100 -Subject: [PATCH 137/170] Changed the order in which lo/hi bytes of vdc addr - are set according to willimanilys ((z64k) suggestions. Changed offset for vdc - ramsize detection from 000 to 000. - ---- - libsrc/c128/emd/c128-vdc.s | 22 ++++++++++++---------- - 1 file changed, 12 insertions(+), 10 deletions(-) - -diff --git a/libsrc/c128/emd/c128-vdc.s b/libsrc/c128/emd/c128-vdc.s -index 842059c3..e359dcdb 100644 ---- a/libsrc/c128/emd/c128-vdc.s -+++ b/libsrc/c128/emd/c128-vdc.s -@@ -104,7 +104,7 @@ INSTALL: - lda ptr2 - cmp ptr2+1 - bne @have64k -- -+ - lda #64 ; assumes x = 0, here -> p.c = 64 - bne @setpagecnt - @have64k: -@@ -113,22 +113,25 @@ INSTALL: - @setpagecnt: - sta pagecount - stx pagecount+1 -+ -+ txa -+ bne @keep64kBit - - ldx #VDC_CSET ; restore 16/64k flag - lda vdc_cset_save -- jsr vdcputreg -- -+ jsr vdcputreg -+@keep64kBit: - lda #<EM_ERR_OK - ldx #>EM_ERR_OK - rts - - test64k: -- sta tmp3 -+ sta tmp1 - sty ptr3 - lda #0 - sta ptr3+1 - jsr settestadr1 -- lda tmp3 -+ lda tmp1 - jsr vdcputbyte ; write $55 - jsr settestadr1 - jsr vdcgetbyte ; read here -@@ -146,7 +149,7 @@ settestadr1: - ldy #$02 ; test page 2 (here) - .byte $2c - settestadr2: -- ldy #$42 ; or page 64+2 (there) -+ ldy #$82 ; or page 64+2 (there) - lda #0 - jmp vdcsetsrcaddr - -@@ -334,17 +337,16 @@ COPYTO: - ; - - vdcsetsrcaddr: -- ldx #VDC_DATA_LO -+ ldx #VDC_DATA_HI - stx VDC_ADDR_REG - @L0: bit VDC_ADDR_REG - bpl @L0 - sta VDC_DATA_REG -- dex -- tya -+ inx - stx VDC_ADDR_REG - @L1: bit VDC_ADDR_REG ; XXX: Test waiting for register 18 - bpl @L1 -- sta VDC_DATA_REG -+ sty VDC_DATA_REG - rts - - vdcgetbyte: --- -2.26.0 - diff --git a/0138-Updated-the-cx16-library-to-the-ROM-s-prerelease-36.patch b/0138-Updated-the-cx16-library-to-the-ROM-s-prerelease-36.patch deleted file mode 100644 index 710596f..0000000 --- a/0138-Updated-the-cx16-library-to-the-ROM-s-prerelease-36.patch +++ /dev/null @@ -1,1186 +0,0 @@ -From b66f7272af4c566df6205f55296ac365ecbf8c73 Mon Sep 17 00:00:00 2001 -From: Greg King <gregdk@users.sf.net> -Date: Fri, 10 Jan 2020 15:17:23 -0500 -Subject: [PATCH 138/170] Updated the cx16 library to the ROM's prerelease 36. - ---- - asminc/cbm_kernal.inc | 15 +++- - asminc/cx16.inc | 137 +++++++++++++++++++++++++++---------- - doc/cx16.sgml | 8 +-- - doc/funcref.sgml | 44 ++++++++++-- - doc/library.sgml | 118 +++++++++++++++++--------------- - include/cbm.h | 1 + - include/cx16.h | 84 +++++++++++++++-------- - libsrc/cbm/c_settim.s | 16 +++++ - libsrc/cx16/clock.s | 1 - - libsrc/cx16/color.s | 2 +- - libsrc/cx16/crt0.s | 6 +- - libsrc/cx16/get_numbanks.s | 20 ++++++ - libsrc/cx16/joyref.s | 20 ------ - libsrc/cx16/kbhit.s | 8 +-- - libsrc/cx16/kernal.s | 14 +++- - libsrc/cx16/libref.s | 4 +- - libsrc/cx16/mcbdefault.s | 37 +++------- - libsrc/cx16/videomode.s | 28 ++++---- - libsrc/cx16/waitvsync.s | 8 +-- - 19 files changed, 357 insertions(+), 214 deletions(-) - create mode 100644 libsrc/cbm/c_settim.s - create mode 100644 libsrc/cx16/get_numbanks.s - delete mode 100644 libsrc/cx16/joyref.s - -diff --git a/asminc/cbm_kernal.inc b/asminc/cbm_kernal.inc -index 86a60d49..7125f125 100644 ---- a/asminc/cbm_kernal.inc -+++ b/asminc/cbm_kernal.inc -@@ -1,11 +1,21 @@ - ; - ; Olli Savia <ops@iki.fi> -+; Greg King - ; --; Commodore Kernal functions -+; Commodore-compatibles Kernal functions - ; - - .if .def(__CX16__) - ; CX16 extended jump table -+ CONSOLE_INIT := $FEDB -+ CONSOLE_PUT_CHAR := $FEDE -+ CONSOLE_GET_CHAR := $FEE1 -+ MEMORY_FILL := $FEE4 -+ MEMORY_COPY := $FEE7 -+ MEMORY_CRC := $FEEA -+ MEMORY_DECOMPRESS := $FEED -+ SPRITE_SET_IMAGE := $FEF0 -+ SPRITE_SET_POSITION := $FEF3 - FB_INIT := $FEF6 - FB_GET_INFO := $FEF9 - FB_SET_PALETTE := $FEFC -@@ -37,7 +47,8 @@ - CLOCK_GET_DATE_TIME := $FF50 - JOYSTICK_SCAN := $FF53 - JOYSTICK_GET := $FF56 -- SCRMOD := $FF5F -+ SCREEN_SET_MODE := $FF5F -+ SCREEN_SET_CHARSET := $FF62 - MOUSE_CONFIG := $FF68 - MOUSE_GET := $FF6B - .endif -diff --git a/asminc/cx16.inc b/asminc/cx16.inc -index e08215df..06cc3019 100644 ---- a/asminc/cx16.inc -+++ b/asminc/cx16.inc -@@ -1,5 +1,5 @@ - ; --; CX16 r35 definitions -+; CX16 r36 definitions - ; - - ; --------------------------------------------------------------------------- -@@ -17,7 +17,8 @@ - YELLOW - ORANGE - BROWN -- LIGHTRED -+ PINK -+ LIGHTRED = PINK - GRAY1 - GRAY2 - LIGHTGREEN -@@ -25,20 +26,81 @@ - GRAY3 - .endenum - --; Special keys --.enum KEY -- F1 = $85 -- F3 -- F5 -- F7 -- F2 -- F4 -- F6 -- F8 -- F9 = $10 -- F10 = $15 -- F11 -- F12 -+; Special characters -+.enum CH -+COLOR_SWAP = $01 -+STOP = $03 -+UNDERLINE -+WHITE -+BOLD -+BELL -+BACKSPACE -+TAB -+LINEFEED -+ITALIC -+OUTLINE -+ENTER -+FONT_LOWER -+FONT_ISO -+F9 -+CURS_DOWN -+REVERSE -+HOME -+DEL -+F10 -+F11 -+F12 -+SHIFT_TAB -+RED = $1C -+CURS_RIGHT -+GREEN -+BLUE -+LIRA = $5C -+ORANGE = $81 -+RUN = $83 -+HELP -+F1 -+F3 -+F5 -+F7 -+F2 -+F4 -+F6 -+F8 -+SHIFT_ENTER -+FONT_UPPER -+FONT_PET -+BLACK -+CURS_UP -+ATTR_CLEAR -+SCRN_CLEAR -+INS -+BROWN -+PINK -+LIGHTRED = PINK -+GRAY1 -+GRAY2 -+LIGHTGREEN -+LIGHTBLUE -+GRAY3 -+PURPLE -+VIOLET = PURPLE -+CURS_LEFT -+YELLOW -+CYAN -+SHIFT_SPACE -+LTEE = $AB -+LLCORNER = $AD -+URCORNER -+ULCORNER = $B0 -+BTEE -+TTEE -+RTEE -+LRCORNER = $BD -+HLINE = $C0 -+CROSS = $DB -+VLINE = $DD -+PI - .endenum - - ; --------------------------------------------------------------------------- -@@ -162,10 +224,9 @@ - .endstruct - - ; Kernal --FNAM := $84 ; Pointer to filename --KTEMP2 := $86 ; 2 bytes for temporary storage --IMPARM := $88 ; Pointer for PRIMM function --SCREEN_PTR := $90 ; Pointer to current row on text screen (16 bits) -+KTEMP2 := $80 ; 2 bytes for temporary storage -+IMPARM := $82 ; Pointer for PRIMM function -+FNAM := $8C ; Pointer to filename - - ; BASIC - TXTPTR := $EE ; Pointer into BASIC source code -@@ -175,23 +236,25 @@ TXTPTR := $EE ; Pointer into BASIC source code - BASIC_BUF := $0200 ; Location of command-line - BASIC_BUF_LEN = 81 ; Maximum length of command-line - --STATUS := $0275 ; Status from previous I/O operation --IN_DEV := $0279 ; Current input device number --OUT_DEV := $027A ; Current output device number --FNAM_LEN := $027D ; Length of filename --SECADR := $027F ; Secondary address --DEVNUM := $0280 ; Device number -+SCREEN_MODE := $0262 ; Current screen mode (set by SCREEN_SET_MODE) -+SCREEN_PTR := $0263 ; Pointer to current row on text screen (16 bits) -+STATUS := $0286 ; Status from previous I/O operation -+IN_DEV := $028A ; Current input device number -+OUT_DEV := $028B ; Current output device number -+FNAM_LEN := $028E ; Length of filename -+SECADR := $0290 ; Secondary address -+DEVNUM := $0291 ; Device number - CURS_COLOR := $0373 ; Color under the cursor --CHARCOLOR := $0377 ; Cursor's color nybbles (high: background, low: foreground) --RVS := $0378 ; Reverse flag --CURS_FLAG := $037C ; 1 = cursor off --CURS_BLINK := $037D ; Blink counter --CURS_CHAR := $037E ; Character under the cursor --CURS_STATE := $037F ; Cursor blink state --CURS_X := $0381 ; Cursor column --CURS_Y := $0384 ; Cursor row --LLEN := $0387 ; Line length --NLINES := $0388 ; Number of screen lines -+CHARCOLOR := $0376 ; Cursor's color nybbles (high: background, low: foreground) -+RVS := $0377 ; Reverse flag -+CURS_FLAG := $037B ; 1 = cursor off -+CURS_BLINK := $037C ; Blink counter -+CURS_CHAR := $037D ; Character under the cursor -+CURS_STATE := $037E ; Cursor blink state -+CURS_X := $0380 ; Cursor column -+CURS_Y := $0383 ; Cursor row -+LLEN := $0386 ; Line length -+NLINES := $0387 ; Number of screen lines - - ; BASIC - VARTAB := $03E3 ; Pointer to start of BASIC variables -@@ -453,7 +516,7 @@ NMIVec := $0318 - ; --------------------------------------------------------------------------- - ; Banked RAM and ROM - --KEY_COUNT := $A00A ; (bank 0) Number of keys in input buffer -+KEY_COUNT := $A00B ; (bank 0) Number of keys in input buffer - TIMER := $A03E ; (bank 0) 60 Hz. timer (3 bytes, big-endian) - - .struct BANK -diff --git a/doc/cx16.sgml b/doc/cx16.sgml -index ca9a50ed..20094d60 100644 ---- a/doc/cx16.sgml -+++ b/doc/cx16.sgml -@@ -46,9 +46,9 @@ file and linker config. - <sect>Memory layout<p> - - cc65-generated programs with the default setup run with the I/O area, RAM bank --zero, and the Kernal ROM visible. That means that Kernal entry points can be --called directly. The usable memory ranges are $0800 - $9EFF and --$A000 - $BFFF. -+one, and the Kernal ROM being visible. That means that Kernal entry points -+can be called directly. The usable memory ranges are $0800 - -+$9EFF, $0400 - $07FF, and $A000 - $BFFF. - - Special locations: - -@@ -77,7 +77,7 @@ The ld65 linker comes with a default config. file for the Commander X16, which - is used via <tt/-t cx16/. The cx16 package comes with additional secondary - linker config. files which are used via <tt/-t cx16 -C <configfile>/. - --Those files use 126 bytes in the zero page. (The rest of page zero is reserved -+Those files use 94 bytes in the zero page. (The rest of page zero is reserved - for Kernal and BASIC.) - - -diff --git a/doc/funcref.sgml b/doc/funcref.sgml -index c2b46f0f..b6171a0e 100644 ---- a/doc/funcref.sgml -+++ b/doc/funcref.sgml -@@ -17,9 +17,9 @@ the C functions available in the standard library. - - <sect>Introduction<p> - --cc65 is a C compiler for 6502 based systems. It implements a subset of the ISO -+cc65 is a C compiler for 6502-based systems. It implements a subset of the ISO - C standard plus additional functions specially crafted for 6502 systems or --just some of the supported machines. This function refrence describes the -+just some of the supported machines. This function reference describes the - available functions together with any limitations. - - For an overview about the available libraries, their purpose, and any -@@ -27,8 +27,8 @@ differences to the ISO standard, please have a look at the <url - url="library.html" name="cc65 Library Overview">. - - <em/Note:/ Standard C functions are listed here, but not described in detail. --Since these functions behave identical on all standard compliant systems, they --are described in any book covering standard C. -+Because those functions behave identically on all standard-compliant systems, -+they are described in any book covering standard C. - - Each entry for a function contains a detailed description - -@@ -200,6 +200,7 @@ function. - <item><ref id="cbm_k_second" name="cbm_k_second"> - <item><ref id="cbm_k_setlfs" name="cbm_k_setlfs"> - <item><ref id="cbm_k_setnam" name="cbm_k_setnam"> -+<item><ref id="cbm_k_settim" name="cbm_k_settim"> - <item><ref id="cbm_k_talk" name="cbm_k_talk"> - <item><ref id="cbm_k_tksa" name="cbm_k_tksa"> - <item><ref id="cbm_k_udtim" name="cbm_k_udtim"> -@@ -321,6 +322,7 @@ function. - <sect1><tt/cx16.h/<label id="cx16.h"><p> - - <itemize> -+<!-- <item><ref id="get_numbanks" name="get_numbanks"> --> - <!-- <item><ref id="get_ostype" name="get_ostype"> --> - <!-- <item><ref id="get_tv" name="get_tv"> --> - <!-- <item><ref id="set_tv" name="set_tv"> --> -@@ -2281,6 +2283,9 @@ only be used in presence of a prototype. - </itemize> - <tag/Availability/cc65 - <tag/See also/ -+<ref id="cbm_k_load" name="cbm_k_load">, -+<ref id="cbm_k_open" name="cbm_k_open">, -+<ref id="cbm_k_save" name="cbm_k_save">, - <ref id="cbm_k_setnam" name="cbm_k_setnam"> - <tag/Example/None. - </descrip> -@@ -2302,9 +2307,34 @@ only be used in presence of a prototype. - </itemize> - <tag/Availability/cc65 - <tag/See also/ --<ref id="cbm_k_open" name="cbm_k_open">, - <ref id="cbm_k_load" name="cbm_k_load">, --<ref id="cbm_k_save" name="cbm_k_save"> -+<ref id="cbm_k_open" name="cbm_k_open">, -+<ref id="cbm_k_save" name="cbm_k_save">, -+<ref id="cbm_k_setlfs" name="cbm_k_setlfs"> -+<tag/Example/None. -+</descrip> -+</quote> -+ -+ -+<sect1>cbm_k_settim<label id="cbm_k_settim"><p> -+ -+<quote> -+<descrip> -+<tag/Function/Set the Jiffy clock. -+<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/ -+<tag/Declaration/<tt/void __fastcall__ cbm_k_settim (unsigned long timer);/ -+<tag/Description/This function changes the Jiffy clock to a different value. -+That clock counts sixtieths of a second. It is used by the library's -+<tt/clock()/ function. The Jiffy clock is updated by the Kernal's Interrupt -+Service Routine. -+<tag/Notes/<itemize> -+<item>The function is available only as a fastcall function; therefore, it may -+be used only in the presence of a prototype. -+</itemize> -+<tag/Availability/cc65 -+<tag/See also/ -+<ref id="cbm_k_udtim" name="cbm_k_udtim">, -+<ref id="clock" name="clock"> - <tag/Example/None. - </descrip> - </quote> -@@ -2368,6 +2398,7 @@ then that ISR must call this function, in order to keep the clock valid. - <tag/Availability/cc65 - <tag/See also/ - <ref id="cbm_k_scnkey" name="cbm_k_scnkey">, -+<ref id="cbm_k_settim" name="cbm_k_settim">, - <ref id="clock" name="clock"> - <tag/Example/None. - </descrip> -@@ -2585,6 +2616,7 @@ changing values. (See the description of <tt/cbm_k_udtim()/.) - </itemize> - <tag/Availability/ISO 9899 - <tag/See also/ -+<ref id="cbm_k_settim" name="cbm_k_settim">, - <ref id="cbm_k_udtim" name="cbm_k_udtim">, - <ref id="time" name="time"> - <tag/Example/None. -diff --git a/doc/library.sgml b/doc/library.sgml -index e8ca8465..303809c5 100644 ---- a/doc/library.sgml -+++ b/doc/library.sgml -@@ -18,22 +18,22 @@ including a discussion of the differences to the ISO standard. - - This file contains a short overview of the libraries available for the cc65 C - compiler. Please have a look at the <url url="funcref.html" name="function --reference"> for a list function by function. Since the function reference is --not complete (I'm working on that) it may happen that you don't find a --specific function. In this case, have a look into the header files. All --functions, that are not defined by the ISO C standard have a short comment in -+reference"> for a function-by-function list. Because the function reference is -+not complete (we're working on that), it may happen that you don't find a -+specific function. In that case, have a look into the header files. All -+functions, that are not defined by the ISO C standard, have a short comment in - the headers, explaining their use. - - - - <sect>ISO C compatible library<p> - --The C library contains a large subset of the ISO C library. Functions are --usually missing in areas, where there is no support on typical 6502 systems. --Wide character sets are an example for this. -+The C library contains a large subset of the ISO C library. Functions usually -+are missing in areas where there are no support on typical 6502 systems. -+Wide-character sets are an example for that. - - I will not go into detail about the ISO functions. If a function is not --mentioned here explicitly, expect it to be available and to behave as defined -+mentioned here explicitly, expect it to be available, and to behave as defined - in the C standard. - - Functions that are <em/not/ available: -@@ -45,13 +45,13 @@ Functions that are <em/not/ available: - <p> - <item>All functions that handle floating point numbers in some manner. - <p> -- <item>The <tt/ldiv/ function (cc65 is currently not able to return structs -- with a size not equal to 1, 2 or 4 bytes by value). -+ <item>The <tt/ldiv/ function (cc65 currently is not able to return structs, -+ by value, with a size not equal to 1, 2, or 4 bytes). - <p> -- <item>All functions handling wide character strings. -+ <item>All functions handling wide-character strings. - <p> - <item>Signals and all related functions (having <tt/SIGSEGV/ would be -- cool:-) -+ cool. :-) - <p> - <item><tt>setbuf/setvbuf</tt> - </itemize> -@@ -60,7 +60,7 @@ Functions not available on all supported systems: - - <itemize> - <item><tt>fopen/fread/fwrite/fclose/fputs/fgets/fscanf</tt>: The functions -- are built on open/read/write/close. These latter functions are not available -+ are built on open/read/write/close. Those latter functions are not available - on all systems. - <p> - <item><tt>ftell/fseek/fgetpos/fsetpos</tt>: Support depends on the -@@ -69,94 +69,95 @@ Functions not available on all supported systems: - <item><tt>rename/remove/rewind</tt>: Support depends on the capabilities of - the target machine. - <p> -- <item><tt>time</tt>: Since many of the supported systems do not have a real -- time clock, which means that the <tt/time/ function is not available. Please -- note that the other functions from <tt/time.h/ <em/are/ available. -+ <item><tt>time</tt>: Many of the supported systems don't have a real-time -+ clock, which means that the <tt/time/ function is not available. Please note -+ that the other functions from <tt/time.h/ <em/are/ available. - </itemize> - - - Functions that are limited in any way: - - <itemize> -- <item><tt>strcspn/strpbrk/strspn</tt>: These functions have a length -- limitation of 256 for the second string argument. Since this string gives a -- character set, and there are only 256 distinct characters, this shouldn't be -+ <item><tt>strcspn/strpbrk/strspn</tt>: Those functions have a length -+ limitation of 256 for the second string argument. Since that string gives a -+ character set, and there are only 256 distinct characters, that shouldn't be - a problem. - <p> - <item><tt>getenv</tt>: Since there is no such thing as an environment on all -- supported systems, the <tt/getenv/ function will always return a <tt/NULL/ -+ supported systems, the <tt/getenv/ function always will return a <tt/NULL/ - pointer. - <p> -- <item><tt>locale</tt>: There is no other locale than the "C" locale. The -+ <item><tt>locale</tt>: There is no locale other than the "C" locale. The - native locale is identical to the "C" locale. - </itemize> - - --In addition to these limitations, some more functions are limited if inlined --versions are requested by using -Os: -+In addition to those limitations, some more functions are limited if inlined -+versions are requested by using the <tt/-Os/ command-line option: - - <itemize> -- <item>The <tt/strlen/ function only works for strings with a maximum length -+ <item>The <tt/strlen/ function works for only strings with a maximum length - of 255 characters. - <p> -- <item>The <tt/isxxx/ character classification functions from -+ <item>The <tt/isXXX/ character classification functions from - <tt/<ctype.h>/ will give unpredictable results if the argument is not -- in character range (0..255). This limitation may be removed by #undef'ing -+ in character range (0..255). That limitation may be removed by #undef'ing - the function name (when using <tt/-Os/, the functions are actually macros -- that expand to inline assembler code, but the real functions are still -+ that expand to inline assembly code, but the real functions still are - available if the macro definition is removed). - </itemize> - - - --<sect>CPU specific stuff - 6502.h<p> -+<sect>CPU-specific stuff - 6502.h<p> - --The header file 6502.h contains some functions that make only sense with the -+The header file 6502.h contains some functions that make sense only with the - 6502 CPU. Examples are macros to insert more or less useful instructions into - your C code, or a function to call arbitrary machine language subroutines, - passing registers in and out. - - - --<sect>Target specific stuff<p> -+<sect>Target-specific stuff<p> - --For each supported system there's a header file that contains calls or defines --specific for this system. So, when programming for the C64, include c64.h, for --the C128, include c128.h and so on. To make the task for the Commodore systems --easier, there is also a header file named cbm.h that will define stuff common --for all CBM systems, and include the header file for the specific target --system. -+For each supported system, there's a header file that contains calls or -+defines specific for that system. So, when programming for the C64, include -+<tt/<c64.h>/, for the C128, include <tt/<c128.h>/, and so on. -+To make the task for the Commodore systems easier, there is also a header file -+named <tt/<cbm.h>/ that will define stuff common for all CBM systems, -+and include the header file for the specific target system. - - The header files contain - - <itemize> - -- <item>Defines for special keys (like function keys) -+ <item>Defines for special keys (such as function keys) - -- <item>Defines for special characters (like the graphics characters) -+ <item>Defines for special characters (such as the graphics characters) - - <item>Variables with a fixed address in memory that may be used to access -- special hardware. For the C64 and C128 there is a variable struct named -- <tt/SID/. Writing to the fields of this struct will write to the SID device -- instead. Using these variables will make your program more readable and more -- portable. Don't fear ineffective code when using these variables, the -- compiler will translate reads and writes to these structs into direct memory -+ special hardware. For the C64 and C128, there is a variable struct named -+ <tt/SID/. Writing to the fields of that struct will write to the SID device -+ instead. Using those variables will make your program more readable and more -+ portable. Don't fear ineffective code when using those variables, the -+ compiler will translate reads and writes to those structs into direct memory - accesses. - -- <item>Other routines that make only sense for a specific system. One example -- are routines to write memory locations in the system bank for the CBM PET-II -+ <item>Other routines that make sense for only a specific system. One example -+ is routines to write memory locations in the system bank for the CBM-II - family. - - </itemize> - - -+ - <sect>Direct console I/O - <tt/conio.h/<p> - - The <tt/conio.h/ header file contains a large set of functions that do screen - and keyboard I/O. The functions will write directly to the screen or poll the - keyboard directly with no more help from the operating system than needed. - This has some disadvantages, but on the other side it's fast and reasonably --portable. conio implementations exist for the following targets: -+portable. Conio implementations exist for the following targets: - - <itemize> - <item>apple2 -@@ -165,13 +166,13 @@ portable. conio implementations exist for the following targets: - <item>atari5200 - <item>atarixl - <item>atmos -+ <item>c128 - <item>c16 (works also for the c116 with up to 32K memory) - <item>c64 -- <item>c128 -- <item>plus4 (or expanded c16/c116) -- <item>cbm510 (40 column video) -- <item>cbm610 (all CBM series-II computers with 80 column video) -+ <item>cbm510 (40-column video) -+ <item>cbm610 (all CBM series-II computers with 80-column video) - <item>creativision -+ <item>cx16 - <item>gamate - <item>geos-apple - <item>geos-cbm -@@ -179,11 +180,12 @@ portable. conio implementations exist for the following targets: - <item>osic1p - <item>pce - <item>pet (all CBM PET systems except the 2001) -+ <item>plus4 (or expanded c16/c116) - <item>telestrat - <item>vic20 - </itemize> - --The conio.h header file does also include the system specific header files -+The <tt/conio.h/ header file does include the system-specific header files also, - which define constants for special characters and keys. - - -@@ -191,14 +193,14 @@ which define constants for special characters and keys. - <sect>Using the joystick - <tt/joystick.h/<p> - - For systems that have a joystick, <tt/joystick.h/ will define a subroutine to --read the current value, including constants to evaluate the result of this -+read the current value, including constants to evaluate the result of that - function. - - - - <sect>Using a mouse - <tt/mouse.h/<p> - --Some target machines support a mouse. Mouse support is currently available for -+Some target machines support a mouse. Mouse support currently is available for - the following targets: - - <itemize> -@@ -206,19 +208,21 @@ the following targets: - <item>apple2enh - <item>atari - <item>atarixl -- <item>c64 - <item>c128 -+ <item>c64 - <item>cbm510 -+ <item>cx16 - </itemize> - - The available functions are declared in <tt/mouse.h/. - - -+ - <sect>Copyright<p> - - This C runtime library implementation for the cc65 compiler is (C) - Copyright 1998-2002 Ullrich von Bassewitz. For usage of the binaries --and/or sources the following conditions do apply: -+and/or sources, the following conditions do apply: - - This software is provided 'as-is', without any expressed or implied - warranty. In no event will the authors be held liable for any damages -@@ -232,8 +236,8 @@ freely, subject to the following restrictions: - <item> The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be -- appreciated but is not required. --<item> Altered source versions must be plainly marked as such, and must not -+ appreciated, but is not required. -+<item> Altered source versions must be marked plainly as such, and must not - be misrepresented as being the original software. - <item> This notice may not be removed or altered from any source - distribution. -diff --git a/include/cbm.h b/include/cbm.h -index 56b5b294..ac3615c3 100644 ---- a/include/cbm.h -+++ b/include/cbm.h -@@ -208,6 +208,7 @@ void __fastcall__ cbm_k_second (unsigned char addr); - void __fastcall__ cbm_k_setlfs (unsigned char LFN, unsigned char DEV, - unsigned char SA); - void __fastcall__ cbm_k_setnam (const char* Name); -+void __fastcall__ cbm_k_settim (unsigned long timer); - void __fastcall__ cbm_k_talk (unsigned char dev); - void __fastcall__ cbm_k_tksa (unsigned char addr); - void cbm_k_udtim (void); -diff --git a/include/cx16.h b/include/cx16.h -index c6638cef..6ceb605c 100644 ---- a/include/cx16.h -+++ b/include/cx16.h -@@ -47,12 +47,32 @@ - /* Additional output character codes */ - #define CH_COLOR_SWAP 0x01 - #define CH_UNDERLINE 0x04 -+#define CH_WHITE 0x05 - #define CH_BOLD 0x06 - #define CH_BACKSPACE 0x08 - #define CH_ITALIC 0x0B - #define CH_OUTLINE 0x0C - #define CH_FONT_ISO 0x0F -+#define CH_RED 0x1C -+#define CH_GREEN 0x1E -+#define CH_BLUE 0x1F -+#define CH_ORANGE 0x81 - #define CH_FONT_PET 0x8F -+#define CH_BLACK 0x90 -+#define CH_ATTR_CLEAR 0x92 -+#define CH_BROWN 0x95 -+#define CH_PINK 0x96 -+#define CH_LIGHTRED CH_PINK -+#define CH_GRAY1 0x97 -+#define CH_GRAY2 0x98 -+#define CH_LIGHTGREEN 0x99 -+#define CH_LIGHTBLUE 0x9A -+#define CH_GRAY3 0x9B -+#define CH_PURPLE 0x9C -+#define CH_VIOLET CH_PURPLE -+#define CH_YELLOW 0x9E -+#define CH_CYAN 0x9F -+#define CH_SHIFT_SPACE 0xA0 - - /* Additional key defines */ - #define CH_SHIFT_TAB 0x18 -@@ -82,7 +102,8 @@ - #define COLOR_YELLOW 0x07 - #define COLOR_ORANGE 0x08 - #define COLOR_BROWN 0x09 --#define COLOR_LIGHTRED 0x0A -+#define COLOR_PINK 0x0A -+#define COLOR_LIGHTRED COLOR_PINK - #define COLOR_GRAY1 0x0B - #define COLOR_GRAY2 0x0C - #define COLOR_LIGHTGREEN 0x0D -@@ -91,27 +112,27 @@ - - /* NES controller masks for joy_read() */ - --#define JOY_BTN_1_MASK 0x80 --#define JOY_BTN_2_MASK 0x40 --#define JOY_BTN_3_MASK 0x20 --#define JOY_BTN_4_MASK 0x10 --#define JOY_UP_MASK 0x08 --#define JOY_DOWN_MASK 0x04 --#define JOY_LEFT_MASK 0x02 --#define JOY_RIGHT_MASK 0x01 -+#define JOY_BTN_1_MASK 0x80 -+#define JOY_BTN_2_MASK 0x40 -+#define JOY_BTN_3_MASK 0x20 -+#define JOY_BTN_4_MASK 0x10 -+#define JOY_UP_MASK 0x08 -+#define JOY_DOWN_MASK 0x04 -+#define JOY_LEFT_MASK 0x02 -+#define JOY_RIGHT_MASK 0x01 - --#define JOY_BTN_A_MASK JOY_BTN_1_MASK --#define JOY_BTN_B_MASK JOY_BTN_2_MASK --#define JOY_SELECT_MASK JOY_BTN_3_MASK --#define JOY_START_MASK JOY_BTN_4_MASK -+#define JOY_BTN_A_MASK JOY_BTN_1_MASK -+#define JOY_BTN_B_MASK JOY_BTN_2_MASK -+#define JOY_SELECT_MASK JOY_BTN_3_MASK -+#define JOY_START_MASK JOY_BTN_4_MASK - --#define JOY_BTN_A(v) ((v) & JOY_BTN_A_MASK) --#define JOY_BTN_B(v) ((v) & JOY_BTN_B_MASK) --#define JOY_SELECT(v) ((v) & JOY_SELECT_MASK) --#define JOY_START(v) ((v) & JOY_START_MASK) -+#define JOY_BTN_A(v) ((v) & JOY_BTN_A_MASK) -+#define JOY_BTN_B(v) ((v) & JOY_BTN_B_MASK) -+#define JOY_SELECT(v) ((v) & JOY_SELECT_MASK) -+#define JOY_START(v) ((v) & JOY_START_MASK) - --#define JOY_FIRE2_MASK JOY_BTN_2_MASK --#define JOY_FIRE2(v) ((v) & JOY_FIRE2_MASK) -+#define JOY_FIRE2_MASK JOY_BTN_2_MASK -+#define JOY_FIRE2(v) ((v) & JOY_FIRE2_MASK) - - /* Additional mouse button mask */ - #define MOUSE_BTN_MIDDLE 0x02 -@@ -119,21 +140,21 @@ - /* get_tv() return codes - ** set_tv() argument codes - */ --#define TV_NONE 0 --#define TV_VGA 1 --#define TV_NTSC_COLOR 2 --#define TV_RGB 3 --#define TV_NONE2 4 --#define TV_VGA2 5 --#define TV_NTSC_MONO 6 --#define TV_RGB2 7 -+#define TV_NONE 0 -+#define TV_VGA 1 -+#define TV_NTSC_COLOR 2 -+#define TV_RGB 3 -+#define TV_NONE2 4 -+#define TV_VGA2 5 -+#define TV_NTSC_MONO 6 -+#define TV_RGB2 7 - - /* Video modes for videomode() */ - #define VIDEOMODE_40x30 0x00 - #define VIDEOMODE_80x60 0x02 - #define VIDEOMODE_40COL VIDEOMODE_40x30 - #define VIDEOMODE_80COL VIDEOMODE_80x60 --#define VIDEOMODE_320x240 0x80 -+#define VIDEOMODE_320x200 0x80 - #define VIDEOMODE_SWAP (-1) - - /* VERA's interrupt flags */ -@@ -193,6 +214,9 @@ extern void cx16_std_mou[]; /* Referred to by mouse_static_stddrv[] - - - -+unsigned char get_numbanks (void); -+/* Return the number of RAM banks that the machine has. */ -+ - signed char get_ostype (void); - /* Get the ROM build version. - ** -1 -- custom build -@@ -201,12 +225,12 @@ signed char get_ostype (void); - */ - - unsigned char get_tv (void); --/* Return the video type that the machine is using. -+/* Return the video signal type that the machine is using. - ** Return a TV_xx constant. - */ - - void __fastcall__ set_tv (unsigned char type); --/* Set the video type that the machine will use. -+/* Set the video signal type that the machine will use. - ** Call with a TV_xx constant. - */ - -diff --git a/libsrc/cbm/c_settim.s b/libsrc/cbm/c_settim.s -new file mode 100644 -index 00000000..5206557f ---- /dev/null -+++ b/libsrc/cbm/c_settim.s -@@ -0,0 +1,16 @@ -+; -+; 2020-01-08, Greg King -+; -+; void __fastcall__ cbm_k_settim (unsigned long timer); -+; -+ -+ .export _cbm_k_settim -+ .importzp sreg -+ -+ .include "cbm.inc" -+ -+ -+.proc _cbm_k_settim -+ ldy sreg -+ jmp SETTIM -+.endproc -diff --git a/libsrc/cx16/clock.s b/libsrc/cx16/clock.s -index 9af215e0..a0871dbc 100644 ---- a/libsrc/cx16/clock.s -+++ b/libsrc/cx16/clock.s -@@ -25,7 +25,6 @@ - .endproc - - -- - .proc _clock - - stz sreg + 1 ; Byte 3 always is zero -diff --git a/libsrc/cx16/color.s b/libsrc/cx16/color.s -index 1be01c47..f8d8c1eb 100644 ---- a/libsrc/cx16/color.s -+++ b/libsrc/cx16/color.s -@@ -36,7 +36,7 @@ _bgcolor: - ora tmp1 - sta CHARCOLOR ; set new values - txa -- lsr a ; get screen color -+ lsr a ; get old background color - lsr a - lsr a - lsr a -diff --git a/libsrc/cx16/crt0.s b/libsrc/cx16/crt0.s -index 52deeb76..d709ea96 100644 ---- a/libsrc/cx16/crt0.s -+++ b/libsrc/cx16/crt0.s -@@ -61,7 +61,7 @@ L2: lda zpsave,x - ldx spsave - txs ; Restore stack pointer - ldx ramsave -- stx VIA1::PRA2 ; Restore former RAM bank -+ stx VIA1::PRA ; Restore former RAM bank - lda VIA1::PRB - and #<~$07 - ora #$04 -@@ -85,10 +85,10 @@ init: - - ; Change to the second RAM bank. - -- lda VIA1::PRA2 -+ lda VIA1::PRA - sta ramsave ; Save the current RAM bank number - lda #$01 -- sta VIA1::PRA2 -+ sta VIA1::PRA - - .if 0 ; We don't need to preserve zero-page space for cc65's variables. - ; Save the zero-page locations that we need. -diff --git a/libsrc/cx16/get_numbanks.s b/libsrc/cx16/get_numbanks.s -new file mode 100644 -index 00000000..00490fb7 ---- /dev/null -+++ b/libsrc/cx16/get_numbanks.s -@@ -0,0 +1,20 @@ -+; -+; 2020-01-10, Greg King -+; -+; unsigned char get_numbanks (void); -+; /* Return the number of RAM banks that the machine has. */ -+; -+; The Commander X16 version of MEMTOP returns with an extra value: -+; The accumulator describes the number of RAM banks that exist on the hardware. -+; -+ -+ .export _get_numbanks -+ -+ .import MEMTOP -+ -+ -+_get_numbanks: -+ sec -+ jsr MEMTOP -+ ldx #>$0000 -+ rts -diff --git a/libsrc/cx16/joyref.s b/libsrc/cx16/joyref.s -deleted file mode 100644 -index edd89fba..00000000 ---- a/libsrc/cx16/joyref.s -+++ /dev/null -@@ -1,20 +0,0 @@ --; --; 2019-12-22, Greg King --; --; Link an interrupt handler if joysticks are used by a program. --; -- -- .interruptor joy_libref, 9 -- -- .include "cbm_kernal.inc" -- .include "cx16.inc" -- -- --joy_libref: -- lda VERA::IRQ_FLAGS -- lsr a -- bcc not_vsync -- jsr JOYSTICK_SCAN ; Bit-bang game controllers -- clc ; Let other Jiffy handlers run --not_vsync: -- rts -diff --git a/libsrc/cx16/kbhit.s b/libsrc/cx16/kbhit.s -index 34afdeba..d7e22efd 100644 ---- a/libsrc/cx16/kbhit.s -+++ b/libsrc/cx16/kbhit.s -@@ -1,5 +1,5 @@ - ; --; 2019-12-22, Greg King -+; 2020-01-08, Greg King - ; - ; unsigned char kbhit (void); - ; /* Returns non-zero (true) if a typed character is waiting. */ -@@ -11,10 +11,10 @@ - - - .proc _kbhit -- ldy VIA1::PRA2 ; (KEY_COUNT is in RAM bank 0) -- stz VIA1::PRA2 -+ ldy VIA1::PRA ; (KEY_COUNT is in RAM bank 0) -+ stz VIA1::PRA - lda KEY_COUNT ; Get number of characters -- sty VIA1::PRA2 -+ sty VIA1::PRA - tax ; High byte of return (only its zero/nonzero ... - rts ; ... state matters) - .endproc -diff --git a/libsrc/cx16/kernal.s b/libsrc/cx16/kernal.s -index ccd52d63..a6b65ebb 100644 ---- a/libsrc/cx16/kernal.s -+++ b/libsrc/cx16/kernal.s -@@ -1,11 +1,20 @@ - ; --; 2019-12-22, Greg King -+; 2020-01-06, Greg King - ; - ; CX16 Kernal functions - ; - - .include "cbm_kernal.inc" - -+ .export CONSOLE_INIT -+ .export CONSOLE_PUT_CHAR -+ .export CONSOLE_GET_CHAR -+ .export MEMORY_FILL -+ .export MEMORY_COPY -+ .export MEMORY_CRC -+ .export MEMORY_DECOMPRESS -+ .export SPRITE_SET_IMAGE -+ .export SPRITE_SET_POSITION - .export FB_INIT - .export FB_GET_INFO - .export FB_SET_PALETTE -@@ -37,7 +46,8 @@ - .export CLOCK_GET_DATE_TIME - .export JOYSTICK_SCAN - .export JOYSTICK_GET -- .export SCRMOD -+ .export SCREEN_SET_MODE -+ .export SCREEN_SET_CHARSET - .export MOUSE_CONFIG - .export MOUSE_GET - -diff --git a/libsrc/cx16/libref.s b/libsrc/cx16/libref.s -index 0d85c7cd..82a39c22 100644 ---- a/libsrc/cx16/libref.s -+++ b/libsrc/cx16/libref.s -@@ -1,9 +1,10 @@ - ; - ; 2013-05-31, Oliver Schmidt --; 2019-11-14, Greg King -+; 2020-01-06, Greg King - ; - - .export em_libref -+ .export joy_libref - .export mouse_libref - .export ser_libref - .export tgi_libref -@@ -11,6 +12,7 @@ - .import _exit - - em_libref := _exit -+joy_libref := _exit - mouse_libref := _exit - ser_libref := _exit - tgi_libref := _exit -diff --git a/libsrc/cx16/mcbdefault.s b/libsrc/cx16/mcbdefault.s -index 3dda1c71..aed0e3a2 100644 ---- a/libsrc/cx16/mcbdefault.s -+++ b/libsrc/cx16/mcbdefault.s -@@ -1,44 +1,29 @@ - ; - ; Default mouse callbacks for the CX16 - ; --; 2019-12-25, Greg King --; --; All functions in this module should be interrupt-safe --; because they might be called from an interrupt handler. -+; 2020-01-10, Greg King - ; - - .export _mouse_def_callbacks - -+ .import MOUSE_GET, SPRITE_SET_POSITION - .include "cx16.inc" - - --msprite: -- stz VERA::CTRL ; set address for VERA's data port zero -- lda #<(VERA::SPRITE::ATTRIB::Z_FLIP + 0 * 8) -- ldx #>(VERA::SPRITE::ATTRIB::Z_FLIP + 0 * 8) -- ldy #^(VERA::SPRITE::ATTRIB::Z_FLIP + 0 * 8) | VERA::INC0 -- sta VERA::ADDR -- stx VERA::ADDR+1 -- sty VERA::ADDR+2 -- rts -- - ; -------------------------------------------------------------------------- - ; Hide the mouse pointer. - --hide: jsr msprite -- lda VERA::DATA0 -- and #<~VERA::SPRITE::DEPTH::LAYER1 -- sta VERA::DATA0 -- rts -+hide: ldx #%10000000 -+ stx gREG::r0H -+ bra mse - - ; -------------------------------------------------------------------------- - ; Show the mouse pointer. - --show: jsr msprite -- lda VERA::DATA0 -- ora #VERA::SPRITE::DEPTH::LAYER1 -- sta VERA::DATA0 -- rts -+show: ldx #gREG::r0 -+ jsr MOUSE_GET -+mse: lda #$00 ; mouse sprite -+ jmp SPRITE_SET_POSITION - - ; -------------------------------------------------------------------------- - ; Prepare to move the mouse pointer. -@@ -53,13 +38,13 @@ draw: ; Fall through - ; -------------------------------------------------------------------------- - ; Move the mouse pointer X position to the value in .XA . - --movex: ; Already set by drivers -+movex: ; Already done by Kernal - ; Fall through - - ; -------------------------------------------------------------------------- - ; Move the mouse pointer Y position to the value in .XA . - --movey: rts ; Already set by drivers -+movey: rts ; Already done by Kernal - - ; -------------------------------------------------------------------------- - ; Callback structure -diff --git a/libsrc/cx16/videomode.s b/libsrc/cx16/videomode.s -index e3a777b8..8fe79744 100644 ---- a/libsrc/cx16/videomode.s -+++ b/libsrc/cx16/videomode.s -@@ -1,10 +1,10 @@ - ; --; 2019-11-06, Greg King -+; 2020-01-06, Greg King - ; - ; /* Video mode defines */ - ; #define VIDEOMODE_40x30 0x00 - ; #define VIDEOMODE_80x60 0x02 --; #define VIDEOMODE_320x240 0x80 -+; #define VIDEOMODE_320x200 0x80 - ; #define VIDEOMODE_SWAP (-1) - ; - ; signed char __fastcall__ videomode (signed char Mode); -@@ -16,29 +16,25 @@ - - .export _videomode - -- .import SCRMOD -+ .import SCREEN_SET_MODE -+ .include "cx16.inc" - - - .proc _videomode -- tax -- clc ; (Get old mode) -- jsr SCRMOD -- pha -- txa -+ ldx SCREEN_MODE ; Get old mode -+ phx - -- sec ; (Set new mode) -- jsr SCRMOD -+ jsr SCREEN_SET_MODE - - pla ; Get back old mode -- bcs @L1 - ldx #>$0000 ; Clear high byte -+ bcs @L1 - rts - --; The new mode is invalid. Go back to the old mode. Return -1. -+; The new mode is invalid. Go back to the old one. Return -1. - --@L1: sec -- jsr SCRMOD -- lda #<-1 -- tax -+@L1: sta SCREEN_MODE -+ dex -+ txa - rts - .endproc -diff --git a/libsrc/cx16/waitvsync.s b/libsrc/cx16/waitvsync.s -index e8176916..6316a048 100644 ---- a/libsrc/cx16/waitvsync.s -+++ b/libsrc/cx16/waitvsync.s -@@ -1,5 +1,5 @@ - ; --; 2019-12-23, Greg King -+; 2020-01-08, Greg King - ; - ; void waitvsync (void); - ; /* Wait for the start of the next video field. */ -@@ -12,10 +12,10 @@ - .include "cx16.inc" - - _waitvsync: -- ldx VIA1::PRA2 ; (TIMER is in RAM bank 0) -- stz VIA1::PRA2 -+ ldx VIA1::PRA ; (TIMER is in RAM bank 0) -+ stz VIA1::PRA - lda TIMER + 2 - : cmp TIMER + 2 - beq :- ; Wait for next jiffy -- stx VIA1::PRA2 -+ stx VIA1::PRA - rts --- -2.26.0 - diff --git a/0139-Minor-cleanup.patch b/0139-Minor-cleanup.patch deleted file mode 100644 index 51e7817..0000000 --- a/0139-Minor-cleanup.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 0f08ae2c12829af9c7d4b7a7a47ff37528dd1ae1 Mon Sep 17 00:00:00 2001 -From: Oliver Schmidt <ol.sc@web.de> -Date: Sat, 18 Jan 2020 19:29:02 +0100 -Subject: [PATCH 139/170] Minor cleanup. - ---- - libsrc/apple2/videomode.s | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/libsrc/apple2/videomode.s b/libsrc/apple2/videomode.s -index 1da99747..65e58254 100644 ---- a/libsrc/apple2/videomode.s -+++ b/libsrc/apple2/videomode.s -@@ -16,7 +16,7 @@ _videomode: - ; Get and save current videomode flag - bit RD80VID - php -- -+ - ; If we are in 80 column mode then the 80 column firmware is - ; known to be active so we can just print the ctrl-char code - ; (even if this only means staying in the current videomode) -@@ -29,18 +29,18 @@ _videomode: - ; current state of the 80 column firmware nor want to fix it - : cmp #$11 ; Ctrl-char code for 40 cols - beq done -- -+ - ; If we are in 40 column mode and want to set 80 column mode - ; then we first presume the 80 column firmware being already - ; active and print the ctrl-char code (this causes a garbage - ; char to be printed on the screen if isn't already active) - jsr COUT -- -+ - ; If we successfully switched to 80 column mode then the 80 - ; column firmware was in fact already active and we're done - bit RD80VID - bmi done -- -+ - ; The 80 column firmware isn't already active so we need to - ; initialize it - causing the screen to be cleared and thus - ; the garbage char printed above to be erased (but for some -@@ -56,7 +56,7 @@ _videomode: - - ; Switch in LC bank 2 for R/O - bit $C080 -- -+ - ; Return ctrl-char code for setting previous - ; videomode using the saved videomode flag - done: lda #$11 ; Ctrl-char code for 40 cols --- -2.26.0 - diff --git a/0140-Made-cc65-detect-a-possibly-missing-argument-at-the-.patch b/0140-Made-cc65-detect-a-possibly-missing-argument-at-the-.patch deleted file mode 100644 index d8e7517..0000000 --- a/0140-Made-cc65-detect-a-possibly-missing-argument-at-the-.patch +++ /dev/null @@ -1,105 +0,0 @@ -From 90a2edcfa2e759893a1df9f8108267b43f769faf Mon Sep 17 00:00:00 2001 -From: Greg King <gregdk@users.sf.net> -Date: Sat, 25 Jan 2020 04:13:04 -0500 -Subject: [PATCH 140/170] Made cc65 detect a possibly missing argument at the - end of a function argument list. - -(It could be a stray comma at the end of the list.) ---- - src/cc65/expr.c | 30 ++++++++++++++++++------------ - 1 file changed, 18 insertions(+), 12 deletions(-) - -diff --git a/src/cc65/expr.c b/src/cc65/expr.c -index 904c3af0..e59f9b4d 100644 ---- a/src/cc65/expr.c -+++ b/src/cc65/expr.c -@@ -1,7 +1,7 @@ - /* expr.c - ** - ** 1998-06-21, Ullrich von Bassewitz --** 2017-12-05, Greg King -+** 2020-01-25, Greg King - */ - - -@@ -278,9 +278,9 @@ static void WarnConstCompareResult (void) - - - static unsigned FunctionParamList (FuncDesc* Func, int IsFastcall) --/* Parse a function parameter list and pass the parameters to the called --** function. Depending on several criteria this may be done by just pushing --** each parameter separately, or creating the parameter frame once and then -+/* Parse a function parameter list, and pass the parameters to the called -+** function. Depending on several criteria, this may be done by just pushing -+** each parameter separately, or creating the parameter frame once, and then - ** storing into this frame. - ** The function returns the size of the parameters pushed. - */ -@@ -322,7 +322,7 @@ static unsigned FunctionParamList (FuncDesc* Func, int IsFastcall) - - /* Do we have more than one parameter in the frame? */ - if (FrameParams > 1) { -- /* Okeydokey, setup the frame */ -+ /* Okeydokey, set up the frame */ - FrameOffs = StackPtr; - g_space (FrameSize); - StackPtr -= FrameSize; -@@ -343,7 +343,7 @@ static unsigned FunctionParamList (FuncDesc* Func, int IsFastcall) - /* Fetch the pointer to the next argument, check for too many args */ - if (ParamCount <= Func->ParamCount) { - /* Beware: If there are parameters with identical names, they -- ** cannot go into the same symbol table, which means that in this -+ ** cannot go into the same symbol table, which means that, in this - ** case of errorneous input, the number of nodes in the symbol - ** table and ParamCount are NOT equal. We have to handle this case - ** below to avoid segmentation violations. Since we know that this -@@ -364,7 +364,7 @@ static unsigned FunctionParamList (FuncDesc* Func, int IsFastcall) - /* End of param list reached, no ellipsis */ - Error ("Too many arguments in function call"); - } -- /* Assume an ellipsis even in case of errors to avoid an error -+ /* Assume an ellipsis even in case of errors, to avoid an error - ** message for each other argument. - */ - Ellipsis = 1; -@@ -373,7 +373,7 @@ static unsigned FunctionParamList (FuncDesc* Func, int IsFastcall) - /* Evaluate the parameter expression */ - hie1 (&Expr); - -- /* If we don't have an argument spec, accept anything, otherwise -+ /* If we don't have an argument spec., accept anything; otherwise, - ** convert the actual argument to the type needed. - */ - Flags = CF_NONE; -@@ -433,6 +433,12 @@ static unsigned FunctionParamList (FuncDesc* Func, int IsFastcall) - break; - } - NextToken (); -+ -+ /* Check for stray comma */ -+ if (CurTok.Tok == TOK_RPAREN) { -+ Error ("Argument expected after comma"); -+ break; -+ } - } - - /* Check if we had enough parameters */ -@@ -441,11 +447,11 @@ static unsigned FunctionParamList (FuncDesc* Func, int IsFastcall) - } - - /* The function returns the size of all parameters pushed onto the stack. -- ** However, if there are parameters missing (which is an error and was -- ** flagged by the compiler) AND a stack frame was preallocated above, -- ** we would loose track of the stackpointer and generate an internal error -+ ** However, if there are parameters missing (which is an error, and was -+ ** flagged by the compiler), AND a stack frame was preallocated above, -+ ** we would loose track of the stackpointer, and generate an internal error - ** later. So we correct the value by the parameters that should have been -- ** pushed to avoid an internal compiler error. Since an error was -+ ** pushed, to avoid an internal compiler error. Since an error was - ** generated before, no code will be output anyway. - */ - return ParamSize + FrameSize; --- -2.26.0 - diff --git a/0141-added-regression-test-related-to-bug-1001.patch b/0141-added-regression-test-related-to-bug-1001.patch deleted file mode 100644 index dffa72c..0000000 --- a/0141-added-regression-test-related-to-bug-1001.patch +++ /dev/null @@ -1,29 +0,0 @@ -From a2bbb6f1be03e1285521da97ffa20622ad1449c1 Mon Sep 17 00:00:00 2001 -From: mrdudz <mrdudz@users.noreply.github.com> -Date: Sat, 25 Jan 2020 20:56:52 +0100 -Subject: [PATCH 141/170] added regression test related to bug #1001 - ---- - test/err/bug1001.c | 10 ++++++++++ - 1 file changed, 10 insertions(+) - create mode 100644 test/err/bug1001.c - -diff --git a/test/err/bug1001.c b/test/err/bug1001.c -new file mode 100644 -index 00000000..62737c17 ---- /dev/null -+++ b/test/err/bug1001.c -@@ -0,0 +1,10 @@ -+ -+/* https://github.com/cc65/cc65/issues/1001 */ -+ -+#include <stdio.h> -+ -+int main(void) -+{ -+ printf("test",); /* should be an error */ -+ return 0; -+} --- -2.26.0 - diff --git a/0142-store-y-first-then-a.-fix-by-willymanilly.patch b/0142-store-y-first-then-a.-fix-by-willymanilly.patch deleted file mode 100644 index 9d08771..0000000 --- a/0142-store-y-first-then-a.-fix-by-willymanilly.patch +++ /dev/null @@ -1,31 +0,0 @@ -From a59402d5f544efd6d608ba4fdd64dc3a6758d2e5 Mon Sep 17 00:00:00 2001 -From: mrdudz <mrdudz@users.noreply.github.com> -Date: Sun, 26 Jan 2020 02:18:04 +0100 -Subject: [PATCH 142/170] store y first, then a. fix by willymanilly - ---- - libsrc/c128/emd/c128-vdc.s | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/libsrc/c128/emd/c128-vdc.s b/libsrc/c128/emd/c128-vdc.s -index e359dcdb..e294ddc1 100644 ---- a/libsrc/c128/emd/c128-vdc.s -+++ b/libsrc/c128/emd/c128-vdc.s -@@ -341,12 +341,12 @@ vdcsetsrcaddr: - stx VDC_ADDR_REG - @L0: bit VDC_ADDR_REG - bpl @L0 -- sta VDC_DATA_REG -+ sty VDC_DATA_REG - inx - stx VDC_ADDR_REG - @L1: bit VDC_ADDR_REG ; XXX: Test waiting for register 18 - bpl @L1 -- sty VDC_DATA_REG -+ sta VDC_DATA_REG - rts - - vdcgetbyte: --- -2.26.0 - diff --git a/0143-Fixes-Atari-OS-devhdl_t-init-field-needs-an-JMP-byte.patch b/0143-Fixes-Atari-OS-devhdl_t-init-field-needs-an-JMP-byte.patch deleted file mode 100644 index 1f31aa0..0000000 --- a/0143-Fixes-Atari-OS-devhdl_t-init-field-needs-an-JMP-byte.patch +++ /dev/null @@ -1,29 +0,0 @@ -From f68cc06ec746ff6cc889d1a7b07ebd8769d7909c Mon Sep 17 00:00:00 2001 -From: Daniel Serpell <daniel.serpell@gmail.com> -Date: Sun, 26 Jan 2020 23:55:37 -0300 -Subject: [PATCH 143/170] Fixes Atari OS devhdl_t, init field needs an JMP - byte. - -This fixes issue #1002. ---- - include/_atarios.h | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/include/_atarios.h b/include/_atarios.h -index c15a9943..5e1374fa 100644 ---- a/include/_atarios.h -+++ b/include/_atarios.h -@@ -120,8 +120,9 @@ struct __devhdl { - void *put; /* address of PUT BYTE routine -1 */ - void *status; /* address of GET STATUS routine -1 */ - void *special; /* address od SPECIAL routine -1 */ -+ unsigned char jmp_inst; /* a "JMP" byte, should be $4C */ - void (*init)(void); /* init routine (JMP INIT) */ -- void *reserved; /* unused */ -+ unsigned char reserved; /* unused */ - }; - - typedef struct __devhdl devhdl_t; --- -2.26.0 - diff --git a/0144-Corrected-check-in-OptTransfers2-for-register-usage..patch b/0144-Corrected-check-in-OptTransfers2-for-register-usage..patch deleted file mode 100644 index d54ae05..0000000 --- a/0144-Corrected-check-in-OptTransfers2-for-register-usage..patch +++ /dev/null @@ -1,26 +0,0 @@ -From 5b11eb4bb95a9982f33f2c580318202afc0b0882 Mon Sep 17 00:00:00 2001 -From: acqn <acqn163@outlook.com> -Date: Tue, 31 Dec 2019 15:55:51 +0800 -Subject: [PATCH 144/170] Corrected check in OptTransfers2 for register usage. - Fixed Issue 992. - ---- - src/cc65/coptind.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/cc65/coptind.c b/src/cc65/coptind.c -index f2ece2ce..e35aa5be 100644 ---- a/src/cc65/coptind.c -+++ b/src/cc65/coptind.c -@@ -1471,7 +1471,7 @@ unsigned OptTransfers2 (CodeSeg* S) - (N = CS_GetNextEntry (S, I)) != 0 && - !CE_HasLabel (N) && - (N->Info & OF_XFR) != 0 && -- GetRegInfo (S, I+2, E->Chg) != E->Chg) { -+ (GetRegInfo (S, I+2, E->Chg) & E->Chg) == 0) { - - CodeEntry* X = 0; - --- -2.26.0 - diff --git a/0145-Always-insert-a-LDA-after-the-removed-PLA-during-the.patch b/0145-Always-insert-a-LDA-after-the-removed-PLA-during-the.patch deleted file mode 100644 index 38d9daa..0000000 --- a/0145-Always-insert-a-LDA-after-the-removed-PLA-during-the.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 9559625ee874434dff7a015191cb14e2303b96b3 Mon Sep 17 00:00:00 2001 -From: acqn <acqn163@outlook.com> -Date: Tue, 31 Dec 2019 16:02:42 +0800 -Subject: [PATCH 145/170] Always insert a LDA after the removed PLA during the - optimization in OptPushPop. Fixed Issue 971. - ---- - src/cc65/coptind.c | 11 ++++++++--- - 1 file changed, 8 insertions(+), 3 deletions(-) - -diff --git a/src/cc65/coptind.c b/src/cc65/coptind.c -index e35aa5be..318f9593 100644 ---- a/src/cc65/coptind.c -+++ b/src/cc65/coptind.c -@@ -1948,17 +1948,22 @@ unsigned OptPushPop (CodeSeg* S) - !MemAccess (S, Push+1, Pop-1, E)) { - - /* Insert a STA after the PHA */ -- X = NewCodeEntry (E->OPC, E->AM, E->Arg, E->JumpTo, E->LI); -+ X = NewCodeEntry (OP65_STA, E->AM, E->Arg, E->JumpTo, E->LI); - CS_InsertEntry (S, X, Push+1); - - /* Remove the PHA instead */ - CS_DelEntry (S, Push); - -+ /* Insert a LDA after the PLA */ -+ X = NewCodeEntry (OP65_LDA, E->AM, E->Arg, E->JumpTo, CS_GetEntry (S, Pop)->LI); -+ CS_InsertEntry (S, X, Pop+1); -+ - /* Remove the PLA/STA sequence */ -- CS_DelEntries (S, Pop, 2); -+ CS_DelEntry (S, Pop); -+ CS_DelEntry (S, I); - - /* Correct I so we continue with the next insn */ -- I -= 2; -+ --I; - - /* Remember we had changes */ - ++Changes; --- -2.26.0 - diff --git a/0146-Quick-fix-for-the-OptPushPop-bug-reported-in-Issue-3.patch b/0146-Quick-fix-for-the-OptPushPop-bug-reported-in-Issue-3.patch deleted file mode 100644 index bc0f44a..0000000 --- a/0146-Quick-fix-for-the-OptPushPop-bug-reported-in-Issue-3.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 6d530931bfc58c925107d2cae10bc2ebe067217b Mon Sep 17 00:00:00 2001 -From: acqn <acqn163@outlook.com> -Date: Wed, 1 Jan 2020 23:44:35 +0800 -Subject: [PATCH 146/170] Quick fix for the OptPushPop bug reported in Issue - #337. - ---- - src/cc65/coptind.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/cc65/coptind.c b/src/cc65/coptind.c -index 318f9593..85901d0f 100644 ---- a/src/cc65/coptind.c -+++ b/src/cc65/coptind.c -@@ -1968,7 +1968,7 @@ unsigned OptPushPop (CodeSeg* S) - /* Remember we had changes */ - ++Changes; - -- } else if ((E->Info & OF_CBRA) == 0 && -+ } else if (!CE_UseLoadFlags (E) && - (!RegAUsed (S, I) || !ChgA)) { - - /* We can remove the PHA and PLA instructions */ --- -2.26.0 - diff --git a/0147-Just-disable-OptPushPop-if-N-Z-is-used-after-the-PLA.patch b/0147-Just-disable-OptPushPop-if-N-Z-is-used-after-the-PLA.patch deleted file mode 100644 index 29a30d0..0000000 --- a/0147-Just-disable-OptPushPop-if-N-Z-is-used-after-the-PLA.patch +++ /dev/null @@ -1,55 +0,0 @@ -From dc5114b0713fd4a8294e81dab83b8ecb59813d41 Mon Sep 17 00:00:00 2001 -From: acqn <acqn163@outlook.com> -Date: Fri, 3 Jan 2020 07:43:51 +0800 -Subject: [PATCH 147/170] Just disable OptPushPop if N/Z is used after the PLA. - This is a more conservative way to fix Issue #971. - ---- - src/cc65/coptind.c | 14 ++++++-------- - 1 file changed, 6 insertions(+), 8 deletions(-) - -diff --git a/src/cc65/coptind.c b/src/cc65/coptind.c -index 85901d0f..04deb011 100644 ---- a/src/cc65/coptind.c -+++ b/src/cc65/coptind.c -@@ -1892,6 +1892,7 @@ unsigned OptPushPop (CodeSeg* S) - while (I < CS_GetEntryCount (S)) { - - CodeEntry* X; -+ CodeEntry* N; - - /* Get next entry */ - CodeEntry* E = CS_GetEntry (S, I); -@@ -1944,7 +1945,9 @@ unsigned OptPushPop (CodeSeg* S) - if (E->OPC == OP65_STA && - (E->AM == AM65_ABS || E->AM == AM65_ZP) && - !CE_HasLabel (E) && -- !RegAUsed (S, I+1) && -+ ((N = CS_GetNextEntry (S, I)) == 0 || -+ (!CE_UseLoadFlags (N) && -+ !RegAUsed (S, I+1))) && - !MemAccess (S, Push+1, Pop-1, E)) { - - /* Insert a STA after the PHA */ -@@ -1954,16 +1957,11 @@ unsigned OptPushPop (CodeSeg* S) - /* Remove the PHA instead */ - CS_DelEntry (S, Push); - -- /* Insert a LDA after the PLA */ -- X = NewCodeEntry (OP65_LDA, E->AM, E->Arg, E->JumpTo, CS_GetEntry (S, Pop)->LI); -- CS_InsertEntry (S, X, Pop+1); -- - /* Remove the PLA/STA sequence */ -- CS_DelEntry (S, Pop); -- CS_DelEntry (S, I); -+ CS_DelEntries (S, Pop, 2); - - /* Correct I so we continue with the next insn */ -- --I; -+ I -= 2; - - /* Remember we had changes */ - ++Changes; --- -2.26.0 - diff --git a/0148-ctype-size-optimization.patch b/0148-ctype-size-optimization.patch deleted file mode 100644 index 5114200..0000000 --- a/0148-ctype-size-optimization.patch +++ /dev/null @@ -1,5782 +0,0 @@ -From ce80624f627ba887cf01d01d3f7c9dc02538a536 Mon Sep 17 00:00:00 2001 -From: IrgendwerA8 <c.krueger.b@web.de> -Date: Thu, 2 Jan 2020 18:57:03 +0100 -Subject: [PATCH 148/170] ctype size optimization - ---- - asminc/ctype.inc | 16 +- - asminc/ctype_common.inc | 91 ++++++ - asminc/ctype_console.inc | 92 +++++++ - asminc/ctypetable.inc | 48 ++++ - doc/cc65.sgml | 5 +- - doc/funcref.sgml | 67 ----- - include/ctype.h | 101 +------ - libsrc/apple2/ctype.s | 160 +---------- - libsrc/atari/ctype.s | 425 ++++++++++------------------ - libsrc/atari2600/ctype.s | 161 +---------- - libsrc/atmos/ctype.s | 426 ++++++++++------------------- - libsrc/cbm/ctype.s | 417 ++++++++++------------------ - libsrc/common/atoi.s | 22 +- - libsrc/common/ctype_preprocessor.s | 50 ++++ - libsrc/common/isalnum.s | 24 +- - libsrc/common/isalpha.s | 24 +- - libsrc/common/isascii.s | 27 ++ - libsrc/common/isblank.s | 24 +- - libsrc/common/iscntrl.s | 24 +- - libsrc/common/isdigit.s | 24 +- - libsrc/common/isgraph.s | 28 +- - libsrc/common/islower.s | 22 +- - libsrc/common/isprint.s | 26 +- - libsrc/common/ispunct.s | 29 +- - libsrc/common/isspace.s | 24 +- - libsrc/common/isupper.s | 24 +- - libsrc/common/isxdigit.s | 24 +- - libsrc/common/stricmp.s | 43 +-- - libsrc/common/strlower.s | 9 +- - libsrc/common/strnicmp.s | 38 +-- - libsrc/common/strupper.s | 8 +- - libsrc/creativision/ctype.s | 171 +----------- - libsrc/gamate/ctype.s | 160 +---------- - libsrc/geos-common/system/ctype.s | 422 ++++++++++------------------ - libsrc/lynx/ctype.s | 171 +----------- - libsrc/nes/ctype.s | 171 +----------- - libsrc/none/ctype.s | 158 +---------- - libsrc/osic1p/ctype.s | 158 +---------- - libsrc/pce/ctype.s | 157 +---------- - libsrc/sim6502/ctype.s | 158 +---------- - libsrc/supervision/ctype.s | 161 +---------- - libsrc/telestrat/ctype.s | 298 +------------------- - test/val/lib_common_ctype.c | 368 +++++++++++++++++++++++++ - 43 files changed, 1492 insertions(+), 3564 deletions(-) - create mode 100644 asminc/ctype_common.inc - create mode 100644 asminc/ctype_console.inc - create mode 100644 asminc/ctypetable.inc - create mode 100644 libsrc/common/ctype_preprocessor.s - create mode 100644 libsrc/common/isascii.s - create mode 100644 test/val/lib_common_ctype.c - -diff --git a/asminc/ctype.inc b/asminc/ctype.inc -index d6b0ccf4..401e772a 100644 ---- a/asminc/ctype.inc -+++ b/asminc/ctype.inc -@@ -1,12 +1,14 @@ -+; ctype.inc - ; --; Definitions for the character type tables -+; This file is part of -+; cc65 - a freeware C compiler for 6502 based systems - ; --; Ullrich von Bassewitz, 08.09.2001 -+; https://github.com/cc65/cc65 -+; -+; See "LICENSE" file for legal information. -+; -+; Definitions for the character type tables - ; -- --; Make the __ctype table an exported/imported symbol -- -- .global __ctype - - ; Define bitmapped constants for the table entries - -@@ -25,5 +27,3 @@ CT_ALNUM = (CT_LOWER | CT_UPPER | CT_DIGIT) - CT_ALPHA = (CT_LOWER | CT_UPPER) - CT_CTRL_SPACE = (CT_CTRL | CT_SPACE) - CT_NOT_PUNCT = (CT_SPACE | CT_CTRL | CT_DIGIT | CT_UPPER | CT_LOWER) -- -- -diff --git a/asminc/ctype_common.inc b/asminc/ctype_common.inc -new file mode 100644 -index 00000000..ffd8dfe0 ---- /dev/null -+++ b/asminc/ctype_common.inc -@@ -0,0 +1,91 @@ -+; ctype_common.inc -+; -+; This file is part of -+; cc65 - a freeware C compiler for 6502 based systems -+; -+; https://github.com/cc65/cc65 -+; -+; See "LICENSE" file for legal information. -+; -+; Character specification table for some common targets. -+; -+ -+ .include "ctypetable.inc" -+ .export __ctypeIdx -+ -+; The tables are readonly, put them into the rodata segment -+ -+.rodata -+ -+__ctypeIdx: -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 0/00 ___ctrl_@___, 1/01 ___ctrl_A___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 2/02 ___ctrl_B___, 3/03 ___ctrl_C___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 4/04 ___ctrl_D___, 5/05 ___ctrl_E___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 6/06 ___ctrl_F___, 7/07 ___ctrl_G___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_WS_SPACETAB_IDX ; 8/08 ___ctrl_H___, 9/09 ___ctrl_I___ -+ ct_mix CT_CTRL_WS_IDX, CT_CTRL_WS_IDX ; 10/0a ___ctrl_J___, 11/0b ___ctrl_K___ -+ ct_mix CT_CTRL_WS_IDX, CT_CTRL_WS_IDX ; 12/0c ___ctrl_L___, 13/0d ___ctrl_M___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 14/0e ___ctrl_N___, 15/0f ___ctrl_O___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 16/10 ___ctrl_P___, 17/11 ___ctrl_Q___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 18/12 ___ctrl_R___, 19/13 ___ctrl_S___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 20/14 ___ctrl_T___, 21/15 ___ctrl_U___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 22/16 ___ctrl_V___, 23/17 ___ctrl_W___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 24/18 ___ctrl_X___, 25/19 ___ctrl_Y___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 26/1a ___ctrl_Z___, 27/1b ___ctrl_[___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 28/1c ___ctrl_\___, 29/1d ___ctrl_]___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 30/1e ___ctrl_^___, 31/1f ___ctrl_____ -+ -+ ct_mix CT_SPACE_SPACETAB_IDX, CT_NONE_IDX ; 32/20 ___SPACE___, 33/21 _____!_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 34/22 _____"_____, 35/23 _____#_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 36/24 _____$_____, 37/25 _____%_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 38/26 _____&_____, 39/27 _____'_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 40/28 _____(_____, 41/29 _____)_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 42/2a _____*_____, 43/2b _____+_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 44/2c _____,_____, 45/2d _____-_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 46/2e _____._____, 47/2f _____/_____ -+ ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 48/30 _____0_____, 49/31 _____1_____ -+ ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 50/32 _____2_____, 51/33 _____3_____ -+ ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 52/34 _____4_____, 53/35 _____5_____ -+ ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 54/36 _____6_____, 55/37 _____7_____ -+ ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 56/38 _____8_____, 57/39 _____9_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 58/3a _____:_____, 59/3b _____;_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 60/3c _____<_____, 61/3d _____=_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 62/3e _____>_____, 63/3f _____?_____ -+ -+ ct_mix CT_NONE_IDX, CT_UPPER_XDIGIT_IDX ; 64/40 _____@_____, 65/41 _____A_____ -+ ct_mix CT_UPPER_XDIGIT_IDX, CT_UPPER_XDIGIT_IDX ; 66/42 _____B_____, 67/43 _____C_____ -+ ct_mix CT_UPPER_XDIGIT_IDX, CT_UPPER_XDIGIT_IDX ; 68/44 _____D_____, 69/45 _____E_____ -+ ct_mix CT_UPPER_XDIGIT_IDX, CT_UPPER_IDX ; 70/46 _____F_____, 71/47 _____G_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 72/48 _____H_____, 73/49 _____I_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 74/4a _____J_____, 75/4b _____K_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 76/4c _____L_____, 77/4d _____M_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 78/4e _____N_____, 79/4f _____O_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 80/50 _____P_____, 81/51 _____Q_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 82/52 _____R_____, 83/53 _____S_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 84/54 _____T_____, 85/55 _____U_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 86/56 _____V_____, 87/57 _____W_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 88/58 _____X_____, 89/59 _____Y_____ -+ ct_mix CT_UPPER_IDX, CT_NONE_IDX ; 90/5a _____Z_____, 91/5b _____[_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 92/5c _____\_____, 93/5d _____]_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 94/5e _____^_____, 95/5f _UNDERLINE_ -+ -+ ct_mix CT_NONE_IDX, CT_LOWER_XDIGIT_IDX ; 96/60 ___grave___, 97/61 _____a_____ -+ ct_mix CT_LOWER_XDIGIT_IDX, CT_LOWER_XDIGIT_IDX ; 98/62 _____b_____, 99/63 _____c_____ -+ ct_mix CT_LOWER_XDIGIT_IDX, CT_LOWER_XDIGIT_IDX ; 100/64 _____d_____, 101/65 _____e_____ -+ ct_mix CT_LOWER_XDIGIT_IDX, CT_LOWER_IDX ; 102/66 _____f_____, 103/67 _____g_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 104/68 _____h_____, 105/69 _____i_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 106/6a _____j_____, 107/6b _____k_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 108/6c _____l_____, 109/6d _____m_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 110/6e _____n_____, 111/6f _____o_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 112/70 _____p_____, 113/71 _____q_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 114/72 _____r_____, 115/73 _____s_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 116/74 _____t_____, 117/75 _____u_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 118/76 _____v_____, 119/77 _____w_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 120/78 _____x_____, 121/79 _____y_____ -+ ct_mix CT_LOWER_IDX, CT_NONE_IDX ; 122/7a _____z_____, 123/7b _____{_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 124/7c _____|_____, 125/7d _____}_____ -+ ct_mix CT_NONE_IDX, CT_WS_IDX ; 126/7e _____~_____, 127/7f ____DEL____ -+ -+.repeat 64 -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 128-255 -+.endrepeat -diff --git a/asminc/ctype_console.inc b/asminc/ctype_console.inc -new file mode 100644 -index 00000000..55db8e61 ---- /dev/null -+++ b/asminc/ctype_console.inc -@@ -0,0 +1,92 @@ -+; ctype_console.inc -+; -+; This file is part of -+; cc65 - a freeware C compiler for 6502 based systems -+; -+; https://github.com/cc65/cc65 -+; -+; See "LICENSE" file for legal information. -+; -+; Character specification table, matching serveral consoles. -+; -+ -+ .include "ctypetable.inc" -+ .export __ctypeIdx -+ -+; The tables are readonly, put them into the rodata segment -+ -+.rodata -+ -+__ctypeIdx: -+ -+.repeat 2 ; 2 times for normal and inverted -+ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 0/00 ___ctrl_@___, 1/01 ___ctrl_A___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 2/02 ___ctrl_B___, 3/03 ___ctrl_C___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 4/04 ___ctrl_D___, 5/05 ___ctrl_E___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 6/06 ___ctrl_F___, 7/07 ___ctrl_G___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_WS_SPACETAB_IDX ; 8/08 ___ctrl_H___, 9/09 ___ctrl_I___ -+ ct_mix CT_CTRL_WS_IDX, CT_CTRL_WS_IDX ; 10/0a ___ctrl_J___, 11/0b ___ctrl_K___ -+ ct_mix CT_CTRL_WS_IDX, CT_CTRL_WS_IDX ; 12/0c ___ctrl_L___, 13/0d ___ctrl_M___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 14/0e ___ctrl_N___, 15/0f ___ctrl_O___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 16/10 ___ctrl_P___, 17/11 ___ctrl_Q___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 18/12 ___ctrl_R___, 19/13 ___ctrl_S___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 20/14 ___ctrl_T___, 21/15 ___ctrl_U___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 22/16 ___ctrl_V___, 23/17 ___ctrl_W___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 24/18 ___ctrl_X___, 25/19 ___ctrl_Y___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 26/1a ___ctrl_Z___, 27/1b ___ctrl_[___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 28/1c ___ctrl_\___, 29/1d ___ctrl_]___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 30/1e ___ctrl_^___, 31/1f ___ctrl_____ -+ -+ ct_mix CT_SPACE_SPACETAB_IDX, CT_NONE_IDX ; 32/20 ___SPACE___, 33/21 _____!_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 34/22 _____"_____, 35/23 _____#_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 36/24 _____$_____, 37/25 _____%_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 38/26 _____&_____, 39/27 _____'_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 40/28 _____(_____, 41/29 _____)_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 42/2a _____*_____, 43/2b _____+_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 44/2c _____,_____, 45/2d _____-_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 46/2e _____._____, 47/2f _____/_____ -+ ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 48/30 _____0_____, 49/31 _____1_____ -+ ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 50/32 _____2_____, 51/33 _____3_____ -+ ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 52/34 _____4_____, 53/35 _____5_____ -+ ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 54/36 _____6_____, 55/37 _____7_____ -+ ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 56/38 _____8_____, 57/39 _____9_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 58/3a _____:_____, 59/3b _____;_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 60/3c _____<_____, 61/3d _____=_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 62/3e _____>_____, 63/3f _____?_____ -+ -+ ct_mix CT_NONE_IDX, CT_UPPER_XDIGIT_IDX ; 64/40 _____@_____, 65/41 _____A_____ -+ ct_mix CT_UPPER_XDIGIT_IDX, CT_UPPER_XDIGIT_IDX ; 66/42 _____B_____, 67/43 _____C_____ -+ ct_mix CT_UPPER_XDIGIT_IDX, CT_UPPER_XDIGIT_IDX ; 68/44 _____D_____, 69/45 _____E_____ -+ ct_mix CT_UPPER_XDIGIT_IDX, CT_UPPER_IDX ; 70/46 _____F_____, 71/47 _____G_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 72/48 _____H_____, 73/49 _____I_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 74/4a _____J_____, 75/4b _____K_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 76/4c _____L_____, 77/4d _____M_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 78/4e _____N_____, 79/4f _____O_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 80/50 _____P_____, 81/51 _____Q_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 82/52 _____R_____, 83/53 _____S_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 84/54 _____T_____, 85/55 _____U_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 86/56 _____V_____, 87/57 _____W_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 88/58 _____X_____, 89/59 _____Y_____ -+ ct_mix CT_UPPER_IDX, CT_NONE_IDX ; 90/5a _____Z_____, 91/5b _____[_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 92/5c _____\_____, 93/5d _____]_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 94/5e _____^_____, 95/5f _UNDERLINE_ -+ -+ ct_mix CT_NONE_IDX, CT_LOWER_XDIGIT_IDX ; 96/60 ___grave___, 97/61 _____a_____ -+ ct_mix CT_LOWER_XDIGIT_IDX, CT_LOWER_XDIGIT_IDX ; 98/62 _____b_____, 99/63 _____c_____ -+ ct_mix CT_LOWER_XDIGIT_IDX, CT_LOWER_XDIGIT_IDX ; 100/64 _____d_____, 101/65 _____e_____ -+ ct_mix CT_LOWER_XDIGIT_IDX, CT_LOWER_IDX ; 102/66 _____f_____, 103/67 _____g_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 104/68 _____h_____, 105/69 _____i_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 106/6a _____j_____, 107/6b _____k_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 108/6c _____l_____, 109/6d _____m_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 110/6e _____n_____, 111/6f _____o_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 112/70 _____p_____, 113/71 _____q_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 114/72 _____r_____, 115/73 _____s_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 116/74 _____t_____, 117/75 _____u_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 118/76 _____v_____, 119/77 _____w_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 120/78 _____x_____, 121/79 _____y_____ -+ ct_mix CT_LOWER_IDX, CT_NONE_IDX ; 122/7a _____z_____, 123/7b _____{_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 124/7c _____|_____, 125/7d _____}_____ -+ ct_mix CT_NONE_IDX, CT_WS_IDX ; 126/7e _____~_____, 127/7f ____DEL____ -+ -+.endrepeat -diff --git a/asminc/ctypetable.inc b/asminc/ctypetable.inc -new file mode 100644 -index 00000000..e0a8bdcd ---- /dev/null -+++ b/asminc/ctypetable.inc -@@ -0,0 +1,48 @@ -+; ctypetable.inc -+; -+; This file is part of -+; cc65 - a freeware C compiler for 6502 based systems -+; -+; https://github.com/cc65/cc65 -+; -+; See "LICENSE" file for legal information. -+; -+; Data covering all possible combinations of character flags for target specific definition -+; -+ -+.include "ctype.inc" -+.export __ctype -+ -+; This data is a table of possible ctype combinations, possible during -+ -+.rodata -+__ctype: -+ct_none: .byte CT_NONE -+ct_lower: .byte CT_LOWER -+ct_upper: .byte CT_UPPER -+ct_digit_xdigit: .byte CT_DIGIT | CT_XDIGIT -+ct_lower_xdigit: .byte CT_LOWER | CT_XDIGIT -+ct_upper_xdigit: .byte CT_UPPER | CT_XDIGIT -+ct_ctrl: .byte CT_CTRL -+ct_ws: .byte CT_OTHER_WS -+ct_ctrl_ws: .byte CT_CTRL | CT_OTHER_WS -+ct_space_spacetab: .byte CT_SPACE | CT_SPACE_TAB -+ct_ctrl_ws_spacetab: .byte CT_CTRL | CT_OTHER_WS | CT_SPACE_TAB -+ -+; build indices out of the table above: -+ -+CT_NONE_IDX = ct_none - __ctype -+CT_LOWER_IDX = ct_lower - __ctype -+CT_UPPER_IDX = ct_upper - __ctype -+CT_DIGIT_XDIGIT_IDX = ct_digit_xdigit - __ctype -+CT_LOWER_XDIGIT_IDX = ct_lower_xdigit - __ctype -+CT_UPPER_XDIGIT_IDX = ct_upper_xdigit - __ctype -+CT_CTRL_IDX = ct_ctrl - __ctype -+CT_WS_IDX = ct_ws - __ctype -+CT_CTRL_WS_IDX = ct_ctrl_ws - __ctype -+CT_SPACE_SPACETAB_IDX = ct_space_spacetab - __ctype -+CT_CTRL_WS_SPACETAB_IDX = ct_ctrl_ws_spacetab - __ctype -+ -+.macro ct_mix lower, upper -+ .byte ((lower) & $0F) | ((upper) << 4) -+.endmacro -diff --git a/doc/cc65.sgml b/doc/cc65.sgml -index 8691f947..dba0a028 100644 ---- a/doc/cc65.sgml -+++ b/doc/cc65.sgml -@@ -249,7 +249,6 @@ Here is a description of all the command line options: - <item><tt/strcmp()/ - <item><tt/strcpy()/ - <item><tt/strlen()/ -- <item>most of the functions declared in <tt/<ctype.h>/ - </itemize> - - Note: This has two consequences: -@@ -259,9 +258,7 @@ Here is a description of all the command line options: - using <tt/--eagerly-inline-funcs/ actually will break things. - <p> - <item>The inlined string and memory functions will not handle strings or -- memory areas larger than 255 bytes. Similarly, the inlined <tt/is..()/ -- functions will not work with values outside the char. range (such as -- <tt/EOF/). -+ memory areas larger than 255 bytes. - <p> - </itemize> - -diff --git a/doc/funcref.sgml b/doc/funcref.sgml -index b6171a0e..94e85009 100644 ---- a/doc/funcref.sgml -+++ b/doc/funcref.sgml -@@ -4232,11 +4232,6 @@ to undefined behaviour. - is a letter or digit. The return value is zero if the character is anything - else. - <tag/Notes/<itemize> --<item>When compiling with <tt/-Os/ the function is actually a macro. The --inline sequence generated by the macro will not work correctly for values --outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of --this range. The non inline function may be accessed by <tt/#undef/'ing --the macro. - <item>When compiling without <tt/-Os/, the function is only available as - fastcall function, so it may only be used in presence of a prototype. - </itemize> -@@ -4269,11 +4264,6 @@ fastcall function, so it may only be used in presence of a prototype. - <tag/Description/The function returns a non zero value if the given argument - is a letter. The return value is zero if the character is anything else. - <tag/Notes/<itemize> --<item>When compiling with <tt/-Os/ the function is actually a macro. The --inline sequence generated by the macro will not work correctly for values --outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of --this range. The non inline function may be accessed by <tt/#undef/'ing the --macro. - <item>When compiling without <tt/-Os/, the function is only available as - fastcall function, so it may only be used in presence of a prototype. - </itemize> -@@ -4305,12 +4295,6 @@ fastcall function, so it may only be used in presence of a prototype. - <tag/Declaration/<tt/int __fastcall__ isascii (int c);/ - <tag/Description/The function returns a non zero value if the given argument - is in the range 0..127 (the range of valid ASCII characters) and zero if not. --<tag/Notes/<itemize> --<item>When compiling with <tt/-Os/ the function is actually a macro. The --inline sequence generated by the macro will not work correctly for values --outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of --this range. The non inline function may be accessed by <tt/#undef/'ing the --macro. - <item>When compiling without <tt/-Os/, the function is only available as - fastcall function, so it may only be used in presence of a prototype. - </itemize> -@@ -4344,11 +4328,6 @@ fastcall function, so it may only be used in presence of a prototype. - is a space or tab character. The return value is zero if the character is - anything else. - <tag/Notes/<itemize> --<item>When compiling with <tt/-Os/ the function is actually a macro. The --inline sequence generated by the macro will not work correctly for values --outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of --this range. The non inline function may be accessed by <tt/#undef/'ing the --macro. - <item>When compiling without <tt/-Os/, the function is only available as - fastcall function, so it may only be used in presence of a prototype. - </itemize> -@@ -4382,11 +4361,6 @@ fastcall function, so it may only be used in presence of a prototype. - is a control character. The return value is zero if the character is anything - else. - <tag/Notes/<itemize> --<item>When compiling with <tt/-Os/ the function is actually a macro. The --inline sequence generated by the macro will not work correctly for values --outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of --this range. The non inline function may be accessed by <tt/#undef/'ing the --macro. - <item>When compiling without <tt/-Os/, the function is only available as - fastcall function, so it may only be used in presence of a prototype. - </itemize> -@@ -4418,12 +4392,6 @@ fastcall function, so it may only be used in presence of a prototype. - <tag/Declaration/<tt/int __fastcall__ isdigit (int c);/ - <tag/Description/The function returns a non zero value if the given argument - is a digit. The return value is zero if the character is anything else. --<tag/Notes/<itemize> --<item>When compiling with <tt/-Os/ the function is actually a macro. The --inline sequence generated by the macro will not work correctly for values --outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of --this range. The non inline function may be accessed by <tt/#undef/'ing the --macro. - <item>When compiling without <tt/-Os/, the function is only available as - fastcall function, so it may only be used in presence of a prototype. - </itemize> -@@ -4479,11 +4447,6 @@ space). - is a printable character with the exception of space. The return value is zero - if the character is anything else. - <tag/Notes/<itemize> --<item>When compiling with <tt/-Os/ the function is actually a macro. The --inline sequence generated by the macro will not work correctly for values --outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of --this range. The non inline function may be accessed by <tt/#undef/'ing the --macro. - <item>When compiling without <tt/-Os/, the function is only available as - fastcall function, so it may only be used in presence of a prototype. - </itemize> -@@ -4517,11 +4480,6 @@ fastcall function, so it may only be used in presence of a prototype. - is a lower case letter. The return value is zero if the character is anything - else. - <tag/Notes/<itemize> --<item>When compiling with <tt/-Os/ the function is actually a macro. The --inline sequence generated by the macro will not work correctly for values --outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of --this range. The non inline function may be accessed by <tt/#undef/'ing the --macro. - <item>When compiling without <tt/-Os/, the function is only available as - fastcall function, so it may only be used in presence of a prototype. - </itemize> -@@ -4555,11 +4513,6 @@ fastcall function, so it may only be used in presence of a prototype. - is a printable character (this includes the space character). The return value - is zero if the character is anything else. - <tag/Notes/<itemize> --<item>When compiling with <tt/-Os/ the function is actually a macro. The --inline sequence generated by the macro will not work correctly for values --outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of --this range. The non inline function may be accessed by <tt/#undef/'ing the --macro. - <item>When compiling without <tt/-Os/, the function is only available as - fastcall function, so it may only be used in presence of a prototype. - </itemize> -@@ -4594,11 +4547,6 @@ space or an alphanumeric character. - is a printable character, but not a space or anything alphanumeric. The return - value is zero if the character is anything else. - <tag/Notes/<itemize> --<item>When compiling with <tt/-Os/ the function is actually a macro. The --inline sequence generated by the macro will not work correctly for values --outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of --this range. The non inline function may be accessed by <tt/#undef/'ing the --macro. - <item>When compiling without <tt/-Os/, the function is only available as - fastcall function, so it may only be used in presence of a prototype. - </itemize> -@@ -4634,11 +4582,6 @@ anything else. The standard white space characters are: space, formfeed ('\f'), - newline ('\n'), carriage return ('\r'), horizontal tab ('\t'), and vertical tab - ('\v'). - <tag/Notes/<itemize> --<item>When compiling with <tt/-Os/ the function is actually a macro. The --inline sequence generated by the macro will not work correctly for values --outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of --this range. The non inline function may be accessed by <tt/#undef/'ing the --macro. - <item>When compiling without <tt/-Os/, the function is only available as - fastcall function, so it may only be used in presence of a prototype. - </itemize> -@@ -4672,11 +4615,6 @@ fastcall function, so it may only be used in presence of a prototype. - is an upper case letter. The return value is zero if the character is anything - else. - <tag/Notes/<itemize> --<item>When compiling with <tt/-Os/ the function is actually a macro. The --inline sequence generated by the macro will not work correctly for values --outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of --this range. The non inline function may be accessed by <tt/#undef/'ing the --macro. - <item>When compiling without <tt/-Os/, the function is only available as - fastcall function, so it may only be used in presence of a prototype. - </itemize> -@@ -4710,11 +4648,6 @@ fastcall function, so it may only be used in presence of a prototype. - is a hexadecimal digit (0..9, a..f and A..F). The return value is zero if the - character is anything else. - <tag/Notes/<itemize> --<item>When compiling with <tt/-Os/ the function is actually a macro. The --inline sequence generated by the macro will not work correctly for values --outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of --this range. The non inline function may be accessed by <tt/#undef/'ing the --macro. - <item>When compiling without <tt/-Os/, the function is only available as - fastcall function, so it may only be used in presence of a prototype. - </itemize> -diff --git a/include/ctype.h b/include/ctype.h -index 103f6cc2..d842228e 100644 ---- a/include/ctype.h -+++ b/include/ctype.h -@@ -36,10 +36,6 @@ - #ifndef _CTYPE_H - #define _CTYPE_H - -- --/* The array containing character classification data */ --extern unsigned char _ctype[256]; -- - /* Bits used to specify character classes */ - #define _CT_LOWER 0x01 /* 0 - Lower case char */ - #define _CT_UPPER 0x02 /* 1 - Upper case char */ -@@ -61,6 +57,7 @@ extern unsigned char _ctype[256]; - /* Character classification functions */ - int __fastcall__ isalnum (int c); - int __fastcall__ isalpha (int c); -+int __fastcall__ isascii (int c); - int __fastcall__ iscntrl (int c); - int __fastcall__ isdigit (int c); - int __fastcall__ isgraph (int c); -@@ -82,102 +79,6 @@ unsigned char __fastcall__ toascii (unsigned char c); - /* Convert a target-specific character to ASCII. */ - #endif - -- -- --/* When --eagerly-inline-funcs is enabled, overload most of the above --** functions by macroes. The function prototypes are available again after --** #undef'ing the macroes. --** Please note that the following macroes do NOT handle EOF correctly, as --** stated in the manual. If you need correct behaviour for EOF, don't --** use --eagerly-inline-funcs, or #undefine the following macroes. --*/ --#ifdef __EAGERLY_INLINE_FUNCS__ -- --#define isalnum(c) (__AX__ = (c), \ -- __asm__ ("tay"), \ -- __asm__ ("lda %v,y", _ctype), \ -- __asm__ ("and #%b", _CT_ALNUM), \ -- __AX__) -- --#define isalpha(c) (__AX__ = (c), \ -- __asm__ ("tay"), \ -- __asm__ ("lda %v,y", _ctype), \ -- __asm__ ("and #%b", _CT_ALPHA), \ -- __AX__) -- --#if __CC65_STD__ >= __CC65_STD_C99__ --#define isblank(c) (__AX__ = (c), \ -- __asm__ ("tay"), \ -- __asm__ ("lda %v,y", _ctype), \ -- __asm__ ("and #%b", _CT_SPACE_TAB), \ -- __AX__) --#endif -- --#define iscntrl(c) (__AX__ = (c), \ -- __asm__ ("tay"), \ -- __asm__ ("lda %v,y", _ctype), \ -- __asm__ ("and #%b", _CT_CNTRL), \ -- __AX__) -- --#define isdigit(c) (__AX__ = (c), \ -- __asm__ ("tay"), \ -- __asm__ ("lda %v,y", _ctype), \ -- __asm__ ("and #%b", _CT_DIGIT), \ -- __AX__) -- --#define isgraph(c) (__AX__ = (c), \ -- __asm__ ("tay"), \ -- __asm__ ("lda %v,y", _ctype), \ -- __asm__ ("and #%b", _CT_NOT_GRAPH), \ -- __asm__ ("cmp #1"), \ -- __asm__ ("lda #1"), \ -- __asm__ ("sbc #1"), \ -- __AX__) -- --#define islower(c) (__AX__ = (c), \ -- __asm__ ("tay"), \ -- __asm__ ("lda %v,y", _ctype), \ -- __asm__ ("and #%b", _CT_LOWER), \ -- __AX__) -- --#define isprint(c) (__AX__ = (c), \ -- __asm__ ("tay"), \ -- __asm__ ("lda %v,y", _ctype), \ -- __asm__ ("and #%b", _CT_NOT_PRINT), \ -- __asm__ ("eor #%b", _CT_NOT_PRINT), \ -- __AX__) -- --#define ispunct(c) (__AX__ = (c), \ -- __asm__ ("tay"), \ -- __asm__ ("lda %v,y", _ctype), \ -- __asm__ ("and #%b", _CT_NOT_PUNCT), \ -- __asm__ ("cmp #1"), \ -- __asm__ ("lda #1"), \ -- __asm__ ("sbc #1"), \ -- __AX__) -- --#define isspace(c) (__AX__ = (c), \ -- __asm__ ("tay"), \ -- __asm__ ("lda %v,y", _ctype), \ -- __asm__ ("and #%b", _CT_WS), \ -- __AX__) -- --#define isupper(c) (__AX__ = (c), \ -- __asm__ ("tay"), \ -- __asm__ ("lda %v,y", _ctype), \ -- __asm__ ("and #%b", _CT_UPPER), \ -- __AX__) -- --#define isxdigit(c) (__AX__ = (c), \ -- __asm__ ("tay"), \ -- __asm__ ("lda %v,y", _ctype), \ -- __asm__ ("and #%b", _CT_XDIGIT), \ -- __AX__) -- --#endif -- -- -- - /* End of ctype.h */ - #endif - -diff --git a/libsrc/apple2/ctype.s b/libsrc/apple2/ctype.s -index fa9a65c8..da4d3847 100644 ---- a/libsrc/apple2/ctype.s -+++ b/libsrc/apple2/ctype.s -@@ -1,161 +1,5 @@ --; --; Stefan Haubenthal with minor changes from Ullrich von Bassewitz, 2003-05-02 --; - ; Character specification table. - ; -+; uses the "console" definition - -- .include "ctype.inc" -- --; The tables are readonly, put them into the rodata segment -- --.rodata -- --; The following 256 byte wide table specifies attributes for the isxxx type --; of functions. Doing it by a table means some overhead in space, but it --; has major advantages: --; --; * It is fast. If it were'nt for the slow parameter passing of cc65, one --; could even define macros for the isxxx functions (this is usually --; done on other platforms). --; --; * It is highly portable. The only unportable part is the table itself, --; all real code goes into the common library. --; --; * We save some code in the isxxx functions. -- -- --__ctype: -- .repeat 2 -- .byte CT_CTRL ; 0/00 ___ctrl_@___ -- .byte CT_CTRL ; 1/01 ___ctrl_A___ -- .byte CT_CTRL ; 2/02 ___ctrl_B___ -- .byte CT_CTRL ; 3/03 ___ctrl_C___ -- .byte CT_CTRL ; 4/04 ___ctrl_D___ -- .byte CT_CTRL ; 5/05 ___ctrl_E___ -- .byte CT_CTRL ; 6/06 ___ctrl_F___ -- .byte CT_CTRL ; 7/07 ___ctrl_G___ -- .byte CT_CTRL ; 8/08 ___ctrl_H___ -- .byte CT_CTRL | CT_OTHER_WS | CT_SPACE_TAB -- ; 9/09 ___ctrl_I___ -- .byte CT_CTRL | CT_OTHER_WS ; 10/0a ___ctrl_J___ -- .byte CT_CTRL | CT_OTHER_WS ; 11/0b ___ctrl_K___ -- .byte CT_CTRL | CT_OTHER_WS ; 12/0c ___ctrl_L___ -- .byte CT_CTRL | CT_OTHER_WS ; 13/0d ___ctrl_M___ -- .byte CT_CTRL ; 14/0e ___ctrl_N___ -- .byte CT_CTRL ; 15/0f ___ctrl_O___ -- .byte CT_CTRL ; 16/10 ___ctrl_P___ -- .byte CT_CTRL ; 17/11 ___ctrl_Q___ -- .byte CT_CTRL ; 18/12 ___ctrl_R___ -- .byte CT_CTRL ; 19/13 ___ctrl_S___ -- .byte CT_CTRL ; 20/14 ___ctrl_T___ -- .byte CT_CTRL ; 21/15 ___ctrl_U___ -- .byte CT_CTRL ; 22/16 ___ctrl_V___ -- .byte CT_CTRL ; 23/17 ___ctrl_W___ -- .byte CT_CTRL ; 24/18 ___ctrl_X___ -- .byte CT_CTRL ; 25/19 ___ctrl_Y___ -- .byte CT_CTRL ; 26/1a ___ctrl_Z___ -- .byte CT_CTRL ; 27/1b ___ctrl_[___ -- .byte CT_CTRL ; 28/1c ___ctrl_\___ -- .byte CT_CTRL ; 29/1d ___ctrl_]___ -- .byte CT_CTRL ; 30/1e ___ctrl_^___ -- .byte CT_CTRL ; 31/1f ___ctrl_____ -- .byte CT_SPACE | CT_SPACE_TAB ; 32/20 ___SPACE___ -- .byte CT_NONE ; 33/21 _____!_____ -- .byte CT_NONE ; 34/22 _____"_____ -- .byte CT_NONE ; 35/23 _____#_____ -- .byte CT_NONE ; 36/24 _____$_____ -- .byte CT_NONE ; 37/25 _____%_____ -- .byte CT_NONE ; 38/26 _____&_____ -- .byte CT_NONE ; 39/27 _____'_____ -- .byte CT_NONE ; 40/28 _____(_____ -- .byte CT_NONE ; 41/29 _____)_____ -- .byte CT_NONE ; 42/2a _____*_____ -- .byte CT_NONE ; 43/2b _____+_____ -- .byte CT_NONE ; 44/2c _____,_____ -- .byte CT_NONE ; 45/2d _____-_____ -- .byte CT_NONE ; 46/2e _____._____ -- .byte CT_NONE ; 47/2f _____/_____ -- .byte CT_DIGIT | CT_XDIGIT ; 48/30 _____0_____ -- .byte CT_DIGIT | CT_XDIGIT ; 49/31 _____1_____ -- .byte CT_DIGIT | CT_XDIGIT ; 50/32 _____2_____ -- .byte CT_DIGIT | CT_XDIGIT ; 51/33 _____3_____ -- .byte CT_DIGIT | CT_XDIGIT ; 52/34 _____4_____ -- .byte CT_DIGIT | CT_XDIGIT ; 53/35 _____5_____ -- .byte CT_DIGIT | CT_XDIGIT ; 54/36 _____6_____ -- .byte CT_DIGIT | CT_XDIGIT ; 55/37 _____7_____ -- .byte CT_DIGIT | CT_XDIGIT ; 56/38 _____8_____ -- .byte CT_DIGIT | CT_XDIGIT ; 57/39 _____9_____ -- .byte CT_NONE ; 58/3a _____:_____ -- .byte CT_NONE ; 59/3b _____;_____ -- .byte CT_NONE ; 60/3c _____<_____ -- .byte CT_NONE ; 61/3d _____=_____ -- .byte CT_NONE ; 62/3e _____>_____ -- .byte CT_NONE ; 63/3f _____?_____ -- -- .byte CT_NONE ; 64/40 _____@_____ -- .byte CT_UPPER | CT_XDIGIT ; 65/41 _____A_____ -- .byte CT_UPPER | CT_XDIGIT ; 66/42 _____B_____ -- .byte CT_UPPER | CT_XDIGIT ; 67/43 _____C_____ -- .byte CT_UPPER | CT_XDIGIT ; 68/44 _____D_____ -- .byte CT_UPPER | CT_XDIGIT ; 69/45 _____E_____ -- .byte CT_UPPER | CT_XDIGIT ; 70/46 _____F_____ -- .byte CT_UPPER ; 71/47 _____G_____ -- .byte CT_UPPER ; 72/48 _____H_____ -- .byte CT_UPPER ; 73/49 _____I_____ -- .byte CT_UPPER ; 74/4a _____J_____ -- .byte CT_UPPER ; 75/4b _____K_____ -- .byte CT_UPPER ; 76/4c _____L_____ -- .byte CT_UPPER ; 77/4d _____M_____ -- .byte CT_UPPER ; 78/4e _____N_____ -- .byte CT_UPPER ; 79/4f _____O_____ -- .byte CT_UPPER ; 80/50 _____P_____ -- .byte CT_UPPER ; 81/51 _____Q_____ -- .byte CT_UPPER ; 82/52 _____R_____ -- .byte CT_UPPER ; 83/53 _____S_____ -- .byte CT_UPPER ; 84/54 _____T_____ -- .byte CT_UPPER ; 85/55 _____U_____ -- .byte CT_UPPER ; 86/56 _____V_____ -- .byte CT_UPPER ; 87/57 _____W_____ -- .byte CT_UPPER ; 88/58 _____X_____ -- .byte CT_UPPER ; 89/59 _____Y_____ -- .byte CT_UPPER ; 90/5a _____Z_____ -- .byte CT_NONE ; 91/5b _____[_____ -- .byte CT_NONE ; 92/5c _____\_____ -- .byte CT_NONE ; 93/5d _____]_____ -- .byte CT_NONE ; 94/5e _____^_____ -- .byte CT_NONE ; 95/5f _UNDERLINE_ -- .byte CT_NONE ; 96/60 ___grave___ -- .byte CT_LOWER | CT_XDIGIT ; 97/61 _____a_____ -- .byte CT_LOWER | CT_XDIGIT ; 98/62 _____b_____ -- .byte CT_LOWER | CT_XDIGIT ; 99/63 _____c_____ -- .byte CT_LOWER | CT_XDIGIT ; 100/64 _____d_____ -- .byte CT_LOWER | CT_XDIGIT ; 101/65 _____e_____ -- .byte CT_LOWER | CT_XDIGIT ; 102/66 _____f_____ -- .byte CT_LOWER ; 103/67 _____g_____ -- .byte CT_LOWER ; 104/68 _____h_____ -- .byte CT_LOWER ; 105/69 _____i_____ -- .byte CT_LOWER ; 106/6a _____j_____ -- .byte CT_LOWER ; 107/6b _____k_____ -- .byte CT_LOWER ; 108/6c _____l_____ -- .byte CT_LOWER ; 109/6d _____m_____ -- .byte CT_LOWER ; 110/6e _____n_____ -- .byte CT_LOWER ; 111/6f _____o_____ -- .byte CT_LOWER ; 112/70 _____p_____ -- .byte CT_LOWER ; 113/71 _____q_____ -- .byte CT_LOWER ; 114/72 _____r_____ -- .byte CT_LOWER ; 115/73 _____s_____ -- .byte CT_LOWER ; 116/74 _____t_____ -- .byte CT_LOWER ; 117/75 _____u_____ -- .byte CT_LOWER ; 118/76 _____v_____ -- .byte CT_LOWER ; 119/77 _____w_____ -- .byte CT_LOWER ; 120/78 _____x_____ -- .byte CT_LOWER ; 121/79 _____y_____ -- .byte CT_LOWER ; 122/7a _____z_____ -- .byte CT_NONE ; 123/7b _____{_____ -- .byte CT_NONE ; 124/7c _____|_____ -- .byte CT_NONE ; 125/7d _____}_____ -- .byte CT_NONE ; 126/7e _____~_____ -- .byte CT_OTHER_WS ; 127/7f ____DEL____ -- .endrepeat -- -- -+ .include "ctype_console.inc" -diff --git a/libsrc/atari/ctype.s b/libsrc/atari/ctype.s -index 73553dc1..8173b2ea 100644 ---- a/libsrc/atari/ctype.s -+++ b/libsrc/atari/ctype.s -@@ -1,301 +1,156 @@ -+; ctype.s - ; --; Ullrich von Bassewitz, 02.06.1998 -+; This file is part of -+; cc65 - a freeware C compiler for 6502 based systems - ; --; Character specification table. -+; https://github.com/cc65/cc65 - ; --; adapted to Atari by Christian Groessler, June 2000 -+; See "LICENSE" file for legal information. -+; -+; Atari character specification table. - ; - -+ .include "ctypetable.inc" -+ .export __ctypeIdx -+ - ; The tables are readonly, put them into the rodata segment - - .rodata - --; The following 256 byte wide table specifies attributes for the isxxx type --; of functions. Doing it by a table means some overhead in space, but it --; has major advantages: --; --; * It is fast. If it were'nt for the slow parameter passing of cc65, one --; could even define macros for the isxxx functions (this is usually --; done on other platforms). --; --; * It is highly portable. The only unportable part is the table itself, --; all real code goes into the common library. --; --; * We save some code in the isxxx functions. --; --; --; Bit assignments: --; --; 0 - Lower case char --; 1 - Upper case char --; 2 - Numeric digit --; 3 - Hex digit (both, lower and upper) --; 4 - Control character --; 5 - The space character itself --; 6 - Other whitespace (that is: '\f', '\n', '\r', '\t' and '\v') --; 7 - Space or tab character -+__ctypeIdx: -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 0/00 ___heart____, 1/01 ___l_tee____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 2/02 ___ctrl_B___, 3/03 ___ctrl_C___ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 4/04 ___r_tee____, 5/05 ___ctrl_E___ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 6/06 ___ctrl_F___, 7/07 ___ctrl_G___ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 8/08 ___ctrl_H___, 9/09 ___ctrl_I___ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 10/0a ___ctrl_J___, 11/0b ___ctrl_K___ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 12/0c ___ctrl_L___, 13/0d ___ctrl_M___ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 14/0e ___ctrl_N___, 15/0f ___ctrl_O___ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 16/10 ____club____, 17/11 ___ctrl_Q___ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 18/12 ___h_line___, 19/13 ___ctrl_S___ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 20/14 ____ball____, 21/15 ___ctrl_U___ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 22/16 ___ctrl_V___, 23/17 ___t_tee____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 24/18 ___b_tee____, 25/19 ___ctrl_Y___ -+ ct_mix CT_NONE_IDX, CT_CTRL_IDX ; 26/1a ___ctrl_Z___, 27/1b ____ESC_____ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 28/1c ___crsr_up__, 29/1d ___crsr_dn__ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 30/1e ___crsr_lf__, 31/1f ___crsr_rg__ - -- .export __ctype -+ ct_mix CT_SPACE_SPACETAB_IDX, CT_NONE_IDX ; 32/20 ___SPACE___, 33/21 _____!_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 34/22 _____"_____, 35/23 _____#_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 36/24 _____$_____, 37/25 _____%_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 38/26 _____&_____, 39/27 _____'_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 40/28 _____(_____, 41/29 _____)_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 42/2a _____*_____, 43/2b _____+_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 44/2c _____,_____, 45/2d _____-_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 46/2e _____._____, 47/2f _____/_____ -+ ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 48/30 _____0_____, 49/31 _____1_____ -+ ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 50/32 _____2_____, 51/33 _____3_____ -+ ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 52/34 _____4_____, 53/35 _____5_____ -+ ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 54/36 _____6_____, 55/37 _____7_____ -+ ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 56/38 _____8_____, 57/39 _____9_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 58/3a _____:_____, 59/3b _____;_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 60/3c _____<_____, 61/3d _____=_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 62/3e _____>_____, 63/3f _____?_____ - --__ctype: -- .byte $00 ; 0/00 ___heart____ -- .byte $00 ; 1/01 ___l_tee____ -- .byte $00 ; 2/02 ___ctrl_B___ -- .byte $00 ; 3/03 ___ctrl_C___ -- .byte $00 ; 4/04 ___r_tee____ -- .byte $00 ; 5/05 ___ctrl_E___ -- .byte $00 ; 6/06 ___ctrl_F___ -- .byte $00 ; 7/07 ___ctrl_G___ -- .byte $00 ; 8/08 ___ctrl_H___ -- .byte $00 ; 9/09 ___ctrl_I___ -- .byte $00 ; 10/0a ___ctrl_J___ -- .byte $00 ; 11/0b ___ctrl_K___ -- .byte $00 ; 12/0c ___ctrl_L___ -- .byte $00 ; 13/0d ___ctrl_M___ -- .byte $00 ; 14/0e ___ctrl_N___ -- .byte $00 ; 15/0f ___ctrl_O___ -- .byte $00 ; 16/10 ____club____ -- .byte $00 ; 17/11 ___ctrl_Q___ -- .byte $00 ; 18/12 ___h_line___ -- .byte $00 ; 19/13 ___ctrl_S___ -- .byte $00 ; 20/14 ____ball____ -- .byte $00 ; 21/15 ___ctrl_U___ -- .byte $00 ; 22/16 ___ctrl_V___ -- .byte $00 ; 23/17 ___t_tee____ -- .byte $00 ; 24/18 ___b_tee____ -- .byte $00 ; 25/19 ___ctrl_Y___ -- .byte $00 ; 26/1a ___ctrl_Z___ -- .byte $10 ; 27/1b ____ESC_____ -- .byte $10 ; 28/1c ___crsr_up__ -- .byte $10 ; 29/1d ___crsr_dn__ -- .byte $10 ; 30/1e ___crsr_lf__ -- .byte $10 ; 31/1f ___crsr_rg__ -- .byte $A0 ; 32/20 ___SPACE___ -- .byte $00 ; 33/21 _____!_____ -- .byte $00 ; 34/22 _____"_____ -- .byte $00 ; 35/23 _____#_____ -- .byte $00 ; 36/24 _____$_____ -- .byte $00 ; 37/25 _____%_____ -- .byte $00 ; 38/26 _____&_____ -- .byte $00 ; 39/27 _____'_____ -- .byte $00 ; 40/28 _____(_____ -- .byte $00 ; 41/29 _____)_____ -- .byte $00 ; 42/2a _____*_____ -- .byte $00 ; 43/2b _____+_____ -- .byte $00 ; 44/2c _____,_____ -- .byte $00 ; 45/2d _____-_____ -- .byte $00 ; 46/2e _____._____ -- .byte $00 ; 47/2f _____/_____ -- .byte $0C ; 48/30 _____0_____ -- .byte $0C ; 49/31 _____1_____ -- .byte $0C ; 50/32 _____2_____ -- .byte $0C ; 51/33 _____3_____ -- .byte $0C ; 52/34 _____4_____ -- .byte $0C ; 53/35 _____5_____ -- .byte $0C ; 54/36 _____6_____ -- .byte $0C ; 55/37 _____7_____ -- .byte $0C ; 56/38 _____8_____ -- .byte $0C ; 57/39 _____9_____ -- .byte $00 ; 58/3a _____:_____ -- .byte $00 ; 59/3b _____;_____ -- .byte $00 ; 60/3c _____<_____ -- .byte $00 ; 61/3d _____=_____ -- .byte $00 ; 62/3e _____>_____ -- .byte $00 ; 63/3f _____?_____ -+ ct_mix CT_NONE_IDX, CT_UPPER_XDIGIT_IDX ; 64/40 _____@_____, 65/41 _____A_____ -+ ct_mix CT_UPPER_XDIGIT_IDX, CT_UPPER_XDIGIT_IDX ; 66/42 _____B_____, 67/43 _____C_____ -+ ct_mix CT_UPPER_XDIGIT_IDX, CT_UPPER_XDIGIT_IDX ; 68/44 _____D_____, 69/45 _____E_____ -+ ct_mix CT_UPPER_XDIGIT_IDX, CT_UPPER_IDX ; 70/46 _____F_____, 71/47 _____G_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 72/48 _____H_____, 73/49 _____I_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 74/4a _____J_____, 75/4b _____K_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 76/4c _____L_____, 77/4d _____M_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 78/4e _____N_____, 79/4f _____O_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 80/50 _____P_____, 81/51 _____Q_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 82/52 _____R_____, 83/53 _____S_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 84/54 _____T_____, 85/55 _____U_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 86/56 _____V_____, 87/57 _____W_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 88/58 _____X_____, 89/59 _____Y_____ -+ ct_mix CT_UPPER_IDX, CT_NONE_IDX ; 90/5a _____Z_____, 91/5b _____[_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 92/5c _____\_____, 93/5d _____]_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 94/5e _____^_____, 95/5f _UNDERLINE_ - -- .byte $00 ; 64/40 _____@_____ -- .byte $0A ; 65/41 _____A_____ -- .byte $0A ; 66/42 _____B_____ -- .byte $0A ; 67/43 _____C_____ -- .byte $0A ; 68/44 _____D_____ -- .byte $0A ; 69/45 _____E_____ -- .byte $0A ; 70/46 _____F_____ -- .byte $02 ; 71/47 _____G_____ -- .byte $02 ; 72/48 _____H_____ -- .byte $02 ; 73/49 _____I_____ -- .byte $02 ; 74/4a _____J_____ -- .byte $02 ; 75/4b _____K_____ -- .byte $02 ; 76/4c _____L_____ -- .byte $02 ; 77/4d _____M_____ -- .byte $02 ; 78/4e _____N_____ -- .byte $02 ; 79/4f _____O_____ -- .byte $02 ; 80/50 _____P_____ -- .byte $02 ; 81/51 _____Q_____ -- .byte $02 ; 82/52 _____R_____ -- .byte $02 ; 83/53 _____S_____ -- .byte $02 ; 84/54 _____T_____ -- .byte $02 ; 85/55 _____U_____ -- .byte $02 ; 86/56 _____V_____ -- .byte $02 ; 87/57 _____W_____ -- .byte $02 ; 88/58 _____X_____ -- .byte $02 ; 89/59 _____Y_____ -- .byte $02 ; 90/5a _____Z_____ -- .byte $00 ; 91/5b _____[_____ -- .byte $00 ; 92/5c _____\_____ -- .byte $00 ; 93/5d _____]_____ -- .byte $00 ; 94/5e _____^_____ -- .byte $00 ; 95/5f _UNDERLINE_ -- .byte $00 ; 96/60 __diamond__ -- .byte $09 ; 97/61 _____a_____ -- .byte $09 ; 98/62 _____b_____ -- .byte $09 ; 99/63 _____c_____ -- .byte $09 ; 100/64 _____d_____ -- .byte $09 ; 101/65 _____e_____ -- .byte $09 ; 102/66 _____f_____ -- .byte $01 ; 103/67 _____g_____ -- .byte $01 ; 104/68 _____h_____ -- .byte $01 ; 105/69 _____i_____ -- .byte $01 ; 106/6a _____j_____ -- .byte $01 ; 107/6b _____k_____ -- .byte $01 ; 108/6c _____l_____ -- .byte $01 ; 109/6d _____m_____ -- .byte $01 ; 110/6e _____n_____ -- .byte $01 ; 111/6f _____o_____ -- .byte $01 ; 112/70 _____p_____ -- .byte $01 ; 113/71 _____q_____ -- .byte $01 ; 114/72 _____r_____ -- .byte $01 ; 115/73 _____s_____ -- .byte $01 ; 116/74 _____t_____ -- .byte $01 ; 117/75 _____u_____ -- .byte $01 ; 118/76 _____v_____ -- .byte $01 ; 119/77 _____w_____ -- .byte $01 ; 120/78 _____x_____ -- .byte $01 ; 121/79 _____y_____ -- .byte $01 ; 122/7a _____z_____ -- .byte $00 ; 123/7b ___spade___ -- .byte $00 ; 124/7c __v_line___ -- .byte $10 ; 125/7d __CLRSCR___ -- .byte $D0 ; 126/7e __backtab__ -- .byte $D0 ; 127/7f ____tab____ -+ ct_mix CT_NONE_IDX, CT_LOWER_XDIGIT_IDX ; 96/60 __diamond__, 97/61 _____a_____ -+ ct_mix CT_LOWER_XDIGIT_IDX, CT_LOWER_XDIGIT_IDX ; 98/62 _____b_____, 99/63 _____c_____ -+ ct_mix CT_LOWER_XDIGIT_IDX, CT_LOWER_XDIGIT_IDX ; 100/64 _____d_____, 101/65 _____e_____ -+ ct_mix CT_LOWER_XDIGIT_IDX, CT_LOWER_IDX ; 102/66 _____f_____, 103/67 _____g_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 104/68 _____h_____, 105/69 _____i_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 106/6a _____j_____, 107/6b _____k_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 108/6c _____l_____, 109/6d _____m_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 110/6e _____n_____, 111/6f _____o_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 112/70 _____p_____, 113/71 _____q_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 114/72 _____r_____, 115/73 _____s_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 116/74 _____t_____, 117/75 _____u_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 118/76 _____v_____, 119/77 _____w_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 120/78 _____x_____, 121/79 _____y_____ -+ ct_mix CT_LOWER_IDX, CT_NONE_IDX ; 122/7a _____z_____, 123/7b ___spade___ -+ ct_mix CT_NONE_IDX, CT_CTRL_IDX ; 124/7c __v_line___, 125/7d __CLRSCR___ -+ ct_mix CT_CTRL_WS_SPACETAB_IDX, CT_CTRL_WS_SPACETAB_IDX -+ ; 126/7e __backtab__, 127/7f ____tab____ - -- .byte $00 ; 128/80 _inv_heart___ -- .byte $00 ; 129/81 _inv_l_tee___ -- .byte $00 ; 130/82 _inv_ctrl_B__ -- .byte $00 ; 131/83 _inv_ctrl_C__ -- .byte $00 ; 132/84 _inv_r_tee___ -- .byte $00 ; 133/85 _inv_ctrl_E__ -- .byte $00 ; 134/86 _inv_ctrl_F__ -- .byte $00 ; 135/87 _inv_ctrl_G__ -- .byte $00 ; 136/88 _inv_ctrl_H__ -- .byte $00 ; 137/89 _inv_ctrl_I__ -- .byte $00 ; 138/8a _inv_ctrl_J__ -- .byte $00 ; 139/8b _inv_ctrl_K__ -- .byte $00 ; 140/8c _inv_ctrl_L__ -- .byte $00 ; 141/8d _inv_ctrl_M__ -- .byte $00 ; 142/8e _inv_ctrl_N__ -- .byte $00 ; 143/8f _inv_ctrl_O__ -- .byte $00 ; 144/90 __inv__club__ -- .byte $00 ; 145/91 _inv_ctrl_Q__ -- .byte $00 ; 146/92 _inv_h_line__ -- .byte $00 ; 147/93 _inv_ctrl_S__ -- .byte $00 ; 148/94 __inv__ball__ -- .byte $00 ; 149/95 _inv_ctrl_U__ -- .byte $00 ; 150/96 _inv_ctrl_V__ -- .byte $00 ; 151/97 __inv_t_tee__ -- .byte $00 ; 152/98 __inv_b_tee__ -- .byte $00 ; 153/99 _inv_ctrl_Y__ -- .byte $00 ; 154/9a _inv_ctrl_Z__ -- .byte $50 ; 155/9b _____EOL_____ -- .byte $10 ; 156/9c ___CLRLINE___ -- .byte $10 ; 157/9d ___INSLINE___ -- .byte $10 ; 158/9e ____CLRTAB___ -- .byte $10 ; 159/9f ____INSTAB___ -- .byte $A0 ; 160/a0 __inv_SPACE__ -- .byte $00 ; 161/a1 ___inv_!_____ -- .byte $00 ; 162/a2 ___inv_"_____ -- .byte $00 ; 163/a3 ___inv_#_____ -- .byte $00 ; 164/a4 ___inv_$_____ -- .byte $00 ; 165/a5 ___inv_%_____ -- .byte $00 ; 166/a6 ___inv_&_____ -- .byte $00 ; 167/a7 ___inv_'_____ -- .byte $00 ; 168/a8 ___inv_(_____ -- .byte $00 ; 169/a9 ___inv_)_____ -- .byte $00 ; 170/aa ___inv_*_____ -- .byte $00 ; 171/ab ___inv_+_____ -- .byte $00 ; 172/ac ___inv_,_____ -- .byte $00 ; 173/ad ___inv_-_____ -- .byte $00 ; 174/ae ___inv_._____ -- .byte $00 ; 175/af ___inv_/_____ -- .byte $0C ; 176/b0 ___inv_0_____ -- .byte $0C ; 177/b1 ___inv_1_____ -- .byte $0C ; 178/b2 ___inv_2_____ -- .byte $0C ; 179/b3 ___inv_3_____ -- .byte $0C ; 180/b4 ___inv_4_____ -- .byte $0C ; 181/b5 ___inv_5_____ -- .byte $0C ; 182/b6 ___inv_6_____ -- .byte $0C ; 183/b7 ___inv_7_____ -- .byte $0C ; 184/b8 ___inv_8_____ -- .byte $0C ; 185/b9 ___inv_9_____ -- .byte $00 ; 186/ba ___inv_:_____ -- .byte $00 ; 187/bb ___inv_;_____ -- .byte $00 ; 188/bc ___inv_<_____ -- .byte $00 ; 189/bd ___inv_=_____ -- .byte $00 ; 190/be ___inv_>_____ -- .byte $00 ; 191/bf ___inv_?_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 128/80 _inv_heart___, 129/81 _inv_l_tee___ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 130/82 _inv_ctrl_B__, 131/83 _inv_ctrl_C__ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 132/84 _inv_r_tee___, 133/85 _inv_ctrl_E__ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 134/86 _inv_ctrl_F__, 135/87 _inv_ctrl_G__ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 136/88 _inv_ctrl_H__, 137/89 _inv_ctrl_I__ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 138/8a _inv_ctrl_J__, 139/8b _inv_ctrl_K__ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 140/8c _inv_ctrl_L__, 141/8d _inv_ctrl_M__ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 142/8e _inv_ctrl_N__, 143/8f _inv_ctrl_O__ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 144/90 __inv__club__, 145/91 _inv_ctrl_Q__ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 146/92 _inv_h_line__, 147/93 _inv_ctrl_S__ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 148/94 __inv__ball__, 149/95 _inv_ctrl_U__ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 150/96 _inv_ctrl_V__, 151/97 __inv_t_tee__ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 152/98 __inv_b_tee__, 153/99 _inv_ctrl_Y__ -+ ct_mix CT_NONE_IDX, CT_CTRL_WS_IDX ; 154/9a _inv_ctrl_Z__, 155/9b _____EOL_____ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 156/9c ___CLRLINE___, 157/9d ___INSLINE___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 158/9e ____CLRTAB___, 159/9f ____INSTAB___ - -- .byte $00 ; 192/c0 ___inv_@_____ -- .byte $0A ; 193/c1 ___inv_A_____ -- .byte $0A ; 194/c2 ___inv_B_____ -- .byte $0A ; 195/c3 ___inv_C_____ -- .byte $0A ; 196/c4 ___inv_D_____ -- .byte $0A ; 197/c5 ___inv_E_____ -- .byte $0A ; 198/c6 ___inv_F_____ -- .byte $02 ; 199/c7 ___inv_G_____ -- .byte $02 ; 200/c8 ___inv_H_____ -- .byte $02 ; 201/c9 ___inv_I_____ -- .byte $02 ; 202/ca ___inv_J_____ -- .byte $02 ; 203/cb ___inv_K_____ -- .byte $02 ; 204/cc ___inv_L_____ -- .byte $02 ; 205/cd ___inv_M_____ -- .byte $02 ; 206/ce ___inv_N_____ -- .byte $02 ; 207/cf ___inv_O_____ -- .byte $02 ; 208/d0 ___inv_P_____ -- .byte $02 ; 209/d1 ___inv_Q_____ -- .byte $02 ; 210/d2 ___inv_R_____ -- .byte $02 ; 211/d3 ___inv_S_____ -- .byte $02 ; 212/d4 ___inv_T_____ -- .byte $02 ; 213/d5 ___inv_U_____ -- .byte $02 ; 214/d6 ___inv_V_____ -- .byte $02 ; 215/d7 ___inv_W_____ -- .byte $02 ; 216/d8 ___inv_X_____ -- .byte $02 ; 217/d9 ___inv_Y_____ -- .byte $02 ; 218/da ___inv_Z_____ -- .byte $00 ; 219/db ___inv_[_____ -- .byte $00 ; 220/dc ___inv_\_____ -- .byte $00 ; 221/dd ___inv_]_____ -- .byte $00 ; 222/de ___inv_^_____ -- .byte $00 ; 223/df _inv_UNDRLIN_ -- .byte $00 ; 224/e0 _inv_diamond_ -- .byte $09 ; 225/e1 ___inv_a_____ -- .byte $09 ; 226/e2 ___inv_b_____ -- .byte $09 ; 227/e3 ___inv_c_____ -- .byte $09 ; 228/e4 ___inv_d_____ -- .byte $09 ; 229/e5 ___inv_e_____ -- .byte $09 ; 230/e6 ___inv_f_____ -- .byte $01 ; 231/e7 ___inv_g_____ -- .byte $01 ; 232/e8 ___inv_h_____ -- .byte $01 ; 233/e9 ___inv_i_____ -- .byte $01 ; 234/ea ___inv_j_____ -- .byte $01 ; 235/eb ___inv_k_____ -- .byte $01 ; 236/ec ___inv_l_____ -- .byte $01 ; 237/ed ___inv_m_____ -- .byte $01 ; 238/ee ___inv_n_____ -- .byte $01 ; 239/ef ___inv_o_____ -- .byte $01 ; 240/f0 ___inv_p_____ -- .byte $01 ; 241/f1 ___inv_q_____ -- .byte $01 ; 242/f2 ___inv_r_____ -- .byte $01 ; 243/f3 ___inv_s_____ -- .byte $01 ; 244/f4 ___inv_t_____ -- .byte $01 ; 245/f5 ___inv_u_____ -- .byte $01 ; 246/f6 ___inv_v_____ -- .byte $01 ; 247/f7 ___inv_w_____ -- .byte $01 ; 248/f8 ___inv_x_____ -- .byte $01 ; 249/f9 ___inv_y_____ -- .byte $01 ; 250/fa ___inv_z_____ -- .byte $00 ; 251/fb __inv_spade__ -- .byte $00 ; 252/fc __inv_v_line_ -- .byte $10 ; 253/fd ____BEEP_____ -- .byte $10 ; 254/fe ____DELBS____ -- .byte $10 ; 255/ff ___INSERT____ -+ ct_mix CT_SPACE_SPACETAB_IDX, CT_NONE_IDX ; 160/a0 __inv_SPACE__, 161/a1 ___inv_!_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 162/a2 ___inv_"_____, 163/a3 ___inv_#_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 164/a4 ___inv_$_____, 165/a5 ___inv_%_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 166/a6 ___inv_&_____, 167/a7 ___inv_'_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 168/a8 ___inv_(_____, 169/a9 ___inv_)_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 170/aa ___inv_*_____, 171/ab ___inv_+_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 172/ac ___inv_,_____, 173/ad ___inv_-_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 174/ae ___inv_._____, 175/af ___inv_/_____ -+ ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 176/b0 ___inv_0_____, 177/b1 ___inv_1_____ -+ ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 178/b2 ___inv_2_____, 179/b3 ___inv_3_____ -+ ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 180/b4 ___inv_4_____, 181/b5 ___inv_5_____ -+ ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 182/b6 ___inv_6_____, 183/b7 ___inv_7_____ -+ ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 184/b8 ___inv_8_____, 185/b9 ___inv_9_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 186/ba ___inv_:_____, 187/bb ___inv_;_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 188/bc ___inv_<_____, 189/bd ___inv_=_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 190/be ___inv_>_____, 191/bf ___inv_?_____ - -+ ct_mix CT_NONE_IDX, CT_UPPER_XDIGIT_IDX ; 192/c0 ___inv_@_____, 193/c1 ___inv_A_____ -+ ct_mix CT_UPPER_XDIGIT_IDX, CT_UPPER_XDIGIT_IDX ; 194/c2 ___inv_B_____, 195/c3 ___inv_C_____ -+ ct_mix CT_UPPER_XDIGIT_IDX, CT_UPPER_XDIGIT_IDX ; 196/c4 ___inv_D_____, 197/c5 ___inv_E_____ -+ ct_mix CT_UPPER_XDIGIT_IDX, CT_UPPER_IDX ; 198/c6 ___inv_F_____,199/c7 ___inv_G_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 200/c8 ___inv_H_____, 201/c9 ___inv_I_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 202/ca ___inv_J_____, 203/cb ___inv_K_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 204/cc ___inv_L_____, 205/cd ___inv_M_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 206/ce ___inv_N_____, 207/cf ___inv_O_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 208/d0 ___inv_P_____, 209/d1 ___inv_Q_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 210/d2 ___inv_R_____, 211/d3 ___inv_S_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 212/d4 ___inv_T_____, 213/d5 ___inv_U_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 214/d6 ___inv_V_____, 215/d7 ___inv_W_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 216/d8 ___inv_X_____, 217/d9 ___inv_Y_____ -+ ct_mix CT_UPPER_IDX, CT_NONE_IDX ; 218/da ___inv_Z_____, 219/db ___inv_[_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 220/dc ___inv_\_____, 221/dd ___inv_]_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 222/de ___inv_^_____, 223/df _inv_UNDRLIN_ - -+ ct_mix CT_NONE_IDX, CT_LOWER_XDIGIT_IDX ; 224/e0 _inv_diamond_, 225/e1 ___inv_a_____ -+ ct_mix CT_LOWER_XDIGIT_IDX, CT_LOWER_XDIGIT_IDX ; 226/e2 ___inv_b_____, 227/e3 ___inv_c_____ -+ ct_mix CT_LOWER_XDIGIT_IDX, CT_LOWER_XDIGIT_IDX ; 228/e4 ___inv_d_____, 229/e5 ___inv_e_____ -+ ct_mix CT_LOWER_XDIGIT_IDX, CT_LOWER_IDX ; 230/e6 ___inv_f_____, 231/e7 ___inv_g_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 232/e8 ___inv_h_____, 233/e9 ___inv_i_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 234/ea ___inv_j_____, 235/eb ___inv_k_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 236/ec ___inv_l_____, 237/ed ___inv_m_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 238/ee ___inv_n_____, 239/ef ___inv_o_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 240/f0 ___inv_p_____, 241/f1 ___inv_q_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 242/f2 ___inv_r_____, 243/f3 ___inv_s_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 244/f4 ___inv_t_____, 245/f5 ___inv_u_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 246/f6 ___inv_v_____, 247/f7 ___inv_w_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 248/f8 ___inv_x_____, 249/f9 ___inv_y_____ -+ ct_mix CT_LOWER_IDX, CT_NONE_IDX ; 250/fa ___inv_z_____, 251/fb __inv_spade__ -+ ct_mix CT_NONE_IDX, CT_CTRL_IDX ; 252/fc __inv_v_line_, 253/fd ____BEEP_____ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 254/fe ____DELBS____, 255/ff ___INSERT____ -diff --git a/libsrc/atari2600/ctype.s b/libsrc/atari2600/ctype.s -index 1892554f..1301965e 100644 ---- a/libsrc/atari2600/ctype.s -+++ b/libsrc/atari2600/ctype.s -@@ -1,162 +1,5 @@ --; --; Ullrich von Bassewitz, 2003-10-10 --; - ; Character specification table. - ; -+; uses the "common" definition - -- .include "ctype.inc" -- --; The tables are readonly, put them into the rodata segment -- --.rodata -- --; The following 256 byte wide table specifies attributes for the isxxx type --; of functions. Doing it by a table means some overhead in space, but it --; has major advantages: --; --; * It is fast. If it weren't for the slow parameter passing of cc65, one --; could even define macros for the isxxx functions (this is usually --; done on other platforms). --; --; * It is highly portable. The only unportable part is the table itself, --; all real code goes into the common library. --; --; * We save some code in the isxxx functions. -- -- --__ctype: -- .byte CT_CTRL ; 0/00 ___ctrl_@___ -- .byte CT_CTRL ; 1/01 ___ctrl_A___ -- .byte CT_CTRL ; 2/02 ___ctrl_B___ -- .byte CT_CTRL ; 3/03 ___ctrl_C___ -- .byte CT_CTRL ; 4/04 ___ctrl_D___ -- .byte CT_CTRL ; 5/05 ___ctrl_E___ -- .byte CT_CTRL ; 6/06 ___ctrl_F___ -- .byte CT_CTRL ; 7/07 ___ctrl_G___ -- .byte CT_CTRL ; 8/08 ___ctrl_H___ -- .byte CT_CTRL | CT_OTHER_WS | CT_SPACE_TAB -- ; 9/09 ___ctrl_I___ -- .byte CT_CTRL | CT_OTHER_WS ; 10/0a ___ctrl_J___ -- .byte CT_CTRL | CT_OTHER_WS ; 11/0b ___ctrl_K___ -- .byte CT_CTRL | CT_OTHER_WS ; 12/0c ___ctrl_L___ -- .byte CT_CTRL | CT_OTHER_WS ; 13/0d ___ctrl_M___ -- .byte CT_CTRL ; 14/0e ___ctrl_N___ -- .byte CT_CTRL ; 15/0f ___ctrl_O___ -- .byte CT_CTRL ; 16/10 ___ctrl_P___ -- .byte CT_CTRL ; 17/11 ___ctrl_Q___ -- .byte CT_CTRL ; 18/12 ___ctrl_R___ -- .byte CT_CTRL ; 19/13 ___ctrl_S___ -- .byte CT_CTRL ; 20/14 ___ctrl_T___ -- .byte CT_CTRL ; 21/15 ___ctrl_U___ -- .byte CT_CTRL ; 22/16 ___ctrl_V___ -- .byte CT_CTRL ; 23/17 ___ctrl_W___ -- .byte CT_CTRL ; 24/18 ___ctrl_X___ -- .byte CT_CTRL ; 25/19 ___ctrl_Y___ -- .byte CT_CTRL ; 26/1a ___ctrl_Z___ -- .byte CT_CTRL ; 27/1b ___ctrl_[___ -- .byte CT_CTRL ; 28/1c ___ctrl_\___ -- .byte CT_CTRL ; 29/1d ___ctrl_]___ -- .byte CT_CTRL ; 30/1e ___ctrl_^___ -- .byte CT_CTRL ; 31/1f ___ctrl_____ -- .byte CT_SPACE | CT_SPACE_TAB ; 32/20 ___SPACE___ -- .byte CT_NONE ; 33/21 _____!_____ -- .byte CT_NONE ; 34/22 _____"_____ -- .byte CT_NONE ; 35/23 _____#_____ -- .byte CT_NONE ; 36/24 _____$_____ -- .byte CT_NONE ; 37/25 _____%_____ -- .byte CT_NONE ; 38/26 _____&_____ -- .byte CT_NONE ; 39/27 _____'_____ -- .byte CT_NONE ; 40/28 _____(_____ -- .byte CT_NONE ; 41/29 _____)_____ -- .byte CT_NONE ; 42/2a _____*_____ -- .byte CT_NONE ; 43/2b _____+_____ -- .byte CT_NONE ; 44/2c _____,_____ -- .byte CT_NONE ; 45/2d _____-_____ -- .byte CT_NONE ; 46/2e _____._____ -- .byte CT_NONE ; 47/2f _____/_____ -- .byte CT_DIGIT | CT_XDIGIT ; 48/30 _____0_____ -- .byte CT_DIGIT | CT_XDIGIT ; 49/31 _____1_____ -- .byte CT_DIGIT | CT_XDIGIT ; 50/32 _____2_____ -- .byte CT_DIGIT | CT_XDIGIT ; 51/33 _____3_____ -- .byte CT_DIGIT | CT_XDIGIT ; 52/34 _____4_____ -- .byte CT_DIGIT | CT_XDIGIT ; 53/35 _____5_____ -- .byte CT_DIGIT | CT_XDIGIT ; 54/36 _____6_____ -- .byte CT_DIGIT | CT_XDIGIT ; 55/37 _____7_____ -- .byte CT_DIGIT | CT_XDIGIT ; 56/38 _____8_____ -- .byte CT_DIGIT | CT_XDIGIT ; 57/39 _____9_____ -- .byte CT_NONE ; 58/3a _____:_____ -- .byte CT_NONE ; 59/3b _____;_____ -- .byte CT_NONE ; 60/3c _____<_____ -- .byte CT_NONE ; 61/3d _____=_____ -- .byte CT_NONE ; 62/3e _____>_____ -- .byte CT_NONE ; 63/3f _____?_____ -- -- .byte CT_NONE ; 64/40 _____@_____ -- .byte CT_UPPER | CT_XDIGIT ; 65/41 _____A_____ -- .byte CT_UPPER | CT_XDIGIT ; 66/42 _____B_____ -- .byte CT_UPPER | CT_XDIGIT ; 67/43 _____C_____ -- .byte CT_UPPER | CT_XDIGIT ; 68/44 _____D_____ -- .byte CT_UPPER | CT_XDIGIT ; 69/45 _____E_____ -- .byte CT_UPPER | CT_XDIGIT ; 70/46 _____F_____ -- .byte CT_UPPER ; 71/47 _____G_____ -- .byte CT_UPPER ; 72/48 _____H_____ -- .byte CT_UPPER ; 73/49 _____I_____ -- .byte CT_UPPER ; 74/4a _____J_____ -- .byte CT_UPPER ; 75/4b _____K_____ -- .byte CT_UPPER ; 76/4c _____L_____ -- .byte CT_UPPER ; 77/4d _____M_____ -- .byte CT_UPPER ; 78/4e _____N_____ -- .byte CT_UPPER ; 79/4f _____O_____ -- .byte CT_UPPER ; 80/50 _____P_____ -- .byte CT_UPPER ; 81/51 _____Q_____ -- .byte CT_UPPER ; 82/52 _____R_____ -- .byte CT_UPPER ; 83/53 _____S_____ -- .byte CT_UPPER ; 84/54 _____T_____ -- .byte CT_UPPER ; 85/55 _____U_____ -- .byte CT_UPPER ; 86/56 _____V_____ -- .byte CT_UPPER ; 87/57 _____W_____ -- .byte CT_UPPER ; 88/58 _____X_____ -- .byte CT_UPPER ; 89/59 _____Y_____ -- .byte CT_UPPER ; 90/5a _____Z_____ -- .byte CT_NONE ; 91/5b _____[_____ -- .byte CT_NONE ; 92/5c _____\_____ -- .byte CT_NONE ; 93/5d _____]_____ -- .byte CT_NONE ; 94/5e _____^_____ -- .byte CT_NONE ; 95/5f _UNDERLINE_ -- .byte CT_NONE ; 96/60 ___grave___ -- .byte CT_LOWER | CT_XDIGIT ; 97/61 _____a_____ -- .byte CT_LOWER | CT_XDIGIT ; 98/62 _____b_____ -- .byte CT_LOWER | CT_XDIGIT ; 99/63 _____c_____ -- .byte CT_LOWER | CT_XDIGIT ; 100/64 _____d_____ -- .byte CT_LOWER | CT_XDIGIT ; 101/65 _____e_____ -- .byte CT_LOWER | CT_XDIGIT ; 102/66 _____f_____ -- .byte CT_LOWER ; 103/67 _____g_____ -- .byte CT_LOWER ; 104/68 _____h_____ -- .byte CT_LOWER ; 105/69 _____i_____ -- .byte CT_LOWER ; 106/6a _____j_____ -- .byte CT_LOWER ; 107/6b _____k_____ -- .byte CT_LOWER ; 108/6c _____l_____ -- .byte CT_LOWER ; 109/6d _____m_____ -- .byte CT_LOWER ; 110/6e _____n_____ -- .byte CT_LOWER ; 111/6f _____o_____ -- .byte CT_LOWER ; 112/70 _____p_____ -- .byte CT_LOWER ; 113/71 _____q_____ -- .byte CT_LOWER ; 114/72 _____r_____ -- .byte CT_LOWER ; 115/73 _____s_____ -- .byte CT_LOWER ; 116/74 _____t_____ -- .byte CT_LOWER ; 117/75 _____u_____ -- .byte CT_LOWER ; 118/76 _____v_____ -- .byte CT_LOWER ; 119/77 _____w_____ -- .byte CT_LOWER ; 120/78 _____x_____ -- .byte CT_LOWER ; 121/79 _____y_____ -- .byte CT_LOWER ; 122/7a _____z_____ -- .byte CT_NONE ; 123/7b _____{_____ -- .byte CT_NONE ; 124/7c _____|_____ -- .byte CT_NONE ; 125/7d _____}_____ -- .byte CT_NONE ; 126/7e _____~_____ -- .byte CT_OTHER_WS ; 127/7f ____DEL____ -- -- .res 128, CT_NONE ; 128-255 -- -- -- -+ .include "ctype_common.inc" -diff --git a/libsrc/atmos/ctype.s b/libsrc/atmos/ctype.s -index 79edafbb..3c3d7be5 100644 ---- a/libsrc/atmos/ctype.s -+++ b/libsrc/atmos/ctype.s -@@ -1,299 +1,155 @@ -+; ctype.s - ; --; Ullrich von Bassewitz, 2003-04-13 -+; This file is part of -+; cc65 - a freeware C compiler for 6502 based systems - ; --; Character specification table. -+; https://github.com/cc65/cc65 - ; -+; See "LICENSE" file for legal information. -+; -+; ATMOS character specification table. -+; -+ -+ .include "ctypetable.inc" -+ .export __ctypeIdx - - ; The tables are readonly, put them into the rodata segment - - .rodata - --; The following 256 byte wide table specifies attributes for the isxxx type --; of functions. Doing it by a table means some overhead in space, but it --; has major advantages: --; --; * It is fast. If it were'nt for the slow parameter passing of cc65, one --; could even define macros for the isxxx functions (this is usually --; done on other platforms). --; --; * It is highly portable. The only unportable part is the table itself, --; all real code goes into the common library. --; --; * We save some code in the isxxx functions. --; --; --; Bit assignments: --; --; 0 - Lower case char --; 1 - Upper case char --; 2 - Numeric digit --; 3 - Hex digit (both, lower and upper) --; 4 - Control character --; 5 - The space character itself --; 6 - Other whitespace (that is: '\f', '\n', '\r', '\t' and '\v') --; 7 - Space or tab character -- -- .export __ctype -+__ctypeIdx: -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 0/00 ___ctrl_@___, 1/01 ___ctrl_A___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 2/02 ___ctrl_B___, 3/03 ___ctrl_C___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 4/04 ___ctrl_D___, 5/05 ___ctrl_E___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 6/06 ___ctrl_F___, 7/07 ___ctrl_G___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_WS_SPACETAB_IDX ; 8/08 ___ctrl_H___, 9/09 ___ctrl_I___ -+ ct_mix CT_CTRL_WS_IDX, CT_CTRL_WS_IDX ; 10/0a ___ctrl_J___, 11/0b ___ctrl_K___ -+ ct_mix CT_CTRL_WS_IDX, CT_CTRL_WS_IDX ; 12/0c ___ctrl_L___, 13/0d ___ctrl_M___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 14/0e ___ctrl_N___, 15/0f ___ctrl_O___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 16/10 ___ctrl_P___, 17/11 ___ctrl_Q___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 18/12 ___ctrl_R___, 19/13 ___ctrl_S___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 20/14 ___ctrl_T___, 21/15 ___ctrl_U___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 22/16 ___ctrl_V___, 23/17 ___ctrl_W___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 24/18 ___ctrl_X___, 25/19 ___ctrl_Y___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 26/1a ___ctrl_Z___, 27/1b ___ctrl_[___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 28/1c ___ctrl_\___, 29/1d ___ctrl_]___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 30/1e ___ctrl_^___, 31/1f ___ctrl_____ - --__ctype: -- .byte $10 ; 0/00 ___ctrl_@___ -- .byte $10 ; 1/01 ___ctrl_A___ -- .byte $10 ; 2/02 ___ctrl_B___ -- .byte $10 ; 3/03 ___ctrl_C___ -- .byte $10 ; 4/04 ___ctrl_D___ -- .byte $10 ; 5/05 ___ctrl_E___ -- .byte $10 ; 6/06 ___ctrl_F___ -- .byte $10 ; 7/07 ___ctrl_G___ -- .byte $10 ; 8/08 ___ctrl_H___ -- .byte $D0 ; 9/09 ___ctrl_I___ -- .byte $50 ; 10/0a ___ctrl_J___ -- .byte $50 ; 11/0b ___ctrl_K___ -- .byte $50 ; 12/0c ___ctrl_L___ -- .byte $50 ; 13/0d ___ctrl_M___ -- .byte $10 ; 14/0e ___ctrl_N___ -- .byte $10 ; 15/0f ___ctrl_O___ -- .byte $10 ; 16/10 ___ctrl_P___ -- .byte $10 ; 17/11 ___ctrl_Q___ -- .byte $10 ; 18/12 ___ctrl_R___ -- .byte $10 ; 19/13 ___ctrl_S___ -- .byte $10 ; 20/14 ___ctrl_T___ -- .byte $10 ; 21/15 ___ctrl_U___ -- .byte $10 ; 22/16 ___ctrl_V___ -- .byte $10 ; 23/17 ___ctrl_W___ -- .byte $10 ; 24/18 ___ctrl_X___ -- .byte $10 ; 25/19 ___ctrl_Y___ -- .byte $10 ; 26/1a ___ctrl_Z___ -- .byte $10 ; 27/1b ___ctrl_[___ -- .byte $10 ; 28/1c ___ctrl_\___ -- .byte $10 ; 29/1d ___ctrl_]___ -- .byte $10 ; 30/1e ___ctrl_^___ -- .byte $10 ; 31/1f ___ctrl_____ -- .byte $A0 ; 32/20 ___SPACE___ -- .byte $00 ; 33/21 _____!_____ -- .byte $00 ; 34/22 _____"_____ -- .byte $00 ; 35/23 _____#_____ -- .byte $00 ; 36/24 _____$_____ -- .byte $00 ; 37/25 _____%_____ -- .byte $00 ; 38/26 _____&_____ -- .byte $00 ; 39/27 _____'_____ -- .byte $00 ; 40/28 _____(_____ -- .byte $00 ; 41/29 _____)_____ -- .byte $00 ; 42/2a _____*_____ -- .byte $00 ; 43/2b _____+_____ -- .byte $00 ; 44/2c _____,_____ -- .byte $00 ; 45/2d _____-_____ -- .byte $00 ; 46/2e _____._____ -- .byte $00 ; 47/2f _____/_____ -- .byte $0C ; 48/30 _____0_____ -- .byte $0C ; 49/31 _____1_____ -- .byte $0C ; 50/32 _____2_____ -- .byte $0C ; 51/33 _____3_____ -- .byte $0C ; 52/34 _____4_____ -- .byte $0C ; 53/35 _____5_____ -- .byte $0C ; 54/36 _____6_____ -- .byte $0C ; 55/37 _____7_____ -- .byte $0C ; 56/38 _____8_____ -- .byte $0C ; 57/39 _____9_____ -- .byte $00 ; 58/3a _____:_____ -- .byte $00 ; 59/3b _____;_____ -- .byte $00 ; 60/3c _____<_____ -- .byte $00 ; 61/3d _____=_____ -- .byte $00 ; 62/3e _____>_____ -- .byte $00 ; 63/3f _____?_____ -+ ct_mix CT_SPACE_SPACETAB_IDX, CT_NONE_IDX ; 32/20 ___SPACE___, 33/21 _____!_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 34/22 _____"_____, 35/23 _____#_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 36/24 _____$_____, 37/25 _____%_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 38/26 _____&_____, 39/27 _____'_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 40/28 _____(_____, 41/29 _____)_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 42/2a _____*_____, 43/2b _____+_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 44/2c _____,_____, 45/2d _____-_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 46/2e _____._____, 47/2f _____/_____ -+ ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 48/30 _____0_____, 49/31 _____1_____ -+ ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 50/32 _____2_____, 51/33 _____3_____ -+ ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 52/34 _____4_____, 53/35 _____5_____ -+ ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 54/36 _____6_____, 55/37 _____7_____ -+ ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 56/38 _____8_____, 57/39 _____9_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 58/3a _____:_____, 59/3b _____;_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 60/3c _____<_____, 61/3d _____=_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 62/3e _____>_____, 63/3f _____?_____ - -- .byte $00 ; 64/40 _____@_____ -- .byte $0A ; 65/41 _____A_____ -- .byte $0A ; 66/42 _____B_____ -- .byte $0A ; 67/43 _____C_____ -- .byte $0A ; 68/44 _____D_____ -- .byte $0A ; 69/45 _____E_____ -- .byte $0A ; 70/46 _____F_____ -- .byte $02 ; 71/47 _____G_____ -- .byte $02 ; 72/48 _____H_____ -- .byte $02 ; 73/49 _____I_____ -- .byte $02 ; 74/4a _____J_____ -- .byte $02 ; 75/4b _____K_____ -- .byte $02 ; 76/4c _____L_____ -- .byte $02 ; 77/4d _____M_____ -- .byte $02 ; 78/4e _____N_____ -- .byte $02 ; 79/4f _____O_____ -- .byte $02 ; 80/50 _____P_____ -- .byte $02 ; 81/51 _____Q_____ -- .byte $02 ; 82/52 _____R_____ -- .byte $02 ; 83/53 _____S_____ -- .byte $02 ; 84/54 _____T_____ -- .byte $02 ; 85/55 _____U_____ -- .byte $02 ; 86/56 _____V_____ -- .byte $02 ; 87/57 _____W_____ -- .byte $02 ; 88/58 _____X_____ -- .byte $02 ; 89/59 _____Y_____ -- .byte $02 ; 90/5a _____Z_____ -- .byte $00 ; 91/5b _____[_____ -- .byte $00 ; 92/5c _____\_____ -- .byte $00 ; 93/5d _____]_____ -- .byte $00 ; 94/5e _____^_____ -- .byte $00 ; 95/5f _UNDERLINE_ -- .byte $00 ; 96/60 ___grave___ -- .byte $09 ; 97/61 _____a_____ -- .byte $09 ; 98/62 _____b_____ -- .byte $09 ; 99/63 _____c_____ -- .byte $09 ; 100/64 _____d_____ -- .byte $09 ; 101/65 _____e_____ -- .byte $09 ; 102/66 _____f_____ -- .byte $01 ; 103/67 _____g_____ -- .byte $01 ; 104/68 _____h_____ -- .byte $01 ; 105/69 _____i_____ -- .byte $01 ; 106/6a _____j_____ -- .byte $01 ; 107/6b _____k_____ -- .byte $01 ; 108/6c _____l_____ -- .byte $01 ; 109/6d _____m_____ -- .byte $01 ; 110/6e _____n_____ -- .byte $01 ; 111/6f _____o_____ -- .byte $01 ; 112/70 _____p_____ -- .byte $01 ; 113/71 _____q_____ -- .byte $01 ; 114/72 _____r_____ -- .byte $01 ; 115/73 _____s_____ -- .byte $01 ; 116/74 _____t_____ -- .byte $01 ; 117/75 _____u_____ -- .byte $01 ; 118/76 _____v_____ -- .byte $01 ; 119/77 _____w_____ -- .byte $01 ; 120/78 _____x_____ -- .byte $01 ; 121/79 _____y_____ -- .byte $01 ; 122/7a _____z_____ -- .byte $00 ; 123/7b _____{_____ -- .byte $00 ; 124/7c _____|_____ -- .byte $00 ; 125/7d _____}_____ -- .byte $00 ; 126/7e _____~_____ -- .byte $40 ; 127/7f ____DEL____ -+ ct_mix CT_NONE_IDX, CT_UPPER_XDIGIT_IDX ; 64/40 _____@_____, 65/41 _____A_____ -+ ct_mix CT_UPPER_XDIGIT_IDX, CT_UPPER_XDIGIT_IDX ; 66/42 _____B_____, 67/43 _____C_____ -+ ct_mix CT_UPPER_XDIGIT_IDX, CT_UPPER_XDIGIT_IDX ; 68/44 _____D_____, 69/45 _____E_____ -+ ct_mix CT_UPPER_XDIGIT_IDX, CT_UPPER_IDX ; 70/46 _____F_____, 71/47 _____G_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 72/48 _____H_____, 73/49 _____I_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 74/4a _____J_____, 75/4b _____K_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 76/4c _____L_____, 77/4d _____M_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 78/4e _____N_____, 79/4f _____O_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 80/50 _____P_____, 81/51 _____Q_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 82/52 _____R_____, 83/53 _____S_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 84/54 _____T_____, 85/55 _____U_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 86/56 _____V_____, 87/57 _____W_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 88/58 _____X_____, 89/59 _____Y_____ -+ ct_mix CT_UPPER_IDX, CT_NONE_IDX ; 90/5a _____Z_____, 91/5b _____[_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 92/5c _____\_____, 93/5d _____]_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 94/5e _____^_____, 95/5f _UNDERLINE_ - -- .byte $00 ; 128/80 ___________ -- .byte $00 ; 129/81 ___________ -- .byte $00 ; 130/82 ___________ -- .byte $00 ; 131/83 ___________ -- .byte $00 ; 132/84 ___________ -- .byte $00 ; 133/85 ___________ -- .byte $00 ; 134/86 ___________ -- .byte $00 ; 135/87 ___________ -- .byte $00 ; 136/88 ___________ -- .byte $00 ; 137/89 ___________ -- .byte $00 ; 138/8a ___________ -- .byte $00 ; 139/8b ___________ -- .byte $00 ; 140/8c ___________ -- .byte $00 ; 141/8d ___________ -- .byte $00 ; 142/8e ___________ -- .byte $00 ; 143/8f ___________ -- .byte $00 ; 144/90 ___________ -- .byte $00 ; 145/91 ___________ -- .byte $00 ; 146/92 ___________ -- .byte $10 ; 147/93 ___________ -- .byte $00 ; 148/94 ___________ -- .byte $00 ; 149/95 ___________ -- .byte $00 ; 150/96 ___________ -- .byte $00 ; 151/97 ___________ -- .byte $00 ; 152/98 ___________ -- .byte $00 ; 153/99 ___________ -- .byte $00 ; 154/9a ___________ -- .byte $00 ; 155/9b ___________ -- .byte $00 ; 156/9c ___________ -- .byte $00 ; 157/9d ___________ -- .byte $00 ; 158/9e ___________ -- .byte $00 ; 159/9f ___________ -+ ct_mix CT_NONE_IDX, CT_LOWER_XDIGIT_IDX ; 96/60 ___grave___, 97/61 _____a_____ -+ ct_mix CT_LOWER_XDIGIT_IDX, CT_LOWER_XDIGIT_IDX ; 98/62 _____b_____, 99/63 _____c_____ -+ ct_mix CT_LOWER_XDIGIT_IDX, CT_LOWER_XDIGIT_IDX ; 100/64 _____d_____, 101/65 _____e_____ -+ ct_mix CT_LOWER_XDIGIT_IDX, CT_LOWER_IDX ; 102/66 _____f_____, 103/67 _____g_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 104/68 _____h_____, 105/69 _____i_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 106/6a _____j_____, 107/6b _____k_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 108/6c _____l_____, 109/6d _____m_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 110/6e _____n_____, 111/6f _____o_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 112/70 _____p_____, 113/71 _____q_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 114/72 _____r_____, 115/73 _____s_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 116/74 _____t_____, 117/75 _____u_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 118/76 _____v_____, 119/77 _____w_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 120/78 _____x_____, 121/79 _____y_____ -+ ct_mix CT_LOWER_IDX, CT_NONE_IDX ; 122/7a _____z_____, 123/7b _____{_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 124/7c _____|_____, 125/7d _____}_____ -+ ct_mix CT_NONE_IDX, CT_WS_IDX ; 126/7e _____~_____, 127/7f ____DEL____ - -- .byte $00 ; 160/a0 ___________ -- .byte $00 ; 161/a1 ___________ -- .byte $00 ; 162/a2 ___________ -- .byte $00 ; 163/a3 ___________ -- .byte $00 ; 164/a4 ___________ -- .byte $00 ; 165/a5 ___________ -- .byte $00 ; 166/a6 ___________ -- .byte $00 ; 167/a7 ___________ -- .byte $00 ; 168/a8 ___________ -- .byte $00 ; 169/a9 ___________ -- .byte $00 ; 170/aa ___________ -- .byte $00 ; 171/ab ___________ -- .byte $00 ; 172/ac ___________ -- .byte $00 ; 173/ad ___________ -- .byte $00 ; 174/ae ___________ -- .byte $00 ; 175/af ___________ -- .byte $00 ; 176/b0 ___________ -- .byte $00 ; 177/b1 ___________ -- .byte $00 ; 178/b2 ___________ -- .byte $00 ; 179/b3 ___________ -- .byte $00 ; 180/b4 ___________ -- .byte $00 ; 181/b5 ___________ -- .byte $00 ; 182/b6 ___________ -- .byte $00 ; 183/b7 ___________ -- .byte $00 ; 184/b8 ___________ -- .byte $00 ; 185/b9 ___________ -- .byte $00 ; 186/ba ___________ -- .byte $00 ; 187/bb ___________ -- .byte $00 ; 188/bc ___________ -- .byte $00 ; 189/bd ___________ -- .byte $00 ; 190/be ___________ -- .byte $00 ; 191/bf ___________ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 128/80 ___________, 129/81 ___________ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 130/82 ___________, 131/83 ___________ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 132/84 ___________, 133/85 ___________ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 134/86 ___________, 135/87 ___________ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 136/88 ___________, 137/89 ___________ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 138/8a ___________, 139/8b ___________ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 140/8c ___________, 141/8d ___________ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 142/8e ___________, 143/8f ___________ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 144/90 ___________, 145/91 ___________ -+ ct_mix CT_NONE_IDX, CT_CTRL_IDX ; 146/92 ___________, 147/93 ___________ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 148/94 ___________, 149/95 ___________ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 150/96 ___________, 151/97 ___________ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 152/98 ___________, 153/99 ___________ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 154/9a ___________, 155/9b ___________ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 156/9c ___________, 157/9d ___________ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 158/9e ___________, 159/9f ___________ - -- .byte $02 ; 192/c0 ___________ -- .byte $02 ; 193/c1 ___________ -- .byte $02 ; 194/c2 ___________ -- .byte $02 ; 195/c3 ___________ -- .byte $02 ; 196/c4 ___________ -- .byte $02 ; 197/c5 ___________ -- .byte $02 ; 198/c6 ___________ -- .byte $02 ; 199/c7 ___________ -- .byte $02 ; 200/c8 ___________ -- .byte $02 ; 201/c9 ___________ -- .byte $02 ; 202/ca ___________ -- .byte $02 ; 203/cb ___________ -- .byte $02 ; 204/cc ___________ -- .byte $02 ; 205/cd ___________ -- .byte $02 ; 206/ce ___________ -- .byte $02 ; 207/cf ___________ -- .byte $02 ; 208/d0 ___________ -- .byte $02 ; 209/d1 ___________ -- .byte $02 ; 210/d2 ___________ -- .byte $02 ; 211/d3 ___________ -- .byte $02 ; 212/d4 ___________ -- .byte $02 ; 213/d5 ___________ -- .byte $02 ; 214/d6 ___________ -- .byte $02 ; 215/d7 ___________ -- .byte $02 ; 216/d8 ___________ -- .byte $02 ; 217/d9 ___________ -- .byte $02 ; 218/da ___________ -- .byte $02 ; 219/db ___________ -- .byte $02 ; 220/dc ___________ -- .byte $02 ; 221/dd ___________ -- .byte $02 ; 222/de ___________ -- .byte $00 ; 223/df ___________ -- .byte $01 ; 224/e0 ___________ -- .byte $01 ; 225/e1 ___________ -- .byte $01 ; 226/e2 ___________ -- .byte $01 ; 227/e3 ___________ -- .byte $01 ; 228/e4 ___________ -- .byte $01 ; 229/e5 ___________ -- .byte $01 ; 230/e6 ___________ -- .byte $01 ; 231/e7 ___________ -- .byte $01 ; 232/e8 ___________ -- .byte $01 ; 233/e9 ___________ -- .byte $01 ; 234/ea ___________ -- .byte $01 ; 235/eb ___________ -- .byte $01 ; 236/ec ___________ -- .byte $01 ; 237/ed ___________ -- .byte $01 ; 238/ee ___________ -- .byte $01 ; 239/ef ___________ -- .byte $01 ; 240/f0 ___________ -- .byte $01 ; 241/f1 ___________ -- .byte $01 ; 242/f2 ___________ -- .byte $01 ; 243/f3 ___________ -- .byte $01 ; 244/f4 ___________ -- .byte $01 ; 245/f5 ___________ -- .byte $01 ; 246/f6 ___________ -- .byte $01 ; 247/f7 ___________ -- .byte $01 ; 248/f8 ___________ -- .byte $01 ; 249/f9 ___________ -- .byte $01 ; 250/fa ___________ -- .byte $01 ; 251/fb ___________ -- .byte $01 ; 252/fc ___________ -- .byte $01 ; 253/fd ___________ -- .byte $01 ; 254/fe ___________ -- .byte $00 ; 255/ff ___________ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 160/a0 ___________, 161/a1 ___________ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 162/a2 ___________, 163/a3 ___________ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 164/a4 ___________, 165/a5 ___________ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 166/a6 ___________, 167/a7 ___________ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 168/a8 ___________, 169/a9 ___________ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 170/aa ___________, 171/ab ___________ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 172/ac ___________, 173/ad ___________ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 174/ae ___________, 175/af ___________ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 176/b0 ___________, 177/b1 ___________ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 178/b2 ___________, 179/b3 ___________ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 180/b4 ___________, 181/b5 ___________ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 182/b6 ___________, 183/b7 ___________ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 184/b8 ___________, 185/b9 ___________ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 186/ba ___________, 187/bb ___________ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 188/bc ___________, 189/bd ___________ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 190/be ___________, 191/bf ___________ -+ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 192/c0 ___________, 193/c1 ___________ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 194/c2 ___________, 195/c3 ___________ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 196/c4 ___________, 197/c5 ___________ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 198/c6 ___________, 199/c7 ___________ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 200/c8 ___________, 201/c9 ___________ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 202/ca ___________, 203/cb ___________ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 204/cc ___________, 205/cd ___________ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 206/ce ___________, 207/cf ___________ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 208/d0 ___________, 209/d1 ___________ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 210/d2 ___________, 211/d3 ___________ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 212/d4 ___________, 213/d5 ___________ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 214/d6 ___________, 215/d7 ___________ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 216/d8 ___________, 217/d9 ___________ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 218/da ___________, 219/db ___________ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 220/dc ___________, 221/dd ___________ -+ ct_mix CT_UPPER_IDX, CT_NONE_IDX ; 222/de ___________, 223/df ___________ - -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 224/e0 ___________, 225/e1 ___________ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 226/e2 ___________, 227/e3 ___________ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 228/e4 ___________, 229/e5 ___________ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 230/e6 ___________, 231/e7 ___________ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 232/e8 ___________, 233/e9 ___________ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 234/ea ___________, 235/eb ___________ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 236/ec ___________, 237/ed ___________ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 238/ee ___________, 239/ef ___________ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 240/f0 ___________, 241/f1 ___________ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 242/f2 ___________, 243/f3 ___________ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 244/f4 ___________, 245/f5 ___________ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 246/f6 ___________, 247/f7 ___________ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 248/f8 ___________, 249/f9 ___________ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 250/fa ___________, 251/fb ___________ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 252/fc ___________, 253/fd ___________ -+ ct_mix CT_LOWER_IDX, CT_NONE_IDX ; 254/fe ___________, 255/ff ___________ -diff --git a/libsrc/cbm/ctype.s b/libsrc/cbm/ctype.s -index ba096bb1..d0943b12 100644 ---- a/libsrc/cbm/ctype.s -+++ b/libsrc/cbm/ctype.s -@@ -1,289 +1,156 @@ -+; ctype.s - ; --; Character specification table. -+; This file is part of -+; cc65 - a freeware C compiler for 6502 based systems - ; --; Ullrich von Bassewitz, 02.06.1998 --; 2003-05-02, Greg King -+; https://github.com/cc65/cc65 - ; -- --; The following 256-byte-wide table specifies attributes for the isxxx type --; of functions. Doing it by a table means some overhead in space, but it --; has major advantages: --; --; * It is fast. If it weren't for the slow parameter-passing of cc65, --; one even could define C-language macroes for the isxxx functions --; (as it usually is done, on other platforms). -+; See "LICENSE" file for legal information. - ; --; * It is highly portable. The only unportable part is the table itself; --; all real code goes into the common library. -+; CBM character specification table. - ; --; * We save some code in the isxxx functions. -- - ; This table is taken from Craig S. Bruce's technical docs. for the ACE OS. - -- .include "ctype.inc" -+ .include "ctypetable.inc" -+ .export __ctypeIdx -+ -+; The tables are readonly, put them into the rodata segment -+ -+.rodata -+ -+__ctypeIdx: -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 0/00 ___rvs_@___, 1/01 ___rvs_a___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 2/02 ___rvs_b___, 3/03 ___rvs_c___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 4/04 ___rvs_d___, 5/05 ___rvs_e___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 6/06 ___rvs_f___, 7/07 _BEL/rvs_g_ -+ ct_mix CT_CTRL_IDX, CT_CTRL_WS_SPACETAB_IDX ; 8/08 ___rvs_h___, 9/09 _TAB/rvs_i_ -+ ct_mix CT_CTRL_WS_IDX, CT_CTRL_IDX ; 10/0a _BOL/rvs_j_, 11/0b ___rvs_k___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_WS_IDX ; 12/0c ___rvs_l___, 13/0d _CR_/rvs_m_ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 14/0e ___rvs_n___, 15/0f ___rvs_o___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_WS_IDX ; 16/10 ___rvs_p___, 17/11 _VT_/rvs_q_ -+ ct_mix CT_CTRL_IDX, CT_CTRL_WS_IDX ; 18/12 ___rvs_r___, 19/13 HOME/rvs_s_ -+ ct_mix CT_CTRL_WS_IDX, CT_CTRL_IDX ; 20/14 _BS_/rvs_t_, 21/15 ___rvs_u___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 22/16 ___rvs_v___, 23/17 ___rvs_w___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 24/18 ___rvs_x___, 25/19 ___rvs_y___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 26/1a ___rvs_z___, 27/1b ___rvs_[___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_WS_IDX ; 28/1c ___rvs_\___, 29/1d cursr-right -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 30/1e ___rvs_^___, 31/1f _rvs_under_ - --; The table is read-only, put it into the RODATA segment. -+ ct_mix CT_SPACE_SPACETAB_IDX, CT_NONE_IDX ; 32/20 ___SPACE___, 33/21 _____!_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 34/22 _____"_____, 35/23 _____#_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 36/24 _____$_____, 37/25 _____%_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 38/26 _____&_____, 39/27 _____'_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 40/28 _____(_____, 41/29 _____)_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 42/2a _____*_____, 43/2b _____+_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 44/2c _____,_____, 45/2d _____-_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 46/2e _____._____, 47/2f _____/_____ -+ ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 48/30 _____0_____, 49/31 _____1_____ -+ ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 50/32 _____2_____, 51/33 _____3_____ -+ ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 52/34 _____4_____, 53/35 _____5_____ -+ ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 54/36 _____6_____, 55/37 _____7_____ -+ ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 56/38 _____8_____, 57/39 _____9_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 58/3a _____:_____, 59/3b _____;_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 60/3c _____<_____, 61/3d _____=_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 62/3e _____>_____, 63/3f _____?_____ - -- .rodata -+ ct_mix CT_NONE_IDX, CT_LOWER_XDIGIT_IDX ; 64/40 _____@_____, 65/41 _____a_____ -+ ct_mix CT_LOWER_XDIGIT_IDX, CT_LOWER_XDIGIT_IDX ; 66/42 _____b_____, 67/43 _____c_____ -+ ct_mix CT_LOWER_XDIGIT_IDX, CT_LOWER_XDIGIT_IDX ; 68/44 _____d_____, 69/45 _____e_____ -+ ct_mix CT_LOWER_XDIGIT_IDX, CT_LOWER_IDX ; 70/46 _____f_____, 71/47 _____g_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 72/48 _____h_____, 73/49 _____i_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 74/4a _____j_____, 75/4b _____k_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 76/4c _____l_____, 77/4d _____m_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 78/4e _____n_____, 79/4f _____o_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 80/50 _____p_____, 81/51 _____q_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 82/52 _____r_____, 83/53 _____s_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 84/54 _____t_____, 85/55 _____u_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 86/56 _____v_____, 87/57 _____w_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 88/58 _____x_____, 89/59 _____y_____ -+ ct_mix CT_LOWER_IDX, CT_NONE_IDX ; 90/5a _____z_____, 91/5b _____[_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 92/5c _____\_____, 93/5d _____]_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 94/5e _____^_____, 95/5f _UNDERLINE_ - --__ctype: -- .byte CT_CTRL ; 0/00 ___rvs_@___ -- .byte CT_CTRL ; 1/01 ___rvs_a___ -- .byte CT_CTRL ; 2/02 ___rvs_b___ -- .byte CT_CTRL ; 3/03 ___rvs_c___ -- .byte CT_CTRL ; 4/04 ___rvs_d___ -- .byte CT_CTRL ; 5/05 ___rvs_e___ -- .byte CT_CTRL ; 6/06 ___rvs_f___ -- .byte CT_CTRL ; 7/07 _BEL/rvs_g_ -- .byte CT_CTRL ; 8/08 ___rvs_h___ -- .byte CT_CTRL | CT_OTHER_WS | CT_SPACE_TAB ; 9/09 _TAB/rvs_i_ -- .byte CT_CTRL | CT_OTHER_WS ; 10/0a _BOL/rvs_j_ -- .byte CT_CTRL ; 11/0b ___rvs_k___ -- .byte CT_CTRL ; 12/0c ___rvs_l___ -- .byte CT_CTRL | CT_OTHER_WS ; 13/0d _CR_/rvs_m_ -- .byte CT_CTRL ; 14/0e ___rvs_n___ -- .byte CT_CTRL ; 15/0f ___rvs_o___ -- .byte CT_CTRL ; 16/10 ___rvs_p___ -- .byte CT_CTRL | CT_OTHER_WS ; 17/11 _VT_/rvs_q_ -- .byte CT_CTRL ; 18/12 ___rvs_r___ -- .byte CT_CTRL | CT_OTHER_WS ; 19/13 HOME/rvs_s_ -- .byte CT_CTRL | CT_OTHER_WS ; 20/14 _BS_/rvs_t_ -- .byte CT_CTRL ; 21/15 ___rvs_u___ -- .byte CT_CTRL ; 22/16 ___rvs_v___ -- .byte CT_CTRL ; 23/17 ___rvs_w___ -- .byte CT_CTRL ; 24/18 ___rvs_x___ -- .byte CT_CTRL ; 25/19 ___rvs_y___ -- .byte CT_CTRL ; 26/1a ___rvs_z___ -- .byte CT_CTRL ; 27/1b ___rvs_[___ -- .byte CT_CTRL ; 28/1c ___rvs_\___ -- .byte CT_CTRL | CT_OTHER_WS ; 29/1d cursr-right -- .byte CT_CTRL ; 30/1e ___rvs_^___ -- .byte CT_CTRL ; 31/1f _rvs_under_ -- .byte CT_SPACE | CT_SPACE_TAB ; 32/20 ___SPACE___ -- .byte $00 ; 33/21 _____!_____ -- .byte $00 ; 34/22 _____"_____ -- .byte $00 ; 35/23 _____#_____ -- .byte $00 ; 36/24 _____$_____ -- .byte $00 ; 37/25 _____%_____ -- .byte $00 ; 38/26 _____&_____ -- .byte $00 ; 39/27 _____'_____ -- .byte $00 ; 40/28 _____(_____ -- .byte $00 ; 41/29 _____)_____ -- .byte $00 ; 42/2a _____*_____ -- .byte $00 ; 43/2b _____+_____ -- .byte $00 ; 44/2c _____,_____ -- .byte $00 ; 45/2d _____-_____ -- .byte $00 ; 46/2e _____._____ -- .byte $00 ; 47/2f _____/_____ -- .byte CT_DIGIT | CT_XDIGIT ; 48/30 _____0_____ -- .byte CT_DIGIT | CT_XDIGIT ; 49/31 _____1_____ -- .byte CT_DIGIT | CT_XDIGIT ; 50/32 _____2_____ -- .byte CT_DIGIT | CT_XDIGIT ; 51/33 _____3_____ -- .byte CT_DIGIT | CT_XDIGIT ; 52/34 _____4_____ -- .byte CT_DIGIT | CT_XDIGIT ; 53/35 _____5_____ -- .byte CT_DIGIT | CT_XDIGIT ; 54/36 _____6_____ -- .byte CT_DIGIT | CT_XDIGIT ; 55/37 _____7_____ -- .byte CT_DIGIT | CT_XDIGIT ; 56/38 _____8_____ -- .byte CT_DIGIT | CT_XDIGIT ; 57/39 _____9_____ -- .byte $00 ; 58/3a _____:_____ -- .byte $00 ; 59/3b _____;_____ -- .byte $00 ; 60/3c _____<_____ -- .byte $00 ; 61/3d _____=_____ -- .byte $00 ; 62/3e _____>_____ -- .byte $00 ; 63/3f _____?_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 96/60 _A`_grave__, 97/61 _A'_acute__ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 98/62 _A^_circum_, 99/63 _A~_tilde__ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 100/64 _A"_dieres_, 101/65 _A__ring___ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 102/66 _AE________, 103/67 _C,cedilla_ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 104/68 _E`_grave__, 105/69 _E'_acute__ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 106/6a _E^_circum_, 107/6b _E"_dieres_ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 108/6c _I`_grave__, 109/6d _I'_acute__ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 110/6e _I^_circum_, 111/6f _I"_dieres_ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 112/70 _D-_Eth_lr_, 113/71 _N~_tilde__ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 114/72 _O`_grave__, 115/73 _O'_acute__ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 116/74 _O^_circum_, 117/75 _O~_tilde__ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 118/76 _O"_dieres_, 119/77 __multiply_ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 120/78 _O/_slash__, 121/79 _U`_grave__ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 122/7a _U'_acute__, 123/7b _U^_circum_ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 124/7c _U"_dieres_, 125/7d _Y'_acute__ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 126/7e _cap_thorn_, 127/7f _Es-sed_B__ - -- .byte $00 ; 64/40 _____@_____ -- .byte CT_LOWER | CT_XDIGIT ; 65/41 _____a_____ -- .byte CT_LOWER | CT_XDIGIT ; 66/42 _____b_____ -- .byte CT_LOWER | CT_XDIGIT ; 67/43 _____c_____ -- .byte CT_LOWER | CT_XDIGIT ; 68/44 _____d_____ -- .byte CT_LOWER | CT_XDIGIT ; 69/45 _____e_____ -- .byte CT_LOWER | CT_XDIGIT ; 70/46 _____f_____ -- .byte CT_LOWER ; 71/47 _____g_____ -- .byte CT_LOWER ; 72/48 _____h_____ -- .byte CT_LOWER ; 73/49 _____i_____ -- .byte CT_LOWER ; 74/4a _____j_____ -- .byte CT_LOWER ; 75/4b _____k_____ -- .byte CT_LOWER ; 76/4c _____l_____ -- .byte CT_LOWER ; 77/4d _____m_____ -- .byte CT_LOWER ; 78/4e _____n_____ -- .byte CT_LOWER ; 79/4f _____o_____ -- .byte CT_LOWER ; 80/50 _____p_____ -- .byte CT_LOWER ; 81/51 _____q_____ -- .byte CT_LOWER ; 82/52 _____r_____ -- .byte CT_LOWER ; 83/53 _____s_____ -- .byte CT_LOWER ; 84/54 _____t_____ -- .byte CT_LOWER ; 85/55 _____u_____ -- .byte CT_LOWER ; 86/56 _____v_____ -- .byte CT_LOWER ; 87/57 _____w_____ -- .byte CT_LOWER ; 88/58 _____x_____ -- .byte CT_LOWER ; 89/59 _____y_____ -- .byte CT_LOWER ; 90/5a _____z_____ -- .byte $00 ; 91/5b _____[_____ -- .byte $00 ; 92/5c _____\_____ -- .byte $00 ; 93/5d _____]_____ -- .byte $00 ; 94/5e _____^_____ -- .byte $00 ; 95/5f _UNDERLINE_ -- .byte $00 ; 96/60 _A`_grave__ -- .byte $00 ; 97/61 _A'_acute__ -- .byte $00 ; 98/62 _A^_circum_ -- .byte $00 ; 99/63 _A~_tilde__ -- .byte $00 ; 100/64 _A"_dieres_ -- .byte $00 ; 101/65 _A__ring___ -- .byte $00 ; 102/66 _AE________ -- .byte $00 ; 103/67 _C,cedilla_ -- .byte $00 ; 104/68 _E`_grave__ -- .byte $00 ; 105/69 _E'_acute__ -- .byte $00 ; 106/6a _E^_circum_ -- .byte $00 ; 107/6b _E"_dieres_ -- .byte $00 ; 108/6c _I`_grave__ -- .byte $00 ; 109/6d _I'_acute__ -- .byte $00 ; 110/6e _I^_circum_ -- .byte $00 ; 111/6f _I"_dieres_ -- .byte $00 ; 112/70 _D-_Eth_lr_ -- .byte $00 ; 113/71 _N~_tilde__ -- .byte $00 ; 114/72 _O`_grave__ -- .byte $00 ; 115/73 _O'_acute__ -- .byte $00 ; 116/74 _O^_circum_ -- .byte $00 ; 117/75 _O~_tilde__ -- .byte $00 ; 118/76 _O"_dieres_ -- .byte $00 ; 119/77 __multiply_ -- .byte $00 ; 120/78 _O/_slash__ -- .byte $00 ; 121/79 _U`_grave__ -- .byte $00 ; 122/7a _U'_acute__ -- .byte $00 ; 123/7b _U^_circum_ -- .byte $00 ; 124/7c _U"_dieres_ -- .byte $00 ; 125/7d _Y'_acute__ -- .byte $00 ; 126/7e _cap_thorn_ -- .byte $00 ; 127/7f _Es-sed_B__ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 128/80 __bullet___, 129/81 __v_line___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 130/82 __h_line___, 131/83 ___cross___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 132/84 _tl_corner_, 133/85 _tr_corner_ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 134/86 _bl_corner_, 135/87 _br_corner_ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 136/88 ___l_tee___, 137/89 ___r_tee___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 138/8a ___t_tee___, 139/8b ___b_tee___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_WS_IDX ; 140/8c ___heart___, 141/8d _CR/diamond -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 142/8e ___club____, 143/8f ___spade___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_WS_IDX ; 144/90 _s_circle__, 145/91 _cursor-up_ -+ ct_mix CT_CTRL_IDX, CT_CTRL_WS_IDX ; 146/92 ___pound___, 147/93 _CLS/check_ -+ ct_mix CT_CTRL_WS_IDX, CT_CTRL_IDX ; 148/94 __INSert___, 149/95 ____+/-____ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 150/96 __divide___, 151/97 __degree___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 152/98 _c_checker_, 153/99 _f_checker_ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 154/9a _solid_sq__, 155/9b __cr_char__ -+ ct_mix CT_CTRL_IDX, CT_CTRL_WS_IDX ; 156/9c _up_arrow__, 157/9d cursor-left -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 158/9e _left_arro_, 159/9f _right_arr_ - -- .byte CT_CTRL ; 128/80 __bullet___ -- .byte CT_CTRL ; 129/81 __v_line___ -- .byte CT_CTRL ; 130/82 __h_line___ -- .byte CT_CTRL ; 131/83 ___cross___ -- .byte CT_CTRL ; 132/84 _tl_corner_ -- .byte CT_CTRL ; 133/85 _tr_corner_ -- .byte CT_CTRL ; 134/86 _bl_corner_ -- .byte CT_CTRL ; 135/87 _br_corner_ -- .byte CT_CTRL ; 136/88 ___l_tee___ -- .byte CT_CTRL ; 137/89 ___r_tee___ -- .byte CT_CTRL ; 138/8a ___t_tee___ -- .byte CT_CTRL ; 139/8b ___b_tee___ -- .byte CT_CTRL ; 140/8c ___heart___ -- .byte CT_CTRL | CT_OTHER_WS ; 141/8d _CR/diamond -- .byte CT_CTRL ; 142/8e ___club____ -- .byte CT_CTRL ; 143/8f ___spade___ -- .byte CT_CTRL ; 144/90 _s_circle__ -- .byte CT_CTRL | CT_OTHER_WS ; 145/91 _cursor-up_ -- .byte CT_CTRL ; 146/92 ___pound___ -- .byte CT_CTRL | CT_OTHER_WS ; 147/93 _CLS/check_ -- .byte CT_CTRL | CT_OTHER_WS ; 148/94 __INSert___ -- .byte CT_CTRL ; 149/95 ____+/-____ -- .byte CT_CTRL ; 150/96 __divide___ -- .byte CT_CTRL ; 151/97 __degree___ -- .byte CT_CTRL ; 152/98 _c_checker_ -- .byte CT_CTRL ; 153/99 _f_checker_ -- .byte CT_CTRL ; 154/9a _solid_sq__ -- .byte CT_CTRL ; 155/9b __cr_char__ -- .byte CT_CTRL ; 156/9c _up_arrow__ -- .byte CT_CTRL | CT_OTHER_WS ; 157/9d cursor-left -- .byte CT_CTRL ; 158/9e _left_arro_ -- .byte CT_CTRL ; 159/9f _right_arr_ -- .byte CT_SPACE | CT_SPACE_TAB ; 160/a0 _req space_ -- .byte $00 ; 161/a1 _!_invertd_ -- .byte $00 ; 162/a2 ___cent____ -- .byte $00 ; 163/a3 ___pound___ -- .byte $00 ; 164/a4 __currency_ -- .byte $00 ; 165/a5 ____yen____ -- .byte $00 ; 166/a6 _|_broken__ -- .byte $00 ; 167/a7 __section__ -- .byte $00 ; 168/a8 __umulaut__ -- .byte $00 ; 169/a9 _copyright_ -- .byte $00 ; 170/aa __fem_ord__ -- .byte $00 ; 171/ab _l_ang_quo_ -- .byte $00 ; 172/ac ____not____ -- .byte $00 ; 173/ad _syl_hyphn_ -- .byte $00 ; 174/ae _registerd_ -- .byte $00 ; 175/af _overline__ -- .byte $00 ; 176/b0 __degrees__ -- .byte $00 ; 177/b1 ____+/-____ -- .byte $00 ; 178/b2 _2_supersc_ -- .byte $00 ; 179/b3 _3_supersc_ -- .byte $00 ; 180/b4 ___acute___ -- .byte $00 ; 181/b5 ____mu_____ -- .byte $00 ; 182/b6 _paragraph_ -- .byte $00 ; 183/b7 __mid_dot__ -- .byte $00 ; 184/b8 __cedilla__ -- .byte $00 ; 185/b9 _1_supersc_ -- .byte $00 ; 186/ba __mas_ord__ -- .byte $00 ; 187/bb _r_ang_quo_ -- .byte $00 ; 188/bc ____1/4____ -- .byte $00 ; 189/bd ____1/2____ -- .byte $00 ; 190/be ____3/4____ -- .byte $00 ; 191/bf _?_invertd_ -+ ct_mix CT_SPACE_SPACETAB_IDX, CT_NONE_IDX ; 160/a0 _req space_, 161/a1 _!_invertd_ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 162/a2 ___cent____, 163/a3 ___pound___ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 164/a4 __currency_, 165/a5 ____yen____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 166/a6 _|_broken__, 167/a7 __section__ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 168/a8 __umulaut__, 169/a9 _copyright_ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 170/aa __fem_ord__, 171/ab _l_ang_quo_ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 172/ac ____not____, 173/ad _syl_hyphn_ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 174/ae _registerd_, 175/af _overline__ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 176/b0 __degrees__, 177/b1 ____+/-____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 178/b2 _2_supersc_, 179/b3 _3_supersc_ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 180/b4 ___acute___, 181/b5 ____mu_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 182/b6 _paragraph_, 183/b7 __mid_dot__ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 184/b8 __cedilla__, 185/b9 _1_supersc_ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 186/ba __mas_ord__, 187/bb _r_ang_quo_ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 188/bc ____1/4____, 189/bd ____1/2____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 190/be ____3/4____, 191/bf _?_invertd_ - -- .byte $00 ; 192/c0 _____`_____ -- .byte CT_UPPER | CT_XDIGIT ; 193/c1 _____A_____ -- .byte CT_UPPER | CT_XDIGIT ; 194/c2 _____B_____ -- .byte CT_UPPER | CT_XDIGIT ; 195/c3 _____C_____ -- .byte CT_UPPER | CT_XDIGIT ; 196/c4 _____D_____ -- .byte CT_UPPER | CT_XDIGIT ; 197/c5 _____E_____ -- .byte CT_UPPER | CT_XDIGIT ; 198/c6 _____F_____ -- .byte CT_UPPER ; 199/c7 _____G_____ -- .byte CT_UPPER ; 200/c8 _____H_____ -- .byte CT_UPPER ; 201/c9 _____I_____ -- .byte CT_UPPER ; 202/ca _____J_____ -- .byte CT_UPPER ; 203/cb _____K_____ -- .byte CT_UPPER ; 204/cc _____L_____ -- .byte CT_UPPER ; 205/cd _____M_____ -- .byte CT_UPPER ; 206/ce _____N_____ -- .byte CT_UPPER ; 207/cf _____O_____ -- .byte CT_UPPER ; 208/d0 _____P_____ -- .byte CT_UPPER ; 209/d1 _____Q_____ -- .byte CT_UPPER ; 210/d2 _____R_____ -- .byte CT_UPPER ; 211/d3 _____S_____ -- .byte CT_UPPER ; 212/d4 _____T_____ -- .byte CT_UPPER ; 213/d5 _____U_____ -- .byte CT_UPPER ; 214/d6 _____V_____ -- .byte CT_UPPER ; 215/d7 _____W_____ -- .byte CT_UPPER ; 216/d8 _____X_____ -- .byte CT_UPPER ; 217/d9 _____Y_____ -- .byte CT_UPPER ; 218/da _____Z_____ -- .byte $00 ; 219/db _____{_____ -- .byte $00 ; 220/dc _____|_____ -- .byte $00 ; 221/dd _____}_____ -- .byte $00 ; 222/de _____~_____ -- .byte $00 ; 223/df ___HOUSE___ -- .byte $00 ; 224/e0 _a`_grave__ -- .byte $00 ; 225/e1 _a'_acute__ -- .byte $00 ; 226/e2 _a^_circum_ -- .byte $00 ; 227/e3 _a~_tilde__ -- .byte $00 ; 228/e4 _a"_dieres_ -- .byte $00 ; 229/e5 _a__ring___ -- .byte $00 ; 230/e6 _ae________ -- .byte $00 ; 231/e7 _c,cedilla_ -- .byte $00 ; 232/e8 _e`_grave__ -- .byte $00 ; 233/e9 _e'_acute__ -- .byte $00 ; 234/ea _e^_circum_ -- .byte $00 ; 235/eb _e"_dieres_ -- .byte $00 ; 236/ec _i`_grave__ -- .byte $00 ; 237/ed _i'_acute__ -- .byte $00 ; 238/ee _i^_circum_ -- .byte $00 ; 239/ef _i"_dieres_ -- .byte $00 ; 240/f0 _o^x_Eth_s_ -- .byte $00 ; 241/f1 _n~_tilda__ -- .byte $00 ; 242/f2 _o`_grave__ -- .byte $00 ; 243/f3 _o'_acute__ -- .byte $00 ; 244/f4 _o^_circum_ -- .byte $00 ; 245/f5 _o~_tilde__ -- .byte $00 ; 246/f6 _o"_dieres_ -- .byte $00 ; 247/f7 __divide___ -- .byte $00 ; 248/f8 _o/_slash__ -- .byte $00 ; 249/f9 _u`_grave__ -- .byte $00 ; 250/fa _u'_acute__ -- .byte $00 ; 251/fb _u^_circum_ -- .byte $00 ; 252/fc _u"_dieres_ -- .byte $00 ; 253/fd _y'_acute__ -- .byte $00 ; 254/fe _sm_thorn__ -- .byte $00 ; 255/ff _y"_dieres_ -+ ct_mix CT_NONE_IDX, CT_UPPER_XDIGIT_IDX ; 192/c0 _____`_____, 193/c1 _____A_____ -+ ct_mix CT_UPPER_XDIGIT_IDX, CT_UPPER_XDIGIT_IDX ; 194/c2 _____B_____, 195/c3 _____C_____ -+ ct_mix CT_UPPER_XDIGIT_IDX, CT_UPPER_XDIGIT_IDX ; 196/c4 _____D_____, 197/c5 _____E_____ -+ ct_mix CT_UPPER_XDIGIT_IDX, CT_UPPER_IDX ; 198/c6 _____F_____, 199/c7 _____G_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 200/c8 _____H_____, 201/c9 _____I_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 202/ca _____J_____, 203/cb _____K_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 204/cc _____L_____, 205/cd _____M_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 206/ce _____N_____, 207/cf _____O_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 208/d0 _____P_____, 209/d1 _____Q_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 210/d2 _____R_____, 211/d3 _____S_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 212/d4 _____T_____, 213/d5 _____U_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 214/d6 _____V_____, 215/d7 _____W_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 216/d8 _____X_____, 217/d9 _____Y_____ -+ ct_mix CT_UPPER_IDX, CT_NONE_IDX ; 218/da _____Z_____, 219/db _____{_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 220/dc _____|_____, 221/dd _____}_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 222/de _____~_____, 223/df ___HOUSE___ - -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 224/e0 _a`_grave__, 225/e1 _a'_acute__ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 226/e2 _a^_circum_, 227/e3 _a~_tilde__ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 228/e4 _a"_dieres_, 229/e5 _a__ring___ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 230/e6 _ae________, 231/e7 _c,cedilla_ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 232/e8 _e`_grave__, 233/e9 _e'_acute__ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 234/ea _e^_circum_, 235/eb _e"_dieres_ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 236/ec _i`_grave__, 237/ed _i'_acute__ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 238/ee _i^_circum_, 239/ef _i"_dieres_ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 240/f0 _o^x_Eth_s_, 241/f1 _n~_tilda__ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 242/f2 _o`_grave__, 243/f3 _o'_acute__ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 244/f4 _o^_circum_, 245/f5 _o~_tilde__ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 246/f6 _o"_dieres_, 247/f7 __divide___ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 248/f8 _o/_slash__, 249/f9 _u`_grave__ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 250/fa _u'_acute__, 251/fb _u^_circum_ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 252/fc _u"_dieres_, 253/fd _y'_acute__ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 254/fe _sm_thorn__, 255/ff _y"_dieres_ -diff --git a/libsrc/common/atoi.s b/libsrc/common/atoi.s -index cb598f71..8427be62 100644 ---- a/libsrc/common/atoi.s -+++ b/libsrc/common/atoi.s -@@ -8,9 +8,8 @@ - .export _atoi, _atol - .import negeax, __ctype - .importzp sreg, ptr1, ptr2, tmp1 -- -+ .import ctype_preprocessor_no_check - .include "ctype.inc" -- - ; - ; Conversion routine (32 bit) - ; -@@ -27,8 +26,9 @@ _atol: sta ptr1 ; Store s - ; Skip whitespace - - L1: lda (ptr1),y -- tax -- lda __ctype,x ; get character classification -+ ; get character classification -+ jsr ctype_preprocessor_no_check -+ - and #CT_SPACE_TAB ; tab or space? - beq L2 ; jump if no - iny -@@ -36,10 +36,10 @@ L1: lda (ptr1),y - inc ptr1+1 - bne L1 ; branch always - --; Check for a sign. The character is in X -+; Check for a sign. Refetch character, X is cleared by preprocessor - --L2: txa ; get char -- ldx #0 ; flag: positive -+L2: lda (ptr1),y ; get char -+ ; x=0 -> flag: positive - cmp #'+' ; ### portable? - beq L3 - cmp #'-' ; ### portable? -@@ -54,9 +54,9 @@ L3: iny - L5: stx tmp1 ; remember sign flag - - L6: lda (ptr1),y ; get next char -- tax -- lda __ctype,x ; get character classification -- and #$04 ; digit? -+ ; get character classification -+ jsr ctype_preprocessor_no_check -+ and #CT_DIGIT ; digit? - beq L8 ; done - - ; Multiply ptr2 (the converted value) by 10 -@@ -91,7 +91,7 @@ L6: lda (ptr1),y ; get next char - - ; Get the character back and add it - -- txa ; get char back -+ lda (ptr1),y ; fetch char again - sec - sbc #'0' ; make numeric value - clc -diff --git a/libsrc/common/ctype_preprocessor.s b/libsrc/common/ctype_preprocessor.s -new file mode 100644 -index 00000000..1f33bd22 ---- /dev/null -+++ b/libsrc/common/ctype_preprocessor.s -@@ -0,0 +1,50 @@ -+; ctype_preprocessor.s -+; -+; This file is part of -+; cc65 - a freeware C compiler for 6502 based systems -+; -+; https://github.com/cc65/cc65 -+; -+; See "LICENSE" file for legal information. -+; -+; ctype_preprocessor(int c) -+; -+; converts a character to test via the is*-functions to the matching ctype-masks -+; If c is out of the 8-bit range, the function returns with carry set and accu cleared. -+; Return value is in accu and x has to be always clear when returning -+; (makes calling code shorter)! -+; -+; IMPORTANT: stricmp, strlower, strnicmp, strupper and atoi rely that Y is not changed -+; while calling this function! -+; -+ -+ .export ctype_preprocessor -+ .export ctype_preprocessor_no_check -+ .import __ctype -+ .import __ctypeIdx -+ -+ctype_preprocessor: -+ cpx #$00 ; char range ok? -+ bne SC ; branch if not -+ctype_preprocessor_no_check: -+ lsr a -+ tax -+ lda __ctypeIdx, x -+ bcc @lowerNibble -+@upperNibble: -+ lsr a -+ lsr a -+ lsr a -+ lsr a -+ clc ; remove out of bounds flag -+@lowerNibble: -+ and #%1111 -+ tax -+ lda __ctype, x -+ ldx #0 -+ rts -+ -+SC: sec -+ lda #0 -+ tax -+ rts -diff --git a/libsrc/common/isalnum.s b/libsrc/common/isalnum.s -index 33497a30..4f6a5e91 100644 ---- a/libsrc/common/isalnum.s -+++ b/libsrc/common/isalnum.s -@@ -1,21 +1,21 @@ -+; isalnum.s - ; --; Ullrich von Bassewitz, 02.06.1998 -+; This file is part of -+; cc65 - a freeware C compiler for 6502 based systems -+; -+; https://github.com/cc65/cc65 -+; -+; See "LICENSE" file for legal information. - ; - ; int isalnum (int c); - ; - - .export _isalnum - .include "ctype.inc" -+ .import ctype_preprocessor - - _isalnum: -- cpx #$00 ; Char range ok? -- bne @L1 ; Jump if no -- tay -- lda __ctype,y ; Get character classification -- and #CT_ALNUM ; Mask character/digit bits -- rts -- --@L1: lda #$00 ; Return false -- tax -- rts -- -+ jsr ctype_preprocessor ; (clears always x) -+ bcs @L1 ; out of range? (everything already clear -> false) -+ and #CT_ALNUM ; mask character/digit bits -+@L1: rts -diff --git a/libsrc/common/isalpha.s b/libsrc/common/isalpha.s -index 2ab9bf26..a331722a 100644 ---- a/libsrc/common/isalpha.s -+++ b/libsrc/common/isalpha.s -@@ -1,21 +1,21 @@ -+; isalpha.s - ; --; Ullrich von Bassewitz, 02.06.1998 -+; This file is part of -+; cc65 - a freeware C compiler for 6502 based systems -+; -+; https://github.com/cc65/cc65 -+; -+; See "LICENSE" file for legal information. - ; - ; int isalpha (int c); - ; - - .export _isalpha - .include "ctype.inc" -+ .import ctype_preprocessor - - _isalpha: -- cpx #$00 ; Char range ok? -- bne @L1 ; Jump if no -- tay -- lda __ctype,y ; Get character classification -- and #CT_ALPHA ; Mask character bits -- rts -- --@L1: lda #$00 ; Return false -- tax -- rts -- -+ jsr ctype_preprocessor ; (clears always x) -+ bcs @L1 ; out of range? (everything already clear -> false) -+ and #CT_ALPHA ; mask character bits -+@L1: rts -diff --git a/libsrc/common/isascii.s b/libsrc/common/isascii.s -new file mode 100644 -index 00000000..dccfabaa ---- /dev/null -+++ b/libsrc/common/isascii.s -@@ -0,0 +1,27 @@ -+; isascii.s -+; -+; This file is part of -+; cc65 - a freeware C compiler for 6502 based systems -+; -+; https://github.com/cc65/cc65 -+; -+; See "LICENSE" file for legal information. -+; -+; int isascii (int c); -+; -+ -+ .export _isascii -+ -+_isascii: -+ cpx #$00 ; Char range ok? -+ bne @L1 ; Jump if no -+ -+ tay -+ bmi @L1 -+ -+ inx -+ rts -+ -+@L1: lda #$00 ; Return false -+ tax -+ rts -diff --git a/libsrc/common/isblank.s b/libsrc/common/isblank.s -index 6babe885..5e0eafd7 100644 ---- a/libsrc/common/isblank.s -+++ b/libsrc/common/isblank.s -@@ -1,5 +1,11 @@ -+; isblank.s - ; --; Ullrich von Bassewitz, 02.06.1998 -+; This file is part of -+; cc65 - a freeware C compiler for 6502 based systems -+; -+; https://github.com/cc65/cc65 -+; -+; See "LICENSE" file for legal information. - ; - ; int isblank (int c); - ; -@@ -8,16 +14,10 @@ - - .export _isblank - .include "ctype.inc" -+ .import ctype_preprocessor - - _isblank: -- cpx #$00 ; Char range ok? -- bne @L1 ; Jump if no -- tay -- lda __ctype,y ; Get character classification -- and #CT_SPACE_TAB ; Mask blank bit -- rts -- --@L1: lda #$00 ; Return false -- tax -- rts -- -+ jsr ctype_preprocessor ; (clears always x) -+ bcs @L1 ; out of range? (everything already clear -> false) -+ and #CT_SPACE_TAB ; mask blank bit -+ @L1: rts -diff --git a/libsrc/common/iscntrl.s b/libsrc/common/iscntrl.s -index 72871645..f4bf0285 100644 ---- a/libsrc/common/iscntrl.s -+++ b/libsrc/common/iscntrl.s -@@ -1,21 +1,21 @@ -+; iscntrl.s - ; --; Ullrich von Bassewitz, 02.06.1998 -+; This file is part of -+; cc65 - a freeware C compiler for 6502 based systems -+; -+; https://github.com/cc65/cc65 -+; -+; See "LICENSE" file for legal information. - ; - ; int iscntrl (int c); - ; - - .export _iscntrl - .include "ctype.inc" -+ .import ctype_preprocessor - - _iscntrl: -- cpx #$00 ; Char range ok? -- bne @L1 ; Jump if no -- tay -- lda __ctype,y ; Get character classification -- and #CT_CTRL ; Mask control character bit -- rts -- --@L1: lda #$00 ; Return false -- tax -- rts -- -+ jsr ctype_preprocessor ; (clears always x) -+ bcs @L1 ; out of range? (everything already clear -> false) -+ and #CT_CTRL ; mask control character bit -+@L1: rts -diff --git a/libsrc/common/isdigit.s b/libsrc/common/isdigit.s -index 2972c894..c0e8bb02 100644 ---- a/libsrc/common/isdigit.s -+++ b/libsrc/common/isdigit.s -@@ -1,21 +1,21 @@ -+; isdigit.s - ; --; Ullrich von Bassewitz, 02.06.1998 -+; This file is part of -+; cc65 - a freeware C compiler for 6502 based systems -+; -+; https://github.com/cc65/cc65 -+; -+; See "LICENSE" file for legal information. - ; - ; int isdigit (int c); - ; - - .export _isdigit - .include "ctype.inc" -+ .import ctype_preprocessor - - _isdigit: -- cpx #$00 ; Char range ok? -- bne @L1 ; Jump if no -- tay -- lda __ctype,y ; Get character classification -- and #CT_DIGIT ; Mask digit bit -- rts -- --@L1: lda #$00 ; Return false -- tax -- rts -- -+ jsr ctype_preprocessor ; (clears always x) -+ bcs @L1 ; out of range? (everything already clear -> false) -+ and #CT_DIGIT ; mask digit bit -+ @L1: rts -diff --git a/libsrc/common/isgraph.s b/libsrc/common/isgraph.s -index bf94014e..575b05a6 100644 ---- a/libsrc/common/isgraph.s -+++ b/libsrc/common/isgraph.s -@@ -1,25 +1,25 @@ -+; isgraph.s - ; --; 1998-06-02, Ullrich von Bassewitz --; 2014-09-10, Greg King -+; This file is part of -+; cc65 - a freeware C compiler for 6502 based systems -+; -+; https://github.com/cc65/cc65 -+; -+; See "LICENSE" file for legal information. - ; - ; int isgraph (int c); - ; - - .export _isgraph - .include "ctype.inc" -+ .import ctype_preprocessor - - _isgraph: -- cpx #>$0000 ; Char range OK? -- bne @L1 ; Jump if no -- tay -- lda __ctype,y ; Get character classification -- and #CT_CTRL_SPACE ; Mask character bits -- cmp #1 ; If false, then set "borrow" flag -+ jsr ctype_preprocessor ; (clears always x) -+ bcs @L1 ; out of range? (everything already clear -> false) -+ and #CT_CTRL_SPACE ; mask character bits -+ cmp #1 ; if false, then set "borrow" flag - lda #0 -- sbc #0 ; Invert logic -- rts ; Return NOT control and NOT space -- --@L1: lda #<0 ; Return false -- tax -- rts -+ sbc #0 ; invert logic (return NOT control and NOT space) -+@L1: rts - -diff --git a/libsrc/common/islower.s b/libsrc/common/islower.s -index 32e00fbd..62ae4164 100644 ---- a/libsrc/common/islower.s -+++ b/libsrc/common/islower.s -@@ -1,21 +1,23 @@ -+; islower.s - ; --; Ullrich von Bassewitz, 02.06.1998 -+; This file is part of -+; cc65 - a freeware C compiler for 6502 based systems -+; -+; https://github.com/cc65/cc65 -+; -+; See "LICENSE" file for legal information. - ; - ; int islower (int c); - ; - - .export _islower - .include "ctype.inc" -+ .import ctype_preprocessor - - _islower: -- cpx #$00 ; Char range ok? -- bne @L1 ; Jump if no -- tay -- lda __ctype,y ; Get character classification -- and #CT_LOWER ; Mask lower char bit -- rts -+ jsr ctype_preprocessor ; (clears always x) -+ bcs @L1 ; out of range? (everything already clear -> false) -+ and #CT_LOWER ; mask lower char bit -+@L1: rts - --@L1: lda #$00 ; Return false -- tax -- rts - -diff --git a/libsrc/common/isprint.s b/libsrc/common/isprint.s -index 1511753f..cbe68c80 100644 ---- a/libsrc/common/isprint.s -+++ b/libsrc/common/isprint.s -@@ -1,22 +1,22 @@ -+; isprint.s - ; --; Ullrich von Bassewitz, 02.06.1998 -+; This file is part of -+; cc65 - a freeware C compiler for 6502 based systems -+; -+; https://github.com/cc65/cc65 -+; -+; See "LICENSE" file for legal information. - ; - ; int isprint (int c); - ; - - .export _isprint - .include "ctype.inc" -+ .import ctype_preprocessor - - _isprint: -- cpx #$00 ; Char range ok? -- bne @L1 ; Jump if no -- tay -- lda __ctype,y ; Get character classification -- eor #CT_CTRL ; NOT a control char -- and #CT_CTRL ; Mask control char bit -- rts -- --@L1: lda #$00 ; Return false -- tax -- rts -- -+ jsr ctype_preprocessor ; (clears always x) -+ bcs @L1 ; out of range? (everything already clear -> false) -+ eor #CT_CTRL ; NOT a control char -+ and #CT_CTRL ; mask control char bit -+@L1: rts -diff --git a/libsrc/common/ispunct.s b/libsrc/common/ispunct.s -index 08753294..ad48fc53 100644 ---- a/libsrc/common/ispunct.s -+++ b/libsrc/common/ispunct.s -@@ -1,25 +1,24 @@ -+; ispunct.s - ; --; 1998-06-02, Ullrich von Bassewitz --; 2014-09-10, Greg King -+; This file is part of -+; cc65 - a freeware C compiler for 6502 based systems -+; -+; https://github.com/cc65/cc65 -+; -+; See "LICENSE" file for legal information. - ; - ; int ispunct (int c); - ; - - .export _ispunct - .include "ctype.inc" -+ .import ctype_preprocessor - - _ispunct: -- cpx #>$0000 ; Char range OK? -- bne @L1 ; Jump if no -- tay -- lda __ctype,y ; Get character classification -- and #CT_NOT_PUNCT ; Mask relevant bits -- cmp #1 ; If false, then set "borrow" flag -+ jsr ctype_preprocessor ; (clears always x) -+ bcs @L1 ; out of range? (everything already clear -> false) -+ and #CT_NOT_PUNCT ; mask relevant bits -+ cmp #1 ; if false, then set "borrow" flag - lda #0 -- sbc #0 ; Invert logic -- rts ; Return NOT (space | control | digit | alpha) -- --@L1: lda #<0 ; Return false -- tax -- rts -- -+ sbc #0 ; invert logic (return NOT (space | control | digit | alpha)) -+@L1: rts -diff --git a/libsrc/common/isspace.s b/libsrc/common/isspace.s -index 64849f7f..272acac0 100644 ---- a/libsrc/common/isspace.s -+++ b/libsrc/common/isspace.s -@@ -1,21 +1,21 @@ -+; isspace.s - ; --; Ullrich von Bassewitz, 02.06.1998 -+; This file is part of -+; cc65 - a freeware C compiler for 6502 based systems -+; -+; https://github.com/cc65/cc65 -+; -+; See "LICENSE" file for legal information. - ; - ; int isspace (int c); - ; - - .export _isspace - .include "ctype.inc" -+ .import ctype_preprocessor - - _isspace: -- cpx #$00 ; Char range ok? -- bne @L1 ; Jump if no -- tay -- lda __ctype,y ; Get character classification -- and #(CT_SPACE | CT_OTHER_WS) ; Mask space bits -- rts -- --@L1: lda #$00 ; Return false -- tax -- rts -- -+ jsr ctype_preprocessor ; (clears always x) -+ bcs @L1 ; out of range? (everything already clear -> false) -+ and #(CT_SPACE | CT_OTHER_WS) ; mask space bits -+ @L1: rts -diff --git a/libsrc/common/isupper.s b/libsrc/common/isupper.s -index 698983ec..2d89459a 100644 ---- a/libsrc/common/isupper.s -+++ b/libsrc/common/isupper.s -@@ -1,21 +1,21 @@ -+; isupper.s - ; --; Ullrich von Bassewitz, 02.06.1998 -+; This file is part of -+; cc65 - a freeware C compiler for 6502 based systems -+; -+; https://github.com/cc65/cc65 -+; -+; See "LICENSE" file for legal information. - ; - ; int isupper (int c); - ; - - .export _isupper - .include "ctype.inc" -+ .import ctype_preprocessor - - _isupper: -- cpx #$00 ; Char range ok? -- bne @L1 ; Jump if no -- tay -- lda __ctype,y ; Get character classification -- and #CT_UPPER ; Mask upper char bit -- rts -- --@L1: lda #$00 ; Return false -- tax -- rts -- -+ jsr ctype_preprocessor ; (clears always x) -+ bcs @L1 ; out of range? (everything already clear -> false) -+ and #CT_UPPER ; mask upper char bit -+@L1: rts -diff --git a/libsrc/common/isxdigit.s b/libsrc/common/isxdigit.s -index 36f86ef1..07fef5c2 100644 ---- a/libsrc/common/isxdigit.s -+++ b/libsrc/common/isxdigit.s -@@ -1,21 +1,21 @@ -+; isxdigit.s - ; --; Ullrich von Bassewitz, 02.06.1998 -+; This file is part of -+; cc65 - a freeware C compiler for 6502 based systems -+; -+; https://github.com/cc65/cc65 -+; -+; See "LICENSE" file for legal information. - ; - ; int isxdigit (int c); - ; - - .export _isxdigit - .include "ctype.inc" -+ .import ctype_preprocessor - - _isxdigit: -- cpx #$00 ; Char range ok? -- bne @L1 ; Jump if no -- tay -- lda __ctype,y ; Get character classification -- and #CT_XDIGIT ; Mask xdigit bit -- rts -- --@L1: lda #$00 ; Return false -- tax -- rts -- -+ jsr ctype_preprocessor ; (clears always x) -+ bcs @L1 ; out of range? (everything already clear -> false) -+ and #CT_XDIGIT ; mask xdigit bit -+@L1: rts -diff --git a/libsrc/common/stricmp.s b/libsrc/common/stricmp.s -index 384e78e3..e1683d9f 100644 ---- a/libsrc/common/stricmp.s -+++ b/libsrc/common/stricmp.s -@@ -1,5 +1,11 @@ -+; stricmp.s - ; --; Ullrich von Bassewitz, 03.06.1998 -+; This file is part of -+; cc65 - a freeware C compiler for 6502 based systems -+; -+; https://github.com/cc65/cc65 -+; -+; See "LICENSE" file for legal information. - ; - ; int stricmp (const char* s1, const char* s2); /* DOS way */ - ; int strcasecmp (const char* s1, const char* s2); /* UNIX way */ -@@ -7,9 +13,8 @@ - - .export _stricmp, _strcasecmp - .import popptr1 -- .import __ctype -- .importzp ptr1, ptr2, tmp1 -- -+ .importzp ptr1, ptr2, tmp1, tmp2 -+ .import ctype_preprocessor_no_check - .include "ctype.inc" - - _stricmp: -@@ -20,27 +25,27 @@ _strcasecmp: - ; ldy #0 ; Y=0 guaranteed by popptr1 - - loop: lda (ptr2),y ; get char from second string -- tax -- lda __ctype,x ; get character classification -+ sta tmp2 ; and save it -+ ; get character classification -+ jsr ctype_preprocessor_no_check - and #CT_LOWER ; lower case char? - beq L1 ; jump if no -- txa ; get character back -- clc -- adc #<('A'-'a') ; make upper case char -- tax ; --L1: stx tmp1 ; remember upper case equivalent -+ lda #<('A'-'a') ; make upper case char -+ adc tmp2 ; ctype_preprocessor_no_check ensures carry clear! -+ sta tmp2 ; remember upper case equivalent - -- lda (ptr1),y ; get character from first string -- tax -- lda __ctype,x ; get character classification -+L1: lda (ptr1),y ; get character from first string -+ sta tmp1 -+ ; get character classification -+ jsr ctype_preprocessor_no_check - and #CT_LOWER ; lower case char? - beq L2 ; jump if no -- txa ; get character back -- clc -- adc #<('A'-'a') ; make upper case char -- tax -+ lda #<('A'-'a') ; make upper case char -+ adc tmp1 ; ctype_preprocessor_no_check ensures carry clear! -+ sta tmp1 ; remember upper case equivalent - --L2: cpx tmp1 ; compare characters -+L2: ldx tmp1 -+ cpx tmp2 ; compare characters - bne L3 - txa ; end of strings? - beq L5 ; a/x both zero -diff --git a/libsrc/common/strlower.s b/libsrc/common/strlower.s -index 848a4faf..8c634b6e 100644 ---- a/libsrc/common/strlower.s -+++ b/libsrc/common/strlower.s -@@ -10,9 +10,8 @@ - - .export _strlower, _strlwr - .import popax -- .import __ctype - .importzp ptr1, ptr2 -- -+ .import ctype_preprocessor_no_check - .include "ctype.inc" - - _strlower: -@@ -25,11 +24,11 @@ _strlwr: - - loop: lda (ptr1),y ; get character - beq L9 ; jump if done -- tax -- lda __ctype,x ; get character classification -+ ; get character classification -+ jsr ctype_preprocessor_no_check - and #CT_UPPER ; upper case char? - beq L1 ; jump if no -- txa ; get character back into accu -+ lda (ptr1),y ; fetch character again - sec - sbc #<('A'-'a') ; make lower case char - sta (ptr1),y ; store back -diff --git a/libsrc/common/strnicmp.s b/libsrc/common/strnicmp.s -index 6a5de09e..54aef2bb 100644 ---- a/libsrc/common/strnicmp.s -+++ b/libsrc/common/strnicmp.s -@@ -7,9 +7,9 @@ - ; - - .export _strnicmp, _strncasecmp -- .import popax, popptr1, __ctype -- .importzp ptr1, ptr2, ptr3, tmp1 -- -+ .import popax, popptr1 -+ .importzp ptr1, ptr2, ptr3, tmp1, tmp2 -+ .import ctype_preprocessor_no_check - .include "ctype.inc" - - _strnicmp: -@@ -46,27 +46,27 @@ Loop: inc ptr3 - ; Compare a byte from the strings - - Comp: lda (ptr2),y -- tax -- lda __ctype,x ; get character classification -+ sta tmp2 ; remember original char -+ ; get character classification -+ jsr ctype_preprocessor_no_check - and #CT_LOWER ; lower case char? - beq L1 ; jump if no -- txa ; get character back -- sec -- sbc #<('a'-'A') ; make upper case char -- tax ; --L1: stx tmp1 ; remember upper case equivalent -- -- lda (ptr1),y ; get character from first string -- tax -- lda __ctype,x ; get character classification -+ lda #<('A'-'a') ; make upper case char -+ adc tmp2 ; ctype_preprocessor_no_check ensures carry clear! -+ sta tmp2 ; remember upper case equivalent -+ -+L1: lda (ptr1),y ; get character from first string -+ sta tmp1 ; remember original char -+ ; get character classification -+ jsr ctype_preprocessor_no_check - and #CT_LOWER ; lower case char? - beq L2 ; jump if no -- txa ; get character back -- sec -- sbc #<('a'-'A') ; make upper case char -- tax -+ lda #<('A'-'a') ; make upper case char -+ adc tmp1 ; ctype_preprocessor_no_check ensures carry clear! -+ sta tmp1 ; remember upper case equivalent - --L2: cpx tmp1 ; compare characters -+L2: ldx tmp1 -+ cpx tmp2 ; compare characters - bne NotEqual ; Jump if strings different - txa ; End of strings? - beq Equal1 ; Jump if EOS reached, a/x == 0 -diff --git a/libsrc/common/strupper.s b/libsrc/common/strupper.s -index bf0d3b62..c07fb17c 100644 ---- a/libsrc/common/strupper.s -+++ b/libsrc/common/strupper.s -@@ -10,9 +10,8 @@ - - .export _strupper, _strupr - .import popax -- .import __ctype - .importzp ptr1, ptr2 -- -+ .import ctype_preprocessor_no_check - .include "ctype.inc" - - _strupper: -@@ -25,11 +24,10 @@ _strupr: - - loop: lda (ptr1),y ; get character - beq L9 ; jump if done -- tax -- lda __ctype,x ; get character classification -+ jsr ctype_preprocessor_no_check - and #CT_LOWER ; lower case char? - beq L1 ; jump if no -- txa ; get character back into accu -+ lda (ptr1),y ; fetch character again - clc - adc #<('A'-'a') ; make upper case char - sta (ptr1),y ; store back -diff --git a/libsrc/creativision/ctype.s b/libsrc/creativision/ctype.s -index 6e0ab178..da4d3847 100644 ---- a/libsrc/creativision/ctype.s -+++ b/libsrc/creativision/ctype.s -@@ -1,172 +1,5 @@ --; --; Ullrich von Bassewitz, 02.06.1998 --; - ; Character specification table. - ; -+; uses the "console" definition - --; The tables are readonly, put them into the rodata segment -- --.rodata -- --; The following 256 byte wide table specifies attributes for the isxxx type --; of functions. Doing it by a table means some overhead in space, but it --; has major advantages: --; --; * It is fast. If it were'nt for the slow parameter passing of cc65, one --; could even define macros for the isxxx functions (this is usually --; done on other platforms). --; --; * It is highly portable. The only unportable part is the table itself, --; all real code goes into the common library. --; --; * We save some code in the isxxx functions. --; --; --; Bit assignments: --; --; 0 - Lower case char --; 1 - Upper case char --; 2 - Numeric digit --; 3 - Hex digit (both, lower and upper) --; 4 - Control character --; 5 - The space character itself --; 6 - Other whitespace (that is: '\f', '\n', '\r', '\t' and '\v') --; 7 - Space or tab character -- -- .export __ctype -- --__ctype: -- --.repeat 2 ; 2 times for normal and inverted -- -- .byte $10 ; 0/00 ___ctrl_@___ -- .byte $10 ; 1/01 ___ctrl_A___ -- .byte $10 ; 2/02 ___ctrl_B___ -- .byte $10 ; 3/03 ___ctrl_C___ -- .byte $10 ; 4/04 ___ctrl_D___ -- .byte $10 ; 5/05 ___ctrl_E___ -- .byte $10 ; 6/06 ___ctrl_F___ -- .byte $10 ; 7/07 ___ctrl_G___ -- .byte $10 ; 8/08 ___ctrl_H___ -- .byte $D0 ; 9/09 ___ctrl_I___ -- .byte $50 ; 10/0a ___ctrl_J___ -- .byte $50 ; 11/0b ___ctrl_K___ -- .byte $50 ; 12/0c ___ctrl_L___ -- .byte $50 ; 13/0d ___ctrl_M___ -- .byte $10 ; 14/0e ___ctrl_N___ -- .byte $10 ; 15/0f ___ctrl_O___ -- .byte $10 ; 16/10 ___ctrl_P___ -- .byte $10 ; 17/11 ___ctrl_Q___ -- .byte $10 ; 18/12 ___ctrl_R___ -- .byte $10 ; 19/13 ___ctrl_S___ -- .byte $10 ; 20/14 ___ctrl_T___ -- .byte $10 ; 21/15 ___ctrl_U___ -- .byte $10 ; 22/16 ___ctrl_V___ -- .byte $10 ; 23/17 ___ctrl_W___ -- .byte $10 ; 24/18 ___ctrl_X___ -- .byte $10 ; 25/19 ___ctrl_Y___ -- .byte $10 ; 26/1a ___ctrl_Z___ -- .byte $10 ; 27/1b ___ctrl_[___ -- .byte $10 ; 28/1c ___ctrl_\___ -- .byte $10 ; 29/1d ___ctrl_]___ -- .byte $10 ; 30/1e ___ctrl_^___ -- .byte $10 ; 31/1f ___ctrl_____ -- .byte $A0 ; 32/20 ___SPACE___ -- .byte $00 ; 33/21 _____!_____ -- .byte $00 ; 34/22 _____"_____ -- .byte $00 ; 35/23 _____#_____ -- .byte $00 ; 36/24 _____$_____ -- .byte $00 ; 37/25 _____%_____ -- .byte $00 ; 38/26 _____&_____ -- .byte $00 ; 39/27 _____'_____ -- .byte $00 ; 40/28 _____(_____ -- .byte $00 ; 41/29 _____)_____ -- .byte $00 ; 42/2a _____*_____ -- .byte $00 ; 43/2b _____+_____ -- .byte $00 ; 44/2c _____,_____ -- .byte $00 ; 45/2d _____-_____ -- .byte $00 ; 46/2e _____._____ -- .byte $00 ; 47/2f _____/_____ -- .byte $0C ; 48/30 _____0_____ -- .byte $0C ; 49/31 _____1_____ -- .byte $0C ; 50/32 _____2_____ -- .byte $0C ; 51/33 _____3_____ -- .byte $0C ; 52/34 _____4_____ -- .byte $0C ; 53/35 _____5_____ -- .byte $0C ; 54/36 _____6_____ -- .byte $0C ; 55/37 _____7_____ -- .byte $0C ; 56/38 _____8_____ -- .byte $0C ; 57/39 _____9_____ -- .byte $00 ; 58/3a _____:_____ -- .byte $00 ; 59/3b _____;_____ -- .byte $00 ; 60/3c _____<_____ -- .byte $00 ; 61/3d _____=_____ -- .byte $00 ; 62/3e _____>_____ -- .byte $00 ; 63/3f _____?_____ -- -- .byte $00 ; 64/40 _____@_____ -- .byte $0A ; 65/41 _____A_____ -- .byte $0A ; 66/42 _____B_____ -- .byte $0A ; 67/43 _____C_____ -- .byte $0A ; 68/44 _____D_____ -- .byte $0A ; 69/45 _____E_____ -- .byte $0A ; 70/46 _____F_____ -- .byte $02 ; 71/47 _____G_____ -- .byte $02 ; 72/48 _____H_____ -- .byte $02 ; 73/49 _____I_____ -- .byte $02 ; 74/4a _____J_____ -- .byte $02 ; 75/4b _____K_____ -- .byte $02 ; 76/4c _____L_____ -- .byte $02 ; 77/4d _____M_____ -- .byte $02 ; 78/4e _____N_____ -- .byte $02 ; 79/4f _____O_____ -- .byte $02 ; 80/50 _____P_____ -- .byte $02 ; 81/51 _____Q_____ -- .byte $02 ; 82/52 _____R_____ -- .byte $02 ; 83/53 _____S_____ -- .byte $02 ; 84/54 _____T_____ -- .byte $02 ; 85/55 _____U_____ -- .byte $02 ; 86/56 _____V_____ -- .byte $02 ; 87/57 _____W_____ -- .byte $02 ; 88/58 _____X_____ -- .byte $02 ; 89/59 _____Y_____ -- .byte $02 ; 90/5a _____Z_____ -- .byte $00 ; 91/5b _____[_____ -- .byte $00 ; 92/5c _____\_____ -- .byte $00 ; 93/5d _____]_____ -- .byte $00 ; 94/5e _____^_____ -- .byte $00 ; 95/5f _UNDERLINE_ -- .byte $00 ; 96/60 ___grave___ -- .byte $09 ; 97/61 _____a_____ -- .byte $09 ; 98/62 _____b_____ -- .byte $09 ; 99/63 _____c_____ -- .byte $09 ; 100/64 _____d_____ -- .byte $09 ; 101/65 _____e_____ -- .byte $09 ; 102/66 _____f_____ -- .byte $01 ; 103/67 _____g_____ -- .byte $01 ; 104/68 _____h_____ -- .byte $01 ; 105/69 _____i_____ -- .byte $01 ; 106/6a _____j_____ -- .byte $01 ; 107/6b _____k_____ -- .byte $01 ; 108/6c _____l_____ -- .byte $01 ; 109/6d _____m_____ -- .byte $01 ; 110/6e _____n_____ -- .byte $01 ; 111/6f _____o_____ -- .byte $01 ; 112/70 _____p_____ -- .byte $01 ; 113/71 _____q_____ -- .byte $01 ; 114/72 _____r_____ -- .byte $01 ; 115/73 _____s_____ -- .byte $01 ; 116/74 _____t_____ -- .byte $01 ; 117/75 _____u_____ -- .byte $01 ; 118/76 _____v_____ -- .byte $01 ; 119/77 _____w_____ -- .byte $01 ; 120/78 _____x_____ -- .byte $01 ; 121/79 _____y_____ -- .byte $01 ; 122/7a _____z_____ -- .byte $00 ; 123/7b _____{_____ -- .byte $00 ; 124/7c _____|_____ -- .byte $00 ; 125/7d _____}_____ -- .byte $00 ; 126/7e _____~_____ -- .byte $40 ; 127/7f ____DEL____ -- --.endrepeat -+ .include "ctype_console.inc" -diff --git a/libsrc/gamate/ctype.s b/libsrc/gamate/ctype.s -index fa9a65c8..da4d3847 100644 ---- a/libsrc/gamate/ctype.s -+++ b/libsrc/gamate/ctype.s -@@ -1,161 +1,5 @@ --; --; Stefan Haubenthal with minor changes from Ullrich von Bassewitz, 2003-05-02 --; - ; Character specification table. - ; -+; uses the "console" definition - -- .include "ctype.inc" -- --; The tables are readonly, put them into the rodata segment -- --.rodata -- --; The following 256 byte wide table specifies attributes for the isxxx type --; of functions. Doing it by a table means some overhead in space, but it --; has major advantages: --; --; * It is fast. If it were'nt for the slow parameter passing of cc65, one --; could even define macros for the isxxx functions (this is usually --; done on other platforms). --; --; * It is highly portable. The only unportable part is the table itself, --; all real code goes into the common library. --; --; * We save some code in the isxxx functions. -- -- --__ctype: -- .repeat 2 -- .byte CT_CTRL ; 0/00 ___ctrl_@___ -- .byte CT_CTRL ; 1/01 ___ctrl_A___ -- .byte CT_CTRL ; 2/02 ___ctrl_B___ -- .byte CT_CTRL ; 3/03 ___ctrl_C___ -- .byte CT_CTRL ; 4/04 ___ctrl_D___ -- .byte CT_CTRL ; 5/05 ___ctrl_E___ -- .byte CT_CTRL ; 6/06 ___ctrl_F___ -- .byte CT_CTRL ; 7/07 ___ctrl_G___ -- .byte CT_CTRL ; 8/08 ___ctrl_H___ -- .byte CT_CTRL | CT_OTHER_WS | CT_SPACE_TAB -- ; 9/09 ___ctrl_I___ -- .byte CT_CTRL | CT_OTHER_WS ; 10/0a ___ctrl_J___ -- .byte CT_CTRL | CT_OTHER_WS ; 11/0b ___ctrl_K___ -- .byte CT_CTRL | CT_OTHER_WS ; 12/0c ___ctrl_L___ -- .byte CT_CTRL | CT_OTHER_WS ; 13/0d ___ctrl_M___ -- .byte CT_CTRL ; 14/0e ___ctrl_N___ -- .byte CT_CTRL ; 15/0f ___ctrl_O___ -- .byte CT_CTRL ; 16/10 ___ctrl_P___ -- .byte CT_CTRL ; 17/11 ___ctrl_Q___ -- .byte CT_CTRL ; 18/12 ___ctrl_R___ -- .byte CT_CTRL ; 19/13 ___ctrl_S___ -- .byte CT_CTRL ; 20/14 ___ctrl_T___ -- .byte CT_CTRL ; 21/15 ___ctrl_U___ -- .byte CT_CTRL ; 22/16 ___ctrl_V___ -- .byte CT_CTRL ; 23/17 ___ctrl_W___ -- .byte CT_CTRL ; 24/18 ___ctrl_X___ -- .byte CT_CTRL ; 25/19 ___ctrl_Y___ -- .byte CT_CTRL ; 26/1a ___ctrl_Z___ -- .byte CT_CTRL ; 27/1b ___ctrl_[___ -- .byte CT_CTRL ; 28/1c ___ctrl_\___ -- .byte CT_CTRL ; 29/1d ___ctrl_]___ -- .byte CT_CTRL ; 30/1e ___ctrl_^___ -- .byte CT_CTRL ; 31/1f ___ctrl_____ -- .byte CT_SPACE | CT_SPACE_TAB ; 32/20 ___SPACE___ -- .byte CT_NONE ; 33/21 _____!_____ -- .byte CT_NONE ; 34/22 _____"_____ -- .byte CT_NONE ; 35/23 _____#_____ -- .byte CT_NONE ; 36/24 _____$_____ -- .byte CT_NONE ; 37/25 _____%_____ -- .byte CT_NONE ; 38/26 _____&_____ -- .byte CT_NONE ; 39/27 _____'_____ -- .byte CT_NONE ; 40/28 _____(_____ -- .byte CT_NONE ; 41/29 _____)_____ -- .byte CT_NONE ; 42/2a _____*_____ -- .byte CT_NONE ; 43/2b _____+_____ -- .byte CT_NONE ; 44/2c _____,_____ -- .byte CT_NONE ; 45/2d _____-_____ -- .byte CT_NONE ; 46/2e _____._____ -- .byte CT_NONE ; 47/2f _____/_____ -- .byte CT_DIGIT | CT_XDIGIT ; 48/30 _____0_____ -- .byte CT_DIGIT | CT_XDIGIT ; 49/31 _____1_____ -- .byte CT_DIGIT | CT_XDIGIT ; 50/32 _____2_____ -- .byte CT_DIGIT | CT_XDIGIT ; 51/33 _____3_____ -- .byte CT_DIGIT | CT_XDIGIT ; 52/34 _____4_____ -- .byte CT_DIGIT | CT_XDIGIT ; 53/35 _____5_____ -- .byte CT_DIGIT | CT_XDIGIT ; 54/36 _____6_____ -- .byte CT_DIGIT | CT_XDIGIT ; 55/37 _____7_____ -- .byte CT_DIGIT | CT_XDIGIT ; 56/38 _____8_____ -- .byte CT_DIGIT | CT_XDIGIT ; 57/39 _____9_____ -- .byte CT_NONE ; 58/3a _____:_____ -- .byte CT_NONE ; 59/3b _____;_____ -- .byte CT_NONE ; 60/3c _____<_____ -- .byte CT_NONE ; 61/3d _____=_____ -- .byte CT_NONE ; 62/3e _____>_____ -- .byte CT_NONE ; 63/3f _____?_____ -- -- .byte CT_NONE ; 64/40 _____@_____ -- .byte CT_UPPER | CT_XDIGIT ; 65/41 _____A_____ -- .byte CT_UPPER | CT_XDIGIT ; 66/42 _____B_____ -- .byte CT_UPPER | CT_XDIGIT ; 67/43 _____C_____ -- .byte CT_UPPER | CT_XDIGIT ; 68/44 _____D_____ -- .byte CT_UPPER | CT_XDIGIT ; 69/45 _____E_____ -- .byte CT_UPPER | CT_XDIGIT ; 70/46 _____F_____ -- .byte CT_UPPER ; 71/47 _____G_____ -- .byte CT_UPPER ; 72/48 _____H_____ -- .byte CT_UPPER ; 73/49 _____I_____ -- .byte CT_UPPER ; 74/4a _____J_____ -- .byte CT_UPPER ; 75/4b _____K_____ -- .byte CT_UPPER ; 76/4c _____L_____ -- .byte CT_UPPER ; 77/4d _____M_____ -- .byte CT_UPPER ; 78/4e _____N_____ -- .byte CT_UPPER ; 79/4f _____O_____ -- .byte CT_UPPER ; 80/50 _____P_____ -- .byte CT_UPPER ; 81/51 _____Q_____ -- .byte CT_UPPER ; 82/52 _____R_____ -- .byte CT_UPPER ; 83/53 _____S_____ -- .byte CT_UPPER ; 84/54 _____T_____ -- .byte CT_UPPER ; 85/55 _____U_____ -- .byte CT_UPPER ; 86/56 _____V_____ -- .byte CT_UPPER ; 87/57 _____W_____ -- .byte CT_UPPER ; 88/58 _____X_____ -- .byte CT_UPPER ; 89/59 _____Y_____ -- .byte CT_UPPER ; 90/5a _____Z_____ -- .byte CT_NONE ; 91/5b _____[_____ -- .byte CT_NONE ; 92/5c _____\_____ -- .byte CT_NONE ; 93/5d _____]_____ -- .byte CT_NONE ; 94/5e _____^_____ -- .byte CT_NONE ; 95/5f _UNDERLINE_ -- .byte CT_NONE ; 96/60 ___grave___ -- .byte CT_LOWER | CT_XDIGIT ; 97/61 _____a_____ -- .byte CT_LOWER | CT_XDIGIT ; 98/62 _____b_____ -- .byte CT_LOWER | CT_XDIGIT ; 99/63 _____c_____ -- .byte CT_LOWER | CT_XDIGIT ; 100/64 _____d_____ -- .byte CT_LOWER | CT_XDIGIT ; 101/65 _____e_____ -- .byte CT_LOWER | CT_XDIGIT ; 102/66 _____f_____ -- .byte CT_LOWER ; 103/67 _____g_____ -- .byte CT_LOWER ; 104/68 _____h_____ -- .byte CT_LOWER ; 105/69 _____i_____ -- .byte CT_LOWER ; 106/6a _____j_____ -- .byte CT_LOWER ; 107/6b _____k_____ -- .byte CT_LOWER ; 108/6c _____l_____ -- .byte CT_LOWER ; 109/6d _____m_____ -- .byte CT_LOWER ; 110/6e _____n_____ -- .byte CT_LOWER ; 111/6f _____o_____ -- .byte CT_LOWER ; 112/70 _____p_____ -- .byte CT_LOWER ; 113/71 _____q_____ -- .byte CT_LOWER ; 114/72 _____r_____ -- .byte CT_LOWER ; 115/73 _____s_____ -- .byte CT_LOWER ; 116/74 _____t_____ -- .byte CT_LOWER ; 117/75 _____u_____ -- .byte CT_LOWER ; 118/76 _____v_____ -- .byte CT_LOWER ; 119/77 _____w_____ -- .byte CT_LOWER ; 120/78 _____x_____ -- .byte CT_LOWER ; 121/79 _____y_____ -- .byte CT_LOWER ; 122/7a _____z_____ -- .byte CT_NONE ; 123/7b _____{_____ -- .byte CT_NONE ; 124/7c _____|_____ -- .byte CT_NONE ; 125/7d _____}_____ -- .byte CT_NONE ; 126/7e _____~_____ -- .byte CT_OTHER_WS ; 127/7f ____DEL____ -- .endrepeat -- -- -+ .include "ctype_console.inc" -diff --git a/libsrc/geos-common/system/ctype.s b/libsrc/geos-common/system/ctype.s -index cc0cc98b..a50ad163 100644 ---- a/libsrc/geos-common/system/ctype.s -+++ b/libsrc/geos-common/system/ctype.s -@@ -1,281 +1,157 @@ -+; ctype.s - ; --; Source: The Hitchhiker's Guide To GEOS --; http://lyonlabs.org/commodore/onrequest/geos-manuals/The_Hitchhikers_Guide_to_GEOS.pdf -+; This file is part of -+; cc65 - a freeware C compiler for 6502 based systems -+; -+; https://github.com/cc65/cc65 -+; -+; See "LICENSE" file for legal information. - ; --; Character specification table. -+; GEOS character specification table. - ; -+; Source: The Hitchhiker's Guide To GEOS -+; http://lyonlabs.org/commodore/onrequest/geos-manuals/The_Hitchhikers_Guide_to_GEOS.pdf - -- .include "ctype.inc" -+ .include "ctypetable.inc" -+ .export __ctypeIdx -+ -+; The tables are readonly, put them into the rodata segment - - .rodata - --; The following 256 byte wide table specifies attributes for the isxxx type --; of functions. Doing it by a table means some overhead in space, but it --; has major advantages: --; --; * It is fast. If it were'nt for the slow parameter passing of cc65, one --; could even define macros for the isxxx functions (this is usually --; done on other platforms). --; --; * It is highly portable. The only unportable part is the table itself, --; all real code goes into the common library. --; --; * We save some code in the isxxx functions. -+__ctypeIdx: -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 0/00 ____NULL___, 1/01 ____N/A____ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 2/02 ____N/A____, 3/03 ____N/A____ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 4/04 ____N/A____, 5/05 ____N/A____ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 6/06 ____N/A____, 7/07 ____N/A____ -+ ct_mix CT_CTRL_IDX, CT_CTRL_WS_SPACETAB_IDX ; 8/08 __BAKSPACE_, 9/09 __FWDSPACE_ -+ ct_mix CT_CTRL_WS_IDX, CT_CTRL_IDX ; 10/0a _____LF____, 11/0b ____HOME___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_WS_IDX ; 12/0c ___UPLINE__, 13/0d _____CR____ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 14/0e __ULINEON__, 15/0f __ULINEOFF_ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 16/10 _ESC_GRAPH_, 17/11 ____N/A____ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 18/12 ___REVON___, 19/13 ___REVOFF__ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 20/14 ___GOTOX___, 21/15 ___GOTOY___ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 22/16 ___GOTOXY__, 23/17 _NEWCRDSET_ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 24/18 ___BOLDON__, 25/19 __ITALICON_ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 26/1a _OUTLINEON_, 27/1b _PLAINTEXT_ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 28/1c ____N/A____, 29/1d ____N/A____ -+ ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 30/1e ____N/A____, 31/1f ____N/A____ -+ -+ ct_mix CT_SPACE_SPACETAB_IDX, CT_NONE_IDX ; 32/20 ___SPACE___, 33/21 _____!_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 34/22 _____"_____, 35/23 _____#_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 36/24 _____$_____, 37/25 _____%_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 38/26 _____&_____, 39/27 _____'_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 40/28 _____(_____, 41/29 _____)_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 42/2a _____*_____, 43/2b _____+_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 44/2c _____,_____, 45/2d _____-_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 46/2e _____._____, 47/2f _____/_____ -+ ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 48/30 _____0_____, 49/31 _____1_____ -+ ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 50/32 _____2_____, 51/33 _____3_____ -+ ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 52/34 _____4_____, 53/35 _____5_____ -+ ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 54/36 _____6_____, 55/37 _____7_____ -+ ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 56/38 _____8_____, 57/39 _____9_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 58/3a _____:_____, 59/3b _____;_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 60/3c _____<_____, 61/3d _____=_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 62/3e _____>_____, 63/3f _____?_____ -+ -+ ct_mix CT_NONE_IDX, CT_UPPER_XDIGIT_IDX ; 64/40 _____@_____, 65/41 _____A_____ -+ ct_mix CT_UPPER_XDIGIT_IDX, CT_UPPER_XDIGIT_IDX ; 66/42 _____B_____, 67/43 _____C_____ -+ ct_mix CT_UPPER_XDIGIT_IDX, CT_UPPER_XDIGIT_IDX ; 68/44 _____D_____, 69/45 _____E_____ -+ ct_mix CT_UPPER_XDIGIT_IDX, CT_UPPER_IDX ; 70/46 _____F_____, 71/47 _____G_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 72/48 _____H_____, 73/49 _____I_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 74/4a _____J_____, 75/4b _____K_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 76/4c _____L_____, 77/4d _____M_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 78/4e _____N_____, 79/4f _____O_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 80/50 _____P_____, 81/51 _____Q_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 82/52 _____R_____, 83/53 _____S_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 84/54 _____T_____, 85/55 _____U_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 86/56 _____V_____, 87/57 _____W_____ -+ ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 88/58 _____X_____, 89/59 _____Y_____ -+ ct_mix CT_UPPER_IDX, CT_NONE_IDX ; 90/5a _____Z_____, 91/5b _____[_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 92/5c _____\_____, 93/5d _____]_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 94/5e _____^_____, 95/5f _UNDERLINE_ -+ -+ ct_mix CT_NONE_IDX, CT_LOWER_XDIGIT_IDX ; 96/60 _____`_____, 97/61 _____a_____ -+ ct_mix CT_LOWER_XDIGIT_IDX, CT_LOWER_XDIGIT_IDX ; 98/62 _____b_____, 99/63 _____c_____ -+ ct_mix CT_LOWER_XDIGIT_IDX, CT_LOWER_XDIGIT_IDX ; 100/64 _____d_____, 101/65 _____e_____ -+ ct_mix CT_LOWER_XDIGIT_IDX, CT_LOWER_IDX ; 102/66 _____f_____, 103/67 _____g_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 104/68 _____h_____, 105/69 _____i_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 106/6a _____j_____, 107/6b _____k_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 108/6c _____l_____, 109/6d _____m_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 110/6e _____n_____, 111/6f _____o_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 112/70 _____p_____, 113/71 _____q_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 114/72 _____r_____, 15/73 _____s_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 116/74 _____t_____, 117/75 _____u_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 118/76 _____v_____, 119/77 _____w_____ -+ ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 120/78 _____x_____, 121/79 _____y_____ -+ ct_mix CT_LOWER_IDX, CT_NONE_IDX ; 122/7a _____z_____, 123/7b _____{_____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 124/7c _____|_____, 125/7d _____}_____ -+ ct_mix CT_NONE_IDX, CT_CTRL_IDX ; 126/7e _____~_____, 127/7f __USELAST__ -+ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 128/80 __SHORTCUT_ ,129/81 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 130/82 ____N/A____ ,131/83 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 132/84 ____N/A____ ,133/85 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 134/86 ____N/A____, 135/87 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 136/88 ____N/A____ ,137/89 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 138/8a ____N/A____ ,139/8b ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 140/8c ____N/A____, 141/8d ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 142/8e ____N/A____, 143/8f ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 144/90 ____N/A____, 145/91 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 146/92 ____N/A____, 147/93 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 148/94 ____N/A____, 149/95 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 150/96 ____N/A____, 151/97 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 152/98 ____N/A____, 153/99 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 154/9a ____N/A____, 155/9b ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 156/9c ____N/A____, 157/9d ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 158/9e ____N/A____, 159/9f ____N/A____ -+ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 160/a0 ____N/A____, 161/a1 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 162/a2 ____N/A____, 163/a3 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 164/a4 ____N/A____, 165/a5 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 166/a6 ____N/A____, 167/a7 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 168/a8 ____N/A____, 169/a9 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 170/aa ____N/A____, 171/ab ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 172/ac ____N/A____, 173/ad ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 174/ae ____N/A____, 175/af ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 176/b0 ____N/A____, 177/b1 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 178/b2 ____N/A____, 179/b3 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 180/b4 ____N/A____, 181/b5 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 182/b6 ____N/A____, 183/b7 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 184/b8 ____N/A____, 185/b9 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 186/ba ____N/A____, 187/bb ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 188/bc ____N/A____, 189/bd ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 190/be ____N/A____, 191/bf ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 192/c0 ____N/A____, 193/c1 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 194/c2 ____N/A____, 195/c3 ____N/A____ -+ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 196/c4 ____N/A____, 197/c5 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 198/c6 ____N/A____, 199/c7 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 200/c8 ____N/A____, 201/c9 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 202/ca ____N/A____, 203/cb ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 204/cc ____N/A____, 205/cd ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 206/ce ____N/A____, 207/cf ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 208/d0 ____N/A____, 209/d1 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 210/d2 ____N/A____, 211/d3 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 212/d4 ____N/A____, 213/d5 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 214/d6 ____N/A____, 215/d7 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 216/d8 ____N/A____, 217/d9 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 218/da ____N/A____, 219/db ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 220/dc ____N/A____, 221/dd ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 222/de ____N/A____, 223/df ____N/A____ - --__ctype: -- .byte CT_CTRL ; 0/00 ____NULL___ -- .byte CT_CTRL ; 1/01 ____N/A____ -- .byte CT_CTRL ; 2/02 ____N/A____ -- .byte CT_CTRL ; 3/03 ____N/A____ -- .byte CT_CTRL ; 4/04 ____N/A____ -- .byte CT_CTRL ; 5/05 ____N/A____ -- .byte CT_CTRL ; 6/06 ____N/A____ -- .byte CT_CTRL ; 7/07 ____N/A____ -- .byte CT_CTRL ; 8/08 __BAKSPACE_ -- .byte CT_CTRL | CT_OTHER_WS | CT_SPACE_TAB ; 9/09 __FWDSPACE_ -- .byte CT_CTRL | CT_OTHER_WS ; 10/0a _____LF____ -- .byte CT_CTRL ; 11/0b ____HOME___ -- .byte CT_CTRL ; 12/0c ___UPLINE__ -- .byte CT_CTRL | CT_OTHER_WS ; 13/0d _____CR____ -- .byte CT_CTRL ; 14/0e __ULINEON__ -- .byte CT_CTRL ; 15/0f __ULINEOFF_ -- .byte CT_CTRL ; 16/10 _ESC_GRAPH_ -- .byte CT_CTRL ; 17/11 ____N/A____ -- .byte CT_CTRL ; 18/12 ___REVON___ -- .byte CT_CTRL ; 19/13 ___REVOFF__ -- .byte CT_CTRL ; 20/14 ___GOTOX___ -- .byte CT_CTRL ; 21/15 ___GOTOY___ -- .byte CT_CTRL ; 22/16 ___GOTOXY__ -- .byte CT_CTRL ; 23/17 _NEWCRDSET_ -- .byte CT_CTRL ; 24/18 ___BOLDON__ -- .byte CT_CTRL ; 25/19 __ITALICON_ -- .byte CT_CTRL ; 26/1a _OUTLINEON_ -- .byte CT_CTRL ; 27/1b _PLAINTEXT_ -- .byte CT_CTRL ; 28/1c ____N/A____ -- .byte CT_CTRL ; 29/1d ____N/A____ -- .byte CT_CTRL ; 30/1e ____N/A____ -- .byte CT_CTRL ; 31/1f ____N/A____ -- .byte CT_SPACE_TAB | CT_SPACE ; 32/20 ___SPACE___ -- .byte CT_NONE ; 33/21 _____!_____ -- .byte CT_NONE ; 34/22 _____"_____ -- .byte CT_NONE ; 35/23 _____#_____ -- .byte CT_NONE ; 36/24 _____$_____ -- .byte CT_NONE ; 37/25 _____%_____ -- .byte CT_NONE ; 38/26 _____&_____ -- .byte CT_NONE ; 39/27 _____'_____ -- .byte CT_NONE ; 40/28 _____(_____ -- .byte CT_NONE ; 41/29 _____)_____ -- .byte CT_NONE ; 42/2a _____*_____ -- .byte CT_NONE ; 43/2b _____+_____ -- .byte CT_NONE ; 44/2c _____,_____ -- .byte CT_NONE ; 45/2d _____-_____ -- .byte CT_NONE ; 46/2e _____._____ -- .byte CT_NONE ; 47/2f _____/_____ -- .byte CT_DIGIT | CT_XDIGIT ; 48/30 _____0_____ -- .byte CT_DIGIT | CT_XDIGIT ; 49/31 _____1_____ -- .byte CT_DIGIT | CT_XDIGIT ; 50/32 _____2_____ -- .byte CT_DIGIT | CT_XDIGIT ; 51/33 _____3_____ -- .byte CT_DIGIT | CT_XDIGIT ; 52/34 _____4_____ -- .byte CT_DIGIT | CT_XDIGIT ; 53/35 _____5_____ -- .byte CT_DIGIT | CT_XDIGIT ; 54/36 _____6_____ -- .byte CT_DIGIT | CT_XDIGIT ; 55/37 _____7_____ -- .byte CT_DIGIT | CT_XDIGIT ; 56/38 _____8_____ -- .byte CT_DIGIT | CT_XDIGIT ; 57/39 _____9_____ -- .byte CT_NONE ; 58/3a _____:_____ -- .byte CT_NONE ; 59/3b _____;_____ -- .byte CT_NONE ; 60/3c _____<_____ -- .byte CT_NONE ; 61/3d _____=_____ -- .byte CT_NONE ; 62/3e _____>_____ -- .byte CT_NONE ; 63/3f _____?_____ -- .byte CT_NONE ; 64/40 _____@_____ -- .byte CT_UPPER | CT_XDIGIT ; 65/41 _____A_____ -- .byte CT_UPPER | CT_XDIGIT ; 66/42 _____B_____ -- .byte CT_UPPER | CT_XDIGIT ; 67/43 _____C_____ -- .byte CT_UPPER | CT_XDIGIT ; 68/44 _____D_____ -- .byte CT_UPPER | CT_XDIGIT ; 69/45 _____E_____ -- .byte CT_UPPER | CT_XDIGIT ; 70/46 _____F_____ -- .byte CT_UPPER ; 71/47 _____G_____ -- .byte CT_UPPER ; 72/48 _____H_____ -- .byte CT_UPPER ; 73/49 _____I_____ -- .byte CT_UPPER ; 74/4a _____J_____ -- .byte CT_UPPER ; 75/4b _____K_____ -- .byte CT_UPPER ; 76/4c _____L_____ -- .byte CT_UPPER ; 77/4d _____M_____ -- .byte CT_UPPER ; 78/4e _____N_____ -- .byte CT_UPPER ; 79/4f _____O_____ -- .byte CT_UPPER ; 80/50 _____P_____ -- .byte CT_UPPER ; 81/51 _____Q_____ -- .byte CT_UPPER ; 82/52 _____R_____ -- .byte CT_UPPER ; 83/53 _____S_____ -- .byte CT_UPPER ; 84/54 _____T_____ -- .byte CT_UPPER ; 85/55 _____U_____ -- .byte CT_UPPER ; 86/56 _____V_____ -- .byte CT_UPPER ; 87/57 _____W_____ -- .byte CT_UPPER ; 88/58 _____X_____ -- .byte CT_UPPER ; 89/59 _____Y_____ -- .byte CT_UPPER ; 90/5a _____Z_____ -- .byte CT_NONE ; 91/5b _____[_____ -- .byte CT_NONE ; 92/5c _____\_____ -- .byte CT_NONE ; 93/5d _____]_____ -- .byte CT_NONE ; 94/5e _____^_____ -- .byte CT_NONE ; 95/5f _UNDERLINE_ -- .byte CT_NONE ; 96/60 _____`_____ -- .byte CT_LOWER | CT_XDIGIT ; 97/61 _____a_____ -- .byte CT_LOWER | CT_XDIGIT ; 98/62 _____b_____ -- .byte CT_LOWER | CT_XDIGIT ; 99/63 _____c_____ -- .byte CT_LOWER | CT_XDIGIT ; 100/64 _____d_____ -- .byte CT_LOWER | CT_XDIGIT ; 101/65 _____e_____ -- .byte CT_LOWER | CT_XDIGIT ; 102/66 _____f_____ -- .byte CT_LOWER ; 103/67 _____g_____ -- .byte CT_LOWER ; 104/68 _____h_____ -- .byte CT_LOWER ; 105/69 _____i_____ -- .byte CT_LOWER ; 106/6a _____j_____ -- .byte CT_LOWER ; 107/6b _____k_____ -- .byte CT_LOWER ; 108/6c _____l_____ -- .byte CT_LOWER ; 109/6d _____m_____ -- .byte CT_LOWER ; 110/6e _____n_____ -- .byte CT_LOWER ; 111/6f _____o_____ -- .byte CT_LOWER ; 112/70 _____p_____ -- .byte CT_LOWER ; 113/71 _____q_____ -- .byte CT_LOWER ; 114/72 _____r_____ -- .byte CT_LOWER ; 115/73 _____s_____ -- .byte CT_LOWER ; 116/74 _____t_____ -- .byte CT_LOWER ; 117/75 _____u_____ -- .byte CT_LOWER ; 118/76 _____v_____ -- .byte CT_LOWER ; 119/77 _____w_____ -- .byte CT_LOWER ; 120/78 _____x_____ -- .byte CT_LOWER ; 121/79 _____y_____ -- .byte CT_LOWER ; 122/7a _____z_____ -- .byte CT_NONE ; 123/7b _____{_____ -- .byte CT_NONE ; 124/7c _____|_____ -- .byte CT_NONE ; 125/7d _____}_____ -- .byte CT_NONE ; 126/7e _____~_____ -- .byte CT_CTRL ; 127/7f __USELAST__ -- .byte CT_NONE ; 128/80 __SHORTCUT_ -- .byte CT_NONE ; 129/81 ____N/A____ -- .byte CT_NONE ; 130/82 ____N/A____ -- .byte CT_NONE ; 131/83 ____N/A____ -- .byte CT_NONE ; 132/84 ____N/A____ -- .byte CT_NONE ; 133/85 ____N/A____ -- .byte CT_NONE ; 134/86 ____N/A____ -- .byte CT_NONE ; 135/87 ____N/A____ -- .byte CT_NONE ; 136/88 ____N/A____ -- .byte CT_NONE ; 137/89 ____N/A____ -- .byte CT_NONE ; 138/8a ____N/A____ -- .byte CT_NONE ; 139/8b ____N/A____ -- .byte CT_NONE ; 140/8c ____N/A____ -- .byte CT_NONE ; 141/8d ____N/A____ -- .byte CT_NONE ; 142/8e ____N/A____ -- .byte CT_NONE ; 143/8f ____N/A____ -- .byte CT_NONE ; 144/90 ____N/A____ -- .byte CT_NONE ; 145/91 ____N/A____ -- .byte CT_NONE ; 146/92 ____N/A____ -- .byte CT_NONE ; 147/93 ____N/A____ -- .byte CT_NONE ; 148/94 ____N/A____ -- .byte CT_NONE ; 149/95 ____N/A____ -- .byte CT_NONE ; 150/96 ____N/A____ -- .byte CT_NONE ; 151/97 ____N/A____ -- .byte CT_NONE ; 152/98 ____N/A____ -- .byte CT_NONE ; 153/99 ____N/A____ -- .byte CT_NONE ; 154/9a ____N/A____ -- .byte CT_NONE ; 155/9b ____N/A____ -- .byte CT_NONE ; 156/9c ____N/A____ -- .byte CT_NONE ; 157/9d ____N/A____ -- .byte CT_NONE ; 158/9e ____N/A____ -- .byte CT_NONE ; 159/9f ____N/A____ -- .byte CT_NONE ; 160/a0 ____N/A____ -- .byte CT_NONE ; 161/a1 ____N/A____ -- .byte CT_NONE ; 162/a2 ____N/A____ -- .byte CT_NONE ; 163/a3 ____N/A____ -- .byte CT_NONE ; 164/a4 ____N/A____ -- .byte CT_NONE ; 165/a5 ____N/A____ -- .byte CT_NONE ; 166/a6 ____N/A____ -- .byte CT_NONE ; 167/a7 ____N/A____ -- .byte CT_NONE ; 168/a8 ____N/A____ -- .byte CT_NONE ; 169/a9 ____N/A____ -- .byte CT_NONE ; 170/aa ____N/A____ -- .byte CT_NONE ; 171/ab ____N/A____ -- .byte CT_NONE ; 172/ac ____N/A____ -- .byte CT_NONE ; 173/ad ____N/A____ -- .byte CT_NONE ; 174/ae ____N/A____ -- .byte CT_NONE ; 175/af ____N/A____ -- .byte CT_NONE ; 176/b0 ____N/A____ -- .byte CT_NONE ; 177/b1 ____N/A____ -- .byte CT_NONE ; 178/b2 ____N/A____ -- .byte CT_NONE ; 179/b3 ____N/A____ -- .byte CT_NONE ; 180/b4 ____N/A____ -- .byte CT_NONE ; 181/b5 ____N/A____ -- .byte CT_NONE ; 182/b6 ____N/A____ -- .byte CT_NONE ; 183/b7 ____N/A____ -- .byte CT_NONE ; 184/b8 ____N/A____ -- .byte CT_NONE ; 185/b9 ____N/A____ -- .byte CT_NONE ; 186/ba ____N/A____ -- .byte CT_NONE ; 187/bb ____N/A____ -- .byte CT_NONE ; 188/bc ____N/A____ -- .byte CT_NONE ; 189/bd ____N/A____ -- .byte CT_NONE ; 190/be ____N/A____ -- .byte CT_NONE ; 191/bf ____N/A____ -- .byte CT_NONE ; 192/c0 ____N/A____ -- .byte CT_NONE ; 193/c1 ____N/A____ -- .byte CT_NONE ; 194/c2 ____N/A____ -- .byte CT_NONE ; 195/c3 ____N/A____ -- .byte CT_NONE ; 196/c4 ____N/A____ -- .byte CT_NONE ; 197/c5 ____N/A____ -- .byte CT_NONE ; 198/c6 ____N/A____ -- .byte CT_NONE ; 199/c7 ____N/A____ -- .byte CT_NONE ; 200/c8 ____N/A____ -- .byte CT_NONE ; 201/c9 ____N/A____ -- .byte CT_NONE ; 202/ca ____N/A____ -- .byte CT_NONE ; 203/cb ____N/A____ -- .byte CT_NONE ; 204/cc ____N/A____ -- .byte CT_NONE ; 205/cd ____N/A____ -- .byte CT_NONE ; 206/ce ____N/A____ -- .byte CT_NONE ; 207/cf ____N/A____ -- .byte CT_NONE ; 208/d0 ____N/A____ -- .byte CT_NONE ; 209/d1 ____N/A____ -- .byte CT_NONE ; 210/d2 ____N/A____ -- .byte CT_NONE ; 211/d3 ____N/A____ -- .byte CT_NONE ; 212/d4 ____N/A____ -- .byte CT_NONE ; 213/d5 ____N/A____ -- .byte CT_NONE ; 214/d6 ____N/A____ -- .byte CT_NONE ; 215/d7 ____N/A____ -- .byte CT_NONE ; 216/d8 ____N/A____ -- .byte CT_NONE ; 217/d9 ____N/A____ -- .byte CT_NONE ; 218/da ____N/A____ -- .byte CT_NONE ; 219/db ____N/A____ -- .byte CT_NONE ; 220/dc ____N/A____ -- .byte CT_NONE ; 221/dd ____N/A____ -- .byte CT_NONE ; 222/de ____N/A____ -- .byte CT_NONE ; 223/df ____N/A____ -- .byte CT_NONE ; 224/e0 ____N/A____ -- .byte CT_NONE ; 225/e1 ____N/A____ -- .byte CT_NONE ; 226/e2 ____N/A____ -- .byte CT_NONE ; 227/e3 ____N/A____ -- .byte CT_NONE ; 228/e4 ____N/A____ -- .byte CT_NONE ; 229/e5 ____N/A____ -- .byte CT_NONE ; 230/e6 ____N/A____ -- .byte CT_NONE ; 231/e7 ____N/A____ -- .byte CT_NONE ; 232/e8 ____N/A____ -- .byte CT_NONE ; 233/e9 ____N/A____ -- .byte CT_NONE ; 234/ea ____N/A____ -- .byte CT_NONE ; 235/eb ____N/A____ -- .byte CT_NONE ; 236/ec ____N/A____ -- .byte CT_NONE ; 237/ed ____N/A____ -- .byte CT_NONE ; 238/ee ____N/A____ -- .byte CT_NONE ; 239/ef ____N/A____ -- .byte CT_NONE ; 240/f0 ____N/A____ -- .byte CT_NONE ; 241/f1 ____N/A____ -- .byte CT_NONE ; 242/f2 ____N/A____ -- .byte CT_NONE ; 243/f3 ____N/A____ -- .byte CT_NONE ; 244/f4 ____N/A____ -- .byte CT_NONE ; 245/f5 ____N/A____ -- .byte CT_NONE ; 246/f6 ____N/A____ -- .byte CT_NONE ; 247/f7 ____N/A____ -- .byte CT_NONE ; 248/f8 ____N/A____ -- .byte CT_NONE ; 249/f9 ____N/A____ -- .byte CT_NONE ; 250/fa ____N/A____ -- .byte CT_NONE ; 251/fb ____N/A____ -- .byte CT_NONE ; 252/fc ____N/A____ -- .byte CT_NONE ; 253/fd ____N/A____ -- .byte CT_NONE ; 254/fe ____N/A____ -- .byte CT_NONE ; 255/ff ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 224/e0 ____N/A____, 225/e1 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 226/e2 ____N/A____, 227/e3 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 228/e4 ____N/A____, 229/e5 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 230/e6 ____N/A____, 231/e7 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 232/e8 ____N/A____, 233/e9 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 234/ea ____N/A____, 235/eb ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 236/ec ____N/A____, 237/ed ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 238/ee ____N/A____, 239/ef ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 240/f0 ____N/A____, 241/f1 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 242/f2 ____N/A____, 243/f3 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 244/f4 ____N/A____, 245/f5 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 246/f6 ____N/A____, 247/f7 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 248/f8 ____N/A____, 249/f9 ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 250/fa ____N/A____, 251/fb ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 252/fc ____N/A____, 253/fd ____N/A____ -+ ct_mix CT_NONE_IDX, CT_NONE_IDX ; 254/fe ____N/A____, 255/ff ____N/A____ -diff --git a/libsrc/lynx/ctype.s b/libsrc/lynx/ctype.s -index 6e0ab178..da4d3847 100644 ---- a/libsrc/lynx/ctype.s -+++ b/libsrc/lynx/ctype.s -@@ -1,172 +1,5 @@ --; --; Ullrich von Bassewitz, 02.06.1998 --; - ; Character specification table. - ; -+; uses the "console" definition - --; The tables are readonly, put them into the rodata segment -- --.rodata -- --; The following 256 byte wide table specifies attributes for the isxxx type --; of functions. Doing it by a table means some overhead in space, but it --; has major advantages: --; --; * It is fast. If it were'nt for the slow parameter passing of cc65, one --; could even define macros for the isxxx functions (this is usually --; done on other platforms). --; --; * It is highly portable. The only unportable part is the table itself, --; all real code goes into the common library. --; --; * We save some code in the isxxx functions. --; --; --; Bit assignments: --; --; 0 - Lower case char --; 1 - Upper case char --; 2 - Numeric digit --; 3 - Hex digit (both, lower and upper) --; 4 - Control character --; 5 - The space character itself --; 6 - Other whitespace (that is: '\f', '\n', '\r', '\t' and '\v') --; 7 - Space or tab character -- -- .export __ctype -- --__ctype: -- --.repeat 2 ; 2 times for normal and inverted -- -- .byte $10 ; 0/00 ___ctrl_@___ -- .byte $10 ; 1/01 ___ctrl_A___ -- .byte $10 ; 2/02 ___ctrl_B___ -- .byte $10 ; 3/03 ___ctrl_C___ -- .byte $10 ; 4/04 ___ctrl_D___ -- .byte $10 ; 5/05 ___ctrl_E___ -- .byte $10 ; 6/06 ___ctrl_F___ -- .byte $10 ; 7/07 ___ctrl_G___ -- .byte $10 ; 8/08 ___ctrl_H___ -- .byte $D0 ; 9/09 ___ctrl_I___ -- .byte $50 ; 10/0a ___ctrl_J___ -- .byte $50 ; 11/0b ___ctrl_K___ -- .byte $50 ; 12/0c ___ctrl_L___ -- .byte $50 ; 13/0d ___ctrl_M___ -- .byte $10 ; 14/0e ___ctrl_N___ -- .byte $10 ; 15/0f ___ctrl_O___ -- .byte $10 ; 16/10 ___ctrl_P___ -- .byte $10 ; 17/11 ___ctrl_Q___ -- .byte $10 ; 18/12 ___ctrl_R___ -- .byte $10 ; 19/13 ___ctrl_S___ -- .byte $10 ; 20/14 ___ctrl_T___ -- .byte $10 ; 21/15 ___ctrl_U___ -- .byte $10 ; 22/16 ___ctrl_V___ -- .byte $10 ; 23/17 ___ctrl_W___ -- .byte $10 ; 24/18 ___ctrl_X___ -- .byte $10 ; 25/19 ___ctrl_Y___ -- .byte $10 ; 26/1a ___ctrl_Z___ -- .byte $10 ; 27/1b ___ctrl_[___ -- .byte $10 ; 28/1c ___ctrl_\___ -- .byte $10 ; 29/1d ___ctrl_]___ -- .byte $10 ; 30/1e ___ctrl_^___ -- .byte $10 ; 31/1f ___ctrl_____ -- .byte $A0 ; 32/20 ___SPACE___ -- .byte $00 ; 33/21 _____!_____ -- .byte $00 ; 34/22 _____"_____ -- .byte $00 ; 35/23 _____#_____ -- .byte $00 ; 36/24 _____$_____ -- .byte $00 ; 37/25 _____%_____ -- .byte $00 ; 38/26 _____&_____ -- .byte $00 ; 39/27 _____'_____ -- .byte $00 ; 40/28 _____(_____ -- .byte $00 ; 41/29 _____)_____ -- .byte $00 ; 42/2a _____*_____ -- .byte $00 ; 43/2b _____+_____ -- .byte $00 ; 44/2c _____,_____ -- .byte $00 ; 45/2d _____-_____ -- .byte $00 ; 46/2e _____._____ -- .byte $00 ; 47/2f _____/_____ -- .byte $0C ; 48/30 _____0_____ -- .byte $0C ; 49/31 _____1_____ -- .byte $0C ; 50/32 _____2_____ -- .byte $0C ; 51/33 _____3_____ -- .byte $0C ; 52/34 _____4_____ -- .byte $0C ; 53/35 _____5_____ -- .byte $0C ; 54/36 _____6_____ -- .byte $0C ; 55/37 _____7_____ -- .byte $0C ; 56/38 _____8_____ -- .byte $0C ; 57/39 _____9_____ -- .byte $00 ; 58/3a _____:_____ -- .byte $00 ; 59/3b _____;_____ -- .byte $00 ; 60/3c _____<_____ -- .byte $00 ; 61/3d _____=_____ -- .byte $00 ; 62/3e _____>_____ -- .byte $00 ; 63/3f _____?_____ -- -- .byte $00 ; 64/40 _____@_____ -- .byte $0A ; 65/41 _____A_____ -- .byte $0A ; 66/42 _____B_____ -- .byte $0A ; 67/43 _____C_____ -- .byte $0A ; 68/44 _____D_____ -- .byte $0A ; 69/45 _____E_____ -- .byte $0A ; 70/46 _____F_____ -- .byte $02 ; 71/47 _____G_____ -- .byte $02 ; 72/48 _____H_____ -- .byte $02 ; 73/49 _____I_____ -- .byte $02 ; 74/4a _____J_____ -- .byte $02 ; 75/4b _____K_____ -- .byte $02 ; 76/4c _____L_____ -- .byte $02 ; 77/4d _____M_____ -- .byte $02 ; 78/4e _____N_____ -- .byte $02 ; 79/4f _____O_____ -- .byte $02 ; 80/50 _____P_____ -- .byte $02 ; 81/51 _____Q_____ -- .byte $02 ; 82/52 _____R_____ -- .byte $02 ; 83/53 _____S_____ -- .byte $02 ; 84/54 _____T_____ -- .byte $02 ; 85/55 _____U_____ -- .byte $02 ; 86/56 _____V_____ -- .byte $02 ; 87/57 _____W_____ -- .byte $02 ; 88/58 _____X_____ -- .byte $02 ; 89/59 _____Y_____ -- .byte $02 ; 90/5a _____Z_____ -- .byte $00 ; 91/5b _____[_____ -- .byte $00 ; 92/5c _____\_____ -- .byte $00 ; 93/5d _____]_____ -- .byte $00 ; 94/5e _____^_____ -- .byte $00 ; 95/5f _UNDERLINE_ -- .byte $00 ; 96/60 ___grave___ -- .byte $09 ; 97/61 _____a_____ -- .byte $09 ; 98/62 _____b_____ -- .byte $09 ; 99/63 _____c_____ -- .byte $09 ; 100/64 _____d_____ -- .byte $09 ; 101/65 _____e_____ -- .byte $09 ; 102/66 _____f_____ -- .byte $01 ; 103/67 _____g_____ -- .byte $01 ; 104/68 _____h_____ -- .byte $01 ; 105/69 _____i_____ -- .byte $01 ; 106/6a _____j_____ -- .byte $01 ; 107/6b _____k_____ -- .byte $01 ; 108/6c _____l_____ -- .byte $01 ; 109/6d _____m_____ -- .byte $01 ; 110/6e _____n_____ -- .byte $01 ; 111/6f _____o_____ -- .byte $01 ; 112/70 _____p_____ -- .byte $01 ; 113/71 _____q_____ -- .byte $01 ; 114/72 _____r_____ -- .byte $01 ; 115/73 _____s_____ -- .byte $01 ; 116/74 _____t_____ -- .byte $01 ; 117/75 _____u_____ -- .byte $01 ; 118/76 _____v_____ -- .byte $01 ; 119/77 _____w_____ -- .byte $01 ; 120/78 _____x_____ -- .byte $01 ; 121/79 _____y_____ -- .byte $01 ; 122/7a _____z_____ -- .byte $00 ; 123/7b _____{_____ -- .byte $00 ; 124/7c _____|_____ -- .byte $00 ; 125/7d _____}_____ -- .byte $00 ; 126/7e _____~_____ -- .byte $40 ; 127/7f ____DEL____ -- --.endrepeat -+ .include "ctype_console.inc" -diff --git a/libsrc/nes/ctype.s b/libsrc/nes/ctype.s -index 6e0ab178..da4d3847 100644 ---- a/libsrc/nes/ctype.s -+++ b/libsrc/nes/ctype.s -@@ -1,172 +1,5 @@ --; --; Ullrich von Bassewitz, 02.06.1998 --; - ; Character specification table. - ; -+; uses the "console" definition - --; The tables are readonly, put them into the rodata segment -- --.rodata -- --; The following 256 byte wide table specifies attributes for the isxxx type --; of functions. Doing it by a table means some overhead in space, but it --; has major advantages: --; --; * It is fast. If it were'nt for the slow parameter passing of cc65, one --; could even define macros for the isxxx functions (this is usually --; done on other platforms). --; --; * It is highly portable. The only unportable part is the table itself, --; all real code goes into the common library. --; --; * We save some code in the isxxx functions. --; --; --; Bit assignments: --; --; 0 - Lower case char --; 1 - Upper case char --; 2 - Numeric digit --; 3 - Hex digit (both, lower and upper) --; 4 - Control character --; 5 - The space character itself --; 6 - Other whitespace (that is: '\f', '\n', '\r', '\t' and '\v') --; 7 - Space or tab character -- -- .export __ctype -- --__ctype: -- --.repeat 2 ; 2 times for normal and inverted -- -- .byte $10 ; 0/00 ___ctrl_@___ -- .byte $10 ; 1/01 ___ctrl_A___ -- .byte $10 ; 2/02 ___ctrl_B___ -- .byte $10 ; 3/03 ___ctrl_C___ -- .byte $10 ; 4/04 ___ctrl_D___ -- .byte $10 ; 5/05 ___ctrl_E___ -- .byte $10 ; 6/06 ___ctrl_F___ -- .byte $10 ; 7/07 ___ctrl_G___ -- .byte $10 ; 8/08 ___ctrl_H___ -- .byte $D0 ; 9/09 ___ctrl_I___ -- .byte $50 ; 10/0a ___ctrl_J___ -- .byte $50 ; 11/0b ___ctrl_K___ -- .byte $50 ; 12/0c ___ctrl_L___ -- .byte $50 ; 13/0d ___ctrl_M___ -- .byte $10 ; 14/0e ___ctrl_N___ -- .byte $10 ; 15/0f ___ctrl_O___ -- .byte $10 ; 16/10 ___ctrl_P___ -- .byte $10 ; 17/11 ___ctrl_Q___ -- .byte $10 ; 18/12 ___ctrl_R___ -- .byte $10 ; 19/13 ___ctrl_S___ -- .byte $10 ; 20/14 ___ctrl_T___ -- .byte $10 ; 21/15 ___ctrl_U___ -- .byte $10 ; 22/16 ___ctrl_V___ -- .byte $10 ; 23/17 ___ctrl_W___ -- .byte $10 ; 24/18 ___ctrl_X___ -- .byte $10 ; 25/19 ___ctrl_Y___ -- .byte $10 ; 26/1a ___ctrl_Z___ -- .byte $10 ; 27/1b ___ctrl_[___ -- .byte $10 ; 28/1c ___ctrl_\___ -- .byte $10 ; 29/1d ___ctrl_]___ -- .byte $10 ; 30/1e ___ctrl_^___ -- .byte $10 ; 31/1f ___ctrl_____ -- .byte $A0 ; 32/20 ___SPACE___ -- .byte $00 ; 33/21 _____!_____ -- .byte $00 ; 34/22 _____"_____ -- .byte $00 ; 35/23 _____#_____ -- .byte $00 ; 36/24 _____$_____ -- .byte $00 ; 37/25 _____%_____ -- .byte $00 ; 38/26 _____&_____ -- .byte $00 ; 39/27 _____'_____ -- .byte $00 ; 40/28 _____(_____ -- .byte $00 ; 41/29 _____)_____ -- .byte $00 ; 42/2a _____*_____ -- .byte $00 ; 43/2b _____+_____ -- .byte $00 ; 44/2c _____,_____ -- .byte $00 ; 45/2d _____-_____ -- .byte $00 ; 46/2e _____._____ -- .byte $00 ; 47/2f _____/_____ -- .byte $0C ; 48/30 _____0_____ -- .byte $0C ; 49/31 _____1_____ -- .byte $0C ; 50/32 _____2_____ -- .byte $0C ; 51/33 _____3_____ -- .byte $0C ; 52/34 _____4_____ -- .byte $0C ; 53/35 _____5_____ -- .byte $0C ; 54/36 _____6_____ -- .byte $0C ; 55/37 _____7_____ -- .byte $0C ; 56/38 _____8_____ -- .byte $0C ; 57/39 _____9_____ -- .byte $00 ; 58/3a _____:_____ -- .byte $00 ; 59/3b _____;_____ -- .byte $00 ; 60/3c _____<_____ -- .byte $00 ; 61/3d _____=_____ -- .byte $00 ; 62/3e _____>_____ -- .byte $00 ; 63/3f _____?_____ -- -- .byte $00 ; 64/40 _____@_____ -- .byte $0A ; 65/41 _____A_____ -- .byte $0A ; 66/42 _____B_____ -- .byte $0A ; 67/43 _____C_____ -- .byte $0A ; 68/44 _____D_____ -- .byte $0A ; 69/45 _____E_____ -- .byte $0A ; 70/46 _____F_____ -- .byte $02 ; 71/47 _____G_____ -- .byte $02 ; 72/48 _____H_____ -- .byte $02 ; 73/49 _____I_____ -- .byte $02 ; 74/4a _____J_____ -- .byte $02 ; 75/4b _____K_____ -- .byte $02 ; 76/4c _____L_____ -- .byte $02 ; 77/4d _____M_____ -- .byte $02 ; 78/4e _____N_____ -- .byte $02 ; 79/4f _____O_____ -- .byte $02 ; 80/50 _____P_____ -- .byte $02 ; 81/51 _____Q_____ -- .byte $02 ; 82/52 _____R_____ -- .byte $02 ; 83/53 _____S_____ -- .byte $02 ; 84/54 _____T_____ -- .byte $02 ; 85/55 _____U_____ -- .byte $02 ; 86/56 _____V_____ -- .byte $02 ; 87/57 _____W_____ -- .byte $02 ; 88/58 _____X_____ -- .byte $02 ; 89/59 _____Y_____ -- .byte $02 ; 90/5a _____Z_____ -- .byte $00 ; 91/5b _____[_____ -- .byte $00 ; 92/5c _____\_____ -- .byte $00 ; 93/5d _____]_____ -- .byte $00 ; 94/5e _____^_____ -- .byte $00 ; 95/5f _UNDERLINE_ -- .byte $00 ; 96/60 ___grave___ -- .byte $09 ; 97/61 _____a_____ -- .byte $09 ; 98/62 _____b_____ -- .byte $09 ; 99/63 _____c_____ -- .byte $09 ; 100/64 _____d_____ -- .byte $09 ; 101/65 _____e_____ -- .byte $09 ; 102/66 _____f_____ -- .byte $01 ; 103/67 _____g_____ -- .byte $01 ; 104/68 _____h_____ -- .byte $01 ; 105/69 _____i_____ -- .byte $01 ; 106/6a _____j_____ -- .byte $01 ; 107/6b _____k_____ -- .byte $01 ; 108/6c _____l_____ -- .byte $01 ; 109/6d _____m_____ -- .byte $01 ; 110/6e _____n_____ -- .byte $01 ; 111/6f _____o_____ -- .byte $01 ; 112/70 _____p_____ -- .byte $01 ; 113/71 _____q_____ -- .byte $01 ; 114/72 _____r_____ -- .byte $01 ; 115/73 _____s_____ -- .byte $01 ; 116/74 _____t_____ -- .byte $01 ; 117/75 _____u_____ -- .byte $01 ; 118/76 _____v_____ -- .byte $01 ; 119/77 _____w_____ -- .byte $01 ; 120/78 _____x_____ -- .byte $01 ; 121/79 _____y_____ -- .byte $01 ; 122/7a _____z_____ -- .byte $00 ; 123/7b _____{_____ -- .byte $00 ; 124/7c _____|_____ -- .byte $00 ; 125/7d _____}_____ -- .byte $00 ; 126/7e _____~_____ -- .byte $40 ; 127/7f ____DEL____ -- --.endrepeat -+ .include "ctype_console.inc" -diff --git a/libsrc/none/ctype.s b/libsrc/none/ctype.s -index 35968f98..1301965e 100644 ---- a/libsrc/none/ctype.s -+++ b/libsrc/none/ctype.s -@@ -1,159 +1,5 @@ --; --; Ullrich von Bassewitz, 2003-10-10 --; - ; Character specification table. - ; -+; uses the "common" definition - -- .include "ctype.inc" -- --; The tables are readonly, put them into the rodata segment -- --.rodata -- --; The following 256 byte wide table specifies attributes for the isxxx type --; of functions. Doing it by a table means some overhead in space, but it --; has major advantages: --; --; * It is fast. If it weren't for the slow parameter passing of cc65, one --; could even define macros for the isxxx functions (this is usually --; done on other platforms). --; --; * It is highly portable. The only unportable part is the table itself, --; all real code goes into the common library. --; --; * We save some code in the isxxx functions. -- -- --__ctype: -- .byte CT_CTRL ; 0/00 ___ctrl_@___ -- .byte CT_CTRL ; 1/01 ___ctrl_A___ -- .byte CT_CTRL ; 2/02 ___ctrl_B___ -- .byte CT_CTRL ; 3/03 ___ctrl_C___ -- .byte CT_CTRL ; 4/04 ___ctrl_D___ -- .byte CT_CTRL ; 5/05 ___ctrl_E___ -- .byte CT_CTRL ; 6/06 ___ctrl_F___ -- .byte CT_CTRL ; 7/07 ___ctrl_G___ -- .byte CT_CTRL ; 8/08 ___ctrl_H___ -- .byte CT_CTRL | CT_OTHER_WS | CT_SPACE_TAB -- ; 9/09 ___ctrl_I___ -- .byte CT_CTRL | CT_OTHER_WS ; 10/0a ___ctrl_J___ -- .byte CT_CTRL | CT_OTHER_WS ; 11/0b ___ctrl_K___ -- .byte CT_CTRL | CT_OTHER_WS ; 12/0c ___ctrl_L___ -- .byte CT_CTRL | CT_OTHER_WS ; 13/0d ___ctrl_M___ -- .byte CT_CTRL ; 14/0e ___ctrl_N___ -- .byte CT_CTRL ; 15/0f ___ctrl_O___ -- .byte CT_CTRL ; 16/10 ___ctrl_P___ -- .byte CT_CTRL ; 17/11 ___ctrl_Q___ -- .byte CT_CTRL ; 18/12 ___ctrl_R___ -- .byte CT_CTRL ; 19/13 ___ctrl_S___ -- .byte CT_CTRL ; 20/14 ___ctrl_T___ -- .byte CT_CTRL ; 21/15 ___ctrl_U___ -- .byte CT_CTRL ; 22/16 ___ctrl_V___ -- .byte CT_CTRL ; 23/17 ___ctrl_W___ -- .byte CT_CTRL ; 24/18 ___ctrl_X___ -- .byte CT_CTRL ; 25/19 ___ctrl_Y___ -- .byte CT_CTRL ; 26/1a ___ctrl_Z___ -- .byte CT_CTRL ; 27/1b ___ctrl_[___ -- .byte CT_CTRL ; 28/1c ___ctrl_\___ -- .byte CT_CTRL ; 29/1d ___ctrl_]___ -- .byte CT_CTRL ; 30/1e ___ctrl_^___ -- .byte CT_CTRL ; 31/1f ___ctrl_____ -- .byte CT_SPACE | CT_SPACE_TAB ; 32/20 ___SPACE___ -- .byte CT_NONE ; 33/21 _____!_____ -- .byte CT_NONE ; 34/22 _____"_____ -- .byte CT_NONE ; 35/23 _____#_____ -- .byte CT_NONE ; 36/24 _____$_____ -- .byte CT_NONE ; 37/25 _____%_____ -- .byte CT_NONE ; 38/26 _____&_____ -- .byte CT_NONE ; 39/27 _____'_____ -- .byte CT_NONE ; 40/28 _____(_____ -- .byte CT_NONE ; 41/29 _____)_____ -- .byte CT_NONE ; 42/2a _____*_____ -- .byte CT_NONE ; 43/2b _____+_____ -- .byte CT_NONE ; 44/2c _____,_____ -- .byte CT_NONE ; 45/2d _____-_____ -- .byte CT_NONE ; 46/2e _____._____ -- .byte CT_NONE ; 47/2f _____/_____ -- .byte CT_DIGIT | CT_XDIGIT ; 48/30 _____0_____ -- .byte CT_DIGIT | CT_XDIGIT ; 49/31 _____1_____ -- .byte CT_DIGIT | CT_XDIGIT ; 50/32 _____2_____ -- .byte CT_DIGIT | CT_XDIGIT ; 51/33 _____3_____ -- .byte CT_DIGIT | CT_XDIGIT ; 52/34 _____4_____ -- .byte CT_DIGIT | CT_XDIGIT ; 53/35 _____5_____ -- .byte CT_DIGIT | CT_XDIGIT ; 54/36 _____6_____ -- .byte CT_DIGIT | CT_XDIGIT ; 55/37 _____7_____ -- .byte CT_DIGIT | CT_XDIGIT ; 56/38 _____8_____ -- .byte CT_DIGIT | CT_XDIGIT ; 57/39 _____9_____ -- .byte CT_NONE ; 58/3a _____:_____ -- .byte CT_NONE ; 59/3b _____;_____ -- .byte CT_NONE ; 60/3c _____<_____ -- .byte CT_NONE ; 61/3d _____=_____ -- .byte CT_NONE ; 62/3e _____>_____ -- .byte CT_NONE ; 63/3f _____?_____ -- -- .byte CT_NONE ; 64/40 _____@_____ -- .byte CT_UPPER | CT_XDIGIT ; 65/41 _____A_____ -- .byte CT_UPPER | CT_XDIGIT ; 66/42 _____B_____ -- .byte CT_UPPER | CT_XDIGIT ; 67/43 _____C_____ -- .byte CT_UPPER | CT_XDIGIT ; 68/44 _____D_____ -- .byte CT_UPPER | CT_XDIGIT ; 69/45 _____E_____ -- .byte CT_UPPER | CT_XDIGIT ; 70/46 _____F_____ -- .byte CT_UPPER ; 71/47 _____G_____ -- .byte CT_UPPER ; 72/48 _____H_____ -- .byte CT_UPPER ; 73/49 _____I_____ -- .byte CT_UPPER ; 74/4a _____J_____ -- .byte CT_UPPER ; 75/4b _____K_____ -- .byte CT_UPPER ; 76/4c _____L_____ -- .byte CT_UPPER ; 77/4d _____M_____ -- .byte CT_UPPER ; 78/4e _____N_____ -- .byte CT_UPPER ; 79/4f _____O_____ -- .byte CT_UPPER ; 80/50 _____P_____ -- .byte CT_UPPER ; 81/51 _____Q_____ -- .byte CT_UPPER ; 82/52 _____R_____ -- .byte CT_UPPER ; 83/53 _____S_____ -- .byte CT_UPPER ; 84/54 _____T_____ -- .byte CT_UPPER ; 85/55 _____U_____ -- .byte CT_UPPER ; 86/56 _____V_____ -- .byte CT_UPPER ; 87/57 _____W_____ -- .byte CT_UPPER ; 88/58 _____X_____ -- .byte CT_UPPER ; 89/59 _____Y_____ -- .byte CT_UPPER ; 90/5a _____Z_____ -- .byte CT_NONE ; 91/5b _____[_____ -- .byte CT_NONE ; 92/5c _____\_____ -- .byte CT_NONE ; 93/5d _____]_____ -- .byte CT_NONE ; 94/5e _____^_____ -- .byte CT_NONE ; 95/5f _UNDERLINE_ -- .byte CT_NONE ; 96/60 ___grave___ -- .byte CT_LOWER | CT_XDIGIT ; 97/61 _____a_____ -- .byte CT_LOWER | CT_XDIGIT ; 98/62 _____b_____ -- .byte CT_LOWER | CT_XDIGIT ; 99/63 _____c_____ -- .byte CT_LOWER | CT_XDIGIT ; 100/64 _____d_____ -- .byte CT_LOWER | CT_XDIGIT ; 101/65 _____e_____ -- .byte CT_LOWER | CT_XDIGIT ; 102/66 _____f_____ -- .byte CT_LOWER ; 103/67 _____g_____ -- .byte CT_LOWER ; 104/68 _____h_____ -- .byte CT_LOWER ; 105/69 _____i_____ -- .byte CT_LOWER ; 106/6a _____j_____ -- .byte CT_LOWER ; 107/6b _____k_____ -- .byte CT_LOWER ; 108/6c _____l_____ -- .byte CT_LOWER ; 109/6d _____m_____ -- .byte CT_LOWER ; 110/6e _____n_____ -- .byte CT_LOWER ; 111/6f _____o_____ -- .byte CT_LOWER ; 112/70 _____p_____ -- .byte CT_LOWER ; 113/71 _____q_____ -- .byte CT_LOWER ; 114/72 _____r_____ -- .byte CT_LOWER ; 115/73 _____s_____ -- .byte CT_LOWER ; 116/74 _____t_____ -- .byte CT_LOWER ; 117/75 _____u_____ -- .byte CT_LOWER ; 118/76 _____v_____ -- .byte CT_LOWER ; 119/77 _____w_____ -- .byte CT_LOWER ; 120/78 _____x_____ -- .byte CT_LOWER ; 121/79 _____y_____ -- .byte CT_LOWER ; 122/7a _____z_____ -- .byte CT_NONE ; 123/7b _____{_____ -- .byte CT_NONE ; 124/7c _____|_____ -- .byte CT_NONE ; 125/7d _____}_____ -- .byte CT_NONE ; 126/7e _____~_____ -- .byte CT_OTHER_WS ; 127/7f ____DEL____ -- -- .res 128, CT_NONE ; 128-255 -+ .include "ctype_common.inc" -diff --git a/libsrc/osic1p/ctype.s b/libsrc/osic1p/ctype.s -index 35968f98..1301965e 100644 ---- a/libsrc/osic1p/ctype.s -+++ b/libsrc/osic1p/ctype.s -@@ -1,159 +1,5 @@ --; --; Ullrich von Bassewitz, 2003-10-10 --; - ; Character specification table. - ; -+; uses the "common" definition - -- .include "ctype.inc" -- --; The tables are readonly, put them into the rodata segment -- --.rodata -- --; The following 256 byte wide table specifies attributes for the isxxx type --; of functions. Doing it by a table means some overhead in space, but it --; has major advantages: --; --; * It is fast. If it weren't for the slow parameter passing of cc65, one --; could even define macros for the isxxx functions (this is usually --; done on other platforms). --; --; * It is highly portable. The only unportable part is the table itself, --; all real code goes into the common library. --; --; * We save some code in the isxxx functions. -- -- --__ctype: -- .byte CT_CTRL ; 0/00 ___ctrl_@___ -- .byte CT_CTRL ; 1/01 ___ctrl_A___ -- .byte CT_CTRL ; 2/02 ___ctrl_B___ -- .byte CT_CTRL ; 3/03 ___ctrl_C___ -- .byte CT_CTRL ; 4/04 ___ctrl_D___ -- .byte CT_CTRL ; 5/05 ___ctrl_E___ -- .byte CT_CTRL ; 6/06 ___ctrl_F___ -- .byte CT_CTRL ; 7/07 ___ctrl_G___ -- .byte CT_CTRL ; 8/08 ___ctrl_H___ -- .byte CT_CTRL | CT_OTHER_WS | CT_SPACE_TAB -- ; 9/09 ___ctrl_I___ -- .byte CT_CTRL | CT_OTHER_WS ; 10/0a ___ctrl_J___ -- .byte CT_CTRL | CT_OTHER_WS ; 11/0b ___ctrl_K___ -- .byte CT_CTRL | CT_OTHER_WS ; 12/0c ___ctrl_L___ -- .byte CT_CTRL | CT_OTHER_WS ; 13/0d ___ctrl_M___ -- .byte CT_CTRL ; 14/0e ___ctrl_N___ -- .byte CT_CTRL ; 15/0f ___ctrl_O___ -- .byte CT_CTRL ; 16/10 ___ctrl_P___ -- .byte CT_CTRL ; 17/11 ___ctrl_Q___ -- .byte CT_CTRL ; 18/12 ___ctrl_R___ -- .byte CT_CTRL ; 19/13 ___ctrl_S___ -- .byte CT_CTRL ; 20/14 ___ctrl_T___ -- .byte CT_CTRL ; 21/15 ___ctrl_U___ -- .byte CT_CTRL ; 22/16 ___ctrl_V___ -- .byte CT_CTRL ; 23/17 ___ctrl_W___ -- .byte CT_CTRL ; 24/18 ___ctrl_X___ -- .byte CT_CTRL ; 25/19 ___ctrl_Y___ -- .byte CT_CTRL ; 26/1a ___ctrl_Z___ -- .byte CT_CTRL ; 27/1b ___ctrl_[___ -- .byte CT_CTRL ; 28/1c ___ctrl_\___ -- .byte CT_CTRL ; 29/1d ___ctrl_]___ -- .byte CT_CTRL ; 30/1e ___ctrl_^___ -- .byte CT_CTRL ; 31/1f ___ctrl_____ -- .byte CT_SPACE | CT_SPACE_TAB ; 32/20 ___SPACE___ -- .byte CT_NONE ; 33/21 _____!_____ -- .byte CT_NONE ; 34/22 _____"_____ -- .byte CT_NONE ; 35/23 _____#_____ -- .byte CT_NONE ; 36/24 _____$_____ -- .byte CT_NONE ; 37/25 _____%_____ -- .byte CT_NONE ; 38/26 _____&_____ -- .byte CT_NONE ; 39/27 _____'_____ -- .byte CT_NONE ; 40/28 _____(_____ -- .byte CT_NONE ; 41/29 _____)_____ -- .byte CT_NONE ; 42/2a _____*_____ -- .byte CT_NONE ; 43/2b _____+_____ -- .byte CT_NONE ; 44/2c _____,_____ -- .byte CT_NONE ; 45/2d _____-_____ -- .byte CT_NONE ; 46/2e _____._____ -- .byte CT_NONE ; 47/2f _____/_____ -- .byte CT_DIGIT | CT_XDIGIT ; 48/30 _____0_____ -- .byte CT_DIGIT | CT_XDIGIT ; 49/31 _____1_____ -- .byte CT_DIGIT | CT_XDIGIT ; 50/32 _____2_____ -- .byte CT_DIGIT | CT_XDIGIT ; 51/33 _____3_____ -- .byte CT_DIGIT | CT_XDIGIT ; 52/34 _____4_____ -- .byte CT_DIGIT | CT_XDIGIT ; 53/35 _____5_____ -- .byte CT_DIGIT | CT_XDIGIT ; 54/36 _____6_____ -- .byte CT_DIGIT | CT_XDIGIT ; 55/37 _____7_____ -- .byte CT_DIGIT | CT_XDIGIT ; 56/38 _____8_____ -- .byte CT_DIGIT | CT_XDIGIT ; 57/39 _____9_____ -- .byte CT_NONE ; 58/3a _____:_____ -- .byte CT_NONE ; 59/3b _____;_____ -- .byte CT_NONE ; 60/3c _____<_____ -- .byte CT_NONE ; 61/3d _____=_____ -- .byte CT_NONE ; 62/3e _____>_____ -- .byte CT_NONE ; 63/3f _____?_____ -- -- .byte CT_NONE ; 64/40 _____@_____ -- .byte CT_UPPER | CT_XDIGIT ; 65/41 _____A_____ -- .byte CT_UPPER | CT_XDIGIT ; 66/42 _____B_____ -- .byte CT_UPPER | CT_XDIGIT ; 67/43 _____C_____ -- .byte CT_UPPER | CT_XDIGIT ; 68/44 _____D_____ -- .byte CT_UPPER | CT_XDIGIT ; 69/45 _____E_____ -- .byte CT_UPPER | CT_XDIGIT ; 70/46 _____F_____ -- .byte CT_UPPER ; 71/47 _____G_____ -- .byte CT_UPPER ; 72/48 _____H_____ -- .byte CT_UPPER ; 73/49 _____I_____ -- .byte CT_UPPER ; 74/4a _____J_____ -- .byte CT_UPPER ; 75/4b _____K_____ -- .byte CT_UPPER ; 76/4c _____L_____ -- .byte CT_UPPER ; 77/4d _____M_____ -- .byte CT_UPPER ; 78/4e _____N_____ -- .byte CT_UPPER ; 79/4f _____O_____ -- .byte CT_UPPER ; 80/50 _____P_____ -- .byte CT_UPPER ; 81/51 _____Q_____ -- .byte CT_UPPER ; 82/52 _____R_____ -- .byte CT_UPPER ; 83/53 _____S_____ -- .byte CT_UPPER ; 84/54 _____T_____ -- .byte CT_UPPER ; 85/55 _____U_____ -- .byte CT_UPPER ; 86/56 _____V_____ -- .byte CT_UPPER ; 87/57 _____W_____ -- .byte CT_UPPER ; 88/58 _____X_____ -- .byte CT_UPPER ; 89/59 _____Y_____ -- .byte CT_UPPER ; 90/5a _____Z_____ -- .byte CT_NONE ; 91/5b _____[_____ -- .byte CT_NONE ; 92/5c _____\_____ -- .byte CT_NONE ; 93/5d _____]_____ -- .byte CT_NONE ; 94/5e _____^_____ -- .byte CT_NONE ; 95/5f _UNDERLINE_ -- .byte CT_NONE ; 96/60 ___grave___ -- .byte CT_LOWER | CT_XDIGIT ; 97/61 _____a_____ -- .byte CT_LOWER | CT_XDIGIT ; 98/62 _____b_____ -- .byte CT_LOWER | CT_XDIGIT ; 99/63 _____c_____ -- .byte CT_LOWER | CT_XDIGIT ; 100/64 _____d_____ -- .byte CT_LOWER | CT_XDIGIT ; 101/65 _____e_____ -- .byte CT_LOWER | CT_XDIGIT ; 102/66 _____f_____ -- .byte CT_LOWER ; 103/67 _____g_____ -- .byte CT_LOWER ; 104/68 _____h_____ -- .byte CT_LOWER ; 105/69 _____i_____ -- .byte CT_LOWER ; 106/6a _____j_____ -- .byte CT_LOWER ; 107/6b _____k_____ -- .byte CT_LOWER ; 108/6c _____l_____ -- .byte CT_LOWER ; 109/6d _____m_____ -- .byte CT_LOWER ; 110/6e _____n_____ -- .byte CT_LOWER ; 111/6f _____o_____ -- .byte CT_LOWER ; 112/70 _____p_____ -- .byte CT_LOWER ; 113/71 _____q_____ -- .byte CT_LOWER ; 114/72 _____r_____ -- .byte CT_LOWER ; 115/73 _____s_____ -- .byte CT_LOWER ; 116/74 _____t_____ -- .byte CT_LOWER ; 117/75 _____u_____ -- .byte CT_LOWER ; 118/76 _____v_____ -- .byte CT_LOWER ; 119/77 _____w_____ -- .byte CT_LOWER ; 120/78 _____x_____ -- .byte CT_LOWER ; 121/79 _____y_____ -- .byte CT_LOWER ; 122/7a _____z_____ -- .byte CT_NONE ; 123/7b _____{_____ -- .byte CT_NONE ; 124/7c _____|_____ -- .byte CT_NONE ; 125/7d _____}_____ -- .byte CT_NONE ; 126/7e _____~_____ -- .byte CT_OTHER_WS ; 127/7f ____DEL____ -- -- .res 128, CT_NONE ; 128-255 -+ .include "ctype_common.inc" -diff --git a/libsrc/pce/ctype.s b/libsrc/pce/ctype.s -index 1ee51b23..da4d3847 100644 ---- a/libsrc/pce/ctype.s -+++ b/libsrc/pce/ctype.s -@@ -1,158 +1,5 @@ --; --; Stefan Haubenthal with minor changes from Ullrich von Bassewitz, 2003-05-02 --; - ; Character specification table. - ; -+; uses the "console" definition - -- .include "ctype.inc" -- --; The tables are read-only; put them into the RODATA segment. -- --.rodata -- --; The following 256-byte-wide table specifies attributes for the isxxx type --; of functions. Doing it by a table means some overhead in space, but it --; has major advantages: --; --; * It is fast. If it weren't for the slow parameter passing of cc65, one --; could even define macros for the isxxx functions (this is usually --; done on other platforms). --; --; * It is highly portable. The only unportable part is the table itself, --; all real code goes into the common library. --; --; * We save some code in the isxxx functions. -- --__ctype: -- .repeat 2 -- .byte CT_CTRL ; 0/00 ___ctrl_@___ -- .byte CT_CTRL ; 1/01 ___ctrl_A___ -- .byte CT_CTRL ; 2/02 ___ctrl_B___ -- .byte CT_CTRL ; 3/03 ___ctrl_C___ -- .byte CT_CTRL ; 4/04 ___ctrl_D___ -- .byte CT_CTRL ; 5/05 ___ctrl_E___ -- .byte CT_CTRL ; 6/06 ___ctrl_F___ -- .byte CT_CTRL ; 7/07 ___ctrl_G___ -- .byte CT_CTRL ; 8/08 ___ctrl_H___ -- .byte CT_CTRL | CT_OTHER_WS | CT_SPACE_TAB -- ; 9/09 ___ctrl_I___ -- .byte CT_CTRL | CT_OTHER_WS ; 10/0a ___ctrl_J___ -- .byte CT_CTRL | CT_OTHER_WS ; 11/0b ___ctrl_K___ -- .byte CT_CTRL | CT_OTHER_WS ; 12/0c ___ctrl_L___ -- .byte CT_CTRL | CT_OTHER_WS ; 13/0d ___ctrl_M___ -- .byte CT_CTRL ; 14/0e ___ctrl_N___ -- .byte CT_CTRL ; 15/0f ___ctrl_O___ -- .byte CT_CTRL ; 16/10 ___ctrl_P___ -- .byte CT_CTRL ; 17/11 ___ctrl_Q___ -- .byte CT_CTRL ; 18/12 ___ctrl_R___ -- .byte CT_CTRL ; 19/13 ___ctrl_S___ -- .byte CT_CTRL ; 20/14 ___ctrl_T___ -- .byte CT_CTRL ; 21/15 ___ctrl_U___ -- .byte CT_CTRL ; 22/16 ___ctrl_V___ -- .byte CT_CTRL ; 23/17 ___ctrl_W___ -- .byte CT_CTRL ; 24/18 ___ctrl_X___ -- .byte CT_CTRL ; 25/19 ___ctrl_Y___ -- .byte CT_CTRL ; 26/1a ___ctrl_Z___ -- .byte CT_CTRL ; 27/1b ___ctrl_[___ -- .byte CT_CTRL ; 28/1c ___ctrl_\___ -- .byte CT_CTRL ; 29/1d ___ctrl_]___ -- .byte CT_CTRL ; 30/1e ___ctrl_^___ -- .byte CT_CTRL ; 31/1f ___ctrl_____ -- .byte CT_SPACE | CT_SPACE_TAB ; 32/20 ___SPACE___ -- .byte CT_NONE ; 33/21 _____!_____ -- .byte CT_NONE ; 34/22 _____"_____ -- .byte CT_NONE ; 35/23 _____#_____ -- .byte CT_NONE ; 36/24 _____$_____ -- .byte CT_NONE ; 37/25 _____%_____ -- .byte CT_NONE ; 38/26 _____&_____ -- .byte CT_NONE ; 39/27 _____'_____ -- .byte CT_NONE ; 40/28 _____(_____ -- .byte CT_NONE ; 41/29 _____)_____ -- .byte CT_NONE ; 42/2a _____*_____ -- .byte CT_NONE ; 43/2b _____+_____ -- .byte CT_NONE ; 44/2c _____,_____ -- .byte CT_NONE ; 45/2d _____-_____ -- .byte CT_NONE ; 46/2e _____._____ -- .byte CT_NONE ; 47/2f _____/_____ -- .byte CT_DIGIT | CT_XDIGIT ; 48/30 _____0_____ -- .byte CT_DIGIT | CT_XDIGIT ; 49/31 _____1_____ -- .byte CT_DIGIT | CT_XDIGIT ; 50/32 _____2_____ -- .byte CT_DIGIT | CT_XDIGIT ; 51/33 _____3_____ -- .byte CT_DIGIT | CT_XDIGIT ; 52/34 _____4_____ -- .byte CT_DIGIT | CT_XDIGIT ; 53/35 _____5_____ -- .byte CT_DIGIT | CT_XDIGIT ; 54/36 _____6_____ -- .byte CT_DIGIT | CT_XDIGIT ; 55/37 _____7_____ -- .byte CT_DIGIT | CT_XDIGIT ; 56/38 _____8_____ -- .byte CT_DIGIT | CT_XDIGIT ; 57/39 _____9_____ -- .byte CT_NONE ; 58/3a _____:_____ -- .byte CT_NONE ; 59/3b _____;_____ -- .byte CT_NONE ; 60/3c _____<_____ -- .byte CT_NONE ; 61/3d _____=_____ -- .byte CT_NONE ; 62/3e _____>_____ -- .byte CT_NONE ; 63/3f _____?_____ -- -- .byte CT_NONE ; 64/40 _____@_____ -- .byte CT_UPPER | CT_XDIGIT ; 65/41 _____A_____ -- .byte CT_UPPER | CT_XDIGIT ; 66/42 _____B_____ -- .byte CT_UPPER | CT_XDIGIT ; 67/43 _____C_____ -- .byte CT_UPPER | CT_XDIGIT ; 68/44 _____D_____ -- .byte CT_UPPER | CT_XDIGIT ; 69/45 _____E_____ -- .byte CT_UPPER | CT_XDIGIT ; 70/46 _____F_____ -- .byte CT_UPPER ; 71/47 _____G_____ -- .byte CT_UPPER ; 72/48 _____H_____ -- .byte CT_UPPER ; 73/49 _____I_____ -- .byte CT_UPPER ; 74/4a _____J_____ -- .byte CT_UPPER ; 75/4b _____K_____ -- .byte CT_UPPER ; 76/4c _____L_____ -- .byte CT_UPPER ; 77/4d _____M_____ -- .byte CT_UPPER ; 78/4e _____N_____ -- .byte CT_UPPER ; 79/4f _____O_____ -- .byte CT_UPPER ; 80/50 _____P_____ -- .byte CT_UPPER ; 81/51 _____Q_____ -- .byte CT_UPPER ; 82/52 _____R_____ -- .byte CT_UPPER ; 83/53 _____S_____ -- .byte CT_UPPER ; 84/54 _____T_____ -- .byte CT_UPPER ; 85/55 _____U_____ -- .byte CT_UPPER ; 86/56 _____V_____ -- .byte CT_UPPER ; 87/57 _____W_____ -- .byte CT_UPPER ; 88/58 _____X_____ -- .byte CT_UPPER ; 89/59 _____Y_____ -- .byte CT_UPPER ; 90/5a _____Z_____ -- .byte CT_NONE ; 91/5b _____[_____ -- .byte CT_NONE ; 92/5c _____\_____ -- .byte CT_NONE ; 93/5d _____]_____ -- .byte CT_NONE ; 94/5e _____^_____ -- .byte CT_NONE ; 95/5f _UNDERLINE_ -- .byte CT_NONE ; 96/60 ___grave___ -- .byte CT_LOWER | CT_XDIGIT ; 97/61 _____a_____ -- .byte CT_LOWER | CT_XDIGIT ; 98/62 _____b_____ -- .byte CT_LOWER | CT_XDIGIT ; 99/63 _____c_____ -- .byte CT_LOWER | CT_XDIGIT ; 100/64 _____d_____ -- .byte CT_LOWER | CT_XDIGIT ; 101/65 _____e_____ -- .byte CT_LOWER | CT_XDIGIT ; 102/66 _____f_____ -- .byte CT_LOWER ; 103/67 _____g_____ -- .byte CT_LOWER ; 104/68 _____h_____ -- .byte CT_LOWER ; 105/69 _____i_____ -- .byte CT_LOWER ; 106/6a _____j_____ -- .byte CT_LOWER ; 107/6b _____k_____ -- .byte CT_LOWER ; 108/6c _____l_____ -- .byte CT_LOWER ; 109/6d _____m_____ -- .byte CT_LOWER ; 110/6e _____n_____ -- .byte CT_LOWER ; 111/6f _____o_____ -- .byte CT_LOWER ; 112/70 _____p_____ -- .byte CT_LOWER ; 113/71 _____q_____ -- .byte CT_LOWER ; 114/72 _____r_____ -- .byte CT_LOWER ; 115/73 _____s_____ -- .byte CT_LOWER ; 116/74 _____t_____ -- .byte CT_LOWER ; 117/75 _____u_____ -- .byte CT_LOWER ; 118/76 _____v_____ -- .byte CT_LOWER ; 119/77 _____w_____ -- .byte CT_LOWER ; 120/78 _____x_____ -- .byte CT_LOWER ; 121/79 _____y_____ -- .byte CT_LOWER ; 122/7a _____z_____ -- .byte CT_NONE ; 123/7b _____{_____ -- .byte CT_NONE ; 124/7c _____|_____ -- .byte CT_NONE ; 125/7d _____}_____ -- .byte CT_NONE ; 126/7e _____~_____ -- .byte CT_OTHER_WS ; 127/7f ____DEL____ -- .endrepeat -+ .include "ctype_console.inc" -diff --git a/libsrc/sim6502/ctype.s b/libsrc/sim6502/ctype.s -index 35968f98..1301965e 100644 ---- a/libsrc/sim6502/ctype.s -+++ b/libsrc/sim6502/ctype.s -@@ -1,159 +1,5 @@ --; --; Ullrich von Bassewitz, 2003-10-10 --; - ; Character specification table. - ; -+; uses the "common" definition - -- .include "ctype.inc" -- --; The tables are readonly, put them into the rodata segment -- --.rodata -- --; The following 256 byte wide table specifies attributes for the isxxx type --; of functions. Doing it by a table means some overhead in space, but it --; has major advantages: --; --; * It is fast. If it weren't for the slow parameter passing of cc65, one --; could even define macros for the isxxx functions (this is usually --; done on other platforms). --; --; * It is highly portable. The only unportable part is the table itself, --; all real code goes into the common library. --; --; * We save some code in the isxxx functions. -- -- --__ctype: -- .byte CT_CTRL ; 0/00 ___ctrl_@___ -- .byte CT_CTRL ; 1/01 ___ctrl_A___ -- .byte CT_CTRL ; 2/02 ___ctrl_B___ -- .byte CT_CTRL ; 3/03 ___ctrl_C___ -- .byte CT_CTRL ; 4/04 ___ctrl_D___ -- .byte CT_CTRL ; 5/05 ___ctrl_E___ -- .byte CT_CTRL ; 6/06 ___ctrl_F___ -- .byte CT_CTRL ; 7/07 ___ctrl_G___ -- .byte CT_CTRL ; 8/08 ___ctrl_H___ -- .byte CT_CTRL | CT_OTHER_WS | CT_SPACE_TAB -- ; 9/09 ___ctrl_I___ -- .byte CT_CTRL | CT_OTHER_WS ; 10/0a ___ctrl_J___ -- .byte CT_CTRL | CT_OTHER_WS ; 11/0b ___ctrl_K___ -- .byte CT_CTRL | CT_OTHER_WS ; 12/0c ___ctrl_L___ -- .byte CT_CTRL | CT_OTHER_WS ; 13/0d ___ctrl_M___ -- .byte CT_CTRL ; 14/0e ___ctrl_N___ -- .byte CT_CTRL ; 15/0f ___ctrl_O___ -- .byte CT_CTRL ; 16/10 ___ctrl_P___ -- .byte CT_CTRL ; 17/11 ___ctrl_Q___ -- .byte CT_CTRL ; 18/12 ___ctrl_R___ -- .byte CT_CTRL ; 19/13 ___ctrl_S___ -- .byte CT_CTRL ; 20/14 ___ctrl_T___ -- .byte CT_CTRL ; 21/15 ___ctrl_U___ -- .byte CT_CTRL ; 22/16 ___ctrl_V___ -- .byte CT_CTRL ; 23/17 ___ctrl_W___ -- .byte CT_CTRL ; 24/18 ___ctrl_X___ -- .byte CT_CTRL ; 25/19 ___ctrl_Y___ -- .byte CT_CTRL ; 26/1a ___ctrl_Z___ -- .byte CT_CTRL ; 27/1b ___ctrl_[___ -- .byte CT_CTRL ; 28/1c ___ctrl_\___ -- .byte CT_CTRL ; 29/1d ___ctrl_]___ -- .byte CT_CTRL ; 30/1e ___ctrl_^___ -- .byte CT_CTRL ; 31/1f ___ctrl_____ -- .byte CT_SPACE | CT_SPACE_TAB ; 32/20 ___SPACE___ -- .byte CT_NONE ; 33/21 _____!_____ -- .byte CT_NONE ; 34/22 _____"_____ -- .byte CT_NONE ; 35/23 _____#_____ -- .byte CT_NONE ; 36/24 _____$_____ -- .byte CT_NONE ; 37/25 _____%_____ -- .byte CT_NONE ; 38/26 _____&_____ -- .byte CT_NONE ; 39/27 _____'_____ -- .byte CT_NONE ; 40/28 _____(_____ -- .byte CT_NONE ; 41/29 _____)_____ -- .byte CT_NONE ; 42/2a _____*_____ -- .byte CT_NONE ; 43/2b _____+_____ -- .byte CT_NONE ; 44/2c _____,_____ -- .byte CT_NONE ; 45/2d _____-_____ -- .byte CT_NONE ; 46/2e _____._____ -- .byte CT_NONE ; 47/2f _____/_____ -- .byte CT_DIGIT | CT_XDIGIT ; 48/30 _____0_____ -- .byte CT_DIGIT | CT_XDIGIT ; 49/31 _____1_____ -- .byte CT_DIGIT | CT_XDIGIT ; 50/32 _____2_____ -- .byte CT_DIGIT | CT_XDIGIT ; 51/33 _____3_____ -- .byte CT_DIGIT | CT_XDIGIT ; 52/34 _____4_____ -- .byte CT_DIGIT | CT_XDIGIT ; 53/35 _____5_____ -- .byte CT_DIGIT | CT_XDIGIT ; 54/36 _____6_____ -- .byte CT_DIGIT | CT_XDIGIT ; 55/37 _____7_____ -- .byte CT_DIGIT | CT_XDIGIT ; 56/38 _____8_____ -- .byte CT_DIGIT | CT_XDIGIT ; 57/39 _____9_____ -- .byte CT_NONE ; 58/3a _____:_____ -- .byte CT_NONE ; 59/3b _____;_____ -- .byte CT_NONE ; 60/3c _____<_____ -- .byte CT_NONE ; 61/3d _____=_____ -- .byte CT_NONE ; 62/3e _____>_____ -- .byte CT_NONE ; 63/3f _____?_____ -- -- .byte CT_NONE ; 64/40 _____@_____ -- .byte CT_UPPER | CT_XDIGIT ; 65/41 _____A_____ -- .byte CT_UPPER | CT_XDIGIT ; 66/42 _____B_____ -- .byte CT_UPPER | CT_XDIGIT ; 67/43 _____C_____ -- .byte CT_UPPER | CT_XDIGIT ; 68/44 _____D_____ -- .byte CT_UPPER | CT_XDIGIT ; 69/45 _____E_____ -- .byte CT_UPPER | CT_XDIGIT ; 70/46 _____F_____ -- .byte CT_UPPER ; 71/47 _____G_____ -- .byte CT_UPPER ; 72/48 _____H_____ -- .byte CT_UPPER ; 73/49 _____I_____ -- .byte CT_UPPER ; 74/4a _____J_____ -- .byte CT_UPPER ; 75/4b _____K_____ -- .byte CT_UPPER ; 76/4c _____L_____ -- .byte CT_UPPER ; 77/4d _____M_____ -- .byte CT_UPPER ; 78/4e _____N_____ -- .byte CT_UPPER ; 79/4f _____O_____ -- .byte CT_UPPER ; 80/50 _____P_____ -- .byte CT_UPPER ; 81/51 _____Q_____ -- .byte CT_UPPER ; 82/52 _____R_____ -- .byte CT_UPPER ; 83/53 _____S_____ -- .byte CT_UPPER ; 84/54 _____T_____ -- .byte CT_UPPER ; 85/55 _____U_____ -- .byte CT_UPPER ; 86/56 _____V_____ -- .byte CT_UPPER ; 87/57 _____W_____ -- .byte CT_UPPER ; 88/58 _____X_____ -- .byte CT_UPPER ; 89/59 _____Y_____ -- .byte CT_UPPER ; 90/5a _____Z_____ -- .byte CT_NONE ; 91/5b _____[_____ -- .byte CT_NONE ; 92/5c _____\_____ -- .byte CT_NONE ; 93/5d _____]_____ -- .byte CT_NONE ; 94/5e _____^_____ -- .byte CT_NONE ; 95/5f _UNDERLINE_ -- .byte CT_NONE ; 96/60 ___grave___ -- .byte CT_LOWER | CT_XDIGIT ; 97/61 _____a_____ -- .byte CT_LOWER | CT_XDIGIT ; 98/62 _____b_____ -- .byte CT_LOWER | CT_XDIGIT ; 99/63 _____c_____ -- .byte CT_LOWER | CT_XDIGIT ; 100/64 _____d_____ -- .byte CT_LOWER | CT_XDIGIT ; 101/65 _____e_____ -- .byte CT_LOWER | CT_XDIGIT ; 102/66 _____f_____ -- .byte CT_LOWER ; 103/67 _____g_____ -- .byte CT_LOWER ; 104/68 _____h_____ -- .byte CT_LOWER ; 105/69 _____i_____ -- .byte CT_LOWER ; 106/6a _____j_____ -- .byte CT_LOWER ; 107/6b _____k_____ -- .byte CT_LOWER ; 108/6c _____l_____ -- .byte CT_LOWER ; 109/6d _____m_____ -- .byte CT_LOWER ; 110/6e _____n_____ -- .byte CT_LOWER ; 111/6f _____o_____ -- .byte CT_LOWER ; 112/70 _____p_____ -- .byte CT_LOWER ; 113/71 _____q_____ -- .byte CT_LOWER ; 114/72 _____r_____ -- .byte CT_LOWER ; 115/73 _____s_____ -- .byte CT_LOWER ; 116/74 _____t_____ -- .byte CT_LOWER ; 117/75 _____u_____ -- .byte CT_LOWER ; 118/76 _____v_____ -- .byte CT_LOWER ; 119/77 _____w_____ -- .byte CT_LOWER ; 120/78 _____x_____ -- .byte CT_LOWER ; 121/79 _____y_____ -- .byte CT_LOWER ; 122/7a _____z_____ -- .byte CT_NONE ; 123/7b _____{_____ -- .byte CT_NONE ; 124/7c _____|_____ -- .byte CT_NONE ; 125/7d _____}_____ -- .byte CT_NONE ; 126/7e _____~_____ -- .byte CT_OTHER_WS ; 127/7f ____DEL____ -- -- .res 128, CT_NONE ; 128-255 -+ .include "ctype_common.inc" -diff --git a/libsrc/supervision/ctype.s b/libsrc/supervision/ctype.s -index 1892554f..1301965e 100644 ---- a/libsrc/supervision/ctype.s -+++ b/libsrc/supervision/ctype.s -@@ -1,162 +1,5 @@ --; --; Ullrich von Bassewitz, 2003-10-10 --; - ; Character specification table. - ; -+; uses the "common" definition - -- .include "ctype.inc" -- --; The tables are readonly, put them into the rodata segment -- --.rodata -- --; The following 256 byte wide table specifies attributes for the isxxx type --; of functions. Doing it by a table means some overhead in space, but it --; has major advantages: --; --; * It is fast. If it weren't for the slow parameter passing of cc65, one --; could even define macros for the isxxx functions (this is usually --; done on other platforms). --; --; * It is highly portable. The only unportable part is the table itself, --; all real code goes into the common library. --; --; * We save some code in the isxxx functions. -- -- --__ctype: -- .byte CT_CTRL ; 0/00 ___ctrl_@___ -- .byte CT_CTRL ; 1/01 ___ctrl_A___ -- .byte CT_CTRL ; 2/02 ___ctrl_B___ -- .byte CT_CTRL ; 3/03 ___ctrl_C___ -- .byte CT_CTRL ; 4/04 ___ctrl_D___ -- .byte CT_CTRL ; 5/05 ___ctrl_E___ -- .byte CT_CTRL ; 6/06 ___ctrl_F___ -- .byte CT_CTRL ; 7/07 ___ctrl_G___ -- .byte CT_CTRL ; 8/08 ___ctrl_H___ -- .byte CT_CTRL | CT_OTHER_WS | CT_SPACE_TAB -- ; 9/09 ___ctrl_I___ -- .byte CT_CTRL | CT_OTHER_WS ; 10/0a ___ctrl_J___ -- .byte CT_CTRL | CT_OTHER_WS ; 11/0b ___ctrl_K___ -- .byte CT_CTRL | CT_OTHER_WS ; 12/0c ___ctrl_L___ -- .byte CT_CTRL | CT_OTHER_WS ; 13/0d ___ctrl_M___ -- .byte CT_CTRL ; 14/0e ___ctrl_N___ -- .byte CT_CTRL ; 15/0f ___ctrl_O___ -- .byte CT_CTRL ; 16/10 ___ctrl_P___ -- .byte CT_CTRL ; 17/11 ___ctrl_Q___ -- .byte CT_CTRL ; 18/12 ___ctrl_R___ -- .byte CT_CTRL ; 19/13 ___ctrl_S___ -- .byte CT_CTRL ; 20/14 ___ctrl_T___ -- .byte CT_CTRL ; 21/15 ___ctrl_U___ -- .byte CT_CTRL ; 22/16 ___ctrl_V___ -- .byte CT_CTRL ; 23/17 ___ctrl_W___ -- .byte CT_CTRL ; 24/18 ___ctrl_X___ -- .byte CT_CTRL ; 25/19 ___ctrl_Y___ -- .byte CT_CTRL ; 26/1a ___ctrl_Z___ -- .byte CT_CTRL ; 27/1b ___ctrl_[___ -- .byte CT_CTRL ; 28/1c ___ctrl_\___ -- .byte CT_CTRL ; 29/1d ___ctrl_]___ -- .byte CT_CTRL ; 30/1e ___ctrl_^___ -- .byte CT_CTRL ; 31/1f ___ctrl_____ -- .byte CT_SPACE | CT_SPACE_TAB ; 32/20 ___SPACE___ -- .byte CT_NONE ; 33/21 _____!_____ -- .byte CT_NONE ; 34/22 _____"_____ -- .byte CT_NONE ; 35/23 _____#_____ -- .byte CT_NONE ; 36/24 _____$_____ -- .byte CT_NONE ; 37/25 _____%_____ -- .byte CT_NONE ; 38/26 _____&_____ -- .byte CT_NONE ; 39/27 _____'_____ -- .byte CT_NONE ; 40/28 _____(_____ -- .byte CT_NONE ; 41/29 _____)_____ -- .byte CT_NONE ; 42/2a _____*_____ -- .byte CT_NONE ; 43/2b _____+_____ -- .byte CT_NONE ; 44/2c _____,_____ -- .byte CT_NONE ; 45/2d _____-_____ -- .byte CT_NONE ; 46/2e _____._____ -- .byte CT_NONE ; 47/2f _____/_____ -- .byte CT_DIGIT | CT_XDIGIT ; 48/30 _____0_____ -- .byte CT_DIGIT | CT_XDIGIT ; 49/31 _____1_____ -- .byte CT_DIGIT | CT_XDIGIT ; 50/32 _____2_____ -- .byte CT_DIGIT | CT_XDIGIT ; 51/33 _____3_____ -- .byte CT_DIGIT | CT_XDIGIT ; 52/34 _____4_____ -- .byte CT_DIGIT | CT_XDIGIT ; 53/35 _____5_____ -- .byte CT_DIGIT | CT_XDIGIT ; 54/36 _____6_____ -- .byte CT_DIGIT | CT_XDIGIT ; 55/37 _____7_____ -- .byte CT_DIGIT | CT_XDIGIT ; 56/38 _____8_____ -- .byte CT_DIGIT | CT_XDIGIT ; 57/39 _____9_____ -- .byte CT_NONE ; 58/3a _____:_____ -- .byte CT_NONE ; 59/3b _____;_____ -- .byte CT_NONE ; 60/3c _____<_____ -- .byte CT_NONE ; 61/3d _____=_____ -- .byte CT_NONE ; 62/3e _____>_____ -- .byte CT_NONE ; 63/3f _____?_____ -- -- .byte CT_NONE ; 64/40 _____@_____ -- .byte CT_UPPER | CT_XDIGIT ; 65/41 _____A_____ -- .byte CT_UPPER | CT_XDIGIT ; 66/42 _____B_____ -- .byte CT_UPPER | CT_XDIGIT ; 67/43 _____C_____ -- .byte CT_UPPER | CT_XDIGIT ; 68/44 _____D_____ -- .byte CT_UPPER | CT_XDIGIT ; 69/45 _____E_____ -- .byte CT_UPPER | CT_XDIGIT ; 70/46 _____F_____ -- .byte CT_UPPER ; 71/47 _____G_____ -- .byte CT_UPPER ; 72/48 _____H_____ -- .byte CT_UPPER ; 73/49 _____I_____ -- .byte CT_UPPER ; 74/4a _____J_____ -- .byte CT_UPPER ; 75/4b _____K_____ -- .byte CT_UPPER ; 76/4c _____L_____ -- .byte CT_UPPER ; 77/4d _____M_____ -- .byte CT_UPPER ; 78/4e _____N_____ -- .byte CT_UPPER ; 79/4f _____O_____ -- .byte CT_UPPER ; 80/50 _____P_____ -- .byte CT_UPPER ; 81/51 _____Q_____ -- .byte CT_UPPER ; 82/52 _____R_____ -- .byte CT_UPPER ; 83/53 _____S_____ -- .byte CT_UPPER ; 84/54 _____T_____ -- .byte CT_UPPER ; 85/55 _____U_____ -- .byte CT_UPPER ; 86/56 _____V_____ -- .byte CT_UPPER ; 87/57 _____W_____ -- .byte CT_UPPER ; 88/58 _____X_____ -- .byte CT_UPPER ; 89/59 _____Y_____ -- .byte CT_UPPER ; 90/5a _____Z_____ -- .byte CT_NONE ; 91/5b _____[_____ -- .byte CT_NONE ; 92/5c _____\_____ -- .byte CT_NONE ; 93/5d _____]_____ -- .byte CT_NONE ; 94/5e _____^_____ -- .byte CT_NONE ; 95/5f _UNDERLINE_ -- .byte CT_NONE ; 96/60 ___grave___ -- .byte CT_LOWER | CT_XDIGIT ; 97/61 _____a_____ -- .byte CT_LOWER | CT_XDIGIT ; 98/62 _____b_____ -- .byte CT_LOWER | CT_XDIGIT ; 99/63 _____c_____ -- .byte CT_LOWER | CT_XDIGIT ; 100/64 _____d_____ -- .byte CT_LOWER | CT_XDIGIT ; 101/65 _____e_____ -- .byte CT_LOWER | CT_XDIGIT ; 102/66 _____f_____ -- .byte CT_LOWER ; 103/67 _____g_____ -- .byte CT_LOWER ; 104/68 _____h_____ -- .byte CT_LOWER ; 105/69 _____i_____ -- .byte CT_LOWER ; 106/6a _____j_____ -- .byte CT_LOWER ; 107/6b _____k_____ -- .byte CT_LOWER ; 108/6c _____l_____ -- .byte CT_LOWER ; 109/6d _____m_____ -- .byte CT_LOWER ; 110/6e _____n_____ -- .byte CT_LOWER ; 111/6f _____o_____ -- .byte CT_LOWER ; 112/70 _____p_____ -- .byte CT_LOWER ; 113/71 _____q_____ -- .byte CT_LOWER ; 114/72 _____r_____ -- .byte CT_LOWER ; 115/73 _____s_____ -- .byte CT_LOWER ; 116/74 _____t_____ -- .byte CT_LOWER ; 117/75 _____u_____ -- .byte CT_LOWER ; 118/76 _____v_____ -- .byte CT_LOWER ; 119/77 _____w_____ -- .byte CT_LOWER ; 120/78 _____x_____ -- .byte CT_LOWER ; 121/79 _____y_____ -- .byte CT_LOWER ; 122/7a _____z_____ -- .byte CT_NONE ; 123/7b _____{_____ -- .byte CT_NONE ; 124/7c _____|_____ -- .byte CT_NONE ; 125/7d _____}_____ -- .byte CT_NONE ; 126/7e _____~_____ -- .byte CT_OTHER_WS ; 127/7f ____DEL____ -- -- .res 128, CT_NONE ; 128-255 -- -- -- -+ .include "ctype_common.inc" -diff --git a/libsrc/telestrat/ctype.s b/libsrc/telestrat/ctype.s -index 79edafbb..db61b1bb 100644 ---- a/libsrc/telestrat/ctype.s -+++ b/libsrc/telestrat/ctype.s -@@ -1,299 +1,5 @@ --; --; Ullrich von Bassewitz, 2003-04-13 --; - ; Character specification table. - ; -+; same as for "atmos" target - --; The tables are readonly, put them into the rodata segment -- --.rodata -- --; The following 256 byte wide table specifies attributes for the isxxx type --; of functions. Doing it by a table means some overhead in space, but it --; has major advantages: --; --; * It is fast. If it were'nt for the slow parameter passing of cc65, one --; could even define macros for the isxxx functions (this is usually --; done on other platforms). --; --; * It is highly portable. The only unportable part is the table itself, --; all real code goes into the common library. --; --; * We save some code in the isxxx functions. --; --; --; Bit assignments: --; --; 0 - Lower case char --; 1 - Upper case char --; 2 - Numeric digit --; 3 - Hex digit (both, lower and upper) --; 4 - Control character --; 5 - The space character itself --; 6 - Other whitespace (that is: '\f', '\n', '\r', '\t' and '\v') --; 7 - Space or tab character -- -- .export __ctype -- --__ctype: -- .byte $10 ; 0/00 ___ctrl_@___ -- .byte $10 ; 1/01 ___ctrl_A___ -- .byte $10 ; 2/02 ___ctrl_B___ -- .byte $10 ; 3/03 ___ctrl_C___ -- .byte $10 ; 4/04 ___ctrl_D___ -- .byte $10 ; 5/05 ___ctrl_E___ -- .byte $10 ; 6/06 ___ctrl_F___ -- .byte $10 ; 7/07 ___ctrl_G___ -- .byte $10 ; 8/08 ___ctrl_H___ -- .byte $D0 ; 9/09 ___ctrl_I___ -- .byte $50 ; 10/0a ___ctrl_J___ -- .byte $50 ; 11/0b ___ctrl_K___ -- .byte $50 ; 12/0c ___ctrl_L___ -- .byte $50 ; 13/0d ___ctrl_M___ -- .byte $10 ; 14/0e ___ctrl_N___ -- .byte $10 ; 15/0f ___ctrl_O___ -- .byte $10 ; 16/10 ___ctrl_P___ -- .byte $10 ; 17/11 ___ctrl_Q___ -- .byte $10 ; 18/12 ___ctrl_R___ -- .byte $10 ; 19/13 ___ctrl_S___ -- .byte $10 ; 20/14 ___ctrl_T___ -- .byte $10 ; 21/15 ___ctrl_U___ -- .byte $10 ; 22/16 ___ctrl_V___ -- .byte $10 ; 23/17 ___ctrl_W___ -- .byte $10 ; 24/18 ___ctrl_X___ -- .byte $10 ; 25/19 ___ctrl_Y___ -- .byte $10 ; 26/1a ___ctrl_Z___ -- .byte $10 ; 27/1b ___ctrl_[___ -- .byte $10 ; 28/1c ___ctrl_\___ -- .byte $10 ; 29/1d ___ctrl_]___ -- .byte $10 ; 30/1e ___ctrl_^___ -- .byte $10 ; 31/1f ___ctrl_____ -- .byte $A0 ; 32/20 ___SPACE___ -- .byte $00 ; 33/21 _____!_____ -- .byte $00 ; 34/22 _____"_____ -- .byte $00 ; 35/23 _____#_____ -- .byte $00 ; 36/24 _____$_____ -- .byte $00 ; 37/25 _____%_____ -- .byte $00 ; 38/26 _____&_____ -- .byte $00 ; 39/27 _____'_____ -- .byte $00 ; 40/28 _____(_____ -- .byte $00 ; 41/29 _____)_____ -- .byte $00 ; 42/2a _____*_____ -- .byte $00 ; 43/2b _____+_____ -- .byte $00 ; 44/2c _____,_____ -- .byte $00 ; 45/2d _____-_____ -- .byte $00 ; 46/2e _____._____ -- .byte $00 ; 47/2f _____/_____ -- .byte $0C ; 48/30 _____0_____ -- .byte $0C ; 49/31 _____1_____ -- .byte $0C ; 50/32 _____2_____ -- .byte $0C ; 51/33 _____3_____ -- .byte $0C ; 52/34 _____4_____ -- .byte $0C ; 53/35 _____5_____ -- .byte $0C ; 54/36 _____6_____ -- .byte $0C ; 55/37 _____7_____ -- .byte $0C ; 56/38 _____8_____ -- .byte $0C ; 57/39 _____9_____ -- .byte $00 ; 58/3a _____:_____ -- .byte $00 ; 59/3b _____;_____ -- .byte $00 ; 60/3c _____<_____ -- .byte $00 ; 61/3d _____=_____ -- .byte $00 ; 62/3e _____>_____ -- .byte $00 ; 63/3f _____?_____ -- -- .byte $00 ; 64/40 _____@_____ -- .byte $0A ; 65/41 _____A_____ -- .byte $0A ; 66/42 _____B_____ -- .byte $0A ; 67/43 _____C_____ -- .byte $0A ; 68/44 _____D_____ -- .byte $0A ; 69/45 _____E_____ -- .byte $0A ; 70/46 _____F_____ -- .byte $02 ; 71/47 _____G_____ -- .byte $02 ; 72/48 _____H_____ -- .byte $02 ; 73/49 _____I_____ -- .byte $02 ; 74/4a _____J_____ -- .byte $02 ; 75/4b _____K_____ -- .byte $02 ; 76/4c _____L_____ -- .byte $02 ; 77/4d _____M_____ -- .byte $02 ; 78/4e _____N_____ -- .byte $02 ; 79/4f _____O_____ -- .byte $02 ; 80/50 _____P_____ -- .byte $02 ; 81/51 _____Q_____ -- .byte $02 ; 82/52 _____R_____ -- .byte $02 ; 83/53 _____S_____ -- .byte $02 ; 84/54 _____T_____ -- .byte $02 ; 85/55 _____U_____ -- .byte $02 ; 86/56 _____V_____ -- .byte $02 ; 87/57 _____W_____ -- .byte $02 ; 88/58 _____X_____ -- .byte $02 ; 89/59 _____Y_____ -- .byte $02 ; 90/5a _____Z_____ -- .byte $00 ; 91/5b _____[_____ -- .byte $00 ; 92/5c _____\_____ -- .byte $00 ; 93/5d _____]_____ -- .byte $00 ; 94/5e _____^_____ -- .byte $00 ; 95/5f _UNDERLINE_ -- .byte $00 ; 96/60 ___grave___ -- .byte $09 ; 97/61 _____a_____ -- .byte $09 ; 98/62 _____b_____ -- .byte $09 ; 99/63 _____c_____ -- .byte $09 ; 100/64 _____d_____ -- .byte $09 ; 101/65 _____e_____ -- .byte $09 ; 102/66 _____f_____ -- .byte $01 ; 103/67 _____g_____ -- .byte $01 ; 104/68 _____h_____ -- .byte $01 ; 105/69 _____i_____ -- .byte $01 ; 106/6a _____j_____ -- .byte $01 ; 107/6b _____k_____ -- .byte $01 ; 108/6c _____l_____ -- .byte $01 ; 109/6d _____m_____ -- .byte $01 ; 110/6e _____n_____ -- .byte $01 ; 111/6f _____o_____ -- .byte $01 ; 112/70 _____p_____ -- .byte $01 ; 113/71 _____q_____ -- .byte $01 ; 114/72 _____r_____ -- .byte $01 ; 115/73 _____s_____ -- .byte $01 ; 116/74 _____t_____ -- .byte $01 ; 117/75 _____u_____ -- .byte $01 ; 118/76 _____v_____ -- .byte $01 ; 119/77 _____w_____ -- .byte $01 ; 120/78 _____x_____ -- .byte $01 ; 121/79 _____y_____ -- .byte $01 ; 122/7a _____z_____ -- .byte $00 ; 123/7b _____{_____ -- .byte $00 ; 124/7c _____|_____ -- .byte $00 ; 125/7d _____}_____ -- .byte $00 ; 126/7e _____~_____ -- .byte $40 ; 127/7f ____DEL____ -- -- .byte $00 ; 128/80 ___________ -- .byte $00 ; 129/81 ___________ -- .byte $00 ; 130/82 ___________ -- .byte $00 ; 131/83 ___________ -- .byte $00 ; 132/84 ___________ -- .byte $00 ; 133/85 ___________ -- .byte $00 ; 134/86 ___________ -- .byte $00 ; 135/87 ___________ -- .byte $00 ; 136/88 ___________ -- .byte $00 ; 137/89 ___________ -- .byte $00 ; 138/8a ___________ -- .byte $00 ; 139/8b ___________ -- .byte $00 ; 140/8c ___________ -- .byte $00 ; 141/8d ___________ -- .byte $00 ; 142/8e ___________ -- .byte $00 ; 143/8f ___________ -- .byte $00 ; 144/90 ___________ -- .byte $00 ; 145/91 ___________ -- .byte $00 ; 146/92 ___________ -- .byte $10 ; 147/93 ___________ -- .byte $00 ; 148/94 ___________ -- .byte $00 ; 149/95 ___________ -- .byte $00 ; 150/96 ___________ -- .byte $00 ; 151/97 ___________ -- .byte $00 ; 152/98 ___________ -- .byte $00 ; 153/99 ___________ -- .byte $00 ; 154/9a ___________ -- .byte $00 ; 155/9b ___________ -- .byte $00 ; 156/9c ___________ -- .byte $00 ; 157/9d ___________ -- .byte $00 ; 158/9e ___________ -- .byte $00 ; 159/9f ___________ -- -- .byte $00 ; 160/a0 ___________ -- .byte $00 ; 161/a1 ___________ -- .byte $00 ; 162/a2 ___________ -- .byte $00 ; 163/a3 ___________ -- .byte $00 ; 164/a4 ___________ -- .byte $00 ; 165/a5 ___________ -- .byte $00 ; 166/a6 ___________ -- .byte $00 ; 167/a7 ___________ -- .byte $00 ; 168/a8 ___________ -- .byte $00 ; 169/a9 ___________ -- .byte $00 ; 170/aa ___________ -- .byte $00 ; 171/ab ___________ -- .byte $00 ; 172/ac ___________ -- .byte $00 ; 173/ad ___________ -- .byte $00 ; 174/ae ___________ -- .byte $00 ; 175/af ___________ -- .byte $00 ; 176/b0 ___________ -- .byte $00 ; 177/b1 ___________ -- .byte $00 ; 178/b2 ___________ -- .byte $00 ; 179/b3 ___________ -- .byte $00 ; 180/b4 ___________ -- .byte $00 ; 181/b5 ___________ -- .byte $00 ; 182/b6 ___________ -- .byte $00 ; 183/b7 ___________ -- .byte $00 ; 184/b8 ___________ -- .byte $00 ; 185/b9 ___________ -- .byte $00 ; 186/ba ___________ -- .byte $00 ; 187/bb ___________ -- .byte $00 ; 188/bc ___________ -- .byte $00 ; 189/bd ___________ -- .byte $00 ; 190/be ___________ -- .byte $00 ; 191/bf ___________ -- -- .byte $02 ; 192/c0 ___________ -- .byte $02 ; 193/c1 ___________ -- .byte $02 ; 194/c2 ___________ -- .byte $02 ; 195/c3 ___________ -- .byte $02 ; 196/c4 ___________ -- .byte $02 ; 197/c5 ___________ -- .byte $02 ; 198/c6 ___________ -- .byte $02 ; 199/c7 ___________ -- .byte $02 ; 200/c8 ___________ -- .byte $02 ; 201/c9 ___________ -- .byte $02 ; 202/ca ___________ -- .byte $02 ; 203/cb ___________ -- .byte $02 ; 204/cc ___________ -- .byte $02 ; 205/cd ___________ -- .byte $02 ; 206/ce ___________ -- .byte $02 ; 207/cf ___________ -- .byte $02 ; 208/d0 ___________ -- .byte $02 ; 209/d1 ___________ -- .byte $02 ; 210/d2 ___________ -- .byte $02 ; 211/d3 ___________ -- .byte $02 ; 212/d4 ___________ -- .byte $02 ; 213/d5 ___________ -- .byte $02 ; 214/d6 ___________ -- .byte $02 ; 215/d7 ___________ -- .byte $02 ; 216/d8 ___________ -- .byte $02 ; 217/d9 ___________ -- .byte $02 ; 218/da ___________ -- .byte $02 ; 219/db ___________ -- .byte $02 ; 220/dc ___________ -- .byte $02 ; 221/dd ___________ -- .byte $02 ; 222/de ___________ -- .byte $00 ; 223/df ___________ -- .byte $01 ; 224/e0 ___________ -- .byte $01 ; 225/e1 ___________ -- .byte $01 ; 226/e2 ___________ -- .byte $01 ; 227/e3 ___________ -- .byte $01 ; 228/e4 ___________ -- .byte $01 ; 229/e5 ___________ -- .byte $01 ; 230/e6 ___________ -- .byte $01 ; 231/e7 ___________ -- .byte $01 ; 232/e8 ___________ -- .byte $01 ; 233/e9 ___________ -- .byte $01 ; 234/ea ___________ -- .byte $01 ; 235/eb ___________ -- .byte $01 ; 236/ec ___________ -- .byte $01 ; 237/ed ___________ -- .byte $01 ; 238/ee ___________ -- .byte $01 ; 239/ef ___________ -- .byte $01 ; 240/f0 ___________ -- .byte $01 ; 241/f1 ___________ -- .byte $01 ; 242/f2 ___________ -- .byte $01 ; 243/f3 ___________ -- .byte $01 ; 244/f4 ___________ -- .byte $01 ; 245/f5 ___________ -- .byte $01 ; 246/f6 ___________ -- .byte $01 ; 247/f7 ___________ -- .byte $01 ; 248/f8 ___________ -- .byte $01 ; 249/f9 ___________ -- .byte $01 ; 250/fa ___________ -- .byte $01 ; 251/fb ___________ -- .byte $01 ; 252/fc ___________ -- .byte $01 ; 253/fd ___________ -- .byte $01 ; 254/fe ___________ -- .byte $00 ; 255/ff ___________ -- -+.include "../atmos/ctype.s" -diff --git a/test/val/lib_common_ctype.c b/test/val/lib_common_ctype.c -new file mode 100644 -index 00000000..15980aff ---- /dev/null -+++ b/test/val/lib_common_ctype.c -@@ -0,0 +1,368 @@ -+// lib_common_ctype.c -+// -+// This file is part of -+// cc65 - a freeware C compiler for 6502 based systems -+// -+// https://github.com/cc65/cc65 -+// -+// See "LICENSE" file for legal information. -+// -+// Unit test for character classification functions ("is..") -+// -+ -+#include <ctype.h> -+#include <stdbool.h> -+#include "unittest.h" -+ -+#define NUMTESTS 257 -+ -+typedef struct -+{ -+ bool isalnum; -+ bool isalpha; -+ bool isascii; -+ bool iscntrl; -+ bool isdigit; -+ bool isgraph; -+ bool islower; -+ bool isprint; -+ bool ispunct; -+ bool isspace; -+ bool isupper; -+ bool isxdigit; -+ bool isblank; -+ -+} CTypeClassifications; -+ -+ -+CTypeClassifications testSet[NUMTESTS] = -+{ -+ //alnum, alpha, ascii, cntrl, digit, graph, lower, print, punct, space, upper, xdigit,blank -+ -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 00 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 01 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 02 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 03 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 04 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 05 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 06 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 07 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 08 -+ {false, false, true, true, false, false, false, false, false, true, false, false, true }, // 09 -+ {false, false, true, true, false, false, false, false, false, true, false, false, false}, // 0A -+ {false, false, true, true, false, false, false, false, false, true, false, false, false}, // 0B -+ {false, false, true, true, false, false, false, false, false, true, false, false, false}, // 0C -+ {false, false, true, true, false, false, false, false, false, true, false, false, false}, // 0D -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 0E -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 0F -+ -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 10 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 11 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 12 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 13 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 14 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 15 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 16 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 17 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 18 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 19 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 1A -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 1B -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 1C -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 1D -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 1E -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 1F -+ -+ {false, false, true, false, false, false, false, true, false, true, false, false, true }, // 20 -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 21 -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 22 -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 23 -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 24 -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 25 -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 26 -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 27 -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 28 -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 29 -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 2A -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 2B -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 2C -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 2D -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 2E -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 2F -+ -+ {true, false, true, false, true, true, false, true, false, false, false, true, false}, // 30 -+ {true, false, true, false, true, true, false, true, false, false, false, true, false}, // 31 -+ {true, false, true, false, true, true, false, true, false, false, false, true, false}, // 32 -+ {true, false, true, false, true, true, false, true, false, false, false, true, false}, // 33 -+ {true, false, true, false, true, true, false, true, false, false, false, true, false}, // 34 -+ {true, false, true, false, true, true, false, true, false, false, false, true, false}, // 35 -+ {true, false, true, false, true, true, false, true, false, false, false, true, false}, // 36 -+ {true, false, true, false, true, true, false, true, false, false, false, true, false}, // 37 -+ {true, false, true, false, true, true, false, true, false, false, false, true, false}, // 38 -+ {true, false, true, false, true, true, false, true, false, false, false, true, false}, // 39 -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 3A -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 3B -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 3C -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 3D -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 3E -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 3F -+ -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 40 -+ {true, true, true, false, false, true, false, true, false, false, true, true, false}, // 41 -+ {true, true, true, false, false, true, false, true, false, false, true, true, false}, // 42 -+ {true, true, true, false, false, true, false, true, false, false, true, true, false}, // 43 -+ {true, true, true, false, false, true, false, true, false, false, true, true, false}, // 44 -+ {true, true, true, false, false, true, false, true, false, false, true, true, false}, // 45 -+ {true, true, true, false, false, true, false, true, false, false, true, true, false}, // 46 -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 47 -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 48 -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 49 -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 4A -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 4B -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 4C -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 4D -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 4E -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 4F -+ -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 50 -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 51 -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 52 -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 53 -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 54 -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 55 -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 56 -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 57 -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 58 -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 59 -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 5A -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 5B -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 5C -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 5D -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 5E -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 5F -+ -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 60 -+ {true, true, true, false, false, true, true, true, false, false, false, true, false}, // 61 -+ {true, true, true, false, false, true, true, true, false, false, false, true, false}, // 62 -+ {true, true, true, false, false, true, true, true, false, false, false, true, false}, // 63 -+ {true, true, true, false, false, true, true, true, false, false, false, true, false}, // 64 -+ {true, true, true, false, false, true, true, true, false, false, false, true, false}, // 65 -+ {true, true, true, false, false, true, true, true, false, false, false, true, false}, // 66 -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 67 -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 68 -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 69 -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 6A -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 6B -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 6C -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 6D -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 6E -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 6F -+ -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 70 -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 71 -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 72 -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 73 -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 74 -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 75 -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 76 -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 77 -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 78 -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 79 -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 7A -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 7B -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 7C -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 7D -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 7E -+ {false, false, true, false, false, true, false, true, true, true, false, false, false}, // 7F -+ -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 80 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 81 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 82 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 83 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 84 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 85 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 86 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 87 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 88 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 89 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 8A -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 8B -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 8C -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 8D -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 8E -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 8F -+ -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 90 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 91 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 92 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 93 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 94 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 95 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 96 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 97 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 98 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 99 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 9A -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 9B -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 9C -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 9D -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 9E -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 9F -+ -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // A0 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // A1 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // A2 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // A3 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // A4 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // A5 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // A6 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // A7 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // A8 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // A9 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // AA -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // AB -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // AC -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // AD -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // AE -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // AF -+ -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // B0 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // B1 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // B2 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // B3 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // B4 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // B5 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // B6 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // B7 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // B8 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // B9 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // BA -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // BB -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // BC -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // BD -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // BE -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // BF -+ -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // C0 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // C1 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // C2 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // C3 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // C4 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // C5 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // C6 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // C7 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // C8 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // C9 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // CA -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // CB -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // CC -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // CD -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // CE -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // CF -+ -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // D0 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // D1 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // D2 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // D3 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // D4 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // D5 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // D6 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // D7 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // D8 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // D9 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // DA -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // DB -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // DC -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // DD -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // DE -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // DF -+ -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // E0 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // E1 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // E2 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // E3 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // E4 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // E5 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // E6 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // E7 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // E8 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // E9 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // EA -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // EB -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // EC -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // ED -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // EE -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // EF -+ -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // F0 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // F1 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // F2 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // F3 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // F4 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // F5 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // F6 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // F7 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // F8 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // F9 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // FA -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // FB -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // FC -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // FD -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // FE -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // FF -+ -+ // out of range test -+ {false, false, false, false, false, false, false, false, false, false, false, false, false} // 100 -+}; -+ -+ -+TEST -+{ -+ int i = 0; -+ -+ while (i<NUMTESTS) -+ { -+ // isalnum() -+ ASSERT_AreEqual(testSet[i].isalnum, (isalnum(i) ? true : false), "%d", "Invalid 'isalnum(%d)' classification!" COMMA i); -+ -+ // isalpha() -+ ASSERT_AreEqual(testSet[i].isalpha, (isalpha(i) ? true : false), "%d", "Invalid 'isalpha(%d)' classification!" COMMA i); -+ -+ // isascii() -+ ASSERT_AreEqual(testSet[i].isascii, (isascii(i) ? true : false), "%d", "Invalid 'isascii(%d)' classification!" COMMA i); -+ -+ // iscntrl() -+ ASSERT_AreEqual(testSet[i].iscntrl, (iscntrl(i) ? true : false), "%d", "Invalid 'iscntrl(%d)' classification!" COMMA i); -+ -+ // isdigit() -+ ASSERT_AreEqual(testSet[i].isdigit, (isdigit(i) ? true : false), "%d", "Invalid 'isdigit(%d)' classification!" COMMA i); -+ -+ // isgraph() -+ ASSERT_AreEqual(testSet[i].isgraph, (isgraph(i) ? true : false), "%d", "Invalid 'isgraph(%d)' classification!" COMMA i); -+ -+ // islower() -+ ASSERT_AreEqual(testSet[i].islower, (islower(i) ? true : false), "%d", "Invalid 'islower(%d)' classification!" COMMA i); -+ -+ // isprint() -+ ASSERT_AreEqual(testSet[i].isprint, (isprint(i) ? true : false), "%d", "Invalid 'isprint(%d)' classification!" COMMA i); -+ -+ // ispunct() -+ ASSERT_AreEqual(testSet[i].ispunct, (ispunct(i) ? true : false), "%d", "Invalid 'ispunct(%d)' classification!" COMMA i); -+ -+ // isspace() -+ ASSERT_AreEqual(testSet[i].isspace, (isspace(i) ? true : false), "%d", "Invalid 'isspace(%d)' classification!" COMMA i); -+ -+ // isupper() -+ ASSERT_AreEqual(testSet[i].isupper, (isupper(i) ? true : false), "%d", "Invalid 'isupper(%d)' classification!" COMMA i); -+ -+ // isxdigit() -+ ASSERT_AreEqual(testSet[i].isxdigit, (isxdigit(i) ? true : false), "%d", "Invalid 'isxdigit(%d)' classification!" COMMA i); -+ -+#if __CC65_STD__ >= __CC65_STD_C99__ -+ // isblank() -+ ASSERT_AreEqual(testSet[i].isblank, (isblank(i) ? true : false), "%d", "Invalid 'isblank(%d)' classification!" COMMA i); -+#endif -+ ++i; -+ } -+} -+ENDTEST --- -2.26.0 - diff --git a/0149-Changes-resulting-from-code-review.patch b/0149-Changes-resulting-from-code-review.patch deleted file mode 100644 index 177eb8e..0000000 --- a/0149-Changes-resulting-from-code-review.patch +++ /dev/null @@ -1,129 +0,0 @@ -From 002d1801ec72c1dc11e90cd7e821395e6df61a5b Mon Sep 17 00:00:00 2001 -From: IrgendwerA8 <c.krueger.b@web.de> -Date: Sun, 5 Jan 2020 15:57:44 +0100 -Subject: [PATCH 149/170] Changes resulting from code review. - ---- - asminc/ctype.inc | 2 ++ - asminc/ctypetable.inc | 2 +- - libsrc/common/atoi.s | 13 ++++++------- - libsrc/common/isascii.s | 13 +++++-------- - libsrc/common/strlower.s | 5 ++--- - libsrc/common/strupper.s | 3 +-- - 6 files changed, 17 insertions(+), 21 deletions(-) - -diff --git a/asminc/ctype.inc b/asminc/ctype.inc -index 401e772a..29976078 100644 ---- a/asminc/ctype.inc -+++ b/asminc/ctype.inc -@@ -9,6 +9,8 @@ - ; - ; Definitions for the character type tables - ; -+; Ullrich von Bassewitz, 08.09.2001 -+; - - ; Define bitmapped constants for the table entries - -diff --git a/asminc/ctypetable.inc b/asminc/ctypetable.inc -index e0a8bdcd..7134d002 100644 ---- a/asminc/ctypetable.inc -+++ b/asminc/ctypetable.inc -@@ -13,7 +13,7 @@ - .include "ctype.inc" - .export __ctype - --; This data is a table of possible ctype combinations, possible during -+; Table definition covering all possible ctype combinations - - .rodata - __ctype: -diff --git a/libsrc/common/atoi.s b/libsrc/common/atoi.s -index 8427be62..b63fcb20 100644 ---- a/libsrc/common/atoi.s -+++ b/libsrc/common/atoi.s -@@ -54,10 +54,11 @@ L3: iny - L5: stx tmp1 ; remember sign flag - - L6: lda (ptr1),y ; get next char -- ; get character classification -- jsr ctype_preprocessor_no_check -- and #CT_DIGIT ; digit? -- beq L8 ; done -+ sec ; check if char is in digit space -+ sbc #'0' ; so subtract lower limit -+ tax ; remember this numeric value -+ cmp #10 ; and check if upper limit is not crossed -+ bcs L8 ; done - - ; Multiply ptr2 (the converted value) by 10 - -@@ -91,9 +92,7 @@ L6: lda (ptr1),y ; get next char - - ; Get the character back and add it - -- lda (ptr1),y ; fetch char again -- sec -- sbc #'0' ; make numeric value -+ txa ; restore numeric value back to accu - clc - adc ptr2 - sta ptr2 -diff --git a/libsrc/common/isascii.s b/libsrc/common/isascii.s -index dccfabaa..c15cc586 100644 ---- a/libsrc/common/isascii.s -+++ b/libsrc/common/isascii.s -@@ -13,15 +13,12 @@ - .export _isascii - - _isascii: -- cpx #$00 ; Char range ok? -- bne @L1 ; Jump if no -- -- tay -- bmi @L1 -- -- inx -+ asl a ; high-bit to carry -+ txa ; check range of input param -+ bne @L1 ; out-of bounds? -+ adc #$FF ; calculate return value based on carry - rts - --@L1: lda #$00 ; Return false -+@L1: lda #$00 ; return false - tax - rts -diff --git a/libsrc/common/strlower.s b/libsrc/common/strlower.s -index 8c634b6e..d4e48138 100644 ---- a/libsrc/common/strlower.s -+++ b/libsrc/common/strlower.s -@@ -28,9 +28,8 @@ loop: lda (ptr1),y ; get character - jsr ctype_preprocessor_no_check - and #CT_UPPER ; upper case char? - beq L1 ; jump if no -- lda (ptr1),y ; fetch character again -- sec -- sbc #<('A'-'a') ; make lower case char -+ lda (ptr1),y ; fetch character again -+ adc #<('a'-'A') ; make lower case char (ctype_preprocessor_no_check ensures carry clear) - sta (ptr1),y ; store back - L1: iny ; next char - bne loop -diff --git a/libsrc/common/strupper.s b/libsrc/common/strupper.s -index c07fb17c..dd6c1c25 100644 ---- a/libsrc/common/strupper.s -+++ b/libsrc/common/strupper.s -@@ -28,8 +28,7 @@ loop: lda (ptr1),y ; get character - and #CT_LOWER ; lower case char? - beq L1 ; jump if no - lda (ptr1),y ; fetch character again -- clc -- adc #<('A'-'a') ; make upper case char -+ adc #<('A'-'a') ; make upper case char (ctype_preprocessor_no_check ensures carry clear) - sta (ptr1),y ; store back - L1: iny ; next char - bne loop --- -2.26.0 - diff --git a/0150-Changes-resulting-from-2nd-code-review.patch b/0150-Changes-resulting-from-2nd-code-review.patch deleted file mode 100644 index 710d6a5..0000000 --- a/0150-Changes-resulting-from-2nd-code-review.patch +++ /dev/null @@ -1,1316 +0,0 @@ -From 08705a3fdc5050d284eb655e6efb2ab5664ca9a4 Mon Sep 17 00:00:00 2001 -From: IrgendwerA8 <c.krueger.b@web.de> -Date: Sun, 2 Feb 2020 18:21:25 +0100 -Subject: [PATCH 150/170] Changes resulting from 2nd code review - ---- - asminc/ctype.inc | 2 +- - asminc/ctype_common.inc | 2 +- - asminc/ctypetable.inc | 50 +- - libsrc/apple2/ctype.s | 5 - - libsrc/atari/ctype.s | 2 +- - libsrc/atmos/ctype.s | 2 +- - libsrc/cbm/ctype.s | 2 +- - .../common/ctype.s | 4 +- - libsrc/common/ctype_preprocessor.s | 2 +- - libsrc/common/isalnum.s | 2 +- - libsrc/common/isalpha.s | 2 +- - libsrc/common/isascii.s | 10 +- - libsrc/common/isblank.s | 4 +- - libsrc/common/iscntrl.s | 4 +- - libsrc/common/isdigit.s | 2 +- - libsrc/common/isgraph.s | 8 +- - libsrc/common/islower.s | 4 +- - libsrc/common/isprint.s | 4 +- - libsrc/common/ispunct.s | 4 +- - libsrc/common/isspace.s | 4 +- - libsrc/common/isupper.s | 4 +- - libsrc/common/isxdigit.s | 4 +- - libsrc/common/mul20.s | 2 +- - libsrc/common/mul40.s | 2 +- - libsrc/common/stricmp.s | 10 +- - libsrc/creativision/ctype.s | 5 - - libsrc/gamate/ctype.s | 5 - - libsrc/geos-common/system/ctype.s | 2 +- - libsrc/lynx/ctype.s | 5 - - libsrc/nes/ctype.s | 5 - - libsrc/pce/ctype.s | 5 - - test/val/lib_common_ctype.c | 634 +++++++++--------- - 32 files changed, 386 insertions(+), 416 deletions(-) - delete mode 100644 libsrc/apple2/ctype.s - rename asminc/ctype_console.inc => libsrc/common/ctype.s (99%) - delete mode 100644 libsrc/creativision/ctype.s - delete mode 100644 libsrc/gamate/ctype.s - delete mode 100644 libsrc/lynx/ctype.s - delete mode 100644 libsrc/nes/ctype.s - delete mode 100644 libsrc/pce/ctype.s - -diff --git a/asminc/ctype.inc b/asminc/ctype.inc -index 29976078..18a290fb 100644 ---- a/asminc/ctype.inc -+++ b/asminc/ctype.inc -@@ -3,7 +3,7 @@ - ; This file is part of - ; cc65 - a freeware C compiler for 6502 based systems - ; --; https://github.com/cc65/cc65 -+; https://cc65.github.io - ; - ; See "LICENSE" file for legal information. - ; -diff --git a/asminc/ctype_common.inc b/asminc/ctype_common.inc -index ffd8dfe0..04aaa8f9 100644 ---- a/asminc/ctype_common.inc -+++ b/asminc/ctype_common.inc -@@ -3,7 +3,7 @@ - ; This file is part of - ; cc65 - a freeware C compiler for 6502 based systems - ; --; https://github.com/cc65/cc65 -+; https://cc65.github.io - ; - ; See "LICENSE" file for legal information. - ; -diff --git a/asminc/ctypetable.inc b/asminc/ctypetable.inc -index 7134d002..76c5b929 100644 ---- a/asminc/ctypetable.inc -+++ b/asminc/ctypetable.inc -@@ -3,46 +3,46 @@ - ; This file is part of - ; cc65 - a freeware C compiler for 6502 based systems - ; --; https://github.com/cc65/cc65 -+; https://cc65.github.io - ; - ; See "LICENSE" file for legal information. - ; - ; Data covering all possible combinations of character flags for target specific definition - ; - --.include "ctype.inc" --.export __ctype -+.include "ctype.inc" -+.export __ctype - - ; Table definition covering all possible ctype combinations - - .rodata - __ctype: --ct_none: .byte CT_NONE --ct_lower: .byte CT_LOWER --ct_upper: .byte CT_UPPER --ct_digit_xdigit: .byte CT_DIGIT | CT_XDIGIT --ct_lower_xdigit: .byte CT_LOWER | CT_XDIGIT --ct_upper_xdigit: .byte CT_UPPER | CT_XDIGIT --ct_ctrl: .byte CT_CTRL --ct_ws: .byte CT_OTHER_WS --ct_ctrl_ws: .byte CT_CTRL | CT_OTHER_WS --ct_space_spacetab: .byte CT_SPACE | CT_SPACE_TAB --ct_ctrl_ws_spacetab: .byte CT_CTRL | CT_OTHER_WS | CT_SPACE_TAB -+ct_none: .byte CT_NONE -+ct_lower: .byte CT_LOWER -+ct_upper: .byte CT_UPPER -+ct_digit_xdigit: .byte CT_DIGIT | CT_XDIGIT -+ct_lower_xdigit: .byte CT_LOWER | CT_XDIGIT -+ct_upper_xdigit: .byte CT_UPPER | CT_XDIGIT -+ct_ctrl: .byte CT_CTRL -+ct_ws: .byte CT_OTHER_WS -+ct_ctrl_ws: .byte CT_CTRL | CT_OTHER_WS -+ct_space_spacetab: .byte CT_SPACE | CT_SPACE_TAB -+ct_ctrl_ws_spacetab: .byte CT_CTRL | CT_OTHER_WS | CT_SPACE_TAB - - ; build indices out of the table above: - --CT_NONE_IDX = ct_none - __ctype --CT_LOWER_IDX = ct_lower - __ctype --CT_UPPER_IDX = ct_upper - __ctype --CT_DIGIT_XDIGIT_IDX = ct_digit_xdigit - __ctype --CT_LOWER_XDIGIT_IDX = ct_lower_xdigit - __ctype --CT_UPPER_XDIGIT_IDX = ct_upper_xdigit - __ctype --CT_CTRL_IDX = ct_ctrl - __ctype --CT_WS_IDX = ct_ws - __ctype --CT_CTRL_WS_IDX = ct_ctrl_ws - __ctype --CT_SPACE_SPACETAB_IDX = ct_space_spacetab - __ctype -+CT_NONE_IDX = ct_none - __ctype -+CT_LOWER_IDX = ct_lower - __ctype -+CT_UPPER_IDX = ct_upper - __ctype -+CT_DIGIT_XDIGIT_IDX = ct_digit_xdigit - __ctype -+CT_LOWER_XDIGIT_IDX = ct_lower_xdigit - __ctype -+CT_UPPER_XDIGIT_IDX = ct_upper_xdigit - __ctype -+CT_CTRL_IDX = ct_ctrl - __ctype -+CT_WS_IDX = ct_ws - __ctype -+CT_CTRL_WS_IDX = ct_ctrl_ws - __ctype -+CT_SPACE_SPACETAB_IDX = ct_space_spacetab - __ctype - CT_CTRL_WS_SPACETAB_IDX = ct_ctrl_ws_spacetab - __ctype - - .macro ct_mix lower, upper -- .byte ((lower) & $0F) | ((upper) << 4) -+ .byte ((lower) & $0F) | ((upper) << 4) - .endmacro -diff --git a/libsrc/apple2/ctype.s b/libsrc/apple2/ctype.s -deleted file mode 100644 -index da4d3847..00000000 ---- a/libsrc/apple2/ctype.s -+++ /dev/null -@@ -1,5 +0,0 @@ --; Character specification table. --; --; uses the "console" definition -- -- .include "ctype_console.inc" -diff --git a/libsrc/atari/ctype.s b/libsrc/atari/ctype.s -index 8173b2ea..7903dc2a 100644 ---- a/libsrc/atari/ctype.s -+++ b/libsrc/atari/ctype.s -@@ -3,7 +3,7 @@ - ; This file is part of - ; cc65 - a freeware C compiler for 6502 based systems - ; --; https://github.com/cc65/cc65 -+; https://cc65.github.io - ; - ; See "LICENSE" file for legal information. - ; -diff --git a/libsrc/atmos/ctype.s b/libsrc/atmos/ctype.s -index 3c3d7be5..7ca01b32 100644 ---- a/libsrc/atmos/ctype.s -+++ b/libsrc/atmos/ctype.s -@@ -3,7 +3,7 @@ - ; This file is part of - ; cc65 - a freeware C compiler for 6502 based systems - ; --; https://github.com/cc65/cc65 -+; https://cc65.github.io - ; - ; See "LICENSE" file for legal information. - ; -diff --git a/libsrc/cbm/ctype.s b/libsrc/cbm/ctype.s -index d0943b12..77a37431 100644 ---- a/libsrc/cbm/ctype.s -+++ b/libsrc/cbm/ctype.s -@@ -3,7 +3,7 @@ - ; This file is part of - ; cc65 - a freeware C compiler for 6502 based systems - ; --; https://github.com/cc65/cc65 -+; https://cc65.github.io - ; - ; See "LICENSE" file for legal information. - ; -diff --git a/asminc/ctype_console.inc b/libsrc/common/ctype.s -similarity index 99% -rename from asminc/ctype_console.inc -rename to libsrc/common/ctype.s -index 55db8e61..15f115e7 100644 ---- a/asminc/ctype_console.inc -+++ b/libsrc/common/ctype.s -@@ -1,9 +1,9 @@ --; ctype_console.inc -+; ctype.s - ; - ; This file is part of - ; cc65 - a freeware C compiler for 6502 based systems - ; --; https://github.com/cc65/cc65 -+; https://cc65.github.io - ; - ; See "LICENSE" file for legal information. - ; -diff --git a/libsrc/common/ctype_preprocessor.s b/libsrc/common/ctype_preprocessor.s -index 1f33bd22..efa001e6 100644 ---- a/libsrc/common/ctype_preprocessor.s -+++ b/libsrc/common/ctype_preprocessor.s -@@ -3,7 +3,7 @@ - ; This file is part of - ; cc65 - a freeware C compiler for 6502 based systems - ; --; https://github.com/cc65/cc65 -+; https://cc65.github.io - ; - ; See "LICENSE" file for legal information. - ; -diff --git a/libsrc/common/isalnum.s b/libsrc/common/isalnum.s -index 4f6a5e91..141949c0 100644 ---- a/libsrc/common/isalnum.s -+++ b/libsrc/common/isalnum.s -@@ -3,7 +3,7 @@ - ; This file is part of - ; cc65 - a freeware C compiler for 6502 based systems - ; --; https://github.com/cc65/cc65 -+; https://cc65.github.io - ; - ; See "LICENSE" file for legal information. - ; -diff --git a/libsrc/common/isalpha.s b/libsrc/common/isalpha.s -index a331722a..95e79916 100644 ---- a/libsrc/common/isalpha.s -+++ b/libsrc/common/isalpha.s -@@ -3,7 +3,7 @@ - ; This file is part of - ; cc65 - a freeware C compiler for 6502 based systems - ; --; https://github.com/cc65/cc65 -+; https://cc65.github.io - ; - ; See "LICENSE" file for legal information. - ; -diff --git a/libsrc/common/isascii.s b/libsrc/common/isascii.s -index c15cc586..70d2f72a 100644 ---- a/libsrc/common/isascii.s -+++ b/libsrc/common/isascii.s -@@ -3,7 +3,7 @@ - ; This file is part of - ; cc65 - a freeware C compiler for 6502 based systems - ; --; https://github.com/cc65/cc65 -+; https://cc65.github.io - ; - ; See "LICENSE" file for legal information. - ; -@@ -13,10 +13,10 @@ - .export _isascii - - _isascii: -- asl a ; high-bit to carry -- txa ; check range of input param -- bne @L1 ; out-of bounds? -- adc #$FF ; calculate return value based on carry -+ asl a ; high-bit to carry -+ txa ; check range of input param -+ bne @L1 ; out-of bounds? -+ adc #$FF ; calculate return value based on carry - rts - - @L1: lda #$00 ; return false -diff --git a/libsrc/common/isblank.s b/libsrc/common/isblank.s -index 5e0eafd7..3d0a02f3 100644 ---- a/libsrc/common/isblank.s -+++ b/libsrc/common/isblank.s -@@ -3,7 +3,7 @@ - ; This file is part of - ; cc65 - a freeware C compiler for 6502 based systems - ; --; https://github.com/cc65/cc65 -+; https://cc65.github.io - ; - ; See "LICENSE" file for legal information. - ; -@@ -14,7 +14,7 @@ - - .export _isblank - .include "ctype.inc" -- .import ctype_preprocessor -+ .import ctype_preprocessor - - _isblank: - jsr ctype_preprocessor ; (clears always x) -diff --git a/libsrc/common/iscntrl.s b/libsrc/common/iscntrl.s -index f4bf0285..f2b95042 100644 ---- a/libsrc/common/iscntrl.s -+++ b/libsrc/common/iscntrl.s -@@ -3,7 +3,7 @@ - ; This file is part of - ; cc65 - a freeware C compiler for 6502 based systems - ; --; https://github.com/cc65/cc65 -+; https://cc65.github.io - ; - ; See "LICENSE" file for legal information. - ; -@@ -12,7 +12,7 @@ - - .export _iscntrl - .include "ctype.inc" -- .import ctype_preprocessor -+ .import ctype_preprocessor - - _iscntrl: - jsr ctype_preprocessor ; (clears always x) -diff --git a/libsrc/common/isdigit.s b/libsrc/common/isdigit.s -index c0e8bb02..36acd73b 100644 ---- a/libsrc/common/isdigit.s -+++ b/libsrc/common/isdigit.s -@@ -3,7 +3,7 @@ - ; This file is part of - ; cc65 - a freeware C compiler for 6502 based systems - ; --; https://github.com/cc65/cc65 -+; https://cc65.github.io - ; - ; See "LICENSE" file for legal information. - ; -diff --git a/libsrc/common/isgraph.s b/libsrc/common/isgraph.s -index 575b05a6..4e317db5 100644 ---- a/libsrc/common/isgraph.s -+++ b/libsrc/common/isgraph.s -@@ -3,7 +3,7 @@ - ; This file is part of - ; cc65 - a freeware C compiler for 6502 based systems - ; --; https://github.com/cc65/cc65 -+; https://cc65.github.io - ; - ; See "LICENSE" file for legal information. - ; -@@ -17,9 +17,9 @@ - _isgraph: - jsr ctype_preprocessor ; (clears always x) - bcs @L1 ; out of range? (everything already clear -> false) -- and #CT_CTRL_SPACE ; mask character bits -- cmp #1 ; if false, then set "borrow" flag -+ and #CT_CTRL_SPACE ; mask character bits -+ cmp #1 ; if false, then set "borrow" flag - lda #0 -- sbc #0 ; invert logic (return NOT control and NOT space) -+ sbc #0 ; invert logic (return NOT control and NOT space) - @L1: rts - -diff --git a/libsrc/common/islower.s b/libsrc/common/islower.s -index 62ae4164..608d0ccf 100644 ---- a/libsrc/common/islower.s -+++ b/libsrc/common/islower.s -@@ -3,7 +3,7 @@ - ; This file is part of - ; cc65 - a freeware C compiler for 6502 based systems - ; --; https://github.com/cc65/cc65 -+; https://cc65.github.io - ; - ; See "LICENSE" file for legal information. - ; -@@ -12,7 +12,7 @@ - - .export _islower - .include "ctype.inc" -- .import ctype_preprocessor -+ .import ctype_preprocessor - - _islower: - jsr ctype_preprocessor ; (clears always x) -diff --git a/libsrc/common/isprint.s b/libsrc/common/isprint.s -index cbe68c80..0d135f24 100644 ---- a/libsrc/common/isprint.s -+++ b/libsrc/common/isprint.s -@@ -3,7 +3,7 @@ - ; This file is part of - ; cc65 - a freeware C compiler for 6502 based systems - ; --; https://github.com/cc65/cc65 -+; https://cc65.github.io - ; - ; See "LICENSE" file for legal information. - ; -@@ -12,7 +12,7 @@ - - .export _isprint - .include "ctype.inc" -- .import ctype_preprocessor -+ .import ctype_preprocessor - - _isprint: - jsr ctype_preprocessor ; (clears always x) -diff --git a/libsrc/common/ispunct.s b/libsrc/common/ispunct.s -index ad48fc53..a532399f 100644 ---- a/libsrc/common/ispunct.s -+++ b/libsrc/common/ispunct.s -@@ -3,7 +3,7 @@ - ; This file is part of - ; cc65 - a freeware C compiler for 6502 based systems - ; --; https://github.com/cc65/cc65 -+; https://cc65.github.io - ; - ; See "LICENSE" file for legal information. - ; -@@ -12,7 +12,7 @@ - - .export _ispunct - .include "ctype.inc" -- .import ctype_preprocessor -+ .import ctype_preprocessor - - _ispunct: - jsr ctype_preprocessor ; (clears always x) -diff --git a/libsrc/common/isspace.s b/libsrc/common/isspace.s -index 272acac0..1f70786c 100644 ---- a/libsrc/common/isspace.s -+++ b/libsrc/common/isspace.s -@@ -3,7 +3,7 @@ - ; This file is part of - ; cc65 - a freeware C compiler for 6502 based systems - ; --; https://github.com/cc65/cc65 -+; https://cc65.github.io - ; - ; See "LICENSE" file for legal information. - ; -@@ -12,7 +12,7 @@ - - .export _isspace - .include "ctype.inc" -- .import ctype_preprocessor -+ .import ctype_preprocessor - - _isspace: - jsr ctype_preprocessor ; (clears always x) -diff --git a/libsrc/common/isupper.s b/libsrc/common/isupper.s -index 2d89459a..0dd2a6ea 100644 ---- a/libsrc/common/isupper.s -+++ b/libsrc/common/isupper.s -@@ -3,7 +3,7 @@ - ; This file is part of - ; cc65 - a freeware C compiler for 6502 based systems - ; --; https://github.com/cc65/cc65 -+; https://cc65.github.io - ; - ; See "LICENSE" file for legal information. - ; -@@ -12,7 +12,7 @@ - - .export _isupper - .include "ctype.inc" -- .import ctype_preprocessor -+ .import ctype_preprocessor - - _isupper: - jsr ctype_preprocessor ; (clears always x) -diff --git a/libsrc/common/isxdigit.s b/libsrc/common/isxdigit.s -index 07fef5c2..3f36ede0 100644 ---- a/libsrc/common/isxdigit.s -+++ b/libsrc/common/isxdigit.s -@@ -3,7 +3,7 @@ - ; This file is part of - ; cc65 - a freeware C compiler for 6502 based systems - ; --; https://github.com/cc65/cc65 -+; https://cc65.github.io - ; - ; See "LICENSE" file for legal information. - ; -@@ -12,7 +12,7 @@ - - .export _isxdigit - .include "ctype.inc" -- .import ctype_preprocessor -+ .import ctype_preprocessor - - _isxdigit: - jsr ctype_preprocessor ; (clears always x) -diff --git a/libsrc/common/mul20.s b/libsrc/common/mul20.s -index 4035b947..5b3bbf83 100644 ---- a/libsrc/common/mul20.s -+++ b/libsrc/common/mul20.s -@@ -3,7 +3,7 @@ - ; This file is part of - ; cc65 - a freeware C compiler for 6502 based systems - ; --; https://github.com/cc65/cc65 -+; https://cc65.github.io - ; - ; See "LICENSE" file for legal information. - ; -diff --git a/libsrc/common/mul40.s b/libsrc/common/mul40.s -index f240fc41..07d6164b 100644 ---- a/libsrc/common/mul40.s -+++ b/libsrc/common/mul40.s -@@ -3,7 +3,7 @@ - ; This file is part of - ; cc65 - a freeware C compiler for 6502 based systems - ; --; https://github.com/cc65/cc65 -+; https://cc65.github.io - ; - ; See "LICENSE" file for legal information. - ; -diff --git a/libsrc/common/stricmp.s b/libsrc/common/stricmp.s -index e1683d9f..3a03258b 100644 ---- a/libsrc/common/stricmp.s -+++ b/libsrc/common/stricmp.s -@@ -3,7 +3,7 @@ - ; This file is part of - ; cc65 - a freeware C compiler for 6502 based systems - ; --; https://github.com/cc65/cc65 -+; https://cc65.github.io - ; - ; See "LICENSE" file for legal information. - ; -@@ -27,7 +27,7 @@ _strcasecmp: - loop: lda (ptr2),y ; get char from second string - sta tmp2 ; and save it - ; get character classification -- jsr ctype_preprocessor_no_check -+ jsr ctype_preprocessor_no_check - and #CT_LOWER ; lower case char? - beq L1 ; jump if no - lda #<('A'-'a') ; make upper case char -@@ -37,13 +37,13 @@ loop: lda (ptr2),y ; get char from second string - L1: lda (ptr1),y ; get character from first string - sta tmp1 - ; get character classification -- jsr ctype_preprocessor_no_check -+ jsr ctype_preprocessor_no_check - and #CT_LOWER ; lower case char? - beq L2 ; jump if no - lda #<('A'-'a') ; make upper case char - adc tmp1 ; ctype_preprocessor_no_check ensures carry clear! -- sta tmp1 ; remember upper case equivalent -- -+ sta tmp1 ; remember upper case equivalent -+ - L2: ldx tmp1 - cpx tmp2 ; compare characters - bne L3 -diff --git a/libsrc/creativision/ctype.s b/libsrc/creativision/ctype.s -deleted file mode 100644 -index da4d3847..00000000 ---- a/libsrc/creativision/ctype.s -+++ /dev/null -@@ -1,5 +0,0 @@ --; Character specification table. --; --; uses the "console" definition -- -- .include "ctype_console.inc" -diff --git a/libsrc/gamate/ctype.s b/libsrc/gamate/ctype.s -deleted file mode 100644 -index da4d3847..00000000 ---- a/libsrc/gamate/ctype.s -+++ /dev/null -@@ -1,5 +0,0 @@ --; Character specification table. --; --; uses the "console" definition -- -- .include "ctype_console.inc" -diff --git a/libsrc/geos-common/system/ctype.s b/libsrc/geos-common/system/ctype.s -index a50ad163..013a1ba9 100644 ---- a/libsrc/geos-common/system/ctype.s -+++ b/libsrc/geos-common/system/ctype.s -@@ -3,7 +3,7 @@ - ; This file is part of - ; cc65 - a freeware C compiler for 6502 based systems - ; --; https://github.com/cc65/cc65 -+; https://cc65.github.io - ; - ; See "LICENSE" file for legal information. - ; -diff --git a/libsrc/lynx/ctype.s b/libsrc/lynx/ctype.s -deleted file mode 100644 -index da4d3847..00000000 ---- a/libsrc/lynx/ctype.s -+++ /dev/null -@@ -1,5 +0,0 @@ --; Character specification table. --; --; uses the "console" definition -- -- .include "ctype_console.inc" -diff --git a/libsrc/nes/ctype.s b/libsrc/nes/ctype.s -deleted file mode 100644 -index da4d3847..00000000 ---- a/libsrc/nes/ctype.s -+++ /dev/null -@@ -1,5 +0,0 @@ --; Character specification table. --; --; uses the "console" definition -- -- .include "ctype_console.inc" -diff --git a/libsrc/pce/ctype.s b/libsrc/pce/ctype.s -deleted file mode 100644 -index da4d3847..00000000 ---- a/libsrc/pce/ctype.s -+++ /dev/null -@@ -1,5 +0,0 @@ --; Character specification table. --; --; uses the "console" definition -- -- .include "ctype_console.inc" -diff --git a/test/val/lib_common_ctype.c b/test/val/lib_common_ctype.c -index 15980aff..39c92953 100644 ---- a/test/val/lib_common_ctype.c -+++ b/test/val/lib_common_ctype.c -@@ -3,7 +3,7 @@ - // This file is part of - // cc65 - a freeware C compiler for 6502 based systems - // --// https://github.com/cc65/cc65 -+// https://cc65.github.io - // - // See "LICENSE" file for legal information. - // -@@ -18,19 +18,19 @@ - - typedef struct - { -- bool isalnum; -- bool isalpha; -- bool isascii; -- bool iscntrl; -- bool isdigit; -- bool isgraph; -- bool islower; -- bool isprint; -- bool ispunct; -- bool isspace; -- bool isupper; -- bool isxdigit; -- bool isblank; -+ bool isalnum; -+ bool isalpha; -+ bool isascii; -+ bool iscntrl; -+ bool isdigit; -+ bool isgraph; -+ bool islower; -+ bool isprint; -+ bool ispunct; -+ bool isspace; -+ bool isupper; -+ bool isxdigit; -+ bool isblank; - - } CTypeClassifications; - -@@ -39,330 +39,330 @@ CTypeClassifications testSet[NUMTESTS] = - { - //alnum, alpha, ascii, cntrl, digit, graph, lower, print, punct, space, upper, xdigit,blank - -- {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 00 -- {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 01 -- {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 02 -- {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 03 -- {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 04 -- {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 05 -- {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 06 -- {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 07 -- {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 08 -- {false, false, true, true, false, false, false, false, false, true, false, false, true }, // 09 -- {false, false, true, true, false, false, false, false, false, true, false, false, false}, // 0A -- {false, false, true, true, false, false, false, false, false, true, false, false, false}, // 0B -- {false, false, true, true, false, false, false, false, false, true, false, false, false}, // 0C -- {false, false, true, true, false, false, false, false, false, true, false, false, false}, // 0D -- {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 0E -- {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 0F -- -- {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 10 -- {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 11 -- {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 12 -- {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 13 -- {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 14 -- {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 15 -- {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 16 -- {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 17 -- {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 18 -- {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 19 -- {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 1A -- {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 1B -- {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 1C -- {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 1D -- {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 1E -- {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 1F -- -- {false, false, true, false, false, false, false, true, false, true, false, false, true }, // 20 -- {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 21 -- {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 22 -- {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 23 -- {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 24 -- {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 25 -- {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 26 -- {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 27 -- {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 28 -- {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 29 -- {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 2A -- {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 2B -- {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 2C -- {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 2D -- {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 2E -- {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 2F -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 00 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 01 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 02 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 03 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 04 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 05 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 06 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 07 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 08 -+ {false, false, true, true, false, false, false, false, false, true, false, false, true }, // 09 -+ {false, false, true, true, false, false, false, false, false, true, false, false, false}, // 0A -+ {false, false, true, true, false, false, false, false, false, true, false, false, false}, // 0B -+ {false, false, true, true, false, false, false, false, false, true, false, false, false}, // 0C -+ {false, false, true, true, false, false, false, false, false, true, false, false, false}, // 0D -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 0E -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 0F -+ -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 10 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 11 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 12 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 13 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 14 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 15 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 16 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 17 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 18 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 19 -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 1A -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 1B -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 1C -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 1D -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 1E -+ {false, false, true, true, false, false, false, false, false, false, false, false, false}, // 1F -+ -+ {false, false, true, false, false, false, false, true, false, true, false, false, true }, // 20 -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 21 -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 22 -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 23 -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 24 -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 25 -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 26 -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 27 -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 28 -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 29 -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 2A -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 2B -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 2C -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 2D -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 2E -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 2F - -- {true, false, true, false, true, true, false, true, false, false, false, true, false}, // 30 -- {true, false, true, false, true, true, false, true, false, false, false, true, false}, // 31 -- {true, false, true, false, true, true, false, true, false, false, false, true, false}, // 32 -- {true, false, true, false, true, true, false, true, false, false, false, true, false}, // 33 -- {true, false, true, false, true, true, false, true, false, false, false, true, false}, // 34 -- {true, false, true, false, true, true, false, true, false, false, false, true, false}, // 35 -- {true, false, true, false, true, true, false, true, false, false, false, true, false}, // 36 -- {true, false, true, false, true, true, false, true, false, false, false, true, false}, // 37 -- {true, false, true, false, true, true, false, true, false, false, false, true, false}, // 38 -- {true, false, true, false, true, true, false, true, false, false, false, true, false}, // 39 -- {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 3A -- {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 3B -- {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 3C -- {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 3D -- {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 3E -- {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 3F -- -- {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 40 -- {true, true, true, false, false, true, false, true, false, false, true, true, false}, // 41 -- {true, true, true, false, false, true, false, true, false, false, true, true, false}, // 42 -- {true, true, true, false, false, true, false, true, false, false, true, true, false}, // 43 -- {true, true, true, false, false, true, false, true, false, false, true, true, false}, // 44 -- {true, true, true, false, false, true, false, true, false, false, true, true, false}, // 45 -- {true, true, true, false, false, true, false, true, false, false, true, true, false}, // 46 -- {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 47 -- {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 48 -- {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 49 -- {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 4A -- {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 4B -- {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 4C -- {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 4D -- {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 4E -- {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 4F -+ {true, false, true, false, true, true, false, true, false, false, false, true, false}, // 30 -+ {true, false, true, false, true, true, false, true, false, false, false, true, false}, // 31 -+ {true, false, true, false, true, true, false, true, false, false, false, true, false}, // 32 -+ {true, false, true, false, true, true, false, true, false, false, false, true, false}, // 33 -+ {true, false, true, false, true, true, false, true, false, false, false, true, false}, // 34 -+ {true, false, true, false, true, true, false, true, false, false, false, true, false}, // 35 -+ {true, false, true, false, true, true, false, true, false, false, false, true, false}, // 36 -+ {true, false, true, false, true, true, false, true, false, false, false, true, false}, // 37 -+ {true, false, true, false, true, true, false, true, false, false, false, true, false}, // 38 -+ {true, false, true, false, true, true, false, true, false, false, false, true, false}, // 39 -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 3A -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 3B -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 3C -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 3D -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 3E -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 3F -+ -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 40 -+ {true, true, true, false, false, true, false, true, false, false, true, true, false}, // 41 -+ {true, true, true, false, false, true, false, true, false, false, true, true, false}, // 42 -+ {true, true, true, false, false, true, false, true, false, false, true, true, false}, // 43 -+ {true, true, true, false, false, true, false, true, false, false, true, true, false}, // 44 -+ {true, true, true, false, false, true, false, true, false, false, true, true, false}, // 45 -+ {true, true, true, false, false, true, false, true, false, false, true, true, false}, // 46 -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 47 -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 48 -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 49 -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 4A -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 4B -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 4C -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 4D -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 4E -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 4F - -- {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 50 -- {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 51 -- {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 52 -- {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 53 -- {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 54 -- {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 55 -- {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 56 -- {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 57 -- {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 58 -- {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 59 -- {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 5A -- {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 5B -- {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 5C -- {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 5D -- {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 5E -- {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 5F -- -- {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 60 -- {true, true, true, false, false, true, true, true, false, false, false, true, false}, // 61 -- {true, true, true, false, false, true, true, true, false, false, false, true, false}, // 62 -- {true, true, true, false, false, true, true, true, false, false, false, true, false}, // 63 -- {true, true, true, false, false, true, true, true, false, false, false, true, false}, // 64 -- {true, true, true, false, false, true, true, true, false, false, false, true, false}, // 65 -- {true, true, true, false, false, true, true, true, false, false, false, true, false}, // 66 -- {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 67 -- {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 68 -- {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 69 -- {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 6A -- {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 6B -- {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 6C -- {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 6D -- {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 6E -- {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 6F -- -- {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 70 -- {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 71 -- {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 72 -- {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 73 -- {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 74 -- {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 75 -- {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 76 -- {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 77 -- {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 78 -- {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 79 -- {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 7A -- {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 7B -- {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 7C -- {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 7D -- {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 7E -- {false, false, true, false, false, true, false, true, true, true, false, false, false}, // 7F -- -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 80 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 81 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 82 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 83 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 84 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 85 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 86 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 87 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 88 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 89 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 8A -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 8B -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 8C -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 8D -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 8E -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 8F -- -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 90 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 91 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 92 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 93 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 94 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 95 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 96 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 97 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 98 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 99 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 9A -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 9B -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 9C -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 9D -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 9E -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 9F -- -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // A0 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // A1 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // A2 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // A3 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // A4 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // A5 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // A6 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // A7 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // A8 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // A9 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // AA -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // AB -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // AC -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // AD -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // AE -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // AF -- -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // B0 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // B1 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // B2 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // B3 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // B4 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // B5 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // B6 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // B7 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // B8 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // B9 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // BA -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // BB -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // BC -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // BD -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // BE -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // BF -- -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // C0 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // C1 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // C2 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // C3 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // C4 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // C5 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // C6 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // C7 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // C8 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // C9 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // CA -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // CB -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // CC -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // CD -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // CE -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // CF -- -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // D0 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // D1 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // D2 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // D3 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // D4 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // D5 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // D6 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // D7 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // D8 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // D9 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // DA -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // DB -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // DC -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // DD -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // DE -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // DF -- -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // E0 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // E1 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // E2 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // E3 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // E4 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // E5 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // E6 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // E7 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // E8 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // E9 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // EA -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // EB -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // EC -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // ED -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // EE -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // EF -- -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // F0 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // F1 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // F2 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // F3 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // F4 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // F5 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // F6 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // F7 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // F8 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // F9 -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // FA -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // FB -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // FC -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // FD -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // FE -- {false, false, false, false, false, true, false, true, true, false, false, false, false}, // FF -- -- // out of range test -- {false, false, false, false, false, false, false, false, false, false, false, false, false} // 100 -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 50 -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 51 -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 52 -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 53 -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 54 -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 55 -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 56 -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 57 -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 58 -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 59 -+ {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 5A -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 5B -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 5C -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 5D -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 5E -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 5F -+ -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 60 -+ {true, true, true, false, false, true, true, true, false, false, false, true, false}, // 61 -+ {true, true, true, false, false, true, true, true, false, false, false, true, false}, // 62 -+ {true, true, true, false, false, true, true, true, false, false, false, true, false}, // 63 -+ {true, true, true, false, false, true, true, true, false, false, false, true, false}, // 64 -+ {true, true, true, false, false, true, true, true, false, false, false, true, false}, // 65 -+ {true, true, true, false, false, true, true, true, false, false, false, true, false}, // 66 -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 67 -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 68 -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 69 -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 6A -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 6B -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 6C -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 6D -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 6E -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 6F -+ -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 70 -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 71 -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 72 -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 73 -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 74 -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 75 -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 76 -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 77 -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 78 -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 79 -+ {true, true, true, false, false, true, true, true, false, false, false, false, false}, // 7A -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 7B -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 7C -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 7D -+ {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 7E -+ {false, false, true, false, false, true, false, true, true, true, false, false, false}, // 7F -+ -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 80 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 81 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 82 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 83 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 84 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 85 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 86 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 87 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 88 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 89 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 8A -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 8B -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 8C -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 8D -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 8E -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 8F -+ -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 90 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 91 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 92 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 93 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 94 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 95 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 96 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 97 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 98 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 99 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 9A -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 9B -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 9C -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 9D -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 9E -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // 9F -+ -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // A0 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // A1 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // A2 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // A3 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // A4 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // A5 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // A6 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // A7 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // A8 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // A9 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // AA -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // AB -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // AC -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // AD -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // AE -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // AF -+ -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // B0 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // B1 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // B2 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // B3 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // B4 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // B5 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // B6 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // B7 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // B8 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // B9 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // BA -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // BB -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // BC -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // BD -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // BE -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // BF -+ -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // C0 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // C1 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // C2 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // C3 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // C4 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // C5 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // C6 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // C7 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // C8 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // C9 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // CA -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // CB -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // CC -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // CD -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // CE -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // CF -+ -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // D0 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // D1 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // D2 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // D3 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // D4 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // D5 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // D6 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // D7 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // D8 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // D9 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // DA -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // DB -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // DC -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // DD -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // DE -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // DF -+ -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // E0 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // E1 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // E2 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // E3 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // E4 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // E5 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // E6 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // E7 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // E8 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // E9 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // EA -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // EB -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // EC -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // ED -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // EE -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // EF -+ -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // F0 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // F1 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // F2 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // F3 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // F4 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // F5 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // F6 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // F7 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // F8 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // F9 -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // FA -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // FB -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // FC -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // FD -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // FE -+ {false, false, false, false, false, true, false, true, true, false, false, false, false}, // FF -+ -+ // out of range test -+ {false, false, false, false, false, false, false, false, false, false, false, false, false} // 100 - }; - - - TEST - { -- int i = 0; -+ int i = 0; - -- while (i<NUMTESTS) -- { -- // isalnum() -- ASSERT_AreEqual(testSet[i].isalnum, (isalnum(i) ? true : false), "%d", "Invalid 'isalnum(%d)' classification!" COMMA i); -+ while (i<NUMTESTS) -+ { -+ // isalnum() -+ ASSERT_AreEqual(testSet[i].isalnum, (isalnum(i) ? true : false), "%d", "Invalid 'isalnum(%d)' classification!" COMMA i); - -- // isalpha() -- ASSERT_AreEqual(testSet[i].isalpha, (isalpha(i) ? true : false), "%d", "Invalid 'isalpha(%d)' classification!" COMMA i); -+ // isalpha() -+ ASSERT_AreEqual(testSet[i].isalpha, (isalpha(i) ? true : false), "%d", "Invalid 'isalpha(%d)' classification!" COMMA i); - -- // isascii() -- ASSERT_AreEqual(testSet[i].isascii, (isascii(i) ? true : false), "%d", "Invalid 'isascii(%d)' classification!" COMMA i); -+ // isascii() -+ ASSERT_AreEqual(testSet[i].isascii, (isascii(i) ? true : false), "%d", "Invalid 'isascii(%d)' classification!" COMMA i); - -- // iscntrl() -- ASSERT_AreEqual(testSet[i].iscntrl, (iscntrl(i) ? true : false), "%d", "Invalid 'iscntrl(%d)' classification!" COMMA i); -+ // iscntrl() -+ ASSERT_AreEqual(testSet[i].iscntrl, (iscntrl(i) ? true : false), "%d", "Invalid 'iscntrl(%d)' classification!" COMMA i); - -- // isdigit() -- ASSERT_AreEqual(testSet[i].isdigit, (isdigit(i) ? true : false), "%d", "Invalid 'isdigit(%d)' classification!" COMMA i); -+ // isdigit() -+ ASSERT_AreEqual(testSet[i].isdigit, (isdigit(i) ? true : false), "%d", "Invalid 'isdigit(%d)' classification!" COMMA i); - -- // isgraph() -- ASSERT_AreEqual(testSet[i].isgraph, (isgraph(i) ? true : false), "%d", "Invalid 'isgraph(%d)' classification!" COMMA i); -+ // isgraph() -+ ASSERT_AreEqual(testSet[i].isgraph, (isgraph(i) ? true : false), "%d", "Invalid 'isgraph(%d)' classification!" COMMA i); - -- // islower() -- ASSERT_AreEqual(testSet[i].islower, (islower(i) ? true : false), "%d", "Invalid 'islower(%d)' classification!" COMMA i); -+ // islower() -+ ASSERT_AreEqual(testSet[i].islower, (islower(i) ? true : false), "%d", "Invalid 'islower(%d)' classification!" COMMA i); - -- // isprint() -- ASSERT_AreEqual(testSet[i].isprint, (isprint(i) ? true : false), "%d", "Invalid 'isprint(%d)' classification!" COMMA i); -+ // isprint() -+ ASSERT_AreEqual(testSet[i].isprint, (isprint(i) ? true : false), "%d", "Invalid 'isprint(%d)' classification!" COMMA i); - -- // ispunct() -- ASSERT_AreEqual(testSet[i].ispunct, (ispunct(i) ? true : false), "%d", "Invalid 'ispunct(%d)' classification!" COMMA i); -+ // ispunct() -+ ASSERT_AreEqual(testSet[i].ispunct, (ispunct(i) ? true : false), "%d", "Invalid 'ispunct(%d)' classification!" COMMA i); - -- // isspace() -- ASSERT_AreEqual(testSet[i].isspace, (isspace(i) ? true : false), "%d", "Invalid 'isspace(%d)' classification!" COMMA i); -+ // isspace() -+ ASSERT_AreEqual(testSet[i].isspace, (isspace(i) ? true : false), "%d", "Invalid 'isspace(%d)' classification!" COMMA i); - -- // isupper() -- ASSERT_AreEqual(testSet[i].isupper, (isupper(i) ? true : false), "%d", "Invalid 'isupper(%d)' classification!" COMMA i); -+ // isupper() -+ ASSERT_AreEqual(testSet[i].isupper, (isupper(i) ? true : false), "%d", "Invalid 'isupper(%d)' classification!" COMMA i); - -- // isxdigit() -- ASSERT_AreEqual(testSet[i].isxdigit, (isxdigit(i) ? true : false), "%d", "Invalid 'isxdigit(%d)' classification!" COMMA i); -+ // isxdigit() -+ ASSERT_AreEqual(testSet[i].isxdigit, (isxdigit(i) ? true : false), "%d", "Invalid 'isxdigit(%d)' classification!" COMMA i); - - #if __CC65_STD__ >= __CC65_STD_C99__ -- // isblank() -- ASSERT_AreEqual(testSet[i].isblank, (isblank(i) ? true : false), "%d", "Invalid 'isblank(%d)' classification!" COMMA i); -+ // isblank() -+ ASSERT_AreEqual(testSet[i].isblank, (isblank(i) ? true : false), "%d", "Invalid 'isblank(%d)' classification!" COMMA i); - #endif -- ++i; -- } -+ ++i; -+ } - } - ENDTEST --- -2.26.0 - diff --git a/0151-Fix-bug-in-tgi_line-HRS-X-parameters-are-16-bits.patch b/0151-Fix-bug-in-tgi_line-HRS-X-parameters-are-16-bits.patch deleted file mode 100644 index 7106d14..0000000 --- a/0151-Fix-bug-in-tgi_line-HRS-X-parameters-are-16-bits.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 026e57279de2aead494c93081f0a645aecbb39ae Mon Sep 17 00:00:00 2001 -From: jede <jede@oric.org> -Date: Fri, 24 Jan 2020 22:28:53 +0100 -Subject: [PATCH 151/170] Fix bug in tgi_line : HRS(X) parameters are 16 bits. - ---- - libsrc/telestrat/tgi/telestrat-228-200-3.s | 8 +++++++- - libsrc/telestrat/tgi/telestrat-240-200-2.s | 9 ++++++++- - 2 files changed, 15 insertions(+), 2 deletions(-) - -diff --git a/libsrc/telestrat/tgi/telestrat-228-200-3.s b/libsrc/telestrat/tgi/telestrat-228-200-3.s -index 228bdce9..c8c56969 100644 ---- a/libsrc/telestrat/tgi/telestrat-228-200-3.s -+++ b/libsrc/telestrat/tgi/telestrat-228-200-3.s -@@ -297,7 +297,13 @@ LINE: - lda Y2 - sta HRS4 - -- lda #$ff -+ lda #$00 -+ sta HRS1+1 -+ sta HRS2+1 -+ sta HRS3+1 -+ sta HRS4+1 -+ -+ lda #$FF - sta HRSPAT - - BRK_TELEMON(XDRAWA) -diff --git a/libsrc/telestrat/tgi/telestrat-240-200-2.s b/libsrc/telestrat/tgi/telestrat-240-200-2.s -index 9bffebb0..128003bf 100644 ---- a/libsrc/telestrat/tgi/telestrat-240-200-2.s -+++ b/libsrc/telestrat/tgi/telestrat-240-200-2.s -@@ -290,7 +290,14 @@ LINE: - lda Y2 - sta HRS4 - -- lda #$ff -+ -+ lda #$00 -+ sta HRS1+1 -+ sta HRS2+1 -+ sta HRS3+1 -+ sta HRS4+1 -+ -+ lda #$FF - sta HRSPAT - - BRK_TELEMON(XDRAWA) --- -2.26.0 - diff --git a/0152-Fix-16-bits-values.patch b/0152-Fix-16-bits-values.patch deleted file mode 100644 index bc2d2fc..0000000 --- a/0152-Fix-16-bits-values.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 0962a9f286b483d35cd854ad1091115e47f9c2e8 Mon Sep 17 00:00:00 2001 -From: jede <jede@oric.org> -Date: Tue, 28 Jan 2020 13:24:06 +0100 -Subject: [PATCH 152/170] Fix 16 bits values - ---- - libsrc/telestrat/tgi/telestrat-228-200-3.s | 12 +++++++++--- - libsrc/telestrat/tgi/telestrat-240-200-2.s | 8 +++++++- - 2 files changed, 16 insertions(+), 4 deletions(-) - -diff --git a/libsrc/telestrat/tgi/telestrat-228-200-3.s b/libsrc/telestrat/tgi/telestrat-228-200-3.s -index c8c56969..34af597e 100644 ---- a/libsrc/telestrat/tgi/telestrat-228-200-3.s -+++ b/libsrc/telestrat/tgi/telestrat-228-200-3.s -@@ -296,12 +296,18 @@ LINE: - sta HRS3 - lda Y2 - sta HRS4 -- -- lda #$00 -+ -+ lda X1+1 - sta HRS1+1 -+ -+ lda Y1+1 - sta HRS2+1 -+ -+ lda X2+1 - sta HRS3+1 -- sta HRS4+1 -+ -+ lda Y2+1 -+ sta HRS4+1 - - lda #$FF - sta HRSPAT -diff --git a/libsrc/telestrat/tgi/telestrat-240-200-2.s b/libsrc/telestrat/tgi/telestrat-240-200-2.s -index 128003bf..345f80e0 100644 ---- a/libsrc/telestrat/tgi/telestrat-240-200-2.s -+++ b/libsrc/telestrat/tgi/telestrat-240-200-2.s -@@ -291,10 +291,16 @@ LINE: - sta HRS4 - - -- lda #$00 -+ lda X1+1 - sta HRS1+1 -+ -+ lda Y1+1 - sta HRS2+1 -+ -+ lda X2+1 - sta HRS3+1 -+ -+ lda Y2+1 - sta HRS4+1 - - lda #$FF --- -2.26.0 - diff --git a/0153-Normalized-Atari-naming.patch b/0153-Normalized-Atari-naming.patch deleted file mode 100644 index 869a9e6..0000000 --- a/0153-Normalized-Atari-naming.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 857a566a2ee2202a392471fd86e4129c9076d695 Mon Sep 17 00:00:00 2001 -From: Oliver Schmidt <ol.sc@web.de> -Date: Mon, 17 Feb 2020 11:07:52 +0100 -Subject: [PATCH 153/170] Normalized Atari naming. - ---- - README.md | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/README.md b/README.md -index 7b3ea342..3d78fda5 100644 ---- a/README.md -+++ b/README.md -@@ -22,7 +22,7 @@ including - - the 600/700 family - - newer PET machines (not 2001). - - the Apple ]\[+ and successors. --- the Atari 8 bit machines. -+- the Atari 8-bit machines. - - the Atari 2600 console. - - the Atari 5200 console. - - GEOS for the C64, C128 and Apple //e. --- -2.26.0 - diff --git a/0154-Fixed-a-typo-in-commit-2e5fbe89cd3f67b06b292936dfdf4.patch b/0154-Fixed-a-typo-in-commit-2e5fbe89cd3f67b06b292936dfdf4.patch deleted file mode 100644 index d12f645..0000000 --- a/0154-Fixed-a-typo-in-commit-2e5fbe89cd3f67b06b292936dfdf4.patch +++ /dev/null @@ -1,27 +0,0 @@ -From e2c664860781747eb247770bc766c7f0c5351a62 Mon Sep 17 00:00:00 2001 -From: Greg King <gregdk@users.sf.net> -Date: Fri, 21 Feb 2020 08:12:05 -0500 -Subject: [PATCH 154/170] Fixed a typo in commit - 2e5fbe89cd3f67b06b292936dfdf4fdb104b7112. - -Changed a && to ||. ---- - src/common/cpu.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/common/cpu.c b/src/common/cpu.c -index c1ff400b..b4c5c8df 100644 ---- a/src/common/cpu.c -+++ b/src/common/cpu.c -@@ -104,7 +104,7 @@ int ValidAddrSizeForCPU (unsigned char AddrSize) - - case ADDR_SIZE_FAR: - /* Supported by "none" and 65816 */ -- return (CPU == CPU_NONE && CPU == CPU_65816); -+ return (CPU == CPU_NONE || CPU == CPU_65816); - - case ADDR_SIZE_LONG: - /* "none" supports all sizes */ --- -2.26.0 - diff --git a/0155-Made-use-of-65C02-opcode-thx-to-polluks.patch b/0155-Made-use-of-65C02-opcode-thx-to-polluks.patch deleted file mode 100644 index 1aa6432..0000000 --- a/0155-Made-use-of-65C02-opcode-thx-to-polluks.patch +++ /dev/null @@ -1,25 +0,0 @@ -From b91ad02da1759ddc81d484fe0bfc4d0aaf98b897 Mon Sep 17 00:00:00 2001 -From: Oliver Schmidt <ol.sc@web.de> -Date: Thu, 5 Mar 2020 14:38:12 +0100 -Subject: [PATCH 155/170] Made use of 65C02 opcode (thx to polluks). - ---- - libsrc/apple2/videomode.s | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libsrc/apple2/videomode.s b/libsrc/apple2/videomode.s -index 65e58254..13151a48 100644 ---- a/libsrc/apple2/videomode.s -+++ b/libsrc/apple2/videomode.s -@@ -62,7 +62,7 @@ _videomode: - done: lda #$11 ; Ctrl-char code for 40 cols - plp - bpl :+ -- lda #$12 ; Ctrl-char code for 80 cols -+ inc a ; Ctrl-char code for 80 cols - : rts ; X was preserved all the way - - .endif ; __APPLE2ENH__ --- -2.26.0 - diff --git a/0156-Fixed-an-error-message-printer.patch b/0156-Fixed-an-error-message-printer.patch deleted file mode 100644 index af044e5..0000000 --- a/0156-Fixed-an-error-message-printer.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 2fc24847acc0e7d8718059f33b1d431d557050ef Mon Sep 17 00:00:00 2001 -From: Greg King <gregdk@users.sf.net> -Date: Wed, 11 Mar 2020 17:28:42 -0400 -Subject: [PATCH 156/170] Fixed an error message printer. - -The disassembler can be built and won't crash if it sees duplicate labels, and one of them is an unnamed label. ---- - src/da65/labels.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/src/da65/labels.c b/src/da65/labels.c -index 97e195eb..542205c1 100644 ---- a/src/da65/labels.c -+++ b/src/da65/labels.c -@@ -97,7 +97,9 @@ static void AddLabel (unsigned Addr, attr_t Attr, const char* Name) - strcmp (SymTab[Addr], Name) == 0))) { - return; - } -- Error ("Duplicate label for address $%04X: %s/%s", Addr, SymTab[Addr], Name); -+ Error ("Duplicate label for address $%04X (%s): '%s'", Addr, -+ SymTab[Addr] == 0 ? "<unnamed label>" : SymTab[Addr], -+ Name == 0 ? "<unnamed label>" : Name); - } - - /* Create a new label (xstrdup will return NULL if input NULL) */ --- -2.26.0 - diff --git a/0157-SEGMENT-start-of-0-should-be-valid.patch b/0157-SEGMENT-start-of-0-should-be-valid.patch deleted file mode 100644 index 7ba45a4..0000000 --- a/0157-SEGMENT-start-of-0-should-be-valid.patch +++ /dev/null @@ -1,25 +0,0 @@ -From e0cb33d9d486fe7e8c48d89a61ca4caff239d2e4 Mon Sep 17 00:00:00 2001 -From: bbbradsmith <bbbradsmith@users.noreply.github.com> -Date: Sat, 21 Mar 2020 17:11:20 -0400 -Subject: [PATCH 157/170] SEGMENT start of 0 should be valid - ---- - src/ld65/config.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/ld65/config.c b/src/ld65/config.c -index b8699a87..6606f697 100644 ---- a/src/ld65/config.c -+++ b/src/ld65/config.c -@@ -753,7 +753,7 @@ static void ParseSegments (void) - - case CFGTOK_START: - FlagAttr (&S->Attr, SA_START, "START"); -- S->Addr = CfgCheckedConstExpr (1, 0x1000000); -+ S->Addr = CfgCheckedConstExpr (0, 0x1000000); - S->Flags |= SF_START; - break; - --- -2.26.0 - diff --git a/0158-fix-whitespace.patch b/0158-fix-whitespace.patch deleted file mode 100644 index 905d223..0000000 --- a/0158-fix-whitespace.patch +++ /dev/null @@ -1,25 +0,0 @@ -From beaa77d2d6c119da0251de254bc1b8b751129a7a Mon Sep 17 00:00:00 2001 -From: Dirk Jagdmann <doj@cubic.org> -Date: Mon, 23 Mar 2020 03:04:48 -0700 -Subject: [PATCH 158/170] fix whitespace - ---- - doc/coding.sgml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/doc/coding.sgml b/doc/coding.sgml -index dc07c091..57961209 100644 ---- a/doc/coding.sgml -+++ b/doc/coding.sgml -@@ -251,7 +251,7 @@ Register variables may give faster and shorter code, but they do also have an - overhead. Register variables are actually zero page locations, so using them - saves roughly one cycle per access. The calling routine may also use register - variables, so the old values have to be saved on function entry and restored --on exit. Saving an d restoring has an overhead of about 70 cycles per 2 byte -+on exit. Saving and restoring has an overhead of about 70 cycles per 2 byte - variable. It is easy to see, that - apart from the additional code that is - needed to save and restore the values - you need to make heavy use of a - variable to justify the overhead. --- -2.26.0 - diff --git a/0159-Update-get_ostype.s.patch b/0159-Update-get_ostype.s.patch deleted file mode 100644 index 3bd3d05..0000000 --- a/0159-Update-get_ostype.s.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 62eb3137abee926ed25e87574d6c1882c6c634df Mon Sep 17 00:00:00 2001 -From: Jeremy Rand <jeremy@rand-family.com> -Date: Tue, 24 Mar 2020 23:39:57 -0400 -Subject: [PATCH 159/170] Update get_ostype.s - -Do not check $fbbe when detecting the Apple //e card. This byte is a version number for the Apple //e card according to misc technote #7 and it appears that the last version of the software that I am aware of has a 3 at this location. - -Prior to this change, Apple //e cards which we not version 0 would be detected as an Apple //e enhanced. ---- - libsrc/apple2/get_ostype.s | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/libsrc/apple2/get_ostype.s b/libsrc/apple2/get_ostype.s -index b54e38d6..192fa360 100644 ---- a/libsrc/apple2/get_ostype.s -+++ b/libsrc/apple2/get_ostype.s -@@ -36,7 +36,7 @@ index: .byte $B3, $00 ; Apple ][ - .byte $B3, $1E, $00 ; Apple ][+ - .byte $B3, $1E, $00 ; Apple /// (emulation) - .byte $B3, $C0, $00 ; Apple //e -- .byte $B3, $C0, $DD, $BE, $00 ; Apple //e Option Card -+ .byte $B3, $C0, $DD, $00 ; Apple //e Option Card - .byte $B3, $C0, $00 ; Apple //e (enhanced) - .byte $B3, $C0, $BF, $00 ; Apple //c - .byte $B3, $C0, $BF, $00 ; Apple //c (3.5 ROM) -@@ -49,7 +49,7 @@ value: .byte $38, $10 ; Apple ][ - .byte $EA, $AD, $11 ; Apple ][+ - .byte $EA, $8A, $20 ; Apple /// (emulation) - .byte $06, $EA, $30 ; Apple //e -- .byte $06, $E0, $02, $00, $40 ; Apple //e Option Card -+ .byte $06, $E0, $02, $40 ; Apple //e Option Card - .byte $06, $E0, $31 ; Apple //e (enhanced) - .byte $06, $00, $FF, $50 ; Apple //c - .byte $06, $00, $00, $51 ; Apple //c (3.5 ROM) --- -2.26.0 - diff --git a/0160-Adjusted-comments-due-to-recent-change.patch b/0160-Adjusted-comments-due-to-recent-change.patch deleted file mode 100644 index 0fcc082..0000000 --- a/0160-Adjusted-comments-due-to-recent-change.patch +++ /dev/null @@ -1,69 +0,0 @@ -From a53bd345d855fdc175ed050cb4cd5b63427143fe Mon Sep 17 00:00:00 2001 -From: Oliver Schmidt <ol.sc@web.de> -Date: Thu, 26 Mar 2020 12:29:56 +0100 -Subject: [PATCH 160/170] Adjusted comments due to recent change. - ---- - libsrc/apple2/get_ostype.s | 44 +++++++++++++++++++------------------- - 1 file changed, 22 insertions(+), 22 deletions(-) - -diff --git a/libsrc/apple2/get_ostype.s b/libsrc/apple2/get_ostype.s -index 192fa360..dd44aa83 100644 ---- a/libsrc/apple2/get_ostype.s -+++ b/libsrc/apple2/get_ostype.s -@@ -32,30 +32,30 @@ next: inx - bne :- - beq next ; Branch always - --index: .byte $B3, $00 ; Apple ][ -- .byte $B3, $1E, $00 ; Apple ][+ -- .byte $B3, $1E, $00 ; Apple /// (emulation) -- .byte $B3, $C0, $00 ; Apple //e -- .byte $B3, $C0, $DD, $00 ; Apple //e Option Card -- .byte $B3, $C0, $00 ; Apple //e (enhanced) -- .byte $B3, $C0, $BF, $00 ; Apple //c -- .byte $B3, $C0, $BF, $00 ; Apple //c (3.5 ROM) -- .byte $B3, $C0, $BF, $00 ; Apple //c (Mem. Exp.) -- .byte $B3, $C0, $BF, $00 ; Apple //c (Rev. Mem. Exp.) -- .byte $B3, $C0, $BF, $00 ; Apple //c Plus -+index: .byte $B3, $00 ; Apple ][ -+ .byte $B3, $1E, $00 ; Apple ][+ -+ .byte $B3, $1E, $00 ; Apple /// (emulation) -+ .byte $B3, $C0, $00 ; Apple //e -+ .byte $B3, $C0, $DD, $00 ; Apple //e Option Card -+ .byte $B3, $C0, $00 ; Apple //e (enhanced) -+ .byte $B3, $C0, $BF, $00 ; Apple //c -+ .byte $B3, $C0, $BF, $00 ; Apple //c (3.5 ROM) -+ .byte $B3, $C0, $BF, $00 ; Apple //c (Mem. Exp.) -+ .byte $B3, $C0, $BF, $00 ; Apple //c (Rev. Mem. Exp.) -+ .byte $B3, $C0, $BF, $00 ; Apple //c Plus - .byte $00 - --value: .byte $38, $10 ; Apple ][ -- .byte $EA, $AD, $11 ; Apple ][+ -- .byte $EA, $8A, $20 ; Apple /// (emulation) -- .byte $06, $EA, $30 ; Apple //e -- .byte $06, $E0, $02, $40 ; Apple //e Option Card -- .byte $06, $E0, $31 ; Apple //e (enhanced) -- .byte $06, $00, $FF, $50 ; Apple //c -- .byte $06, $00, $00, $51 ; Apple //c (3.5 ROM) -- .byte $06, $00, $03, $53 ; Apple //c (Mem. Exp.) -- .byte $06, $00, $04, $54 ; Apple //c (Rev. Mem. Exp.) -- .byte $06, $00, $05, $55 ; Apple //c Plus -+value: .byte $38, $10 ; Apple ][ -+ .byte $EA, $AD, $11 ; Apple ][+ -+ .byte $EA, $8A, $20 ; Apple /// (emulation) -+ .byte $06, $EA, $30 ; Apple //e -+ .byte $06, $E0, $02, $40 ; Apple //e Option Card -+ .byte $06, $E0, $31 ; Apple //e (enhanced) -+ .byte $06, $00, $FF, $50 ; Apple //c -+ .byte $06, $00, $00, $51 ; Apple //c (3.5 ROM) -+ .byte $06, $00, $03, $53 ; Apple //c (Mem. Exp.) -+ .byte $06, $00, $04, $54 ; Apple //c (Rev. Mem. Exp.) -+ .byte $06, $00, $05, $55 ; Apple //c Plus - .byte $00 - - .code --- -2.26.0 - diff --git a/0161-cc65-inline-asm-stp-mnemonic-support.patch b/0161-cc65-inline-asm-stp-mnemonic-support.patch deleted file mode 100644 index 4233a7c..0000000 --- a/0161-cc65-inline-asm-stp-mnemonic-support.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 68ff89ba0a36b7d5d57d64077dfbb477215fd74a Mon Sep 17 00:00:00 2001 -From: "marko.lauke" <marko.lauke@googlemail.com> -Date: Fri, 13 Mar 2020 00:42:27 +0100 -Subject: [PATCH 161/170] +cc65 inline asm stp mnemonic support - ---- - src/cc65/codeent.c | 3 +++ - src/cc65/opcodes.c | 7 +++++++ - src/cc65/opcodes.h | 1 + - 3 files changed, 11 insertions(+) - -diff --git a/src/cc65/codeent.c b/src/cc65/codeent.c -index 729248e9..7df164cc 100644 ---- a/src/cc65/codeent.c -+++ b/src/cc65/codeent.c -@@ -615,6 +615,9 @@ void CE_GenRegInfo (CodeEntry* E, RegContents* InputRegs) - case OP65_BRK: - break; - -+ case OP65_STP: -+ break; -+ - case OP65_BVC: - break; - -diff --git a/src/cc65/opcodes.c b/src/cc65/opcodes.c -index a7b91ca9..792b92f7 100644 ---- a/src/cc65/opcodes.c -+++ b/src/cc65/opcodes.c -@@ -502,6 +502,13 @@ const OPCDesc OPCTable[OP65_COUNT] = { - REG_NONE, /* chg */ - OF_STORE /* flags */ - }, -+ { OP65_STP, /* opcode */ -+ "stp", /* mnemonic */ -+ 1, /* size */ -+ REG_NONE, /* use */ -+ REG_NONE, /* chg */ -+ OF_NONE /* flags */ -+ }, - { OP65_STX, /* opcode */ - "stx", /* mnemonic */ - 0, /* size */ -diff --git a/src/cc65/opcodes.h b/src/cc65/opcodes.h -index 0d191f6c..8267d955 100644 ---- a/src/cc65/opcodes.h -+++ b/src/cc65/opcodes.h -@@ -114,6 +114,7 @@ typedef enum { - OP65_SED, - OP65_SEI, - OP65_STA, -+ OP65_STP, /* 65c02, 65816 stop */ - OP65_STX, - OP65_STY, - OP65_STZ, --- -2.26.0 - diff --git a/0162-code-style.patch b/0162-code-style.patch deleted file mode 100644 index 31a0a44..0000000 --- a/0162-code-style.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 3e1284093359f1b57a1032f5708e76d9ca43ff2c Mon Sep 17 00:00:00 2001 -From: "marko.lauke" <marko.lauke@googlemail.com> -Date: Sat, 21 Mar 2020 20:26:34 +0100 -Subject: [PATCH 162/170] +code style - ---- - src/cc65/codeent.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src/cc65/codeent.c b/src/cc65/codeent.c -index 7df164cc..51f5f137 100644 ---- a/src/cc65/codeent.c -+++ b/src/cc65/codeent.c -@@ -615,9 +615,6 @@ void CE_GenRegInfo (CodeEntry* E, RegContents* InputRegs) - case OP65_BRK: - break; - -- case OP65_STP: -- break; -- - case OP65_BVC: - break; - -@@ -1141,6 +1138,9 @@ void CE_GenRegInfo (CodeEntry* E, RegContents* InputRegs) - } - break; - -+ case OP65_STP: -+ break; -+ - case OP65_STX: - if (E->AM == AM65_ZP) { - switch (GetKnownReg (E->Chg & REG_ZP, 0)) { --- -2.26.0 - diff --git a/0163-Aligned-comment.patch b/0163-Aligned-comment.patch deleted file mode 100644 index dbc7f8e..0000000 --- a/0163-Aligned-comment.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 4ea2bfef0a80b253d9af81677a524fd1ab1a8670 Mon Sep 17 00:00:00 2001 -From: greg-king5 <greg.king5@verizon.net> -Date: Thu, 26 Mar 2020 22:54:58 -0400 -Subject: [PATCH 163/170] Aligned comment. - ---- - src/cc65/opcodes.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/cc65/opcodes.h b/src/cc65/opcodes.h -index 8267d955..bdb0c28a 100644 ---- a/src/cc65/opcodes.h -+++ b/src/cc65/opcodes.h -@@ -114,7 +114,7 @@ typedef enum { - OP65_SED, - OP65_SEI, - OP65_STA, -- OP65_STP, /* 65c02, 65816 stop */ -+ OP65_STP, /* 65c02, 65816 stop */ - OP65_STX, - OP65_STY, - OP65_STZ, --- -2.26.0 - diff --git a/0164-Added-missing-tag-and-itemize-Linuxdoc-tags-to-some-.patch b/0164-Added-missing-tag-and-itemize-Linuxdoc-tags-to-some-.patch deleted file mode 100644 index 604d112..0000000 --- a/0164-Added-missing-tag-and-itemize-Linuxdoc-tags-to-some-.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 8b5a2f135cdbbafb829c1a3f4fd1518a2042eb56 Mon Sep 17 00:00:00 2001 -From: Greg King <gregdk@users.sf.net> -Date: Fri, 27 Mar 2020 00:59:15 -0400 -Subject: [PATCH 164/170] Added missing <tag> and <itemize> Linuxdoc tags to - some ctype.h function descriptions. - ---- - doc/funcref.sgml | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/doc/funcref.sgml b/doc/funcref.sgml -index 94e85009..a954c658 100644 ---- a/doc/funcref.sgml -+++ b/doc/funcref.sgml -@@ -4294,7 +4294,8 @@ fastcall function, so it may only be used in presence of a prototype. - <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/ - <tag/Declaration/<tt/int __fastcall__ isascii (int c);/ - <tag/Description/The function returns a non zero value if the given argument --is in the range 0..127 (the range of valid ASCII characters) and zero if not. -+is in the range 0..127 (the range of valid ASCII characters), and zero if not. -+<tag/Notes/<itemize> - <item>When compiling without <tt/-Os/, the function is only available as - fastcall function, so it may only be used in presence of a prototype. - </itemize> -@@ -4392,6 +4393,7 @@ fastcall function, so it may only be used in presence of a prototype. - <tag/Declaration/<tt/int __fastcall__ isdigit (int c);/ - <tag/Description/The function returns a non zero value if the given argument - is a digit. The return value is zero if the character is anything else. -+<tag/Notes/<itemize> - <item>When compiling without <tt/-Os/, the function is only available as - fastcall function, so it may only be used in presence of a prototype. - </itemize> --- -2.26.0 - diff --git a/0165-fix-the-clean-target-to-remove-any-disk-images.patch b/0165-fix-the-clean-target-to-remove-any-disk-images.patch deleted file mode 100644 index 51ea0ab..0000000 --- a/0165-fix-the-clean-target-to-remove-any-disk-images.patch +++ /dev/null @@ -1,50 +0,0 @@ -From c15f4975d0a6d31a03f4c23ce5655f9615224997 Mon Sep 17 00:00:00 2001 -From: Dirk Jagdmann <doj@cubic.org> -Date: Sun, 29 Mar 2020 13:09:57 -0700 -Subject: [PATCH 165/170] fix the clean: target to remove any disk images. - ---- - samples/Makefile | 12 ++++++------ - samples/README | 1 + - 2 files changed, 7 insertions(+), 6 deletions(-) - -diff --git a/samples/Makefile b/samples/Makefile -index 69efbe43..adfe870e 100644 ---- a/samples/Makefile -+++ b/samples/Makefile -@@ -92,14 +92,14 @@ ifneq ($(filter disk samples.%,$(MAKECMDGOALS)),) - - # For this one, see https://www.horus.com/~hias/atari/ - DIR2ATR ?= dir2atr -- -- DISK_c64 = samples.d64 -- DISK_apple2 = samples.dsk -- DISK_apple2enh = samples.dsk -- DISK_atari = samples.atr -- DISK_atarixl = samples.atr - endif - -+DISK_c64 = samples.d64 -+DISK_apple2 = samples.dsk -+DISK_apple2enh = samples.dsk -+DISK_atari = samples.atr -+DISK_atarixl = samples.atr -+ - # -------------------------------------------------------------------------- - # System-dependent settings - # For convenience, these groups and lines are sorted alphabetically, first -diff --git a/samples/README b/samples/README -index 7ace7da3..73d048fc 100644 ---- a/samples/README -+++ b/samples/README -@@ -16,6 +16,7 @@ Please note: - at the top of the makefile, specify the system with SYS=<target> on the - make command line, or set a SYS environment variable. - -+ * Use "make disk" to build a disk image with all sample programs. - - List of supplied sample programs: - --- -2.26.0 - diff --git a/0166-Matched-comment-to-the-one-in-the-C-header-file.patch b/0166-Matched-comment-to-the-one-in-the-C-header-file.patch deleted file mode 100644 index 6e9256a..0000000 --- a/0166-Matched-comment-to-the-one-in-the-C-header-file.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 4cc95a2c6ce814a3882121b05db88d95b89822aa Mon Sep 17 00:00:00 2001 -From: Oliver Schmidt <ol.sc@web.de> -Date: Thu, 2 Apr 2020 09:45:11 +0200 -Subject: [PATCH 166/170] Matched comment to the one in the C header file. - ---- - libsrc/apple2/dosdetect.s | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/libsrc/apple2/dosdetect.s b/libsrc/apple2/dosdetect.s -index 46fbb548..44e46b2b 100644 ---- a/libsrc/apple2/dosdetect.s -+++ b/libsrc/apple2/dosdetect.s -@@ -14,10 +14,11 @@ - ; ProDOS 8 1.6 - $16 - ; ProDOS 8 1.7 - $17 - ; ProDOS 8 1.8 - $18 --; ProDOS 8 1.9 - $18 -+; ProDOS 8 1.9 - $18 (!) - ; ProDOS 8 2.0.1 - $21 - ; ProDOS 8 2.0.2 - $22 - ; ProDOS 8 2.0.3 - $23 -+; ProDOS 8 2.4.x - $24 - ; - - .constructor initdostype, 25 --- -2.26.0 - diff --git a/0167-Some-style-adjustments.patch b/0167-Some-style-adjustments.patch deleted file mode 100644 index 23fd005..0000000 --- a/0167-Some-style-adjustments.patch +++ /dev/null @@ -1,421 +0,0 @@ -From 65dd931d22b7196a0b6a4de8d6d441e15acfdab1 Mon Sep 17 00:00:00 2001 -From: Oliver Schmidt <ol.sc@web.de> -Date: Thu, 2 Apr 2020 10:03:01 +0200 -Subject: [PATCH 167/170] Some style adjustments. - ---- - libsrc/atari/ostype.s | 4 ++-- - libsrc/common/atoi.s | 8 +++----- - libsrc/common/ctype_preprocessor.s | 10 +++++----- - libsrc/common/isalnum.s | 2 +- - libsrc/common/isalpha.s | 2 +- - libsrc/common/isblank.s | 4 ++-- - libsrc/common/iscntrl.s | 2 +- - libsrc/common/isdigit.s | 4 ++-- - libsrc/common/isgraph.s | 3 +-- - libsrc/common/islower.s | 2 +- - libsrc/common/isprint.s | 2 +- - libsrc/common/ispunct.s | 2 +- - libsrc/common/isspace.s | 4 ++-- - libsrc/common/isupper.s | 2 +- - libsrc/common/isxdigit.s | 2 +- - libsrc/common/strlower.s | 9 +++------ - libsrc/common/strnicmp.s | 20 ++++++++++---------- - libsrc/common/strupper.s | 7 ++----- - libsrc/lynx/crt0.s | 2 +- - 19 files changed, 41 insertions(+), 50 deletions(-) - -diff --git a/libsrc/atari/ostype.s b/libsrc/atari/ostype.s -index 7248582a..876e8749 100644 ---- a/libsrc/atari/ostype.s -+++ b/libsrc/atari/ostype.s -@@ -93,7 +93,7 @@ _get_ostype: - asl a - asl a - and #%00111000 -- ora #%11 -+ ora #%00000011 - _fin: ldx #0 - disable_rom_save_a - rts -@@ -117,7 +117,7 @@ _1200_11: - lda #%00010000 - - _1200_fin: -- ora #%010 -+ ora #%00000010 - bne _fin - - ; 400/800 ROM -diff --git a/libsrc/common/atoi.s b/libsrc/common/atoi.s -index b63fcb20..10f917f8 100644 ---- a/libsrc/common/atoi.s -+++ b/libsrc/common/atoi.s -@@ -15,7 +15,7 @@ - ; - - _atoi: --_atol: sta ptr1 ; Store s -+_atol: sta ptr1 ; store s - stx ptr1+1 - ldy #0 - sty ptr2 -@@ -71,7 +71,7 @@ L6: lda (ptr1),y ; get next char - lda ptr2+1 - pha - lda ptr2 -- pha ; Save value -+ pha ; save value - - jsr mul2 ; * 4 - jsr mul2 ; * 8 -@@ -118,7 +118,7 @@ L8: lda ptr2 - ; Negate the value if necessary, otherwise we're done - - ldy tmp1 ; sign -- beq L9 ; Branch if positive -+ beq L9 ; branch if positive - - ; Negate the 32 bit value in ptr2/sreg - -@@ -133,5 +133,3 @@ mul2: asl ptr2 - rol sreg - rol sreg+1 ; * 2 - L9: rts -- -- -diff --git a/libsrc/common/ctype_preprocessor.s b/libsrc/common/ctype_preprocessor.s -index efa001e6..79d93860 100644 ---- a/libsrc/common/ctype_preprocessor.s -+++ b/libsrc/common/ctype_preprocessor.s -@@ -29,7 +29,7 @@ ctype_preprocessor: - ctype_preprocessor_no_check: - lsr a - tax -- lda __ctypeIdx, x -+ lda __ctypeIdx,x - bcc @lowerNibble - @upperNibble: - lsr a -@@ -38,13 +38,13 @@ ctype_preprocessor_no_check: - lsr a - clc ; remove out of bounds flag - @lowerNibble: -- and #%1111 -+ and #%00001111 - tax -- lda __ctype, x -- ldx #0 -+ lda __ctype,x -+ ldx #$00 - rts - - SC: sec -- lda #0 -+ lda #$00 - tax - rts -diff --git a/libsrc/common/isalnum.s b/libsrc/common/isalnum.s -index 141949c0..2a05e32e 100644 ---- a/libsrc/common/isalnum.s -+++ b/libsrc/common/isalnum.s -@@ -15,7 +15,7 @@ - .import ctype_preprocessor - - _isalnum: -- jsr ctype_preprocessor ; (clears always x) -+ jsr ctype_preprocessor ; (always clears X) - bcs @L1 ; out of range? (everything already clear -> false) - and #CT_ALNUM ; mask character/digit bits - @L1: rts -diff --git a/libsrc/common/isalpha.s b/libsrc/common/isalpha.s -index 95e79916..7a1f79d2 100644 ---- a/libsrc/common/isalpha.s -+++ b/libsrc/common/isalpha.s -@@ -15,7 +15,7 @@ - .import ctype_preprocessor - - _isalpha: -- jsr ctype_preprocessor ; (clears always x) -+ jsr ctype_preprocessor ; (always clears X) - bcs @L1 ; out of range? (everything already clear -> false) - and #CT_ALPHA ; mask character bits - @L1: rts -diff --git a/libsrc/common/isblank.s b/libsrc/common/isblank.s -index 3d0a02f3..cc5b9e5a 100644 ---- a/libsrc/common/isblank.s -+++ b/libsrc/common/isblank.s -@@ -17,7 +17,7 @@ - .import ctype_preprocessor - - _isblank: -- jsr ctype_preprocessor ; (clears always x) -+ jsr ctype_preprocessor ; (always clears X) - bcs @L1 ; out of range? (everything already clear -> false) - and #CT_SPACE_TAB ; mask blank bit -- @L1: rts -+@L1: rts -diff --git a/libsrc/common/iscntrl.s b/libsrc/common/iscntrl.s -index f2b95042..65e2111b 100644 ---- a/libsrc/common/iscntrl.s -+++ b/libsrc/common/iscntrl.s -@@ -15,7 +15,7 @@ - .import ctype_preprocessor - - _iscntrl: -- jsr ctype_preprocessor ; (clears always x) -+ jsr ctype_preprocessor ; (always clears X) - bcs @L1 ; out of range? (everything already clear -> false) - and #CT_CTRL ; mask control character bit - @L1: rts -diff --git a/libsrc/common/isdigit.s b/libsrc/common/isdigit.s -index 36acd73b..76b2d1b2 100644 ---- a/libsrc/common/isdigit.s -+++ b/libsrc/common/isdigit.s -@@ -15,7 +15,7 @@ - .import ctype_preprocessor - - _isdigit: -- jsr ctype_preprocessor ; (clears always x) -+ jsr ctype_preprocessor ; (always clears X) - bcs @L1 ; out of range? (everything already clear -> false) - and #CT_DIGIT ; mask digit bit -- @L1: rts -+@L1: rts -diff --git a/libsrc/common/isgraph.s b/libsrc/common/isgraph.s -index 4e317db5..6dd91ed3 100644 ---- a/libsrc/common/isgraph.s -+++ b/libsrc/common/isgraph.s -@@ -15,11 +15,10 @@ - .import ctype_preprocessor - - _isgraph: -- jsr ctype_preprocessor ; (clears always x) -+ jsr ctype_preprocessor ; (always clears X) - bcs @L1 ; out of range? (everything already clear -> false) - and #CT_CTRL_SPACE ; mask character bits - cmp #1 ; if false, then set "borrow" flag - lda #0 - sbc #0 ; invert logic (return NOT control and NOT space) - @L1: rts -- -diff --git a/libsrc/common/islower.s b/libsrc/common/islower.s -index 608d0ccf..a11ee129 100644 ---- a/libsrc/common/islower.s -+++ b/libsrc/common/islower.s -@@ -15,7 +15,7 @@ - .import ctype_preprocessor - - _islower: -- jsr ctype_preprocessor ; (clears always x) -+ jsr ctype_preprocessor ; (always clears X) - bcs @L1 ; out of range? (everything already clear -> false) - and #CT_LOWER ; mask lower char bit - @L1: rts -diff --git a/libsrc/common/isprint.s b/libsrc/common/isprint.s -index 0d135f24..e1d63bc6 100644 ---- a/libsrc/common/isprint.s -+++ b/libsrc/common/isprint.s -@@ -15,7 +15,7 @@ - .import ctype_preprocessor - - _isprint: -- jsr ctype_preprocessor ; (clears always x) -+ jsr ctype_preprocessor ; (always clears X) - bcs @L1 ; out of range? (everything already clear -> false) - eor #CT_CTRL ; NOT a control char - and #CT_CTRL ; mask control char bit -diff --git a/libsrc/common/ispunct.s b/libsrc/common/ispunct.s -index a532399f..ac4ab7f1 100644 ---- a/libsrc/common/ispunct.s -+++ b/libsrc/common/ispunct.s -@@ -15,7 +15,7 @@ - .import ctype_preprocessor - - _ispunct: -- jsr ctype_preprocessor ; (clears always x) -+ jsr ctype_preprocessor ; (always clears X) - bcs @L1 ; out of range? (everything already clear -> false) - and #CT_NOT_PUNCT ; mask relevant bits - cmp #1 ; if false, then set "borrow" flag -diff --git a/libsrc/common/isspace.s b/libsrc/common/isspace.s -index 1f70786c..c3702344 100644 ---- a/libsrc/common/isspace.s -+++ b/libsrc/common/isspace.s -@@ -15,7 +15,7 @@ - .import ctype_preprocessor - - _isspace: -- jsr ctype_preprocessor ; (clears always x) -+ jsr ctype_preprocessor ; (always clears X) - bcs @L1 ; out of range? (everything already clear -> false) - and #(CT_SPACE | CT_OTHER_WS) ; mask space bits -- @L1: rts -+@L1: rts -diff --git a/libsrc/common/isupper.s b/libsrc/common/isupper.s -index 0dd2a6ea..175fb872 100644 ---- a/libsrc/common/isupper.s -+++ b/libsrc/common/isupper.s -@@ -15,7 +15,7 @@ - .import ctype_preprocessor - - _isupper: -- jsr ctype_preprocessor ; (clears always x) -+ jsr ctype_preprocessor ; (always clears X) - bcs @L1 ; out of range? (everything already clear -> false) - and #CT_UPPER ; mask upper char bit - @L1: rts -diff --git a/libsrc/common/isxdigit.s b/libsrc/common/isxdigit.s -index 3f36ede0..e8a12a10 100644 ---- a/libsrc/common/isxdigit.s -+++ b/libsrc/common/isxdigit.s -@@ -15,7 +15,7 @@ - .import ctype_preprocessor - - _isxdigit: -- jsr ctype_preprocessor ; (clears always x) -+ jsr ctype_preprocessor ; (always clears X) - bcs @L1 ; out of range? (everything already clear -> false) - and #CT_XDIGIT ; mask xdigit bit - @L1: rts -diff --git a/libsrc/common/strlower.s b/libsrc/common/strlower.s -index d4e48138..479d852e 100644 ---- a/libsrc/common/strlower.s -+++ b/libsrc/common/strlower.s -@@ -16,7 +16,7 @@ - - _strlower: - _strlwr: -- sta ptr1 ; Save s (working copy) -+ sta ptr1 ; save s (working copy) - stx ptr1+1 - sta ptr2 - stx ptr2+1 ; save function result -@@ -25,10 +25,10 @@ _strlwr: - loop: lda (ptr1),y ; get character - beq L9 ; jump if done - ; get character classification -- jsr ctype_preprocessor_no_check -+ jsr ctype_preprocessor_no_check - and #CT_UPPER ; upper case char? - beq L1 ; jump if no -- lda (ptr1),y ; fetch character again -+ lda (ptr1),y ; fetch character again - adc #<('a'-'A') ; make lower case char (ctype_preprocessor_no_check ensures carry clear) - sta (ptr1),y ; store back - L1: iny ; next char -@@ -41,6 +41,3 @@ L1: iny ; next char - L9: lda ptr2 - ldx ptr2+1 - rts -- -- -- -diff --git a/libsrc/common/strnicmp.s b/libsrc/common/strnicmp.s -index 54aef2bb..c4cc272d 100644 ---- a/libsrc/common/strnicmp.s -+++ b/libsrc/common/strnicmp.s -@@ -41,7 +41,7 @@ _strncasecmp: - ; Start of compare loop. Check the counter. - - Loop: inc ptr3 -- beq IncHi ; Increment high byte -+ beq IncHi ; increment high byte - - ; Compare a byte from the strings - -@@ -58,18 +58,18 @@ Comp: lda (ptr2),y - L1: lda (ptr1),y ; get character from first string - sta tmp1 ; remember original char - ; get character classification -- jsr ctype_preprocessor_no_check -+ jsr ctype_preprocessor_no_check - and #CT_LOWER ; lower case char? - beq L2 ; jump if no - lda #<('A'-'a') ; make upper case char - adc tmp1 ; ctype_preprocessor_no_check ensures carry clear! -- sta tmp1 ; remember upper case equivalent -+ sta tmp1 ; remember upper case equivalent - - L2: ldx tmp1 - cpx tmp2 ; compare characters -- bne NotEqual ; Jump if strings different -- txa ; End of strings? -- beq Equal1 ; Jump if EOS reached, a/x == 0 -+ bne NotEqual ; jump if strings different -+ txa ; end of strings? -+ beq Equal1 ; jump if EOS reached, a/x == 0 - - ; Increment the pointers - -@@ -77,12 +77,12 @@ L2: ldx tmp1 - bne Loop - inc ptr1+1 - inc ptr2+1 -- bne Loop ; Branch always -+ bne Loop ; branch always - - ; Increment hi byte - - IncHi: inc ptr3+1 -- bne Comp ; Jump if counter not zero -+ bne Comp ; jump if counter not zero - - ; Exit code if strings are equal. a/x not set - -@@ -94,8 +94,8 @@ Equal1: rts - - NotEqual: - bcs L3 -- ldx #$FF ; Make result negative -+ ldx #$FF ; make result negative - rts - --L3: ldx #$01 ; Make result positive -+L3: ldx #$01 ; make result positive - rts -diff --git a/libsrc/common/strupper.s b/libsrc/common/strupper.s -index dd6c1c25..e2160d4d 100644 ---- a/libsrc/common/strupper.s -+++ b/libsrc/common/strupper.s -@@ -16,7 +16,7 @@ - - _strupper: - _strupr: -- sta ptr1 ; Save s (working copy) -+ sta ptr1 ; save s (working copy) - stx ptr1+1 - sta ptr2 - stx ptr2+1 ; save function result -@@ -24,7 +24,7 @@ _strupr: - - loop: lda (ptr1),y ; get character - beq L9 ; jump if done -- jsr ctype_preprocessor_no_check -+ jsr ctype_preprocessor_no_check - and #CT_LOWER ; lower case char? - beq L1 ; jump if no - lda (ptr1),y ; fetch character again -@@ -40,6 +40,3 @@ L1: iny ; next char - L9: lda ptr2 - ldx ptr2+1 - rts -- -- -- -diff --git a/libsrc/lynx/crt0.s b/libsrc/lynx/crt0.s -index da2162b4..238a2c99 100644 ---- a/libsrc/lynx/crt0.s -+++ b/libsrc/lynx/crt0.s -@@ -68,7 +68,7 @@ MikeyInitData: .byte $9e,$18,$68,$1f,$00,$00,$00,$00,$00,$ff,$1a,$1b,$04,$0d,$2 - - ; Disable the TX/RX IRQ; set to 8E1. - -- lda #%11101 -+ lda #%00011101 - sta SERCTL - - ; Clear all pending interrupts. --- -2.26.0 - diff --git a/0168-Adjusted-tolower-and-toupper-to-https-github.com-cc6.patch b/0168-Adjusted-tolower-and-toupper-to-https-github.com-cc6.patch deleted file mode 100644 index 1a31f87..0000000 --- a/0168-Adjusted-tolower-and-toupper-to-https-github.com-cc6.patch +++ /dev/null @@ -1,105 +0,0 @@ -From df015f47662d3b2f44a383bd5dc520216c9285f7 Mon Sep 17 00:00:00 2001 -From: Oliver Schmidt <ol.sc@web.de> -Date: Thu, 2 Apr 2020 11:15:53 +0200 -Subject: [PATCH 168/170] Adjusted tolower() and toupper() to - https://github.com/cc65/cc65/pull/997 - -For some reason or another both the author of the PR in question and its reviewers didn't notice that the two functions in question were totally overlooked. ---- - libsrc/common/tolower.s | 32 +++++++++++++++++++------------- - libsrc/common/toupper.s | 32 +++++++++++++++++++------------- - 2 files changed, 38 insertions(+), 26 deletions(-) - -diff --git a/libsrc/common/tolower.s b/libsrc/common/tolower.s -index 2c624cb7..e672f077 100644 ---- a/libsrc/common/tolower.s -+++ b/libsrc/common/tolower.s -@@ -1,21 +1,27 @@ -+; tolower.s - ; --; Ullrich von Bassewitz, 02.06.1998 -+; This file is part of -+; cc65 - a freeware C compiler for 6502 based systems -+; -+; https://cc65.github.io -+; -+; See "LICENSE" file for legal information. - ; - ; int tolower (int c); - ; - - .export _tolower -- .import __ctype -+ .include "ctype.inc" -+ .import ctype_preprocessor - - _tolower: -- cpx #$00 ; Outside valid range? -- bne L9 ; If so, return the argument unchanged -- tay ; Get C into Y -- lda __ctype,y ; Get character classification -- lsr a -- lsr a ; Get bit 1 (upper case char) into carry -- tya ; Get char back into A -- bcc L9 ; Jump if no upper case char -- sbc #<('A'-'a') ; Make lower case char (carry already set) --L9: rts -- -+ tay ; save char -+ jsr ctype_preprocessor ; (always clears X) -+ bcc @L2 ; out of range? -+@L1: tya ; if so, return the argument unchanged -+ rts -+@L2: and #CT_UPPER ; upper case char? -+ beq @L1 ; jump if no -+ tya ; restore char -+ adc #<('a'-'A') ; make lower case char (ctype_preprocessor ensures carry clear) -+ rts -diff --git a/libsrc/common/toupper.s b/libsrc/common/toupper.s -index da1ee042..5b3a4c22 100644 ---- a/libsrc/common/toupper.s -+++ b/libsrc/common/toupper.s -@@ -1,21 +1,27 @@ -+; toupper.s - ; --; Ullrich von Bassewitz, 02.06.1998 -+; This file is part of -+; cc65 - a freeware C compiler for 6502 based systems -+; -+; https://cc65.github.io -+; -+; See "LICENSE" file for legal information. - ; - ; int toupper (int c); - ; - - .export _toupper -- .import __ctype -+ .include "ctype.inc" -+ .import ctype_preprocessor - - _toupper: -- cpx #$00 ; Outside valid range? -- bne L9 ; If so, return the argument unchanged -- tay ; Get c into Y -- lda __ctype,y ; Get character classification -- lsr a ; Get bit 0 (lower char) into carry -- tya ; Get C back into A -- bcc L9 ; Jump if not lower char -- clc -- adc #<('A'-'a') ; make upper case char --L9: rts ; CC are set -- -+ tay ; save char -+ jsr ctype_preprocessor ; (always clears X) -+ bcc @L2 ; out of range? -+@L1: tya ; if so, return the argument unchanged -+ rts -+@L2: and #CT_LOWER ; lower case char? -+ beq @L1 ; jump if no -+ tya ; restore char -+ adc #<('A'-'a') ; make upper case char (ctype_preprocessor ensures carry clear) -+ rts --- -2.26.0 - diff --git a/0169-Fixed-tolower-and-toupper-to-save-high-byte.patch b/0169-Fixed-tolower-and-toupper-to-save-high-byte.patch deleted file mode 100644 index 4cff01d..0000000 --- a/0169-Fixed-tolower-and-toupper-to-save-high-byte.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 411fe87f64f57dd3b2469214fdbca01a121b4569 Mon Sep 17 00:00:00 2001 -From: Oliver Schmidt <ol.sc@web.de> -Date: Thu, 2 Apr 2020 22:14:22 +0200 -Subject: [PATCH 169/170] Fixed tolower() and toupper() to save high byte. - ---- - libsrc/common/tolower.s | 21 +++++++++++---------- - libsrc/common/toupper.s | 21 +++++++++++---------- - 2 files changed, 22 insertions(+), 20 deletions(-) - -diff --git a/libsrc/common/tolower.s b/libsrc/common/tolower.s -index e672f077..bebac3c5 100644 ---- a/libsrc/common/tolower.s -+++ b/libsrc/common/tolower.s -@@ -12,16 +12,17 @@ - - .export _tolower - .include "ctype.inc" -- .import ctype_preprocessor -+ .import ctype_preprocessor_no_check - - _tolower: -- tay ; save char -- jsr ctype_preprocessor ; (always clears X) -- bcc @L2 ; out of range? --@L1: tya ; if so, return the argument unchanged -- rts --@L2: and #CT_UPPER ; upper case char? -- beq @L1 ; jump if no -- tya ; restore char -- adc #<('a'-'A') ; make lower case char (ctype_preprocessor ensures carry clear) -+ cpx #$00 ; out of range? -+ bne @L2 ; if so, return the argument unchanged -+ tay ; save char -+ jsr ctype_preprocessor_no_check -+ and #CT_UPPER ; upper case char? -+ beq @L1 ; jump if no -+ tya ; restore char -+ adc #<('a'-'A') ; make lower case char (ctype_preprocessor_no_check ensures carry clear) - rts -+@L1: tya ; restore char -+@L2: rts -diff --git a/libsrc/common/toupper.s b/libsrc/common/toupper.s -index 5b3a4c22..ed3dd9b0 100644 ---- a/libsrc/common/toupper.s -+++ b/libsrc/common/toupper.s -@@ -12,16 +12,17 @@ - - .export _toupper - .include "ctype.inc" -- .import ctype_preprocessor -+ .import ctype_preprocessor_no_check - - _toupper: -- tay ; save char -- jsr ctype_preprocessor ; (always clears X) -- bcc @L2 ; out of range? --@L1: tya ; if so, return the argument unchanged -- rts --@L2: and #CT_LOWER ; lower case char? -- beq @L1 ; jump if no -- tya ; restore char -- adc #<('A'-'a') ; make upper case char (ctype_preprocessor ensures carry clear) -+ cpx #$00 ; out of range? -+ bne @L2 ; if so, return the argument unchanged -+ tay ; save char -+ jsr ctype_preprocessor_no_check -+ and #CT_LOWER ; lower case char? -+ beq @L1 ; jump if no -+ tya ; restore char -+ adc #<('A'-'a') ; make upper case char (ctype_preprocessor_no_check ensures carry clear) - rts -+@L1: tya ; restore char -+@L2: rts --- -2.26.0 - diff --git a/0170-Shortened-names-and-adjusted-style.patch b/0170-Shortened-names-and-adjusted-style.patch deleted file mode 100644 index 0c1fb79..0000000 --- a/0170-Shortened-names-and-adjusted-style.patch +++ /dev/null @@ -1,669 +0,0 @@ -From 0981c020b2e36a34fd3dfb29478c99d5b3142f7b Mon Sep 17 00:00:00 2001 -From: Oliver Schmidt <ol.sc@web.de> -Date: Thu, 2 Apr 2020 22:58:16 +0200 -Subject: [PATCH 170/170] Shortened names and adjusted style. - ---- - asminc/ctype.inc | 18 +++++++++--------- - asminc/ctype_common.inc | 4 ++-- - libsrc/atari/ctype.s | 4 ++-- - libsrc/atmos/ctype.s | 4 ++-- - libsrc/cbm/ctype.s | 4 ++-- - libsrc/common/atoi.s | 6 ++---- - libsrc/common/ctype.s | 4 ++-- - .../{ctype_preprocessor.s => ctypemask.s} | 16 ++++++++-------- - libsrc/common/isalnum.s | 4 ++-- - libsrc/common/isalpha.s | 4 ++-- - libsrc/common/isblank.s | 4 ++-- - libsrc/common/iscntrl.s | 4 ++-- - libsrc/common/isdigit.s | 4 ++-- - libsrc/common/isgraph.s | 4 ++-- - libsrc/common/islower.s | 8 ++++---- - libsrc/common/isprint.s | 10 +++++----- - libsrc/common/ispunct.s | 12 ++++++------ - libsrc/common/isspace.s | 8 ++++---- - libsrc/common/isupper.s | 8 ++++---- - libsrc/common/isxdigit.s | 8 ++++---- - libsrc/common/stricmp.s | 12 +++++------- - libsrc/common/strlower.s | 7 +++---- - libsrc/common/strnicmp.s | 12 +++++------- - libsrc/common/strupper.s | 6 +++--- - libsrc/common/tolower.s | 6 +++--- - libsrc/common/toupper.s | 6 +++--- - libsrc/geos-common/system/ctype.s | 4 ++-- - 27 files changed, 92 insertions(+), 99 deletions(-) - rename libsrc/common/{ctype_preprocessor.s => ctypemask.s} (80%) - -diff --git a/asminc/ctype.inc b/asminc/ctype.inc -index 18a290fb..4d9ae798 100644 ---- a/asminc/ctype.inc -+++ b/asminc/ctype.inc -@@ -14,15 +14,15 @@ - - ; Define bitmapped constants for the table entries - --CT_NONE = $00 ; Nothing special --CT_LOWER = $01 ; 0 - Lower case char --CT_UPPER = $02 ; 1 - Upper case char --CT_DIGIT = $04 ; 2 - Numeric digit --CT_XDIGIT = $08 ; 3 - Hex digit (both, lower and upper) --CT_CTRL = $10 ; 4 - Control character --CT_SPACE = $20 ; 5 - The space character itself --CT_OTHER_WS = $40 ; 6 - Other whitespace ('\f', '\n', '\r', '\t' and '\v') --CT_SPACE_TAB = $80 ; 7 - Space or tab character -+CT_NONE = %00000000 ; Nothing special -+CT_LOWER = %00000001 ; 0 - Lower case char -+CT_UPPER = %00000010 ; 1 - Upper case char -+CT_DIGIT = %00000100 ; 2 - Numeric digit -+CT_XDIGIT = %00001000 ; 3 - Hex digit (both, lower and upper) -+CT_CTRL = %00010000 ; 4 - Control character -+CT_SPACE = %00100000 ; 5 - The space character itself -+CT_OTHER_WS = %01000000 ; 6 - Other whitespace ('\f', '\n', '\r', '\t' and '\v') -+CT_SPACE_TAB = %10000000 ; 7 - Space or tab character - - ; Combined stuff - CT_ALNUM = (CT_LOWER | CT_UPPER | CT_DIGIT) -diff --git a/asminc/ctype_common.inc b/asminc/ctype_common.inc -index 04aaa8f9..044c2834 100644 ---- a/asminc/ctype_common.inc -+++ b/asminc/ctype_common.inc -@@ -11,13 +11,13 @@ - ; - - .include "ctypetable.inc" -- .export __ctypeIdx -+ .export __ctypeidx - - ; The tables are readonly, put them into the rodata segment - - .rodata - --__ctypeIdx: -+__ctypeidx: - ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 0/00 ___ctrl_@___, 1/01 ___ctrl_A___ - ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 2/02 ___ctrl_B___, 3/03 ___ctrl_C___ - ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 4/04 ___ctrl_D___, 5/05 ___ctrl_E___ -diff --git a/libsrc/atari/ctype.s b/libsrc/atari/ctype.s -index 7903dc2a..2f219f8c 100644 ---- a/libsrc/atari/ctype.s -+++ b/libsrc/atari/ctype.s -@@ -11,13 +11,13 @@ - ; - - .include "ctypetable.inc" -- .export __ctypeIdx -+ .export __ctypeidx - - ; The tables are readonly, put them into the rodata segment - - .rodata - --__ctypeIdx: -+__ctypeidx: - ct_mix CT_NONE_IDX, CT_NONE_IDX ; 0/00 ___heart____, 1/01 ___l_tee____ - ct_mix CT_NONE_IDX, CT_NONE_IDX ; 2/02 ___ctrl_B___, 3/03 ___ctrl_C___ - ct_mix CT_NONE_IDX, CT_NONE_IDX ; 4/04 ___r_tee____, 5/05 ___ctrl_E___ -diff --git a/libsrc/atmos/ctype.s b/libsrc/atmos/ctype.s -index 7ca01b32..90a3baa6 100644 ---- a/libsrc/atmos/ctype.s -+++ b/libsrc/atmos/ctype.s -@@ -11,13 +11,13 @@ - ; - - .include "ctypetable.inc" -- .export __ctypeIdx -+ .export __ctypeidx - - ; The tables are readonly, put them into the rodata segment - - .rodata - --__ctypeIdx: -+__ctypeidx: - ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 0/00 ___ctrl_@___, 1/01 ___ctrl_A___ - ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 2/02 ___ctrl_B___, 3/03 ___ctrl_C___ - ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 4/04 ___ctrl_D___, 5/05 ___ctrl_E___ -diff --git a/libsrc/cbm/ctype.s b/libsrc/cbm/ctype.s -index 77a37431..7388f68b 100644 ---- a/libsrc/cbm/ctype.s -+++ b/libsrc/cbm/ctype.s -@@ -12,13 +12,13 @@ - ; This table is taken from Craig S. Bruce's technical docs. for the ACE OS. - - .include "ctypetable.inc" -- .export __ctypeIdx -+ .export __ctypeidx - - ; The tables are readonly, put them into the rodata segment - - .rodata - --__ctypeIdx: -+__ctypeidx: - ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 0/00 ___rvs_@___, 1/01 ___rvs_a___ - ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 2/02 ___rvs_b___, 3/03 ___rvs_c___ - ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 4/04 ___rvs_d___, 5/05 ___rvs_e___ -diff --git a/libsrc/common/atoi.s b/libsrc/common/atoi.s -index 10f917f8..0236b77f 100644 ---- a/libsrc/common/atoi.s -+++ b/libsrc/common/atoi.s -@@ -8,7 +8,7 @@ - .export _atoi, _atol - .import negeax, __ctype - .importzp sreg, ptr1, ptr2, tmp1 -- .import ctype_preprocessor_no_check -+ .import ctypemaskdirect - .include "ctype.inc" - ; - ; Conversion routine (32 bit) -@@ -26,9 +26,7 @@ _atol: sta ptr1 ; store s - ; Skip whitespace - - L1: lda (ptr1),y -- ; get character classification -- jsr ctype_preprocessor_no_check -- -+ jsr ctypemaskdirect ; get character classification - and #CT_SPACE_TAB ; tab or space? - beq L2 ; jump if no - iny -diff --git a/libsrc/common/ctype.s b/libsrc/common/ctype.s -index 15f115e7..220ad79c 100644 ---- a/libsrc/common/ctype.s -+++ b/libsrc/common/ctype.s -@@ -11,13 +11,13 @@ - ; - - .include "ctypetable.inc" -- .export __ctypeIdx -+ .export __ctypeidx - - ; The tables are readonly, put them into the rodata segment - - .rodata - --__ctypeIdx: -+__ctypeidx: - - .repeat 2 ; 2 times for normal and inverted - -diff --git a/libsrc/common/ctype_preprocessor.s b/libsrc/common/ctypemask.s -similarity index 80% -rename from libsrc/common/ctype_preprocessor.s -rename to libsrc/common/ctypemask.s -index 79d93860..b518a10c 100644 ---- a/libsrc/common/ctype_preprocessor.s -+++ b/libsrc/common/ctypemask.s -@@ -1,4 +1,4 @@ --; ctype_preprocessor.s -+; ctypemask.s - ; - ; This file is part of - ; cc65 - a freeware C compiler for 6502 based systems -@@ -7,7 +7,7 @@ - ; - ; See "LICENSE" file for legal information. - ; --; ctype_preprocessor(int c) -+; ctypemask(int c) - ; - ; converts a character to test via the is*-functions to the matching ctype-masks - ; If c is out of the 8-bit range, the function returns with carry set and accu cleared. -@@ -18,18 +18,18 @@ - ; while calling this function! - ; - -- .export ctype_preprocessor -- .export ctype_preprocessor_no_check -+ .export ctypemask -+ .export ctypemaskdirect - .import __ctype -- .import __ctypeIdx -+ .import __ctypeidx - --ctype_preprocessor: -+ctypemask: - cpx #$00 ; char range ok? - bne SC ; branch if not --ctype_preprocessor_no_check: -+ctypemaskdirect: - lsr a - tax -- lda __ctypeIdx,x -+ lda __ctypeidx,x - bcc @lowerNibble - @upperNibble: - lsr a -diff --git a/libsrc/common/isalnum.s b/libsrc/common/isalnum.s -index 2a05e32e..ec2c9de1 100644 ---- a/libsrc/common/isalnum.s -+++ b/libsrc/common/isalnum.s -@@ -12,10 +12,10 @@ - - .export _isalnum - .include "ctype.inc" -- .import ctype_preprocessor -+ .import ctypemask - - _isalnum: -- jsr ctype_preprocessor ; (always clears X) -+ jsr ctypemask ; (always clears X) - bcs @L1 ; out of range? (everything already clear -> false) - and #CT_ALNUM ; mask character/digit bits - @L1: rts -diff --git a/libsrc/common/isalpha.s b/libsrc/common/isalpha.s -index 7a1f79d2..2d1f4b58 100644 ---- a/libsrc/common/isalpha.s -+++ b/libsrc/common/isalpha.s -@@ -12,10 +12,10 @@ - - .export _isalpha - .include "ctype.inc" -- .import ctype_preprocessor -+ .import ctypemask - - _isalpha: -- jsr ctype_preprocessor ; (always clears X) -+ jsr ctypemask ; (always clears X) - bcs @L1 ; out of range? (everything already clear -> false) - and #CT_ALPHA ; mask character bits - @L1: rts -diff --git a/libsrc/common/isblank.s b/libsrc/common/isblank.s -index cc5b9e5a..a9788daa 100644 ---- a/libsrc/common/isblank.s -+++ b/libsrc/common/isblank.s -@@ -14,10 +14,10 @@ - - .export _isblank - .include "ctype.inc" -- .import ctype_preprocessor -+ .import ctypemask - - _isblank: -- jsr ctype_preprocessor ; (always clears X) -+ jsr ctypemask ; (always clears X) - bcs @L1 ; out of range? (everything already clear -> false) - and #CT_SPACE_TAB ; mask blank bit - @L1: rts -diff --git a/libsrc/common/iscntrl.s b/libsrc/common/iscntrl.s -index 65e2111b..7a487901 100644 ---- a/libsrc/common/iscntrl.s -+++ b/libsrc/common/iscntrl.s -@@ -12,10 +12,10 @@ - - .export _iscntrl - .include "ctype.inc" -- .import ctype_preprocessor -+ .import ctypemask - - _iscntrl: -- jsr ctype_preprocessor ; (always clears X) -+ jsr ctypemask ; (always clears X) - bcs @L1 ; out of range? (everything already clear -> false) - and #CT_CTRL ; mask control character bit - @L1: rts -diff --git a/libsrc/common/isdigit.s b/libsrc/common/isdigit.s -index 76b2d1b2..ae3f8d12 100644 ---- a/libsrc/common/isdigit.s -+++ b/libsrc/common/isdigit.s -@@ -12,10 +12,10 @@ - - .export _isdigit - .include "ctype.inc" -- .import ctype_preprocessor -+ .import ctypemask - - _isdigit: -- jsr ctype_preprocessor ; (always clears X) -+ jsr ctypemask ; (always clears X) - bcs @L1 ; out of range? (everything already clear -> false) - and #CT_DIGIT ; mask digit bit - @L1: rts -diff --git a/libsrc/common/isgraph.s b/libsrc/common/isgraph.s -index 6dd91ed3..8b97780b 100644 ---- a/libsrc/common/isgraph.s -+++ b/libsrc/common/isgraph.s -@@ -12,10 +12,10 @@ - - .export _isgraph - .include "ctype.inc" -- .import ctype_preprocessor -+ .import ctypemask - - _isgraph: -- jsr ctype_preprocessor ; (always clears X) -+ jsr ctypemask ; (always clears X) - bcs @L1 ; out of range? (everything already clear -> false) - and #CT_CTRL_SPACE ; mask character bits - cmp #1 ; if false, then set "borrow" flag -diff --git a/libsrc/common/islower.s b/libsrc/common/islower.s -index a11ee129..b19c1682 100644 ---- a/libsrc/common/islower.s -+++ b/libsrc/common/islower.s -@@ -12,12 +12,12 @@ - - .export _islower - .include "ctype.inc" -- .import ctype_preprocessor -+ .import ctypemask - - _islower: -- jsr ctype_preprocessor ; (always clears X) -- bcs @L1 ; out of range? (everything already clear -> false) -- and #CT_LOWER ; mask lower char bit -+ jsr ctypemask ; (always clears X) -+ bcs @L1 ; out of range? (everything already clear -> false) -+ and #CT_LOWER ; mask lower char bit - @L1: rts - - -diff --git a/libsrc/common/isprint.s b/libsrc/common/isprint.s -index e1d63bc6..c62bd784 100644 ---- a/libsrc/common/isprint.s -+++ b/libsrc/common/isprint.s -@@ -12,11 +12,11 @@ - - .export _isprint - .include "ctype.inc" -- .import ctype_preprocessor -+ .import ctypemask - - _isprint: -- jsr ctype_preprocessor ; (always clears X) -- bcs @L1 ; out of range? (everything already clear -> false) -- eor #CT_CTRL ; NOT a control char -- and #CT_CTRL ; mask control char bit -+ jsr ctypemask ; (always clears X) -+ bcs @L1 ; out of range? (everything already clear -> false) -+ eor #CT_CTRL ; NOT a control char -+ and #CT_CTRL ; mask control char bit - @L1: rts -diff --git a/libsrc/common/ispunct.s b/libsrc/common/ispunct.s -index ac4ab7f1..df47322f 100644 ---- a/libsrc/common/ispunct.s -+++ b/libsrc/common/ispunct.s -@@ -12,13 +12,13 @@ - - .export _ispunct - .include "ctype.inc" -- .import ctype_preprocessor -+ .import ctypemask - - _ispunct: -- jsr ctype_preprocessor ; (always clears X) -- bcs @L1 ; out of range? (everything already clear -> false) -- and #CT_NOT_PUNCT ; mask relevant bits -- cmp #1 ; if false, then set "borrow" flag -+ jsr ctypemask ; (always clears X) -+ bcs @L1 ; out of range? (everything already clear -> false) -+ and #CT_NOT_PUNCT ; mask relevant bits -+ cmp #1 ; if false, then set "borrow" flag - lda #0 -- sbc #0 ; invert logic (return NOT (space | control | digit | alpha)) -+ sbc #0 ; invert logic (return NOT (space | control | digit | alpha)) - @L1: rts -diff --git a/libsrc/common/isspace.s b/libsrc/common/isspace.s -index c3702344..b234febf 100644 ---- a/libsrc/common/isspace.s -+++ b/libsrc/common/isspace.s -@@ -12,10 +12,10 @@ - - .export _isspace - .include "ctype.inc" -- .import ctype_preprocessor -+ .import ctypemask - - _isspace: -- jsr ctype_preprocessor ; (always clears X) -- bcs @L1 ; out of range? (everything already clear -> false) -- and #(CT_SPACE | CT_OTHER_WS) ; mask space bits -+ jsr ctypemask ; (always clears X) -+ bcs @L1 ; out of range? (everything already clear -> false) -+ and #(CT_SPACE | CT_OTHER_WS) ; mask space bits - @L1: rts -diff --git a/libsrc/common/isupper.s b/libsrc/common/isupper.s -index 175fb872..45f48d87 100644 ---- a/libsrc/common/isupper.s -+++ b/libsrc/common/isupper.s -@@ -12,10 +12,10 @@ - - .export _isupper - .include "ctype.inc" -- .import ctype_preprocessor -+ .import ctypemask - - _isupper: -- jsr ctype_preprocessor ; (always clears X) -- bcs @L1 ; out of range? (everything already clear -> false) -- and #CT_UPPER ; mask upper char bit -+ jsr ctypemask ; (always clears X) -+ bcs @L1 ; out of range? (everything already clear -> false) -+ and #CT_UPPER ; mask upper char bit - @L1: rts -diff --git a/libsrc/common/isxdigit.s b/libsrc/common/isxdigit.s -index e8a12a10..6d59e2ac 100644 ---- a/libsrc/common/isxdigit.s -+++ b/libsrc/common/isxdigit.s -@@ -12,10 +12,10 @@ - - .export _isxdigit - .include "ctype.inc" -- .import ctype_preprocessor -+ .import ctypemask - - _isxdigit: -- jsr ctype_preprocessor ; (always clears X) -- bcs @L1 ; out of range? (everything already clear -> false) -- and #CT_XDIGIT ; mask xdigit bit -+ jsr ctypemask ; (always clears X) -+ bcs @L1 ; out of range? (everything already clear -> false) -+ and #CT_XDIGIT ; mask xdigit bit - @L1: rts -diff --git a/libsrc/common/stricmp.s b/libsrc/common/stricmp.s -index 3a03258b..494350b0 100644 ---- a/libsrc/common/stricmp.s -+++ b/libsrc/common/stricmp.s -@@ -14,7 +14,7 @@ - .export _stricmp, _strcasecmp - .import popptr1 - .importzp ptr1, ptr2, tmp1, tmp2 -- .import ctype_preprocessor_no_check -+ .import ctypemaskdirect - .include "ctype.inc" - - _stricmp: -@@ -26,22 +26,20 @@ _strcasecmp: - - loop: lda (ptr2),y ; get char from second string - sta tmp2 ; and save it -- ; get character classification -- jsr ctype_preprocessor_no_check -+ jsr ctypemaskdirect ; get character classification - and #CT_LOWER ; lower case char? - beq L1 ; jump if no - lda #<('A'-'a') ; make upper case char -- adc tmp2 ; ctype_preprocessor_no_check ensures carry clear! -+ adc tmp2 ; ctypemaskdirect ensures carry clear! - sta tmp2 ; remember upper case equivalent - - L1: lda (ptr1),y ; get character from first string - sta tmp1 -- ; get character classification -- jsr ctype_preprocessor_no_check -+ jsr ctypemaskdirect ; get character classification - and #CT_LOWER ; lower case char? - beq L2 ; jump if no - lda #<('A'-'a') ; make upper case char -- adc tmp1 ; ctype_preprocessor_no_check ensures carry clear! -+ adc tmp1 ; ctypemaskdirect ensures carry clear! - sta tmp1 ; remember upper case equivalent - - L2: ldx tmp1 -diff --git a/libsrc/common/strlower.s b/libsrc/common/strlower.s -index 479d852e..b7c1a289 100644 ---- a/libsrc/common/strlower.s -+++ b/libsrc/common/strlower.s -@@ -11,7 +11,7 @@ - .export _strlower, _strlwr - .import popax - .importzp ptr1, ptr2 -- .import ctype_preprocessor_no_check -+ .import ctypemaskdirect - .include "ctype.inc" - - _strlower: -@@ -24,12 +24,11 @@ _strlwr: - - loop: lda (ptr1),y ; get character - beq L9 ; jump if done -- ; get character classification -- jsr ctype_preprocessor_no_check -+ jsr ctypemaskdirect ; get character classification - and #CT_UPPER ; upper case char? - beq L1 ; jump if no - lda (ptr1),y ; fetch character again -- adc #<('a'-'A') ; make lower case char (ctype_preprocessor_no_check ensures carry clear) -+ adc #<('a'-'A') ; make lower case char (ctypemaskdirect ensures carry clear) - sta (ptr1),y ; store back - L1: iny ; next char - bne loop -diff --git a/libsrc/common/strnicmp.s b/libsrc/common/strnicmp.s -index c4cc272d..43d6d0d5 100644 ---- a/libsrc/common/strnicmp.s -+++ b/libsrc/common/strnicmp.s -@@ -9,7 +9,7 @@ - .export _strnicmp, _strncasecmp - .import popax, popptr1 - .importzp ptr1, ptr2, ptr3, tmp1, tmp2 -- .import ctype_preprocessor_no_check -+ .import ctypemaskdirect - .include "ctype.inc" - - _strnicmp: -@@ -47,22 +47,20 @@ Loop: inc ptr3 - - Comp: lda (ptr2),y - sta tmp2 ; remember original char -- ; get character classification -- jsr ctype_preprocessor_no_check -+ jsr ctypemaskdirect ; get character classification - and #CT_LOWER ; lower case char? - beq L1 ; jump if no - lda #<('A'-'a') ; make upper case char -- adc tmp2 ; ctype_preprocessor_no_check ensures carry clear! -+ adc tmp2 ; ctypemaskdirect ensures carry clear! - sta tmp2 ; remember upper case equivalent - - L1: lda (ptr1),y ; get character from first string - sta tmp1 ; remember original char -- ; get character classification -- jsr ctype_preprocessor_no_check -+ jsr ctypemaskdirect ; get character classification - and #CT_LOWER ; lower case char? - beq L2 ; jump if no - lda #<('A'-'a') ; make upper case char -- adc tmp1 ; ctype_preprocessor_no_check ensures carry clear! -+ adc tmp1 ; ctypemaskdirect ensures carry clear! - sta tmp1 ; remember upper case equivalent - - L2: ldx tmp1 -diff --git a/libsrc/common/strupper.s b/libsrc/common/strupper.s -index e2160d4d..3af0d8d9 100644 ---- a/libsrc/common/strupper.s -+++ b/libsrc/common/strupper.s -@@ -11,7 +11,7 @@ - .export _strupper, _strupr - .import popax - .importzp ptr1, ptr2 -- .import ctype_preprocessor_no_check -+ .import ctypemaskdirect - .include "ctype.inc" - - _strupper: -@@ -24,11 +24,11 @@ _strupr: - - loop: lda (ptr1),y ; get character - beq L9 ; jump if done -- jsr ctype_preprocessor_no_check -+ jsr ctypemaskdirect ; get character classification - and #CT_LOWER ; lower case char? - beq L1 ; jump if no - lda (ptr1),y ; fetch character again -- adc #<('A'-'a') ; make upper case char (ctype_preprocessor_no_check ensures carry clear) -+ adc #<('A'-'a') ; make upper case char (ctypemaskdirect ensures carry clear) - sta (ptr1),y ; store back - L1: iny ; next char - bne loop -diff --git a/libsrc/common/tolower.s b/libsrc/common/tolower.s -index bebac3c5..828be1cb 100644 ---- a/libsrc/common/tolower.s -+++ b/libsrc/common/tolower.s -@@ -12,17 +12,17 @@ - - .export _tolower - .include "ctype.inc" -- .import ctype_preprocessor_no_check -+ .import ctypemaskdirect - - _tolower: - cpx #$00 ; out of range? - bne @L2 ; if so, return the argument unchanged - tay ; save char -- jsr ctype_preprocessor_no_check -+ jsr ctypemaskdirect ; get character classification - and #CT_UPPER ; upper case char? - beq @L1 ; jump if no - tya ; restore char -- adc #<('a'-'A') ; make lower case char (ctype_preprocessor_no_check ensures carry clear) -+ adc #<('a'-'A') ; make lower case char (ctypemaskdirect ensures carry clear) - rts - @L1: tya ; restore char - @L2: rts -diff --git a/libsrc/common/toupper.s b/libsrc/common/toupper.s -index ed3dd9b0..d0465f64 100644 ---- a/libsrc/common/toupper.s -+++ b/libsrc/common/toupper.s -@@ -12,17 +12,17 @@ - - .export _toupper - .include "ctype.inc" -- .import ctype_preprocessor_no_check -+ .import ctypemaskdirect - - _toupper: - cpx #$00 ; out of range? - bne @L2 ; if so, return the argument unchanged - tay ; save char -- jsr ctype_preprocessor_no_check -+ jsr ctypemaskdirect ; get character classification - and #CT_LOWER ; lower case char? - beq @L1 ; jump if no - tya ; restore char -- adc #<('A'-'a') ; make upper case char (ctype_preprocessor_no_check ensures carry clear) -+ adc #<('A'-'a') ; make upper case char (ctypemaskdirect ensures carry clear) - rts - @L1: tya ; restore char - @L2: rts -diff --git a/libsrc/geos-common/system/ctype.s b/libsrc/geos-common/system/ctype.s -index 013a1ba9..b34f6847 100644 ---- a/libsrc/geos-common/system/ctype.s -+++ b/libsrc/geos-common/system/ctype.s -@@ -13,13 +13,13 @@ - ; http://lyonlabs.org/commodore/onrequest/geos-manuals/The_Hitchhikers_Guide_to_GEOS.pdf - - .include "ctypetable.inc" -- .export __ctypeIdx -+ .export __ctypeidx - - ; The tables are readonly, put them into the rodata segment - - .rodata - --__ctypeIdx: -+__ctypeidx: - ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 0/00 ____NULL___, 1/01 ____N/A____ - ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 2/02 ____N/A____, 3/03 ____N/A____ - ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 4/04 ____N/A____, 5/05 ____N/A____ --- -2.26.0 - diff --git a/cc65.spec b/cc65.spec index a4dcaff..5ec92e8 100644 --- a/cc65.spec +++ b/cc65.spec @@ -38,8 +38,8 @@ infodir="%{_infodir}" Name: cc65 -Version: 2.18 -Release: 14%{?dist} +Version: 2.19 +Release: 1%{?dist} Summary: A free C compiler for 6502 based systems # For license clarification see: @@ -49,176 +49,7 @@ URL: https://cc65.github.io Source0: %{git_url}/archive/V%{version}/%{name}-%{version}.tar.gz # Backported from upstream. -Patch0001: 0001-sim65-common-define-for-paravirt-hooks-base-location.patch -Patch0002: 0002-Reduced-shadow-for-h2-to-improve-readability.patch -Patch0003: 0003-Replace-GIT_SHA-with-a-more-versatile-BUILD_ID-defin.patch -Patch0004: 0004-test-ref-otccex-Fix-ramdomly-occurring-segfault.patch -Patch0005: 0005-util-zlib-deflater-Fix-several-compiler-warnings.patch -Patch0006: 0006-zlib-Use-correct-un-signedness-of-char-in-prototypes.patch -Patch0007: 0007-Made-the-ld65-configure-file-s-segment-offset-attrib.patch -Patch0008: 0008-Minor-URL-update.patch -Patch0009: 0009-src-Makefile-Simplify-BUILD_ID-logic.patch -Patch0010: 0010-Changed-empty-parameter-lists-into-void-lists-on-fun.patch -Patch0011: 0011-Add-page-0-variables-from-Telemon-2.4.patch -Patch0012: 0012-Add-XSCROH-XSCROB-value.patch -Patch0013: 0013-cc65-Add-support-for-binary-literals.patch -Patch0014: 0014-binlit-Add-a-few-random-leading-zeros.patch -Patch0015: 0015-Document-binary-literals.patch -Patch0016: 0016-Fix-bug-gotoxy-does-not-working-because-Y-does-not-u.patch -Patch0017: 0017-Add-textcolor-and-bgcolor.s.patch -Patch0018: 0018-Fix-gotoy-changecolor.patch -Patch0019: 0019-fix-typo.patch -Patch0020: 0020-fix-import.patch -Patch0021: 0021-Fix-typo-and-optimize.patch -Patch0022: 0022-Fix-label-optimize-code.patch -Patch0023: 0023-Fix-bug-with-bgcolor-and-textcolor.patch -Patch0024: 0024-jmp-instead-of-jsr.patch -Patch0025: 0025-Fix-bgcolor-and-textcolor-must-return-last-color-jmp.patch -Patch0026: 0026-Optimize-Clrscr.patch -Patch0027: 0027-Cleaning-import-variables.patch -Patch0028: 0028-Fix-comment-and-gotox-force-colour-change.patch -Patch0029: 0029-Fix-bug-FF.patch -Patch0030: 0030-Allowed-old-style-K-and-R-function-declarations-to-b.patch -Patch0031: 0031-Add-cclear-and-cclearxy.patch -Patch0032: 0032-Cleaning.patch -Patch0033: 0033-doc-clarify-need-for-.IMPORT-on-some-special-symbols.patch -Patch0034: 0034-Grammatical-modifications.patch -Patch0035: 0035-Use-the-word-macros-universally-not-macroes.patch -Patch0036: 0036-Added-a-charmap-header-that-converts-no-character-en.patch -Patch0037: 0037-Use-MACHID-to-check-for-realtime-clock.patch -Patch0038: 0038-Added-a-.ORG-keyword-to-ca65-structs-unions.patch -Patch0039: 0039-Created-a-target-and-a-library-for-the-Commander-X16.patch -Patch0040: 0040-Updated-the-cx16-start-up-to-the-emulator-s-release-.patch -Patch0041: 0041-Put-the-C64-code-into-cx16-_scrsize.s.patch -Patch0042: 0042-Fixed-a-typo-in-the-cx16-document.patch -Patch0043: 0043-Added-character-codes-to-change-between-the-two-CBM-.patch -Patch0044: 0044-Fixed-cgetc.patch -Patch0045: 0045-Made-the-none-CPU-allow-all-address-sizes.patch -Patch0046: 0046-Fix-Gamate-RVS.patch -Patch0047: 0047-Fix-colors-for-948.patch -Patch0048: 0048-Hello-world-example-for-the-Supervision.patch -Patch0049: 0049-Move-screen-init-into-crt0.s.patch -Patch0050: 0050-Improve-init-code-readability.patch -Patch0051: 0051-Improve-helloworld-example-for-Supervision.patch -Patch0052: 0052-Add-supervisionhello-in-samples-Makefile.patch -Patch0053: 0053-Use-decimal-for-lcd-size-initialization.patch -Patch0054: 0054-Comments.patch -Patch0055: 0055-Improve-comments.patch -Patch0056: 0056-Init-is-no-longer-in-crt0.s.patch -Patch0057: 0057-Significantly-faster-rand-implementation.patch -Patch0058: 0058-Update-comments-in-rand.s.patch -Patch0059: 0059-Added-new-program-descriptions-to-the-list.patch -Patch0060: 0060-Fixed-problems-with-the-Atari-Lynx-s-TGI-driver.patch -Patch0061: 0061-cx16-Update-ROM-banks-to-new-mapping.patch -Patch0062: 0062-Fixed-error-handling-for-missing-names-in-ld65-confi.patch -Patch0063: 0063-Fix-char-35-38-42-47-52.patch -Patch0064: 0064-Fix-4.patch -Patch0065: 0065-M-N-fixed.patch -Patch0066: 0066-Fix-left-arrow-char-77-13-64.patch -Patch0067: 0067-Fix-127-second-left-arrow.patch -Patch0068: 0068-small-m-and-n-fixed.patch -Patch0069: 0069-New-OSI-input-routine-based-on-disassembly-of-ROM-co.patch -Patch0070: 0070-Restructured-according-to-review.patch -Patch0071: 0071-Remove-obsolete-comment.patch -Patch0072: 0072-Remove-source-file-that-was-only-used-for-testing.patch -Patch0073: 0073-Address-review-comments.patch -Patch0074: 0074-Removed-redundant-LDA.patch -Patch0075: 0075-Added-the-GIF-switch-to-the-X16-emulator-s-control-p.patch -Patch0076: 0076-Tentative-solution-for-cgetc-in-Lynx.patch -Patch0077: 0077-Remove-useless-tax.patch -Patch0078: 0078-remove-bra.patch -Patch0079: 0079-Added-VERA-peek-and-poke-to-the-cx16-library.patch -Patch0080: 0080-libsrc-kplot.s-Use-cbm_kernal.inc-symbols-not-hardco.patch -Patch0081: 0081-vic20-cputc-Fix-incorrect-CRAM_PTR-at-startup-when-u.patch -Patch0082: 0082-Second-tentative-fix.patch -Patch0083: 0083-stz.patch -Patch0084: 0084-kbhit-checks-KBEDG-and-getc-resets-KBEDG.patch -Patch0085: 0085-Optimizations.patch -Patch0086: 0086-Reformat-comments-to-style-guide-rules.patch -Patch0087: 0087-Optimize-a-negation-in-signed-division.patch -Patch0088: 0088-Don-t-set-carry-when-already-set.patch -Patch0089: 0089-Swap-the-positive-negative-paths-to-save-a-branch.patch -Patch0090: 0090-Optimize-sign-extension.patch -Patch0091: 0091-Fixed-typos.patch -Patch0092: 0092-Made-assert-send-SIGABRT-when-an-assertion-fails.patch -Patch0093: 0093-Fixed-exit-code-974.patch -Patch0094: 0094-Changed-a-See-also-link-in-the-abort-and-assert-desc.patch -Patch0095: 0095-Updated-cx16-to-match-the-Commander-X16-ROMs-and-emu.patch -Patch0096: 0096-Added-a-standard-mouse-driver-to-the-cx16-library.patch -Patch0097: 0097-Fix-silent-crash-failure-on-warning-from-linker-comm.patch -Patch0098: 0098-make-linker-generated-export-warning-conistent-with-.patch -Patch0099: 0099-Replaced-plain-0-s-and-1-s-in-exit-statements-with-E.patch -Patch0100: 0100-Added-enum-for-cc65-exit-codes.-replaced-stdlib-exit.patch -Patch0101: 0101-Added-comment-to-debugger-exit-with-error.patch -Patch0102: 0102-Replaced-enum-in-cc65.h-by-defines.-added-comment-th.patch -Patch0103: 0103-Removed-CC65_-prefixes-from-exit-statements-in-abort.patch -Patch0104: 0104-Removed-additional-exit-constants-definitions-from-c.patch -Patch0105: 0105-added-additional-empty-line-after-header-guard-in-cc.patch -Patch0106: 0106-Removed-unnecessary-include-cc65.h-from-convert.c.patch -Patch0107: 0107-Fixed-C16-978.patch -Patch0108: 0108-Update-c16.sgml.patch -Patch0109: 0109-Update-c128.sgml.patch -Patch0110: 0110-Update-c64.sgml.patch -Patch0111: 0111-Update-cbm510.sgml.patch -Patch0112: 0112-Update-cx16.sgml.patch -Patch0113: 0113-Update-funcref.sgml.patch -Patch0114: 0114-Update-nes.sgml.patch -Patch0115: 0115-Update-pce.sgml.patch -Patch0116: 0116-Update-plus4.sgml.patch -Patch0117: 0117-Update-vic20.sgml.patch -Patch0118: 0118-Update-color.s.patch -Patch0119: 0119-Update-conio.s.patch -Patch0120: 0120-Update-cputc.s.patch -Patch0121: 0121-Update-fast.s.patch -Patch0122: 0122-Update-isfast.s.patch -Patch0123: 0123-Update-revers.s.patch -Patch0124: 0124-Update-slow.s.patch -Patch0125: 0125-Update-status.s.patch -Patch0126: 0126-Added-cx16.h-to-the-function-reference-document.patch -Patch0127: 0127-Expanded-Sim65-zero-page.patch -Patch0128: 0128-Changed-sim65-s-internal-error-codes-from-9-bit-valu.patch -Patch0129: 0129-Added-the-missing-BANK_RAM-array-to-the-Commander-X1.patch -Patch0130: 0130-Updated-the-cx16-library-to-the-Commander-X16-Kernal.patch -Patch0131: 0131-Made-the-program-chaining-exec-handle-the-X16-emulat.patch -Patch0132: 0132-Added-real-time-clock-functions-to-the-cx16-library.patch -Patch0133: 0133-Fixed-the-target-guards-around-the-usage-messages.patch -Patch0134: 0134-Made-ca65-give-error-messages-when-it-sees-duplicate.patch -Patch0135: 0135-Changes-in-INSTALL-routine-from-emd-c128-vdc.s.patch -Patch0136: 0136-Added-reservation-of-second-byte-for-pagecount.patch -Patch0137: 0137-Changed-the-order-in-which-lo-hi-bytes-of-vdc-addr-a.patch -Patch0138: 0138-Updated-the-cx16-library-to-the-ROM-s-prerelease-36.patch -Patch0139: 0139-Minor-cleanup.patch -Patch0140: 0140-Made-cc65-detect-a-possibly-missing-argument-at-the-.patch -Patch0141: 0141-added-regression-test-related-to-bug-1001.patch -Patch0142: 0142-store-y-first-then-a.-fix-by-willymanilly.patch -Patch0143: 0143-Fixes-Atari-OS-devhdl_t-init-field-needs-an-JMP-byte.patch -Patch0144: 0144-Corrected-check-in-OptTransfers2-for-register-usage..patch -Patch0145: 0145-Always-insert-a-LDA-after-the-removed-PLA-during-the.patch -Patch0146: 0146-Quick-fix-for-the-OptPushPop-bug-reported-in-Issue-3.patch -Patch0147: 0147-Just-disable-OptPushPop-if-N-Z-is-used-after-the-PLA.patch -Patch0148: 0148-ctype-size-optimization.patch -Patch0149: 0149-Changes-resulting-from-code-review.patch -Patch0150: 0150-Changes-resulting-from-2nd-code-review.patch -Patch0151: 0151-Fix-bug-in-tgi_line-HRS-X-parameters-are-16-bits.patch -Patch0152: 0152-Fix-16-bits-values.patch -Patch0153: 0153-Normalized-Atari-naming.patch -Patch0154: 0154-Fixed-a-typo-in-commit-2e5fbe89cd3f67b06b292936dfdf4.patch -Patch0155: 0155-Made-use-of-65C02-opcode-thx-to-polluks.patch -Patch0156: 0156-Fixed-an-error-message-printer.patch -Patch0157: 0157-SEGMENT-start-of-0-should-be-valid.patch -Patch0158: 0158-fix-whitespace.patch -Patch0159: 0159-Update-get_ostype.s.patch -Patch0160: 0160-Adjusted-comments-due-to-recent-change.patch -Patch0161: 0161-cc65-inline-asm-stp-mnemonic-support.patch -Patch0162: 0162-code-style.patch -Patch0163: 0163-Aligned-comment.patch -Patch0164: 0164-Added-missing-tag-and-itemize-Linuxdoc-tags-to-some-.patch -Patch0165: 0165-fix-the-clean-target-to-remove-any-disk-images.patch -Patch0166: 0166-Matched-comment-to-the-one-in-the-C-header-file.patch -Patch0167: 0167-Some-style-adjustments.patch -Patch0168: 0168-Adjusted-tolower-and-toupper-to-https-github.com-cc6.patch -Patch0169: 0169-Fixed-tolower-and-toupper-to-save-high-byte.patch -Patch0170: 0170-Shortened-names-and-adjusted-style.patch +# none BuildRequires: gcc BuildRequires: make @@ -425,6 +256,9 @@ they have been split into this package. %changelog +* Sun Jun 13 2021 Dan HorĂ¡k <dan[at]danny.cz> - 2.19-1 +- updated to 2.19 + * Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.18-14 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild diff --git a/sources b/sources index bf0690a..c892470 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (cc65-2.18.tar.gz) = 47e530052911c8fdac0ea560fef78f5971441509f37b4020df54937cf9b5420e07653b3d191c844da0af5dddd17a61e90c3ad3fb56bf7623214977017b4bc9a1 +SHA512 (cc65-2.19.tar.gz) = e893359249588247d262ff19b8b7efbbcb10a274964aaa18cfe21830cce39da53831262bcc8ee4678158c0e0ab56905411b037699d1097aa5fc03edf7d6bea8f