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

Exporting x16 sprites needs the extra color byte removed #113

Closed
Thraka opened this issue Jun 10, 2024 · 2 comments
Closed

Exporting x16 sprites needs the extra color byte removed #113

Thraka opened this issue Jun 10, 2024 · 2 comments

Comments

@Thraka
Copy link

Thraka commented Jun 10, 2024

It seems that x16 vera chip uses 17-bits for address space, but for sprites, the bottom 5 bits are ignored, so everything is aligned to 32 decimal ($20).

We were using a sprite project with multiple 32x32x4bpp sprites. However, with that extra metadata byte you add at the end of each sprite for the "chosen" color the C64 uses, throws everything out of whack because nothing after the first sprite aligns properly to the vera memory expected.

While you can use the SPRMEM command in BASIC to set the correct location of the sprite in memory, it unfortunately is bound by the vera limitation of aligning things to 32 decimal. For example, If you set sprite 1 to $3000 and sprite 2 to $3001. Sprite 2 will actually align to $3000 and ignore what you told it. The next bit of memory you can align to is $3020.

@GeorgRottensteiner
Copy link
Owner

Thanks! I did implement the fix in a different way, as there's a huge function collection querying all kind of mode infos (Lookup).
Implemented with commit #c54d5622984286fa270fc4deddf0b8e975344c31.
Uploaded a new WIP build to https://www.georg-rottensteiner.de/webmisc/C64StudioRelease.zip

@Thraka
Copy link
Author

Thraka commented Jun 11, 2024

Awesome, thanks @GeorgRottensteiner ! I wanted to take a stab at it obviously not understanding too much about your code structure, so no worries!

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

Successfully merging a pull request may close this issue.

2 participants