Omnimaga
Calculator Community => Casio Calculators => Topic started by: Spenceboy98 on June 16, 2012, 12:31:00 am
-
Is there a way to change the background color of the screen without storing a gigantic sprite?
-
Memcpy?
-
You mean memset.
-
How do I use memset?
-
Yup, i was tired and sleepy
So, you use memset like this:
void * memset ( void * ptr, int value, size_t num );
Ptr will be a pointer to the screen, value the color, and num the number of pixel to change.
-
Also, memset returns the first argument.
-
Do you happen to know what number Brown is?
-
0xA8000000 it is.
-
0xA8000000 it is.
Brown?
-
Actually, get the RGB value for brown, then encode it in 5-6-5 RGB.
So, according to my calculations, 0x9A60.
0xA8000000 is the pointer to the screen, I got confused, sorry.
-
So, you use memset like this:
void * memset ( void * ptr, int value, size_t num );
Ptr will be a pointer to the screen, value the color, and num the number of pixel to change.
memset works with bytes, so you can use it to fill the screen, but only for few colors, where the lower byte equals the higher byte.
Black or white is OK, but brown (0x9A60) not, because 0x9A != 0x60.
Also the num is NOT number of pixels, but number of pixels * sizeof(unsigned short), because 1 pixel (= 1 unsigned short) == 2 bytes.