From a4f04fea0ec967f9080f52fc07f6736431c5e11e Mon Sep 17 00:00:00 2001 From: Björn Esser Date: Apr 06 2020 08:36:44 +0000 Subject: Add several bugfix patches from upstream --- diff --git a/0001-sim65-common-define-for-paravirt-hooks-base-location.patch b/0001-sim65-common-define-for-paravirt-hooks-base-location.patch index af3b912..fd79a58 100644 --- a/0001-sim65-common-define-for-paravirt-hooks-base-location.patch +++ b/0001-sim65-common-define-for-paravirt-hooks-base-location.patch @@ -1,7 +1,7 @@ From 52695523465cb8bc72a0728b1f5b46ffc3eb2eef Mon Sep 17 00:00:00 2001 From: bbbradsmith Date: Thu, 30 May 2019 15:34:05 -0400 -Subject: [PATCH 001/125] sim65 common define for paravirt hooks base location +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 @@ -115,5 +115,5 @@ index cd491539..99c28fa0 100644 /* Code */ /*****************************************************************************/ -- -2.23.0 +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 index 09b4be1..5dc6342 100644 --- a/0002-Reduced-shadow-for-h2-to-improve-readability.patch +++ b/0002-Reduced-shadow-for-h2-to-improve-readability.patch @@ -1,7 +1,7 @@ From e34ee329738b5b8f54e62e7dd63deff5e1088bff Mon Sep 17 00:00:00 2001 From: Oliver Schmidt Date: Tue, 4 Jun 2019 11:43:07 +0200 -Subject: [PATCH 002/125] Reduced shadow for h2 to improve readability. +Subject: [PATCH 002/170] Reduced shadow for h2 to improve readability. --- doc/doc.css | 2 +- @@ -21,5 +21,5 @@ index 232599a7..e4c316e1 100644 margin-top: 2em; margin-bottom: 1em; -- -2.23.0 +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 index c3b1f61..8957a2c 100644 --- 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 @@ -1,7 +1,7 @@ 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/125] Replace GIT_SHA with a more versatile BUILD_ID +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 @@ -70,5 +70,5 @@ index c76a3993..202c61cc 100644 xsnprintf (Buf, sizeof (Buf), "%u.%u", VER_MAJOR, VER_MINOR); #endif -- -2.23.0 +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 index a5771ee..1c1fb3f 100644 --- a/0004-test-ref-otccex-Fix-ramdomly-occurring-segfault.patch +++ b/0004-test-ref-otccex-Fix-ramdomly-occurring-segfault.patch @@ -1,7 +1,7 @@ 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/125] test/ref/otccex: Fix ramdomly occurring segfault. +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 @@ -33,5 +33,5 @@ index aa5df158..645078ef 100644 n = n / b; /* 'break' is supported */ -- -2.23.0 +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 index 983d395..20bc093 100644 --- a/0005-util-zlib-deflater-Fix-several-compiler-warnings.patch +++ b/0005-util-zlib-deflater-Fix-several-compiler-warnings.patch @@ -1,7 +1,7 @@ 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/125] util/zlib/deflater: Fix several compiler warnings. +Subject: [PATCH 005/170] util/zlib/deflater: Fix several compiler warnings. --- util/zlib/deflater.c | 6 +++--- @@ -32,5 +32,5 @@ index 32d01a36..7e13600a 100644 return 0; } -- -2.23.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 index 0820630..2fa4b59 100644 --- a/0006-zlib-Use-correct-un-signedness-of-char-in-prototypes.patch +++ b/0006-zlib-Use-correct-un-signedness-of-char-in-prototypes.patch @@ -1,7 +1,7 @@ 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/125] zlib: Use correct (un)signedness of char in +Subject: [PATCH 006/170] zlib: Use correct (un)signedness of char in prototypes and functions. Also ensure we are using the same constness qualifiers. @@ -82,5 +82,5 @@ index 4e449a3e..61838b47 100644 if ((unsigned char) csum != ptr[3] || (unsigned char) (csum >> 8) != ptr[2] -- -2.23.0 +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 index 7b97e8e..e367a4d 100644 --- a/0007-Made-the-ld65-configure-file-s-segment-offset-attrib.patch +++ b/0007-Made-the-ld65-configure-file-s-segment-offset-attrib.patch @@ -1,7 +1,7 @@ From 28584b31f1b3560173c16487f45aad23dc6f9fb5 Mon Sep 17 00:00:00 2001 From: Greg King Date: Sun, 30 Jun 2019 22:44:10 -0400 -Subject: [PATCH 007/125] Made the ld65 configure file's segment offset +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. @@ -23,5 +23,5 @@ index f8bff2ac..b8699a87 100644 break; -- -2.23.0 +2.26.0 diff --git a/0008-Minor-URL-update.patch b/0008-Minor-URL-update.patch index 132cbc0..d7c465c 100644 --- a/0008-Minor-URL-update.patch +++ b/0008-Minor-URL-update.patch @@ -1,7 +1,7 @@ From 9be25dab9ce05434978ff16fd1761f3502bbd03e Mon Sep 17 00:00:00 2001 From: Oliver Schmidt Date: Mon, 15 Jul 2019 12:29:09 +0200 -Subject: [PATCH 008/125] Minor URL update. +Subject: [PATCH 008/170] Minor URL update. --- samples/Makefile | 2 +- @@ -21,5 +21,5 @@ index 6c94495f..ad81c247 100644 DISK_c64 = samples.d64 -- -2.23.0 +2.26.0 diff --git a/0009-src-Makefile-Simplify-BUILD_ID-logic.patch b/0009-src-Makefile-Simplify-BUILD_ID-logic.patch index 4a1925b..3ae8c88 100644 --- a/0009-src-Makefile-Simplify-BUILD_ID-logic.patch +++ b/0009-src-Makefile-Simplify-BUILD_ID-logic.patch @@ -1,7 +1,7 @@ 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/125] src/Makefile: Simplify BUILD_ID logic. +Subject: [PATCH 009/170] src/Makefile: Simplify BUILD_ID logic. --- src/Makefile | 6 ++---- @@ -30,5 +30,5 @@ index bbf594aa..87f1e823 100644 CFLAGS += -MMD -MP -O3 -I common \ -Wall -Wextra -Wno-char-subscripts $(USER_CFLAGS) \ -- -2.23.0 +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 index e11debe..8e6ff88 100644 --- a/0010-Changed-empty-parameter-lists-into-void-lists-on-fun.patch +++ b/0010-Changed-empty-parameter-lists-into-void-lists-on-fun.patch @@ -1,7 +1,7 @@ From 88c6dd2da81c10eb36bdc76f236ef3d428d9312e Mon Sep 17 00:00:00 2001 From: Greg King Date: Tue, 16 Jul 2019 13:16:02 -0400 -Subject: [PATCH 010/125] Changed empty parameter lists into (void) lists on +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. @@ -67,5 +67,5 @@ index b2010f6f..8f1e1547 100644 } -- -2.23.0 +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 index 1ab347f..77a9e18 100644 --- a/0011-Add-page-0-variables-from-Telemon-2.4.patch +++ b/0011-Add-page-0-variables-from-Telemon-2.4.patch @@ -1,7 +1,7 @@ From 99de3cb6ea5ae3bfed01cb9139dc68939b3909ef Mon Sep 17 00:00:00 2001 From: jede Date: Sat, 20 Jul 2019 11:28:33 +0200 -Subject: [PATCH 011/125] Add page 0 variables from Telemon 2.4 +Subject: [PATCH 011/170] Add page 0 variables from Telemon 2.4 --- asminc/telestrat.inc | 29 +++++++++++++++++++++++++++-- @@ -54,5 +54,5 @@ index f2eb42ff..3bd8a1f5 100644 FLERR := $8B -- -2.23.0 +2.26.0 diff --git a/0012-Add-XSCROH-XSCROB-value.patch b/0012-Add-XSCROH-XSCROB-value.patch index 8fa7033..b18acb1 100644 --- a/0012-Add-XSCROH-XSCROB-value.patch +++ b/0012-Add-XSCROH-XSCROB-value.patch @@ -1,7 +1,7 @@ From 76fe064e03a909be3139cf2daae48d8ded0fe269 Mon Sep 17 00:00:00 2001 From: jede Date: Sat, 20 Jul 2019 11:31:00 +0200 -Subject: [PATCH 012/125] Add XSCROH & XSCROB value +Subject: [PATCH 012/170] Add XSCROH & XSCROB value --- asminc/telestrat.inc | 2 ++ @@ -21,5 +21,5 @@ index 3bd8a1f5..3526c6f9 100644 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.23.0 +2.26.0 diff --git a/0013-cc65-Add-support-for-binary-literals.patch b/0013-cc65-Add-support-for-binary-literals.patch index f658b9a..1fb3dfd 100644 --- a/0013-cc65-Add-support-for-binary-literals.patch +++ b/0013-cc65-Add-support-for-binary-literals.patch @@ -1,7 +1,7 @@ From 925ea9d5443949cfd916504a9ed04ada8b750e27 Mon Sep 17 00:00:00 2001 From: Lauri Kasanen Date: Tue, 16 Jul 2019 18:39:37 +0300 -Subject: [PATCH 013/125] cc65: Add support for binary literals +Subject: [PATCH 013/170] cc65: Add support for binary literals Binary literals, 0b001, are a GCC extension in C and a C++14 feature. --- @@ -575,5 +575,5 @@ index 00000000..2b6c1ca8 + return 0; +} -- -2.23.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 index 3f2b61c..87056b9 100644 --- a/0014-binlit-Add-a-few-random-leading-zeros.patch +++ b/0014-binlit-Add-a-few-random-leading-zeros.patch @@ -1,7 +1,7 @@ From 1bfdce55edf0184ef9e9f8318977253da78c3748 Mon Sep 17 00:00:00 2001 From: Lauri Kasanen Date: Tue, 16 Jul 2019 19:06:34 +0300 -Subject: [PATCH 014/125] binlit: Add a few random leading zeros +Subject: [PATCH 014/170] binlit: Add a few random leading zeros --- test/val/binlit.c | 18 +++++++++--------- @@ -52,5 +52,5 @@ index 2b6c1ca8..47e7a196 100644 small[35] = 0b100011; small[36] = 0b100100; -- -2.23.0 +2.26.0 diff --git a/0015-Document-binary-literals.patch b/0015-Document-binary-literals.patch index 88899fb..fff51e7 100644 --- a/0015-Document-binary-literals.patch +++ b/0015-Document-binary-literals.patch @@ -1,7 +1,7 @@ From 5cbbb4597fee58a1b22b751e9f3e49d53892f863 Mon Sep 17 00:00:00 2001 From: Lauri Kasanen Date: Wed, 17 Jul 2019 09:28:14 +0300 -Subject: [PATCH 015/125] Document binary literals +Subject: [PATCH 015/170] Document binary literals --- doc/cc65.sgml | 8 ++++++++ @@ -27,5 +27,5 @@ index 86b61ae4..601e364e 100644

-- -2.23.0 +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 index 4ee9346..f0dc61c 100644 --- 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 @@ -1,7 +1,7 @@ From 14ac1a7ff6cd26b862de76f4feab27be1f4974d4 Mon Sep 17 00:00:00 2001 From: jede Date: Wed, 3 Jul 2019 01:13:59 +0200 -Subject: [PATCH 016/125] Fix bug : gotoxy does not working because Y does not +Subject: [PATCH 016/170] Fix bug : gotoxy does not working because Y does not update the adress on the screen --- @@ -42,5 +42,5 @@ index e1470f84..03d0a215 100644 rts .endproc -- -2.23.0 +2.26.0 diff --git a/0017-Add-textcolor-and-bgcolor.s.patch b/0017-Add-textcolor-and-bgcolor.s.patch index 4f46c70..5302bba 100644 --- a/0017-Add-textcolor-and-bgcolor.s.patch +++ b/0017-Add-textcolor-and-bgcolor.s.patch @@ -1,7 +1,7 @@ From 7f9e73a1ce42ca5489f7b533d942a4d8b3193148 Mon Sep 17 00:00:00 2001 From: jede Date: Sat, 6 Jul 2019 10:16:57 +0200 -Subject: [PATCH 017/125] Add textcolor and bgcolor.s +Subject: [PATCH 017/170] Add textcolor and bgcolor.s --- asminc/telestrat.inc | 1 + @@ -293,5 +293,5 @@ index 00000000..6c635268 + + -- -2.23.0 +2.26.0 diff --git a/0018-Fix-gotoy-changecolor.patch b/0018-Fix-gotoy-changecolor.patch index 375d41d..3dfcfd5 100644 --- a/0018-Fix-gotoy-changecolor.patch +++ b/0018-Fix-gotoy-changecolor.patch @@ -1,7 +1,7 @@ From 3d5811d8f5ef8b14e39635c7ec9fb9f01ca6c62f Mon Sep 17 00:00:00 2001 From: jede Date: Sat, 6 Jul 2019 10:19:45 +0200 -Subject: [PATCH 018/125] Fix gotoy changecolor +Subject: [PATCH 018/170] Fix gotoy changecolor --- libsrc/telestrat/gotoy.s | 6 ++++++ @@ -24,5 +24,5 @@ index c6010cc2..99ab3ec6 100644 rts .endproc -- -2.23.0 +2.26.0 diff --git a/0019-fix-typo.patch b/0019-fix-typo.patch index 32207f3..e40034f 100644 --- a/0019-fix-typo.patch +++ b/0019-fix-typo.patch @@ -1,7 +1,7 @@ From 7767a0e88e28882c03e9072b72995205d30cd1ea Mon Sep 17 00:00:00 2001 From: jede Date: Sat, 6 Jul 2019 10:26:19 +0200 -Subject: [PATCH 019/125] fix typo +Subject: [PATCH 019/170] fix typo --- libsrc/telestrat/gotoxy.s | 3 +-- @@ -22,5 +22,5 @@ index 0a3db00b..a73ab5ff 100644 .include "telestrat.inc" -- -2.23.0 +2.26.0 diff --git a/0020-fix-import.patch b/0020-fix-import.patch index 26f014f..c837333 100644 --- a/0020-fix-import.patch +++ b/0020-fix-import.patch @@ -1,7 +1,7 @@ From 28eba8bff9688173257a7c537b3e2533cf1e7012 Mon Sep 17 00:00:00 2001 From: jede Date: Sat, 6 Jul 2019 10:33:39 +0200 -Subject: [PATCH 020/125] fix import +Subject: [PATCH 020/170] fix import --- libsrc/telestrat/gotoxy.s | 2 +- @@ -34,5 +34,5 @@ index 99ab3ec6..ee437f00 100644 .import _update_adscr -- -2.23.0 +2.26.0 diff --git a/0021-Fix-typo-and-optimize.patch b/0021-Fix-typo-and-optimize.patch index dd2fba4..e0abe08 100644 --- a/0021-Fix-typo-and-optimize.patch +++ b/0021-Fix-typo-and-optimize.patch @@ -1,7 +1,7 @@ From a0a6537bdaa29743ceea170ee4884ab018da7369 Mon Sep 17 00:00:00 2001 From: jede Date: Sun, 7 Jul 2019 22:02:48 +0200 -Subject: [PATCH 021/125] Fix typo and optimize +Subject: [PATCH 021/170] Fix typo and optimize --- libsrc/telestrat/bgcolor.s | 9 +++------ @@ -165,5 +165,5 @@ index 6c635268..b5584902 100644 - - -- -2.23.0 +2.26.0 diff --git a/0022-Fix-label-optimize-code.patch b/0022-Fix-label-optimize-code.patch index dcc91a6..5c8804f 100644 --- a/0022-Fix-label-optimize-code.patch +++ b/0022-Fix-label-optimize-code.patch @@ -1,7 +1,7 @@ From 6f7f6b5119344a4cb855b5ea0b849b96a91701a7 Mon Sep 17 00:00:00 2001 From: jede Date: Wed, 10 Jul 2019 21:44:07 +0200 -Subject: [PATCH 022/125] Fix label, optimize code +Subject: [PATCH 022/170] Fix label, optimize code --- libsrc/telestrat/clrscr.s | 15 +++++++-------- @@ -115,5 +115,5 @@ index b5584902..ee6ba729 100644 rts out: -- -2.23.0 +2.26.0 diff --git a/0023-Fix-bug-with-bgcolor-and-textcolor.patch b/0023-Fix-bug-with-bgcolor-and-textcolor.patch index 0af9a0e..f02ca8a 100644 --- a/0023-Fix-bug-with-bgcolor-and-textcolor.patch +++ b/0023-Fix-bug-with-bgcolor-and-textcolor.patch @@ -1,7 +1,7 @@ From ede64f68a9e2a9bf38d70e0887748409ba157384 Mon Sep 17 00:00:00 2001 From: jede Date: Wed, 17 Jul 2019 21:48:53 +0200 -Subject: [PATCH 023/125] Fix bug with bgcolor and textcolor +Subject: [PATCH 023/170] Fix bug with bgcolor and textcolor --- libsrc/telestrat/bgcolor.s | 15 +-------- @@ -298,5 +298,5 @@ index ee6ba729..77bf6c71 100644 rts .endproc -- -2.23.0 +2.26.0 diff --git a/0024-jmp-instead-of-jsr.patch b/0024-jmp-instead-of-jsr.patch index ece0b42..cd81889 100644 --- a/0024-jmp-instead-of-jsr.patch +++ b/0024-jmp-instead-of-jsr.patch @@ -1,7 +1,7 @@ From f9e13abc11ed85418e288eefdfb031766ee90b3b Mon Sep 17 00:00:00 2001 From: jede Date: Wed, 17 Jul 2019 22:53:49 +0200 -Subject: [PATCH 024/125] jmp instead of jsr +Subject: [PATCH 024/170] jmp instead of jsr --- libsrc/telestrat/gotoxy.s | 5 +++-- @@ -41,5 +41,5 @@ index 182e3f74..008d4413 100644 + jmp update_adscr .endproc -- -2.23.0 +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 index 7859c4d..a4c2f1d 100644 --- a/0025-Fix-bgcolor-and-textcolor-must-return-last-color-jmp.patch +++ b/0025-Fix-bgcolor-and-textcolor-must-return-last-color-jmp.patch @@ -1,7 +1,7 @@ From 0fe98a7ca862d42456a5b9cdba4daf22b94de843 Mon Sep 17 00:00:00 2001 From: jede Date: Thu, 18 Jul 2019 20:48:10 +0200 -Subject: [PATCH 025/125] Fix bgcolor and textcolor must return last color, jmp +Subject: [PATCH 025/170] Fix bgcolor and textcolor must return last color, jmp remove. --- @@ -81,5 +81,5 @@ index 77bf6c71..7d16c9e1 100644 rts .endproc -- -2.23.0 +2.26.0 diff --git a/0026-Optimize-Clrscr.patch b/0026-Optimize-Clrscr.patch index 4d1df9e..7d3b818 100644 --- a/0026-Optimize-Clrscr.patch +++ b/0026-Optimize-Clrscr.patch @@ -1,7 +1,7 @@ From 848df36f6b766835f6a560447341037448d54478 Mon Sep 17 00:00:00 2001 From: jede Date: Sun, 21 Jul 2019 10:56:32 +0200 -Subject: [PATCH 026/125] Optimize Clrscr +Subject: [PATCH 026/170] Optimize Clrscr --- libsrc/telestrat/clrscr.s | 2 +- @@ -21,5 +21,5 @@ index 52f34dca..2adc905b 100644 sta OLD_CHARCOLOR -- -2.23.0 +2.26.0 diff --git a/0027-Cleaning-import-variables.patch b/0027-Cleaning-import-variables.patch index e7f98fe..3e7f57a 100644 --- a/0027-Cleaning-import-variables.patch +++ b/0027-Cleaning-import-variables.patch @@ -1,7 +1,7 @@ From 996537282c6c9c3eb4565f03ce8653c5889bbab1 Mon Sep 17 00:00:00 2001 From: jede Date: Sun, 21 Jul 2019 10:57:17 +0200 -Subject: [PATCH 027/125] Cleaning import variables +Subject: [PATCH 027/170] Cleaning import variables --- libsrc/telestrat/clrscr.s | 2 +- @@ -21,5 +21,5 @@ index 2adc905b..aa2eae68 100644 .include "telestrat.inc" -- -2.23.0 +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 index cd4746b..366cc18 100644 --- a/0028-Fix-comment-and-gotox-force-colour-change.patch +++ b/0028-Fix-comment-and-gotox-force-colour-change.patch @@ -1,7 +1,7 @@ From e7bb0aad19ca0636e1fba54c6f9b7dae55f91e08 Mon Sep 17 00:00:00 2001 From: jede Date: Sun, 21 Jul 2019 11:01:14 +0200 -Subject: [PATCH 028/125] Fix comment and gotox force colour change +Subject: [PATCH 028/170] Fix comment and gotox force colour change --- libsrc/telestrat/cputc.s | 2 +- @@ -42,5 +42,5 @@ index cd8828d6..7a172071 100644 rts .endproc -- -2.23.0 +2.26.0 diff --git a/0029-Fix-bug-FF.patch b/0029-Fix-bug-FF.patch index c1010dd..f4a2b1f 100644 --- a/0029-Fix-bug-FF.patch +++ b/0029-Fix-bug-FF.patch @@ -1,7 +1,7 @@ From cceffbdb8c5f90302d0a89f6524fe71dd5489001 Mon Sep 17 00:00:00 2001 From: jede Date: Sun, 21 Jul 2019 18:38:17 +0200 -Subject: [PATCH 029/125] Fix bug $FF +Subject: [PATCH 029/170] Fix bug $FF --- libsrc/telestrat/clrscr.s | 6 ++++-- @@ -26,5 +26,5 @@ index aa2eae68..39c2f772 100644 rts .endproc -- -2.23.0 +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 index 00e2d17..bdb7081 100644 --- 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 @@ -1,7 +1,7 @@ From a0db846a9772ef82cf7163670e7a2fc109ec4b53 Mon Sep 17 00:00:00 2001 From: Greg King Date: Mon, 22 Jul 2019 09:05:01 -0400 -Subject: [PATCH 030/125] Allowed old-style (K and R) function declarations to +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. @@ -378,5 +378,5 @@ index fe194d89..df1d314e 100644 $(WORKDIR)/%.$1.$2.prg: %.c | $(WORKDIR) -- -2.23.0 +2.26.0 diff --git a/0031-Add-cclear-and-cclearxy.patch b/0031-Add-cclear-and-cclearxy.patch index b88ed28..1c04d35 100644 --- a/0031-Add-cclear-and-cclearxy.patch +++ b/0031-Add-cclear-and-cclearxy.patch @@ -1,7 +1,7 @@ From 3b07b8b8e3771ab297707facc043bbf78a542029 Mon Sep 17 00:00:00 2001 From: jede Date: Fri, 26 Jul 2019 23:04:54 +0200 -Subject: [PATCH 031/125] Add cclear and cclearxy +Subject: [PATCH 031/170] Add cclear and cclearxy --- libsrc/telestrat/cclear.s | 35 +++++++++++++++++++++++++++++++++++ @@ -50,5 +50,5 @@ index 00000000..bf875ec1 +@L9: + rts -- -2.23.0 +2.26.0 diff --git a/0032-Cleaning.patch b/0032-Cleaning.patch index d9475ad..927146c 100644 --- a/0032-Cleaning.patch +++ b/0032-Cleaning.patch @@ -1,7 +1,7 @@ From 3d63a8bb6233875d985f4658612878c6016d9dbd Mon Sep 17 00:00:00 2001 From: jede Date: Fri, 26 Jul 2019 23:11:34 +0200 -Subject: [PATCH 032/125] Cleaning +Subject: [PATCH 032/170] Cleaning --- libsrc/telestrat/cclear.s | 12 ++++++------ @@ -41,5 +41,5 @@ index bf875ec1..a3291996 100644 +@L2: rts -- -2.23.0 +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 index e7be2fe..65296e5 100644 --- a/0033-doc-clarify-need-for-.IMPORT-on-some-special-symbols.patch +++ b/0033-doc-clarify-need-for-.IMPORT-on-some-special-symbols.patch @@ -1,7 +1,7 @@ From cc373cc41dc4387e9936288047e892daafc44217 Mon Sep 17 00:00:00 2001 From: Jeremy Chadwick Date: Fri, 23 Aug 2019 23:36:43 -0700 -Subject: [PATCH 033/125] doc: clarify need for .IMPORT on some special symbols +Subject: [PATCH 033/170] doc: clarify need for .IMPORT on some special symbols --- doc/ld65.sgml | 6 ++++-- @@ -32,5 +32,5 @@ index 36489b0c..6add0f0f 100644 __STACK_START__ This is set to the start of the memory -- -2.23.0 +2.26.0 diff --git a/0034-Grammatical-modifications.patch b/0034-Grammatical-modifications.patch index 16b2b66..f0f572f 100644 --- a/0034-Grammatical-modifications.patch +++ b/0034-Grammatical-modifications.patch @@ -1,7 +1,7 @@ From 57b997355fd97565d4a6a9713832afd5fdaf4f83 Mon Sep 17 00:00:00 2001 From: Jeremy Chadwick Date: Sat, 24 Aug 2019 03:49:32 -0700 -Subject: [PATCH 034/125] Grammatical modifications +Subject: [PATCH 034/170] Grammatical modifications --- doc/ld65.sgml | 8 ++++---- @@ -34,5 +34,5 @@ index 6add0f0f..97233271 100644 __STACK_START__ This is set to the start of the memory -- -2.23.0 +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 index 1a2f395..5b6f068 100644 --- a/0035-Use-the-word-macros-universally-not-macroes.patch +++ b/0035-Use-the-word-macros-universally-not-macroes.patch @@ -1,7 +1,7 @@ From 4e3abf417fc485b89edf2a591cd4e22432d62ed1 Mon Sep 17 00:00:00 2001 From: Jeremy Chadwick Date: Mon, 26 Aug 2019 12:16:22 -0700 -Subject: [PATCH 035/125] Use the word 'macros' universally (not macroes) +Subject: [PATCH 035/170] Use the word 'macros' universally (not macroes) --- doc/ca65.sgml | 8 ++++---- @@ -48,5 +48,5 @@ index 0291f2eb..989dce70 100644 files with a ".i" suffix on their base names. Assembler files, object files, and libraries given on the command line are ignored. -- -2.23.0 +2.26.0 diff --git a/0036-Added-a-charmap-header-that-converts-no-character-en.patch b/0036-Added-a-charmap-header-that-converts-no-character-en.patch index c72350e..bfb714a 100644 --- a/0036-Added-a-charmap-header-that-converts-no-character-en.patch +++ b/0036-Added-a-charmap-header-that-converts-no-character-en.patch @@ -1,7 +1,7 @@ From c53b167307431ce1d087d4417d57fbadb06bc1eb Mon Sep 17 00:00:00 2001 From: Greg King Date: Sat, 7 Sep 2019 18:50:11 -0400 -Subject: [PATCH 036/125] Added a charmap header that converts no character +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. @@ -312,5 +312,5 @@ index 00000000..876dab18 + +#pragma warn (remap-zero, pop) -- -2.23.0 +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 index 0b191f9..a479a2c 100644 --- a/0037-Use-MACHID-to-check-for-realtime-clock.patch +++ b/0037-Use-MACHID-to-check-for-realtime-clock.patch @@ -1,7 +1,7 @@ From 3b128ba59f6bfc943bfdc9a971daa00f612f1193 Mon Sep 17 00:00:00 2001 From: Oliver Schmidt Date: Tue, 10 Sep 2019 09:49:06 +0200 -Subject: [PATCH 037/125] Use MACHID to check for realtime clock. +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. --- @@ -109,5 +109,5 @@ index 07032fdd..f722f6f4 100644 ; Get tm -- -2.23.0 +2.26.0 diff --git a/0038-Added-a-.ORG-keyword-to-ca65-structs-unions.patch b/0038-Added-a-.ORG-keyword-to-ca65-structs-unions.patch index 707157f..767b18c 100644 --- a/0038-Added-a-.ORG-keyword-to-ca65-structs-unions.patch +++ b/0038-Added-a-.ORG-keyword-to-ca65-structs-unions.patch @@ -1,7 +1,7 @@ From 0896deedefa81598ecbc472ffb6cdb9f8dca864e Mon Sep 17 00:00:00 2001 From: Greg King Date: Wed, 11 Sep 2019 17:55:49 -0400 -Subject: [PATCH 038/125] Added a .ORG keyword to ca65 structs/unions. +Subject: [PATCH 038/170] Added a .ORG keyword to ca65 structs/unions. Allow 24-bit numbers as operands in ca65 structs/unions. --- @@ -387,5 +387,5 @@ index 5ea7a18e..6d279a70 100644 ** by user code. ** Leave the struct scope level. -- -2.23.0 +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 index a857390..cbac42d 100644 --- 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 @@ -1,7 +1,7 @@ From 18afc7c7038280e2443c64e31cf2f0092a484004 Mon Sep 17 00:00:00 2001 From: Greg King Date: Fri, 27 Sep 2019 03:38:51 -0400 -Subject: [PATCH 039/125] Created a target and a library for the Commander X16 +Subject: [PATCH 039/170] Created a target and a library for the Commander X16 prototype computer. --- @@ -3102,5 +3102,5 @@ index 3d584bf9..53d63c5c 100644 + return EXIT_SUCCESS; } -- -2.23.0 +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 index 5e664ac..5324868 100644 --- 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 @@ -1,7 +1,7 @@ From 6cae84a25da68d0970c54e55d3faf6efa28b0da1 Mon Sep 17 00:00:00 2001 From: Greg King Date: Sat, 28 Sep 2019 00:54:27 -0400 -Subject: [PATCH 040/125] Updated the cx16 start-up to the emulator's release +Subject: [PATCH 040/170] Updated the cx16 start-up to the emulator's release 32. Made the Kernal ROM be visible when programs start. @@ -72,5 +72,5 @@ index 181e6308..a3a613bd 100644 spsave: .res 1 zpsave: .res zpspace -- -2.23.0 +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 index 2b3dc08..fe3c70e 100644 --- a/0041-Put-the-C64-code-into-cx16-_scrsize.s.patch +++ b/0041-Put-the-C64-code-into-cx16-_scrsize.s.patch @@ -1,7 +1,7 @@ From 2546c6ba1c985d3280c4f9539af3080ec2233b1e Mon Sep 17 00:00:00 2001 From: Greg King Date: Sat, 28 Sep 2019 01:38:16 -0400 -Subject: [PATCH 041/125] Put the C64 code into cx16/_scrsize.s. +Subject: [PATCH 041/170] Put the C64 code into cx16/_scrsize.s. (I forgot that SCREEN is an official jumptable function. --- @@ -32,5 +32,5 @@ index 8059f04d..f240b1e5 100644 - rts +screensize := SCREEN -- -2.23.0 +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 index 4c1fc1f..725c3c6 100644 --- a/0042-Fixed-a-typo-in-the-cx16-document.patch +++ b/0042-Fixed-a-typo-in-the-cx16-document.patch @@ -1,7 +1,7 @@ From d7ec817f0a472d9e812a5e7c5da298a16c228168 Mon Sep 17 00:00:00 2001 From: Greg King Date: Mon, 30 Sep 2019 10:41:21 -0400 -Subject: [PATCH 042/125] Fixed a typo in the cx16 document. +Subject: [PATCH 042/170] Fixed a typo in the cx16 document. --- doc/cx16.sgml | 2 +- @@ -21,5 +21,5 @@ index 077458bf..b739e6a9 100644 -- -2.23.0 +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 index 90f300d..4a9ca52 100644 --- a/0043-Added-character-codes-to-change-between-the-two-CBM-.patch +++ b/0043-Added-character-codes-to-change-between-the-two-CBM-.patch @@ -1,7 +1,7 @@ From 3cece61525cec3def39ac4791b04cdaccb45c85b Mon Sep 17 00:00:00 2001 From: Greg King Date: Tue, 1 Oct 2019 04:16:44 -0400 -Subject: [PATCH 043/125] Added character codes to change between the two CBM +Subject: [PATCH 043/170] Added character codes to change between the two CBM fonts. --- @@ -22,5 +22,5 @@ index d9b31543..96eb675c 100644 -- -2.23.0 +2.26.0 diff --git a/0044-Fixed-cgetc.patch b/0044-Fixed-cgetc.patch index ecf2ef8..94735dc 100644 --- a/0044-Fixed-cgetc.patch +++ b/0044-Fixed-cgetc.patch @@ -1,7 +1,7 @@ From 9dfc8f84bcc8b5ad4b50c16615a84b76cb7bedca Mon Sep 17 00:00:00 2001 From: Greg King Date: Tue, 1 Oct 2019 05:30:36 -0400 -Subject: [PATCH 044/125] Fixed cgetc(). +Subject: [PATCH 044/170] Fixed cgetc(). The GETIN function doesn't protect CPU registers. --- @@ -30,5 +30,5 @@ index 14cad5f5..2c5ea76d 100644 ldx #>$0000 rts -- -2.23.0 +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 index 2dbb42a..5868737 100644 --- a/0045-Made-the-none-CPU-allow-all-address-sizes.patch +++ b/0045-Made-the-none-CPU-allow-all-address-sizes.patch @@ -1,7 +1,7 @@ From 2e5fbe89cd3f67b06b292936dfdf4fdb104b7112 Mon Sep 17 00:00:00 2001 From: Greg King Date: Wed, 2 Oct 2019 10:09:48 -0400 -Subject: [PATCH 045/125] Made the "none" CPU allow all address sizes. +Subject: [PATCH 045/170] Made the "none" CPU allow all address sizes. --- src/common/cpu.c | 16 ++++++++-------- @@ -41,5 +41,5 @@ index b055fae8..c1ff400b 100644 default: FAIL ("Invalid address size"); -- -2.23.0 +2.26.0 diff --git a/0046-Fix-Gamate-RVS.patch b/0046-Fix-Gamate-RVS.patch index 24cd441..b11f76e 100644 --- a/0046-Fix-Gamate-RVS.patch +++ b/0046-Fix-Gamate-RVS.patch @@ -1,7 +1,7 @@ From 9bd92178b6b122727ad23179b8edb59759e9f999 Mon Sep 17 00:00:00 2001 From: Fabrizio Caruso Date: Thu, 3 Oct 2019 18:47:10 +0200 -Subject: [PATCH 046/125] Fix Gamate RVS +Subject: [PATCH 046/170] Fix Gamate RVS --- libsrc/gamate/conio.s | 1 + @@ -20,5 +20,5 @@ index 18d5da67..6ac43949 100644 lda #LCD_MODE_INC_Y sta LCD_MODE -- -2.23.0 +2.26.0 diff --git a/0047-Fix-colors-for-948.patch b/0047-Fix-colors-for-948.patch index ec1bb8d..e22dd90 100644 --- a/0047-Fix-colors-for-948.patch +++ b/0047-Fix-colors-for-948.patch @@ -1,7 +1,7 @@ From 96547d1dd46694ff940fa36e9fc4ac02472fb26b Mon Sep 17 00:00:00 2001 From: Stefan Date: Wed, 9 Oct 2019 10:03:38 +0200 -Subject: [PATCH 047/125] Fix colors for #948 +Subject: [PATCH 047/170] Fix colors for #948 --- include/creativision.h | 32 ++++++++++++++++---------------- @@ -51,5 +51,5 @@ index a9710902..40b9ee03 100644 /* Protos */ void __fastcall__ psg_outb(unsigned char b); -- -2.23.0 +2.26.0 diff --git a/0048-Hello-world-example-for-the-Supervision.patch b/0048-Hello-world-example-for-the-Supervision.patch index 1bb2d89..05fa097 100644 --- a/0048-Hello-world-example-for-the-Supervision.patch +++ b/0048-Hello-world-example-for-the-Supervision.patch @@ -1,7 +1,7 @@ From 74a904be54d357d6010cb24d9d1d69d488a558b1 Mon Sep 17 00:00:00 2001 From: Fabrizio Caruso Date: Thu, 3 Oct 2019 22:46:34 +0200 -Subject: [PATCH 048/125] Hello world example for the Supervision +Subject: [PATCH 048/170] Hello world example for the Supervision --- samples/supervisionhello.c | 72 ++++++++++++++++++++++++++++++++++++++ @@ -87,5 +87,5 @@ index 00000000..9b09a773 + + -- -2.23.0 +2.26.0 diff --git a/0049-Move-screen-init-into-crt0.s.patch b/0049-Move-screen-init-into-crt0.s.patch index 01e16ae..6dcd972 100644 --- a/0049-Move-screen-init-into-crt0.s.patch +++ b/0049-Move-screen-init-into-crt0.s.patch @@ -1,7 +1,7 @@ From cdb8035cf0228a2194c7bfe9216e4897777b60a9 Mon Sep 17 00:00:00 2001 From: Fabrizio Caruso Date: Thu, 3 Oct 2019 23:32:16 +0200 -Subject: [PATCH 049/125] Move screen init into crt0.s +Subject: [PATCH 049/170] Move screen init into crt0.s --- cfg/supervision.cfg | 2 +- @@ -63,5 +63,5 @@ index 9b09a773..5996d219 100755 for(i=0;i<8;++i) -- -2.23.0 +2.26.0 diff --git a/0050-Improve-init-code-readability.patch b/0050-Improve-init-code-readability.patch index abd2df1..413fc13 100644 --- a/0050-Improve-init-code-readability.patch +++ b/0050-Improve-init-code-readability.patch @@ -1,7 +1,7 @@ From 915836b3ec888445eb290f61456a4e23f947bc6a Mon Sep 17 00:00:00 2001 From: Fabrizio Caruso Date: Sun, 6 Oct 2019 13:00:37 +0200 -Subject: [PATCH 050/125] Improve init code readability +Subject: [PATCH 050/170] Improve init code readability --- cfg/supervision.cfg | 2 +- @@ -41,5 +41,5 @@ index ab147efb..a474cfbe 100644 ; Now, the 32Kbyte image can reside in the top of 64Kbyte and 128Kbyte ROMs. jmp reset -- -2.23.0 +2.26.0 diff --git a/0051-Improve-helloworld-example-for-Supervision.patch b/0051-Improve-helloworld-example-for-Supervision.patch index 479dcbb..77d78f8 100644 --- a/0051-Improve-helloworld-example-for-Supervision.patch +++ b/0051-Improve-helloworld-example-for-Supervision.patch @@ -1,7 +1,7 @@ From eb83a3fd0f1f55910353bb6cb329b1a7f7d5137c Mon Sep 17 00:00:00 2001 From: Fabrizio Caruso Date: Sun, 6 Oct 2019 13:41:02 +0200 -Subject: [PATCH 051/125] Improve helloworld example for Supervision +Subject: [PATCH 051/170] Improve helloworld example for Supervision --- samples/supervisionhello.c | 71 +++++++++++++++++++++----------------- @@ -108,5 +108,5 @@ index 5996d219..c1832179 100755 while(1) {}; -- -2.23.0 +2.26.0 diff --git a/0052-Add-supervisionhello-in-samples-Makefile.patch b/0052-Add-supervisionhello-in-samples-Makefile.patch index 989ef15..7d2d56a 100644 --- a/0052-Add-supervisionhello-in-samples-Makefile.patch +++ b/0052-Add-supervisionhello-in-samples-Makefile.patch @@ -1,7 +1,7 @@ From b051c913e9ae0b6d87c92e438d091e0c61da98f6 Mon Sep 17 00:00:00 2001 From: Fabrizio Caruso Date: Sun, 6 Oct 2019 15:19:45 +0200 -Subject: [PATCH 052/125] Add supervisionhello in samples/Makefile +Subject: [PATCH 052/170] Add supervisionhello in samples/Makefile --- samples/Makefile | 3 +++ @@ -22,5 +22,5 @@ index ad81c247..69efbe43 100644 # Unlisted targets will try to build everything. # That lets us learn what they cannot build, and what settings -- -2.23.0 +2.26.0 diff --git a/0053-Use-decimal-for-lcd-size-initialization.patch b/0053-Use-decimal-for-lcd-size-initialization.patch index 710b764..cebdf09 100644 --- a/0053-Use-decimal-for-lcd-size-initialization.patch +++ b/0053-Use-decimal-for-lcd-size-initialization.patch @@ -1,7 +1,7 @@ From 40cf719068f69da617bc448b031160d47a914c2a Mon Sep 17 00:00:00 2001 From: Fabrizio Caruso Date: Sun, 6 Oct 2019 20:30:30 +0200 -Subject: [PATCH 053/125] Use decimal for lcd size initialization +Subject: [PATCH 053/170] Use decimal for lcd size initialization --- libsrc/supervision/crt0.s | 2 +- @@ -21,5 +21,5 @@ index a474cfbe..f1c65538 100644 sta lcd_height lda #(6<<5) | SV_LCD_ON | SV_NMI_ENABLE_ON -- -2.23.0 +2.26.0 diff --git a/0054-Comments.patch b/0054-Comments.patch index 74d016a..c5ffe4a 100644 --- a/0054-Comments.patch +++ b/0054-Comments.patch @@ -1,7 +1,7 @@ From 1b1d29ca9e8de2f323ac7e2492741034f0227872 Mon Sep 17 00:00:00 2001 From: Fabrizio Caruso Date: Mon, 7 Oct 2019 11:36:57 +0200 -Subject: [PATCH 054/125] Comments +Subject: [PATCH 054/170] Comments --- samples/supervisionhello.c | 11 +++++++++++ @@ -39,5 +39,5 @@ index c1832179..3d2c2602 100755 { 0x00, 0xC0, 0x30, 0xF0, 0x0C, 0xCC, 0x3C, 0xFC, -- -2.23.0 +2.26.0 diff --git a/0055-Improve-comments.patch b/0055-Improve-comments.patch index 5f33f2c..686e84d 100644 --- a/0055-Improve-comments.patch +++ b/0055-Improve-comments.patch @@ -1,7 +1,7 @@ From 7706ea2f133287fb0d107d6c7a9f1e99e3b0e4df Mon Sep 17 00:00:00 2001 From: Fabrizio Caruso Date: Mon, 7 Oct 2019 11:41:29 +0200 -Subject: [PATCH 055/125] Improve comments +Subject: [PATCH 055/170] Improve comments --- samples/supervisionhello.c | 5 +++-- @@ -33,5 +33,5 @@ index 3d2c2602..7cc866e5 100755 { 0x00, 0xC0, 0x30, 0xF0, 0x0C, 0xCC, 0x3C, 0xFC, -- -2.23.0 +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 index f5f6a66..21bde87 100644 --- a/0056-Init-is-no-longer-in-crt0.s.patch +++ b/0056-Init-is-no-longer-in-crt0.s.patch @@ -1,7 +1,7 @@ From fb260ef17f28305321a9932b710bd8f30f243dfc Mon Sep 17 00:00:00 2001 From: Fabrizio Caruso Date: Wed, 9 Oct 2019 09:23:57 +0200 -Subject: [PATCH 056/125] Init is no longer in crt0.s +Subject: [PATCH 056/170] Init is no longer in crt0.s --- cfg/supervision.cfg | 2 +- @@ -61,5 +61,5 @@ index 7cc866e5..db2b5f66 100755 display_char(3,2, h_char); -- -2.23.0 +2.26.0 diff --git a/0057-Significantly-faster-rand-implementation.patch b/0057-Significantly-faster-rand-implementation.patch index 8a95180..5a4378c 100644 --- a/0057-Significantly-faster-rand-implementation.patch +++ b/0057-Significantly-faster-rand-implementation.patch @@ -1,7 +1,7 @@ From 3994fee595605c5981d023c29b5d9d8e170d9adc Mon Sep 17 00:00:00 2001 From: LRFLEW Date: Mon, 7 Oct 2019 22:37:34 -0500 -Subject: [PATCH 057/125] Significantly faster rand() implementation +Subject: [PATCH 057/170] Significantly faster rand() implementation --- libsrc/common/rand.s | 22 ++++++---------------- @@ -46,5 +46,5 @@ index 102dd5be..fc23b6ee 100644 rts ; return bit (16-22,24-31) in (X,A) -- -2.23.0 +2.26.0 diff --git a/0058-Update-comments-in-rand.s.patch b/0058-Update-comments-in-rand.s.patch index aec856a..8eb42b2 100644 --- a/0058-Update-comments-in-rand.s.patch +++ b/0058-Update-comments-in-rand.s.patch @@ -1,7 +1,7 @@ From 216105f6df0f24ee656de3cf3abca4591ed3723d Mon Sep 17 00:00:00 2001 From: LRFLEW Date: Wed, 9 Oct 2019 01:42:50 -0500 -Subject: [PATCH 058/125] Update comments in rand.s +Subject: [PATCH 058/170] Update comments in rand.s --- libsrc/common/rand.s | 16 ++++++++++++++-- @@ -51,5 +51,5 @@ index fc23b6ee..a272af80 100644 adc rand+2 sta rand+2 -- -2.23.0 +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 index 818f5f6..08adfe0 100644 --- a/0059-Added-new-program-descriptions-to-the-list.patch +++ b/0059-Added-new-program-descriptions-to-the-list.patch @@ -1,7 +1,7 @@ From 39b10f9599b15a5256db22fe386472fa6ec0e12f Mon Sep 17 00:00:00 2001 From: Greg King Date: Fri, 11 Oct 2019 10:48:56 -0400 -Subject: [PATCH 059/125] Added new program descriptions to the list. +Subject: [PATCH 059/170] Added new program descriptions to the list. --- samples/README | 80 ++++++++++++++++++++++++++++++-------------------- @@ -181,5 +181,5 @@ index 88a6021c..7ace7da3 100644 + Apple ][, Atari, C64, C128, Oric Atmos and Telestrat, GEOS, + NES, and Lynx. -- -2.23.0 +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 index cc1b8c3..8dcce44 100644 --- a/0060-Fixed-problems-with-the-Atari-Lynx-s-TGI-driver.patch +++ b/0060-Fixed-problems-with-the-Atari-Lynx-s-TGI-driver.patch @@ -1,7 +1,7 @@ From f3f15cfd25dc5379ca48021884f4b96471dd895e Mon Sep 17 00:00:00 2001 From: Greg King Date: Sat, 12 Oct 2019 04:01:03 -0400 -Subject: [PATCH 060/125] Fixed problems with the Atari Lynx's TGI driver. +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.) @@ -153,5 +153,5 @@ index 04bdaae0..0728e687 100644 iny dec STRLEN -- -2.23.0 +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 index 4ec24b5..f61159b 100644 --- a/0061-cx16-Update-ROM-banks-to-new-mapping.patch +++ b/0061-cx16-Update-ROM-banks-to-new-mapping.patch @@ -1,7 +1,7 @@ From e660a4934791d046a2034257619148a72841a2ab Mon Sep 17 00:00:00 2001 From: LRFLEW Date: Mon, 7 Oct 2019 13:36:54 -0500 -Subject: [PATCH 061/125] [cx16] Update ROM banks to new mapping +Subject: [PATCH 061/170] [cx16] Update ROM banks to new mapping --- libsrc/cx16/crt0.s | 3 ++- @@ -29,5 +29,5 @@ index a3a613bd..873fd706 100644 ; Change to the first RAM bank. -- -2.23.0 +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 index 95ab3c6..68a0d18 100644 --- a/0062-Fixed-error-handling-for-missing-names-in-ld65-confi.patch +++ b/0062-Fixed-error-handling-for-missing-names-in-ld65-confi.patch @@ -1,7 +1,7 @@ From 4f24a06f0e06ea420ef6ec995ed86260aba8749a Mon Sep 17 00:00:00 2001 From: Greg King Date: Sat, 12 Oct 2019 07:59:49 -0400 -Subject: [PATCH 062/125] Fixed error handling for missing names in ld65 +Subject: [PATCH 062/170] Fixed error handling for missing names in ld65 configure files. --- @@ -37,5 +37,5 @@ index 31f1c7a4..d6278abb 100644 -- -2.23.0 +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 index 86f8bf0..fe36c60 100644 --- a/0063-Fix-char-35-38-42-47-52.patch +++ b/0063-Fix-char-35-38-42-47-52.patch @@ -1,7 +1,7 @@ From 5eda1c256cdda5fda1c8ee17a1036a84782a00b3 Mon Sep 17 00:00:00 2001 From: Fabrizio Caruso Date: Sun, 13 Oct 2019 10:27:09 +0200 -Subject: [PATCH 063/125] Fix char 35 38 42 47 52 +Subject: [PATCH 063/170] Fix char 35 38 42 47 52 --- libsrc/lynx/tgi/lynx-160-102-16.s | 10 +++++----- @@ -42,5 +42,5 @@ index 0728e687..cc85060c 100644 .byte $FF, $C3, $99, $99, $83, $9F, $99, $C3 ;54 .byte $FF, $E7, $E7, $E7, $E7, $F3, $99, $81 ;55 -- -2.23.0 +2.26.0 diff --git a/0064-Fix-4.patch b/0064-Fix-4.patch index 00a4601..291b4f4 100644 --- a/0064-Fix-4.patch +++ b/0064-Fix-4.patch @@ -1,7 +1,7 @@ From 0210d76694bad683f5fb6d384f619c0975d5f14d Mon Sep 17 00:00:00 2001 From: Fabrizio Caruso Date: Sun, 13 Oct 2019 10:41:44 +0200 -Subject: [PATCH 064/125] Fix 4 +Subject: [PATCH 064/170] Fix 4 --- libsrc/lynx/tgi/lynx-160-102-16.s | 2 +- @@ -21,5 +21,5 @@ index cc85060c..f749fc57 100644 .byte $FF, $C3, $99, $99, $83, $9F, $99, $C3 ;54 .byte $FF, $E7, $E7, $E7, $E7, $F3, $99, $81 ;55 -- -2.23.0 +2.26.0 diff --git a/0065-M-N-fixed.patch b/0065-M-N-fixed.patch index 3030e66..2cd32b5 100644 --- a/0065-M-N-fixed.patch +++ b/0065-M-N-fixed.patch @@ -1,7 +1,7 @@ From d04f7935c30b4b7aacb5670a968f51981c0c90df Mon Sep 17 00:00:00 2001 From: Fabrizio Caruso Date: Sun, 13 Oct 2019 11:23:09 +0200 -Subject: [PATCH 065/125] M N fixed +Subject: [PATCH 065/170] M N fixed --- libsrc/lynx/tgi/lynx-160-102-16.s | 4 ++-- @@ -30,5 +30,5 @@ index f749fc57..463a322a 100644 .byte $FF, $E7, $E7, $E7, $C3, $99, $99, $99 ;25 .byte $FF, $81, $9F, $CF, $E7, $F3, $F9, $81 ;26 -- -2.23.0 +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 index b8ecb0c..ec28c5e 100644 --- a/0066-Fix-left-arrow-char-77-13-64.patch +++ b/0066-Fix-left-arrow-char-77-13-64.patch @@ -1,7 +1,7 @@ From b91e2337146cab57a3a481a152c1b3051999696d Mon Sep 17 00:00:00 2001 From: Fabrizio Caruso Date: Sun, 13 Oct 2019 11:30:21 +0200 -Subject: [PATCH 066/125] Fix left arrow (char 77=13+64) +Subject: [PATCH 066/170] Fix left arrow (char 77=13+64) --- libsrc/lynx/tgi/lynx-160-102-16.s | 2 +- @@ -21,5 +21,5 @@ index 463a322a..53597b7d 100644 ; gemena -- -2.23.0 +2.26.0 diff --git a/0067-Fix-127-second-left-arrow.patch b/0067-Fix-127-second-left-arrow.patch index e7d2337..9d73512 100644 --- a/0067-Fix-127-second-left-arrow.patch +++ b/0067-Fix-127-second-left-arrow.patch @@ -1,7 +1,7 @@ From bac6f94929497f28d8a15a996e4fb578a6ff80d5 Mon Sep 17 00:00:00 2001 From: Fabrizio Caruso Date: Sun, 13 Oct 2019 12:13:46 +0200 -Subject: [PATCH 067/125] Fix 127 (second left arrow) +Subject: [PATCH 067/170] Fix 127 (second left arrow) --- libsrc/lynx/tgi/lynx-160-102-16.s | 2 +- @@ -18,5 +18,5 @@ index 53597b7d..00b7364c 100644 - .byte $FF, $EF, $CF, $80, $80, $CF, $EF, $FF ;255 + .byte $FF, $DF, $9F, $01, $01, $9F, $DF, $FF ;255 -- -2.23.0 +2.26.0 diff --git a/0068-small-m-and-n-fixed.patch b/0068-small-m-and-n-fixed.patch index 3e4a649..6188eb0 100644 --- a/0068-small-m-and-n-fixed.patch +++ b/0068-small-m-and-n-fixed.patch @@ -1,7 +1,7 @@ From 9a3e521358a31d7764988101e1da674b390ba49a Mon Sep 17 00:00:00 2001 From: Fabrizio Caruso Date: Sun, 13 Oct 2019 12:32:54 +0200 -Subject: [PATCH 068/125] small m and n fixed +Subject: [PATCH 068/170] small m and n fixed --- libsrc/lynx/tgi/lynx-160-102-16.s | 4 ++-- @@ -30,5 +30,5 @@ index 00b7364c..903d8f25 100644 .byte $87, $F3, $C1, $99, $99, $99, $FF, $FF ;249 .byte $FF, $81, $CF, $E7, $F3, $81, $FF, $FF ;250 -- -2.23.0 +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 index a665cde..eb23fc6 100644 --- 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 @@ -1,7 +1,7 @@ From e2007d074312c2f8600d8da87b2c55a724f4b128 Mon Sep 17 00:00:00 2001 From: Jeff Tranter Date: Thu, 4 Jan 2018 19:04:13 -0500 -Subject: [PATCH 069/125] New OSI input routine based on disassembly of ROM +Subject: [PATCH 069/170] New OSI input routine based on disassembly of ROM code. --- @@ -263,5 +263,5 @@ index aaa03ba6..9f8620dc 100644 RESET := $FF00 ; Reset address, show boot prompt KBD := $DF00 ; Polled keyboard register -- -2.23.0 +2.26.0 diff --git a/0070-Restructured-according-to-review.patch b/0070-Restructured-according-to-review.patch index 5536b12..20908dd 100644 --- a/0070-Restructured-according-to-review.patch +++ b/0070-Restructured-according-to-review.patch @@ -1,7 +1,7 @@ From eb2317d01400f361c396b4626b41894139060983 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20M=C3=BChlstrasser?= Date: Mon, 2 Sep 2019 20:52:16 +0200 -Subject: [PATCH 070/125] Restructured according to review +Subject: [PATCH 070/170] Restructured according to review Restructured according to review in pull request #567. @@ -498,5 +498,5 @@ index 1ecfa104..db28854f 100644 + .byte $00, '_', '-', ':', '0', '9', '8' + .byte '7', '6', '5', '4', '3', '2', '1' -- -2.23.0 +2.26.0 diff --git a/0071-Remove-obsolete-comment.patch b/0071-Remove-obsolete-comment.patch index 4477a1f..517b62e 100644 --- a/0071-Remove-obsolete-comment.patch +++ b/0071-Remove-obsolete-comment.patch @@ -1,7 +1,7 @@ From 8704d42005f91e11257a34c94ff97485a9ba1379 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20M=C3=BChlstrasser?= Date: Tue, 3 Sep 2019 10:04:30 +0200 -Subject: [PATCH 071/125] Remove obsolete comment +Subject: [PATCH 071/170] Remove obsolete comment --- kbhit.c | 19 +++++++++++++++++++ @@ -34,5 +34,5 @@ index 00000000..4ce1894c + return 0; +} -- -2.23.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 index 1a41af9..4323176 100644 --- a/0072-Remove-source-file-that-was-only-used-for-testing.patch +++ b/0072-Remove-source-file-that-was-only-used-for-testing.patch @@ -1,7 +1,7 @@ From 668273cdf5b402b78457bff3b8a6a1a275c0c404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20M=C3=BChlstrasser?= Date: Wed, 4 Sep 2019 19:33:14 +0200 -Subject: [PATCH 072/125] Remove source file that was only used for testing +Subject: [PATCH 072/170] Remove source file that was only used for testing --- kbhit.c | 19 ------------------- @@ -34,5 +34,5 @@ index 4ce1894c..00000000 - return 0; -} -- -2.23.0 +2.26.0 diff --git a/0073-Address-review-comments.patch b/0073-Address-review-comments.patch index d8361b5..3dc8714 100644 --- a/0073-Address-review-comments.patch +++ b/0073-Address-review-comments.patch @@ -1,7 +1,7 @@ From 7547c4c77c1feef64a247c3c091ba995ff1de03c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20M=C3=BChlstrasser?= Date: Tue, 17 Sep 2019 20:03:51 +0200 -Subject: [PATCH 073/125] Address review comments +Subject: [PATCH 073/170] Address review comments - removed typo from comment - removed redundant AND instruction @@ -45,5 +45,5 @@ index db28854f..122a81c6 100644 lda KBDTMP and #$06 -- -2.23.0 +2.26.0 diff --git a/0074-Removed-redundant-LDA.patch b/0074-Removed-redundant-LDA.patch index e39d8b7..babed15 100644 --- a/0074-Removed-redundant-LDA.patch +++ b/0074-Removed-redundant-LDA.patch @@ -1,7 +1,7 @@ From 55444b8337bf163970f62ad1aa3f917a6f0719ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20M=C3=BChlstrasser?= Date: Tue, 17 Sep 2019 20:23:36 +0200 -Subject: [PATCH 074/125] Removed redundant LDA +Subject: [PATCH 074/170] Removed redundant LDA After the removal of the redundant AND in commit 704c8df04ffa3679f87fff019ad986fbd8801ca5 also the @@ -23,5 +23,5 @@ index 122a81c6..8744baf6 100644 bne LFDA2 bit LASTSCAN -- -2.23.0 +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 index 29755d5..0178ffa 100644 --- 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 @@ -1,7 +1,7 @@ From f3d898d6a3e2f5a595e542c5fb27c06fd3e21fad Mon Sep 17 00:00:00 2001 From: Greg King Date: Tue, 15 Oct 2019 12:10:34 -0400 -Subject: [PATCH 075/125] Added the GIF switch to the X16 emulator's control +Subject: [PATCH 075/170] Added the GIF switch to the X16 emulator's control port. --- @@ -40,5 +40,5 @@ index 6f3f1c73..5b46908d 100644 + DETECT .byte 2 ; If is "16" string, then running on emulator (RO) .endstruct -- -2.23.0 +2.26.0 diff --git a/0076-Tentative-solution-for-cgetc-in-Lynx.patch b/0076-Tentative-solution-for-cgetc-in-Lynx.patch index 85b8a00..a215247 100644 --- a/0076-Tentative-solution-for-cgetc-in-Lynx.patch +++ b/0076-Tentative-solution-for-cgetc-in-Lynx.patch @@ -1,7 +1,7 @@ From da01286037dd1e396b15d756a401240c14b277a7 Mon Sep 17 00:00:00 2001 From: Fabrizio Caruso Date: Tue, 15 Oct 2019 22:25:26 +0200 -Subject: [PATCH 076/125] Tentative solution for cgetc in Lynx +Subject: [PATCH 076/170] Tentative solution for cgetc in Lynx --- libsrc/lynx/cgetc.s | 6 +++--- @@ -29,5 +29,5 @@ index b61fb44f..19cfdaff 100644 and #1 beq @L6 -- -2.23.0 +2.26.0 diff --git a/0077-Remove-useless-tax.patch b/0077-Remove-useless-tax.patch index 31f5cd3..c7c41d3 100644 --- a/0077-Remove-useless-tax.patch +++ b/0077-Remove-useless-tax.patch @@ -1,7 +1,7 @@ From e4b60e10682717360575c1d93885c72ab3dc86ea Mon Sep 17 00:00:00 2001 From: Fabrizio Caruso Date: Wed, 16 Oct 2019 13:30:58 +0200 -Subject: [PATCH 077/125] Remove useless tax +Subject: [PATCH 077/170] Remove useless tax --- libsrc/lynx/cgetc.s | 1 - @@ -20,5 +20,5 @@ index 19cfdaff..c81afa82 100644 @L1: lda KBSTL -- -2.23.0 +2.26.0 diff --git a/0078-remove-bra.patch b/0078-remove-bra.patch index 571d8ba..7ab813b 100644 --- a/0078-remove-bra.patch +++ b/0078-remove-bra.patch @@ -1,7 +1,7 @@ From 1074d35a1579ae1a6cc334455c0391fec6da416a Mon Sep 17 00:00:00 2001 From: Fabrizio Caruso Date: Wed, 16 Oct 2019 23:22:41 +0200 -Subject: [PATCH 078/125] remove bra +Subject: [PATCH 078/170] remove bra --- libsrc/lynx/cgetc.s | 32 +++++++++++++++----------------- @@ -77,5 +77,5 @@ index c81afa82..ee489337 100644 lda #'2' ; opt 2 pressed rts -- -2.23.0 +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 index 2abaa9a..ebd4b10 100644 --- a/0079-Added-VERA-peek-and-poke-to-the-cx16-library.patch +++ b/0079-Added-VERA-peek-and-poke-to-the-cx16-library.patch @@ -1,7 +1,7 @@ From 9fa90e2265b0d54e3fd9e6ec0227821f6a09d9de Mon Sep 17 00:00:00 2001 From: Greg King Date: Thu, 24 Oct 2019 05:15:42 -0400 -Subject: [PATCH 079/125] Added VERA peek() and poke() to the cx16 library. +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. --- @@ -138,5 +138,5 @@ index 00000000..9178850e + sty VERA::ADDR+2 + rts -- -2.23.0 +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 index 14743f8..249f9a9 100644 --- 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 @@ -1,7 +1,7 @@ From 128991d868f94d471540a3964b682d902073460d Mon Sep 17 00:00:00 2001 From: "Curt J. Sampson" Date: Thu, 24 Oct 2019 13:46:41 +0900 -Subject: [PATCH 080/125] libsrc/*/kplot.s: Use cbm_kernal.inc symbols, not +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 @@ -140,5 +140,5 @@ index f37ed8fc..1a943d37 100644 .endproc - -- -2.23.0 +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 index 51c8497..789d210 100644 --- 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 @@ -1,7 +1,7 @@ From 1d39863a602a728c83aa600a7929b76ce9d1bb06 Mon Sep 17 00:00:00 2001 From: "Curt J. Sampson" Date: Wed, 9 Oct 2019 21:05:00 +0900 -Subject: [PATCH 081/125] vic20/cputc: Fix incorrect CRAM_PTR at startup when +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 @@ -57,5 +57,5 @@ index 43aacdae..1db81854 100644 _cputcxy: pha ; Save C -- -2.23.0 +2.26.0 diff --git a/0082-Second-tentative-fix.patch b/0082-Second-tentative-fix.patch index 5311000..1059271 100644 --- a/0082-Second-tentative-fix.patch +++ b/0082-Second-tentative-fix.patch @@ -1,7 +1,7 @@ From 609f63ac749fc4bfc75720d5b27c5f7820dc741b Mon Sep 17 00:00:00 2001 From: Fabrizio Caruso Date: Mon, 28 Oct 2019 20:02:18 +0100 -Subject: [PATCH 082/125] Second tentative fix +Subject: [PATCH 082/170] Second tentative fix --- libsrc/lynx/cgetc.s | 4 ++++ @@ -47,5 +47,5 @@ index b606fc49..a5126a7d 100644 rts + -- -2.23.0 +2.26.0 diff --git a/0083-stz.patch b/0083-stz.patch index 4752971..cebc125 100644 --- a/0083-stz.patch +++ b/0083-stz.patch @@ -1,7 +1,7 @@ From 43f24afe297c93256f98dfae2e71613feeedb751 Mon Sep 17 00:00:00 2001 From: Fabrizio Caruso Date: Mon, 28 Oct 2019 21:25:41 +0100 -Subject: [PATCH 083/125] stz +Subject: [PATCH 083/170] stz --- libsrc/lynx/cgetc.s | 3 +-- @@ -22,5 +22,5 @@ index bb2840b1..17943e2d 100644 bit #$08 beq @L7 -- -2.23.0 +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 index 5855154..e4cfa8e 100644 --- a/0084-kbhit-checks-KBEDG-and-getc-resets-KBEDG.patch +++ b/0084-kbhit-checks-KBEDG-and-getc-resets-KBEDG.patch @@ -1,7 +1,7 @@ From 78d660da5571f29605dfdafe359527bf3c102823 Mon Sep 17 00:00:00 2001 From: Fabrizio Caruso Date: Wed, 30 Oct 2019 09:14:17 +0100 -Subject: [PATCH 084/125] kbhit checks KBEDG and getc resets KBEDG +Subject: [PATCH 084/170] kbhit checks KBEDG and getc resets KBEDG --- libsrc/lynx/cgetc.s | 16 ++++++++++------ @@ -82,5 +82,5 @@ index a5126a7d..a846c43e 100644 rts -- -2.23.0 +2.26.0 diff --git a/0085-Optimizations.patch b/0085-Optimizations.patch index 9efe2c7..018642b 100644 --- a/0085-Optimizations.patch +++ b/0085-Optimizations.patch @@ -1,7 +1,7 @@ From 2bd798fa13fffa2a73df3ca46285a59fd020f6bc Mon Sep 17 00:00:00 2001 From: Fabrizio Caruso Date: Wed, 30 Oct 2019 18:32:35 +0100 -Subject: [PATCH 085/125] Optimizations +Subject: [PATCH 085/170] Optimizations --- libsrc/lynx/cgetc.s | 9 ++------- @@ -50,5 +50,5 @@ index a846c43e..90d9061c 100644 rts -- -2.23.0 +2.26.0 diff --git a/0086-Reformat-comments-to-style-guide-rules.patch b/0086-Reformat-comments-to-style-guide-rules.patch index 391dfe3..5605ae5 100644 --- a/0086-Reformat-comments-to-style-guide-rules.patch +++ b/0086-Reformat-comments-to-style-guide-rules.patch @@ -1,7 +1,7 @@ From 0d21a2b5a4a71a39b730492068ca1cf01448b4d5 Mon Sep 17 00:00:00 2001 From: Richard Halkyard Date: Thu, 31 Oct 2019 11:23:15 -0500 -Subject: [PATCH 086/125] Reformat comments to style guide rules +Subject: [PATCH 086/170] Reformat comments to style guide rules --- libsrc/c64/tgi/c64-hi.s | 95 ++++++++++++++++++++--------------------- @@ -264,5 +264,5 @@ index c9167b51..38faf3d7 100644 lda X1 -- -2.23.0 +2.26.0 diff --git a/0087-Optimize-a-negation-in-signed-division.patch b/0087-Optimize-a-negation-in-signed-division.patch index 77ddfc5..162cd0c 100644 --- a/0087-Optimize-a-negation-in-signed-division.patch +++ b/0087-Optimize-a-negation-in-signed-division.patch @@ -1,7 +1,7 @@ From 2bec637637df08ffa5a43c0e75fa04015934e0e3 Mon Sep 17 00:00:00 2001 From: Piotr Fusik Date: Tue, 5 Nov 2019 20:15:34 +0100 -Subject: [PATCH 087/125] Optimize a negation in signed division. +Subject: [PATCH 087/170] Optimize a negation in signed division. --- libsrc/runtime/idiv32by16r16.s | 11 +++++------ @@ -37,5 +37,5 @@ index 12e7feb5..098e3dbf 100644 inx dey -- -2.23.0 +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 index 7d77948..4f04689 100644 --- a/0088-Don-t-set-carry-when-already-set.patch +++ b/0088-Don-t-set-carry-when-already-set.patch @@ -1,7 +1,7 @@ From 421c3f2b4fef1896316b0d8b0227727c50071fdb Mon Sep 17 00:00:00 2001 From: Piotr Fusik Date: Tue, 5 Nov 2019 20:16:21 +0100 -Subject: [PATCH 088/125] Don't set carry when already set. +Subject: [PATCH 088/170] Don't set carry when already set. --- libsrc/runtime/imul8x8r16.s | 4 +++- @@ -30,5 +30,5 @@ index e1aea30a..72e6d03a 100644 txa sbc ptr3+1 -- -2.23.0 +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 index 17b08d6..2b78fe9 100644 --- a/0089-Swap-the-positive-negative-paths-to-save-a-branch.patch +++ b/0089-Swap-the-positive-negative-paths-to-save-a-branch.patch @@ -1,7 +1,7 @@ From 985371433b016b4412f115c852fd44e0cf6dba69 Mon Sep 17 00:00:00 2001 From: Piotr Fusik Date: Tue, 5 Nov 2019 20:26:02 +0100 -Subject: [PATCH 089/125] Swap the positive/negative paths to save a branch. +Subject: [PATCH 089/170] Swap the positive/negative paths to save a branch. --- libsrc/runtime/imul8x8r16.s | 55 +++++++++++++++++++++---------------- @@ -90,5 +90,5 @@ index 72e6d03a..fe939f66 100644 tya ; Put result into cc65's accumulator rts -- -2.23.0 +2.26.0 diff --git a/0090-Optimize-sign-extension.patch b/0090-Optimize-sign-extension.patch index 5836f42..1ba93fb 100644 --- a/0090-Optimize-sign-extension.patch +++ b/0090-Optimize-sign-extension.patch @@ -1,7 +1,7 @@ From d38417b347323ba73d2af5106316720f038e95fa Mon Sep 17 00:00:00 2001 From: Piotr Fusik Date: Tue, 5 Nov 2019 20:44:21 +0100 -Subject: [PATCH 090/125] Optimize sign extension. +Subject: [PATCH 090/170] Optimize sign extension. --- libsrc/runtime/imul8x8r16.s | 16 ++++++++++------ @@ -36,5 +36,5 @@ index fe939f66..fe08c855 100644 bpl PosStart -- -2.23.0 +2.26.0 diff --git a/0091-Fixed-typos.patch b/0091-Fixed-typos.patch index f727d81..9ddec3d 100644 --- a/0091-Fixed-typos.patch +++ b/0091-Fixed-typos.patch @@ -1,7 +1,7 @@ From 7f7db01e257be7215430f5eaaa95842f96e3f949 Mon Sep 17 00:00:00 2001 From: Stefan Date: Sat, 9 Nov 2019 22:23:46 +0100 -Subject: [PATCH 091/125] Fixed typos +Subject: [PATCH 091/170] Fixed typos --- doc/funcref.sgml | 4 ++-- @@ -23,5 +23,5 @@ index 030c726c..6b39ad5e 100644 The function is actually a macro. -- -2.23.0 +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 index fab0e3f..94b2e73 100644 --- a/0092-Made-assert-send-SIGABRT-when-an-assertion-fails.patch +++ b/0092-Made-assert-send-SIGABRT-when-an-assertion-fails.patch @@ -1,7 +1,7 @@ From ac4866c027b881b9cde2b4195cac0988eb3ca411 Mon Sep 17 00:00:00 2001 From: Greg King Date: Sun, 10 Nov 2019 12:46:01 -0500 -Subject: [PATCH 092/125] Made assert() send SIGABRT when an assertion fails. +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. --- @@ -114,5 +114,5 @@ index 7c6df4a2..ed93fc12 100644 - - -- -2.23.0 +2.26.0 diff --git a/0093-Fixed-exit-code-974.patch b/0093-Fixed-exit-code-974.patch index 03b922a..220f15c 100644 --- a/0093-Fixed-exit-code-974.patch +++ b/0093-Fixed-exit-code-974.patch @@ -1,7 +1,7 @@ From 659d1729eb4e8192f3ff76a8813d8944b4c3cb40 Mon Sep 17 00:00:00 2001 From: Stefan Date: Tue, 12 Nov 2019 11:23:23 +0100 -Subject: [PATCH 093/125] Fixed exit code #974 +Subject: [PATCH 093/170] Fixed exit code #974 --- test/ref/yacc.c | 2 +- @@ -21,5 +21,5 @@ index f2c3e2a5..776e4f93 100644 testbreak++; -- -2.23.0 +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 index eec43b3..f50620e 100644 --- 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 @@ -1,7 +1,7 @@ From 4dda5d2173928271dd3d8b506b493e55088819c0 Mon Sep 17 00:00:00 2001 From: Greg King Date: Tue, 12 Nov 2019 11:57:38 -0500 -Subject: [PATCH 094/125] Changed a "See also" link in the abort() and assert() +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(). @@ -40,5 +40,5 @@ index 314c57d8..72a44c7b 100644 -- -2.23.0 +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 index 8d568a1..df2c620 100644 --- 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 @@ -1,7 +1,7 @@ From d78133e1f00be19929ca6ee920c30f782c502e8b Mon Sep 17 00:00:00 2001 From: Greg King Date: Sat, 16 Nov 2019 13:11:40 -0500 -Subject: [PATCH 095/125] Updated cx16 to match the Commander X16 ROMs and +Subject: [PATCH 095/170] Updated cx16 to match the Commander X16 ROMs and emulator, release 34. --- @@ -1536,5 +1536,5 @@ index 00000000..396a2d14 + rts +.endproc -- -2.23.0 +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 index 014dbce..b339129 100644 --- a/0096-Added-a-standard-mouse-driver-to-the-cx16-library.patch +++ b/0096-Added-a-standard-mouse-driver-to-the-cx16-library.patch @@ -1,7 +1,7 @@ From 5da525e0ea10987d9dbf1ad2ba5bad9548d23f59 Mon Sep 17 00:00:00 2001 From: Greg King Date: Sat, 16 Nov 2019 14:51:24 -0500 -Subject: [PATCH 096/125] Added a standard mouse driver to the cx16 library. +Subject: [PATCH 096/170] Added a standard mouse driver to the cx16 library. --- doc/cx16.sgml | 9 +- @@ -494,5 +494,5 @@ index 00000000..d708bb66 + +_mouse_stddrv: .asciiz "cx16-std.mou" -- -2.23.0 +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 index 88a5a5a..dabee6d 100644 --- a/0097-Fix-silent-crash-failure-on-warning-from-linker-comm.patch +++ b/0097-Fix-silent-crash-failure-on-warning-from-linker-comm.patch @@ -1,7 +1,7 @@ From 788fbcc9c8cdd88ecaf6baacef9cd347e406b0fd Mon Sep 17 00:00:00 2001 From: bbbradsmith Date: Sun, 17 Nov 2019 03:45:32 -0500 -Subject: [PATCH 097/125] Fix silent crash failure on warning from linker +Subject: [PATCH 097/170] Fix silent crash failure on warning from linker command line define import size mismatch --- @@ -30,5 +30,5 @@ index b83d8b49..be14f748 100644 if (I->Obj) { /* The import comes from an object file */ -- -2.23.0 +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 index d18612c..b8fafa2 100644 --- a/0098-make-linker-generated-export-warning-conistent-with-.patch +++ b/0098-make-linker-generated-export-warning-conistent-with-.patch @@ -1,7 +1,7 @@ From c9355734f5acce3c06553d7b7b7ddbda50a7b495 Mon Sep 17 00:00:00 2001 From: bbbradsmith Date: Mon, 18 Nov 2019 01:37:26 -0500 -Subject: [PATCH 098/125] make linker generated export warning conistent with +Subject: [PATCH 098/170] make linker generated export warning conistent with the import warning --- @@ -22,5 +22,5 @@ index be14f748..5df7a37c 100644 if (I->Obj) { /* The import comes from an object file */ -- -2.23.0 +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 index a2cd618..6ebe0fd 100644 --- 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 @@ -1,7 +1,7 @@ From 7bae9038cfc1ff25a6845c050a4a0d6a98fd47a9 Mon Sep 17 00:00:00 2001 From: mc78 Date: Mon, 11 Nov 2019 16:30:09 +0100 -Subject: [PATCH 099/125] Replaced plain 0's and 1's in exit statements with +Subject: [PATCH 099/170] Replaced plain 0's and 1's in exit statements with EXIT_SUCCESS or EXIT_FAILURE --- @@ -136,5 +136,5 @@ index 5712f453..27c7d88a 100644 V = SignedShiftRight1 (V); } -- -2.23.0 +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 index f7f6caa..1faf0e0 100644 --- a/0100-Added-enum-for-cc65-exit-codes.-replaced-stdlib-exit.patch +++ b/0100-Added-enum-for-cc65-exit-codes.-replaced-stdlib-exit.patch @@ -1,7 +1,7 @@ From 3daecfb3dd357047e12bdd002ab114bbeb29c85d Mon Sep 17 00:00:00 2001 From: mc78 Date: Tue, 12 Nov 2019 13:08:33 +0100 -Subject: [PATCH 100/125] Added enum for cc65 exit codes. replaced stdlib exit +Subject: [PATCH 100/170] Added enum for cc65 exit codes. replaced stdlib exit code names constants in libsrc with cc65 exit code named constants --- @@ -125,5 +125,5 @@ index b7cb35eb..665b7086 100644 + exit(CC65_EXIT_ABORT); } -- -2.23.0 +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 index 8256101..ea47433 100644 --- a/0101-Added-comment-to-debugger-exit-with-error.patch +++ b/0101-Added-comment-to-debugger-exit-with-error.patch @@ -1,7 +1,7 @@ From 694dd9240fe42d9544af82ed161927c62971d95d Mon Sep 17 00:00:00 2001 From: mc78 Date: Tue, 12 Nov 2019 20:48:43 +0100 -Subject: [PATCH 101/125] Added comment to debugger exit with error +Subject: [PATCH 101/170] Added comment to debugger exit with error --- libsrc/common/_afailed.c | 2 +- @@ -75,5 +75,5 @@ index ec21a6b4..cc9610dd 100644 void _afailed (char* file, unsigned line) { -- -2.23.0 +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 index 6289e8d..89bca5f 100644 --- 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 @@ -1,7 +1,7 @@ From 16a66f19e10b85e5adc4b0c72de07cbd8dd2159f Mon Sep 17 00:00:00 2001 From: mc78 Date: Fri, 15 Nov 2019 16:35:58 +0100 -Subject: [PATCH 102/125] Replaced enum in cc65.h by defines. added comment +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 @@ -77,5 +77,5 @@ index a4d07ac0..7798e004 100644 + return EXIT_SUCCESS; } -- -2.23.0 +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 index dc6385a..e62378f 100644 --- a/0103-Removed-CC65_-prefixes-from-exit-statements-in-abort.patch +++ b/0103-Removed-CC65_-prefixes-from-exit-statements-in-abort.patch @@ -1,7 +1,7 @@ From a139c4057c4bcea6518ab3dc9c23db0171d2d4c5 Mon Sep 17 00:00:00 2001 From: mc78 Date: Sun, 17 Nov 2019 13:13:43 +0100 -Subject: [PATCH 103/125] Removed CC65_ prefixes from exit statements in abort +Subject: [PATCH 103/170] Removed CC65_ prefixes from exit statements in abort and assert code as well from definition --- @@ -74,5 +74,5 @@ index 665b7086..92ed745a 100644 + exit(EXIT_ABORT); } -- -2.23.0 +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 index af4780b..43ab10b 100644 --- a/0104-Removed-additional-exit-constants-definitions-from-c.patch +++ b/0104-Removed-additional-exit-constants-definitions-from-c.patch @@ -1,7 +1,7 @@ From 8d2617110facddc2ba709db28abd710e7ce2ca38 Mon Sep 17 00:00:00 2001 From: mc78 Date: Sun, 17 Nov 2019 15:57:34 +0100 -Subject: [PATCH 104/125] Removed additional exit constants definitions from +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. @@ -104,5 +104,5 @@ index 92ed745a..90a65128 100644 void abort (void) { -- -2.23.0 +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 index 503e208..c163f8e 100644 --- a/0105-added-additional-empty-line-after-header-guard-in-cc.patch +++ b/0105-added-additional-empty-line-after-header-guard-in-cc.patch @@ -1,7 +1,7 @@ From 1dee2360fa5a5690271a347f782a214776550cab Mon Sep 17 00:00:00 2001 From: mc78 Date: Sun, 17 Nov 2019 16:16:32 +0100 -Subject: [PATCH 105/125] added additional empty line after header guard in +Subject: [PATCH 105/170] added additional empty line after header guard in cc65.h to conform to other headers --- @@ -21,5 +21,5 @@ index 720f1cd0..7e9c2cae 100644 /* Code */ /*****************************************************************************/ -- -2.23.0 +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 index 1518556..c2f5ae5 100644 --- a/0106-Removed-unnecessary-include-cc65.h-from-convert.c.patch +++ b/0106-Removed-unnecessary-include-cc65.h-from-convert.c.patch @@ -1,7 +1,7 @@ From db971d8a655c8f00109ba1d9403cf9838643b93a Mon Sep 17 00:00:00 2001 From: mc78 Date: Tue, 19 Nov 2019 13:17:02 +0100 -Subject: [PATCH 106/125] Removed unnecessary #include from convert.c +Subject: [PATCH 106/170] Removed unnecessary #include from convert.c Adjusted block comments to predominant style --- @@ -53,5 +53,5 @@ index 7798e004..ea9273fc 100644 unsigned char info_signature[3] = {3, 21, 63 | 0x80}; -- -2.23.0 +2.26.0 diff --git a/0107-Fixed-C16-978.patch b/0107-Fixed-C16-978.patch index bb05234..f0c587a 100644 --- a/0107-Fixed-C16-978.patch +++ b/0107-Fixed-C16-978.patch @@ -1,7 +1,7 @@ From d9a6fbac48d52e5765b0ac6e5531f7261561f61d Mon Sep 17 00:00:00 2001 From: Stefan Date: Tue, 19 Nov 2019 18:59:18 +0100 -Subject: [PATCH 107/125] Fixed C16 #978 +Subject: [PATCH 107/170] Fixed C16 #978 --- libsrc/c16/waitvsync.s | 1 + @@ -16,5 +16,5 @@ index 00000000..c020976b @@ -0,0 +1 @@ +.include "../plus4/waitvsync.s" -- -2.23.0 +2.26.0 diff --git a/0108-Update-c16.sgml.patch b/0108-Update-c16.sgml.patch index a622802..dc25fdd 100644 --- a/0108-Update-c16.sgml.patch +++ b/0108-Update-c16.sgml.patch @@ -1,7 +1,7 @@ From 9ab614d764b5f524cb60fb65c0e3d7187b97fdd0 Mon Sep 17 00:00:00 2001 From: Stefan Date: Tue, 19 Nov 2019 19:05:28 +0100 -Subject: [PATCH 108/125] Update c16.sgml +Subject: [PATCH 108/170] Update c16.sgml --- doc/c16.sgml | 5 +---- @@ -28,5 +28,5 @@ index 462f9834..ae64da47 100644 - - -- -2.23.0 +2.26.0 diff --git a/0109-Update-c128.sgml.patch b/0109-Update-c128.sgml.patch index 5182ce1..f1cfc9d 100644 --- a/0109-Update-c128.sgml.patch +++ b/0109-Update-c128.sgml.patch @@ -1,7 +1,7 @@ From 9bf2bf308aeb349b7693ed3feb64c29654c8d673 Mon Sep 17 00:00:00 2001 From: Stefan Date: Tue, 19 Nov 2019 19:09:54 +0100 -Subject: [PATCH 109/125] Update c128.sgml +Subject: [PATCH 109/170] Update c128.sgml --- doc/c128.sgml | 1 + @@ -20,5 +20,5 @@ index 1d8734fd..8c62b6ad 100644 -- -2.23.0 +2.26.0 diff --git a/0110-Update-c64.sgml.patch b/0110-Update-c64.sgml.patch index 2b76dfb..5428a2c 100644 --- a/0110-Update-c64.sgml.patch +++ b/0110-Update-c64.sgml.patch @@ -1,7 +1,7 @@ From 94892231bcc60ba0b004b94ecd2a7002b7b29e90 Mon Sep 17 00:00:00 2001 From: Stefan Date: Tue, 19 Nov 2019 19:10:32 +0100 -Subject: [PATCH 110/125] Update c64.sgml +Subject: [PATCH 110/170] Update c64.sgml --- doc/c64.sgml | 1 + @@ -20,5 +20,5 @@ index c1186705..7cd9b2d8 100644 -- -2.23.0 +2.26.0 diff --git a/0111-Update-cbm510.sgml.patch b/0111-Update-cbm510.sgml.patch index 692f2db..1431870 100644 --- a/0111-Update-cbm510.sgml.patch +++ b/0111-Update-cbm510.sgml.patch @@ -1,7 +1,7 @@ From 49ebac7ac1c6e563f481c6bdd585e724ae749763 Mon Sep 17 00:00:00 2001 From: Stefan Date: Tue, 19 Nov 2019 19:11:11 +0100 -Subject: [PATCH 111/125] Update cbm510.sgml +Subject: [PATCH 111/170] Update cbm510.sgml --- doc/cbm510.sgml | 1 + @@ -20,5 +20,5 @@ index 012a7b59..c208f3ea 100644 -- -2.23.0 +2.26.0 diff --git a/0112-Update-cx16.sgml.patch b/0112-Update-cx16.sgml.patch index 0e35e84..79d4970 100644 --- a/0112-Update-cx16.sgml.patch +++ b/0112-Update-cx16.sgml.patch @@ -1,7 +1,7 @@ From 63ab22f97f59953da5a38b265d3277dde163214c Mon Sep 17 00:00:00 2001 From: Stefan Date: Tue, 19 Nov 2019 19:14:08 +0100 -Subject: [PATCH 112/125] Update cx16.sgml +Subject: [PATCH 112/170] Update cx16.sgml --- doc/cx16.sgml | 62 +++++++++++++++++++++++++-------------------------- @@ -88,5 +88,5 @@ index 7189e715..2136265b 100644 -- -2.23.0 +2.26.0 diff --git a/0113-Update-funcref.sgml.patch b/0113-Update-funcref.sgml.patch index 35a95d8..a07e7a5 100644 --- a/0113-Update-funcref.sgml.patch +++ b/0113-Update-funcref.sgml.patch @@ -1,7 +1,7 @@ From c08f1e4bfdc56bcdd7da4c6422246f6e5896e9c3 Mon Sep 17 00:00:00 2001 From: Stefan Date: Tue, 19 Nov 2019 19:15:50 +0100 -Subject: [PATCH 113/125] Update funcref.sgml +Subject: [PATCH 113/170] Update funcref.sgml --- doc/funcref.sgml | 4 ++-- @@ -31,5 +31,5 @@ index 72a44c7b..7a46736e 100644 , , -- -2.23.0 +2.26.0 diff --git a/0114-Update-nes.sgml.patch b/0114-Update-nes.sgml.patch index 85a1f19..f427432 100644 --- a/0114-Update-nes.sgml.patch +++ b/0114-Update-nes.sgml.patch @@ -1,7 +1,7 @@ From 7361aa9959b8a869d18e4f457f00ea1bf449f0f9 Mon Sep 17 00:00:00 2001 From: Stefan Date: Tue, 19 Nov 2019 19:16:31 +0100 -Subject: [PATCH 114/125] Update nes.sgml +Subject: [PATCH 114/170] Update nes.sgml --- doc/nes.sgml | 2 +- @@ -22,5 +22,5 @@ index 3f8f7418..beb322fc 100644 -- -2.23.0 +2.26.0 diff --git a/0115-Update-pce.sgml.patch b/0115-Update-pce.sgml.patch index 65e7522..eac7d04 100644 --- a/0115-Update-pce.sgml.patch +++ b/0115-Update-pce.sgml.patch @@ -1,7 +1,7 @@ From ea16316e336f53c915bc038e0cd53f0e9895ab0f Mon Sep 17 00:00:00 2001 From: Stefan Date: Tue, 19 Nov 2019 19:17:22 +0100 -Subject: [PATCH 115/125] Update pce.sgml +Subject: [PATCH 115/170] Update pce.sgml --- doc/pce.sgml | 2 +- @@ -22,5 +22,5 @@ index a1866b8f..42a1ca9d 100644 -- -2.23.0 +2.26.0 diff --git a/0116-Update-plus4.sgml.patch b/0116-Update-plus4.sgml.patch index a215852..6741c75 100644 --- a/0116-Update-plus4.sgml.patch +++ b/0116-Update-plus4.sgml.patch @@ -1,7 +1,7 @@ From a56b176749bb6bf43a29e797e362a9596f5cb079 Mon Sep 17 00:00:00 2001 From: Stefan Date: Tue, 19 Nov 2019 19:18:05 +0100 -Subject: [PATCH 116/125] Update plus4.sgml +Subject: [PATCH 116/170] Update plus4.sgml --- doc/plus4.sgml | 1 + @@ -20,5 +20,5 @@ index 11468bb3..645de516 100644 -- -2.23.0 +2.26.0 diff --git a/0117-Update-vic20.sgml.patch b/0117-Update-vic20.sgml.patch index 3cadb21..17515e1 100644 --- a/0117-Update-vic20.sgml.patch +++ b/0117-Update-vic20.sgml.patch @@ -1,7 +1,7 @@ From c9d2c10cbd43cf4e46aec6ec6489515742737daf Mon Sep 17 00:00:00 2001 From: Stefan Date: Tue, 19 Nov 2019 19:18:39 +0100 -Subject: [PATCH 117/125] Update vic20.sgml +Subject: [PATCH 117/170] Update vic20.sgml --- doc/vic20.sgml | 1 + @@ -20,5 +20,5 @@ index e292e0a1..4fcd0079 100644 -- -2.23.0 +2.26.0 diff --git a/0118-Update-color.s.patch b/0118-Update-color.s.patch index 1f47b49..b4034ee 100644 --- a/0118-Update-color.s.patch +++ b/0118-Update-color.s.patch @@ -1,7 +1,7 @@ From 4497998944981862233914b75875590226021345 Mon Sep 17 00:00:00 2001 From: Stefan Date: Tue, 19 Nov 2019 19:20:19 +0100 -Subject: [PATCH 118/125] Update color.s +Subject: [PATCH 118/170] Update color.s --- libsrc/c16/color.s | 34 +--------------------------------- @@ -47,5 +47,5 @@ index 2f3046e8..fbcc95a2 100644 - +.include "../plus4/color.s" -- -2.23.0 +2.26.0 diff --git a/0119-Update-conio.s.patch b/0119-Update-conio.s.patch index 7accd14..e0fd554 100644 --- a/0119-Update-conio.s.patch +++ b/0119-Update-conio.s.patch @@ -1,7 +1,7 @@ From 06c98952fcd153d5ae4ac22477e8a51006481ee9 Mon Sep 17 00:00:00 2001 From: Stefan Date: Tue, 19 Nov 2019 19:21:00 +0100 -Subject: [PATCH 119/125] Update conio.s +Subject: [PATCH 119/170] Update conio.s --- libsrc/c16/conio.s | 11 +---------- @@ -24,5 +24,5 @@ index feca30c6..3ab372a2 100644 - +.include "../plus4/conio.s" -- -2.23.0 +2.26.0 diff --git a/0120-Update-cputc.s.patch b/0120-Update-cputc.s.patch index 540d98b..423e986 100644 --- a/0120-Update-cputc.s.patch +++ b/0120-Update-cputc.s.patch @@ -1,7 +1,7 @@ From 3f360fe3ee04490dd1664e27066c1248f9e4de87 Mon Sep 17 00:00:00 2001 From: Stefan Date: Tue, 19 Nov 2019 19:21:52 +0100 -Subject: [PATCH 120/125] Update cputc.s +Subject: [PATCH 120/170] Update cputc.s --- libsrc/c16/cputc.s | 105 +-------------------------------------------- @@ -118,5 +118,5 @@ index 49b3a84d..86959675 100644 - rts +.include "../plus4/cputc.s" -- -2.23.0 +2.26.0 diff --git a/0121-Update-fast.s.patch b/0121-Update-fast.s.patch index 08747ef..e7c1108 100644 --- a/0121-Update-fast.s.patch +++ b/0121-Update-fast.s.patch @@ -1,7 +1,7 @@ From df752ff7a58da5785f113c84cf946c5de75bbc58 Mon Sep 17 00:00:00 2001 From: Stefan Date: Tue, 19 Nov 2019 19:22:28 +0100 -Subject: [PATCH 121/125] Update fast.s +Subject: [PATCH 121/170] Update fast.s --- libsrc/c16/fast.s | 23 +---------------------- @@ -36,5 +36,5 @@ index e4881396..50924edb 100644 - +.include "../plus4/fast.s" -- -2.23.0 +2.26.0 diff --git a/0122-Update-isfast.s.patch b/0122-Update-isfast.s.patch index 6a2a1ee..fa40df1 100644 --- a/0122-Update-isfast.s.patch +++ b/0122-Update-isfast.s.patch @@ -1,7 +1,7 @@ From 2c34723a97631992dd6d00fa6e19bd49e05a7c87 Mon Sep 17 00:00:00 2001 From: Stefan Date: Tue, 19 Nov 2019 19:22:53 +0100 -Subject: [PATCH 122/125] Update isfast.s +Subject: [PATCH 122/170] Update isfast.s --- libsrc/c16/isfast.s | 23 +---------------------- @@ -36,5 +36,5 @@ index ff104d97..03684075 100644 - +.include "../plus4/isfast.s" -- -2.23.0 +2.26.0 diff --git a/0123-Update-revers.s.patch b/0123-Update-revers.s.patch index 604f987..f5508e6 100644 --- a/0123-Update-revers.s.patch +++ b/0123-Update-revers.s.patch @@ -1,7 +1,7 @@ From eeefd10f8f8699e7ceb0d02840257dd56f6a0bbb Mon Sep 17 00:00:00 2001 From: Stefan Date: Tue, 19 Nov 2019 19:23:31 +0100 -Subject: [PATCH 123/125] Update revers.s +Subject: [PATCH 123/170] Update revers.s --- libsrc/c16/revers.s | 28 +--------------------------- @@ -41,5 +41,5 @@ index f1c0b4d6..3ce66876 100644 - +.include "../plus4/revers.s" -- -2.23.0 +2.26.0 diff --git a/0124-Update-slow.s.patch b/0124-Update-slow.s.patch index 903656a..ed7f753 100644 --- a/0124-Update-slow.s.patch +++ b/0124-Update-slow.s.patch @@ -1,7 +1,7 @@ From 9d4d00737ec18db92ea395bef6185345eb353adb Mon Sep 17 00:00:00 2001 From: Stefan Date: Tue, 19 Nov 2019 19:24:14 +0100 -Subject: [PATCH 124/125] Update slow.s +Subject: [PATCH 124/170] Update slow.s --- libsrc/c16/slow.s | 23 +---------------------- @@ -36,5 +36,5 @@ index 18b8c231..70e461a9 100644 - +.include "../plus4/slow.s" -- -2.23.0 +2.26.0 diff --git a/0125-Update-status.s.patch b/0125-Update-status.s.patch index b02dd9e..05a7134 100644 --- a/0125-Update-status.s.patch +++ b/0125-Update-status.s.patch @@ -1,7 +1,7 @@ From d1fd7ffc59f2aa06ec4f5af263c867d2907eaaa0 Mon Sep 17 00:00:00 2001 From: Stefan Date: Tue, 19 Nov 2019 19:24:49 +0100 -Subject: [PATCH 125/125] Update status.s +Subject: [PATCH 125/170] Update status.s --- libsrc/c16/status.s | 6 +----- @@ -19,5 +19,5 @@ index c6f27923..04d97169 100644 - .exportzp ST := $90 ; IEC status byte +.include "../plus4/status.s" -- -2.23.0 +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 new file mode 100644 index 0000000..e4b38b6 --- /dev/null +++ b/0126-Added-cx16.h-to-the-function-reference-document.patch @@ -0,0 +1,104 @@ +From f75657d7e250268c5a4c444ecd8b2ac2ea7815db Mon Sep 17 00:00:00 2001 +From: Greg King +Date: Wed, 20 Nov 2019 12:11:47 -0500 +Subject: [PATCH 126/170] Added 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. + + + ++

++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++(incomplete) ++ ++ +

+ + +@@ -7702,24 +7716,31 @@ used in presence of a prototype. + + + +-, +-/ +-, ++, ++/ ++unsigned __fastcall__ videomode (unsigned Mode); /* for apple2enh and c128 */ ++signed char __fastcall__ videomode (signed char Mode); /* for cx16 */ ++ +-The function is specific to the C128 and enhanced Apple //e. ++The function is specific to the Commodore 128, the enhanced Apple //e, ++and the Commander X16. + This function replaces . +-The function is only available as fastcall function, so it may only be +-used in presence of a prototype. ++The function is available as only a fastcall function, so it may be used ++only in the presence of a prototype. + +-, + , ++ + , + + + +-/, +-/, +-/, +-/ ++, ++, ++, ++/ + + +-- +2.26.0 + diff --git a/0127-Expanded-Sim65-zero-page.patch b/0127-Expanded-Sim65-zero-page.patch new file mode 100644 index 0000000..0743155 --- /dev/null +++ b/0127-Expanded-Sim65-zero-page.patch @@ -0,0 +1,39 @@ +From d5c804f851c2dcf187a640b320cc49d466bfc76d Mon Sep 17 00:00:00 2001 +From: Oliver Schmidt +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 new file mode 100644 index 0000000..549a404 --- /dev/null +++ b/0128-Changed-sim65-s-internal-error-codes-from-9-bit-valu.patch @@ -0,0 +1,31 @@ +From fb0d09a277ce74959552fe1ce58f1b4d7ee8419f Mon Sep 17 00:00:00 2001 +From: Greg King +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 new file mode 100644 index 0000000..cea62a9 --- /dev/null +++ b/0129-Added-the-missing-BANK_RAM-array-to-the-Commander-X1.patch @@ -0,0 +1,80 @@ +From cab4910a7d07029b3cc0ffd8abd4355f0365f5b7 Mon Sep 17 00:00:00 2001 +From: Greg King +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 new file mode 100644 index 0000000..a759404 --- /dev/null +++ b/0130-Updated-the-cx16-library-to-the-Commander-X16-Kernal.patch @@ -0,0 +1,1534 @@ +From 3fa253d31fbec8602e791345125e33efadd98cbf Mon Sep 17 00:00:00 2001 +From: Greg King +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: + + + + 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

+ + +@@ -243,6 +244,9 @@ point to + Supports a standard 3-button mouse connected to the PS/2 mouse port of the + Commander X16. ++ ++ Currently (r35), this driver doesn't support

+ + +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 #(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 +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 new file mode 100644 index 0000000..08602ee --- /dev/null +++ b/0131-Made-the-program-chaining-exec-handle-the-X16-emulat.patch @@ -0,0 +1,47 @@ +From f067c4530fb385137a7458011b082690ac1c705e Mon Sep 17 00:00:00 2001 +From: Greg King +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 new file mode 100644 index 0000000..26df28e --- /dev/null +++ b/0132-Added-real-time-clock-functions-to-the-cx16-library.patch @@ -0,0 +1,396 @@ +From b56ba8f073c186339572b091033e1ebcd88191df Mon Sep 17 00:00:00 2001 +From: Greg King +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 ++ 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 + #include +@@ -10,74 +11,83 @@ + #include + + #ifdef __CC65__ +-#include +-#include +-#endif /* #ifdef __CC65__ */ ++ #include ++ #include ++#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 new file mode 100644 index 0000000..9e9399f --- /dev/null +++ b/0133-Fixed-the-target-guards-around-the-usage-messages.patch @@ -0,0 +1,38 @@ +From 00ab3c2d34b63cdadace7827e2f148db983d48eb Mon Sep 17 00:00:00 2001 +From: Greg King +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 +@@ -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 new file mode 100644 index 0000000..d5d5dbf --- /dev/null +++ b/0134-Made-ca65-give-error-messages-when-it-sees-duplicate.patch @@ -0,0 +1,70 @@ +From 5109c0b68f7a2cd07ece07b6812affeab07ae17a Mon Sep 17 00:00:00 2001 +From: Greg King +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 new file mode 100644 index 0000000..32a9160 --- /dev/null +++ b/0135-Changes-in-INSTALL-routine-from-emd-c128-vdc.s.patch @@ -0,0 +1,124 @@ +From 2a421396740049244d85e1591fdec91ae6d5fa08 Mon Sep 17 00:00:00 2001 +From: mc78 +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 + 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 new file mode 100644 index 0000000..e1235de --- /dev/null +++ b/0136-Added-reservation-of-second-byte-for-pagecount.patch @@ -0,0 +1,25 @@ +From 390878e831efdc73fc7698836762952dac53ffd9 Mon Sep 17 00:00:00 2001 +From: mc78 +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 new file mode 100644 index 0000000..7255f3d --- /dev/null +++ b/0137-Changed-the-order-in-which-lo-hi-bytes-of-vdc-addr-a.patch @@ -0,0 +1,87 @@ +From 244dc358e55a9b86a7281d40a576355c21268f30 Mon Sep 17 00:00:00 2001 +From: mc78 +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 + 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 new file mode 100644 index 0000000..710596f --- /dev/null +++ b/0138-Updated-the-cx16-library-to-the-ROM-s-prerelease-36.patch @@ -0,0 +1,1186 @@ +From b66f7272af4c566df6205f55296ac365ecbf8c73 Mon Sep 17 00:00:00 2001 +From: Greg King +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 ++; 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. + Memory layout

+ + 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 Introduction

+ +-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 . + + + + ++ + + + +@@ -321,6 +322,7 @@ function. +

+ + ++ + + + +@@ -2281,6 +2283,9 @@ only be used in presence of a prototype. + + , ++, ++, + + +@@ -2302,9 +2307,34 @@ only be used in presence of a prototype. + + , + , +- ++, ++, ++ ++ ++ ++ ++ ++cbm_k_settim

++ ++ ++ ++/ ++ ++The function is available only as a fastcall function; therefore, it may ++be used only in the presence of a prototype. ++ ++, ++ + + +@@ -2368,6 +2398,7 @@ then that ISR must call this function, in order to keep the clock valid. + , ++, + + +@@ -2585,6 +2616,7 @@ changing values. (See the description of + , + , + + 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. + + + + ISO C compatible library

+ +-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 + All functions that handle floating point numbers in some manner. +

+- The The +- All functions handling wide character strings. ++ All functions handling wide-character strings. +

+ Signals and all related functions (having + setbuf/setvbuf + +@@ -60,7 +60,7 @@ Functions not available on all supported systems: + + + fopen/fread/fwrite/fclose/fputs/fgets/fscanf: 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. +

+ ftell/fseek/fgetpos/fsetpos: Support depends on the +@@ -69,94 +69,95 @@ Functions not available on all supported systems: + rename/remove/rewind: Support depends on the capabilities of + the target machine. +

+- time: Since many of the supported systems do not have a real +- time clock, which means that the time: Many of the supported systems don't have a real-time ++ clock, which means that the + + + Functions that are limited in any way: + + +- strcspn/strpbrk/strspn: 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 ++ strcspn/strpbrk/strspn: 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. +

+ getenv: Since there is no such thing as an environment on all +- supported systems, the +- locale: There is no other locale than the "C" locale. The ++ locale: There is no locale other than the "C" locale. The + native locale is identical to the "C" locale. + + + +-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 +- The The +- The The + + + +-CPU specific stuff - 6502.h

++CPU-specific stuff - 6502.h

+ +-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. + + + +-Target specific stuff

++Target-specific stuff

+ +-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 ++ + +- Defines for special keys (like function keys) ++ Defines for special keys (such as function keys) + +- Defines for special characters (like the graphics characters) ++ Defines for special characters (such as the graphics characters) + + 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 +- 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 ++ 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. + + + + ++ + Direct console I/O - + + The + apple2 +@@ -165,13 +166,13 @@ portable. conio implementations exist for the following targets: + atari5200 + atarixl + atmos ++ c128 + c16 (works also for the c116 with up to 32K memory) + c64 +- c128 +- plus4 (or expanded c16/c116) +- cbm510 (40 column video) +- cbm610 (all CBM series-II computers with 80 column video) ++ cbm510 (40-column video) ++ cbm610 (all CBM series-II computers with 80-column video) + creativision ++ cx16 + gamate + geos-apple + geos-cbm +@@ -179,11 +180,12 @@ portable. conio implementations exist for the following targets: + osic1p + pce + pet (all CBM PET systems except the 2001) ++ plus4 (or expanded c16/c116) + telestrat + vic20 + + +-The conio.h header file does also include the system specific header files ++The Using the joystick - + + For systems that have a joystick, Using a mouse - + +-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: + + +@@ -206,19 +208,21 @@ the following targets: + apple2enh + atari + atarixl +- c64 + c128 ++ c64 + cbm510 ++ cx16 + + + The available functions are declared in Copyright

+ + 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: + 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. +- Altered source versions must be plainly marked as such, and must not ++ appreciated, but is not required. ++ Altered source versions must be marked plainly as such, and must not + be misrepresented as being the original software. + 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 new file mode 100644 index 0000000..51e7817 --- /dev/null +++ b/0139-Minor-cleanup.patch @@ -0,0 +1,56 @@ +From 0f08ae2c12829af9c7d4b7a7a47ff37528dd1ae1 Mon Sep 17 00:00:00 2001 +From: Oliver Schmidt +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 new file mode 100644 index 0000000..d8e7517 --- /dev/null +++ b/0140-Made-cc65-detect-a-possibly-missing-argument-at-the-.patch @@ -0,0 +1,105 @@ +From 90a2edcfa2e759893a1df9f8108267b43f769faf Mon Sep 17 00:00:00 2001 +From: Greg King +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 new file mode 100644 index 0000000..dffa72c --- /dev/null +++ b/0141-added-regression-test-related-to-bug-1001.patch @@ -0,0 +1,29 @@ +From a2bbb6f1be03e1285521da97ffa20622ad1449c1 Mon Sep 17 00:00:00 2001 +From: mrdudz +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 ++ ++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 new file mode 100644 index 0000000..9d08771 --- /dev/null +++ b/0142-store-y-first-then-a.-fix-by-willymanilly.patch @@ -0,0 +1,31 @@ +From a59402d5f544efd6d608ba4fdd64dc3a6758d2e5 Mon Sep 17 00:00:00 2001 +From: mrdudz +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 new file mode 100644 index 0000000..1f31aa0 --- /dev/null +++ b/0143-Fixes-Atari-OS-devhdl_t-init-field-needs-an-JMP-byte.patch @@ -0,0 +1,29 @@ +From f68cc06ec746ff6cc889d1a7b07ebd8769d7909c Mon Sep 17 00:00:00 2001 +From: Daniel Serpell +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 new file mode 100644 index 0000000..d54ae05 --- /dev/null +++ b/0144-Corrected-check-in-OptTransfers2-for-register-usage..patch @@ -0,0 +1,26 @@ +From 5b11eb4bb95a9982f33f2c580318202afc0b0882 Mon Sep 17 00:00:00 2001 +From: acqn +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 new file mode 100644 index 0000000..38d9daa --- /dev/null +++ b/0145-Always-insert-a-LDA-after-the-removed-PLA-during-the.patch @@ -0,0 +1,43 @@ +From 9559625ee874434dff7a015191cb14e2303b96b3 Mon Sep 17 00:00:00 2001 +From: acqn +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 new file mode 100644 index 0000000..bc0f44a --- /dev/null +++ b/0146-Quick-fix-for-the-OptPushPop-bug-reported-in-Issue-3.patch @@ -0,0 +1,26 @@ +From 6d530931bfc58c925107d2cae10bc2ebe067217b Mon Sep 17 00:00:00 2001 +From: acqn +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 new file mode 100644 index 0000000..29a30d0 --- /dev/null +++ b/0147-Just-disable-OptPushPop-if-N-Z-is-used-after-the-PLA.patch @@ -0,0 +1,55 @@ +From dc5114b0713fd4a8294e81dab83b8ecb59813d41 Mon Sep 17 00:00:00 2001 +From: acqn +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 new file mode 100644 index 0000000..5114200 --- /dev/null +++ b/0148-ctype-size-optimization.patch @@ -0,0 +1,5782 @@ +From ce80624f627ba887cf01d01d3f7c9dc02538a536 Mon Sep 17 00:00:00 2001 +From: IrgendwerA8 +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: + most of the functions declared in + + Note: This has two consequences: +@@ -259,9 +258,7 @@ Here is a description of all the command line options: + using + The inlined string and memory functions will not handle strings or +- memory areas larger than 255 bytes. Similarly, the inlined + + +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. + +-When compiling with When compiling without +@@ -4269,11 +4264,6 @@ fastcall function, so it may only be used in presence of a prototype. + +-When compiling with When compiling without +@@ -4305,12 +4295,6 @@ fastcall function, so it may only be used in presence of a prototype. + +-When compiling with When compiling without +@@ -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. + +-When compiling with When compiling without +@@ -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. + +-When compiling with When compiling without +@@ -4418,12 +4392,6 @@ fastcall function, so it may only be used in presence of a prototype. + +-When compiling with When compiling without +@@ -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. + +-When compiling with When compiling without +@@ -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. + +-When compiling with When compiling without +@@ -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. + +-When compiling with When compiling without +@@ -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. + +-When compiling with When compiling without +@@ -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'). + +-When compiling with When compiling without +@@ -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. + +-When compiling with When compiling without +@@ -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. + +-When compiling with When compiling without +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 ++#include ++#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= __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 new file mode 100644 index 0000000..177eb8e --- /dev/null +++ b/0149-Changes-resulting-from-code-review.patch @@ -0,0 +1,129 @@ +From 002d1801ec72c1dc11e90cd7e821395e6df61a5b Mon Sep 17 00:00:00 2001 +From: IrgendwerA8 +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 new file mode 100644 index 0000000..710d6a5 --- /dev/null +++ b/0150-Changes-resulting-from-2nd-code-review.patch @@ -0,0 +1,1316 @@ +From 08705a3fdc5050d284eb655e6efb2ab5664ca9a4 Mon Sep 17 00:00:00 2001 +From: IrgendwerA8 +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= __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 new file mode 100644 index 0000000..7106d14 --- /dev/null +++ b/0151-Fix-bug-in-tgi_line-HRS-X-parameters-are-16-bits.patch @@ -0,0 +1,52 @@ +From 026e57279de2aead494c93081f0a645aecbb39ae Mon Sep 17 00:00:00 2001 +From: jede +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 new file mode 100644 index 0000000..bc2d2fc --- /dev/null +++ b/0152-Fix-16-bits-values.patch @@ -0,0 +1,61 @@ +From 0962a9f286b483d35cd854ad1091115e47f9c2e8 Mon Sep 17 00:00:00 2001 +From: jede +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 new file mode 100644 index 0000000..869a9e6 --- /dev/null +++ b/0153-Normalized-Atari-naming.patch @@ -0,0 +1,25 @@ +From 857a566a2ee2202a392471fd86e4129c9076d695 Mon Sep 17 00:00:00 2001 +From: Oliver Schmidt +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 new file mode 100644 index 0000000..d12f645 --- /dev/null +++ b/0154-Fixed-a-typo-in-commit-2e5fbe89cd3f67b06b292936dfdf4.patch @@ -0,0 +1,27 @@ +From e2c664860781747eb247770bc766c7f0c5351a62 Mon Sep 17 00:00:00 2001 +From: Greg King +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 new file mode 100644 index 0000000..1aa6432 --- /dev/null +++ b/0155-Made-use-of-65C02-opcode-thx-to-polluks.patch @@ -0,0 +1,25 @@ +From b91ad02da1759ddc81d484fe0bfc4d0aaf98b897 Mon Sep 17 00:00:00 2001 +From: Oliver Schmidt +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 new file mode 100644 index 0000000..af044e5 --- /dev/null +++ b/0156-Fixed-an-error-message-printer.patch @@ -0,0 +1,28 @@ +From 2fc24847acc0e7d8718059f33b1d431d557050ef Mon Sep 17 00:00:00 2001 +From: Greg King +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 ? "" : SymTab[Addr], ++ Name == 0 ? "" : 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 new file mode 100644 index 0000000..7ba45a4 --- /dev/null +++ b/0157-SEGMENT-start-of-0-should-be-valid.patch @@ -0,0 +1,25 @@ +From e0cb33d9d486fe7e8c48d89a61ca4caff239d2e4 Mon Sep 17 00:00:00 2001 +From: bbbradsmith +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 new file mode 100644 index 0000000..905d223 --- /dev/null +++ b/0158-fix-whitespace.patch @@ -0,0 +1,25 @@ +From beaa77d2d6c119da0251de254bc1b8b751129a7a Mon Sep 17 00:00:00 2001 +From: Dirk Jagdmann +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 new file mode 100644 index 0000000..3bd3d05 --- /dev/null +++ b/0159-Update-get_ostype.s.patch @@ -0,0 +1,37 @@ +From 62eb3137abee926ed25e87574d6c1882c6c634df Mon Sep 17 00:00:00 2001 +From: Jeremy Rand +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 new file mode 100644 index 0000000..0fcc082 --- /dev/null +++ b/0160-Adjusted-comments-due-to-recent-change.patch @@ -0,0 +1,69 @@ +From a53bd345d855fdc175ed050cb4cd5b63427143fe Mon Sep 17 00:00:00 2001 +From: Oliver Schmidt +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 new file mode 100644 index 0000000..4233a7c --- /dev/null +++ b/0161-cc65-inline-asm-stp-mnemonic-support.patch @@ -0,0 +1,58 @@ +From 68ff89ba0a36b7d5d57d64077dfbb477215fd74a Mon Sep 17 00:00:00 2001 +From: "marko.lauke" +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 new file mode 100644 index 0000000..31a0a44 --- /dev/null +++ b/0162-code-style.patch @@ -0,0 +1,36 @@ +From 3e1284093359f1b57a1032f5708e76d9ca43ff2c Mon Sep 17 00:00:00 2001 +From: "marko.lauke" +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 new file mode 100644 index 0000000..dbc7f8e --- /dev/null +++ b/0163-Aligned-comment.patch @@ -0,0 +1,25 @@ +From 4ea2bfef0a80b253d9af81677a524fd1ab1a8670 Mon Sep 17 00:00:00 2001 +From: greg-king5 +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 new file mode 100644 index 0000000..604d112 --- /dev/null +++ b/0164-Added-missing-tag-and-itemize-Linuxdoc-tags-to-some-.patch @@ -0,0 +1,35 @@ +From 8b5a2f135cdbbafb829c1a3f4fd1518a2042eb56 Mon Sep 17 00:00:00 2001 +From: Greg King +Date: Fri, 27 Mar 2020 00:59:15 -0400 +Subject: [PATCH 164/170] Added missing and 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. + / + + When compiling without +@@ -4392,6 +4393,7 @@ fastcall function, so it may only be used in presence of a prototype. + + When compiling without +-- +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 new file mode 100644 index 0000000..51ea0ab --- /dev/null +++ b/0165-fix-the-clean-target-to-remove-any-disk-images.patch @@ -0,0 +1,50 @@ +From c15f4975d0a6d31a03f4c23ce5655f9615224997 Mon Sep 17 00:00:00 2001 +From: Dirk Jagdmann +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= 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 new file mode 100644 index 0000000..6e9256a --- /dev/null +++ b/0166-Matched-comment-to-the-one-in-the-C-header-file.patch @@ -0,0 +1,29 @@ +From 4cc95a2c6ce814a3882121b05db88d95b89822aa Mon Sep 17 00:00:00 2001 +From: Oliver Schmidt +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 new file mode 100644 index 0000000..23fd005 --- /dev/null +++ b/0167-Some-style-adjustments.patch @@ -0,0 +1,421 @@ +From 65dd931d22b7196a0b6a4de8d6d441e15acfdab1 Mon Sep 17 00:00:00 2001 +From: Oliver Schmidt +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 new file mode 100644 index 0000000..1a31f87 --- /dev/null +++ b/0168-Adjusted-tolower-and-toupper-to-https-github.com-cc6.patch @@ -0,0 +1,105 @@ +From df015f47662d3b2f44a383bd5dc520216c9285f7 Mon Sep 17 00:00:00 2001 +From: Oliver Schmidt +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 new file mode 100644 index 0000000..4cff01d --- /dev/null +++ b/0169-Fixed-tolower-and-toupper-to-save-high-byte.patch @@ -0,0 +1,77 @@ +From 411fe87f64f57dd3b2469214fdbca01a121b4569 Mon Sep 17 00:00:00 2001 +From: Oliver Schmidt +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 new file mode 100644 index 0000000..0c1fb79 --- /dev/null +++ b/0170-Shortened-names-and-adjusted-style.patch @@ -0,0 +1,669 @@ +From 0981c020b2e36a34fd3dfb29478c99d5b3142f7b Mon Sep 17 00:00:00 2001 +From: Oliver Schmidt +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 b153c58..023adea 100644 --- a/cc65.spec +++ b/cc65.spec @@ -39,7 +39,7 @@ infodir="%{_infodir}" Name: cc65 Version: 2.18 -Release: 11%{?dist} +Release: 12%{?dist} Summary: A free C compiler for 6502 based systems # For license clarification see: @@ -174,6 +174,51 @@ 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 BuildRequires: gcc BuildRequires: make @@ -380,6 +425,9 @@ they have been split into this package. %changelog +* Mon Apr 06 2020 Björn Esser - 2.18-12 +- Add several bugfix patches from upstream + * Tue Jan 28 2020 Fedora Release Engineering - 2.18-11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild