mirror of
https://github.com/a2-4am/4cade.git
synced 2024-09-28 03:54:46 +00:00
shave some cycles
This commit is contained in:
parent
2c319823fa
commit
f750844ec6
@ -79,7 +79,6 @@ dst = $02 ; [word] used by drawing routines
|
|||||||
rowcount = $04 ; [byte] used by drawing routines
|
rowcount = $04 ; [byte] used by drawing routines
|
||||||
tmpy = $05 ; [byte] used by drawing routines
|
tmpy = $05 ; [byte] used by drawing routines
|
||||||
box = $0E ; [byte] counter in main loop
|
box = $0E ; [byte] counter in main loop
|
||||||
any = $0F ; [byte][must be at $0F] counter in main loop
|
|
||||||
BoxStages = $10 ; [$30 bytes] current stage for each box
|
BoxStages = $10 ; [$30 bytes] current stage for each box
|
||||||
auxsrc_hgrhi = $BC00 ; [$C0 bytes] HGR base addresses (hi) starting at $9000
|
auxsrc_hgrhi = $BC00 ; [$C0 bytes] HGR base addresses (hi) starting at $9000
|
||||||
hgrhi = $BD00 ; [$C0 bytes] HGR base addresses (hi) starting at $2000
|
hgrhi = $BD00 ; [$C0 bytes] HGR base addresses (hi) starting at $2000
|
||||||
@ -228,15 +227,14 @@ BoxLoop ldy BoxStages-1, x ; for each box, get its current stage
|
|||||||
lda BoxesX-1, x
|
lda BoxesX-1, x
|
||||||
ldy BoxesY-1, x ; Y = starting byte offset for this box
|
ldy BoxesY-1, x ; Y = starting byte offset for this box
|
||||||
tax ; X = starting HGR row for this box
|
tax ; X = starting HGR row for this box
|
||||||
inc any ; was initialized by the BoxStages copy loop
|
|
||||||
clc
|
clc
|
||||||
j jsr $FD00 ; [SMC] call drawing routine for this stage
|
j jsr $0000 ; [SMC] call drawing routine for this stage
|
||||||
ldx box
|
ldx box
|
||||||
NextBox dex
|
NextBox dex
|
||||||
bne BoxLoop
|
bne BoxLoop
|
||||||
lda any
|
lda j+2
|
||||||
beq + ; if we didn't draw anything in any box, we're done
|
beq + ; if we didn't draw anything in any box, we're done
|
||||||
stx any ; X=0 here
|
stx j+2 ; X=0 here
|
||||||
bit $C000 ; check for key
|
bit $C000 ; check for key
|
||||||
bpl MainLoop
|
bpl MainLoop
|
||||||
+ sta $C000 ; 80STORE off
|
+ sta $C000 ; 80STORE off
|
||||||
@ -754,6 +752,4 @@ OUTER_STAGE
|
|||||||
!if >* != >STAGE0 {
|
!if >* != >STAGE0 {
|
||||||
!error "Templates are not all on same page"
|
!error "Templates are not all on same page"
|
||||||
}
|
}
|
||||||
; Note: the final k_rts is later copied to zero page $0F and used in MainLoop,
|
|
||||||
; so don't put any more code before BoxInitialStages.
|
|
||||||
BoxInitialStages
|
BoxInitialStages
|
||||||
|
@ -77,7 +77,6 @@ src = $00 ; [word][must be at $00] used by drawing ro
|
|||||||
dst = $02 ; [word] used by drawing routines
|
dst = $02 ; [word] used by drawing routines
|
||||||
rowcount = $04 ; [byte] used by drawing routines
|
rowcount = $04 ; [byte] used by drawing routines
|
||||||
box = $0E ; [byte] counter in main loop
|
box = $0E ; [byte] counter in main loop
|
||||||
any = $0F ; [byte][must be at $0F] counter in main loop
|
|
||||||
BoxStages = $10 ; [$30 bytes] current stage for each box
|
BoxStages = $10 ; [$30 bytes] current stage for each box
|
||||||
hgrhi = $40 ; [$C0 bytes] HGR base addresses
|
hgrhi = $40 ; [$C0 bytes] HGR base addresses
|
||||||
hgrlo = $300 ; [$C0 bytes] HGR base addresses
|
hgrlo = $300 ; [$C0 bytes] HGR base addresses
|
||||||
@ -220,15 +219,14 @@ BoxLoop ldy BoxStages-1, x ; for each box, get its current stage
|
|||||||
lda BoxesX-1, x
|
lda BoxesX-1, x
|
||||||
ldy BoxesY-1, x ; Y = starting byte offset for this box
|
ldy BoxesY-1, x ; Y = starting byte offset for this box
|
||||||
tax ; X = starting HGR row for this box
|
tax ; X = starting HGR row for this box
|
||||||
inc any ; was initialized by the BoxStages copy loop
|
|
||||||
clc
|
clc
|
||||||
j jsr $FD00 ; [SMC] call drawing routine for this stage
|
j jsr $0000 ; [SMC] call drawing routine for this stage
|
||||||
ldx box
|
ldx box
|
||||||
NextBox dex
|
NextBox dex
|
||||||
bne BoxLoop
|
bne BoxLoop
|
||||||
lda any
|
lda j+2
|
||||||
beq + ; if we didn't draw anything in any box, we're done
|
beq + ; if we didn't draw anything in any box, we're done
|
||||||
stx any ; X=0 here
|
stx j+2 ; X=0 here
|
||||||
bit $C000
|
bit $C000
|
||||||
bpl MainLoop
|
bpl MainLoop
|
||||||
+
|
+
|
||||||
@ -561,8 +559,5 @@ BuildStage1And0
|
|||||||
jsr BuildDrawingRoutineFrom
|
jsr BuildDrawingRoutineFrom
|
||||||
lda #<STAGE0
|
lda #<STAGE0
|
||||||
jmp BuildDrawingRoutineFrom
|
jmp BuildDrawingRoutineFrom
|
||||||
; note: the high byte of the final JMP is later copied
|
|
||||||
; to zero page $0F and used in MainLoop, so don't put any
|
|
||||||
; more code before BoxInitialStages
|
|
||||||
|
|
||||||
BoxInitialStages
|
BoxInitialStages
|
||||||
|
@ -133,17 +133,15 @@ BoxLoop ldy <BoxStages-1, x ; for each box, get its current stage
|
|||||||
sta <j+2
|
sta <j+2
|
||||||
lda BoxesX-1, x ; A = starting SHR row for this box
|
lda BoxesX-1, x ; A = starting SHR row for this box
|
||||||
ldy BoxesY-1, x ; Y = starting byte offset for this box
|
ldy BoxesY-1, x ; Y = starting byte offset for this box
|
||||||
inc <any
|
|
||||||
clc
|
clc
|
||||||
stx <ReBox+1
|
stx <ReBox+1
|
||||||
j jsr $FD00 ; [SMC] call drawing routine for this stage
|
j jsr $0000 ; [SMC] call drawing routine for this stage
|
||||||
ReBox ldx #$00 ; [SMC]
|
ReBox ldx #$00 ; [SMC]
|
||||||
NextBox dex
|
NextBox dex
|
||||||
bne <BoxLoop
|
bne <BoxLoop
|
||||||
any=*+1
|
lda <j+2
|
||||||
lda #$00 ; [SMC]
|
|
||||||
beq <exit ; if we didn't draw anything in any box, we're done
|
beq <exit ; if we didn't draw anything in any box, we're done
|
||||||
stx <any ; X=0 here
|
stx <j+2 ; X=0 here
|
||||||
bit $C000
|
bit $C000
|
||||||
bpl MainLoop
|
bpl MainLoop
|
||||||
exit sta WRITEMAINMEM
|
exit sta WRITEMAINMEM
|
||||||
|
Loading…
Reference in New Issue
Block a user