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: 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: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: 886
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...?
2006-05-22 08:53
PopMilo

Registered: Mar 2004
Posts: 145
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
hedning/G★P
Aomeba/Artline Desig..
xAD/nIGHTFALL
Flex/Artline Designs
Dano/Padua
WVL/Xenon
iAN CooG/HVSC
zscs
Guests online: 123
Top Demos
1 Next Level  (9.8)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.7)
5 Edge of Disgrace  (9.6)
6 Comaland 100%  (9.6)
7 Uncensored  (9.6)
8 No Bounds  (9.6)
9 50 Years of Flex  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 It's More Fun to Com..  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Rainbow Connection  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Booze Design  (9.3)
3 Censor Design  (9.3)
4 Crest  (9.3)
5 Performers  (9.3)
Top Organizers
1 Burglar  (9.9)
2 Sixx  (9.8)
3 hedning  (9.7)
4 Irata  (9.7)
5 MWS  (9.6)

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