| |
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.... |
| |
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). |
| |
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. |
| |
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.. |
| |
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). |
| |
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. |
| |
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. |
| |
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) |
| |
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)). |
| |
ChristopherJam
Registered: Aug 2004 Posts: 1409 |
I was about to mention extended colour mode, but TWW beat me to it :) |
| |
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 |