Attached find my patch to DOSBox which directly logs to .VGM files instead of .DRO files. The program logs writes to the Tandy 1000/PCjr's SN76496 chip, the Game Blaster (SAA1099), the OPL2/Dual OPL2/OPL3 chip, the PC speaker (via an AY-3-8910), and the Sound Blaster and Tandy SL/TL/RL DACs (via an YM2612). DAC and PC speaker are only logged if "capturepcm" and "capturespeaker" in the [dosbox] section of DOSBox.conf are set to "true", respectively; they are "false" by default, and can only be changed from the config file, not within a DOSBox session from the command line. I have only added PC speaker support for that one game (4D Boxing) that uses it as a fourth PSG channel, but theoretically one could also use it to create a .VGM pack of scratchy sound effects from Commander Keen episodes 1-3. Similarly, I have added DAC logging only for the few games that use it for drums; therefore, it only works with single-cycle 8-bit transfers when the whole sample in memory at the time that the DMA transfer is started (i.e. no double-buffering).
The source code diff also incorporates my
correction to the Game Blaster base clock,
my patch adding support for Tandy 1000 direct DAC writes, and
my patch correcting the interpretation of SN76496 frequency register value 0. As mentioned in one of these discussion threads, when using the Tandy DAC, "sbtype=" should be set to "none" in the [sblaster] section of DOSBox.conf. The source code diff is against SVN r4000, as revisions
r4002 and r4003 from two days ago made some changes to the mixer code that break my Tandy DAC code. Just download SVN r4003 and replace mixer.cpp and mixer.h with those from r4000. As I am using a few C++14 features, before compiling, you need to re-run "configure" with the CPPFLAGS="-std=gnu++14" option, e.g.
Code: Select all
./configure --enable-core-inline LDFLAGS="-static-libgcc -static-libstdc++ -s" CPPFLAGS="-std=gnu++14"
The default key to start capturing is still Ctrl+Alt+F7; even the name in the key bindings ("mapper") file is still "hand_caprawopl", so I wouldn't have to change my key binding file. I tried to start logging in the middle of a 4-OP FM song, and the playback still seemed correct, so I hope I did the register cache business correctly, and I have taken care that no OPL register writes are filtered (i.e. no implicit vgm_cmp).