I have no idea how to accomplish what you are hoping to accomplish but I will say this is a very cool project!
Also I wasn't aware of Metal Saver! Thanks for putting it on my radar!
Thank you. I also decide that instead of full rewrite of original game palette data (Metal Savior hardvare uses xBGR_444 colour space) it's would be easier to use an in-game software colour converter. At the first stage of conversion, is it enough to just shift a content of each RGB channel left by 1 bit?
I think that's not quite correct because you would lose the black value and you also don't get a maximum value 31!
maybe it looks better with this palette conversion!
0 -> 0 *
1 -> 2
2 -> 4
3 -> 6
4 -> 8
5 -> 10
6 -> 12
7 -> 14
8 -> 17 *
9 -> 19
10 -> 21
11 -> 23
12 -> 25
13 -> 27
14 -> 29
15 -> 31 *
I. e. it should look some kinda like this?
move.w D0, D1 ; D0 contains the whole colour code
move.w D0, D2
andi.w #$f, D0 ; getting R component
andi.w #$f0, D1 ; G
andi.w #$f00, D2 ; B
asl.b #1, D0
asl.w #1, D1
asl.w #1, D2
cmpi.b #$10, D0
blt (2,PC)
addi.b #1, D0
cmpi.w #$10, D1
blt (2,PC)
addi.w #1, D1
cmpi.w #$10, D2
blt (2,PC)
addi.w #1, D2
Your idea is correct but this code won't work that way... I don't know which compiler you are using, but BLT shouldn't really work like this!?
Do you want to do it in real time or on NEOGEO? why no pre-calculated palettes?
You can get almost the same by copying the MSB of each component to the LSB. Meaning you can get away with just an AND and a shift, and no branching.
Also, for this format of colors, a table would also work, it'd take just 8 kB.