PDA

Click to See Complete Forum and Search --> : Masks?


invitro
Jun 18th, 2002, 06:12 PM
What is the best way to animate sprites... without using keyboard characters?!

My friend along time ago use to use a XOR mask... each character was stored in afile... that looekd like

0 0 1 0 0
0 1 0 1 0
0 1 0 1 0
0 0 1 0 0

where each 1 would be the color that was read, and inputed with PSET.

Anyone hird of this method?

jian2587
Jul 29th, 2002, 07:08 AM
You write them to a file, then read them into an array
Then you test each byte, if its a zero, dont draw it, else, pset it

invitro
Jul 29th, 2002, 05:11 PM
Ohhh ya its all coming back to me, thank you!
..I just thought there was something elsem ore to it... hmmm... isent psetting the values every time a slow process?

jian2587
Jul 31st, 2002, 07:27 AM
What's really slow is testing it for zero, not pset
HOwever, u can speed things up further by using poke
'Example
DEF SEG = &HA000
FOR I& = 0 TO 65535
POKE I&,INT(RND*255)
NEXT
DEF SEG

This is still very slow, try using ASM codes

FYI, indeed u need to pset every bit, if u need to use MASK
Otherwise, you could just move them in blocks to the destination

You could use REP MOVSD in ASM codes to move them
quickly