VMU Save Icon palette

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
tonma
DCEmu Freak
DCEmu Freak
Posts: 82
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Thu Mar 10, 2016 7:14 am
Has thanked: 0
Been thanked: 1 time

VMU Save Icon palette

Post by tonma »

Hi,

I'm writing my owns tool for converting picture.

I've some problems with the palette of the vmu save icon.

I have an array of Hex value :
const unsigned char vmu_bios_save_icon[544] ={
//Palette		
0xF2,0x24,0xF5,0x45,0xF2,0x2C,0xFA,0xBB,
0xF0,0x9F,0xF2,0x01,0xF5,0x68,0xF9,0xAD,
0xFE,0xEE,0xFF,0xFF,0xF7,0xDF,0xF6,0x31,
0xFE,0x61,0xFE,0xB0,0xF2,0x46,0xFA,0x71,

//Icon image
0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x00,
0x00,0x07,0x77,0x77,0x77,0x77,0x77,0x77,
0x77,0x77,0x77,0x77,0x77,0x77,0x71,0x22,
...
And I use :
pkg.icon_cnt = 1;
memcpy(&pkg.icon_pal[0], vmu_bios_save_icon, 32);
pkg.icon_data = vmu_bios_save_icon + 32;
I use the ARGB4444 format 0xAR,0xGB and tested litte/big endian.
But I only have blue palette as you can see in the picture. Left original and right vmy icon

I use the define PACK4444(a, r, g, b) ( ((a>>4) << 12) | ((r>>4)<<8) | ((g>>4)<<4) | ((b>>4)) )

For example, the orange value
in ARGB = 255 255 73 26
in Hex = 0xFF,0x41

Green value = 73 decimal => (1001001b>>4)<<4 => 0100 => 0x4
Attachments
vmu_save_palette.png
vmu_save_palette.png (2.32 KiB) Viewed 587 times
Last edited by tonma on Thu Sep 06, 2018 10:12 am, edited 1 time in total.
These users thanked the author tonma for the post:
Ian Robinson
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5658
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: VMU Save Icon palette

Post by BlueCrab »

Your palette (in that code block) is in the wrong byte ordering. Remember, the palette data is 16-bit quantities in little endian byte ordering, so the data should be in the form of 0xGB, 0xAR, 0xGB, 0xAR, ... if you want to use all 8-bit quantities to represent it. As it is, your entire icon (save one color value) has transparency, and thus would have stuff bleeding through from the background of whatever it is displayed on.
tonma
DCEmu Freak
DCEmu Freak
Posts: 82
Joined: Thu Mar 10, 2016 7:14 am
Has thanked: 0
Been thanked: 1 time

Re: VMU Save Icon palette

Post by tonma »

Thanks.

:oops: I'm a little silly, I changed the little/big endian between the byte instead of the word. 0xAR,0xGB => 0xRA,0xBG

Now, that's works better.
User avatar
Ian Robinson
DC Developer
DC Developer
Posts: 114
Joined: Mon Mar 11, 2019 7:12 am
Has thanked: 209 times
Been thanked: 41 times

Re: VMU Save Icon palette

Post by Ian Robinson »

Did you ever write this tool or release a version ?
Post Reply