// If there's more than our minimum (2 pages) available, allocate it (up\r
// to the maximum we need)\r
//\r
+// Please call MML_CheckForEMS() before calling this function.\r
+// MML_CheckForEMS is not local despite the name wwww.\r
+//\r
\r
boolean\r
PML_StartupEMS(global_game_variables_t *gvar)\r
byte err=0, str[64];\r
\r
boolean errorflag=false;\r
- static char emmname[] = "EMMXXXX0"; //fix by andrius4669\r
unsigned EMSVer;\r
unsigned totalEMSpages,freeEMSpages,EMSPageFrame,EMSHandle,EMSAvail;\r
totalEMSpages = freeEMSpages = EMSPageFrame = EMSHandle = EMSAvail = EMSVer = 0; // set all to 0~\r
gvar->pm.emm.EMSAvail = gvar->mmi.EMSmem = 0;\r
\r
__asm {\r
- mov dx,OFFSET emmname //fix by andrius4669\r
- mov ax,0x3d00\r
- int EMM_INT // try to open EMMXXXX0 device\r
- jc error1\r
-\r
- mov bx,ax\r
- mov ax,0x4400\r
-\r
- int EMM_INT // get device info\r
- jc error1\r
-\r
- and dx,0x80\r
- jz error1\r
-\r
- mov ax,0x4407\r
-\r
- int EMM_INT // get status\r
- jc error1\r
- or al,al\r
- jz error1\r
-\r
- mov ah,0x3e\r
- int EMM_INT // close handle\r
- jc error1\r
-\r
+ //MML_CheckForEMS() takes care of what the code did here\r
mov ah,EMS_STATUS\r
int EMS_INT\r
jc error1 // make sure EMS hardware is present\r