Skip to content
This repository has been archived by the owner on May 24, 2018. It is now read-only.

solve pal issue #14

Closed
interdpth opened this issue May 11, 2018 · 1 comment
Closed

solve pal issue #14

interdpth opened this issue May 11, 2018 · 1 comment

Comments

@interdpth
Copy link
Owner

P.JBoy - Today at 9:14 AM
you know
in the SNES tilemap format, the palette isn't the most significant nybble
it's bits 10..12
interdpth - Today at 9:15 AM
....
0x1c00?
P.JBoy - Today at 9:15 AM
so you'll have to do an actual transformation
interdpth - Today at 9:15 AM
i saw 0x1c00 somewhere
get index off that, bounce back to slot 3?
P.JBoy - Today at 9:16 AM
the SNES tilemap format is yxPpppiiiiiiiiii, the GBA tilemap format is ppppyxiiiiiiiiii
interdpth - Today at 9:16 AM
oh wow
so sm gets less colors
P.JBoy - Today at 9:17 AM
yeah, backgrounds and sprites mutually exclusively get 8 palettes
interdpth - Today at 9:17 AM
sad times
P.JBoy - Today at 9:17 AM
but the GBA doesn't have a priority bit
interdpth - Today at 9:17 AM
so just shave that off
and i get ppp
then add to it and i should be good

@interdpth
Copy link
Owner Author

possible algo uint16_t snes2gba_tilemap(uint16_t tile) { return tile & 0x3FF | tile & 0xC000 >> 4 | (tile & 0x1C00 << 3) + 0x3000; }

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

No branches or pull requests

1 participant