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 > Software sprites....
2006-04-24 10:16
PopMilo

Registered: Mar 2004
Posts: 146
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:32
Cruzer

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

Registered: Mar 2004
Posts: 146
@ 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: 902
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: 146
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: 146
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: 146
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: 121
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...?
2006-05-22 08:53
PopMilo

Registered: Mar 2004
Posts: 146
Sorry man.... :(

My parents got ill ... I wasnt able to work on it as much as I thought...

But I'm Ok and am working on it as much as I can!

I got seven 24x21 pixel software sprites moving around at 50 fps! Its murphys law I guess :) Why isnt it 8 ? I miss just a few raster lines to make it 8 sprites... But I think it can be optimized enough to squeeze in 1 more....

But it will be difficult to do anything else in the few remaining lines... :(

But! since this is all without preshifted sprite definitions I am prety satisfied... :)

Ill try to put something together for this evening for you to see it in all of its glory! :)
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
Unlock/Padua/Albion
Durandal
MaD ][/Starship
Andy/AEG
Malmix/Fatzone
Worluk
kbs/Pht/Lxt
XmikeX
Guests online: 112
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 The Demo Coder  (9.6)
6 Edge of Disgrace  (9.6)
7 What Is The Matrix 2  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.7)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 X-Mas Demo 2024  (9.5)
7 Dawnfall V1.1  (9.5)
8 Rainbow Connection  (9.5)
9 Onscreen 5k  (9.5)
10 Morph  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top Swappers
1 Derbyshire Ram  (10)
2 Jerry  (9.8)
3 Violator  (9.7)
4 Acidchild  (9.7)
5 Cash  (9.6)

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