Harry Potter Posted February 15, 2021 Share Posted February 15, 2021 Can somebody give me a quick guide on setting the Atari screen colors in cc65, please? I read in the documentation that textcolor() and friends don't work. Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted February 15, 2021 Share Posted February 15, 2021 (edited) perhaps elaborate on what you are trying and in what graphics mode? what you have done so far and where does it not meet your expectation? As said before, the A8 is not like other platforms in this respect, e.g. if you are expecting to say set the text color to red, output a character and it appear in red, then set text color to green, output a char, and that appears in green - then depending on what you are trying you could find the first character turns green. Edited February 15, 2021 by Wrathchild Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted February 15, 2021 Author Share Posted February 15, 2021 In text mode. I just want to change the screen colors in future projects, but I have nothing concrete yet. Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted February 15, 2021 Share Posted February 15, 2021 (edited) In text mode, you only have background colour, text brightness and border colour. Let's look at the Atari palette: Going down is your 'Hue' (0-15) and across is the 'Luminance' (brightness, also 0-15). So in Basic, try this in sequence (Note the values are Hue*16+Luminance): Change background to Red: POKE 710,3*16+4 Change text dark: POKE 709,0 Change text light: POKE 709,14 Change border to blue: POKE 712,9*16+6 So to prove the colour of the text can't be different from the background colour, try: POKE 709,12*16+8 You'll see the text just goes darker Hope that helps [Edit] To add to this, in the Memory Map, the address 708 (decimal) is COLOR0. This is the shadow register for the GTIA hardware register COLPF0 and during the OS vertical blank routine, the shadows are transferred to the h/w regs. So 709 is COLOR1, 710 is COLOR2 and 712 is COLOR4 (sometimes known as COLBAK as the h/w reg is called COLBK) Edited February 15, 2021 by Wrathchild 1 Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted February 15, 2021 Share Posted February 15, 2021 In terms of CC65, check atari.h as this defines the method: extern void __fastcall__ _setcolor (unsigned char color_reg, unsigned char hue, unsigned char luminace); So this can be used to achieve the same as the basic statements: setcolor(2, HUE_REDORANGE, 4); Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted February 16, 2021 Author Share Posted February 16, 2021 Thank you. That's all I needed to know. Quote Link to comment Share on other sites More sharing options...
ilmenit Posted February 16, 2021 Share Posted February 16, 2021 6 hours ago, Harry Potter said: Thank you. That's all I needed to know. No matter what language and compiler you use, I'd recommend to read De Re Atari starting programming on this platform and Atari Memory Map. https://www.atariarchives.org/dere/ https://www.atariarchives.org/mapping/memorymap.php Quote Link to comment Share on other sites More sharing options...
zzip Posted February 16, 2021 Share Posted February 16, 2021 16 hours ago, Wrathchild said: In text mode, you only have background colour, text brightness and border colour. Let's look at the Atari palette: Going down is your 'Hue' (0-15) and across is the 'Luminance' (brightness, also 0-15). This is the GTIA palette, only available in the 3 GTIA modes. All other modes have half as many luminance possibilities (128 colors total) 2 Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted February 16, 2021 Share Posted February 16, 2021 Very true, has become habit to use even numbers only for luminance ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.