| | 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 |
Yep, the board use only 54 characters in total. so it fits the description. |
| | TWW
Registered: Jul 2009 Posts: 545 |
No worries, You have the full resolution as in singlecolor but You can define different background colors for the different characters.
So basically You need to Draw Your white pieceis (let's say Your charset is @ $2000) from $2000 and the black pieces from $2400. Then You set extended mode, define the colors and hardware does the rest. |
| | Oswald
Registered: Apr 2002 Posts: 5094 |
yeah, quite an awesome feature set for the gfx chip for 82, esp if you take into account that 2/3rd of the silicone is taken up by sprite HW. |
| | Rudi Account closed
Registered: May 2010 Posts: 125 |
yes. that was easy. no sprites:
thanks for the help. |
| | Digger
Registered: Mar 2005 Posts: 437 |
@Groepaz/@Algoritm: What is this overlapping data trick?! Never heard of this before?! :D |
| | Skate
Registered: Jul 2003 Posts: 494 |
@Rudi: Don't forget the movement animation. When a piece needs to move, put a sprite over that char, replace the char with an empty board cell, move the sprite, replace the sprite with the char version and disable that sprite. I hate chess games without movement animation. :) |
| | algorithm
Registered: May 2002 Posts: 705 |
@digger. the first few lines at the bottom of the current set of sprites are also in the second row of sprites at the bottom..
now when the rasterline is at that section, you have ample time to change sprite pointers to the sprite definitions for the next row (and the gfx for these few lines will be the same, you will not see any glitches) useful for example when having digitized audio and sprite multiplexing or/and via adjusting d011 for vertical scroll for example. data for the lines can be transferred/plotted as the sprites are multiplexed. |
| | TWW
Registered: Jul 2009 Posts: 545 |
Very good!
Now here is some notes I made when developed my prototypes which might help You from here;
Chessboard:
~~~~~~~~~~~
a b c d e f g h
+-----+-----+-----+-----+-----+-----+-----+-----+
| |#####| |#####| |#####| |#####|
8 | R |##N##| B |##K##| Q |##B##| N |##R##|
| |#####| |#####| |#####| |#####|
+-----+-----+-----+-----+-----+-----+-----+-----+
|#####| |#####| |#####| |#####| |
7 |##P##| P |##P##| P |##P##| P |##P##| P |
|#####| |#####| |#####| |#####| |
+-----+-----+-----+-----+-----+-----+-----+-----+
| |#####| |#####| |#####| |#####|
6 | |#####| |#####| |#####| |#####|
| |#####| |#####| |#####| |#####|
+-----+-----+-----+-----+-----+-----+-----+-----+
|#####| |#####| |#####| |#####| |
5 |#####| |#####| |#####| |#####| |
|#####| |#####| |#####| |#####| |
+-----+-----+-----+-----+-----+-----+-----+-----+
| |#####| |#####| |#####| |#####|
4 | |#####| |#####| |#####| |#####|
| |#####| |#####| |#####| |#####|
+-----+-----+-----+-----+-----+-----+-----+-----+
|#####| |#####| |#####| |#####| |
3 |#####| |#####| |#####| |#####| |
|#####| |#####| |#####| |#####| |
+-----+-----+-----+-----+-----+-----+-----+-----+
| |#####| |#####| |#####| |#####|
2 | P |##P##| P |##P##| P |##P##| P |##P##|
| |#####| |#####| |#####| |#####|
+-----+-----+-----+-----+-----+-----+-----+-----+
|#####| |#####| |#####| |#####| |
1 |##R##| N |##B##| K |##Q##| B |##N##| R |
|#####| |#####| |#####| |#####| |
+-----+-----+-----+-----+-----+-----+-----+-----+
Piece ID:
~~~~~~~~~
White Pawn: #%00000001
White Rook: #%00000010
White kNight: #%00000011
White Bishop: #%00000100
White Queen: #%00000101
White King: #%00000110
Black Pawn: #%10000001
Black Rook: #%10000010
Black kNight: #%10000011
Black Bishop: #%10000100
Black Queen: #%10000101
Black King: #%10000110
Bit #3 signify virgin (0) or moved (1) piece.
Bit #4 Signify En Passant Candidate (1) or not (0)
Board Coordinates:
~~~~~~~~~~~~~~~~~~
0, 1, 2, 3, 4, 5, 6, 7
8, 9, 10, 11, 12, 13, 14, 15
16, 17, 18, 19, 20, 21, 22, 23
24, 25, 26, 27, 28, 29, 30, 31
32, 33, 34, 35, 36, 37, 38, 39
40, 41, 42, 43, 44, 45, 46, 47
48, 49, 50, 51, 52, 53, 54, 55
56, 57, 58, 59, 60, 61, 62, 63
Mapped to ZP adresses: $40 - $7f (0-63)
Basically both my prototyes will display the chessboards perfectly based on the pieces in those ZP address locations. From there it's easy to save/load a game, setup Challenges based on famous games etc. From here it's straight fwd. implementation of the move rules and path-checking. Then it's the AI.
And if You want to be cool, use a mouse routine to allow picking/dropping pieces ;-) |
| | Oswald
Registered: Apr 2002 Posts: 5094 |
Quote: Very good!
Now here is some notes I made when developed my prototypes which might help You from here;
Chessboard:
~~~~~~~~~~~
a b c d e f g h
+-----+-----+-----+-----+-----+-----+-----+-----+
| |#####| |#####| |#####| |#####|
8 | R |##N##| B |##K##| Q |##B##| N |##R##|
| |#####| |#####| |#####| |#####|
+-----+-----+-----+-----+-----+-----+-----+-----+
|#####| |#####| |#####| |#####| |
7 |##P##| P |##P##| P |##P##| P |##P##| P |
|#####| |#####| |#####| |#####| |
+-----+-----+-----+-----+-----+-----+-----+-----+
| |#####| |#####| |#####| |#####|
6 | |#####| |#####| |#####| |#####|
| |#####| |#####| |#####| |#####|
+-----+-----+-----+-----+-----+-----+-----+-----+
|#####| |#####| |#####| |#####| |
5 |#####| |#####| |#####| |#####| |
|#####| |#####| |#####| |#####| |
+-----+-----+-----+-----+-----+-----+-----+-----+
| |#####| |#####| |#####| |#####|
4 | |#####| |#####| |#####| |#####|
| |#####| |#####| |#####| |#####|
+-----+-----+-----+-----+-----+-----+-----+-----+
|#####| |#####| |#####| |#####| |
3 |#####| |#####| |#####| |#####| |
|#####| |#####| |#####| |#####| |
+-----+-----+-----+-----+-----+-----+-----+-----+
| |#####| |#####| |#####| |#####|
2 | P |##P##| P |##P##| P |##P##| P |##P##|
| |#####| |#####| |#####| |#####|
+-----+-----+-----+-----+-----+-----+-----+-----+
|#####| |#####| |#####| |#####| |
1 |##R##| N |##B##| K |##Q##| B |##N##| R |
|#####| |#####| |#####| |#####| |
+-----+-----+-----+-----+-----+-----+-----+-----+
Piece ID:
~~~~~~~~~
White Pawn: #%00000001
White Rook: #%00000010
White kNight: #%00000011
White Bishop: #%00000100
White Queen: #%00000101
White King: #%00000110
Black Pawn: #%10000001
Black Rook: #%10000010
Black kNight: #%10000011
Black Bishop: #%10000100
Black Queen: #%10000101
Black King: #%10000110
Bit #3 signify virgin (0) or moved (1) piece.
Bit #4 Signify En Passant Candidate (1) or not (0)
Board Coordinates:
~~~~~~~~~~~~~~~~~~
0, 1, 2, 3, 4, 5, 6, 7
8, 9, 10, 11, 12, 13, 14, 15
16, 17, 18, 19, 20, 21, 22, 23
24, 25, 26, 27, 28, 29, 30, 31
32, 33, 34, 35, 36, 37, 38, 39
40, 41, 42, 43, 44, 45, 46, 47
48, 49, 50, 51, 52, 53, 54, 55
56, 57, 58, 59, 60, 61, 62, 63
Mapped to ZP adresses: $40 - $7f (0-63)
Basically both my prototyes will display the chessboards perfectly based on the pieces in those ZP address locations. From there it's easy to save/load a game, setup Challenges based on famous games etc. From here it's straight fwd. implementation of the move rules and path-checking. Then it's the AI.
And if You want to be cool, use a mouse routine to allow picking/dropping pieces ;-)
yeah its all down hill from here, thanks for doing most of it for him:) |
| | ChristopherJam
Registered: Aug 2004 Posts: 1409 |
Quoting TWWThen it's the AI.
Oh, is that all? ;) |
Previous - 1 | 2 | 3 | 4 | 5 | 6 - Next | |