TSRMusic is a utility created by Napalm and modified by Lemm to allow Keen Vorticons mods to play IMF music. The program is Terminate Stay Resident (TSR), meaning it is run before Keen, "ends" and stays resident in memory while the game runs. It allows any level to have its own IMF music as long as that music file is no larger than 32KB in size. As the help file notes:
- TSR plays 560Hz Type-1 IMF files in the Keen Vorticon games. TSR is installed before game and uninstalled immediately afterwards. It intercepts the keen timer interrupt and polls certain game variables to determine when the song should be changed.
- Note: If running under DOSbox: cycles should be set below 3000 when the TSR is loaded or else may not detect the adlib card.
There are components to TSRMusic, the program, a batch file used to start it (this will most likely be the same file used to start the mod), various IMF music files, and a song list file containing information on what songs to play in what levels.
The batch file will be something like this:
tsrmusic.com ckXpatch keenXpat.pat tsrmusic.com /u
A simple songlist file will be something like:
#This is my song list %l 1 "K5T05.IMF" #Level 1 song 'Metal.imf' %l 80 "worldmap.imf" #Map song %x #Stop reading stuff here.
The following patches are used to allow TSRMusic to work with Keen 1–3 (Versions 1.31):
#Play music with TSRMusic: %patch $BE97 $65 %patch $BEE2 $65
#Play music with TSRMusic: %patch $B5AF $65 %patch $B5FA $65
#Play music with TSRMusic: %patch $C90D $65 %patch $C958 $65