1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-31 11:32:00 +00:00

Merge pull request #338 from IrgendwerA8/master

Allow use of different charmaps on Atari target
This commit is contained in:
Oliver Schmidt 2016-08-28 11:22:44 +02:00 committed by GitHub
commit 1e7a992663
4 changed files with 729 additions and 0 deletions

View File

@ -318,6 +318,58 @@ chip registers.
</descrip><p>
<sect1>Character mapping<p>
The Atari has two representations for characters:
<enum>
<item> ATASCII is character mapping which is similar to ASCII and used
by the CIO system of the OS. This is the default mapping of cc65 when
producing code for the atari target.
<item> The internal/screen mapping represents the real value of the
screen ram when showing a character.
</enum>
For direct memory access (simplicity and speed) enabling the internal
mapping can be useful. This can be achieved by including the
"<tt/atari_screen_charmap.h/" header.
A word of caution: Since the <tt/0x00/ character has to be mapped in an
incompatible way to the C-standard, the usage of string functions in
conjunction with internal character mapped strings delivers unexpected
results regarding the string length. The end of strings are detected where
you may not expect them (to early or (much) to late). Internal mapped
strings typically support the "<tt/mem...()/" functions.
<em>For assembler sources the macro "<tt/scrcode/" from the "<tt/atari.mac/"
package delivers the same feature.</em>
You can switch back to the ATASCII mapping by including
"<tt/atari_atascii_charmap.h/".
A final note: Since cc65 has currently some difficulties with string merging
under different mappings, defining remapped strings works only flawlessly
with static array initialization:
<verb>
#include &lt;atari\_screen\_charmap.h&gt;
char pcScreenMappingString[] = "Hello Atari!";
#include &lt;atari_atascii_charmap.h&gt;
char pcAtasciiMappingString[] = "Hello Atari!";
</verb>
delivers correct results, while
<verb>
#include &lt;atari_screen_charmap.h&gt;
char* pcScreenMappingString = "Hello Atari!";
#include &lt;atari_atascii_charmap.h&gt;
char* pcAtasciiMappingString = "Hello Atari!";
</verb>
does not.
<sect>Loadable drivers<p>

View File

@ -0,0 +1,304 @@
/*****************************************************************************/
/* */
/* atari_atascii_charmap.h */
/* */
/* Atari system standard string mapping (ISO-8859-1 -> AtASCII) */
/* */
/* */
/* */
/* (C) 2016 Christian Krueger */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
/* warranty. In no event will the authors be held liable for any damages */
/* arising from the use of this software. */
/* */
/* Permission is granted to anyone to use this software for any purpose, */
/* including commercial applications, and to alter it and redistribute it */
/* freely, subject to the following restrictions: */
/* */
/* 1. The origin of this software must not be misrepresented; you must not */
/* claim that you wrote the original software. If you use this software */
/* in a product, an acknowledgment in the product documentation would be */
/* appreciated but is not required. */
/* 2. Altered source versions must be plainly marked as such, and must not */
/* be misrepresented as being the original software. */
/* 3. This notice may not be removed or altered from any source */
/* distribution. */
/* */
/*****************************************************************************/
/* No include guard here! Multiple use in one file may be intentional. */
#pragma charmap (0x00, 0x00)
#pragma charmap (0x01, 0x01)
#pragma charmap (0x02, 0x02)
#pragma charmap (0x03, 0x03)
#pragma charmap (0x04, 0x04)
#pragma charmap (0x05, 0x05)
#pragma charmap (0x06, 0x06)
#pragma charmap (0x07, 0xFD)
#pragma charmap (0x08, 0x08)
#pragma charmap (0x09, 0x7F)
#pragma charmap (0x0A, 0x9B)
#pragma charmap (0x0B, 0x0B)
#pragma charmap (0x0C, 0x7D)
#pragma charmap (0x0D, 0x0D)
#pragma charmap (0x0E, 0x0E)
#pragma charmap (0x0F, 0x0F)
#pragma charmap (0x10, 0x10)
#pragma charmap (0x11, 0x11)
#pragma charmap (0x12, 0x12)
#pragma charmap (0x13, 0x13)
#pragma charmap (0x14, 0x14)
#pragma charmap (0x15, 0x15)
#pragma charmap (0x16, 0x16)
#pragma charmap (0x17, 0x17)
#pragma charmap (0x18, 0x18)
#pragma charmap (0x19, 0x19)
#pragma charmap (0x1A, 0x1A)
#pragma charmap (0x1B, 0x1B)
#pragma charmap (0x1C, 0x1C)
#pragma charmap (0x1D, 0x1D)
#pragma charmap (0x1E, 0x1E)
#pragma charmap (0x1F, 0x1F)
#pragma charmap (0x20, 0x20)
#pragma charmap (0x21, 0x21)
#pragma charmap (0x22, 0x22)
#pragma charmap (0x23, 0x23)
#pragma charmap (0x24, 0x24)
#pragma charmap (0x25, 0x25)
#pragma charmap (0x26, 0x26)
#pragma charmap (0x27, 0x27)
#pragma charmap (0x28, 0x28)
#pragma charmap (0x29, 0x29)
#pragma charmap (0x2A, 0x2A)
#pragma charmap (0x2B, 0x2B)
#pragma charmap (0x2C, 0x2C)
#pragma charmap (0x2D, 0x2D)
#pragma charmap (0x2E, 0x2E)
#pragma charmap (0x2F, 0x2F)
#pragma charmap (0x30, 0x30)
#pragma charmap (0x31, 0x31)
#pragma charmap (0x32, 0x32)
#pragma charmap (0x33, 0x33)
#pragma charmap (0x34, 0x34)
#pragma charmap (0x35, 0x35)
#pragma charmap (0x36, 0x36)
#pragma charmap (0x37, 0x37)
#pragma charmap (0x38, 0x38)
#pragma charmap (0x39, 0x39)
#pragma charmap (0x3A, 0x3A)
#pragma charmap (0x3B, 0x3B)
#pragma charmap (0x3C, 0x3C)
#pragma charmap (0x3D, 0x3D)
#pragma charmap (0x3E, 0x3E)
#pragma charmap (0x3F, 0x3F)
#pragma charmap (0x40, 0x40)
#pragma charmap (0x41, 0x41)
#pragma charmap (0x42, 0x42)
#pragma charmap (0x43, 0x43)
#pragma charmap (0x44, 0x44)
#pragma charmap (0x45, 0x45)
#pragma charmap (0x46, 0x46)
#pragma charmap (0x47, 0x47)
#pragma charmap (0x48, 0x48)
#pragma charmap (0x49, 0x49)
#pragma charmap (0x4A, 0x4A)
#pragma charmap (0x4B, 0x4B)
#pragma charmap (0x4C, 0x4C)
#pragma charmap (0x4D, 0x4D)
#pragma charmap (0x4E, 0x4E)
#pragma charmap (0x4F, 0x4F)
#pragma charmap (0x50, 0x50)
#pragma charmap (0x51, 0x51)
#pragma charmap (0x52, 0x52)
#pragma charmap (0x53, 0x53)
#pragma charmap (0x54, 0x54)
#pragma charmap (0x55, 0x55)
#pragma charmap (0x56, 0x56)
#pragma charmap (0x57, 0x57)
#pragma charmap (0x58, 0x58)
#pragma charmap (0x59, 0x59)
#pragma charmap (0x5A, 0x5A)
#pragma charmap (0x5B, 0x5B)
#pragma charmap (0x5C, 0x5C)
#pragma charmap (0x5D, 0x5D)
#pragma charmap (0x5E, 0x5E)
#pragma charmap (0x5F, 0x5F)
#pragma charmap (0x60, 0x60)
#pragma charmap (0x61, 0x61)
#pragma charmap (0x62, 0x62)
#pragma charmap (0x63, 0x63)
#pragma charmap (0x64, 0x64)
#pragma charmap (0x65, 0x65)
#pragma charmap (0x66, 0x66)
#pragma charmap (0x67, 0x67)
#pragma charmap (0x68, 0x68)
#pragma charmap (0x69, 0x69)
#pragma charmap (0x6A, 0x6A)
#pragma charmap (0x6B, 0x6B)
#pragma charmap (0x6C, 0x6C)
#pragma charmap (0x6D, 0x6D)
#pragma charmap (0x6E, 0x6E)
#pragma charmap (0x6F, 0x6F)
#pragma charmap (0x70, 0x70)
#pragma charmap (0x71, 0x71)
#pragma charmap (0x72, 0x72)
#pragma charmap (0x73, 0x73)
#pragma charmap (0x74, 0x74)
#pragma charmap (0x75, 0x75)
#pragma charmap (0x76, 0x76)
#pragma charmap (0x77, 0x77)
#pragma charmap (0x78, 0x78)
#pragma charmap (0x79, 0x79)
#pragma charmap (0x7A, 0x7A)
#pragma charmap (0x7B, 0x7B)
#pragma charmap (0x7C, 0x7C)
#pragma charmap (0x7D, 0x7D)
#pragma charmap (0x7E, 0x7E)
#pragma charmap (0x7F, 0x7F)
#pragma charmap (0x80, 0x80)
#pragma charmap (0x81, 0x81)
#pragma charmap (0x82, 0x82)
#pragma charmap (0x83, 0x83)
#pragma charmap (0x84, 0x84)
#pragma charmap (0x85, 0x85)
#pragma charmap (0x86, 0x86)
#pragma charmap (0x87, 0x87)
#pragma charmap (0x88, 0x88)
#pragma charmap (0x89, 0x89)
#pragma charmap (0x8A, 0x8A)
#pragma charmap (0x8B, 0x8B)
#pragma charmap (0x8C, 0x8C)
#pragma charmap (0x8D, 0x8D)
#pragma charmap (0x8E, 0x8E)
#pragma charmap (0x8F, 0x8F)
#pragma charmap (0x90, 0x90)
#pragma charmap (0x91, 0x91)
#pragma charmap (0x92, 0x92)
#pragma charmap (0x93, 0x93)
#pragma charmap (0x94, 0x94)
#pragma charmap (0x95, 0x95)
#pragma charmap (0x96, 0x96)
#pragma charmap (0x97, 0x97)
#pragma charmap (0x98, 0x98)
#pragma charmap (0x99, 0x99)
#pragma charmap (0x9A, 0x9A)
#pragma charmap (0x9B, 0x9B)
#pragma charmap (0x9C, 0x9C)
#pragma charmap (0x9D, 0x9D)
#pragma charmap (0x9E, 0x9E)
#pragma charmap (0x9F, 0x9F)
#pragma charmap (0xA0, 0xA0)
#pragma charmap (0xA1, 0xA1)
#pragma charmap (0xA2, 0xA2)
#pragma charmap (0xA3, 0xA3)
#pragma charmap (0xA4, 0xA4)
#pragma charmap (0xA5, 0xA5)
#pragma charmap (0xA6, 0xA6)
#pragma charmap (0xA7, 0xA7)
#pragma charmap (0xA8, 0xA8)
#pragma charmap (0xA9, 0xA9)
#pragma charmap (0xAA, 0xAA)
#pragma charmap (0xAB, 0xAB)
#pragma charmap (0xAC, 0xAC)
#pragma charmap (0xAD, 0xAD)
#pragma charmap (0xAE, 0xAE)
#pragma charmap (0xAF, 0xAF)
#pragma charmap (0xB0, 0xB0)
#pragma charmap (0xB1, 0xB1)
#pragma charmap (0xB2, 0xB2)
#pragma charmap (0xB3, 0xB3)
#pragma charmap (0xB4, 0xB4)
#pragma charmap (0xB5, 0xB5)
#pragma charmap (0xB6, 0xB6)
#pragma charmap (0xB7, 0xB7)
#pragma charmap (0xB8, 0xB8)
#pragma charmap (0xB9, 0xB9)
#pragma charmap (0xBA, 0xBA)
#pragma charmap (0xBB, 0xBB)
#pragma charmap (0xBC, 0xBC)
#pragma charmap (0xBD, 0xBD)
#pragma charmap (0xBE, 0xBE)
#pragma charmap (0xBF, 0xBF)
#pragma charmap (0xC0, 0xC0)
#pragma charmap (0xC1, 0xC1)
#pragma charmap (0xC2, 0xC2)
#pragma charmap (0xC3, 0xC3)
#pragma charmap (0xC4, 0xC4)
#pragma charmap (0xC5, 0xC5)
#pragma charmap (0xC6, 0xC6)
#pragma charmap (0xC7, 0xC7)
#pragma charmap (0xC8, 0xC8)
#pragma charmap (0xC9, 0xC9)
#pragma charmap (0xCA, 0xCA)
#pragma charmap (0xCB, 0xCB)
#pragma charmap (0xCC, 0xCC)
#pragma charmap (0xCD, 0xCD)
#pragma charmap (0xCE, 0xCE)
#pragma charmap (0xCF, 0xCF)
#pragma charmap (0xD0, 0xD0)
#pragma charmap (0xD1, 0xD1)
#pragma charmap (0xD2, 0xD2)
#pragma charmap (0xD3, 0xD3)
#pragma charmap (0xD4, 0xD4)
#pragma charmap (0xD5, 0xD5)
#pragma charmap (0xD6, 0xD6)
#pragma charmap (0xD7, 0xD7)
#pragma charmap (0xD8, 0xD8)
#pragma charmap (0xD9, 0xD9)
#pragma charmap (0xDA, 0xDA)
#pragma charmap (0xDB, 0xDB)
#pragma charmap (0xDC, 0xDC)
#pragma charmap (0xDD, 0xDD)
#pragma charmap (0xDE, 0xDE)
#pragma charmap (0xDF, 0xDF)
#pragma charmap (0xE0, 0xE0)
#pragma charmap (0xE1, 0xE1)
#pragma charmap (0xE2, 0xE2)
#pragma charmap (0xE3, 0xE3)
#pragma charmap (0xE4, 0xE4)
#pragma charmap (0xE5, 0xE5)
#pragma charmap (0xE6, 0xE6)
#pragma charmap (0xE7, 0xE7)
#pragma charmap (0xE8, 0xE8)
#pragma charmap (0xE9, 0xE9)
#pragma charmap (0xEA, 0xEA)
#pragma charmap (0xEB, 0xEB)
#pragma charmap (0xEC, 0xEC)
#pragma charmap (0xED, 0xED)
#pragma charmap (0xEE, 0xEE)
#pragma charmap (0xEF, 0xEF)
#pragma charmap (0xF0, 0xF0)
#pragma charmap (0xF1, 0xF1)
#pragma charmap (0xF2, 0xF2)
#pragma charmap (0xF3, 0xF3)
#pragma charmap (0xF4, 0xF4)
#pragma charmap (0xF5, 0xF5)
#pragma charmap (0xF6, 0xF6)
#pragma charmap (0xF7, 0xF7)
#pragma charmap (0xF8, 0xF8)
#pragma charmap (0xF9, 0xF9)
#pragma charmap (0xFA, 0xFA)
#pragma charmap (0xFB, 0xFB)
#pragma charmap (0xFC, 0xFC)
#pragma charmap (0xFD, 0xFD)
#pragma charmap (0xFE, 0xFE)
#pragma charmap (0xFF, 0xFF)

View File

@ -0,0 +1,310 @@
/*****************************************************************************/
/* */
/* atari_screen_charmap.h */
/* */
/* Atari system internal string mapping (ISO-8859-1 -> Internal/Screen-Code) */
/* */
/* */
/* */
/* (C) 2016 Christian Krueger */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
/* warranty. In no event will the authors be held liable for any damages */
/* arising from the use of this software. */
/* */
/* Permission is granted to anyone to use this software for any purpose, */
/* including commercial applications, and to alter it and redistribute it */
/* freely, subject to the following restrictions: */
/* */
/* 1. The origin of this software must not be misrepresented; you must not */
/* claim that you wrote the original software. If you use this software */
/* in a product, an acknowledgment in the product documentation would be */
/* appreciated but is not required. */
/* 2. Altered source versions must be plainly marked as such, and must not */
/* be misrepresented as being the original software. */
/* 3. This notice may not be removed or altered from any source */
/* distribution. */
/* */
/*****************************************************************************/
/* No include guard here! Multiple use in one file may be intentional. */
#pragma warn (remap-zero, push, off)
#pragma charmap (0x00, 0x40)
#pragma warn (remap-zero, pop)
#pragma charmap (0x01, 0x41)
#pragma charmap (0x02, 0x42)
#pragma charmap (0x03, 0x43)
#pragma charmap (0x04, 0x44)
#pragma charmap (0x05, 0x45)
#pragma charmap (0x06, 0x46)
#pragma charmap (0x07, 0xFD)
#pragma charmap (0x08, 0x48)
#pragma charmap (0x09, 0x7F)
#pragma charmap (0x0A, 0xDB)
#pragma charmap (0x0B, 0x4B)
#pragma charmap (0x0C, 0x7D)
#pragma charmap (0x0D, 0x4D)
#pragma charmap (0x0E, 0x4E)
#pragma charmap (0x0F, 0x4F)
#pragma charmap (0x10, 0x50)
#pragma charmap (0x11, 0x51)
#pragma charmap (0x12, 0x52)
#pragma charmap (0x13, 0x53)
#pragma charmap (0x14, 0x54)
#pragma charmap (0x15, 0x55)
#pragma charmap (0x16, 0x56)
#pragma charmap (0x17, 0x57)
#pragma charmap (0x18, 0x58)
#pragma charmap (0x19, 0x59)
#pragma charmap (0x1A, 0x5A)
#pragma charmap (0x1B, 0x5B)
#pragma charmap (0x1C, 0x5C)
#pragma charmap (0x1D, 0x5D)
#pragma charmap (0x1E, 0x5E)
#pragma charmap (0x1F, 0x5F)
#pragma warn (remap-zero, push, off)
#pragma charmap (0x20, 0x00)
#pragma warn (remap-zero, pop)
#pragma charmap (0x21, 0x01)
#pragma charmap (0x22, 0x02)
#pragma charmap (0x23, 0x03)
#pragma charmap (0x24, 0x04)
#pragma charmap (0x25, 0x05)
#pragma charmap (0x26, 0x06)
#pragma charmap (0x27, 0x07)
#pragma charmap (0x28, 0x08)
#pragma charmap (0x29, 0x09)
#pragma charmap (0x2A, 0x0A)
#pragma charmap (0x2B, 0x0B)
#pragma charmap (0x2C, 0x0C)
#pragma charmap (0x2D, 0x0D)
#pragma charmap (0x2E, 0x0E)
#pragma charmap (0x2F, 0x0F)
#pragma charmap (0x30, 0x10)
#pragma charmap (0x31, 0x11)
#pragma charmap (0x32, 0x12)
#pragma charmap (0x33, 0x13)
#pragma charmap (0x34, 0x14)
#pragma charmap (0x35, 0x15)
#pragma charmap (0x36, 0x16)
#pragma charmap (0x37, 0x17)
#pragma charmap (0x38, 0x18)
#pragma charmap (0x39, 0x19)
#pragma charmap (0x3A, 0x1A)
#pragma charmap (0x3B, 0x1B)
#pragma charmap (0x3C, 0x1C)
#pragma charmap (0x3D, 0x1D)
#pragma charmap (0x3E, 0x1E)
#pragma charmap (0x3F, 0x1F)
#pragma charmap (0x40, 0x20)
#pragma charmap (0x41, 0x21)
#pragma charmap (0x42, 0x22)
#pragma charmap (0x43, 0x23)
#pragma charmap (0x44, 0x24)
#pragma charmap (0x45, 0x25)
#pragma charmap (0x46, 0x26)
#pragma charmap (0x47, 0x27)
#pragma charmap (0x48, 0x28)
#pragma charmap (0x49, 0x29)
#pragma charmap (0x4A, 0x2A)
#pragma charmap (0x4B, 0x2B)
#pragma charmap (0x4C, 0x2C)
#pragma charmap (0x4D, 0x2D)
#pragma charmap (0x4E, 0x2E)
#pragma charmap (0x4F, 0x2F)
#pragma charmap (0x50, 0x30)
#pragma charmap (0x51, 0x31)
#pragma charmap (0x52, 0x32)
#pragma charmap (0x53, 0x33)
#pragma charmap (0x54, 0x34)
#pragma charmap (0x55, 0x35)
#pragma charmap (0x56, 0x36)
#pragma charmap (0x57, 0x37)
#pragma charmap (0x58, 0x38)
#pragma charmap (0x59, 0x39)
#pragma charmap (0x5A, 0x3A)
#pragma charmap (0x5B, 0x3B)
#pragma charmap (0x5C, 0x3C)
#pragma charmap (0x5D, 0x3D)
#pragma charmap (0x5E, 0x3E)
#pragma charmap (0x5F, 0x3F)
#pragma charmap (0x60, 0x60)
#pragma charmap (0x61, 0x61)
#pragma charmap (0x62, 0x62)
#pragma charmap (0x63, 0x63)
#pragma charmap (0x64, 0x64)
#pragma charmap (0x65, 0x65)
#pragma charmap (0x66, 0x66)
#pragma charmap (0x67, 0x67)
#pragma charmap (0x68, 0x68)
#pragma charmap (0x69, 0x69)
#pragma charmap (0x6A, 0x6A)
#pragma charmap (0x6B, 0x6B)
#pragma charmap (0x6C, 0x6C)
#pragma charmap (0x6D, 0x6D)
#pragma charmap (0x6E, 0x6E)
#pragma charmap (0x6F, 0x6F)
#pragma charmap (0x70, 0x70)
#pragma charmap (0x71, 0x71)
#pragma charmap (0x72, 0x72)
#pragma charmap (0x73, 0x73)
#pragma charmap (0x74, 0x74)
#pragma charmap (0x75, 0x75)
#pragma charmap (0x76, 0x76)
#pragma charmap (0x77, 0x77)
#pragma charmap (0x78, 0x78)
#pragma charmap (0x79, 0x79)
#pragma charmap (0x7A, 0x7A)
#pragma charmap (0x7B, 0x7B)
#pragma charmap (0x7C, 0x7C)
#pragma charmap (0x7D, 0x7D)
#pragma charmap (0x7E, 0x7E)
#pragma charmap (0x7F, 0x7F)
#pragma charmap (0x80, 0xC0)
#pragma charmap (0x81, 0xC1)
#pragma charmap (0x82, 0xC2)
#pragma charmap (0x83, 0xC3)
#pragma charmap (0x84, 0xC4)
#pragma charmap (0x85, 0xC5)
#pragma charmap (0x86, 0xC6)
#pragma charmap (0x87, 0xC7)
#pragma charmap (0x88, 0xC8)
#pragma charmap (0x89, 0xC9)
#pragma charmap (0x8A, 0xCA)
#pragma charmap (0x8B, 0xCB)
#pragma charmap (0x8C, 0xCC)
#pragma charmap (0x8D, 0xCD)
#pragma charmap (0x8E, 0xCE)
#pragma charmap (0x8F, 0xCF)
#pragma charmap (0x90, 0xD0)
#pragma charmap (0x91, 0xD1)
#pragma charmap (0x92, 0xD2)
#pragma charmap (0x93, 0xD3)
#pragma charmap (0x94, 0xD4)
#pragma charmap (0x95, 0xD5)
#pragma charmap (0x96, 0xD6)
#pragma charmap (0x97, 0xD7)
#pragma charmap (0x98, 0xD8)
#pragma charmap (0x99, 0xD9)
#pragma charmap (0x9A, 0xDA)
#pragma charmap (0x9B, 0xDB)
#pragma charmap (0x9C, 0xDC)
#pragma charmap (0x9D, 0xDD)
#pragma charmap (0x9E, 0xDE)
#pragma charmap (0x9F, 0xDF)
#pragma charmap (0xA0, 0x80)
#pragma charmap (0xA1, 0x81)
#pragma charmap (0xA2, 0x82)
#pragma charmap (0xA3, 0x83)
#pragma charmap (0xA4, 0x84)
#pragma charmap (0xA5, 0x85)
#pragma charmap (0xA6, 0x86)
#pragma charmap (0xA7, 0x87)
#pragma charmap (0xA8, 0x88)
#pragma charmap (0xA9, 0x89)
#pragma charmap (0xAA, 0x8A)
#pragma charmap (0xAB, 0x8B)
#pragma charmap (0xAC, 0x8C)
#pragma charmap (0xAD, 0x8D)
#pragma charmap (0xAE, 0x8E)
#pragma charmap (0xAF, 0x8F)
#pragma charmap (0xB0, 0x90)
#pragma charmap (0xB1, 0x91)
#pragma charmap (0xB2, 0x92)
#pragma charmap (0xB3, 0x93)
#pragma charmap (0xB4, 0x94)
#pragma charmap (0xB5, 0x95)
#pragma charmap (0xB6, 0x96)
#pragma charmap (0xB7, 0x97)
#pragma charmap (0xB8, 0x98)
#pragma charmap (0xB9, 0x99)
#pragma charmap (0xBA, 0x9A)
#pragma charmap (0xBB, 0x9B)
#pragma charmap (0xBC, 0x9C)
#pragma charmap (0xBD, 0x9D)
#pragma charmap (0xBE, 0x9E)
#pragma charmap (0xBF, 0x9F)
#pragma charmap (0xC0, 0xA0)
#pragma charmap (0xC1, 0xA1)
#pragma charmap (0xC2, 0xA2)
#pragma charmap (0xC3, 0xA3)
#pragma charmap (0xC4, 0xA4)
#pragma charmap (0xC5, 0xA5)
#pragma charmap (0xC6, 0xA6)
#pragma charmap (0xC7, 0xA7)
#pragma charmap (0xC8, 0xA8)
#pragma charmap (0xC9, 0xA9)
#pragma charmap (0xCA, 0xAA)
#pragma charmap (0xCB, 0xAB)
#pragma charmap (0xCC, 0xAC)
#pragma charmap (0xCD, 0xAD)
#pragma charmap (0xCE, 0xAE)
#pragma charmap (0xCF, 0xAF)
#pragma charmap (0xD0, 0xB0)
#pragma charmap (0xD1, 0xB1)
#pragma charmap (0xD2, 0xB2)
#pragma charmap (0xD3, 0xB3)
#pragma charmap (0xD4, 0xB4)
#pragma charmap (0xD5, 0xB5)
#pragma charmap (0xD6, 0xB6)
#pragma charmap (0xD7, 0xB7)
#pragma charmap (0xD8, 0xB8)
#pragma charmap (0xD9, 0xB9)
#pragma charmap (0xDA, 0xBA)
#pragma charmap (0xDB, 0xBB)
#pragma charmap (0xDC, 0xBC)
#pragma charmap (0xDD, 0xBD)
#pragma charmap (0xDE, 0xBE)
#pragma charmap (0xDF, 0xBF)
#pragma charmap (0xE0, 0xE0)
#pragma charmap (0xE1, 0xE1)
#pragma charmap (0xE2, 0xE2)
#pragma charmap (0xE3, 0xE3)
#pragma charmap (0xE4, 0xE4)
#pragma charmap (0xE5, 0xE5)
#pragma charmap (0xE6, 0xE6)
#pragma charmap (0xE7, 0xE7)
#pragma charmap (0xE8, 0xE8)
#pragma charmap (0xE9, 0xE9)
#pragma charmap (0xEA, 0xEA)
#pragma charmap (0xEB, 0xEB)
#pragma charmap (0xEC, 0xEC)
#pragma charmap (0xED, 0xED)
#pragma charmap (0xEE, 0xEE)
#pragma charmap (0xEF, 0xEF)
#pragma charmap (0xF0, 0xF0)
#pragma charmap (0xF1, 0xF1)
#pragma charmap (0xF2, 0xF2)
#pragma charmap (0xF3, 0xF3)
#pragma charmap (0xF4, 0xF4)
#pragma charmap (0xF5, 0xF5)
#pragma charmap (0xF6, 0xF6)
#pragma charmap (0xF7, 0xF7)
#pragma charmap (0xF8, 0xF8)
#pragma charmap (0xF9, 0xF9)
#pragma charmap (0xFA, 0xFA)
#pragma charmap (0xFB, 0xFB)
#pragma charmap (0xFC, 0xFC)
#pragma charmap (0xFD, 0xFD)
#pragma charmap (0xFE, 0xFE)
#pragma charmap (0xFF, 0xFF)

View File

@ -0,0 +1,63 @@
/*
** testprogram for includes "atari_screen_charmap.h" and "atari_atascii_charmap.h"
**
** 19-Aug-2016, Christian Krueger
*/
#include <conio.h>
#include <atari.h>
#include <peekpoke.h>
#include <string.h>
char pcDefaultMappingString[] = "Hello Atari!";
#include <atari_screen_charmap.h>
char pcScreenMappingString[] = "Hello Atari!";
#include <atari_atascii_charmap.h>
char pcAtasciiMappingString[] = "Hello Atari!";
/* THIS WON'T work due to string merging/collection problems!
char* pcDefaultMappingString = "Hello Atari!";
#include <atari_screen_charmap.h>
char* pcScreenMappingString = "Hello Atari!";
#include <atari_atascii_charmap.h>
char* pcAtasciiMappingString = "Hello Atari!";
*/
int
main(void)
{
static unsigned char expectedAtasciiValues[] = { 40,101,108,108,111,0,33,116,97,114,105,1};
int returnValue = 0;
unsigned char* screen = (unsigned char*) PEEKW(88);
// check default (=atascii)
clrscr();
cputs(pcDefaultMappingString);
returnValue |= memcmp(screen, expectedAtasciiValues, sizeof(expectedAtasciiValues));
clrscr();
memcpy(screen, pcScreenMappingString, sizeof(expectedAtasciiValues));
returnValue |= memcmp(screen, expectedAtasciiValues, sizeof(expectedAtasciiValues));
clrscr();
cputs(pcAtasciiMappingString);
returnValue |= memcmp(screen, expectedAtasciiValues, sizeof(expectedAtasciiValues));
clrscr();
if (returnValue)
cputs("Test FAILED!");
else
cputs("Test passed.");
cputs("\n\rHit any key to exit...");
cgetc();
return returnValue;
}