Keen 1-3 Adlib Music TSR - by Napalm
(and some stuff by lemm)
BETA - Please do not use this in production mods
 
License: Creative Commons Attribution-Share Alike 2.0 UK: England & Wales
http://creativecommons.org/licenses/by-sa/2.0/uk/
 
If you use this all or part of my code please credit me as the license states.

- About -

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.

- Instructions -

Song List:
Requires a file named songlist.lst in the executable directory.  Format:

#comment line
    Rest of the characters on that line are ignored.
    
    Example:
        # This is a comment line
        

 
%l <levelnum> "filename.imf"
    Play "filename.imf" at level <levelnum>.  Filenames cannot be more than 8 letters long. <levelnum> should be 90 or less. If this directive is not given for a level, then that level will have no music.
    
    Example:
        %l 1 "K5T05.IMF"
        %l 80 "worldmap.imf"

%x
    Stop reading instructions after the first %x


Batch File:

tsrmusic.com
ckXpatch keenXpat.pat
tsrmusic.com /u


Patches:

%ext ck1
%version 1.31
%patch $BE97 $65
%patch $BEE2 $65
%end

%ext ck2
%version 1.31
%patch $B5AF $65
%patch $B5FA $65
%end

%ext ck3
%version 1.31
%patch $C90D $65
%patch $C958 $65
%end

- History -
July 17, 2010: Stopped the interrupt handler from delaying when reading blocks with delay of zero
June 6, 2010: Auto switches songs depending on level.
?? 2010: First beta version
