Function 55 and its subfunction 55
Subfunction 55 - Start playing
data on the built-in speaker
Options:
·
eax =
55 - function number
·
ebx =
55 - subfunction number
·
esi =
data pointer
Return value:
·
eax =
0 - successful
·
eax =
55 - error (speaker is disabled or busy)
Data is an array of variable-length elements. The format of each element
is determined by the first byte:
·
0 = end of data
·
1..0x80 = sets the duration of the sound in hundredths
of a second of a note, determined by the immediate frequency value
o
the next word (2 bytes) contains a frequency divider;
frequency is defined as 1193180 / divider
·
0x81 = invalid
·
0x82..0xFF = note, defined by
octave and number:
o
duration in hundredths of a second = (first byte)
-0x81
o
there is one more byte;
o
(second byte) = 0xFF - pause
o
otherwise, it has the form a * 0x10 + b, where b =
note number in octave from 1 to 12, a = octave number (counting from 0)
Remarks:
·
Speaker
eating may be prohibited / enabled by function 8 subfunction
8.
·
The
function returns control, informing where the request information should go.
The playback itself is independent of the program.
·
Data
should be stored in memory at least until the end of playback.
Constants for registers:
eax -
SF_SPEAKER_PLAY (55)