[stella] Re: Thrust 1.0

Subject: [stella] Re: Thrust 1.0
From: "Thomas Jentzsch" <tjentzsch@xxxxxx>
Date: Thu, 3 Aug 2000 18:40:59 +0200
Andrew Davie wrote:
> Anyway, Thomas... how about it?  How about sharing those areas where you
> feel you *must* use the illegal opcodes and let those of us who are on
> higher moral ground :))  tell you why you don't need to :)

Ok, actually the score-displaying routine is the only place where i
really need the illegal opcodes.

I used them get some free time (16 cycles) for other effects. The
result is actually only a *47* pixel routine, because the right pixel
of the first and the third digit (if i remember it correct) are always
the same. That works for me, the score display has blank pixels there,
and THRUST too (except for the long T-line). Here is the result:

..digitLoop:
    nop                     ; 2  61
    nop                     ; 2  63
    nop                     ; 2  65
    nop                     ; 2  67
    nop                     ; 2  69
    nop                     ; 2  71
    nop                     ; 2  73
    nop                     ; 2  75
    lda     (digitPtr+$a),y ; 5   4
    sta     GRP0            ; 3   7
    lda     (digitPtr+$8),y ; 5  12
    sta     GRP1            ; 3  15
    lda     (digitPtr+$6),y ; 5  20
    sta     GRP0            ; 3  23
    lax     (digitPtr+$0),y ; 5  28     illegal
    txs                     ; 2  30
    lax     (digitPtr+$4),y ; 5  35     illegal
    lda     (digitPtr+$2),y ; 5  40
    stx     GRP1            ; 3  43
    sta     GRP0            ; 3  46
    tsx                     ; 2  48
    stx     GRP1            ; 3  51
    sty     GRP0            ; 3  54
    dey                     ; 2  56
    bpl     .digitLoop      ; 2³ 59

As you can see, i saved the time by using LAX and the stack pointer.

Then i added the color-scrolling effect, wasted some time (AND, TYA) to
get the code working for my needs, and that's how it looks like now:

..digitLoop:
    dey                     ; 2  61
    lda     (digcolPtr),y   ; 5  66
    and     digcolMask      ; 3  69
    sta     COLUP0          ; 3  72
    sta     COLUP1          ; 3  75
    lda     (digitPtr+$a),y ; 5   4
    sta     GRP0            ; 3   7
    lda     (digitPtr+$8),y ; 5  12
    sta     GRP1            ; 3  15
    lda     (digitPtr+$6),y ; 5  20
    sta     GRP0            ; 3  23
    lax     (digitPtr+$0),y ; 5  28     illegal
    txs                     ; 2  30
    lax     (digitPtr+$4),y ; 5  35     illegal
    lda     (digitPtr+$2),y ; 5  40
    stx     GRP1            ; 3  43
    sta     GRP0            ; 3  46
    tsx                     ; 2  48
    stx     GRP1            ; 3  51
    sty     GRP0            ; 3  54
    tya                     ; 2  56
    bne     .digitLoop      ; 2³ 59     when loop ends: y=0

There are a few other places in the code where i saved some bytes and
cycles with illegal opcodes (LAX to get a value in two registers, a
long NOP instead of BIT to skip one instruction and keep the flags,...),
but i could make them legal again.

Thomas Jentzsch         | *** Every bit is sacred ! ***
tjentzsch at web dot de |
_______________________________________________________________________
1.000.000 DM gewinnen - kostenlos tippen - http://millionenklick.web.de
IhrName@xxxxxx, 8MB Speicher, Verschluesselung - http://freemail.web.de


--
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/

Current Thread