return;
}
- if (!init_adlib()) {
- printf("Cannot init library\n");
- return;
- }
- if (!probe_8254()) { /* we need the timer to keep time with the music */
- printf("8254 timer not found\n");
- return;
- }
+ SD_Initimf(&gvar);
if (!SD_imf_load_music(argv[1], &gvar)) {
printf("Failed to load IMF Music\n");
}
write_8254_system_timer(T8254_REF_CLOCK_HZ / tickrate);
- gvar.ca.sd.irq0_cnt = 0;
- gvar.ca.sd.irq0_add = 182;
- gvar.ca.sd.irq0_max = 1000; /* about 18.2Hz */
old_irq0 = _dos_getvect(8);/*IRQ0*/
_dos_setvect(8,irq0);
- SD_adlib_shut_up();
- shutdown_adlib_opl3(); // NTS: Apparently the music won't play otherwise
_cli();
gvar.ca.sd.irq0_ticks = ptick = 0;
_sti();
\r
void SD_Initimf(global_game_variables_t *gvar)\r
{\r
+ if (!init_adlib()) {\r
+ printf("Cannot init library\n");\r
+ return;\r
+ }\r
+ if (!probe_8254()) { /* we need the timer to keep time with the music */\r
+ printf("8254 timer not found\n");\r
+ return;\r
+ }\r
+\r
gvar->ca.sd.irq0_ticks=\r
- gvar->ca.sd.irq0_cnt=\r
- gvar->ca.sd.irq0_add=\r
+ //gvar->ca.sd.irq0_cnt=\r
+ //gvar->ca.sd.irq0_add=\r
gvar->ca.sd.imf_delay_countdown=\r
gvar->ca.sd.irq0_max=0;\r
gvar->ca.sd.imf_music=\r
gvar->ca.sd.imf_play_ptr=\r
gvar->ca.sd.imf_music_end=NULL;\r
+ gvar->ca.sd.irq0_cnt = 0;\r
+ gvar->ca.sd.irq0_add = 182;\r
+ gvar->ca.sd.irq0_max = 1000; /* about 18.2Hz */\r
+\r
+ SD_adlib_shut_up();\r
+ shutdown_adlib_opl3(); // NTS: Apparently the music won't play otherwise\r
}\r
\r
void SD_imf_free_music(global_game_variables_t *gvar)\r