;--------------------------------------------------------------------------------------------------------
; This file is used by VDMSound to set up its various hardware emulation modules.
; For a detailed description of the general structure of this .ini file, see the VDMConfig.hlp help file.
;
; Following are a few quick pointers to the settings that are usually changed:
;
; - DEBUG OUTPUT: if you lower the value of 'detail' under the [*.debug] section, VDMSound will produce
;   debug output that can then be used to diagnose problems with games. Enabling debug output, however,
;   will hurt VDMSound's performance.
;
; - MIDI MAPPING: sometimes a game may be playing music for the MT-32 or LAPC-1, but all you have is a
;   GM/GS device like your SoundBlaster or DirectMusic. Modify 'MapFile' under [MIDI Mapper.config] to
;   translate the music. Available map files are 'identitiy.map' (MT-32 to MT-32 or GM to GM),
;   'mt2gm.map' (maps the game's MT-32 to your system's GM), and 'gm2mt.map' (maps GM to MT-32).
;
; - DIGITAL SOUND LATENCY: latency can be a good thing or a bad thing depending on what you are looking
;   for. Low latency means good synchronization between sound and animation, but may result in breaking
;   sound. High latency means smooth sound which may, however, lag significantly behind animation. Modify
;   latency by changing 'buffer' under the [SB Wave Player.config] and [AdLib Wave Player.config]
;   sections. If you have a sturdy system, you can also improve sound quality without increasing latency
;   by lowering 'minDMAPeriod' under the [DMA Transfer Manager.config] section. Keep 'minDMAPeriod' above
;   0 if possible, or else your system responsiveness will decrease blow acceptable limits.
;
; - WINDOWS NT4: DIGITAL SOUND LATENCY: unlike Windows 2000 and its successors, NT4 does its DirectSound
;   3 mixing at user-level on relatively large chunks of audio data, which implies significant latency.
;   VDMSound is forced to automatically pick the largest of the two latencies (DirectSound's, and the
;   latency specified by the user under 'buffer'). If you are willing to sacrifice either digital sound
;   or AdLib sound in exchange for lower latency under NT4 (while still allowing games to detect both
;   emulated SoundBlaster and AdLib), simply change 'DSoundDevice' to 'WaveDevice' under the [SB Wave
;   Player] and [AdLib Wave Player] sections.
;
; - PORT, IRQ, AND DMA SETTINGS: although you should never need to change these, VDMSound lets you do so.
;   Since they are emulated, these values can be virtually anything and do not need to match any ports,
;   IRQs or DMA channels on your system. Change them under the [MPU401 Controller.config], [SB
;   Controller.config], [AdLib Controller.config] and [Joystick Controller.config] sections. If using the
;   "Run with VDMS" feature, you must also change the BLASTER environment variable in VDMSRun.bat.
;
; - JOYSTICK TWEAKING: reading the joystick's position is performed by continuously polling the joystick
;   port. This significant I/O activity is very costly under Windows, and if games poll at very small
;   intervals then your game will be slowed down significantly. VDMSound can adjust for this by giving
;   out the joystick position before it is supposed to, just so that games would go faster. Adjust
;   'minCoord' and 'maxCoord' under the [Joystick Controller.config] section. Decrease 'maxCoord' to
;   speed up games (for some games it can go as low as 20!). Low values may, however, result in jerky
;   joystick movement, improper calibration, etc. You can also decrease 'poll' if you find that the game
;   misses some of your button presses, but only do so if misses occur when the joystick is not moving.
;
; - AUDIO DEVICES: if you would rather have VDMSound use a different MIDI or digital sound device on your
;   system, modify 'device' under the [MIDI Player.config], [SB Wave Player.config] and [AdLib Wave
;   Player.config] sections. -1 means the Windows system-wide default, 0 is the first device, 1 is the
;   second, etc.
;--------------------------------------------------------------------------------------------------------

[*.depends] ; Add here dependencies common to all modules (beware of circular references!)

[*.debug]   ; Add here debug parameters common to all modules
detail  = 256           ; 256 = no logging, 192 = errors only, 128 = warnings and errors, 0 = everything
file    = .\VDMS.LOG    ; log in a file called VDMS.LOG in the current directory

[*.config] ; Add here settings common to all modules

;--------------------------------------------------------------------------------------------------------
; This provides VDM services such as hooking I/O ports, manipulating registers and memory, etc.
;--------------------------------------------------------------------------------------------------------

[VDMServicesProvider]
CLSID   = VDDLoader.VDMServices
Path    = VDDLoader.dll

[VDMServicesProvider.config]
fixPOPF = 1             ; makes undocumented system call 2e:e8(0d,0/1) to recover from the PUSHF/CLI/POPF protected-mode cleared interrupts problem (Windows XP only)

;--------------------------------------------------------------------------------------------------------
; Declare additional modules here ...
;--------------------------------------------------------------------------------------------------------

;
; MPU 401 emulation
;

;--------------------------------------------------------------------------------------------------------
; This module emulates a MPU-401 interface card.  It accepts as well as generates MIDI messages (MIDI-in,
; MIDI-out).
;--------------------------------------------------------------------------------------------------------

[MPU401 Controller]
CLSID   = EmuMPU401.MPU401Ctl
Path    = EmuMPU401.dll

[MPU401 Controller.depends]
VDMSrv  = VDMServicesProvider
MidiOut = MIDI Mapper

[MPU401 Controller.config]
port    = 0x330         ; usually 0x300 or 0x330
IRQ     = 2             ; usually 2

;--------------------------------------------------------------------------------------------------------
; This module is used to convert MIDI messages between MT-32 and GM
;--------------------------------------------------------------------------------------------------------

[MIDI Mapper]
CLSID   = MIDIToolkit.MIDIMapper
Path    = MIDIToolkit.dll

[MIDI Mapper.depends]
MidiOut = MIDI Player

[MIDI Mapper.config]
mapFile = identity.map  ; translates between the MIDI devices selected in games and the one in your system

;--------------------------------------------------------------------------------------------------------
; This module is used to play back MIDI messages on a Windows MIDI-out device
;--------------------------------------------------------------------------------------------------------

[MIDI Player]
CLSID   = MIDIDevice.MIDIOut
Path    = MIDIDevice.dll

[MIDI Player.depends]
MidiOut = SysEx Indicator

[MIDI Player.config]
device  = -1            ; -1 = the MIDI mapper, 0 = first device, 1 = second, etc.

;--------------------------------------------------------------------------------------------------------
; This module is used to have a keyboard led blink whenever a SysEx message is transmitted.  Useful for
; most Sierra games, where SysEx transfers are lengthy
;--------------------------------------------------------------------------------------------------------

[SysEx Indicator]
CLSID   = MIDIIndicator.ActivityLights
Path    = MIDIIndicator.dll

[SysEx Indicator.config]
led     = Scroll        ; the indicator led - can be either of Num, Caps or Scroll

;
; SoundBlaster and AdLib emulation
;

;--------------------------------------------------------------------------------------------------------
; This module manages DMA transfers
;--------------------------------------------------------------------------------------------------------

[DMA Transfer Manager]
CLSID   = DMAController.TransferMgr
Path    = DMAController.dll

[DMA Transfer Manager.depends]
VDMSrv  = VDMServicesProvider

[DMA Transfer Manager.config]
minDMAPeriod = 5   ; these regulate the frequency of DMA ...
maxDMAPeriod = 15  ; ... activity (polling and updating)

;--------------------------------------------------------------------------------------------------------
; This module emulates a SoundBlaster-compatible card.
;--------------------------------------------------------------------------------------------------------

[SB Controller]
CLSID   = EmuSBCompat.SBCompatCtl
Path    = EmuSBCompat.dll

[SB Controller.depends]
VDMSrv  = VDMServicesProvider
DMACtl  = DMA Transfer Manager
WaveOut = SB Wave Player
AdLib   = AdLib Controller

[SB Controller.config]
version = 4.15      ; 1.05 for SB1.x, 2.01 for SB2, 3.02 for SBPro, 4.05 for SB16
port    = 0x220     ; usually 0x220 (can also be 210, 230, 240, 250, 260 or 280)
IRQ     = 7         ; usually 5 or 7
DMA8    = 1         ; usually 1
DMA16   = 5         ; usually 5

;; forceSampleRate = 22050
;; forceNumBits    = 16
;; forceChannels   = 2

;--------------------------------------------------------------------------------------------------------
; This module emulates an AdLib card.
;--------------------------------------------------------------------------------------------------------

[AdLib Controller]
CLSID   = EmuAdLib.AdLibCtl
Path    = EmuAdLib.dll

[AdLib Controller.depends]
VDMSrv  = VDMServicesProvider
WaveOut = AdLib Wave Player

[AdLib Controller.config]
port    = 0x388
sampleRate = 11025  ; sample rate at which to output sound, 44100 = max (highest quality but highest CPU% too), 8000 = min

;--------------------------------------------------------------------------------------------------------
; This module is used to play back the SB Wave data on a Windows DirectSound device
;--------------------------------------------------------------------------------------------------------

[SB Wave Player]
CLSID   = DSoundDevice.WaveOut  ; you can also use 'WaveDevice.WaveOut'
Path    = DSoundDevice.dll      ; you can also use 'WaveDevice.dll'

;; [SB Wave Player.depends]
;; waveOut = Wave Writer

[SB Wave Player.config]
device  = -1    ; -1 = the Wave/DirectSound mapper, 0 = first device, 1 = second, etc.
buffer  = 75    ; how many milliseconds of audio data to buffer

;--------------------------------------------------------------------------------------------------------
; This module is used to play back the AdLib data on a Windows DirectSound device
;--------------------------------------------------------------------------------------------------------

[AdLib Wave Player]
CLSID   = DSoundDevice.WaveOut  ; you can also use 'WaveDevice.WaveOut'
Path    = DSoundDevice.dll      ; you can also use 'WaveDevice.dll'

[AdLib Wave Player.config]
device  = -1    ; -1 = the Wave/DirectSound mapper, 0 = first device, 1 = second, etc.
buffer  = 75    ; how many milliseconds of audio data to buffer

;--------------------------------------------------------------------------------------------------------
; This module is used to dump Wave data to a raw PCM file
;--------------------------------------------------------------------------------------------------------

;; [Wave Writer]
;; CLSID   = DiskWriter.WaveOut
;; Path    = DiskWriter.dll

;
; Joystick Emulation
;

;--------------------------------------------------------------------------------------------------------
; This module emulates up to two analogue joysticks
; You can copy these sections (rename "Joystick Controller" to "Joystick Controller 1" and so on) and
; increment the copied port number if you need to emulate more than one gameport.
;--------------------------------------------------------------------------------------------------------

[Joystick Controller]
CLSID   = EmuJoystick.JoystickCtl
Path    = EmuJoystick.dll

[Joystick Controller.depends]
VDMSrv  = VDMServicesProvider

[Joystick Controller.config]
port        = 0x201     ; usually 0x201
minCoord    = 5         ; upper and left range trimming, 0 gives maximum range
maxCoord    = 250       ; bottom and right range trimming, decrease to boost joystick sensitivity, increase if jerky
pollPeriod  = 125       ; how many milliseconds should elapse between asynchronous joystick updates
mapFile     = joy1.map  ; allows you to pick from various joystick configurations

;--------------------------------------------------------------------------------------------------------
; This module emulates a parallel-port soundcard such as the Disney SoundSource
;--------------------------------------------------------------------------------------------------------

;; [ParallelPort DAC Controller]
;; CLSID   = EmuPPDAC.PPDACCtl
;; Path    = EmuPPDAC.dll
;;
;; [ParallelPort DAC Controller.depends]
;; VDMSrv  = VDMServicesProvider
;; WaveOut = ParallelPort DAC Wave Player
;;
;; [ParallelPort DAC Controller.config]
;; port       = 0x3bc  ; usually 0x278, 0x378 or 0x3bc
;; sampleRate = 11025  ; sample rate at which to output sound, 44100 = max (highest quality but highest CPU% too), 8000 = min
;;
;; [ParallelPort DAC Wave Player]
;; CLSID   = DSoundDevice.WaveOut  ; you can also use 'WaveDevice.WaveOut'
;; Path    = DSoundDevice.dll      ; you can also use 'WaveDevice.dll'
;;
;; [ParallelPort DAC Wave Player.config]
;; device  = -1    ; -1 = the Wave/DirectSound mapper, 0 = first device, 1 = second, etc.
;; buffer  = 75    ; how many milliseconds of audio data to buffer
