mov dx,OFFSET emmname //fix by andrius4669\r
mov ax,0x3d00\r
int EMS_INT // try to open EMMXXXX0 device\r
- jc erroreu\r
+ jc error1\r
\r
mov bx,ax\r
mov ax,0x4400\r
\r
int EMS_INT // get device info\r
- jc erroreu\r
+ jc error1\r
\r
and dx,0x80\r
- jz erroreu\r
+ jz error1\r
\r
mov ax,0x4407\r
\r
int EMS_INT // get status\r
- jc erroreu\r
+ jc error1\r
or al,al\r
- jz erroreu\r
+ jz error1\r
\r
mov ah,0x3e\r
int EMS_INT // close handle\r
- jc erroreu\r
+ jc error1\r
\r
mov ah,EMS_STATUS\r
int EMS_INT\r
- jc erroreu // make sure EMS hardware is present\r
+ jc error1 // make sure EMS hardware is present\r
\r
mov ah,EMS_VERSION\r
int EMS_INT // only work on EMS 3.2 or greater (silly, but...)\r
or ah,ah\r
- jnz erroreu\r
+ jnz error1\r
mov [EMSVer],ax // set EMSVer\r
cmp al,0x32 // only work on ems 3.2 or greater\r
- jb erroreu\r
+ jb error1\r
\r
mov ah,EMS_GETFRAME\r
int EMS_INT // find the page frame address\r
or ah,ah\r
- jnz erroreu\r
+ jnz error1\r
mov [EMSPageFrame],bx\r
\r
mov ah,EMS_GETPAGES\r
int EMS_INT // find out how much EMS is there\r
or ah,ah\r
- jnz erroreu\r
+ jnz error1\r
or bx,bx\r
jz noEMS // no EMS at all to allocate\r
cmp bx,2\r
mov [totalEMSpages],dx\r
mov [freeEMSpages],bx\r
mov [EMSAvail],bx\r
- jmp Endeu\r
+ jmp End1\r
#ifdef __BORLANDC__\r
}\r
#endif\r
- erroreu:\r
+ error1:\r
#ifdef __BORLANDC__\r
__asm {\r
#endif\r
mov err,ah\r
mov errorflag,1\r
- jmp Endeu\r
+ jmp End1\r
#ifdef __BORLANDC__\r
}\r
#endif\r
- noEMS:\r
- Endeu:\r
+noEMS:\r
+End1:\r
#ifdef __WATCOMC__\r
}\r
#endif\r
*/\r
__asm {\r
mov ah,EMS_ALLOCPAGES\r
- mov bx,[EMSAvail]\r
+ mov bx,[EMSAvail];\r
int EMS_INT\r
or ah,ah\r
- jnz erroreuu\r
+ jnz error2\r
mov [EMSHandle],dx\r
- jmp Endeuu\r
+ jmp End2\r
#ifdef __BORLANDC__\r
}\r
#endif\r
- erroreuu:\r
+ error2:\r
#ifdef __BORLANDC__\r
__asm {\r
#endif\r
mov err,ah\r
mov errorflag,1\r
- jmp Endeuu\r
+ jmp End2\r
#ifdef __BORLANDC__\r
}\r
#endif\r
- Endeuu:\r
+End2:\r
#ifdef __WATCOMC__\r
}\r
#endif\r
\r
if(errorflag==false)\r
{\r
- //gvar->pm.emm.EMSAvail = EMSAvail;\r
- //gvar->mmi.EMSmem = gvar->pm.emm.EMSAvail * (dword)EMSPageSize;\r
gvar->mmi.EMSmem = EMSAvail * (dword)EMSPageSize;\r
\r
// Initialize EMS mapping cache\r
\r
gvar->pm.emm.EMSPresent = true; // We have EMS\r
gvar->pm.emm.EMSPageFrame = EMSPageFrame;\r
+ gvar->pm.emm.EMSAvail = EMSAvail;\r
gvar->pm.emm.EMSVer = EMSVer;\r
gvar->pm.emm.EMSHandle = EMSHandle;\r
gvar->pm.emm.freeEMSpages = freeEMSpages;\r