Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors when using no remap, json palettes and 2 BPP mode #27

Open
est77 opened this issue Feb 13, 2021 · 2 comments
Open

Errors when using no remap, json palettes and 2 BPP mode #27

est77 opened this issue Feb 13, 2021 · 2 comments
Assignees
Labels

Comments

@est77
Copy link

est77 commented Feb 13, 2021

In the code here: https://github.com/Optiroc/SuperFamiconv/blob/master/src/Palette.cpp#L93,
this check seems wrong when using 2 BPP or more that 1 palette. If the check fails, SuperFamiconv throws an exception and enters the catch block and tries to read the json palette as a binary palette with pretty random results.

In my case, I have a 16 colors palette in the original image that I expect SuperFamiconv to convert to 4 palettes with 4 colors each in 2 bpp mode. The check fails because 16 colors is greater than 4.

Using native binary palettes instead seems to work ok.

@Optiroc Optiroc self-assigned this Feb 15, 2021
@Optiroc Optiroc added the bug label Feb 15, 2021
@Optiroc
Copy link
Owner

Optiroc commented Feb 15, 2021

Do you have sample JSON input to test with?

@est77
Copy link
Author

est77 commented Feb 16, 2021

Attached the original PNG image and json palette.

hud

hud_pal.json.txt

superfamiconv command:

superfamiconv tiles -i hud.png -p hud_pal.json -d hud_tileset.chr -B 2 -W 8 -H 8 -v -D -F

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants