My working routine for an aligned 32x32 sprite with a mask (R0 = screen address, R1=sprite, R2=mask) does something like
Code: Select all
LDMIA R0,{R3-R6}
LDMIA R2!,{R7-R10}
BIC R3,R3,R7
BIC R4,R4,R8
BIC R5,R5,R9
BIC R6,R6,R10
MVN R7,R7 : MVN R8,R8 : MVN R9,R9 : MVN R10,R10
LDMIA R1!,{R11-R14}
BIC R11,R11,R7 : BIC R12,R12,R8 : BIC R13,R13,R9 : BIC R14,R14,R10
ORR R3,R3,R11 : ORR R4,R4,R12 : ORR R5,R5,R13 : ORR R6,R6,R14
STMIA R0,{R3-R6}
ADD R0,R0,#160
Elsewhere I've seen routines that plot masked sprites either just using ANDs followed by ORRs (I can't work out how this would work) or BICs like me, but then the four ORRs but no MVN (flipping the mask) and BICs in the middle. Neither approach works when I try it.
Are those other routines only appropriate to MODE 13, using a different kind of mask from !Paint or employing some other tactic I've failed to understand?
Cheers!