chiptune_player: auto-increment mostly working

was chasing after glitches which I think are applewin bugs
This commit is contained in:
Vince Weaver 2018-02-26 01:33:34 -05:00
parent 0a5ee09b92
commit 1eb4cf5ef7
2 changed files with 24 additions and 35 deletions

View File

@ -132,21 +132,6 @@ mockingboard_found:
jsr new_song
; jsr increment_file ; debug
; jsr new_song
; cli
;============================
; Enable 6502 interrupts
;============================
cli ; clear interrupt mask
;============================
; Init Background
;============================
@ -156,6 +141,13 @@ mockingboard_found:
sta DRAW_PAGE
sta SCREEN_Y
;============================
; Enable 6502 interrupts
;============================
cli ; clear interrupt mask
;============================
; Loop forever
;============================
@ -213,27 +205,21 @@ done_play:
; ; FIXME: unhook interrupt handler
;
sei ; disable interrupts
;
lda #0
sta DONE_PLAYING
jsr clear_ay_both
lda #0
sta CH
jsr clear_bottoms
;
; lda #21
; sta CV
; lda #<done_message
; sta OUTL
; lda #>done_message
; sta OUTH
; jsr print_both_pages
jsr increment_file
jsr new_song
cli
cli ; re-enable interrupts
jmp main_loop
@ -258,6 +244,9 @@ new_song:
sta B_VOLUME
sta C_VOLUME
sta COPY_OFFSET
sta DECOMPRESS_TIME
sta COPY_TIME
sta MB_CHUNK_OFFSET
lda #$20
sta DECODER_STATE
lda #3
@ -298,11 +287,6 @@ new_song:
sta OUTH
jsr print_both_pages
; lda #<krw_file ; point to filename
; sta INL
; lda #>krw_file
; sta INH
disk_buff EQU LZ4_BUFFER
read_size EQU $4000
@ -578,7 +562,7 @@ krw_file:
mocking_message: .asciiz "LOOKING FOR MOCKINGBOARD IN SLOT #4"
not_message: .byte "NOT "
found_message: .asciiz "FOUND"
done_message: .asciiz "DONE PLAYING"
;done_message: .asciiz "DONE PLAYING"
loading_message: .asciiz "LOADING"
;============

View File

@ -19,13 +19,15 @@ interrupt_handler:
bit $C404 ; clear 6522 interrupt by reading T1C-L ; 4
;============
lda DONE_PLAYING ; 3
beq update_time
jmp exit_interrupt ;============
; 7
;=====================
; Update time counter
;=====================
update_time:
inc FRAME_COUNT ; 5
lda FRAME_COUNT ; 3
cmp #50 ; 3
@ -90,6 +92,9 @@ mb_write_loop:
lda #1 ; set done playing ; 2
sta DONE_PLAYING ; 3
jsr clear_ay_both
jmp done_interrupt ; 3
mb_not_done:
@ -267,7 +272,7 @@ done_interrupt:
jsr volume_bars
jsr page_flip
exit_interrupt:
pla ; restore a ; 4