Load palette(s) from region in .bin to view in Binxelview
So, PlayStation 1 stores its 15BPP and 4BPP data alongside each other in VRAM. The fun part is that 4BPP textures use color palettes that are stored in 15BPP format... so you can plainly see the palettes in one mode, but you need them for the other mode.
Source .bin (VRAM dump via DuckStation), PNGs in 15BPP and 4BPP, and "PS1 VRAM" presets: Die Hard Trilogy (Die Harder).zip
In this instance, the palettes are stored in the bottom-right region of VRAM in 15BPP. The most useful section is the brightest 16×256 column at byte 80680, fourth from the left.
For my own needs, I figured out a way to test all these palettes in Photoshop. But I figured it could be quite useful to be able to target a region in a .bin, and load it directly into Binxelview's palette.
Thoughts about how to read & load entries, using the .bin and presets provided above for this example:
- Start by finding the byte position of the palette's first color: in this case, 80680.
- Then, while viewing the .bin in the appropriate color mode (4BPP, 1, -4), enter the byte position of the palette, and select a preset to decode the palette correctly. (PS1 VRAM 15BPP)
- For each color entry in Binxelview's palette, load each byte in sequence until the palette has been filled.
- If there are more palettes in the same region of data, cycle through them using buttons that can increment the palette's byte position by the length of the palette (20 bytes) or by row (800 bytes).
Sure, if you can display the palette data as 1 colour per pixel, it would be reasonable to have a way to send it to the palette. Could probably put it on the right click menu... would need to make sure the palette is retained when you switch away from 24/32bpp mode.
Note to add a few suitable palette presets to assist this, the two PS1 ones above, and VGA 18-bit for starters.
Should be available in preview builds as of: https://github.com/bbbradsmith/binxelview/commit/4851a7a7ce8d7ac0be3432e1e33aa87efe906917
I'll close this issue at the moment, but feel free to comment if there's more to say on it, and it can be reopened.