0 Members and 2 Guests are viewing this topic.
Hello everybody !I have problems with color support, and I would need your help...I have to change my buffer from uint8_t* to void*.But in a function to change a pixel, I have to cast a void* value to an uint8_t if the screen is in 4 bpp mode.So I tried :Code: [Select]function setPixel(void *buffer,int x,int y,int color){ //... uint8_t px=*((uint8_t *)buffer[pos]) //pos is an int //...}But gcc does not like that... What should I do instead?
function setPixel(void *buffer,int x,int y,int color){ //... uint8_t px=*((uint8_t *)buffer[pos]) //pos is an int //...}
uint8_t px=(((uint8_t *)buffer)[pos]);
So, CX compatibility should be okay, but for random reasons it keep crashing when I open it with the emulator...I really do not understand.The CX emulator works fine, I can run other programs that I compiled.But it doesn't seem that the error comes from the code, since it runs perfectly on non-CX emulator.I have no clue...
(Sorry for the triple post...)By the way, even if I can't use the timers, the color display works great.Here is some eye-candy...(In the first picture, you can see iron, gold and diamond, and in the second one, there is pretty much every block I added )