X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=doc%2Fatari.sgml;h=6cbff6208abe5e2711a6b8546625c36fc79ce383;hb=aaf8863de5081b6061e20041e888717b0f929e25;hp=47ce050e1d860d8576c5dbf4c3b8bca7e36c7cc1;hpb=501df59c1eb09b9c44491ba1f9af6813b98bcbed;p=cc65 diff --git a/doc/atari.sgml b/doc/atari.sgml index 47ce050e1..6cbff6208 100644 --- a/doc/atari.sgml +++ b/doc/atari.sgml @@ -148,7 +148,7 @@ Special locations: ($58). @@ -275,6 +275,7 @@ See the for declaration and u _getcolor _getdefdev _graphics +_is_cmdline_dos _rest_vecs _save_vecs _scroll @@ -316,6 +317,101 @@ chip registers.

+Display lists

+ +A major feature of the Atari graphics chip "ANTIC" is to +process instructions for the display generation. +cc65 supports constructing these display lists by offering defines +for the instructions. In conjunction with the "void"-variable extension +of cc65, display lists can be created quite comfortable: + + +... +unsigned char ScreenMemory[100]; + +void DisplayList = +{ + DL_BLK8, + DL_BLK8, + DL_BLK8, + DL_LMS(DL_CHR20x8x2), + ScreenMemory, + DL_CHR20x8x2, + DL_CHR20x8x2, + DL_CHR20x8x2, + DL_BLK4, + DL_CHR20x8x2, + DL_JVB +}; +... +POKEW(560,(unsigned int)&DisplayList); // SDLSTL +... + + +Please inspect the Character mapping

+ +The Atari has two representations for characters: + + 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. + The internal/screen mapping represents the real value of the +screen ram when showing a character. + + +For direct memory access (simplicity and speed) enabling the internal +mapping can be useful. This can be achieved by including the +"For assembler sources the macro " + +You can switch back to the ATASCII mapping by including +" +#include <atari\_screen\_charmap.h> +char pcScreenMappingString[] = "Hello Atari!"; + +#include <atari_atascii_charmap.h> +char pcAtasciiMappingString[] = "Hello Atari!"; + + +delivers correct results, while + + +#include <atari_screen_charmap.h> +char* pcScreenMappingString = "Hello Atari!"; + +#include <atari_atascii_charmap.h> +char* pcAtasciiMappingString = "Hello Atari!"; + + +does not. Loadable drivers

@@ -561,7 +657,7 @@ The contents of this chunk come from the SYSCHKCHNK memory area of the linker co main program&nl; This load chunk is loaded at the selected program start address (default $2000) and contains all of the code and data of the program.&nl; -The contents of this chunk come from the RAM memory area of the linker config file. +The contents of this chunk come from the MAIN memory area of the linker config file. @@ -743,7 +839,7 @@ segments should go above $7FFF.

The main problem is that the EXE header generated by the cc65 runtime lib is wrong. It defines a single load chunk with the sizes/addresses -of the STARTUP, LOWCODE, INIT, CODE, RODATA, and DATA segments, in +of the STARTUP, LOWCODE, ONCE, CODE, RODATA, and DATA segments, in fact, the whole user program (we're disregarding the "system check" load chunk here).

@@ -796,7 +892,7 @@ SEGMENTS { NEXEHDR: load = FSTHDR, type = ro; # first load chunk STARTUP: load = RAMLO, type = ro, define = yes; LOWCODE: load = RAMLO, type = ro, define = yes, optional = yes; - INIT: load = RAMLO, type = ro, optional = yes; + ONCE: load = RAMLO, type = ro, optional = yes; CODE: load = RAMLO, type = ro, define = yes; CHKHDR: load = SECHDR, type = ro; # second load chunk @@ -808,7 +904,7 @@ SEGMENTS { AUTOSTRT: load = RAM, type = ro; # defines program entry point } FEATURES { - CONDES: segment = RODATA, + CONDES: segment = ONCE, type = constructor, label = __CONSTRUCTOR_TABLE__, count = __CONSTRUCTOR_COUNT__; @@ -827,7 +923,7 @@ the MAINHDR segment get discarded.

The newly added NEXEHDR segment defines the correct chunk header for the first intended load chunk. It -puts the STARTUP, LOWCODE, INIT, and CODE segments, which are the +puts the STARTUP, LOWCODE, ONCE, and CODE segments, which are the segments containing only code, into load chunk #1 (RAMLO memory area).

The header for the second load chunk comes from the new CHKHDR @@ -858,7 +954,7 @@ cl65 -t atari -C split.cfg -o prog.com prog.c split.s Low data and high code example

-Goal: Put RODATA and DATA into low memory and STARTUP, LOWCODE, INIT, +Goal: Put RODATA and DATA into low memory and STARTUP, LOWCODE, ONCE, CODE, BSS, ZPSAVE into high memory (split2.cfg): @@ -893,7 +989,7 @@ SEGMENTS { CHKHDR: load = SECHDR, type = ro; # second load chunk STARTUP: load = RAM, type = ro, define = yes; - INIT: load = RAM, type = ro, optional = yes; + ONCE: load = RAM, type = ro, optional = yes; CODE: load = RAM, type = ro, define = yes; BSS: load = RAM, type = bss, define = yes; @@ -901,7 +997,7 @@ SEGMENTS { AUTOSTRT: load = RAM, type = ro; # defines program entry point } FEATURES { - CONDES: segment = RODATA, + CONDES: segment = ONCE, type = constructor, label = __CONSTRUCTOR_TABLE__, count = __CONSTRUCTOR_COUNT__;