|
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]
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.
|