X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Flib%2F16_pm.c;h=03df02377c4c8e6c20d801e6b12ccfcefc5f811d;hb=c9ea53d56f793c6abcf528c20590c02804dde275;hp=4cf503968b292a4b375c229e4e08e926758c08ad;hpb=52711700f92f02fe8976d2e035a04a4501842b9f;p=16.git diff --git a/src/lib/16_pm.c b/src/lib/16_pm.c index 4cf50396..03df0237 100755 --- a/src/lib/16_pm.c +++ b/src/lib/16_pm.c @@ -1,5 +1,5 @@ /* Project 16 Source Code~ - * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover + * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover * * This file is part of Project 16. * @@ -165,6 +165,9 @@ PML_StartupEMS(global_game_variables_t *gvar) static char emmname[] = "EMMXXXX0"; //fix by andrius4669 unsigned int EMSVer = 0; unsigned totalEMSpages,freeEMSpages,EMSPageFrame,EMSHandle=0,EMSAvail=0; +#ifdef __DEBUG_PM__ + word e=0; +#endif totalEMSpages = freeEMSpages = EMSPageFrame = 0; gvar->pm.emm.EMSPresent = false; // Assume that we'll fail gvar->pm.emm.EMSAvail = 0; @@ -175,27 +178,37 @@ PML_StartupEMS(global_game_variables_t *gvar) mov ax,0x3d00 int EMM_INT // try to open EMMXXXX0 device jc error1 - +#ifdef __DEBUG_PM__ + add e,1 +#endif mov bx,ax mov ax,0x4400 int EMM_INT // get device info jc error1 - +#ifdef __DEBUG_PM__ + add e,1 +#endif and dx,0x80 jz error1 - +#ifdef __DEBUG_PM__ + add e,1 +#endif mov ax,0x4407 int EMM_INT // get status jc error1 or al,al jz error1 - +#ifdef __DEBUG_PM__ + add e,1 +#endif mov ah,0x3e int EMM_INT // close handle jc error1 - +#ifdef __DEBUG_PM__ + add e,1 +#endif mov ah,EMS_STATUS int EMS_INT jc error1 // make sure EMS hardware is present @@ -232,6 +245,9 @@ PML_StartupEMS(global_game_variables_t *gvar) error1: #ifdef __BORLANDC__ __asm { +#endif +#ifdef __DEBUG_PM__ + mov e,1 #endif mov err,ah mov errorflag,1 @@ -270,6 +286,9 @@ End1: error2: #ifdef __BORLANDC__ __asm { +#endif +#ifdef __DEBUG_PM__ + mov e,1 #endif mov err,ah mov errorflag,1 @@ -296,6 +315,10 @@ End2: strcpy(str,"PML_StartupEMS: EMS error "); MM_EMSerr(str, err); printf("%s\n",str); +#ifdef __DEBUG_PM__ + printf("e=%u\n", e); + getch(); +#endif return(gvar->pm.emm.EMSPresent); }