Overview Features Coding ApolloOS Performance Forum Downloads Products Contact Goto
Apollo-Computer

Welcome to the Apollo Forum

This forum is for people interested in the APOLLO CPU.
Please read the forum usage manual.
Please visit our Apollo-Discord Server for support.



All TopicsNewsPerformanceGamesDemosApolloVampireAROSWorkbenchATARIReleases
Information about the Apollo CPU and FPU.

Coding Example : Super Fast SDL Sprite Routine

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
 

 
 


Ian Parsons

Posts 230
22 Mar 2016 03:48


BSEL has been redefined to use 3 source operands and a 4th operand for destination?

PCMP is a new parallel instruction already in Apollo?


Samuel Crow

Posts 424
24 Mar 2016 09:13


Ian Parsons wrote:

BSEL has been redefined to use 3 source operands and a 4th operand for destination?
 
  PCMP is a new parallel instruction already in Apollo?

These are only the start!  A whole contingent of 64-bit parallel opcodes are planned!

posts 3