EmOneGarand Posted March 23, 2022 Share Posted March 23, 2022 How is the background color determined with the BG value? I've looked at a couple examples and it doesn't really make sense to me. In the Spritetest C project they have: *(volatile unsigned short*)(BG)=(volatile unsigned short)2000; // Set Background colour. Which produced a Blue color, I changed that to 8000 and got a green color. I then added button inputs to increment or decrement that value and I merely got a darkening or lightening of the color I got at start up while it seemed to loop the same colors. I saw another example use a double digit number to get a lilac like color, what is the format? How would I convert RGB to get a matching color or is there a hardcoded table of color values? Looking at the includes it only shows the memory address for BG. Quote Link to comment https://forums.atariage.com/topic/332958-background-color/ Share on other sites More sharing options...
Seedy1812 Posted March 23, 2022 Share Posted March 23, 2022 As you have discovered BG does not hold a RGB value but a CRY value. This is a 16 bit value where the top 8 bits is the colour and the bottom 8 bits is the brightness. CRY to/from RGB is not an exact match. Normally you would preprocess the colours rather than runtime conversion each frame. I would recommend reading the Jaguar Technical Reference Manual about The CRY Colour Scheme. 1 Quote Link to comment https://forums.atariage.com/topic/332958-background-color/#findComment-5026756 Share on other sites More sharing options...
SCPCD Posted March 24, 2022 Share Posted March 24, 2022 Not exactly. (the doc is not well explained here) The BG color is a 16-bit value that is writtenback to the linebuffer after each pixel read. The linebuffer color scheme is defined by the VMODE register, so the BG can be RGB16 or CRY16. In RGB24, the BG is not written back. 2 Quote Link to comment https://forums.atariage.com/topic/332958-background-color/#findComment-5027637 Share on other sites More sharing options...
+CyranoJ Posted March 24, 2022 Share Posted March 24, 2022 Thanks @SCPCD I'll look into this and change the BG colour mode to match the selected colour mode for the display read from _rapinit.s Quote Link to comment https://forums.atariage.com/topic/332958-background-color/#findComment-5027724 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.