Subfunction 21 : Test for residency
AH = 82
AL = 21
If MODRES is resident, AX will be set to 5722h, and BX will hold the version
number in hex (i.e. 0120h means version 1.20). DX:CX will point to a table
containing the available devices. Note that this information is not available
in the old versions of MODRES.
The table has the following format:
┌────────┬─────┬───────────────────────────────────────────────────────────┐
│ Offset │ Len │ Contents │
├────────┼─────┼───────────────────────────────────────────────────────────┤
│ 0 │ 20 │ The name of the device - blank padded and null │
│ │ │ terminated. │
│ 20 │ 2 │ Always seems to be FFFF hex. │
│ 22 │ 2 │ Usually the port associated with the device. This will │
│ │ │ be set to zero if the device is not available. │
│ 24 │ 2 │ Usually the second port associated with stero devices. │
│ 26 │ 2 │ The address of the int 8 routine for playing a sample. │
│ 28 │ 1 │ The type of device. See table below. │
│ 29 │ 2 │ The address of the int 8 routine for playing a module │
│ │ │ with all samples < 64K. │
│ 31 │ 2 │ The address of the int 8 routine for playing a module │
│ │ │ with some samples > 64K. │
└────────┴─────┴───────────────────────────────────────────────────────────┛
The end of the table will be marked with a FF hex as the first byte in the
name field. The possible device types known to me are as follows:
┌────────┬─────────────────────┐
│ Number │ Name │
├────────┼─────────────────────┤
│ 0 │ Speaker │
│ 1 │ Soundblaster │
│ 2 │ D/A on an LPT port │
│ 4 │ D/A on 1&2 (stereo) │
│ 5 │ D/A on 1&2 (mono) │
│ 7 │ Stereo-on-1 │
│ 8 │ Disney Sound Source │
└────────┴─────────────────────┛