]> 4ch.mooo.com Git - 16.git/commitdiff
p16 is being worked on a bunch by me wwww [16_ca needs huge amounts of work and I...
authorsparky4 <sparky4@cock.li>
Fri, 7 Apr 2017 20:52:27 +0000 (15:52 -0500)
committersparky4 <sparky4@cock.li>
Fri, 7 Apr 2017 20:52:27 +0000 (15:52 -0500)
src/imfplay.c
src/lib/16_sd.c

index 3aefa2d2e8f47008378ed33693798f96911ec70c..415bcfb85eb073448d8b392667076ed24fe41946 100755 (executable)
@@ -207,14 +207,7 @@ void main(int argc,char **argv) {
                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");
@@ -222,14 +215,9 @@ void main(int argc,char **argv) {
        }
 
        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();
index f48ae2c05501fac4a7b1f7c828593efca09b2eae..3e4cfc00e6acfd4468e5484a729a9c6a937cde29 100755 (executable)
@@ -199,14 +199,29 @@ void FMSetVoice(int voiceNum, FMInstrument *ins){
 \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