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