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

btile: change data layout to match struct sp1_tp #106

Open
jorgegv opened this issue Oct 7, 2022 · 0 comments
Open

btile: change data layout to match struct sp1_tp #106

jorgegv opened this issue Oct 7, 2022 · 0 comments

Comments

@jorgegv
Copy link
Owner

jorgegv commented Oct 7, 2022

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.

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

No branches or pull requests

1 participant