+ static global_game_variables_t gvar;\r
+ static map_t map;\r
+#ifdef DUMP\r
+#ifdef DUMP_MAP\r
+ short i;\r
+ word k;\r
+#endif\r
+#endif\r
+ char *fmt = "Memory available = %u\n";\r
+ char *fmt0 = "Largest Contiguous Block of Memory available = %u\n";\r
+ //byte *datboi = "oh shit waddup!\n";\r
+\r
+ MM_Startup(&gvar);\r
+ PM_Startup(&gvar);\r
+ //printf("pmstarted ok\n");\r
+ PM_CheckMainMem(&gvar);\r
+ PM_UnlockMainMem(&gvar);\r
+ CA_Startup(&gvar);\r
+\r
+ fprintf(stderr, fmt, _memavl());\r
+ fprintf(stderr, fmt0, _memmax());\r
+ fprintf(stderr, "Size of map var = %u\n", _msize(&(gvar.ca.mapsegs)));\r
+ //getch();\r
+\r
+ CA_loadmap("data/test.map", &map, &gvar);\r
+#ifdef DUMP\r
+ fprintf(stdout, "map.width= %d\n", map.width);\r
+ fprintf(stdout, "map.height= %d\n", map.height);\r
+ getch();\r
+#ifdef DUMP_MAP\r
+ //if(map.width*map.height != 1200)\r
+ for(k=0;k<MAP_LAYERS;k++)\r
+ {\r
+ printf("maplayer: %u\n[\n", k);\r
+ for(i=0; i<(map.width*map.height); i++)\r
+ {\r
+ //fprintf(stdout, "%04d[%02d]", i, map.data[i]);\r
+ //fprintf(stdout, "%c", map.MAPDATAPTK[i]+44);\r
+ fprintf(stdout, "%c", map.layerdata[k].data[i]+44);\r
+ if(!((i+1)%map.width)){\r
+ //fprintf(stdout, "[%d]", i);\r
+ fprintf(stdout, "\n"); }\r
+ }\r
+ fprintf(stdout, "]\n");\r
+ getch();\r
+ }\r
+#else\r
+ //fprintf(stderr, "contents of the buffer\n[\n%s\n]\n", (gvar.ca.mapsegs));\r
+#endif\r
+ /*fprintf(stdout, "&main()=%Fp\n", *argv[0]);\r
+ fprintf(stdout, "&map==%Fp\n", &map);\r
+ fprintf(stdout, "&map.tiles==%Fp\n", map.tiles);\r
+ fprintf(stdout, "&map.width==%Fp\n", map.width);\r
+ fprintf(stdout, "&map.height==%Fp\n", map.height);\r
+ fprintf(stdout, "&map.data==%Fp\n", map.data);*/\r
+#endif\r
+ //fprintf(stderr, "here comes dat boi!\n"); getch(); fprintf(stderr, "%s", datboi);\r
+ MM_FreePtr((memptr *)&(gvar.ca.mapsegs), &gvar);\r
+ PM_Shutdown(&gvar);\r
+ CA_Shutdown(&gvar);\r
+ MM_Shutdown(&gvar);\r