11-11-2022, 09:38 PM
(This post was last modified: 11-11-2022, 09:51 PM by megamarc.
Edit Reason: Warning about unaligned reads
)
Hi!
Thanks for permission to use your video :-) How may I credit you?Link to GitHub account, username...?
Thanks for clarifications about palette format and motivations for NES palette. I agree that it would be better to call "custom" palette instead of NES palette, I think this naming is too specific and may create confusion. Be careful however with the format: palette data (red portion) starts at an odd offset. On ARM you can't do unaligned memory reads, that will trigger a CPU runtime exception. Intel x86 allows it, but with performance penalty. So it's a good practice to put data in a boundary aligned to the size of expected reads. In this case, it's expected that client code will do 16-bit (2 byte) reads in case of SNES/Amiga/Genesis palettes, so palette data should start in an offset that is multiple of 2.
By the way, I just pushed to github release 2.13.2 that adds getters for layer and sprite positions, and global palette with your suggestions:
https://github.com/megamarc/Tilengine/co...94107ea236
Thanks for permission to use your video :-) How may I credit you?Link to GitHub account, username...?
Thanks for clarifications about palette format and motivations for NES palette. I agree that it would be better to call "custom" palette instead of NES palette, I think this naming is too specific and may create confusion. Be careful however with the format: palette data (red portion) starts at an odd offset. On ARM you can't do unaligned memory reads, that will trigger a CPU runtime exception. Intel x86 allows it, but with performance penalty. So it's a good practice to put data in a boundary aligned to the size of expected reads. In this case, it's expected that client code will do 16-bit (2 byte) reads in case of SNES/Amiga/Genesis palettes, so palette data should start in an offset that is multiple of 2.
By the way, I just pushed to github release 2.13.2 that adds getters for layer and sprite positions, and global palette with your suggestions:
https://github.com/megamarc/Tilengine/co...94107ea236