From be70971b042dc6967c7e402709471cff039e1f33 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Mon, 24 Feb 2020 00:19:48 -0500 Subject: [PATCH] vs: add some missing files --- vertical_scroll/Makefile | 5 +- vertical_scroll/scroller.s | 105 +++++++++++++++++++++++++++++-------- vertical_scroll/zp.inc | 8 +++ 3 files changed, 96 insertions(+), 22 deletions(-) diff --git a/vertical_scroll/Makefile b/vertical_scroll/Makefile index e1c8120b..8bd0947f 100644 --- a/vertical_scroll/Makefile +++ b/vertical_scroll/Makefile @@ -24,7 +24,7 @@ SCROLLER: scroller.o scroller.o: scroller.s gr_copy.s gr_unrle.s gr_unrle_large.s \ gr_copy_large.s \ - zp.inc hardware.inc desire.inc spaceman.inc + zp.inc hardware.inc desire.inc spaceman.inc spaceman2.inc ca65 -o scroller.o scroller.s -l scroller.lst #### @@ -36,6 +36,9 @@ desire.inc: desire.png desire2.png spaceman.inc: spaceman_big.png $(PNG2RLE) asm spaceman_big.png spaceman_rle > spaceman.inc +spaceman2.inc: spaceman_big2.png + $(PNG2RLE) asm spaceman_big2.png spaceman2_rle > spaceman2.inc + #### diff --git a/vertical_scroll/scroller.s b/vertical_scroll/scroller.s index 4bd0d2a5..6b9cba50 100644 --- a/vertical_scroll/scroller.s +++ b/vertical_scroll/scroller.s @@ -6,6 +6,29 @@ .include "zp.inc" .include "hardware.inc" +;PT3_USE_ZERO_PAGE=0 + + ;=================== + ; PT3 Setup + + lda #0 + sta DONE_PLAYING + lda #1 + sta LOOP + + jsr mockingboard_detect + bcc mockingboard_not_found +setup_interrupt: + jsr mockingboard_init + jsr mockingboard_setup_interrupt + jsr reset_ay_both + jsr clear_ay_both + jsr pt3_init_song + +start_interrupts: + cli + +mockingboard_not_found: ;=================== ; init screen @@ -61,13 +84,22 @@ jsr wait_until_keypress ;============================= - ; Load spaceman + ; Load spaceman top lda #spaceman_rle sta GBASH - lda #$a0 + lda #$90 + jsr load_rle_large + + ; Load spaceman bottom + + lda #spaceman2_rle + sta GBASH + lda #$A0 jsr load_rle_large @@ -76,44 +108,65 @@ rescroll: lda #0 sta SCROLL_COUNT + lda #<$9000 + sta TINL + lda #>$9000 + sta TINH + lda #<$A000 - sta OUTL - sta INL + sta BINL lda #>$A000 - sta OUTH - sta INH + sta BINH ; delay lda #200 jsr WAIT scroll_loop: + lda TINL + sta OUTL + lda TINH + sta OUTH jsr gr_copy_to_current_large ; copy to page1 jsr page_flip + lda #100 + jsr WAIT -sl2: - lda INL ; inc to next line - clc - adc #$28 - sta INL + lda BINL sta OUTL - lda INH - adc #$0 - sta INH + lda BINH sta OUTH + jsr gr_copy_to_current_large ; copy to page1 + jsr page_flip + lda #100 jsr WAIT + lda TINL ; inc to next line + clc + adc #$28 + sta TINL + lda TINH + adc #$0 + sta TINH + + lda BINL ; inc to next line + clc + adc #$28 + sta BINL + lda BINH + adc #$0 + sta BINH + inc SCROLL_COUNT lda SCROLL_COUNT - cmp #72 + cmp #73 bne scroll_loop - jsr wait_until_keypress jmp rescroll @@ -128,11 +181,6 @@ wait_until_keypress: bit KEYRESET rts - - - - - .include "gr_unrle.s" .include "gr_unrle_large.s" .include "gr_offsets.s" @@ -140,5 +188,20 @@ wait_until_keypress: .include "gr_copy_large.s" .include "gr_pageflip.s" +.include "pt3_lib_core.s" +.include "pt3_lib_init.s" +.include "pt3_lib_mockingboard_setup.s" +.include "interrupt_handler.s" +; if you're self patching, detect has to be after interrupt_handler.s +.include "pt3_lib_mockingboard_detect.s" + + + .include "desire.inc" .include "spaceman.inc" + .include "spaceman2.inc" + +PT3_LOC = song +.align $100 +song: +.incbin "../pt3_player/music/DF.PT3" diff --git a/vertical_scroll/zp.inc b/vertical_scroll/zp.inc index 97e3a30d..efee5db9 100644 --- a/vertical_scroll/zp.inc +++ b/vertical_scroll/zp.inc @@ -67,9 +67,17 @@ DONE_SONG = $89 PT3_TEMP = $8A + DISP_PAGE = $ED ; ALL DRAW_PAGE = $EE ; ALL + +TINL = $F0 +TINH = $F1 +BINL = $F2 +BINH = $F3 + + SCROLL_COUNT = $F9 TEMP = $FA TEMPY = $FB