rage1 icon indicating copy to clipboard operation
rage1 copied to clipboard

btile: change data layout to match struct sp1_tp

Open jorgegv opened this issue 1 year ago • 0 comments

The data for a given BTILE is specified in a struct btile_s and is currently split into 2 separate byte arrays: one for pixel data and one for attr data. All this data is generated by DATAGEN.

If BTILE data is instead arranged as an array of struct sp1_tp elements (which contain a pointer to 8-byte pixel data and an attribute), the size of BTILE data would be exactly the same (just the arrangement in memory would change), but it will allow them to be directly used by the function sp1_PutTilesInv, which does exactly the same as our btile_draw, but much more optimized.

This optimization will also help the animated btiles run smoothly, and also make our btile drawing code smaller.

jorgegv avatar Oct 07 '22 12:10 jorgegv