Gunnar von Boehn (Apollo Team Member) Posts 6254 21 Mar 2016 19:38
| Here is an example how to get Sprite Routines, like for example used by SDL, super fast. Super fast means here ~ 100 times faster than Bob routines on Classic Amiga. :-) In other words Sprite copy with 400 MB/sec These SDL Sprite routines use Chunky Pixel But need to support MASKING operation e.g. transparent pixels. We show here a simple Code example which does this very efficient. Lets say SPRITE-SRC-PRT in A0 Lets say SCREEN-PRT in A1 Lets say D0=$0 Lets say D7 = 64bit words to copy per row For optimal speed Screen-PTR should be aligned to LONG, SRC-POINTER does not need to be aligned as APOLLO can correct misaligned reads for free. LOOPX: MOVE.Q (A0)+,D1 ; load 8 pixel (each 256 color) PCMPeq.B D0,D1,D2 ; check for background pixel, create mask BSEL D2,(A1),D1,D3 ; load background and combine bytes MOVE.Q D3,(A1)+ DBF D7,LOOPX
|