[Decompilation] [th01] Main menu: Playing the selected Music Test track

2.

Part of P0216, funded by JonathKane.
This commit is contained in:
nmlgc 2022-08-15 08:26:24 +02:00
parent 97a60b64fc
commit f00093f7c4
2 changed files with 11 additions and 33 deletions

View File

@ -688,4 +688,13 @@ void option_update_and_render(void)
#undef sel_prev #undef sel_prev
#undef in_this_menu #undef in_this_menu
} }
void music_play_selected(void)
{
extern const TextArray<TRACK_COUNT> MUSIC_FILES;
const TextArray<TRACK_COUNT> FILES = MUSIC_FILES;
mdrv2_bgm_stop();
mdrv2_bgm_load(FILES.t[music_sel]);
mdrv2_bgm_play();
}
/// --------- /// ---------

View File

@ -84,38 +84,7 @@ op_01__TEXT segment byte public 'CODE' use16
extern @music_choice_unput_and_put$qii:proc extern @music_choice_unput_and_put$qii:proc
extern @main_update_and_render$qv:proc extern @main_update_and_render$qv:proc
extern @option_update_and_render$qv:proc extern @option_update_and_render$qv:proc
extern @music_play_selected$qv:proc
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_AE6D proc far
var_3C = byte ptr -3Ch
enter 3Ch, 0
lea ax, [bp+var_3C]
push ss
push ax
push ds
push offset _MUSIC_FILES
mov cx, 3Ch ; '<'
call SCOPY@
call @mdrv2_bgm_stop$qv
mov al, _music_sel
cbw
shl ax, 2
lea dx, [bp+var_3C]
add ax, dx
mov bx, ax
pushd dword ptr ss:[bx] ; path
call @mdrv2_bgm_load$qnxc
add sp, 4
call @mdrv2_bgm_play$qv
leave
retf
sub_AE6D endp
; =============== S U B R O U T I N E ======================================= ; =============== S U B R O U T I N E =======================================
@ -238,7 +207,7 @@ loc_AFE0:
loc_AFEE: loc_AFEE:
cmp _menu_sel, 0 cmp _menu_sel, 0
jnz short loc_AFF9 jnz short loc_AFF9
call sub_AE6D call @music_play_selected$qv
loc_AFF9: loc_AFF9:
pop bp pop bp