[stella] zero page 6-digit routine

Subject: [stella] zero page 6-digit routine
From: Robin Harbron <macbeth@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 26 Mar 1998 13:38:54 -0500
I'm sure this has been done before, but I did it
just to try - ends up leaving 13 cycles free per
scanline, again, I don't see the point in wasting
time with a wsync in this sort of routine.

6 cycles were saved by using regular indexing
instead of indirect indexing... another 4 were
saved over my original routine because I could
load directly into x : LDX $FFFF,Y instead of
having to load it into A then transferring it.

So, what can be done with these spare 13 cycles? :)


;This routine is meant to be copied and run in
;zero page.  selfx labels indicate where the
;self-modifying code is.

         tsx
         stx temps

zeroloop ldy count1  ;3
self0    lda $ffff,y ;4
         sta grp0    ;3 = 10

	;waste 13 cycles
         bit $00
         bit $00
         bit $00     ;9
         nop
         nop         ;4

self1    lda $ffff,y ;4
         sta grp1    ;3
self5    ldx $ffff,y ;4        
         txs         ;2
self2    lda $ffff,y ;4
         sta tmp     ;3
self3    ldx $ffff,y ;4 
self4    lda $ffff,y ;4

         ldy tmp     ;3
         sty grp0    ;3
         stx grp1    ;3
         sta grp0    ;3
         tsx         ;2
         stx grp1    ;3

         dec count1  ;5
         bpl zeroloop;3

         ldx temps
         txs
         rts
-- 
Robin Harbron  <macbeth@xxxxxxxxxxx>
   http://www.tbaytel.net/macbeth

Attachment: test.bin
Description: Binary data

Current Thread