Jump to content

  • Log In with Google      Sign In   
  • Create Account

GBA Colors


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Aprosenf   Members   -  Reputation: 372

Like
Likes
Like

Posted 19 January 2002 - 02:16 PM

In Modes 3 and 5, I know that the color depth is 15-bit in BGR format. However, when my bitmap is being drawn, it''s as if it''s in RBG (i.e. RGB with the green and blue switched). It''s just a simple 24-bit bitmap. I wrote a program to convert .bmp''s into .h''s with hard-coded data, and for exmaple yellow (R=255, G=255, B=0) comes out as 0xE07F (Note that the bytes are swapped in lo-hi instead of hi-lo, which the normally are, so it comes out to 0111 1111 1110 0000 in binary) after it is ran through the program. When it is displayed, it comes out as magenta. Does anyone know why this would be happening?

Sponsor:

#2 Aprosenf   Members   -  Reputation: 372

Like
Likes
Like

Posted 19 January 2002 - 02:20 PM

BTW, the source code to my converter program can be found at
http://www.angelfire.com/ma3/aprosenf/files/BMP_To_GBA.zip

#3 Aprosenf   Members   -  Reputation: 372

Like
Likes
Like

Posted 19 January 2002 - 02:39 PM

Never mind, I figured it out. I did have to swap the bytes in each word (i.e. change 0xEO7F to 0x7FE0), and I also had to swap the red and blue values. It just kind of confuses me the way words and double-words are stored. For example, if I have a short that is 0xABCD (43,981) and I saved it to a file, the bytes would read CD AB, not AB CD. Anyways, forget I even posted this here.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS