|
Subject: Re: [stella] a quickie From: Piero Cavina <p.cavina@xxxxxxxxxxxxx> Date: Sat, 30 May 1998 22:55:13 +0200 |
At 23.54 29/05/98 +1000, Andrew Davie wrote:
>Further optimization tricks - this time, a pretty simple one.
Here's another, very simple too... never JMP unless you can't really avoid
it. If you know that some status bit is always 0 or 1 at that point, use a
branch instruction instead, to save a byte and some cycles. And what if
the brach is out of range? Easy: spend a couple of hours re-arranging your
time-sensitive code to make that BNE possible. It happened to me, and might
happen to you too... :)
The following one is simple but not obvious, and can turn your clean and
well commented data part of the program into a mess (I learned it from
Jim)..: "merge" the tables! ie:
BitmapShape:
.byte $AA
.byte $23
.byte $00
.byte $00
.byte $01
(..other stuff..)
ZgyzLookupTable:
.byte $00
.byte $00
.byte $01
.byte $01
.byte $02
Why not re-arrange the data in this way:
BitmapShape:
.byte $AA
.byte $23
ZgyzLookupTable:
.byte $00
.byte $00
.byte $01 ; <- end of BitmapShape
.byte $01
.byte $02
Lots of graphics data can be "compacted" in this way. Also, I ended
changing the design of some graphics so that I could compact them better,
and save some more bytes... wicked!
Ciao,
P.
--
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/stella.html
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [stella] a quickie, Nick S Bensema | Thread | [stella] Collisions, Erik Mooney |
| Re: [stella] alt.atari.2600.program, C. Linville | Date | [stella] Atari 98..., Nick S Bensema |
| Month |