Support Forum

Please or Register to create posts and topics.

More than 64 sprite patterns. How?

Hi!

I'm testing some idea for my project. I need a quite big character in it - its size is 32x48 pixels. I use 2x6 hardware sprites so for a 10-frames "walk right" animation I use 60 patterns. For "walk-left" animation i use flip option but still I need more patterns for other animations so I'm thinking how to use bank switching with sprite system.

In the code I have something like that:

MMU8(6,0)
LoadSD("pack.SPR",49152,16384,0)
InitSprites(64,49152)

MMU8(6,32)
LoadSD("pack2.SPR",49152,16384,0)

InitSprites(64,49152)

and during runtime I switch banks to use needed pack:

MMU8(6,32) :    UpdateSprite(X,Y,id,pat,dir)

ELSE

MMU8(6,0) :    UpdateSprite(X,Y,id,pat,dir)

but it doesn't work correctly. Is it a proper way of thinking or should I do it differently?

[EDIT]

I'm digging ZXS NEXT documentation... so we can have 64 sprites, 64 settings and 64 patterns and all that stuff is stored in separated memory... so it's impossible to change patterns runtime. Am I right?

[EDIT 2]

I should read a manual first 😉 Anyway - I found how to switch main/shadow screen I started to write my own sprite system so I can render what I want in the background and I can use as many banks as I need. Still excited 🙂

Uploaded files:
  • BlackR1.jpg
  • BlackR2.jpg
DarkTrancer has reacted to this post.
DarkTrancer