; HGR Demo2 ; Apple II graphics/music in 1k ; 1k demo for Demosplash 2021 ; by deater (Vince Weaver) ; Zero Page .include "zp.inc" .include "hardware.inc" d2: ;=================== ; music Player Setup lda #peasant_song sta SONG_H ; assume mockingboard in slot#4 ; TODO: inline? jsr mockingboard_init ;================================ ; Clear screen and setup graphics ;================================ jsr HGR2 ; set hi-res 140x192, page2, fullscreen ; A and Y both 0 at end sty FRAME ; start at 0 ;================== ; create sinetable ;ldy #0 ; Y is 0 sinetable_loop: tya ; 2 and #$3f ; wrap sine at 63 entries ; 2 cmp #$20 php ; save pos/negative for later and #$1f cmp #$10 bcc sin_left ; blt sin_right: ; sec carry should be set here eor #$FF adc #$20 ; 32-X sin_left: tax lda sinetable_base,X ; 4+ plp bcc sin_done sin_negate: ; carry set here eor #$ff adc #0 sin_done: sta sinetable,Y iny bne sinetable_loop ; NOTE: making gbash/gbasl table wasn't worth it ;===================== ; setup credits ;=================== ; print message ;=================== print_message: .include "clear_bottom.s" ldx #12 print_message_loop: lda message1,X sta $6d2,X sta $Ad2,X lda message2,X sta $6ea,X sta $Aea,X dex bpl print_message_loop ;========================== ; beginning of demo ;========================== .include "dsr_shape.s" ; start music, no music for spin start_interrupts: cli forever: ;===================== ; orange/green effect .include "moving.s" ;========================= ; clear screen first time skip_clear_smc: lda #0 bne skip_clear jsr fast_hclr skip_clear: jsr flip_page ;===================== ; wires effect .include "wires.s" ; jsr wires ;===================== ; oval effect ; jsr oval .include "oval.s" ;===================== ; repeat ; switch things up for the second round lda #$7f sta color_smc+1 sta skip_clear_smc+1 lda #159 sta moving_size_smc+1 sta oval_size_smc+1 lda #