2014-12-24 20:39:34 +00:00
|
|
|
; int __pascal __near music_cmt_load(int track)
|
|
|
|
music_cmt_load proc pascal near
|
|
|
|
arg @@track:word
|
|
|
|
local @@fn:dword
|
|
|
|
|
|
|
|
push si
|
|
|
|
mov word ptr @@fn+2, ds
|
2015-02-24 14:45:38 +00:00
|
|
|
mov word ptr @@fn, offset _a_Music0_txt
|
2014-12-24 20:39:34 +00:00
|
|
|
les bx, @@fn
|
|
|
|
mov al, byte ptr music_game
|
|
|
|
add al, '0'
|
|
|
|
mov es:[bx+6], al
|
|
|
|
call file_ropen pascal, word ptr @@fn+2, bx
|
|
|
|
mov ax, @@track
|
|
|
|
imul ax, MUSIC_CMT_LEN
|
|
|
|
cwde
|
|
|
|
call file_seek pascal, eax, 0
|
2015-02-24 14:45:38 +00:00
|
|
|
call file_read pascal, ds, offset _music_cmt, MUSIC_CMT_LEN
|
2014-12-24 20:39:34 +00:00
|
|
|
call file_close
|
|
|
|
xor si, si
|
|
|
|
jmp short @@check
|
|
|
|
|
|
|
|
@@terminate_line:
|
|
|
|
mov bx, si
|
|
|
|
imul bx, MUSIC_CMT_LINE_LEN
|
2015-02-24 14:45:38 +00:00
|
|
|
mov (_music_cmt + MUSIC_CMT_LINE_LEN - 2)[bx], 0
|
2014-12-24 20:39:34 +00:00
|
|
|
inc si
|
|
|
|
|
|
|
|
@@check:
|
|
|
|
cmp si, MUSIC_CMT_LINE_COUNT
|
|
|
|
jl short @@terminate_line
|
|
|
|
pop si
|
|
|
|
ret
|
|
|
|
music_cmt_load endp
|