Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Audio Subsystem & Driver Dispatch

CIV.EXE contains no sound code. The player picks a sound card in the setup menu (sound_names in SETUP.C), and CIV loads the matching driver as an overlay at start-up, just as it loads the graphics driver:

ChoiceDriver
No sounds pleaseNSOUND.CVL
IBM soundsISOUND.CVL (PC speaker)
Tandy soundsTSOUND.CVL
AdLib/Sound BlasterASOUND.CVL
Roland MT-32 MIDI boardRSOUND.CVL

run_program copies the driver’s entry points into slots 100–110 of driver_slots (DRIVER.INC). CIV then uses five calls:

CallSlotWhen
sound_init()100Start-up (INTRO.C)
sound(n, variant) → sound_command101Every sound and tune; sound in GAME.C checks that sound is on (debug & 10h)
sound_tick()103Timer interrupt, about 60 Hz; may ask for a faster or slower timer
sound_fast_tick()104Timer interrupt at the fast rate
sound_shutdown()102Exit

sound_quiet_ticks() (slot 105) counts timer ticks since the last command, and CIV also uses it as a source of random numbers.

The commands and the driver’s internals are described in The AdLib Sound Driver; src/ASOUND.ASM is its recovered source.