#include "src/lib/16_ca.h"\r
#include "src/lib/16_mm.h"\r
#include "src/lib/16_hc.h"\r
+#include "src/lib/16_lib.h"\r
//#include "src/lib/modex16.h"\r
#pragma hdrstop\r
\r
#pragma warn -use\r
\r
//file load or read definition\r
-#define FILERL\r
-//#define FILEREAD\r
+#define FILEREAD\r
+//#define EXMMVERBOSE\r
\r
#define PRINTBB { printf("&main()= %Fp\n", argv[0]);printf("bigbuffer= %Fp\n", bigbuffer);printf("&bigbuffer= %Fp\n", &bigbuffer);printf("bigbuffer= %04x\n", bigbuffer);printf("&bigbuffer= %04x\n", &bigbuffer); }\r
\r
void\r
main(int argc, char *argv[])\r
{\r
+ byte w=1;\r
global_game_variables_t gvar;\r
#ifdef __WATCOMC__\r
__segment sega;\r
#endif\r
memptr bigbuffer;\r
\r
-#ifdef FILERL\r
//static byte bakapee[64];\r
- char *bakapee;\r
+ char *bakapee1, *bakapee2;\r
word baka;\r
-#endif\r
\r
#ifdef __BORLANDC__\r
argc=argc;\r
#endif\r
-#ifdef FILERL\r
- bakapee = malloc(64);\r
-#endif\r
+ //file name //\r
+ bakapee1 = malloc(64);\r
+ bakapee2 = malloc(64);\r
+ //file name //\r
+\r
gvar.mm.mmstarted=0;\r
\r
//PRINTBB\r
-#ifdef FILERL\r
- if(argv[1]) bakapee = argv[1];\r
- else\r
+ if(argv[1]){ bakapee1 = argv[1];\r
+ if(argv[2]) bakapee2 = argv[2]; }\r
+ else{\r
//{ printf("filename!: "); scanf("%[^\n]", &bakapee); }\r
- bakapee = "data/koishi~.pcx";\r
-#endif\r
-\r
+ bakapee1 = "data/koishi~.pcx";\r
+ bakapee2 = "data/test.map";\r
+ }\r
// printf("main()=%Fp start MM\n", *argv[0]);\r
MM_Startup(&gvar.mm, &gvar.mmi);\r
//PM_Startup();\r
PRINTBB;\r
// printf("press any key to continue!\n");\r
// getch();\r
-#ifdef FILERL\r
+#ifdef FILEREAD\r
+for(w=0;w<2;w++)\r
+{\r
// bakapeehandle = open(bakapee,O_RDONLY | O_BINARY, S_IREAD);\r
// printf("size of big buffer~=%u\n", _bmsize(segu, bigbuffer));\r
// if(CA_FarRead(bakapeehandle,(void far *)&bigbuffer,sizeof(bigbuffer),&gvar.mm))\r
-#ifdef FILEREAD\r
- printf(" read\n");\r
- if(CA_ReadFile(bakapee, &bigbuffer, &gvar))\r
-#else\r
- printf(" load\n");\r
- if(CA_LoadFile(bakapee, &bigbuffer, &gvar))\r
+ if(w>0)\r
+ {\r
+ printf(" read\n");\r
+ if(CA_ReadFile(bakapee2, &bigbuffer, &gvar)) baka=1; else baka=0;\r
+ }\r
#endif\r
- baka=1;\r
- else\r
- baka=0;\r
+ if(w==0)\r
+ {\r
+ printf(" load\n");\r
+ if(CA_LoadFile(bakapee1, &bigbuffer, &gvar)) baka=1; else baka=0;\r
+ }\r
// close(bakapeehandle);\r
//hmm functions in cache system use the buffered stuff\r
#ifdef __WATCOMC__\r
printf("\nsize of big buffer~=%u\n", _bmsize(sega, bigbuffer));\r
#endif\r
-#endif\r
+\r
printf("contents of the buffer\n[\n%s\n]\n", bigbuffer);\r
//printf("dark purple = purgable\n");\r
//printf("medium blue = non purgable\n");\r
getch();\r
MM_ShowMemory(&gvar, &gvar.mm);\r
MM_DumpData(&gvar.mm);\r
- MM_Report(&gvar);\r
+ MM_Report_(&gvar);\r
+ if(baka) printf("\nyay!\n");\r
+ else printf("\npoo!\n");\r
printf("press any key to continue!\n");\r
getch();\r
-#ifdef FILERL\r
- MM_FreePtr(&bigbuffer, &gvar.mm);\r
+#ifdef FILEREAD\r
+}\r
#endif\r
+ MM_FreePtr(&bigbuffer, &gvar.mm);\r
//PM_Shutdown();\r
CA_Shutdown(&gvar);\r
MM_Shutdown(&gvar.mm);\r
-#ifdef FILERL\r
- free(bakapee);\r
- if(baka) printf("\nyay!\n");\r
- else printf("\npoo!\n");\r
-#endif\r
+ free(bakapee1); free(bakapee2);\r
printf("========================================\n");\r
printf("near= %Fp ", gvar.mm.nearheap);\r
printf("far= %Fp", gvar.mm.farheap);\r