Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
1 user currently in Super Mario World hacking: labmaster | 3 guests
Acmlm's Board - I2 Archive - Super Mario World hacking - lunar magic animated palettes
  
User name:
Password:
Reply:
 

UserPost
HyperLamer
Posts: 3945/8210
Heh, I thought I remembered something about having to use the higher bits of the colour, but I figured that was for converting to RGB. But then I never really worked with SNES either; Gameboy Colour just also happens to use 15-bit RGB.
ExKeeper
Posts: 84/512
I don't understand that equation, but I just figured out that the palette editor will show it.
blackhole89
Posts: 603/971
Originally posted by HyperHacker
Well, SNES uses 15-bit colour AFAIK. So something like this should work:
S = (B & 31) ^ ((G & 31) << 5) ^ ((R & 31) << 10)
where S = SNES colour. ^ means XOR (you could use add, but XOR is faster ) and << means left-shift (multiply by 2; eg x << 5 means x multiplied by 2 5 times).

First off, it is the other way around, in other words, the blue colour component is the highest one.
Second, you have to act a little bit different if you want to convert a 24-bit RGB colour to SNES.

S = ((R & 248) >> 3) ^ ((G & 248) << 2) ^ ((R & 248) << 7).

This one should be right.
Smallhacker
Posts: 1417/2273
A few weeks ago, I was finally un-lasy enough to write a few functions that converts SNES colors to PC and vice versa. Maybe I should make a program out of them and release it?
HyperLamer
Posts: 3903/8210
Well, SNES uses 15-bit colour AFAIK. So something like this should work:
S = (B & 31) ^ ((G & 31) << 5) ^ ((R & 31) << 10)
where S = SNES colour. ^ means XOR (you could use add, but XOR is faster ) and << means left-shift (multiply by 2; eg x << 5 means x multiplied by 2 5 times).
ExKeeper
Posts: 77/512
the link seems to be dead.
Shyguy
Posts: 350/1998
Useful Resources for SMW Hackers! (NEWBIES: READ THIS)





Read that thread for your color converting needs!!!!!
ExKeeper
Posts: 76/512
Is there a way to convert PC RGB values to SNES RGB values?
Acmlm's Board - I2 Archive - Super Mario World hacking - lunar magic animated palettes


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.010 seconds.