Dead Hackers Society
Other BBSes »
 
 

68k Inside

Sommarhack 2024

Silly Venture 2024 SE
Demoscene  Coding  CT60  Buy/sell

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)

by:

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
















[All messages in this thread]    [Start new 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
Name:
Topic:
Anti-troll code:

Message:

What's the anti-troll code?
That's your personal code to be able to add comments and messages on the dhs.nu site.
Don't have a code or forgot it? Fix it here.
© 1994-2024 Dead Hackers Society Contact: Anders Eriksson