mist: handle enabling/disabling mockingboard better

This commit is contained in:
Vince Weaver 2020-07-17 14:28:45 -04:00
parent 4e4736a19a
commit dc06de88df
3 changed files with 30 additions and 20 deletions

View File

@ -4,11 +4,13 @@
mist_link_book:
; turn off music
sei_smc:
lda SOUND_STATUS
and #SOUND_MOCKINGBOARD
beq skip_turn_off_music
sei
jsr clear_ay_both
skip_turn_off_music:
; clear screen

View File

@ -105,6 +105,10 @@ no_language_card:
mockingboard_found:
; jsr mockingboard_patch ; patch to work in slots other than 4?
lda SOUND_STATUS
ora #SOUND_MOCKINGBOARD
sta SOUND_STATUS
;=======================
; Set up 50Hz interrupt
;========================
@ -129,11 +133,6 @@ mockingboard_found:
mockingboard_notfound:
; patch out cli/sei calls
lda #$EA
sta cli_smc
sta sei_smc
done_setup_sound:
@ -520,8 +519,13 @@ done_keyloop:
get_mist_book:
cli_smc:
; play music if mockingboard
lda SOUND_STATUS
and #SOUND_MOCKINGBOARD
beq skip_start_music
cli
skip_start_music:
lda #TITLE_BOOK_CLOSED
sta LOCATION

View File

@ -64,17 +64,7 @@ ENVELOPE_SHAPE = $7D
PATTERN_L = $7E
PATTERN_H = $7F
ORNAMENT_L = $D0
ORNAMENT_H = $D1
SAMPLE_L = $D2
SAMPLE_H = $D3
LOOP = $D4
MB_VALUE = $D5
MB_ADDR_L = $D6
MB_ADDR_H = $D7
DONE_PLAYING = $D8
DONE_SONG = $D9
PT3_TEMP = $DA
; note: rest are up at $d0
; We have to save/restore the following values
@ -248,11 +238,25 @@ END_OF_SAVE = $C9
; done game puzzle state
; rest of pt3_player
ORNAMENT_L = $D0
ORNAMENT_H = $D1
SAMPLE_L = $D2
SAMPLE_H = $D3
LOOP = $D4
MB_VALUE = $D5
MB_ADDR_L = $D6
MB_ADDR_H = $D7
DONE_PLAYING = $D8
DONE_SONG = $D9
PT3_TEMP = $DA
JOYSTICK_ENABLED= $DD
SOUND_STATUS = $DE
SOUND_DISABLED = $80
SOUND_IN_LC = $01 ; $01 sound effects in language card
SOUND_MOCKINGBOARD = $02 ; mockingboard detected
GRID_PAGE = $DF
ANIMATE_FRAME = $E0