diff options
author | Ian C <ianc@noddybox.co.uk> | 2021-09-21 21:18:46 +0100 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2021-09-21 21:18:46 +0100 |
commit | 81216ea9a6da08678c7e38c5d3584d9a72655026 (patch) | |
tree | d613f8c3e6e385f39d8a407154786ce905954ad1 | |
parent | 25302a2513307a3a41b76f5e568f0916713c0620 (diff) |
Imported V1.10V1.10
-rw-r--r-- | CHANGELOG | 4 | ||||
-rw-r--r-- | doc/casm.html | 11 | ||||
-rw-r--r-- | src/casm.c | 2 | ||||
-rw-r--r-- | src/codepage.c | 35 | ||||
-rw-r--r-- | src/codepage.h | 3 |
5 files changed, 52 insertions, 3 deletions
@@ -3,3 +3,7 @@ V1.9 * Added CHANGELOG * Added Commodore 64 PRG output. * Added start-address option to T64 output. + +V1.10 +===== +* Added c64 codepage for Commodore 64 screen codes. diff --git a/doc/casm.html b/doc/casm.html index 9d78b7b..d52c0ea 100644 --- a/doc/casm.html +++ b/doc/casm.html @@ -744,6 +744,17 @@ https://en.wikipedia.org/wiki/PETSCII</a> more details. </td></tr> <tr><td class="cmd"> +c64 +</td> +<td class="def"> +The screen codes as used on the Commodore 64. Note these codes are different +to PETSCII and are the values to be poked into screen memory. The lower case +characters are the low part of the code -- these will appear onscreen either +in upper or lower case depending on the shift mode. The upper case characters +are either graphics characters or capital letters depending on the shift mode. +</td></tr> + +<tr><td class="cmd"> zx81 </td> <td class="def"> @@ -59,7 +59,7 @@ */ static const char *casm_usage = -"Version 1.9\n" +"Version 1.10\n" "\n" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" diff --git a/src/codepage.c b/src/codepage.c index 4ae9efe..5462a9b 100644 --- a/src/codepage.c +++ b/src/codepage.c @@ -60,6 +60,7 @@ static const ValueTable codepage_table[] = {"zx81", CP_ZX81}, {"spectrum", CP_SPECTRUM}, {"cbm", CP_CBM}, + {"c64", CP_C64}, {NULL} }; @@ -188,12 +189,44 @@ static CodepageDef cp_cbm[] = {0, 0} }; + +static CodepageDef cp_c64[] = +{ + {' ', 0x20}, {'!', 0x21}, {'"', 0x22}, {'#', 0x23}, + {'$', 0x24}, {'%', 0x25}, {'&', 0x26}, {'\'', 0x27}, + {'(', 0x28}, {')', 0x29}, {'*', 0x2a}, {'+', 0x2b}, + {',', 0x2c}, {'-', 0x2d}, {'.', 0x2e}, {'/', 0x2f}, + {'0', 0x30}, {'1', 0x31}, {'2', 0x32}, {'3', 0x33}, + {'4', 0x34}, {'5', 0x35}, {'6', 0x36}, {'7', 0x37}, + {'8', 0x38}, {'9', 0x39}, {':', 0x3a}, {';', 0x3b}, + {'<', 0x3c}, {'=', 0x3d}, {'>', 0x3e}, {'?', 0x3f}, + {'@', 0x00}, {'A', 0x41}, {'B', 0x42}, {'C', 0x43}, + {'D', 0x44}, {'E', 0x45}, {'F', 0x46}, {'G', 0x47}, + {'H', 0x48}, {'I', 0x49}, {'J', 0x4a}, {'K', 0x4b}, + {'L', 0x4c}, {'M', 0x4d}, {'N', 0x4e}, {'O', 0x4f}, + {'P', 0x50}, {'Q', 0x51}, {'R', 0x52}, {'S', 0x53}, + {'T', 0x54}, {'U', 0x55}, {'V', 0x56}, {'W', 0x57}, + {'X', 0x58}, {'Y', 0x59}, {'Z', 0x5a}, {'[', 0x1b}, + {'\\', 0x1f}, {']', 0x1d}, {'^', 0x1e}, {'_', 0x64}, + {'`', 0x1c}, {'a', 0x01}, {'b', 0x02}, {'c', 0x03}, + {'d', 0x04}, {'e', 0x05}, {'f', 0x06}, {'g', 0x07}, + {'h', 0x08}, {'i', 0x09}, {'j', 0x0a}, {'k', 0x0b}, + {'l', 0x0c}, {'m', 0x0d}, {'n', 0x0e}, {'o', 0x0f}, + {'p', 0x10}, {'q', 0x11}, {'r', 0x12}, {'s', 0x13}, + {'t', 0x14}, {'u', 0x15}, {'v', 0x16}, {'w', 0x17}, + {'x', 0x18}, {'y', 0x19}, {'z', 0x1a}, {'{', 0x5b}, + {'|', 0x5c}, {'}', 0x5d}, {'~', 0x5e}, + {0, 0} +}; + + static CodepageDef *cp_table[] = { cp_ascii, cp_zx81, cp_spectrum, - cp_cbm + cp_cbm, + cp_c64 }; diff --git a/src/codepage.h b/src/codepage.h index 36c98d6..51cea47 100644 --- a/src/codepage.h +++ b/src/codepage.h @@ -36,7 +36,8 @@ typedef enum CP_ASCII, CP_ZX81, CP_SPECTRUM, - CP_CBM + CP_CBM, + CP_C64 } Codepage; |