; ; Ride the bird past the mountain ; by Vince Weaver ; TREE1X = $E1 TREE2X = $E2 bird_mountain: ;=================== ; init screen jsr TEXT jsr HOME ;================== ; Init vars lda #0 sta FRAME sta FRAMEH lda #28 sta TREE1X lda #37 sta TREE2X ;========================= ; setup scrolling letters ;========================= ; Patch the inverse values out (as used by check_email) lda #39 sta ml_patch_dest+1 lda #$80 sta ml_patch_or+1 lda #$09 sta ml_patch_or lda #' '|$80 sta ml_patch_space+1 lda #letters_bm sta LETTERH lda #39 sta LETTERX lda #1 sta LETTERY lda #16 sta LETTERD ;================= ; Set draw page lda #0 sta DISP_PAGE lda #0 sta DRAW_PAGE ;========================== ; Load the background image lda #katahdin sta LZ4_SRC+1 lda #<(katahdin_end-8) ; skip checksum at end sta LZ4_END lda #>(katahdin_end-8) ; skip checksum at end sta LZ4_END+1 lda #<$2000 ; Destination is HGR page0 sta LZ4_DST lda #>$2000 sta LZ4_DST+1 jsr lz4_decode sei ; disable interrupt music ;===================================================== ; attempt vapor lock ;===================================================== jsr vapor_lock ;========================== ; setup text screen ; clear top 6 lines to space ; takes (Y/2)*(6+435+7)+5 = ? lda #$A0 ; space ; 2 ldy #10 ; 6 lines ; 2 jsr clear_page_loop ; 2693 jsr draw_moon_sky ; 6+54 ; vapor lock returns with us at beginning of hsync in line ; 114 (7410 cycles), so with 5070 cycles to go ; 5070+4550 = 9620 ; -2757 (draw text) ; =========== ; 6863 ;; Try X=97 Y=14 cycles=6875 ; Try X=136 Y=10 cycles=6861 R2 nop ldy #10 ; 2 bmloopA:ldx #136 ; 2 bmloopB:dex ; 2 bne bmloopB ; 2nt/3 dey ; 2 bne bmloopA ; 2nt/3 jmp bm_display_loop ;==================== ; draw moon sky ; 54 cycles draw_moon_sky: ; 1 2 ; 0123456789abcdef0123456789abcdef0123456 ;line1:.asciiz " * . " $400 ;line2:.asciiz " * . . " $480 ;line3:.asciiz " * " $500 ;line4:.asciiz " * " $580 ;line5:.asciiz " . . . " $600 ;line6:.asciiz " . " $680 lda #'.'|$80 ; print star ; 2 sta $420 ; 4 sta $487 ; 4 sta $4A4 ; 4 sta $601 ; 4 sta $61c ; 4 sta $621 ; 4 sta $68d ; 4 ;============ ; 30 ; draw the moon lda #' ' ; print inv space ; 2 sta $403 ; 4 sta $482 ; 4 sta $502 ; 4 sta $583 ; 4 ;============ ; 18 rts ; 6 .align $100 ;===================================================== ;===================================================== ; Loop forever display loop ;===================================================== ;===================================================== bm_display_loop: ; each scan line 65 cycles ; 1 cycle each byte (40cycles) + 25 for horizontal ;Total of 12480 cycles to draw screen ;Vertical blank = 4550 cycles (70 scan lines) ; Total of 17030 cycles to get back to where was ; Text mode for 6*8=48 scanlines (3120 cycles) ; hgr for 64 scalines (4160 cycles) ; gr for 80 scalines (5200 cycles) ; vblank = 4550 cycles ; text bit SET_TEXT ; 4 ;================ ; clear bottom green jsr draw_bottom_green ; 2209+6 ;================ ; Draw Small Tree lda #>small_tree ; 2 sta INH ; 3 lda #big_tree ; 2 sta INH ; 3 lda #bird_rider_stand_right ; 2 sta INH ; 3 lda #bird_rider_walk_right ; 2 sta INH ; 3 lda #