From: sparky4 <sparky4@cock.li>
Date: Tue, 30 May 2017 21:11:28 +0000 (-0500)
Subject: --0000-- UNTESTED --0000--
X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=2fb58644b5c539decd246968bc9cc99b94069364;p=16.git

--0000-- UNTESTED --0000--
---

diff --git a/HEAP.16W b/HEAP.16W
new file mode 100755
index 00000000..7307e0f1
--- /dev/null
+++ b/HEAP.16W
@@ -0,0 +1,79 @@
+
+	== default ==
+
+  USED block at 2e770016 of size 6146
+  USED block at 2e771818 of size 20
+  USED block at 2e77182c of size 66
+  USED block at 2e77186e of size 50
+  USED block at 2e7718a0 of size 50
+  USED block at 2e7718d2 of size 50
+  USED block at 2e771904 of size 50
+  USED block at 2e771936 of size 50
+  USED block at 2e771968 of size 50
+  USED block at 2e77199a of size 50
+  USED block at 2e7719cc of size 50
+  USED block at 2e7719fe of size 50
+  USED block at 2e771a30 of size 50
+  USED block at 2e771a62 of size 50
+  USED block at 2e771a94 of size 50
+  FREE block at 2e771ac6 of size 29618
+  USED block at 2e778e78 of size 1202
+  USED block at 2e77932a of size 1202
+  USED block at 2e7797dc of size 1202
+  USED block at 2e779c8e of size 136
+  USED block at 2e779d16 of size 22
+  FREE block at 2e779d2c of size 8202
+ERROR - bad node in heap
+
+	== near ==
+
+  FREE block at 1e76f9a6 of size 12
+  FREE block at 1e76f9b2 of size 320
+  FREE block at 1e76faf2 of size 52
+  FREE block at 1e76fb26 of size 20
+  FREE block at 1e76fb3a of size 20
+  FREE block at 1e76fb4e of size 20
+  FREE block at 1e76fb62 of size 20
+  FREE block at 1e76fb76 of size 20
+  FREE block at 1e76fb8a of size 1138
+OK - end of heap
+
+	== far ==
+
+  FREE block at 2e770016 of size 6146
+  FREE block at 2e771818 of size 20
+  FREE block at 2e77182c of size 66
+  FREE block at 2e77186e of size 50
+  FREE block at 2e7718a0 of size 50
+  FREE block at 2e7718d2 of size 50
+  FREE block at 2e771904 of size 50
+  FREE block at 2e771936 of size 50
+  FREE block at 2e771968 of size 50
+  FREE block at 2e77199a of size 50
+  FREE block at 2e7719cc of size 50
+  FREE block at 2e7719fe of size 50
+  FREE block at 2e771a30 of size 50
+  FREE block at 2e771a62 of size 50
+  FREE block at 2e771a94 of size 50
+  FREE block at 2e771ac6 of size 29618
+  FREE block at 2e778e78 of size 1202
+  FREE block at 2e77932a of size 1202
+  FREE block at 2e7797dc of size 1202
+  FREE block at 2e779c8e of size 136
+  FREE block at 2e779d16 of size 22
+  FREE block at 2e779d2c of size 8202
+ERROR - bad node in heap
+
+Memory Type         Total      Used       Free
+----------------  --------   --------   --------
+Default		   48416	10596	  37820
+Near		   1622		484	  1138
+Far		   48416	10596	  37820
+----------------  --------   --------   --------
+HC_coreleft = 1136
+HC_farcoreleft = 417792
+HC_GetFreeSize = 37820
+HC_GetNearFreeSize = 1138
+HC_GetFarFreeSize = 37820
+memavl = 1136
+stackavail = 31484
diff --git a/MMDUMP.16W b/MMDUMP.16W
new file mode 100755
index 00000000..53b3a1de
Binary files /dev/null and b/MMDUMP.16W differ
diff --git a/XCROLL1.16W b/XCROLL1.16W
new file mode 100755
index 00000000..2346cfed
Binary files /dev/null and b/XCROLL1.16W differ
diff --git a/XCROLL2.16W b/XCROLL2.16W
new file mode 100755
index 00000000..85dca0f0
Binary files /dev/null and b/XCROLL2.16W differ
diff --git a/XCROLL3.16W b/XCROLL3.16W
new file mode 100755
index 00000000..85dca0f0
Binary files /dev/null and b/XCROLL3.16W differ
diff --git a/XCROLL4.16W b/XCROLL4.16W
new file mode 100755
index 00000000..53b3a1de
Binary files /dev/null and b/XCROLL4.16W differ
diff --git a/bcexmm.exe b/bcexmm.exe
index 145959bc..80889851 100755
Binary files a/bcexmm.exe and b/bcexmm.exe differ
diff --git a/bcexmm.prj b/bcexmm.prj
index 91b20b10..3da423e7 100755
Binary files a/bcexmm.prj and b/bcexmm.prj differ
diff --git a/makefile b/makefile
index e41a4971..55a314c3 100755
--- a/makefile
+++ b/makefile
@@ -36,7 +36,7 @@
 # serial output is plain text ASCII.
 DEBUGSERIAL=1
 
-DELLOGFILE=1
+DELLOGFILE=0
 
 #192x144
 #wwww will add these
diff --git a/src/0tesuto.c b/src/0tesuto.c
index f8371585..f58b0a0a 100755
--- a/src/0tesuto.c
+++ b/src/0tesuto.c
@@ -115,7 +115,8 @@ int main(int argc,char **argv)
 	/* setup camera and screen~ */
 	modexHiganbanaPageSetup(&gvar);
 	ZC_MVSetup(&gvar.mv, &map, &gvar);
-	ZC_ShowMV(&gvar.mv, gvar.video.sp, 0);
+	//ZC_ShowMV(&gvar.mv, gvar.video.sp, 0);
+	VL_ShowPage(&gvar.video.page[gvar.video.sp], 0, 0);
 
 //	VL_PatternDraw(video_t *video, word pn, boolean sw, boolean allsw);
 	VL_PatternDraw(&gvar.video, 0/*gvar.video.sp*/, 0, 1);
@@ -230,7 +231,8 @@ draw_vrl1_vgax_modex(x-rx,y-ry,vrl_header,line_offsets,buffer+sizeof(*vrl_header
 
 //===========================================================================//
 
-	ZC_ShowMV(&gvar.mv, 0, 0);
+	//ZC_ShowMV(&gvar.mv, 0, 0);
+	VL_ShowPage(&gvar.video.page[gvar.video.sp], 0, 0);
 if(!noanim) {
 	/* another handy "demo" effect using VGA write mode 1.
 	 * we can take what's on screen and vertically squash it like an old analog TV set turning off. */
diff --git a/src/lib/16_ca.c b/src/lib/16_ca.c
index ce406dd5..6580e239 100755
--- a/src/lib/16_ca.c
+++ b/src/lib/16_ca.c
@@ -1241,6 +1241,7 @@ void CA_Startup(global_game_variables_t *gvar)
 #endif
 #endif//profile
 
+#ifdef SHOWMEMINFO
 #ifdef __BORLANDC__
 	unlink("meminfo.16b");
 	gvar->handle.showmemhandle = open("meminfo.16b", O_CREAT | O_WRONLY | O_TEXT);
@@ -1249,6 +1250,7 @@ void CA_Startup(global_game_variables_t *gvar)
 	unlink("meminfo.16w");
 	gvar->handle.showmemhandle = open("meminfo.16w", O_CREAT | O_WRONLY | O_TEXT);
 #endif
+#endif
 
 
 #ifndef NOMAPS
@@ -1288,7 +1290,9 @@ void CA_Shutdown(global_game_variables_t *gvar)
 #ifdef PROFILE
 	close(gvar->handle.profilehandle);
 #endif
+#ifdef SHOWMEMINFO
  	close(gvar->handle.showmemhandle);
+#endif
 
 	close(gvar->ca.file.maphandle);
 	close(gvar->ca.file.grhandle);
diff --git a/src/lib/16_head.h b/src/lib/16_head.h
index adea8fff..45fcd2da 100755
--- a/src/lib/16_head.h
+++ b/src/lib/16_head.h
@@ -195,8 +195,6 @@ extern	int			profilehandle,debughandle;	//make it into game global
 typedef union REGPACK	regs_t;
 #endif
 
-#define INPUT_STATUS_1		0x03da
-
 // local function //
 long int filesize(FILE *fp);
 void clrstdin();
diff --git a/src/lib/16_mm.c b/src/lib/16_mm.c
index 5061b4d5..94fe16e7 100755
--- a/src/lib/16_mm.c
+++ b/src/lib/16_mm.c
@@ -801,6 +801,31 @@ void MML_ClearBlock (global_game_variables_t *gvar)
 }
 
 
+//==========================================================================
+
+/*
+===================
+=
+= MM_Reset
+=
+===================
+*/
+
+void MM_Reset (global_game_variables_t *gvar)
+{
+//	//has to be 16
+//	if(sizeof(mmblocktype)!=16)
+//		return;
+
+#ifdef __BORLANDC__
+	strcpy(gvar->handle.datadumpfilename, "mmdump.16b");
+#endif
+#ifdef __WATCOMC__
+	strcpy(gvar->handle.datadumpfilename, "mmdump.16w");
+#endif
+}
+
+
 //==========================================================================
 
 /*
@@ -824,9 +849,7 @@ void MM_Startup (global_game_variables_t *gvar)
 	if(gvar->mm.mmstarted)
 		MM_Shutdown (gvar);
 
-	//has to be 16
-	if(sizeof(mmblocktype)!=16)
-		return;
+	MM_Reset (gvar);
 
 	gvar->mm.mmstarted = true;
 	gvar->mm.bombonerror = true;
@@ -1670,16 +1693,9 @@ void MM_DumpData (global_game_variables_t *gvar)
 #ifdef __BORLANDC__
 	free(gvar->mm.nearheap);
 #endif
-#ifdef __BORLANDC__
-		dumpfile = fopen ("mmdump.16b","w");
-#endif
-#ifdef __WATCOMC__
-		dumpfile = fopen ("mmdump.16w","w");
-#endif
-	if (!dumpfile){
-		printf("MM_DumpData: Couldn't open MMDUMP.16!\n");
-		return;
-	}
+	dumpfile = fopen (gvar->handle.datadumpfilename, "w");
+	if (!dumpfile)
+		Quit (gvar, "MM_DumpData: Couldn't open MMDUMP.16!\n");
 
 	lowest = -1;
 	do
@@ -1717,8 +1733,8 @@ void MM_DumpData (global_game_variables_t *gvar)
 
 	} while (lowest != 0xffff);
 
-	fclose(dumpfile);
-	printf("MMDUMP.16 created.\n");
+	fclose (dumpfile);
+//00	printf ("MMDUMP.16 created.\n");
 }
 
 //==========================================================================
diff --git a/src/lib/16_mm.h b/src/lib/16_mm.h
index 510dadae..d26b647a 100755
--- a/src/lib/16_mm.h
+++ b/src/lib/16_mm.h
@@ -190,6 +190,7 @@ boolean MML_CheckForXMS (void);
 void MML_UseSpace (unsigned segstart, unsigned seglength, global_game_variables_t *gvar);
 void MML_ClearBlock (global_game_variables_t *gvar);
 
+void MM_Reset (global_game_variables_t *gvar);
 void MM_Startup (global_game_variables_t *gvar);
 void MM_Shutdown (global_game_variables_t *gvar);
 
diff --git a/src/lib/16_pm.c b/src/lib/16_pm.c
index ce81eb4a..961b8c0e 100755
--- a/src/lib/16_pm.c
+++ b/src/lib/16_pm.c
@@ -1208,7 +1208,7 @@ PM_GetPage(int pagenum, global_game_variables_t *gvar)
 	if (pagenum >= gvar->pm.fi.ChunksInFile)
 		Quit (gvar, "PM_GetPage: Invalid page request");
 
-//#ifdef __DEBUG_2__	// for debugging
+#ifdef __DEBUG_2__	// for debugging
 	__asm {
 		mov	dx,STATUS_REGISTER_1
 		in	al,dx
@@ -1218,7 +1218,7 @@ PM_GetPage(int pagenum, global_game_variables_t *gvar)
 		mov	al,10	// bright green
 		out	dx,al
 	}
-//#endif
+#endif
 
 	if (!(result = PM_GetPageAddress(pagenum, gvar)))
 	{
@@ -1236,7 +1236,7 @@ if (!gvar->pm.PMPages[pagenum].offset)	// JDC: sparse page
 	}
 	gvar->pm.PMPages[pagenum].lastHit =  gvar->pm.PMFrameCount;
 
-//#ifdef __DEBUG_2__	// for debugging
+#ifdef __DEBUG_2__	// for debugging
 	__asm{
 		mov	dx,STATUS_REGISTER_1
 		in	al,dx
@@ -1248,7 +1248,7 @@ if (!gvar->pm.PMPages[pagenum].offset)	// JDC: sparse page
 		mov	al,0x20	// normal
 		out	dx,al
 	}
-//#endif
+#endif
 
 	return(result);
 }
diff --git a/src/lib/16_tail.h b/src/lib/16_tail.h
index d106d0ef..70649493 100755
--- a/src/lib/16_tail.h
+++ b/src/lib/16_tail.h
@@ -78,15 +78,15 @@
 	if(gvar.in.inst->Keyboard[sc_F4]){ turboXT(12);									IN_UserInput(1, &gvar); } \
 	if(gvar.in.inst->Keyboard[68/*sc_F10*/]){ gvar.kurokku.fpscap=!gvar.kurokku.fpscap;			IN_UserInput(1, &gvar); } \
 	if(gvar.in.inst->Keyboard[sc_F8]){ gvar.video.vga_state.bgps=!gvar.video.vga_state.bgps;		IN_UserInput(1, &gvar); } \
-	if(gvar.in.inst->Keyboard[sc_F7]){ ZC_ShowMV(&gvar.mv, 0, 1);						IN_UserInput(1, &gvar); } \
-	if(gvar.in.inst->Keyboard[sc_F6]){ ZC_ShowMV(&gvar.mv, 0, 0);						IN_UserInput(1, &gvar); } \
+	if(gvar.in.inst->Keyboard[sc_F7]){ VL_ShowPage(&gvar.video.page, 0, 1);						IN_UserInput(1, &gvar); } \
+	if(gvar.in.inst->Keyboard[sc_F6]){ VL_ShowPage(&gvar.video.page, 0, 0);						IN_UserInput(1, &gvar); } \
 	if(gvar.in.inst->Keyboard[sc_T]){ gvar.video.vga_state.rss=!gvar.video.vga_state.rss;			IN_UserInput(1, &gvar); } \
 	if(gvar.in.inst->Keyboard[sc_P]){ modexpdump(0, &gvar);							IN_UserInput(1, &gvar); } \
 	if(gvar.in.inst->Keyboard[sc_Y]){ dbg_delayanimation=!dbg_delayanimation;				IN_UserInput(1, &gvar); } \
 	if(gvar.in.inst->Keyboard[sc_Q]){ VL_modexPrintTextBox(&gvar);						IN_UserInput(1, &gvar); } \
 	if(gvar.in.inst->Keyboard[sc_W]){ VL_MemToScreen((byte __far *)&gvar, 64, 64, 16, 16, &gvar);	IN_UserInput(1, &gvar); } \
 	if(gvar.in.inst->Keyboard[sc_LBrkt]){ ShowPalVal (&gvar);							IN_UserInput(1, &gvar); } \
-	if(gvar.in.inst->Keyboard[sc_M]){ MM_ShowMemory(&gvar);							IN_UserInput(1, &gvar); } \
+	if(gvar.in.inst->Keyboard[sc_M]){ MM_ShowMemory(&gvar);	MM_DumpData (&gvar);			IN_UserInput(1, &gvar); } \
 	RFDEBUGFUNCTIONS
 //FIZZLEFADEFUNCTION
 
@@ -98,10 +98,10 @@
 	ZC_panPageManual(&gvar.mv, &gvar.player, 0);
 
 #define FUNCTIONKEYSHOWMV \
-	if(gvar.in.inst->Keyboard[1+1]){ gvar.video.sp=0; ZC_ShowMV(&gvar.mv, 0, 0); } \
-	if(gvar.in.inst->Keyboard[2+1]){ gvar.video.sp=1; ZC_ShowMV(&gvar.mv, 0, 0); } \
-	if(gvar.in.inst->Keyboard[3+1]){ gvar.video.sp=2; ZC_ShowMV(&gvar.mv, 0, 1); } \
-	if(gvar.in.inst->Keyboard[4+1]){ gvar.video.sp=3; ZC_ShowMV(&gvar.mv, 0, 1); }
+	if(gvar.in.inst->Keyboard[1+1]){ gvar.video.sp=0; VL_ShowPage(&gvar.video.page, 0, 0); } \
+	if(gvar.in.inst->Keyboard[2+1]){ gvar.video.sp=1; VL_ShowPage(&gvar.video.page, 0, 0); } \
+	if(gvar.in.inst->Keyboard[3+1]){ gvar.video.sp=2; VL_ShowPage(&gvar.video.page, 0, 1); } \
+	if(gvar.in.inst->Keyboard[4+1]){ gvar.video.sp=3; VL_ShowPage(&gvar.video.page, 0, 1); }
 
 #define TAIL_FUNCTIONKEYDRAWJUNK \
 	FUNCTIONKEYSHOWMV \
diff --git a/src/lib/16_tdef.h b/src/lib/16_tdef.h
index 30d0cfa4..10e28b48 100755
--- a/src/lib/16_tdef.h
+++ b/src/lib/16_tdef.h
@@ -350,6 +350,7 @@ typedef struct
 {
 	int profilehandle,debughandle,showmemhandle;
 	int heaphandle;
+	byte datadumpfilename[12];
 } loghandle_t;
 
 typedef struct
diff --git a/src/lib/16_timer.h b/src/lib/16_timer.h
index 8bcd10c0..81800c1f 100755
--- a/src/lib/16_timer.h
+++ b/src/lib/16_timer.h
@@ -25,7 +25,7 @@
 #include "src/lib/16_head.h"
 #include "src/lib/wcpu/16_wcpu.h"
 
-#define FPSVALUE 60
+#define FPSVALUE 30
 
 clock_t start_timer(global_game_variables_t *gv);
 double elapsed_timer(global_game_variables_t *gv);
diff --git a/src/lib/16_vl.c b/src/lib/16_vl.c
index 2c3fc766..ec88898e 100755
--- a/src/lib/16_vl.c
+++ b/src/lib/16_vl.c
@@ -567,14 +567,14 @@ modexShowPage(page_t *page) {
 	low_address  = LOW_ADDRESS  | (offset << 8);
 
 	/* wait for appropriate timing and then program CRTC */
-//+=+=										while ((inp(INPUT_STATUS_1) & DISPLAY_ENABLE));
+//+=+=										while ((inp(STATUS_REGISTER_1) & DISPLAY_ENABLE));
 	outpw(CRTC_INDEX, high_address);
 	outpw(CRTC_INDEX, low_address);
 	outp(CRTC_INDEX, 0x13);
 	outp(CRTC_DATA, crtcOffset);
 
 	/* wait for one retrace */
-//+=+=										while (!(inp(INPUT_STATUS_1) & VRETRACE));
+//+=+=										while (!(inp(STATUS_REGISTER_1) & VRETRACE));
 
 	/* do PEL panning here */
 	outp(AC_INDEX, 0x33);
@@ -609,14 +609,14 @@ VL_ShowPage(page_t *page, boolean vsync, boolean sr)
 	low_address  = LOW_ADDRESS  | (offset << 8);
 
 	// wait for appropriate timing and then program CRTC
-	if(vsync) while ((inp(INPUT_STATUS_1) & DISPLAY_ENABLE));
+	if(vsync) while ((inp(STATUS_REGISTER_1) & DISPLAY_ENABLE));
 	outpw(CRTC_INDEX, high_address);
 	outpw(CRTC_INDEX, low_address);
 	outp(CRTC_INDEX, 0x13);
 	outp(CRTC_DATA, crtcOffset);
 
 	// wait for one retrace
-	if(vsync) while (!(inp(INPUT_STATUS_1) & VRETRACE));
+	if(vsync) while (!(inp(STATUS_REGISTER_1) & VRETRACE));
 
 	// do PEL panning here
 	outp(AC_INDEX, 0x33);
@@ -1346,11 +1346,11 @@ void VL_PatternDraw(video_t *video, word pn, boolean sw, boolean allsw)
 
 void
 modexWaitBorder() {
-	while(inp(INPUT_STATUS_1)  & 8)  {
+	while(inp(STATUS_REGISTER_1)  & 8)  {
 	// spin
 	}
 
-	while(!(inp(INPUT_STATUS_1)  & 8))  {
+	while(!(inp(STATUS_REGISTER_1)  & 8))  {
 	//spin
 	}
 }
@@ -1358,7 +1358,7 @@ modexWaitBorder() {
 void
 modexWaitBorder_start()
 {
-	while(inp(INPUT_STATUS_1)  & 8)  {
+	while(inp(STATUS_REGISTER_1)  & 8)  {
 	// spin
 	}
 
@@ -1367,7 +1367,7 @@ modexWaitBorder_start()
 void
 modexWaitBorder_end()
 {
-	while(!(inp(INPUT_STATUS_1)  & 8))  {
+	while(!(inp(STATUS_REGISTER_1)  & 8))  {
 	// spin
 	}
 
diff --git a/src/lib/16_vl.h b/src/lib/16_vl.h
index 078a5080..7e63079d 100755
--- a/src/lib/16_vl.h
+++ b/src/lib/16_vl.h
@@ -125,8 +125,11 @@ extern byte far*  VGA;  /* The VGA Memory */
 #define HIGH_ADDRESS 		0x0C
 #define LOW_ADDRESS		0x0D
 #define VRETRACE		0x08
-//#define INPUT_STATUS_1		0x03da	defined in 16_head
-#define STATUS_REGISTER_1	INPUT_STATUS_1
+//#define INPUT _STATUS_1			defined in 16_head
+//#define STATUS_REGISTER_1	0x03da
+
+#define	STATUS_REGISTER_1    0x3da
+
 #define ATR_INDEX			AC_INDEX
 #define ATR_OVERSCAN		17
 #define DISPLAY_ENABLE		0x01
diff --git a/src/lib/doslib b/src/lib/doslib
index bd7aef78..0fa03eb4 160000
--- a/src/lib/doslib
+++ b/src/lib/doslib
@@ -1 +1 @@
-Subproject commit bd7aef78dacba681d641b637b31a93682e1109e0
+Subproject commit 0fa03eb420bf0215c0da701a477efe512472691d
diff --git a/src/lib/scroll16.c b/src/lib/scroll16.c
index 1888cb4f..a6cbcff5 100755
--- a/src/lib/scroll16.c
+++ b/src/lib/scroll16.c
@@ -318,7 +318,7 @@ void ZC_walk(global_game_variables_t *gvar, word pn)
 //panning page
 void ZC_panPageManual(map_view_t *pip, player_t *player, word pn)
 {
-#define SHOWMVFUN_ ZC_ShowMV(pip, 0, 0);
+#define SHOWMVFUN_ VL_ShowPage(pip[0].page, 0, 0);//ZC_ShowMV(pip, 0, 0);
 	switch(player[pn].enti.d)
 	{
 		//right movement
@@ -413,6 +413,8 @@ void ZC_MVInit(map_view_t *pip, int tx, int ty)
 	//pip[0].ty = pip[1].ty = ty;
 }
 
+//#if 0
+//for backwards compatibility with code i am lazy ww
 void ZC_ShowMV(map_view_t *moo, boolean vsync, boolean sr)
 {
 	VL_ShowPage(moo[0].page, vsync, sr);
diff --git a/src/lib/scroll16.h b/src/lib/scroll16.h
index 20836e3d..0cd71b63 100755
--- a/src/lib/scroll16.h
+++ b/src/lib/scroll16.h
@@ -114,7 +114,7 @@ void ZC_walk(global_game_variables_t *gvar, word pn);
 void ZC_panPageManual(map_view_t *pip, player_t *player, word pn);
 void ZC_MVSetup(map_view_t *pip, map_t *map, global_game_variables_t *gv);
 void ZC_MVInit(map_view_t *pip, int tx, int ty);
-void ZC_ShowMV(map_view_t *moo, boolean vsync, boolean sr);
+//void ZC_ShowMV(map_view_t *moo, boolean vsync, boolean sr);
 void near mapScrollRight(map_view_t *mv, player_t *player, word id, word plid);
 void near mapScrollLeft(map_view_t *mv, player_t *player, word id, word plid);
 void near mapScrollUp(map_view_t *mv, player_t *player, word id, word plid);
diff --git a/src/vidtest.c b/src/vidtest.c
index c957ef62..dff2f9a0 100755
--- a/src/vidtest.c
+++ b/src/vidtest.c
@@ -173,8 +173,8 @@ void main(int argc, char *argv[])
 		if(gvar.in.inst->Keyboard[25]){ modexpdump(gvar.video.sp, &gvar); IN_UserInput(1, &gvar); }//p
 		if(gvar.in.inst->Keyboard[sc_I]){ drawboxesmodex(&gvar.video.page[gvar.video.sp]); IN_UserInput(1, &gvar); }//i
 		if(gvar.in.inst->Keyboard[sc_O]){ copyboxesmodex(&gvar.video.page, !gvar.video.sp); IN_UserInput(1, &gvar); }//o
-		//VL_ShowPage(&gvar.video.page[gvar.video.sp], 0, 0);
-		ZC_ShowMV(&gvar.mv, 0, 0);
+		VL_ShowPage(&gvar.video.page[gvar.video.sp], 0, 0);
+		//ZC_ShowMV(&gvar.mv, 0, 0);
 	}
 
 	endclk = *clockw;
diff --git a/src/xcroll.c b/src/xcroll.c
index 52d9b5b9..00f869c4 100755
--- a/src/xcroll.c
+++ b/src/xcroll.c
@@ -23,8 +23,10 @@
 #include "src/lib/scroll16.h"
 #include "src/lib/16_timer.h"
 //#include "src/lib/16_dbg.h"
+//HC_heapdump
 
 #ifdef __DEBUG__
+#define SCROLLEXEDEBUG
 boolean
 	dbg_nointest=1;
 #endif
@@ -59,8 +61,6 @@ void main(int argc, char *argv[])
 	static global_game_variables_t gvar;
 	struct glob_game_vars *ggvv;
 
-//	static entity_t enti;
-
 	char bakapee[64] = FILENAME_1;
 	char bakapeep[64] = FILENAME_1P;
 //	char bakapee3[64] = FILENAME_3;
@@ -79,19 +79,34 @@ void main(int argc, char *argv[])
 	//----gvar.player[0].enti.spri.spritesheet = malloc(sizeof(struct vrs_container));
 
 	// create the map
-//	fprintf(stderr, "testing map load~	");
+		#ifdef SCROLLEXEDEBUG
+	strcpy(gvar.handle.datadumpfilename, "xcroll1.16w");	MM_DumpData (&gvar);
+	fprintf(stderr, "testing map load~	");
+		#endif
 	CA_loadmap("data/test.map", &map, &gvar);
 #ifndef NOMAPLOAD
 	chkmap(&map, 0);
-//	initMap(&map);
-//	printf("chkmap ok	");
-//	fprintf(stderr, "yay map loaded~~\n");
 #else
 	chkmap(&map, 1);
-	//initMap(&map);
 #endif
+	//initMap(&map);
+		#ifdef SCROLLEXEDEBUG
+	printf("chkmap ok\n");
+//	fprintf(stderr, "yay map loaded~~\n");
+	strcpy(gvar.handle.datadumpfilename, "xcroll2.16w");	MM_DumpData (&gvar);
+		#endif
+
 	// data
+		#ifdef SCROLLEXEDEBUG
+	fprintf(stderr, "VRS_LoadVRS~	");
+	strcpy(gvar.handle.datadumpfilename, "xcroll3.16w");	MM_DumpData (&gvar);
+		#endif
 	VRS_LoadVRS(bakapee, &gvar.player[0].enti, &gvar);
+		#ifdef SCROLLEXEDEBUG
+	printf("VRS load OK~\n");
+	strcpy(gvar.handle.datadumpfilename, "xcroll4.16w");	MM_DumpData (&gvar);
+		#endif
+	strcpy(gvar.handle.datadumpfilename, "xcroll.16w");
 
 	// input!
 	IN_Default(0, &gvar.player[0],ctrl_Keyboard1, &gvar);
@@ -263,6 +278,10 @@ void main(int argc, char *argv[])
 	modexSavePalFile("data/g.pal", &gvar.video.palette);
 	modexFadeOff(4, &gvar.video.palette);
 #endif
+		#ifdef SCROLLEXEDEBUG
+	MM_Reset(&gvar);	MM_DumpData (&gvar);
+	HC_heapdump (&gvar);
+		#endif
 	Shutdown16(&gvar);
 	printf("\nProject 16 xcroll.exe. This is just a test file!\n");
 	printf("version %s\n", VERSION);