3 * Adlib OPL2/OPL3 FM synthesizer chipset test program.
4 * Play MIDI file using the OPLx synthesizer (well, poorly anyway)
5 * (C) 2010-2012 Jonathan Campbell.
6 * Hackipedia DOS library.
8 * This code is licensed under the LGPL.
9 * <insert LGPL legal text here>
11 * Compiles for intended target environments:
12 * - MS-DOS [pure DOS mode, or Windows or OS/2 DOS Box]
15 #include "src/lib/16_head.h"
16 #include "src/lib/16_tail.h"
17 #include "src/lib/16_pm.h"
18 #include "src/lib/16_ca.h"
19 #include "src/lib/16_mm.h"
20 #include "src/lib/16_hc.h"
21 #include "src/lib/16_dbg.h"
22 #include "src/lib/16_sd.h"
24 extern struct glob_game_vars *ggvv;
26 void main(int argc,char **argv) {
27 static global_game_variables_t gvar;
38 printf("ADLIB FM test program IMFPLAY\n");
40 printf("You must specify an IMF file to play\n"); ShutdownCAMMPM(&gvar);
46 if (!SD_imf_load_music(argv[1], &gvar)) {
47 printf("Failed to load IMF Music\n"); ShutdownCAMMPM(&gvar);
51 SD_StartupTimer(&gvar);
56 adv = gvar.ca.sd.irq0_ticks - gvar.ca.sd.ptick;
57 if (adv >= 100UL) adv = 100UL;
58 gvar.ca.sd.ptick = gvar.ca.sd.irq0_ticks;
68 if (c == 0) c = getch() << 8;
75 //0000 printf("contents of the imf_music\n[\n%s\n]\n", gvar.ca.sd.imf_music);
77 SD_imf_free_music(&gvar);
81 write_8254_system_timer(0); /* back to normal 18.2Hz */
82 ShutdownCAMMPM(&gvar);