| |
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.... |
| |
tlr
Registered: Sep 2003 Posts: 1790 |
Quote: Zone Ranger has some cool software sprites, not too smooth, but very fast.. Zone Ranger
Hadn't seen that one. Great! |
| |
MikeD Account closed
Registered: Jan 2006 Posts: 19 |
Err....but what happens when 2 sprites cross? If you just STA, then you lose the sprite underneath?!?! I don't quite follow you - unless you're masking some other way perhaps?
Yes, the barrel shifter is a small routine that will rotate any sprite by "N" pixels. Its pretty much the same as your tables. I have 8 tables for MCM and 16 for Hires. 1 is the remainer, and 1 overflow, and then have this "n" times. Although yes, I could do a "0" special case.
All this does is rotate one column into the next and then stores the remainer in the overflow column. here it is...
ldy #15
RotateALL
SrcColumn1 lax $0101,y
BarrelShift1 lda Table1,x
DataDest1 sta $0101,y
BarrelShiftO1 lda Table1+256,x
sta Column2+1
; Now do Column 2
SrcColumn2 lax $0101,y
BarrelShift2 lda Table1,x
Column2 ora #$00
DataDest2 sta $0101,y
BarrelShiftO2 lda Table1+256,x
DataDest3 sta $0101,y
dey
bpl RotateALL
A barrel shifter is simply a function (of hardware or software) that takes the same time to rotate 1 as it does any other number. This routine does that - probably exactly the same way as yours does. More effort actually goes into caching the thing rather than rotating it!
|
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
why dont you use good ol' brute force ?
lda screen,x
and #spritemask
ora #spritedaza
sta screen,x |
| |
MikeD Account closed
Registered: Jan 2006 Posts: 19 |
Because this isn't from a demo, its game code. And the game has 167 16x16 sprites. Demo's can afford the space for a couple of sprite shapes - games can't :) |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
167 is a lot :) |
| |
Luca
Registered: Apr 2002 Posts: 178 |
Boooo-hooo! :_(
Months ago, I tried myself to have a nice softprites routine too, with animated bubbles that run in vertical+sin(x). Due to the amount of the bubbles (5) I used doublebuffering, but bubbles #4 and #5 disappear before they reach the top of the screen, although I'm quite sure the dblbuffer works good! Frustrated, I paused that stuff...and I'm soooooo saaaaaad cause of that! |
| |
Cruzer
Registered: Dec 2001 Posts: 1048 |
@Luca: Definitely sounds like it's not safe to conclude that your double buffer works. Testing all the things you're 100% sure works is the way to debug when you can't find the error. |
| |
Luca
Registered: Apr 2002 Posts: 178 |
Quote: @Luca: Definitely sounds like it's not safe to conclude that your double buffer works. Testing all the things you're 100% sure works is the way to debug when you can't find the error.
Yes, you're right. I had a long debugging time, then I lost hopes, also because of the bad ordered code I wrote. Probably it's time to get back to it, after a period of calm. |
| |
PopMilo
Registered: Mar 2004 Posts: 146 |
@MikeD:
Sprites do not cross :)
Its supposed to be arcade game, if you touch some object it can explode, dissapear, you picked it up, or it just blocks your movement...
Since my frontal layer is hires black there are no color clashes even if two sprites overlap (In that case I just have to use simple masking routine).
Char sprites -> hires black->masking routine
Hardware sprites -> multicolor (3 colors) -> dont have to do masking, they have priorities-just have to synchronize hardware priorities with software routine.
Offcourse I need mask definition for each frame, so it takes more memory, and more cputime, so I think Ill try to avoid overlaping.
And also chars in front (scenary) will have rectangular shapes (like chars) to make masking simple (dont draw char on screen if there is something infront, and mask hardware sprites if nececery with simple "erase 8x8 pixel block" in sprite.
And to answer JackAsser "Any previews popmilo?":
Currently Im busy with my own pc "hires over multi sprite editor" with keyboard controls (like in c128 built in sprdef)- old habbits die hard :)
So when I make at least one complete animation of my hero walking, Ill let it out :)
So far, I have only sprites flying around, and there is so much more in a game that needs a lot of thinking...
Ill take it step by step...
Ohhh... I just realized how big this post is :) Maybe I should make a blog out of this :)
|
| |
MikeD Account closed
Registered: Jan 2006 Posts: 19 |
Err... What about baddie to baddie? Dont you get that at all? If its Hires only, do you really need a MASK?
Is it hires in MCM? I use an automask so I dont need to store one.
lax (Temp+18),y ; 5*
lda (Temp+2),y ; 5
and MCMAutoMask,x ; 4
ora (Temp+18),y ; 5*
sta (Addr),y ; 6
dey ; 2 = 27 (with 7 sprites=14,616 cycles)
Little longer, but saves loads of memory - and rotation time. |
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 - Next |