4 Digit Hex Colours?

Discussion in 'NDS - ROM Hacking and Translations' started by someonewhodied, Dec 21, 2012.

Dec 21, 2012

4 Digit Hex Colours? by someonewhodied at 3:15 AM (4,214 Views / 0 Likes) 3 replies

  1. someonewhodied
    OP

    Member someonewhodied Lazy Person

    Joined:
    Sep 21, 2008
    Messages:
    869
    Country:
    United States
    So megaman zero collection uses 4 digit hex colours instead of the usual 6 and the colour mixer I have doesn't work.

    I'm specifically looking for values for AR codes like this:

    Weapon Colours (Z3)
    92040524 00FF0300
    520349E4 BFF28388
    E20349E4 0000000C
    XXXXYYYY ZZZZ@@@@
    ####$$$$ 00000000
    D2000000 00000000

    For the part in red.
     
  2. rastsan

    Member rastsan 8 baller, Death Wizard

    Joined:
    May 28, 2008
    Messages:
    963
    Location:
    toronto
    Country:
    Canada
    wouldn't it be easier to add a hold select and up to increase value xxxx and select and down to decrease xxxx value (and then a different button for the rest of the 4 digits). then to document what each increase does?
    Seriously I have no intention of figuring it out for you. (that is huge time waster). if you already know which area is the color area and you know its between these hex values turning the above code into a increase / decrease to change color makes sense right? its just setting the interval... (byte jump)
     
  3. Cyan

    Global Moderator Cyan GBATemp's lurking knight

    Joined:
    Oct 27, 2002
    Messages:
    16,432
    Location:
    Engine room, learning
    Country:
    France
    If max color is on 2bytes (using 4 hex digit) then it means the max value is FFFF = 1111 1111 1111 1111

    if it's RGBA it's 4 bit per color
    if it's RGB it's 5 bit per color +1 unused 0 11111 11111 11111 = 01111111 11111111 = 0BBBBBGG GGGRRRRR = 2 bytes. Each byte store a mix of two colors, contrary to 3 bytes with one color per byte)
    known as 15-bit color

    11111 = 0x1f = full color, but you need to set them to binary to find the correct color.
    White is not 0x1f1f1f but 0x7FFF (11111 11111 11111)


    PS: it's only a supposition on how the color can be coded in your current game
    You'll have to test it to know if it's working, and if it's in big or little endian (the unused bit at the start or the end, and the direction of the color reading)
    0RGB
    RGB0
    0BGR <- more likely to be this one
    BGR0
    and high chance it's in little endian (reversed order) 0x7FFF must be written FF 7F in your Action replay code.
    Read the link above to learn how to convert 24bit to 15bit

    Edit:
    It could be that it's not using a color definition, but a palette position.
    For example you have a palette with 32 positions (I randomly picked that number). each position has it's own color definition, and the sprite use the palette position instead of a color definition for of its each pixel.
     
    rastsan likes this.
  4. someonewhodied
    OP

    Member someonewhodied Lazy Person

    Joined:
    Sep 21, 2008
    Messages:
    869
    Country:
    United States

Share This Page