--- /dev/null
+@echo off\r
+iff exist %* then\r
+ del %*\r
+endiff\r
+setlocal\r
+set url="138.47.241.23"\r
+rem for %@eval[%#+1] in (%*) do (\r
+rem for %# in (1,1,%*) do (\r
+:loop\r
+ set /a o=0\r
+:oooo\r
+ set /a q=%@EVAL[%@LEN[%1] - 4]\r
+ set w=%@INSTR[0,%q,%1]\r
+ iff NOT "%w" == "" then\r
+ set /a o=%o+1\r
+ set y=%w.z%o\r
+rem echo y=%y\r
+ if %o lt 100 (\r
+ if %o lt 10 (\r
+ set z=00%o\r
+ ) else (\r
+ set z=0%o\r
+ ) endif\r
+ ) else if %o gt 99 (\r
+ set z=%o\r
+ ) endif\r
+\r
+ htget http://%url/%1.zip.%z > %y\r
+rem pause\r
+ iff NOT "%@FILESIZE[%y,b]" == "0" then\r
+ type %y >> %w.zip\r
+ iff "%@FILESIZE[%y,b]" == "65536" then\r
+rem echo o=%o\r
+ goto oooo\r
+ endiff\r
+ iff NOT "%#" == "0" then\r
+ shift /1\r
+ iff exist %w.zip then\r
+ unzip %w.zip\r
+ del %w.z*\r
+ endiff\r
+ goto loop\r
+ else\r
+ del %#\r
+ endiff\r
+ else\r
+ del %y\r
+ echo Error null zip file wwww\r
+ endiff\r
+ else\r
+ rem del %y.z*\r
+ rem need to add a cleaner wwww\r
+ echo done~ wwww\r
+ endiff\r
+rem echo y="%y"\r
+rem echo q=%q\r
+rem echo o=%o\r
+rem echo w=%w\r
+rem echo %%1=%1\r
+endlocal\r
printf("debugmm: %u\t", dbg_debugmm);\r
#endif\r
#ifdef __DEBUG_PM__\r
- printf("debugpm: %u", dbg_ddebugpm);\r
+ printf("debugpm: %u", dbg_debugpm);\r
#endif\r
printf("\n");\r
#endif\r
#define __DEBUG_InputMgr__\r
#define __DEBUG_MAP__\r
//#define __DEBUG_CA__\r
-//#define __DEBUG_PM__\r
+#define __DEBUG_PM__\r
//#define __DEBUG_MM__\r
\r
\r
PML_StartupEMS(global_game_variables_t *gvar)\r
{\r
int i;\r
- long size;\r
+ //long size;\r
byte err=0, str[64];\r
\r
boolean errorflag=false;\r
static char emmname[] = "EMMXXXX0"; //fix by andrius4669\r
unsigned int EMSVer = 0;\r
unsigned totalEMSpages,freeEMSpages,EMSPageFrame,EMSHandle=0,EMSAvail=0;\r
+#ifdef __DEBUG_PM__\r
+ word e=0;\r
+#endif\r
totalEMSpages = freeEMSpages = EMSPageFrame = 0;\r
gvar->pm.emm.EMSPresent = false; // Assume that we'll fail\r
gvar->pm.emm.EMSAvail = 0;\r
mov ax,0x3d00\r
int EMM_INT // try to open EMMXXXX0 device\r
jc error1\r
-\r
+#ifdef __DEBUG_PM__\r
+ add e,1\r
+#endif\r
mov bx,ax\r
mov ax,0x4400\r
\r
int EMM_INT // get device info\r
jc error1\r
-\r
+#ifdef __DEBUG_PM__\r
+ add e,1\r
+#endif\r
and dx,0x80\r
jz error1\r
-\r
+#ifdef __DEBUG_PM__\r
+ add e,1\r
+#endif\r
mov ax,0x4407\r
\r
int EMM_INT // get status\r
jc error1\r
or al,al\r
jz error1\r
-\r
+#ifdef __DEBUG_PM__\r
+ add e,1\r
+#endif\r
mov ah,0x3e\r
int EMM_INT // close handle\r
jc error1\r
-\r
+#ifdef __DEBUG_PM__\r
+ add e,1\r
+#endif\r
mov ah,EMS_STATUS\r
int EMS_INT\r
jc error1 // make sure EMS hardware is present\r
error1:\r
#ifdef __BORLANDC__\r
__asm {\r
+#endif\r
+#ifdef __DEBUG_PM__\r
+ mov e,1\r
#endif\r
mov err,ah\r
mov errorflag,1\r
#ifdef __WATCOMC__\r
}\r
#endif\r
-//*\r
+/*\r
if(errorflag==false)\r
{\r
// Don't hog all available EMS\r
gvar->pm.emm.EMSAvail = size / EMSPageSize;\r
}\r
}\r
-//*/\r
+*/\r
__asm {\r
mov ah,EMS_ALLOCPAGES\r
mov bx,[EMSAvail];\r
error2:\r
#ifdef __BORLANDC__\r
__asm {\r
+#endif\r
+#ifdef __DEBUG_PM__\r
+ mov e,1\r
#endif\r
mov err,ah\r
mov errorflag,1\r
strcpy(str,"PML_StartupEMS: EMS error ");\r
MM_EMSerr(str, err);\r
printf("%s\n",str);\r
+#ifdef __DEBUG_PM__\r
+ printf("e=%u\n", e);\r
+ getch();\r
+#endif\r
return(gvar->pm.emm.EMSPresent);\r
}\r
\r