From 9bd9229921a81b5bd735a2fbf464288400c62503 Mon Sep 17 00:00:00 2001 From: sparky4 Date: Fri, 23 Sep 2016 13:26:30 -0500 Subject: [PATCH] added debug variable --- src/exmmtest.c | 17 +++++++++-------- src/lib/16_pm.c | 2 ++ src/lib/16_pm.h | 4 +++- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/exmmtest.c b/src/exmmtest.c index a1e0391f..f9582832 100755 --- a/src/exmmtest.c +++ b/src/exmmtest.c @@ -86,6 +86,7 @@ main(int argc, char *argv[]) //file name // gvar.mm.mmstarted=0; + pmdebug=0; //PRINTBB if(argv[1]){ bakapee1 = argv[1]; @@ -97,11 +98,12 @@ main(int argc, char *argv[]) } //printf("main()=%Fp start MM\n", *argv[0]); MM_Startup(&gvar); -#ifdef __DEBUG_PM__ - PM_Startup(&gvar); - //PM_CheckMainMem(&gvar); - PM_UnlockMainMem(&gvar); -#endif + if(pmdebug>0) + { + PM_Startup(&gvar); + PM_CheckMainMem(&gvar); + PM_UnlockMainMem(&gvar); + } CA_Startup(&gvar); // printf(" done!\n"); PRINTBB; @@ -149,9 +151,8 @@ for(w=0;w<2;w++) printf("bakapee1=%s\n", bakapee1); printf("bakapee2=%s\n", bakapee2); MM_FreePtr(&bigbuffer, &gvar); -#ifdef __DEBUG_PM__ - PM_Shutdown(&gvar); -#endif + if(pmdebug>0) + PM_Shutdown(&gvar); CA_Shutdown(&gvar); MM_Shutdown(&gvar); free(bakapee1); free(bakapee2); diff --git a/src/lib/16_pm.c b/src/lib/16_pm.c index 9e4d608a..b472e58b 100755 --- a/src/lib/16_pm.c +++ b/src/lib/16_pm.c @@ -29,6 +29,8 @@ #include "src/lib/16_pm.h" #pragma hdrstop +boolean pmdebug=0; + /* // Main Mem specific variables boolean MainPresent; diff --git a/src/lib/16_pm.h b/src/lib/16_pm.h index b9d801e1..a8510f17 100755 --- a/src/lib/16_pm.h +++ b/src/lib/16_pm.h @@ -33,6 +33,8 @@ #include "src/lib/16_mm.h" #include +extern boolean pmdebug; + /*// NOTE! PMPageSize must be an even divisor of EMSPageSize, and >= 1024 #define EMSPageSize 16384 #define EMSPageSizeSeg (EMSPageSize >> 4) @@ -110,5 +112,5 @@ extern void PM_Startup(global_game_variables_t *gvar), extern memptr PM_GetPageAddress(int pagenum, global_game_variables_t *gvar), PM_GetPage(int pagenum, global_game_variables_t *gvar); // Use this one to cache page -//void PM_SetMainMemPurge(int level, global_game_variables_t *gvar); +void PM_SetMainMemPurge(int level, global_game_variables_t *gvar); #endif -- 2.39.5