ds: making some progress

This commit is contained in:
Vince Weaver 2019-11-15 17:01:19 -05:00
parent df1e5b51c6
commit f8774a3010
5 changed files with 45 additions and 31 deletions

View File

@ -12,18 +12,19 @@ credits:
lda #0
sta DRAW_PAGE
sta FRAME
sta FRAME_PLAY_OFFSET
sta FRAME_PLAY_PAGE
jsr update_pt3_play
jsr pt3_write_lc_5
; jsr pt3_write_lc_5
lda #<credits_text
sta CREDITS_POINTERL
lda #>credits_text
sta CREDITS_POINTERH
jsr play_frame_compressed ; 6+1237
; jsr play_frame_compressed ; 6+1237
;==================
; setup graphics
@ -671,4 +672,4 @@ uloop2: dex ; 2
fake_music_play_end:
.assert >fake_music_play = >fake_music_play_end, error, "fake_musis_play crosses page"
.assert >fake_music_play = >fake_music_play_end, error, "fake_music_play crosses page"

View File

@ -7,33 +7,33 @@
escape:
; jmp escape
;==================
; setup music
; we are roughly at the beginning of pattern 0x19
; pattern $19
; line $10
; we are roughly at the beginning of pattern 0x18
; pattern $18
; line $15
lda #$19
lda #$18
sta current_pattern_smc+1
lda #0
sta current_line_smc+1
lda #0
sta FRAME_PLAY_OFFSET
sta FRAME_PLAY_PAGE
sta FRAME_OFFSET
sta FRAME_PAGE
jsr update_pt3_play
; setup 4 frames
jsr pt3_write_lc_4 ; FIXME
lda #$30 ; assume on line $10, speed=3
lda #$3F ; assume on line $15, speed=3
sta FRAME_PLAY_OFFSET
lda #1
sta SOUND_WHILE_DECODE
; setup 4 frames
jsr pt3_write_lc_4
;===================
; init vars

View File

@ -20,21 +20,21 @@ lc4_frame_decode_loop:
rts
pt3_write_lc_5:
pt3_write_lc_6:
; page offset
lda #0
sta FRAME_PAGE
lc5_frame_decode_loop:
lc6_frame_decode_loop:
jsr pt3_set_pages
jsr pt3_write_lc
lda FRAME_PAGE
cmp #5
bne lc5_frame_decode_loop
cmp #6
bne lc6_frame_decode_loop
rts
@ -71,6 +71,16 @@ lc_frame_decode_loop:
inc FRAME_OFFSET
lda SOUND_WHILE_DECODE
beq no_play_music
lda FRAME_OFFSET
and #$7
bne no_play_music
jsr play_frame_compressed
no_play_music:
lda FRAME_OFFSET
cmp #59*3 ; FIXME: make this depend on song
; hardcoding for 59 for our song
@ -129,12 +139,14 @@ pt3_set_pages:
music_table_begin:
music_addr_table:
.byte $f1,$f2,$f3,$f4,$f5,$f6,$f7,$f8,$f9,$fa,$fb,$BB,$CC,$DD,$EE,$FF
.byte $e6,$e7,$e8,$e9,$ea,$eb,$ec,$ed,$ee,$ef,$f0,$BB,$CC,$DD,$EE,$FF
.byte $db,$dc,$dd,$de,$df,$e0,$e1,$e2,$e3,$e4,$e5,$BB,$CC,$DD,$EE,$FF
.byte $d0,$d1,$d2,$d3,$d4,$d5,$d6,$d7,$d8,$d9,$da,$BB,$CC,$DD,$EE,$FF
.byte $f1,$f2,$f3,$f4,$f5,$f6,$f7,$f8,$f9,$fa,$fb,$BB,$CC,$DD,$EE,$FF ;0
.byte $e6,$e7,$e8,$e9,$ea,$eb,$ec,$ed,$ee,$ef,$f0,$BB,$CC,$DD,$EE,$FF ;1
.byte $db,$dc,$dd,$de,$df,$e0,$e1,$e2,$e3,$e4,$e5,$BB,$CC,$DD,$EE,$FF ;2
.byte $d0,$d1,$d2,$d3,$d4,$d5,$d6,$d7,$d8,$d9,$da,$BB,$CC,$DD,$EE,$FF ;3
.byte $14,$15,$16,$17,$18,$19,$1A,$1B,$1C,$1D,$1E,$BB,$CC,$DD,$EE,$FF ;4
.byte $1F,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$BB,$CC,$DD,$EE,$FF ;5
.byte $2A,$2B,$2C,$2D,$2E,$2F,$30,$31,$32,$33,$34,$BB,$CC,$DD,$EE,$FF ;6
;.byte $d0,$d1,$d2,$d3,$d4,$d5,$d6,$d7,$d8,$d9,$da,$BB,$CC,$DD,$EE,$FF
.byte $14,$15,$16,$17,$18,$19,$1A,$1B,$1C,$1D,$1E,$BB,$CC,$DD,$EE,$FF
music_table_end:
.assert >music_table_begin = >music_table_end, error, "music_table crosses page"

View File

@ -7,7 +7,7 @@
end_book:
cli
; cli
;===================
; init screen
@ -44,12 +44,12 @@ end_book:
jsr move_and_print
jsr move_and_print
lda #200
jsr long_wait
lda #200
jsr long_wait
; lda #200
; jsr long_wait
; lda #200
; jsr long_wait
sei
; sei
lda #0
sta FRAME_PLAY_OFFSET
@ -58,8 +58,8 @@ end_book:
sta FRAME_PAGE
jsr update_pt3_play
; setup 1 frame
jsr pt3_write_lc_1
; setup 5 frames
jsr pt3_write_lc_6
;=============================

View File

@ -213,6 +213,7 @@ YPOS = $F4 ; ALL
DIRECTION = $F5 ; ALL
GAIT = $F6 ; ALL
INTRO_LOOPER = $F7 ; INTRO
SOUND_WHILE_DECODE = $F8
TEMP = $FA
TEMPY = $FB