Page 1 of 1

TGI functions and 4-bit or 16-color

Posted: Thu Apr 04, 2024 11:56 pm
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?

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

Posted: Fri Apr 05, 2024 1:32 am
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...... )

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

Posted: Fri Apr 05, 2024 3:17 am
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:

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

Posted: Fri Apr 05, 2024 4:07 am
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