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 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.
2016-06-03 19:37
Rudi
Account closed

Registered: May 2010
Posts: 125
Yep, the board use only 54 characters in total. so it fits the description.
2016-06-03 19:39
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.
2016-06-03 19:58
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.
2016-06-03 20:25
Rudi
Account closed

Registered: May 2010
Posts: 125
yes. that was easy. no sprites:



thanks for the help.
2016-06-03 20:47
Digger

Registered: Mar 2005
Posts: 437
@Groepaz/@Algoritm: What is this overlapping data trick?! Never heard of this before?! :D
2016-06-03 21:28
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. :)
2016-06-03 21:28
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.
2016-06-03 23:22
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 ;-)
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
Chesser/Blazon
Kakka/Extend, Damone..
DuncanTwain
Fred/Channel 4
mankeli/Extend
New Design/Excess
B.A./QUANTUM
Guests online: 87
Top Demos
1 The Lethal Christmas..  (9.7)
2 Next Level  (9.7)
3 13:37  (9.7)
4 Mojo  (9.7)
5 Coma Light 13  (9.6)
6 Edge of Disgrace  (9.6)
7 What Is The Matrix 2  (9.6)
8 The Demo Coder  (9.6)
9 Uncensored  (9.6)
10 Comaland 100%  (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 NTSC-Fixers
1 Pudwerx  (10)
2 Booze  (9.7)
3 Stormbringer  (9.7)
4 Fungus  (9.6)
5 Grim Reaper  (9.3)

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