Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Updating sprite X msb
2016-03-26 15:50
ChristopherJam

Registered: Aug 2004
Posts: 1378
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....
 
2016-03-27 08:39
Rastah Bar

Registered: Oct 2012
Posts: 336
2016-03-27 09:59
Rastah Bar

Registered: Oct 2012
Posts: 336
Quoting Hoogo
I 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
2016-03-27 12:23
Skate

Registered: Jul 2003
Posts: 490
Quote: Quoting Hoogo
I 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. :)
2016-03-27 17:50
Rastah Bar

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
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
cba
Mike
Core/VPN
Nordischsound/Hokuto..
juN3bula/N3U
Guests online: 111
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Wafer Demo  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Nostalgia  (9.3)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Musicians
1 Vincenzo  (9.8)
2 Rob Hubbard  (9.7)
3 Stinsen  (9.7)
4 Jeroen Tel  (9.6)
5 Linus  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.205 sec.