diff --git a/basic/appleiibot/Makefile b/basic/appleiibot/Makefile index cfc7dddd..d755560d 100644 --- a/basic/appleiibot/Makefile +++ b/basic/appleiibot/Makefile @@ -22,7 +22,7 @@ appleiibot.dsk: E2.BAS FLAME.BAS FLAME2.BAS HELLO \ OVAL.BAS OVAL_HGR.BAS MOVING.BAS THICK_SINE.BAS TURKEY.BAS \ FLAME_HGR.BAS RECT.BAS SNOWY.BAS EDGAR.BAS OOPS4.BAS OOPS3.BAS \ HORROR.BAS DIAMOND.BAS LEMM.BAS OOPS.BAS SPLIT.BAS PARTICLE.BAS \ - PARTICLE_HGR.BAS + PARTICLE_HGR.BAS DIAMOND_SCROLL.BAS # cp $(EMPTY_DISK)/empty.dsk appleiibot.dsk cp empty.dsk appleiibot.dsk $(DOS33) -y appleiibot.dsk BSAVE -a 0x0300 LOAD @@ -119,6 +119,7 @@ appleiibot.dsk: E2.BAS FLAME.BAS FLAME2.BAS HELLO \ $(DOS33) -y appleiibot.dsk SAVE A SPLIT.BAS $(DOS33) -y appleiibot.dsk SAVE A PARTICLE.BAS $(DOS33) -y appleiibot.dsk SAVE A PARTICLE_HGR.BAS + $(DOS33) -y appleiibot.dsk SAVE A DIAMOND_SCROLL.BAS #### @@ -672,5 +673,10 @@ PARTICLE_HGR.BAS: particle_hgr.bas #### +DIAMOND_SCROLL.BAS: diamond_scroll.bas + $(TOKENIZE) < diamond_scroll.bas > DIAMOND_SCROLL.BAS + +#### + clean: rm -f *~ *.o *.lst convert_to convert_from convert_qkumba convert_vmw make_boxes convert_back convert_tgreene LOAD *.BAS make_hgr_boxes diff --git a/basic/appleiibot/diamond_scroll.bas b/basic/appleiibot/diamond_scroll.bas new file mode 100644 index 00000000..f110a725 --- /dev/null +++ b/basic/appleiibot/diamond_scroll.bas @@ -0,0 +1,2 @@ +1FORI=0TO140:POKE875+I,4*PEEK(2125+I)-204+(PEEK(2266+I/3)-35)/4^(I-INT(I/3)*3):NEXT +2&"/@q 8 0100 1000 eor $C +page_smc: + lda #$4 ; reset to beginning + sta inner_loop_smc+2 + + lda #8 ; lines to count (*3=24) + sta LINE + + ;============================ + ; draw an interleaved line + +line_loop: + ldx #119 + +screen_loop: + + txa ; extrapolate Y from X + and #$7 + tay + +pattern_smc: + lda pattern1,Y + +inner_loop_smc: + sta $400,X + + dex + bpl screen_loop + + ;================================= + ; move to next pattern + ; assume we are in same 256 byte page (so high byte never change) + + jsr scroll_pattern + + ; move to next line + + clc + lda inner_loop_smc+1 + adc #$80 + sta inner_loop_smc+1 ; FIXME just inc if carry set + bcc noflo + inc inner_loop_smc+2 +noflo: + + dec LINE + bne line_loop + + ;======================================= + ; done drawing frame + ;======================================= + + ; draw line pattern + + lda #$0F ; white bar + ldx #21 +draw_line_loop: + +dll_smc: + sta $430,X ; partway down screen + dex + bne draw_line_loop + + + ;========================= + ; scroll one line + + jsr scroll_pattern + + ; switch page + lda page_smc+1 + eor #$c + sta page_smc+1 + sta dll_smc+2 + ; is 4 or 8 + lsr + lsr ; now 0 or 1 (C is 1 or 0) + and #$1 + tax + lda PAGE1,X + + lda #200 + jsr WAIT + + ; A is 0 after + + beq hexagon_loop + + +scroll_pattern: + clc + lda pattern_smc+1 + adc #8 + cmp #( 8 0100 1000 eor $C +page_smc: + lda #$4 ; reset to beginning + sta inner_loop_smc+2 + + lda #8 ; lines to count (*3=24) + sta LINE + + ;============================ + ; draw an interleaved line + +line_loop: + ldx #119 + +screen_loop: + + txa ; extrapolate Y from X + and #$7 + tay + +pattern_smc: + lda pattern1,Y + +inner_loop_smc: + sta $400,X + + dex + bpl screen_loop + + ;================================= + ; move to next pattern + ; assume we are in same 256 byte page (so high byte never change) + + jsr scroll_pattern + + ; move to next line + + clc + lda inner_loop_smc+1 + adc #$80 + sta inner_loop_smc+1 ; FIXME just inc if carry set + bcc noflo + inc inner_loop_smc+2 +noflo: + + dec LINE + bne line_loop + + ;======================================= + ; done drawing frame + ;======================================= + + ; draw line pattern + + lda #$0F ; white bar + ldx #21 +draw_line_loop: + +dll_smc: + sta $430,X ; partway down screen + dex + bne draw_line_loop + + + ;========================= + ; scroll one line + + jsr scroll_pattern + + ; switch page + lda page_smc+1 + eor #$c + sta page_smc+1 + sta dll_smc+2 + ; is 4 or 8 + lsr + lsr ; now 0 or 1 (C is 1 or 0) + and #$1 + tax + lda PAGE1,X + + lda #200 + jsr WAIT + + ; A is 0 after + + beq hexagon_loop + + +scroll_pattern: + clc + lda pattern_smc+1 + adc #8 + cmp #(