diff --git a/src/fx/fx.hgr.48boxes.common.a b/src/fx/fx.hgr.48boxes.common.a index dbaeb3ccd..519d03fd8 100644 --- a/src/fx/fx.hgr.48boxes.common.a +++ b/src/fx/fx.hgr.48boxes.common.a @@ -67,11 +67,15 @@ ; 1F |FFFFFFF|FFFFFFF|FFFFFFF|FFFFFFF|FFFFFFF ; +!ifndef USES_CLEAR { + USES_CLEAR = 1 +} + src = $00 ; [word][must be at $00] used by drawing routines dst = $02 ; [word] used by drawing routines -box = $04 ; [byte] counter in main loop -rowcount = $05 ; [byte] used by drawing routines -any = $0D ; [byte][must be at $0D] counter in main loop +rowcount = $04 ; [byte] used by drawing routines +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 hgrhi = $40 ; [$C0 bytes] HGR base addresses hgrlo = $300 ; [$C0 bytes] HGR base addresses @@ -190,10 +194,11 @@ k_right_mask = 17 ; X=0 here +BUILD_HGR_LOOKUP_TABLES_X_IS_ALREADY_0 hgrlo, hgrhi - ; any (zero page $0D) was initialized by the BoxStages copy loop + ; any was initialized by the BoxStages copy loop MainLoop ldx #48 BoxLoop stx box ldy BoxStages-1, x ; for each box, get its current stage + inc BoxStages-1, x ; increment every box's stage every time through the loop lda StagesHi, y beq NextBox ; if stage's drawing routine is 0, nothing to do sta j+2 @@ -204,109 +209,14 @@ BoxLoop stx box clc j jsr $FD00 ; [SMC] call drawing routine for this stage ldx box -NextBox inc BoxStages-1, x ; increment every box's stage every time through the loop, - ; even if we didn't call a drawing routine - dex +NextBox dex bne BoxLoop lda any beq + ; if we didn't draw anything in any box, we're done stx any ; X=0 here bit $C000 bpl MainLoop -+ rts - -GenerateStages - ; copy codegen data to zero page - ; X=0 here -- lda CODEGEN_COPY_START, x - sta $00, x - inx - bne - - - ; generate drawing routines for copy01, then copy00 - jsr GenerateStage1And0 - ; A=0 here - sta