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 > Sprite multiplexer
2009-06-12 19:21
Axel
Account closed

Registered: Apr 2006
Posts: 42
Sprite multiplexer

I am trying to do simple multiplexer using "Zone split" technique. Something like this:
      1 2
      1 2
      1 2
      ...

I found in codebase that: "The Y-coordinate for a sprite must have been set before the raster line reaches that Y-position, or the re-used sprite won't display at all" What does it mean?
I wrote this piece of code:
	     
lda $d001		
clc			
adc #21			
sta $d001
sta $d003
ldx spriteindex
lda frametable,x	
sta $07f8		
lda frametable+1,x	
sta $07f9               
txa			
clc			
adc #2
sta spriteindex

How exacly can I get it to work?


 
... 10 posts hidden. Click here to view all posts....
 
2009-06-13 20:02
Axel
Account closed

Registered: Apr 2006
Posts: 42
I got the idea, but I don't know how to use it in code ;)
I made sprite multiplexer using multiple iterrupts and it works quite good but few virtual sprites aren't displayed,
it depends on raster line where I start reusing sprites.
2009-06-14 03:39
Oswald

Registered: Apr 2002
Posts: 5094
you may be late by rewriting the Y coords then. the first line of each char row is a bad line meaning you have there 40 cycles less cpu time, maybe those are the specific lines things go wrong.
2009-06-14 17:21
Axel
Account closed

Registered: Apr 2006
Posts: 42
Yes you are right. I change sprite position a bit late, becouse of these badlines.
What is the solution?
2009-06-14 17:46
assiduous
Account closed

Registered: Jun 2007
Posts: 343
set the raster interrupt to trigger one line earlier and wait in a loop to change the Y pos when needed. or use CIA interrupts.
2009-06-15 14:46
Skate

Registered: Jul 2003
Posts: 494
you can change sprites' Y position right after sprite is displayed but don't forget that you have to change the sprite address (which sprite data to be displayed) at the exact raster position. so, if you need all 8 sprites, change Y coordinates before the multiplexing position and change sprite addresses at the multiplexed raster position.

0: ******** <-- this is where first sprites are displayed
1: ++++++++ <-- this is where new Y coordinates are set. this line can be any line available between 1 and 20.
...
...
20: oooooooo <-- this is where you change sprite datas (at the end of the raster line)
21: ******** <-- our new sprites are shown here
22: goes same like "1:"
2009-06-15 17:45
hollowman

Registered: Dec 2001
Posts: 474
This old thread is worth reading:
http://noname.c64.org/csdb/forums/index.php?roomid=11&topicid=3..
The half-shape trick is very nice
2009-06-16 12:52
Axel
Account closed

Registered: Apr 2006
Posts: 42
Thanks now it works :)
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
Felidae/Reflex
JLD/Finnish Gold
psenough
Sillicon/Unreal
The Syndrom/TIA/Pret..
Guests online: 122
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 X-Mas Demo 2024  (9.5)
7 Dawnfall V1.1  (9.5)
8 Rainbow Connection  (9.5)
9 Onscreen 5k  (9.5)
10 Morph  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top Original Suppliers
1 Derbyshire Ram  (9.7)
2 Fungus  (9.3)
3 Black Beard  (9.2)
4 Baracuda  (9.2)
5 hedning  (9.1)

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