Re: [stella] Qb: BETA 1.0

Subject: Re: [stella] Qb: BETA 1.0
From: Thomas Jentzsch <tjentzsch@xxxxxx>
Date: Fri, 2 Mar 2001 23:54:44 +0100
At 02.03.2001, 14:25, Andrew Davie wrote:
> I have about 4 bytes free, so if
> you see some savings let me know!  Thanks to those who have recently posted
> optimisations - I will get to those shortly, if I haven't already done so.

Ok, here are some more suggestions... (all rights
reserved:)

1. There are several subroutines (SetFrame,
CountDown...), where you can do something like this:

SoundOff
    ldy #SOUND_OFF
    .byte   $2c             ; bit.w
SoundSliding
    ldy #SOUND_SLIDING
Sound


2. Replace:
    lda #0
    jsr CountDown

   With:
    jsr CountDown0
    ...
    
    bne NotEnd
CountDown0:
    clc
    lda PlayerCounter,x
    ...


3. move DoAI directly behind ChangeCreature and
eliminate jmp (this should be possible for other
subroutines too)


4.  jsr MBlock
;    lda #0
    sta PF0                 ; MBlock returns a=0

If you document the state of registers and flags when
returning you might find some more.


5. in SetupBottomScore change:
        lda level
        lsr
        lsr
        lsr
        lsr
        lsr
;        clc
;        adc #1
;        sta S5
        tax
        inx
        stx S5                  


6. in PointsInit change:
        lda PlayerFlags,x
        and #%1110                      ; frame
;        tay
;        lda Point,y
;        pha
;        lda Point+1,y
;        tay
;        pla
        tax
        lda Point,x
        ldy Point+1,x

7. it should be possible to replace some jumps with
branches, some code rearrangement should help there
too.

8. there are some place where you could eliminate rts.
   Example:

NotSameC
        cmp #1                          ; 0 = carry C -> collision, else no collision
Incomplete
        rts

WrapUp

                ; If the grid is complete (checked during MoveCube) then the player is informed

        ldx MC_Complete
        bne Incomplete
        lda #MODE_PLAYER_LOCK+10
;        jsr ChangeMode                  ; lock for completion (X=0)
        jmp ChangeMode                  ; lock for completion (X=0)

;Incomplete
;        rts


9. exchange x and y here:
ZapPF   sta playfield,y
        sta playfield+PFC,y
        stx playfield+PFC+PFC,y
        dey
        bpl ZapPF


10: replace:
MTADone
;->64
        ldx #3
        jsr MBlock
        jsr MBlock
        jsr MBlock
        jsr MBlock
        
   with:
        jsr MB4a

        
> But now, I think things are getting pretty tight :)

Yes, I think there aren't many more byte optimizations
left. Maybe with some redesign of larger parts of code
you could get some more bytes, but it's much easier for
you to find out. 

        
Have fun!
Thomas                            
_______________________________________________________
Thomas Jentzsch         | *** Every bit is sacred ! ***
tjentzsch at web dot de |



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

Current Thread