Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user lotus_skylight ! (Registered 2024-09-25) You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Software sprites....
2006-04-24 10:16
PopMilo

Registered: Mar 2004
Posts: 145
Software sprites....

Does anybody have any expirience with software sprites?
Bobs?

In hires or char mode?

Games I susspect have something to do with software sprites:

Cybernoid for bullets...
Last ninja for masking main character (its not a software sprite, only hardware one masked, to show visibility...)
karnov
Astromarine corps
..,

What is record for these?
 
... 111 posts hidden. Click here to view all posts....
 
2006-05-02 09:27
WVL

Registered: Mar 2002
Posts: 889
Quote: Isn't the ball in Pinball Dreams just some plain old layered hardware sprites? Any "software" involved in that?


lot of software involved in that! :)

the ball consists of 3 single colored sprites for each of the 3 colors. Sometimes the ball has to go behind objects, so i have to cut pieces out of the sprites. To do this the fastest, i use 24 pre-shifted spritedefinitions (8 images for every color of the ball) which i AND with the mask data. The sprites themselves only move by 8 pixel spacings in x, and every single pixel in y.
2006-05-02 09:32
Cruzer

Registered: Dec 2001
Posts: 1048
IC, hadn't thought of the clipping.
2006-05-02 10:04
PopMilo

Registered: Mar 2004
Posts: 145
@ WVL: "pinball dreams also uses preshifted sprite definitions for the 3 ball sprites to make the masking quicker. The code is pretty well optimized, so maybe you would want to take a look?"

I have that dev package... Have already looked in there but its huge. Maybe you could give me some pointers where to look ?
2006-05-02 10:26
WVL

Registered: Mar 2002
Posts: 889
Quote: @ WVL: "pinball dreams also uses preshifted sprite definitions for the 3 ball sprites to make the masking quicker. The code is pretty well optimized, so maybe you would want to take a look?"

I have that dev package... Have already looked in there but its huge. Maybe you could give me some pointers where to look ?


the routine you need is called 'calcclippedsprite' and is inside MAIN.txt in the /sources/ directory.

the first bit of the routine fetches pointers to the chars containing the mask data (which is rle-ed in the memory), from 'clipoffset' is the loop that does the ANDing.. i've chosen for some smart way i only need to AND with the mask data once (my sprite data is set up in such a way, check it out)

clipoffset ldx #0
cliploop
spritea1   lda $1000,y           //fetch correct sprite byte
char1      and $1000,x           //mask data!
point1a    sta spriteimage,y     //store 1st byte sprite0
spriteb1   and $1000,y           //and with 2nd spriteimg
point2a    sta spriteimage2,y    //store 1st byte sprite2 
spritec1   and $1000,y           //and with 3rd spriteimg
point3a    sta spriteimage3,y    //store 1st byte sprite3
           dey
spritea2   lda $1000,y           //the same, but for
char2      and $1000,x           //the 2nd byte in the
point1b    sta spriteimage,y     //sprites
spriteb2   and $1000,y
point2b    sta spriteimage2,y
spritec2   and $1000,y
point3b    sta spriteimage3,y
           dey
spritea3   lda $1000,y           //3rd byte
char3      and $1000,x
point1c    sta spriteimage,y
spriteb3   and $1000,y
point2c    sta spriteimage2,y
           beq point3c
spritec3   and $1000,y
point3c    sta spriteimage3,y

after this is the loop condition, which is a bit awkward. It checks for all rows done (15 of them) and if the maskdata goes past any 8-pixel boundarys (if so, the char1/char2/char3 pointers get an update!)
2006-05-02 10:45
PopMilo

Registered: Mar 2004
Posts: 145
thanks! will take some time to analyse it...
First I want to finish kind of a framework for my test app... making lookup tables, sinuses, double buffering stuff like that... so I could test different aproaches more easily...
2006-05-04 23:12
PopMilo

Registered: Mar 2004
Posts: 145
Am making progress but nothing to show yet.... will be soon...

But. I found this:

http://plus4.emucamp.com/forum.php?postid=10459

A game for plus4 with software sprites, with masking and speed...
It looks very interesting:

Quote: "...It only generates the sprite in that rotation when its about to draw it. So if a sprite is animating, and moving, theres a good chance that some frames won't ever be rotated.

Also the cache allows sprites that are used a lot to stay inside the cache, while ones that aren't drift to the top of the list.

So yes. Rotate on demand, but demand is mesured per-rotation and no per-sprite. (i.e. I dont do 4 rotations for a sprite, just the one it needs right now)..."

Cache for mostly used rotations? Excellent idea!
2006-05-05 00:54
T.M.R
Account closed

Registered: Dec 2001
Posts: 749
Things to remember about Xeo3:

1) Mike Dailly used to work for DMA Design, wrote Blood Money on the C64 and seriously knows what he's doing.

2) The 264 series have a higher overall clock speed than the C64, at least 1.5 times the grunt to shift stuff around if memory serves.
2006-05-05 23:22
PopMilo

Registered: Mar 2004
Posts: 145
Quote: Things to remember about Xeo3:

1) Mike Dailly used to work for DMA Design, wrote Blood Money on the C64 and seriously knows what he's doing.

2) The 264 series have a higher overall clock speed than the C64, at least 1.5 times the grunt to shift stuff around if memory serves.


I know he is pro... :)

I didnt like blood money that much :)

I know he knows what he's doing :)

I know I began programming 6510 back in 1986. Never stopped since. I make programs for living. Have done some pretty intensive shit on DSP's and microcontrollers. I want to take c64 to its limits :)

And I love software sprites :)

Next week Im releasing my demo with software sprites, I hope... :)
2006-05-21 11:14
Honesty

Registered: Jan 2003
Posts: 117
Good luck then... :))
2006-05-21 15:38
T.M.R
Account closed

Registered: Dec 2001
Posts: 749
"Next week Im releasing my demo with software sprites, I hope..."

That's a very long week...?
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 - 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
Alakran_64
Exile/Anubis
Airwolf/F4CG
The Syndrom/TIA/Pret..
insane/Rabenauge
morphfrog
Aomeba/Artline Desig..
kbs/Pht/Lxt
Guests online: 137
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Mojo  (9.6)
6 Uncensored  (9.6)
7 Wonderland XIV  (9.6)
8 Comaland 100%  (9.6)
9 No Bounds  (9.6)
10 Unboxed  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Party Elk 2  (9.6)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.6)
5 Rainbow Connection  (9.5)
6 It's More Fun to Com..  (9.5)
7 Morph  (9.5)
8 Dawnfall V1.1  (9.5)
9 Onscreen 5k  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Booze Design  (9.3)
2 Oxyron  (9.3)
3 Nostalgia  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.2)
Top Musicians
1 Rob Hubbard  (9.7)
2 Jeroen Tel  (9.7)
3 Stinsen  (9.6)
4 Mutetus  (9.6)
5 Linus  (9.6)

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