diff --git a/graphics/hgr/bubble_universe/Makefile b/graphics/hgr/bubble_universe/Makefile index b3b3a7e1..8b4f0a38 100644 --- a/graphics/hgr/bubble_universe/Makefile +++ b/graphics/hgr/bubble_universe/Makefile @@ -39,7 +39,7 @@ bubble.o: bubble.s hgr_clear_part.s sin_unrolled.s BUBBLE_TINY: bubble_tiny.o ld65 -o BUBBLE_TINY bubble_tiny.o -C $(LINKER_SCRIPTS)/apple2_c00.inc -bubble_tiny.o: bubble_tiny.s hgr_clear_part.s sin_unrolled.s hgr_clear_codegen.s +bubble_tiny.o: bubble_tiny.s hgr_clear_codegen.s ca65 -o bubble_tiny.o bubble_tiny.s -l bubble_tiny.lst ### diff --git a/graphics/hgr/bubble_universe/bubble_tiny.s b/graphics/hgr/bubble_universe/bubble_tiny.s index 2aea9ddd..4b436876 100644 --- a/graphics/hgr/bubble_universe/bubble_tiny.s +++ b/graphics/hgr/bubble_universe/bubble_tiny.s @@ -16,6 +16,7 @@ ; 2326 bytes -- alignment turned off ; 2311 bytes -- optimize mod table generation ; 1447 bytes -- first attempt at hgr_clear codegen +; 1443 bytes -- tail call optimization ; soft-switches @@ -290,7 +291,6 @@ hposn_low = $6b00 hgr_make_tables: - ;===================== ; make /7 %7 tables ;===================== @@ -300,10 +300,9 @@ hgr_make_7_tables: lda #0 tax tay - div7_loop: sta div7_table,Y -mod_smc: +mod7_smc: stx mod7_table inx @@ -315,25 +314,11 @@ mod_smc: ldx #0 div7_not7: - inc mod_smc+1 ; assume on page boundary + inc mod7_smc+1 ; assume on page boundary iny bne div7_loop -; ldy #0 -; lda #0 -;mod7_loop: -; sta mod7_table,Y -; clc -; adc #1 -; cmp #7 -; bne mod7_not7 -; lda #0 -;mod7_not7: -; iny -; bne mod7_loop - - ; Hposn table ; hposn_low, hposn_high will each be filled with $C0 bytes diff --git a/graphics/hgr/bubble_universe/hgr_clear_codegen.s b/graphics/hgr/bubble_universe/hgr_clear_codegen.s index 83c3df52..a5dbcfda 100644 --- a/graphics/hgr/bubble_universe/hgr_clear_codegen.s +++ b/graphics/hgr/bubble_universe/hgr_clear_codegen.s @@ -6,7 +6,7 @@ hgr_clear_codegen: ;======================== ; set up output pointers - lda #<(hgr_page1_clearscreen) + lda #<(hgr_page1_clearscreen) ; assume both start page boundary sta OUTL sta INL @@ -29,7 +29,7 @@ hgr_clear_codegen_loop: lda #$99 ; STA jsr write_both - lda hposn_low,X + lda hposn_low,X ; low is same both jsr write_both lda hposn_high,X @@ -77,9 +77,11 @@ hgr_clear_codegen_loop: lda #$60 ; RTS - jsr write_both +; jsr write_both - rts ; tail call +; rts ; tail call + + ; fallthrough ;=============================