NEC PC Programmers Reference/PC-98xx Series Programmers Reference/Sound BIOS

The Sound BIOS is a toolkit for operating the OPN music playback/sound generation system. It has no default interrupt -- the interrupt must be established by the application.

Requirements
The Sound BIOS requires a sound card that supports OPN MUSIC BIOS. It can only be used in normal mode.

Setting the Sound BIOS Interrupt
The Sound BIOS interrupt is established by setting the byte at address 0xCEE00 to the interrupt number desired for use.

N88-BASIC sets Sound BIOS interrupt to 0xD2 by default.

Setup
Sound BIOS expects access to specific regions of memory for its operation, among other requirements.


 * the DWORD beginning at 0000:05E0 must be reserved to it.
 * Status area of 256 bytes
 * Work area of 512 bytes
 * 96 bytes stack space

The status and work areas must be contiguous. To reserve space for Sound BIOS, set the offset into the segment so reserved where the work area begins to the WORD at 0xCEE06 (0 is acceptable). Before using Sound BIOS, set ES to 0xCEE0 and DI to the WORD at 0xCEE06. Set SS to the designated BIOS stack area segment and SI to the offset into the same.

Operation of the Sound BIOS
The Sound BIOS is accessed by calling its designated interrupt with the command number in CPU reg AH. Each Sound BIOS command requires specific parameters. The following list of Sound BIOS commands explains the commands available and how to pass parameters to them.

Callback timing
Sound BIOS uses OPN reg A as a tempo clock/metronome and reg B for modulation timing. It latches onto the PIC and monitors these regs to determine what action to take in accordance with the commands given. The metronome ticks at at least 5 msecs.

Compatibility with Manual Port Operations
It is possible that manual operation of the sound card will interfere with the proper operation of Sound BIOS commands, causing unexpected behavior.