Jump to content
IGNORED

Color used to print character


Recommended Posts

I have redefined characters to use as graphics. The following code creates my border using the letter Z redefined in blue.

 

115 COLOR 218:PLOT 0,0:DRAWTO 0,23:DRAWTO 19,23:DRAWTO 19,0:DRAWTO 0,0

 

I can use COLOR 90 (orange), 122 (green), and 218 (blue) for color registers 0, 1, and 2.

If I use COLOR 186 for color register 3 (inverse lower case) a blue colon is printed and not the red/pink redefined letter Z.

 

?#6;"inverse-lower-z" creates a red/pink border piece.

 

How do you use color register 3 (186 in this case) in the above code to create a border with the redefined character z?

 

Thanks

 

Link to comment
Share on other sites

This listing:
 

10 GRAPHICS 1+16
20 FOR I=0 TO 255
25 IF I=125 THEN GOTO 40
30 COLOR I:PLOT I-(INT(I/20)*20),INT(I/20)
40 NEXT I
50 GOTO 50

gives:

 

image.thumb.png.6e7b10a8af82d415a07150aa07fca015.png

 

So the 'Z's are at 90 = 0x5A (orange), 122 = 0x7A (green), 218 = 0xDA (blue) and 250 =0xFA (pink)

 

So as screen character for 'Z' is actually 0x3A, adding 0x00, 0x40, 0x80 or 0xC0 would give you the character in different colours

 

So the listing:

 

10 GRAPHICS 1+16
20 FOR I=0 TO 255
30 POKE PEEK(88)+256*PEEK(89)+I,I
40 NEXT I
50 GOTO 50

 

gives:

 

image.thumb.png.222b4bd817e73b435e9a7397cd920ab9.png

 

And here the 'Z's are at 58 = 0x3A (orange), 122 = 0x7A (green), 186 = 0xBA (blue) and 250 =0xFA (pink)

 

So it can be concluded the 'COLOR' value does not directly correlate with the screen-code values, so consistently either use COLOR/PLOT or POKEs.

 

Edited by Wrathchild
Link to comment
Share on other sites

The chart shows the 'Z' character's color0-3 values at character 90 which is then repeated at 122 (lower z):

 

image.png.0581fe95a1a240f55d02f5905e58fbcd.png

 

which mirror the 'COLOR' statements results first 3 values but appear to have got the color3 value wrong, especially the values for "C.3" in the right two grids are the same as "C.2" in the left two grids.

They should be updated to range from 224-255 instead.

Link to comment
Share on other sites

7 hours ago, Wrathchild said:

This listing:
 


10 GRAPHICS 1+16
20 FOR I=0 TO 255
25 IF I=125 THEN GOTO 40
30 COLOR I:PLOT I-(INT(I/20)*20),INT(I/20)
40 NEXT I
50 GOTO 50

gives:

 

image.thumb.png.6e7b10a8af82d415a07150aa07fca015.png

 

So the 'Z's are at 90 = 0x5A (orange), 122 = 0x7A (green), 218 = 0xDA (blue) and 250 =0xFA (pink)

 

So as screen character for 'Z' is actually 0x3A, adding 0x00, 0x40, 0x80 or 0xC0 would give you the character in different colours

 

So the listing:

 


10 GRAPHICS 1+16
20 FOR I=0 TO 255
30 POKE PEEK(88)+256*PEEK(89)+I,I
40 NEXT I
50 GOTO 50

 

gives:

 

image.thumb.png.222b4bd817e73b435e9a7397cd920ab9.png

 

And here the 'Z's are at 58 = 0x3A (orange), 122 = 0x7A (green), 186 = 0xBA (blue) and 250 =0xFA (pink)

 

So it can be concluded the 'COLOR' value does not directly correlate with the screen-code values, so consistently either use COLOR/PLOT or POKEs.

 

As wrathchild stated, please see this reference :

https://www.atariarchives.org/c2bag/page029.php

Link to comment
Share on other sites

In OS graphics modes 1 and 2 the colour is decided by the top 2 bits of the "screen code".

 

The screen code is often not the same as ATASCII - this is by design because if you grouped ASCII into 2 lots of 64, like 0-63 and 64-127 you'd have the numbers and many of the punctuation symbols in one half and the upper/lower case characters in the other.

The way they did it gives you upper case, numbers and most of the special characters you need for everyday use.  Another side effect is Space becomes 0 so the clear-screen operation can be much the same between character and graphics modes, for what that's worth.

  • Like 1
Link to comment
Share on other sites

Normal Ascii sees such control characters with the low values (12) but Atari wanted the graphics characters and most of the existing control characters were a bit irrelevant to the computer so they just used "spares".

 

Really the biggest impact is probably the CR/LF difference, the other stuff doesn't seem to matter too much.

Link to comment
Share on other sites

On 7/10/2019 at 12:16 AM, Wrathchild said:

The chart shows the 'Z' character's color0-3 values at character 90 which is then repeated at 122 (lower z):

 

image.png.0581fe95a1a240f55d02f5905e58fbcd.png

 

which mirror the 'COLOR' statements results first 3 values but appear to have got the color3 value wrong, especially the values for "C.3" in the right two grids are the same as "C.2" in the left two grids.

They should be updated to range from 224-255 instead.

Is there a definitive table that provides all the correct values to use when use poke and color to display a character as a certain color register?

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.

Guest
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.

Loading...
  • Recently Browsing   0 members

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