X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Flib%2F16_mm.h;h=36a23120e565fde31f552b18180a8a79457ceff5;hb=579be865a2f1d2a84d5295506f3e8ea9815d11af;hp=f890a3bb4faa21bce17f92adda6621e6fae45dfe;hpb=256be2f6f35912701d3e3770e49e388f462a6acc;p=proj16%2F16.git diff --git a/src/lib/16_mm.h b/src/lib/16_mm.h index f890a3bb..36a23120 100755 --- a/src/lib/16_mm.h +++ b/src/lib/16_mm.h @@ -1,19 +1,23 @@ -/* Catacomb Apocalypse Source Code - * Copyright (C) 1993-2014 Flat Rock Software +/* Project 16 Source Code~ + * Copyright (C) 2012-2020 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover * - * This program is free software; you can redistribute it and/or modify + * 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 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * 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, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 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. + * */ // ID_MM.H @@ -29,7 +33,7 @@ #ifdef __DEBUG__ // 1 == Debug/Dev ; 0 == Production/final #define OUT_OF_MEM_MSG "MM_GetPtr: Out of memory!\nYou were short :%lu bytes\n" #else -#define OUT_OF_MEM_MSG "\npee\n" +#define OUT_OF_MEM_MSG "\n" #endif //#define GETNEWBLOCK {if(!(mmnew=mmfree))Quit("MM_GETNEWBLOCK: No free blocks!") ;mmfree=mmfree->next;} @@ -37,8 +41,8 @@ #define FREEBLOCK(x) {*x->useptr=NULL;x->next=gvar->mm.mmfree;gvar->mm.mmfree=x;} -#define SAVENEARHEAP 0x200 // space to leave in data segment -#define SAVEFARHEAP 0x400 // space to leave in far heap +#define SAVENEARHEAP 0x400 // space to leave in data segment +#define SAVEFARHEAP 0 // space to leave in far heap #define BUFFERSIZE 0x1000 // miscelanious, allways available buffer @@ -92,17 +96,18 @@ //========================================================================== -//moved to typdefst +//typedef void _seg * memptr; //moved to 16_t.h + /*typedef struct { dword nearheap,farheap,EMSmem,XMSmem,mainmem; -} mminfotype;*/ +} mminfotype;*/ //moved to 16_tdef.h //========================================================================== extern void (* beforesort) (void); extern void (* aftersort) (void); -extern void (* XMSaddr) (void); // far pointer to XMS driver +//extern void (* XMSaddr) (void); // far pointer to XMS driver extern dword XMSDriver; extern word XMSVer; @@ -175,35 +180,37 @@ typedef struct //========================================================================== -boolean MML_CheckForEMS(void); +boolean MML_CheckForEMS (void); //byte MML_SetupEMS(mminfo_t *mm); //void MML_ShutdownEMS(mminfo_t *mm); -byte MM_MapEMS(global_game_variables_t *gvar); +//byte MM_MapEMS(global_game_variables_t *gvar); //byte MM_MapXEMS(global_game_variables_t *gvar); -boolean MML_CheckForXMS(void); +boolean MML_CheckForXMS (void); //void MML_SetupXMS(mminfo_t *mm, mminfotype *mmi); //void MML_ShutdownXMS(mminfo_t *mm); -void MML_UseSpace(word segstart, dword seglength, global_game_variables_t *gvar); -void MML_ClearBlock(global_game_variables_t *gvar); - -void MM_Startup(global_game_variables_t *gvar); -void MM_Shutdown(global_game_variables_t *gvar); - -void MM_GetPtr(memptr *baseptr,dword size, global_game_variables_t *gvar); -void MM_FreePtr(memptr *baseptr, global_game_variables_t *gvar); -void MM_SetPurge(memptr *baseptr, int purge, global_game_variables_t *gvar); -void MM_SetLock(memptr *baseptr, boolean locked, global_game_variables_t *gvar); -void MM_SortMem(global_game_variables_t *gvar); -void MM_ShowMemory(global_game_variables_t *gvar); -void MM_DumpData(global_game_variables_t *gvar); -dword MM_UnusedMemory(global_game_variables_t *gvar); -dword MM_TotalFree(global_game_variables_t *gvar); -void MM_Report_(global_game_variables_t *gvar); -/*static */void MM_EMSerr(byte *stri, byte err); -void MM_BombOnError(boolean bomb, global_game_variables_t *gvar); +void MML_UseSpace (unsigned segstart, unsigned seglength, global_game_variables_t *gvar); +void MML_ClearBlock (global_game_variables_t *gvar); + +void MM_Reset (global_game_variables_t *gvar); +void MM_Startup (global_game_variables_t *gvar); +void MM_Shutdown (global_game_variables_t *gvar); + +void MM_GetPtr (memptr *baseptr,dword size, global_game_variables_t *gvar); +void MM_FreePtr (memptr *baseptr, global_game_variables_t *gvar); +void MM_SetPurge (memptr *baseptr, int purge, global_game_variables_t *gvar); +void MM_SetLock (memptr *baseptr, boolean locked, global_game_variables_t *gvar); +void MM_SortMem (global_game_variables_t *gvar); +void MM_ShowMemory (global_game_variables_t *gvar); +//void MM_ShowMemoryDetail (unsigned x, unsigned y, unsigned w, unsigned q, sdword end, mmshowmemoryinfo_t *scaninfo, global_game_variables_t *gvar); +void MM_DumpData (global_game_variables_t *gvar); +dword MM_UnusedMemory (global_game_variables_t *gvar); +dword MM_TotalFree (global_game_variables_t *gvar); +void MM_Report_ (global_game_variables_t *gvar); +/*static */void MM_EMSerr (byte *stri, byte err); +void MM_BombOnError (boolean bomb, global_game_variables_t *gvar); //void MM_GetNewBlock(mminfo_t *mm); //void MM_FreeBlock(mmblocktype *x, mminfo_t *mm); -void xms_call(byte v, global_game_variables_t *gvar); +void xms_call (byte v, global_game_variables_t *gvar); //==========================================================================