TGI functions and 4-bit or 16-color

Chat about anything CX16 related that doesn't fit elsewhere
Post Reply
russell-s-harper
Posts: 13
Joined: Sat Jan 27, 2024 7:22 pm

TGI functions and 4-bit or 16-color

Post by russell-s-harper »

I'd like to be able to use 4-bit or 16-color with TGI. I have some existing line drawing functions, but the built-ins for TGI run approximately 3× faster, so would like to take advantage of them if possible.

In C, this will configure VERA to 4-bit mode, so enough for two screens, and have it display the second screen:

/* Set the bitmap to 16-color mode */ VERA.layer0.config = 6; /* Set the offset */ VERA.layer0.tilebase = SCR_2_BASE;

However, tgi_line and other functions will plot expecting 8-bit / 256-color mode so the output won't be correct.

Are there any settings to let TGI know of the pixels / byte and screen base?
User avatar
ahenry3068
Posts: 1135
Joined: Tue Apr 04, 2023 9:57 pm

Re: TGI functions and 4-bit or 16-color

Post by ahenry3068 »

russell-s-harper wrote: Thu Apr 04, 2024 11:56 pm I'd like to be able to use 4-bit or 16-color with TGI. I have some existing line drawing functions, but the built-ins for TGI run approximately 3× faster, so would like to take advantage of them if possible.

In C, this will configure VERA to 4-bit mode, so enough for two screens, and have it display the second screen:

/* Set the bitmap to 16-color mode */ VERA.layer0.config = 6; /* Set the offset */ VERA.layer0.tilebase = SCR_2_BASE;

However, tgi_line and other functions will plot expecting 8-bit / 256-color mode so the output won't be correct.

Are there any settings to let TGI know of the pixels / byte and screen base?
TGI ?? T.he G.raphics I.nterface ? If you are talking about the FB and GRAPH routines present in ROM they are strictly for 8 bit mode. You'll have to write your own Graphics primitives for the 16 color mode. It's actually a project I'm looking at maybe doing in the future (writing the primitives). I'm not planning on doing them in the near future though.

(By Graphics primitives I mean functions Such as PutPixel, Line, Rect... Maybe BitBlit or PutImage. etc...... )
mortarm
Posts: 298
Joined: Tue May 16, 2023 6:21 pm

Re: TGI functions and 4-bit or 16-color

Post by mortarm »

ahenry3068 wrote: Fri Apr 05, 2024 1:32 am If you are talking about the FB and GRAPH routines...
I didn't know there was a Facebook routine. :mrgreen:
User avatar
ahenry3068
Posts: 1135
Joined: Tue Apr 04, 2023 9:57 pm

Re: TGI functions and 4-bit or 16-color

Post by ahenry3068 »

mortarm wrote: Fri Apr 05, 2024 3:17 am
ahenry3068 wrote: Fri Apr 05, 2024 1:32 am If you are talking about the FB and GRAPH routines...
I didn't know there was a Facebook routine. :mrgreen:
FB. F.rame B.uffer .............. :D
Post Reply