]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/16_tail_.c
code miraculously works on real hardware
[16.git] / src / lib / 16_tail_.c
index 10ef73953477103afad322c014f91de2bd11f75d..50ccaddcd7f12414987a6c77cbb53dff946b268f 100755 (executable)
@@ -1,8 +1,45 @@
+/* Project 16 Source Code~\r
+ * Copyright (C) 2012-2019 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
+ *\r
+ * This file is part of Project 16.\r
+ *\r
+ * Project 16 is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 3 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * Project 16 is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>, or\r
+ * write to the Free Software Foundation, Inc., 51 Franklin Street,\r
+ * Fifth Floor, Boston, MA 02110-1301 USA.\r
+ *\r
+ */\r
+/*\r
+ * 16 tail library\r
+ */\r
+\r
 #include "src/lib/16_tail.h"\r
+#include "src/lib/16_vl.h"\r
 \r
-void   TL_VidInit(global_game_variables_t *gvar)\r
+//===========================================================================\r
+\r
+/*\r
+====================\r
+=\r
+= TL_DosLibStartup\r
+=\r
+====================\r
+*/\r
+\r
+void TL_DosLibStartup(global_game_variables_t *gvar)\r
 {\r
-       start_timer(gvar);\r
+       if(gvar->DLStarted)\r
+               return;\r
 \r
        // DOSLIB: check our environment\r
        probe_dos();\r
@@ -34,10 +71,94 @@ void        TL_VidInit(global_game_variables_t *gvar)
        _DEBUGF("Serial debug output printf test %u %u %u\n",1U,2U,3U);\r
 \r
        textInit();\r
+       gvar->DLStarted = true;\r
+}\r
+\r
+//===========================================================================\r
+\r
+/*\r
+====================\r
+=\r
+= TL_VidInit\r
+=\r
+====================\r
+*/\r
+\r
+void   TL_VidInit(global_game_variables_t *gvar)\r
+{\r
+       start_timer(gvar);      //i do not remeber why this is here wwww i think it should be somewhere else www\r
+\r
+       if(!gvar->DLStarted) TL_DosLibStartup(gvar);\r
 \r
        // get old video mode\r
        //in.h.ah = 0xf;\r
        //int86(0x10, &in, &out);\r
-       if(!gvar->video.old_mode) gvar->video.old_mode = vgaGetMode();//out.h.al;\r
+       if(!gvar->video.old_mode) gvar->video.old_mode = VL_vgaGetMode();//out.h.al;\r
        gvar->video.VL_Initiated = 1;\r
 }\r
+\r
+//===========================================================================\r
+\r
+/*\r
+=============================================================================\r
+\r
+                                               MUSIC STUFF\r
+\r
+=============================================================================\r
+*/\r
+\r
+\r
+/*\r
+=================\r
+=\r
+= StopMusic\r
+=\r
+=================\r
+*/\r
+#if 0\r
+void PL_StopMusic(global_game_variables_t *gvar)\r
+{\r
+       int     i;\r
+\r
+       SD_MusicOff();\r
+       for (i = 0;i < LASTMUSIC;i++)\r
+               if (gvar->ca.audiosegs[STARTMUSIC + i])\r
+               {\r
+                       MM_SetPurge(MEMPTRCONV gvar->ca.audiosegs[STARTMUSIC + i],3, gvar);\r
+                       MM_SetLock(MEMPTRCONV gvar->ca.audiosegs[STARTMUSIC + i],false, gvar);\r
+               }\r
+}\r
+\r
+//==========================================================================\r
+\r
+\r
+/*\r
+=================\r
+=\r
+= StartMusic\r
+=\r
+=================\r
+*/\r
+\r
+void PL_StartMusic(global_game_variables_t *gvar)\r
+{\r
+       musicnames      chunk;\r
+\r
+       SD_MusicOff();\r
+       chunk = 0;//++++songs[gamestate.mapon+gamestate.episode*10];\r
+\r
+//     if ((chunk == -1) || (MusicMode != smm_AdLib))\r
+//DEBUG control panel          return;\r
+\r
+//++++ MM_BombOnError (false,gvar);\r
+//++++ CA_CacheAudioChunk(STARTMUSIC + chunk, gvar);\r
+//++++ MM_BombOnError (true,gvar);\r
+//++++ if (gvar->mm.mmerror)\r
+//++++         gvar->mm.mmerror = false;\r
+//++++ else\r
+//++++ {\r
+               MM_SetLock(MEMPTRCONV gvar->ca.audiosegs[STARTMUSIC + chunk],true, gvar);\r
+               SD_StartMusic((MusicGroup far *)gvar->ca.audiosegs[STARTMUSIC + chunk]);\r
+//++++ }\r
+}\r
+#endif //disabled due to some fuckery i am not sure.\r