diff --git a/demos/lovebyte2023/1k/Makefile b/demos/lovebyte2023/1k/Makefile index f50df221..891553a0 100644 --- a/demos/lovebyte2023/1k/Makefile +++ b/demos/lovebyte2023/1k/Makefile @@ -45,7 +45,7 @@ BLUE_FLAME: blue_flame.o ld65 -o BLUE_FLAME blue_flame.o -C $(LINKER_SCRIPTS)/apple2_8000.inc blue_flame.o: blue_flame.s \ - letters.s zp.inc \ + letters.s flame.s zp.inc \ ay3_write_regs.s interrupt_handler.s play_frame.s \ SmallLove2.s mockingboard_constants.s mockingboard_init.s \ tracker_init.s diff --git a/demos/lovebyte2023/1k/blue_flame.s b/demos/lovebyte2023/1k/blue_flame.s index 601b532d..caf2c593 100644 --- a/demos/lovebyte2023/1k/blue_flame.s +++ b/demos/lovebyte2023/1k/blue_flame.s @@ -4,14 +4,31 @@ ; Lovebyte 2023 -; Zero Page - .include "zp.inc" - .include "hardware.inc" + +; TODO: +; line border? +; DEMO OVER message, zooming from angle? + +; COOL_PATTERN? (140) +; WEB? (140) +; BOXES (68) ??? +; SIER/SIERFAST (140) +; MIRROR (140) +; THICK_LINES (88) +; RAINBOW SQUARES (106) +; THICK (113) *** +; WIRES (91) +; STAGGERED (60) +; STATIC_COLUMN (44) *** + +.include "zp.inc" +.include "hardware.inc" blue_flame: ; clear both pages of graphics + jsr HGR jsr HGR2 ; A and Y are 0 now? @@ -31,9 +48,15 @@ blue_flame: cli ; enable music + jsr do_letters + + jsr flames + +end: + jmp end + +.include "flame.s" .include "letters.s" - - .include "interrupt_handler.s" .include "mockingboard_constants.s" diff --git a/demos/lovebyte2023/1k/flame.s b/demos/lovebyte2023/1k/flame.s new file mode 100644 index 00000000..d85f107c --- /dev/null +++ b/demos/lovebyte2023/1k/flame.s @@ -0,0 +1,189 @@ +; flames -- Apple II Hires + + +flames: + + ;================================================== + ; clear both graphics screens, set to display page1 + +; jsr HGR +; jsr HGR2 +; bit PAGE1 ; display page1 while leaving $E6 set to page2 + + lda #$20 + sta HGR_PAGE + + ;============================================= + ; setup (draw white line at bottom of screen) + + ldx #39 + lda #$f +white_line_loop: +; sta $5FD0,X + sta $3FD0,X + dex + bpl white_line_loop + + + ;==================== + ;==================== + ; main loop + ;==================== + ;==================== + + + +fire_loop: + + ; first time through loop, X = FF + ; other times through loop, X = 192 + + + ;==================== + ; move fire + ;==================== +move_fire: + ldx #191 ; start at bottom of screen +burn_loop: + txa + jsr HPOSN ; puts addr of line in A into GBASL:GBASH + + lda GBASL ; put the line address into input + sta BASL + lda GBASH + sta BASH + + ; input now in GBASL:GBASH + + ldx HGR_X ; restore X + dex ; point to line above + txa ; put in A + jsr HPOSN ; put addr of line in A into GBASL:GBASH + + ; output now in GBASL:GBASH + + ldy #39 ; 39 columns across screen +burn_inner: + +random_smc: + lda $E000 ; our "RANDOM" numbers + +; and #$1 +; bne dont_invert_dex + + bpl dont_invert_dex ; is top bit random enough? + + lda dex_smc + eor #$20 + sta dex_smc + +dont_invert_dex: + +;burn_in_smc: + lda (BASL),Y + tax +; ldx $4000,Y + beq skip_if_zero + +dex_smc: ; DEX = $CA, NOP = $EA + dex + +skip_if_zero: + txa +;burn_out_smc: +; sta $4000,Y + sta (GBASL),Y + + inc random_smc+1 ; update "RNG" + bne no_oflo + inc random_smc+2 + bne no_oflo + lda #$d0 + sta random_smc+2 +no_oflo: + + + + + dey + bpl burn_inner + + ldx HGR_X ; finish early as top of screen empty + cpx #150 + bne burn_loop + + ;==================== + ; copy to visible + +copy_to_page1: + + ; X should already be 150 here +; ldx #150 ; only on bottom of screen + +copy_loop: + txa + jsr HPOSN ; puts addr of line in A into GBASL:GBASH + + lda GBASL + sta BASL +; sta copy_inner_smc+1 + lda GBASH + eor #$60 ; flip to page 1 + sta BASH +; sta copy_inner_smc+2 + + ldy #39 +copy_inner: + lda (GBASL),Y + tax + lda color_lookup,X + +; sec ; or ora $80? +ror_smc: +; ror ; ROR = $6A 0110 1010 + ; NOP = $EA 1110 1010 + +copy_inner_smc: + sta (BASL),Y + +; lda ror_smc +; eor $80 +; sta ror_smc + + dey + bpl copy_inner + + ldx HGR_X + inx + cpx #192 + bne copy_loop + + ;==================== + ; loop forever + + beq fire_loop ; bra + + + + ;===================== + + + +color_lookup: + .byte $00 ; 1 0 00 00 00 BBBB 0 + .byte $84 ; 1 0 00 01 00 BB0B 1 + .byte $90 ; 1 0 01 00 00 BOBB 2 + .byte $81 ; 1 0 00 00 01 BBBO 3 + .byte $91 ; 1 0 01 00 01 BOBO 4 + .byte $C4 ; 1 1 00 01 00 OBOB 5 + .byte $D1 ; 1 1 01 00 01 OOBO 6 + .byte $DA ; 1 1 01 01 01 OOOO 7 + .byte $F5 ; 1 1 11 01 01 OWOO 8 + .byte $DD ; 1 1 01 11 01 WOWO 9 + .byte $FE ; 1 1 11 01 11 OWOW 10 + .byte $DF ; 1 1 01 11 11 OOWW 11 + .byte $F5 ; 1 1 11 01 01 WWOO 12 + .byte $FD ; 1 1 11 11 01 WWWO 13 + .byte $DF ; 1 1 01 11 11 WOWW 14 + .byte $ff ; 1 1 11 11 11 WWWW 15 + diff --git a/demos/lovebyte2023/1k/letters.s b/demos/lovebyte2023/1k/letters.s index f59cfe5d..ba2dc083 100644 --- a/demos/lovebyte2023/1k/letters.s +++ b/demos/lovebyte2023/1k/letters.s @@ -1,47 +1,5 @@ -; TODO: -; line border? -; flame demo -; DEMO OVER message, zooming from angle? - - -; zero page locations -.if 0 -HGR_SHAPE = $1A -SEEDL = $4E -FRAME = $A4 -OUR_ROT = $A5 -RND_EXP = $C9 -HGR_PAGE = $E6 -HGR_SCALE = $E7 -HGR_ROTATION = $F9 -WHICH = $FB -SCALE = $FC -ROTATE = $FD -XPOS = $FE -YPOS = $FF - -; Soft Switches -KEYPRESS = $C000 -KEYRESET = $C010 -SPEAKER = $C030 -PAGE0 = $C054 -PAGE1 = $C055 - -; ROM calls -RND = $EFAE - -HGR2 = $F3D8 -HGR = $F3E2 -HCLR = $F3F2 -HCLR_COLOR = $F3F4 -HPOSN = $F411 -XDRAW0 = $F65D -TEXT = $FB36 ; Set text mode -WAIT = $FCA8 ; delay 1/2(26+27A+5A^2) us -.endif - -letter_test: +do_letters: ;========================================= ; SETUP @@ -63,8 +21,7 @@ letter_test: ; jsr slide_in -end: - jmp end + rts ;=========================