| |
ChristopherJam
Registered: Aug 2004 Posts: 1409 |
Updating sprite X msb
Slack bastard time. Recs for updating $d010 if I've got an eight bit x-position in my object table, but all my sprites are offset a constant number of pixels to the right? Current draft is this:
clc
lda mobX,x
adc xoffset
sta $d000,y
lda #0
adc #255
eor #255
eor $d010
and hibit,x
eor $d010
sta $d010
(x is both object ID and sprite number (I'll change how I index mobX later), y is double the sprite number. hibit contains 2**i) |
|
... 10 posts hidden. Click here to view all posts.... |
| |
Rastah Bar Account closed
Registered: Oct 2012 Posts: 336 |
|
| |
Rastah Bar Account closed
Registered: Oct 2012 Posts: 336 |
Quoting HoogoI wonder if that multiplexer reuses the sprites in order, so that for every call y will increased by 2 and start with 0 again? Not sure if that can make a difference, just thinking...
If you can use a separate piece of code for each sprite, maybe you could do (for example for sprite 3)?
clc
lda mobX+3
adc xoffset
sta $d006
lda $d010
and #f7 ; clear first
bcc store
ora #$08
store
sta $d010
|
| |
Skate
Registered: Jul 2003 Posts: 494 |
Quote: Quoting HoogoI wonder if that multiplexer reuses the sprites in order, so that for every call y will increased by 2 and start with 0 again? Not sure if that can make a difference, just thinking...
If you can use a separate piece of code for each sprite, maybe you could do (for example for sprite 3)?
clc
lda mobX+3
adc xoffset
sta $d006
lda $d010
and #f7 ; clear first
bcc store
ora #$08
store
sta $d010
I remember writing a macro like this one, using sprite number as a parameter and generating these and/or values according to the number. this way code looks fine, things speed up, memory usage sucx, speed rocx. :) |
| |
Rastah Bar Account closed
Registered: Oct 2012 Posts: 336 |
Quoting Color Bar
If you can use a separate piece of code for each sprite, maybe you could do (for example for sprite 3)?
Now I look more carefully I see that this is what Hein is doing ... |
Previous - 1 | 2 - Next |