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 > Multiplexing sprites?
2016-06-02 19:02
Rudi
Account closed

Registered: May 2010
Posts: 125
Multiplexing sprites?

Hi,
Thanks for all the help ive gotten so far here on csdb.
Now I've runned into another problem.
How the *** does sprite multiplexing work?
I just need the basic idea. I tried to read Cadaver and other tuts, but they seemed too advanced for my taste in continuing.

What my goal is basically to display 64 sprites that stands still. So it will display a checkerboard, hence the sprites only need one of two colors. and they are filled with either of the color. The sprites are displayed beneath the characters so i can either have black and white chess-pieces (using $d800) this works fine with 8 sprites! but now i need to fill the entire checkerboard.
(edit: the entire board is in singlecolor, not multicolor btw)

I have not yet figured out how it works in theory? I just need to have interrupts on each row and display the sprites.
I have a feeling it would work something like this:

01234567
12345670
01234567
12345670
01234567
12345670
01234567
12345670

sprite 0 has darkgray, sprite 1 gray color, sprite 2 darkgray, ..etc.. so it will show a checkerboard in the end..
is it as simple as just setting an interrupt and move the sprite or do one need something else to take into consideration as well?
 
... 42 posts hidden. Click here to view all posts....
 
2016-06-03 17:38
Rudi
Account closed

Registered: May 2010
Posts: 125
TWW: nice screens. the upper one looks more like what I need, but ill explain more of the details of mine below in this post. I dont really have the patience to draw each chess-piece in multicolor, and i allready drawed all the pieces in single color.

Oswald: Can I do multicolored sprites on top or below a single colored character? If so, of course I can use one sprite for two cells in the board. Great idea.

ChristopherJam: Yes, I'll look into that and all other possibilities.

Basically what I have now is this:
- 3x3 chars for one piece.
- A cell of board is displayed as one sprite below the characters that display the chess-piece.
The sprite is stretched in Y. so basically the data in memory for the sprite is 24x12 filled pixels. And after Y-stretch its 24x24 (fiting the 3x3 char).

Todo-list:
- Display two cells as multicolor sprite instead of one.
- My first attempt at doing sprite-multiplexing (with a simpler scheme than this project).


In screenshot 8 sprites are displayed behind the characters.
This is what I have at the moment (dont mind the colors).
2016-06-03 17:56
algorithm

Registered: May 2002
Posts: 705
Quote: fungus: thats fairly easy using the overlapping data "trick" :)

Either that or have 1 of 8 timing based on lower 3 bits of $d011. Overlapping data method works very well as it is however.
2016-06-03 18:49
Oswald

Registered: Apr 2002
Posts: 5094
rudi,yes there's a sprite register to put them behind single color gfx, it just works. (d01b)

I recommend using Y expanded sprites, then sprite height is 42 and you can avoid bad lines completely if first sprite row starts on first displayed gfx line (this one bad line doesnt matter you can set up the first spr row way beforehand)

y stretch may be to much if you'll have an AI in there. Otherwise it spares memory with CPU cycles..
2016-06-03 18:58
Rudi
Account closed

Registered: May 2010
Posts: 125
Oswald: yes, saw that. i fixed it now. got 8 sprites for this screen (with expand for Y as well):



(edit: actually I havent gotten to the point where badlines is an issue. heheh, but now as i am finished with the basics, ill try multiplexing, just need a little break).
2016-06-03 19:12
TWW

Registered: Jul 2009
Posts: 545
Rudi: Forget about sprites. You do not need that at all for the screen You have there. Use Singlecolor bitmap.

The only Challenge is to Draw up the pieces but if You want I can send You the Source for example #1 above which does just that.

Drawing up 3x3 cells With Graphics during gameplay is peanuts in RTIME and the lost RTIME With a screen full of sprites and not to mention the screensplitting/IRQ mess it's a Complete Waste.

Somtimes it's ok to rethink the strategy ;-)

Ps. Nice pieces.
2016-06-03 19:17
Rudi
Account closed

Registered: May 2010
Posts: 125
TWW: Thanks. Bitmap? Oh sh** no, I totally forgot about Bitmap mode. If I can exclude the sprites altogheter of course I would do that. This is a good exercise for me on doing more than 8 sprites though. Ill check into bitmap mode as well. Yes, I only need the setup as in the screenshot, with more cells for the board and white pieces at the bottom ofc.
2016-06-03 19:19
Oswald

Registered: Apr 2002
Posts: 5094
yeah that screen can be done with a hires bitmap. just set up the colors in screen mem (once). and draw the pieces into it. multicolor screen would work too. 3 colors for pieces 1 color for background (d800)

or you could have a 7 color screen with the spritelayer, but drawing would be more complicated that way (sprite layer + bitmap)
2016-06-03 19:26
TWW

Registered: Jul 2009
Posts: 545
Lol, I am an idiot!

There is even a MUCH faster and simpler way to do it: Extended char color mode.

You print the piece characters onto the screen and add #$40 when it's even or odd Board coordinates (assuming you use ZP to represent the Board layout (if not do it)).
2016-06-03 19:31
ChristopherJam

Registered: Aug 2004
Posts: 1409
I was about to mention extended colour mode, but TWW beat me to it :)
2016-06-03 19:36
Rudi
Account closed

Registered: May 2010
Posts: 125
If this does not fuck up the resolution of the characters then I will go for it.
Previous - 1 | 2 | 3 | 4 | 5 | 6 - 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
csabanw
Magic/Nah-Kolor
psych
JackAsser/Booze Design
bepp/ΤRIΛD
Guests online: 109
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 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Crackers
1 Mr. Z  (9.9)
2 Antitrack  (9.8)
3 OTD  (9.8)
4 Fungus  (9.8)
5 S!R  (9.8)

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