You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
The text was updated successfully, but these errors were encountered:
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).
The text was updated successfully, but these errors were encountered: