Jump to content

Understanding and using graphics mode with CC65

Recommended Posts

Hi eveyone,


I am using CC65 to code a game that use conio.h to display characters on the screen.
It works fine in graphics mode 0 but I get weird results with other text modes.
(I am compiling with cl65.exe -O -t atarixl --start-addr 0x4000 ... to get enough memory).


I would like to use any other text mode that adds support for colors like graphics mode 12.

(I would use re-defined characters but this is not my issue).

My goal is to have a text mode with at least 4 colors and to know how to draw characters and set their

colors with CC65.


(1) If I set graphics mode 12 I get the lower four lines in monochromatic mode. Is it normal?

I thought it was a BASIC thing. How can I get read of them?


(2) The conio library seems not to behave correctly when used with any graphics mode other than 0. How to I set colors?


Where can I find any simple example?








  • Like 1
Link to comment
Share on other sites

CC65 is a C cross compiler. Is graphics mode 13 supposed to always have the 4 lowest lines of monochromatic text? I am not using Assembly. Where can I get help on how to use a text mode with colors and still use CC65?

TGI is not for text modes.

I have zero experience with display lists. Where can I start reading about them?

Edited by Fabrizio Caruso
Link to comment
Share on other sites

Are you using the graphics() function? Its parameters are just like BASIC. So use 12+16 in order not to have the four lines graphics 0 window.


And, are you sure you need the "atarixl" Target? It's normally only needed for very large programs, it makes the RAM below the ROM available. Try "atari" target (and use __RESERVED_MEMORY__ to reserve memory for the screen buffer)

  • Like 1
Link to comment
Share on other sites

... Is graphics mode 13 supposed to always have the 4 lowest lines of monochromatic text?


I don't have cc65. From what you describe it sounds like cc65 uses the Atari OS CIO to open graphics modes. Any BASIC language documentation referring to the graphics mode numbers should be good to use, since it is the OS, not BASIC that is creating the graphics modes.


Simply, you get graphics modes numbered 0 through 11 on Atari 800/400, 0 to 15 on XL and XE.


Mode 0 is the usual 40x24 text mode. What you described as monochromatic text.


Mode 1 and 2 are colored text modes. Modes 3 to 7 are regular graphics modes (black background by default).


Mode 8 is the highest resolution mode which uses the same color scheme as the monochromatic text mode (blue background, white pixels).


The modes from 1 through 8 automatically include four lines of "monochromatic text" at the bottom of the screen. Add 16 to the graphics mode number to remove the text window at the bottom of the screen.


On computers with GTIA (which by now is almost every 8-bit Atari available) modes 9, 10, 11 are graphics modes with special color options. None of these include the text window at the bottom of the screen.


On the XL/XE there are also modes 12, 13, 14, 15. Two are text modes that really require custom character set to be effective, and two are graphics modes.

Edited by kenjennings
Link to comment
Share on other sites

I have managed to set up video mode 12 + 16. Now I need to understand


(1) how the 5 color palette is created

(2) how the 5 available colors are encoded in each character


My characters seem to only have 3 colors.


How are 5 colors possible? A 2 bit combination would only produce 4 possible colors per pixel on each character.

Link to comment
Share on other sites

You really need to read the hardware manual regarding ANTIC modes 4 and 5. Seriously, go to atarimania.com, into the atari 800 books section. We'll be right here.


But in case that's TL:DR:


Basically, in ANTIC modes 4 and 5, bit 7 of a character determines whether or not the fifth color is used.



Link to comment
Share on other sites

The color shadow registers are at addresses 708-712 ($2C4-$2C8) which are copied by the OS VBI to the HW registers $D016-$D01A. First colour registers are COLOR0-3 and the last one is background colour.


The 5th color in character mode 12 is produced by using inverse character codes in which the bitpair 11 is using COLOR3 register instead COLOR2 (00 - backround, 01 - COLOR0, 10 - COLOR1, 11 - COLOR2).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...