bubble_gr: more size work

This commit is contained in:
Vince Weaver 2024-05-03 02:15:06 -04:00
parent 8a39749d2f
commit d360e8e4d6
2 changed files with 37 additions and 45 deletions

View File

@ -7,13 +7,15 @@ EMPTY_DISK = ../../../empty_disk
all: bubble_gr.dsk make_table
bubble_gr.dsk: HELLO BUBBLE_GR BUBBLE_COLOR BUBBLE_SMALL BUBBLE_TINY
bubble_gr.dsk: HELLO BUBBLE_GR BUBBLE_COLOR BUBBLE_SMALL BUBBLE_TINY \
COOL_LINES
cp $(EMPTY_DISK)/empty.dsk bubble_gr.dsk
$(DOS33) -y bubble_gr.dsk SAVE A HELLO
$(DOS33) -y bubble_gr.dsk BSAVE -a 0x2000 BUBBLE_GR
$(DOS33) -y bubble_gr.dsk BSAVE -a 0x2000 BUBBLE_COLOR
$(DOS33) -y bubble_gr.dsk BSAVE -a 0x2000 BUBBLE_SMALL
$(DOS33) -y bubble_gr.dsk BSAVE -a 0x2000 BUBBLE_TINY
$(DOS33) -y bubble_gr.dsk BSAVE -a 0x2000 COOL_LINES
###
@ -54,6 +56,15 @@ bubble_tiny.o: bubble_tiny.s
###
COOL_LINES: cool_lines.o
ld65 -o COOL_LINES cool_lines.o -C $(LINKER_SCRIPTS)/apple2_2000.inc
cool_lines.o: cool_lines.s
ca65 -o cool_lines.o cool_lines.s -l cool_lines.lst
###
make_table: make_table.o
$(CC) $(LFLAGS) -o make_table make_table.o
@ -64,6 +75,6 @@ make_table.o: make_table.c
clean:
rm -f *~ *.o *.lst make_table \
HELLO BUBBLE_GR BUBBLE_COLOR BUBBLE_SMALL BUBBLE_TINY
HELLO BUBBLE_GR BUBBLE_COLOR BUBBLE_SMALL BUBBLE_TINY COOL_LINES

View File

@ -25,6 +25,9 @@
; 264 bytes = add sound (urgh)
; 265 bytes = fix colors
; 263 bytes = waste a lot of time optimizing color lookup table
; 259 bytes = undo self modifying code
; 247 bytes = remove extra cosine table
; 245 bytes = minor fixes
; soft-switches
@ -56,9 +59,8 @@ INH = $FD
sines = $6c00
sines2 = $6d00
; must be page aligned :(
cosines = $6e00
cosines2= $6f00
cosines = $6cc0
;cosines2= $6f00
color_map = $1000
@ -186,31 +188,29 @@ setup_sine_loop:
; X is $FF here?
inx
stx COLOR ; $FF (color white)
; ldx #0
cosine_loop:
lda sines+192,X
sta cosines,X
sta cosines2,X
inx
bne cosine_loop
; X is 0 here?
;=======================
; init variables
;=======================
;
; 245
txa
ldx #$30
init_loop:
sta $D0,X
dex
bne init_loop
; lda #0
stx U
stx V
stx T
dex ; Y=$FF (color white)
stx COLOR
; stx U
; stx V
; stx T
; stx INL
;=========================
;=========================
@ -218,41 +218,31 @@ cosine_loop:
;=========================
;=========================
; in theory Y=0 from previous loop, but not init above?
next_frame:
; reset I*T
lda T
; sta it1_smc+1
; sta it2_smc+1
sta IT
; reset I*S
lda #0
; sta is1_smc+1
; sta is2_smc+1
sta IS
num1_smc:
lda #13 ; 13
sta I
i_loop:
num2_smc:
lda #$18 ; 24
sta J
j_loop:
; ldx U
; ldy V
; where S=41 (approximately 1/6.28)
bit SPEAKER ; click speaker
; where S=41 (approximately 1/6.28)
; calc: a=i*s+v;
; calc: b=i+t+u;
; u=sines[a]+sines[b];
@ -277,8 +267,6 @@ j_loop:
adc sines,X ; 4+
sta U ; 3
bit SPEAKER ; click speaker
;===========================================================
@ -312,19 +300,13 @@ no_plot:
bne j_loop
done_j:
; lda is1_smc+1
lda IS
clc
lda IS
adc #41 ; 1/6.28 = 0.16 = 0 0 1 0 1 0 0 0 = 0x28
; sta is1_smc+1
; sta is2_smc+1
sta IS
dec I
bne i_loop
done_i:
; sty V
inc T
end:
@ -333,7 +315,6 @@ end:
; cycle colors
ldy #$0 ; 2
sty INL ; 2
lda #4 ; 2
sta INH ; 2
cycle_color_loop:
@ -351,8 +332,8 @@ cycle_color_loop:
lda INH ; 2
cmp #$8 ; 2
bne cycle_color_loop ; 2
; beq next_frame ; bra ; 2
jmp next_frame
beq next_frame ; bra ; 2
; jmp next_frame
; half as many points