Search site Dead Hackers Society
Other BBSes »

Outline 2019

Sommarhack 2019
Demoscene   º   Coding   º   CT60   º   Buy/sell   º   Misc/crap   º   Alive magazine   º   SNDH/Tracking

Atari coding BBS
Re: Compiled sprites madness!
Posted by: Leonard Jun,13.2016-21:44 

I love generated code!

Yes you have to do all stuff you mention. let's call the AND value "mask" and the OR value "or"

trivial case is if "or" = 0 then you can skip ORG
trivial case 2: if "mask" = 0 then you can use MOVE instead of pair AND/OR
more subtil case: if ("mask" | "or" == ffffffff) then you can avoid the AND instruction (just keep the OR)

then you can optimize some part of the code, for instance, instead of:

and.l #$n,(a0) ;7
or.l #$xxxx0000,(a0)+ ;7 (total 14)

better use:

and.l #$n,(a0) ;7
ori.w #$xxxx,(a0)+ ;4
addq.w #2,a0 ;2 (total 13)

and even better:

and.l #n,(a0)+ ;7
ori.w #$xxxx,-4(a0) ;5 (total 12)

the most efficient optim is your point 5) (use data registers). You can use adress register too for MOVE instructions.

A new idea I never implemented myself is that you can change sprite lines display order to maximize data register usage.

last but not least, you can optimize things like that:

andi.l #$ff00ff00,(a0) ;7
or.l #$00xx00yy,(a0)+ ;7
andi.l #$ff00ff00,(a0) ;7
or.l #$00zz00ww,(a0)+ ;7 (total 28)


move.l #$xxyyzzww,dn ; 3
movep.l dn,1(a0) ; 6
addq.w #8,a0 ; 2 (total 11)

[All messages in this thread]

Topic Posted by  Date 
Compiled sprites madness! ggn Jun,10.2016-18:05
  Re: Compiled sprites madness! Leonard Jun,13.2016-21:44
    Re: Compiled sprites madness! ggn Jun,13.2016-22:30
    Re: Compiled sprites madness! deez Jun,15.2016-10:15
      Re: Compiled sprites madness! PeP Jun,15.2016-20:36
      Re: Compiled sprites madness! Alien / ST-CNX Jun,16.2016-02:54
        Re: Compiled sprites madness! specter Jun,16.2016-08:32

Reply to this message
Human verification (enter the text of the ASCII-art below):

   _   _   _   _  _  _        _  
 _|_ _|_ _|_ _|_ (_)  ) |_|_ / \ 
  |   |   |   |  (_) /_   |  \_/

© 1994-2019 Dead Hackers Society Contact: Anders Eriksson