ds: more music

issues with the cycle-counting parts :(
This commit is contained in:
Vince Weaver 2019-11-08 00:47:34 -05:00
parent 58a5a1707b
commit 17800ad425
6 changed files with 57 additions and 74 deletions

View File

@ -6,18 +6,15 @@
credits:
;===================
; init screen
; jsr TEXT
; jsr HOME
bit KEYRESET
;===================
; init vars
lda #0
sta DRAW_PAGE
sta FRAME
sta FRAME_PLAY_OFFSET
sta FRAME_PLAY_PAGE
jsr update_pt3_play
lda #<credits_text
sta CREDITS_POINTERL
@ -170,8 +167,16 @@ credits_loop:
; -10 -- keypress
; -12 -- call/return of draw code
; -446 -- do_words
;-1239 -- play music
; -8 -- wrap
;=======
; 2804
; 1557 //2804
lda FRAME_PLAY_PAGE ; 3
and #$3 ; 2
sta FRAME_PLAY_PAGE ; 3
jsr play_frame_compressed ; 6+1233
pad_time:
@ -351,12 +356,14 @@ pad_time:
; WAIT for VBLANK to finish
;============================
; Try X=61 Y=9 cycles=2800 R4
nop
; want 1557
; Try X=3 Y=74 cycles=1555R2
nop
ldy #9 ; 2
tloop1: ldx #61 ; 2
ldy #74 ; 2
tloop1: ldx #3 ; 2
tloop2: dex ; 2
bne tloop2 ; 2nt/3
dey ; 2

View File

@ -63,24 +63,18 @@ demosplash2019:
; start irq music
;========================
; cli ; enable interrupts
cli ; enable interrupts
;===========================
; opening book scene
;============================
nop
nop
nop
jsr open_book
;===========================
; starbase scene
;===========================
; nop
; nop
; nop
jsr starbase
;============================
@ -93,18 +87,12 @@ demosplash2019:
; escape scene
;===========================
; nop
; nop
; nop
jsr escape
;===========================
; book scene
;===========================
; nop
; nop
; nop
jsr end_book
;===========================
@ -116,8 +104,8 @@ demosplash2019:
; wait wait wait
; jsr wait_until_keypressed
;repeat_ending:
; jmp repeat_ending
repeat_ending:
jmp repeat_ending
@ -128,8 +116,8 @@ wait_until_keypressed:
lda KEYPRESS
bpl wait_until_keypressed
bit KEYRESET
; rts
jmp demosplash2019
rts
; Apple II intro
.include "appleII_intro.s"

View File

@ -7,11 +7,18 @@
escape:
;===================
; init screen
; jsr TEXT
; jsr HOME
bit KEYRESET
;==================
; setup music
; we are roughly at the beginning of pattern 0x19
lda #19
sta current_pattern_smc+1
lda #0
sta current_line_smc+1
; setup 4 frames
jsr pt3_write_lc_4
;===================
; init vars
@ -62,6 +69,11 @@ escape:
jsr create_update_type2
jsr setup_update_type2
;==========================================
; replace bottom with call to music player
; lda #20
; sta $9800+
;=============================
; Load graphic page0

View File

@ -270,6 +270,8 @@ apple_iic:
; bypass the firmware interrupt handler
; should we do this on IIe too? probably faster
done_apple_detect:
sei ; disable interrupts
lda $c08b ; disable ROM (enable language card)
lda $c08b
@ -282,7 +284,7 @@ apple_iic:
sta interrupt_smc
sta interrupt_smc+1
done_apple_detect:
;=========================

View File

@ -1,17 +1,17 @@
; ZZ points to offset from pointer
;D000 ;0 $9000,$9100,$9200 = A Low (reg0)
;D100 ;1 $9300,$9400,$9500 = A high (reg1) [top], B high (reg3) [bottom]
;D200 ;2 $9600,$9700,$9800 = B Low (reg2)
;D300 ;3 $9900,$9A00,$9B00 = C Low (reg4)
;D400 ;4 $9C00,$9D00,$9E00 = Envelope Shape (r13) [top], C high (reg5) [bot]
;D500 ;5 $9F00,$A000,$A100 = Noise (r6), bit7 = don't change envelope
;D600 ;6 $A200,$A300,$A400 = Enable (r7)
;D700 ;7 $A500,$A600,$A700 = A amp (r8), bit 5 of r8,r9,r10
;D800 ;8 $A800,$A900,$AA00 = C amp (r10) [top], B amp (r9) [bottom]
;D900 ;9 $AB00,$AC00,$AD00 = ENV low (r11)
;DA00 ;a $AE00,$AF00,$B000 = ENV high (r12)
;D0 F1 ;0 $9000,$9100,$9200 = A Low (reg0)
;D1 F2 ;1 $9300,$9400,$9500 = A high (reg1) [top], B high (reg3) [bottom]
;D2 F3 ;2 $9600,$9700,$9800 = B Low (reg2)
;D3 F4 ;3 $9900,$9A00,$9B00 = C Low (reg4)
;D4 F5 ;4 $9C00,$9D00,$9E00 = Envelope Shape (r13) [top], C high (reg5) [bot]
;D5 F6 ;5 $9F00,$A000,$A100 = Noise (r6), bit7 = don't change envelope
;D6 F7 ;6 $A200,$A300,$A400 = Enable (r7)
;D7 F8 ;7 $A500,$A600,$A700 = A amp (r8), bit 5 of r8,r9,r10
;D8 F9 ;8 $A800,$A900,$AA00 = C amp (r10) [top], B amp (r9) [bottom]
;D9 FA ;9 $AB00,$AC00,$AD00 = ENV low (r11)
;DA FB ;a $AE00,$AF00,$B000 = ENV high (r12)
pt3_write_frame:
@ -154,33 +154,5 @@ r12_wrsmc:
;=============================
; Register 13: already handled
.if 0
no_frame_wrap:
; -1
; delay 72+1-3=70
lda #43 ; 70-2-25=43
jsr delay_a
jmp done_frame_wrap ; 3
frame_wrap:
inc r0_smc+2 ; 6
inc r1_smc+2 ; 6
inc r2_smc+2 ; 6
inc r4_smc+2 ; 6
inc r5_smc+2 ; 6
inc r13_smc+2 ; 6
inc r6_smc+2 ; 6
inc r7_smc+2 ; 6
inc r8_smc+2 ; 6
inc r9_smc+2 ; 6
inc r11_smc+2 ; 6
inc r12_smc+2 ; 6
;=====
; 72
done_frame_wrap:
.endif
rts ; 6

View File

@ -61,6 +61,8 @@ lc_frame_decode_loop:
rts
;========================
;
pt3_set_pages:
lda FRAME_PAGE
asl