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

SetSpriteLoc procedure works only for very limited set of parameters #874

Open
zzarko opened this issue Feb 8, 2025 · 0 comments
Open

Comments

@zzarko
Copy link
Collaborator

zzarko commented Feb 8, 2025

I spent couple of hours trying to figure out why I get garbage on screen with sprites when I switched VIC2 to $4000-$7FFF, screen on $4800, and using SetSpriteLoc. Essentially, there are two problems, both related to SetSpriteLoc procedure:

First one is that third parameter, VIC bank has opposite values than what is used for SetBank procedure. For example, constant needed for SetBank if you want VIC data to be at $4000 is 2, but for SetSpriteLoc you need to use 1, or for VIC data at $0000, this is 3 for SetBank and 0 for SetSpriteLoc.

Second one is that SetSpriteLoc is hardcoded for screen to be at VIC data base address + $0400. Setting the screen to any other offset (like $4800) will just do nothing, as wrong addresses will be used by the procedure.

A good solution would be for third parameter for SetSpriteLoc to be character screen address (not VIC bank), but I guess that would break compatibility with previous code that uses it. Alternatively, maybe include SetSpriteLoc in Screen unit with correct implementation (currently there is none there).

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

No branches or pull requests

1 participant