From: sparky4 <sparky4@cock.li>
Date: Thu, 13 Apr 2017 22:40:17 +0000 (-0500)
Subject: EXEMM BROKEN
X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=7092caf49f8feaee14bba0a140f1974bd57d3228;p=16.git

EXEMM BROKEN
---

diff --git a/bcexmm.dsk b/bcexmm.dsk
index eba89c29..fb8a3fd5 100755
Binary files a/bcexmm.dsk and b/bcexmm.dsk differ
diff --git a/bcexmm.exe b/bcexmm.exe
index 5c908de0..c1a3808c 100755
Binary files a/bcexmm.exe and b/bcexmm.exe differ
diff --git a/bcexmm.prj b/bcexmm.prj
index a2c632b1..4f33a902 100755
Binary files a/bcexmm.prj and b/bcexmm.prj differ
diff --git a/src/bakapi.c b/src/bakapi.c
index 423e60e2..b03f294a 100755
--- a/src/bakapi.c
+++ b/src/bakapi.c
@@ -139,17 +139,21 @@ main(int argc, char *argvar[])
 	//modexPalUpdate(bmp.palette); //____
 	//modexDrawBmp(VGA, 0, 0, &bmp, 0); //____
 	//getch(); //____
-	VL_SetLineWidth (40, &gvar);
+	//VL_SetLineWidth (40, &gvar);
 
 	VL_ShowPage(&gvar.video.page[showpage], 0, 0);
 	{
 		word w;
 		for(w=0;w<64000;w++)
 		{
-			ding(&gvar.video.page[showpage], &bakapee, 4);
-			ding(&gvar.video.page[1], &bakapee, 4);
+			ding(&gvar.video.page[showpage], &bakapee, 2);
+			ding(&gvar.video.page[1], &bakapee, 2);
 		}
+#ifdef BAKAFIZZUNSIGNED
 		if(!baka_FizzleFade (gvar.video.ofs.bufferofs, gvar.video.ofs.displayofs, vga_state.vga_width, vga_state.vga_height, 70, true, &gvar))
+#else
+		if(!baka_FizzleFade (&gvar.video.page[1], &gvar.video.page[0], vga_state.vga_width, vga_state.vga_height, 70, true, &gvar))
+#endif
 		//ding(&gvar.video.page[showpage], &bakapee, 9);
 		modexprint(&gvar.video.page[0], gvar.video.page[0].sw/2, gvar.video.page[0].sh/2, 1, 0, 47, 0, 1, "bakapi ok");
 	}
diff --git a/src/exmmtest.c b/src/exmmtest.c
index 1a4cbe68..0b5a4ab8 100755
--- a/src/exmmtest.c
+++ b/src/exmmtest.c
@@ -64,7 +64,7 @@
 
 ////////////////////////////////////////////////////////////////////////////
 //#ifdef __BORLANDC__
-void VL_Startup (global_game_variables_t *gvar){}
+//void VL_Startup (global_game_variables_t *gvar){}
 void VL_Shutdown (global_game_variables_t *gvar){}
 void VGAmodeX(sword vq, boolean cmem, global_game_variables_t *gv)
 {
diff --git a/src/lib/16_mm.c b/src/lib/16_mm.c
index 2f032490..8ee134f0 100755
--- a/src/lib/16_mm.c
+++ b/src/lib/16_mm.c
@@ -1266,7 +1266,7 @@ void MM_ShowMemory(global_game_variables_t *gvar)
 	sdword	end,owner;
 	byte    scratch[160],scratch0[4096],str[16];
 
-	VL_SetLineWidth(40, gvar);
+//	VL_SetLineWidth(40, gvar);
 	temp = gvar->video.ofs.bufferofs;
 	gvar->video.ofs.bufferofs = gvar->video.ofs.displayofs;
 	scan = gvar->mm.mmhead;
@@ -1310,8 +1310,8 @@ void MM_ShowMemory(global_game_variables_t *gvar)
 #endif
 		y = scan->start/320;
 		x = scan->start%320;
-		VW_Hlin(x,x+end,y,color, &gvar->video.ofs);
-		VL_Plot(x,y,15, &gvar->video.ofs);
+		VW_Hlin(x,x+end,y,color,gvar);
+		VL_Plot(x,y,15,gvar);
 		for(w=(scan->start)/80;w<=end/80;w++)
 		{
 			//printf("+	%u	%lu\n", w, scan->length);
@@ -1324,7 +1324,7 @@ void MM_ShowMemory(global_game_variables_t *gvar)
 		if (scan->next && scan->next->start >= end+1)
 #endif
 		{
-			VW_Hlin(x+end+1,x+(scan->next->start-scan->start),y,0, &gvar->video.ofs);	// black = free
+			VW_Hlin(x+end+1,x+(scan->next->start-scan->start),y,0,gvar);	// black = free
 			strcat(scratch0, AARESET);
 //++==++==optional			strcat(scratch0, "\n");
 			strcat(scratch0,AAGREEN);
diff --git a/src/lib/16_tail.c b/src/lib/16_tail.c
index ce2733d3..ec7023c8 100755
--- a/src/lib/16_tail.c
+++ b/src/lib/16_tail.c
@@ -310,7 +310,8 @@ noxor:
 
 			if ((x>width || y>height) && (x<width*2 && y<height*2))
 				continue;
-			drawofs = source+(gvar->video.ofs.ylookup[y]) + (x>>2);
+			//drawofs = source+(gvar->video.ofs.ylookup[y]) + (x>>2);
+			drawofs = source+(y*gvar->video.page[0].stridew) + (x>>2);
 
 			//
 			// copy one pixel
diff --git a/src/lib/16_tail.h b/src/lib/16_tail.h
index 7212da7f..87bba9c6 100755
--- a/src/lib/16_tail.h
+++ b/src/lib/16_tail.h
@@ -84,7 +84,7 @@
 	if(gvar.in.inst->Keyboard[sc_P]){ modexpdump(&gvar.video.page[0]);					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.video.ofs);	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); } \
 	RFDEBUGFUNCTIONS
 //FIZZLEFADEFUNCTION
 
diff --git a/src/lib/16_tdef.h b/src/lib/16_tdef.h
index 07807c20..7ed1ae7d 100755
--- a/src/lib/16_tdef.h
+++ b/src/lib/16_tdef.h
@@ -377,9 +377,10 @@ typedef struct
 
 typedef struct
 {
+	//ylookup[MAXSCANLINES],
 	unsigned int offscreen_ofs;
 	unsigned int pattern_ofs;
-	unsigned	bufferofs,	ylookup[MAXSCANLINES], linewidth,displayofs;
+	unsigned	bufferofs,linewidth,displayofs;
 	pan_t		pan;
 } ofs_t;	//unfinished
 
diff --git a/src/lib/16_vl.c b/src/lib/16_vl.c
index ceed6410..7d8a0b25 100755
--- a/src/lib/16_vl.c
+++ b/src/lib/16_vl.c
@@ -359,7 +359,9 @@ void modexEnter(sword vq, boolean cmem, global_game_variables_t *gv)
 		}
 		break;
 	}
-	VL_SetLineWidth (cm.offset, gv);
+//	VL_SetLineWidth (cm.offset, gv);
+	gv->video.ofs.displayofs = 0;
+	gv->video.ofs.bufferofs = gv->video.page[0].width*gv->video.page[0].height;//gvar->video.page[0].pagesize;
 	gv->video.curr_mode=vq;
 	gv->video.VL_Started=1;
 }
@@ -546,7 +548,7 @@ void modexHiganbanaPageSetup(video_t *video)
 	video->vga_state.vga_draw_stride=	vga_state.vga_draw_stride;
 	video->vga_state.vga_draw_stride_limit=	vga_state.vga_draw_stride_limit;
 	//sprite render switch and bgpreservation switch
-	video->vga_state.rss=		1;
+	video->vga_state.rss=	1;
 	video->vga_state.bgps=	1;
 
 	//setup the buffersize
diff --git a/src/lib/16_vl.h b/src/lib/16_vl.h
index 519b1026..85a3bd71 100755
--- a/src/lib/16_vl.h
+++ b/src/lib/16_vl.h
@@ -214,11 +214,11 @@ void modexPalWhite();
 void modexPalUpdate(byte *p);
 void VL_modexPalScramble(byte *p);
 word modexPalOverscan(word col);
-void VL_Plot (int x, int y, int color, ofs_t *ofs);
-void VL_Hlin (unsigned x, unsigned y, unsigned width, unsigned color, ofs_t *ofs);
-void VL_Vlin (int x, int y, int height, int color, ofs_t *ofs);
-void VL_Bar (int x, int y, int width, int height, int color, ofs_t *ofs);
-void VL_MemToScreen (byte far *source, int width, int height, int x, int y, ofs_t *ofs);
+void VL_Plot (int x, int y, int color, global_game_variables_t *gvar);
+void VL_Hlin (unsigned x, unsigned y, unsigned width, unsigned color, global_game_variables_t *gvar);
+void VL_Vlin (int x, int y, int height, int color, global_game_variables_t *gvar);
+void VL_Bar (int x, int y, int width, int height, int color, global_game_variables_t *gvar);
+void VL_MemToScreen (byte far *source, int width, int height, int x, int y, global_game_variables_t *gvar);
 void modexputPixel(page_t *page, int x, int y, byte color);
 byte modexgetPixel(page_t *page, int x, int y);
 
diff --git a/src/lib/16_vl_1.c b/src/lib/16_vl_1.c
index 6956717e..0ad22064 100755
--- a/src/lib/16_vl_1.c
+++ b/src/lib/16_vl_1.c
@@ -168,7 +168,7 @@ SetScreen_done:
 =
 ====================
 */
-
+#if 0
 void VL_SetLineWidth (unsigned width, global_game_variables_t *gvar)
 {
 	int i,offset;
@@ -190,10 +190,8 @@ void VL_SetLineWidth (unsigned width, global_game_variables_t *gvar)
 		gvar->video.ofs.ylookup[i]=offset;
 		offset += gvar->video.ofs.linewidth;
 	}
-	gvar->video.ofs.displayofs = 0;
-	gvar->video.ofs.bufferofs = gvar->video.page[0].width*gvar->video.page[0].height;//gvar->video.page[0].pagesize;
 }
-
+#endif
 /*
 =============================================================================
 
@@ -504,14 +502,15 @@ void VL_TestPaletteSet (video_t *v)
 =================
 */
 
-void VL_Plot (int x, int y, int color, ofs_t *ofs)
+void VL_Plot (int x, int y, int color, global_game_variables_t *gvar)
 {
 	byte mask;
 	VCLIPDEF
 
 	mask = pclip[x&3];
 	VGAMAPMASK(mask);
-	*(byte far *)MK_FP(SCREENSEG,ofs->bufferofs+(ofs->ylookup[y]+(x>>2))) = color;
+	//*(byte far *)MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+(gvar->video.ofs.ylookup[y]+(x>>2))) = color;
+	*(byte far *)MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+((y*gvar->video.page[0].stridew)+(x>>2))) = color;
 	VGAMAPMASK(15);
 }
 
@@ -524,7 +523,7 @@ void VL_Plot (int x, int y, int color, ofs_t *ofs)
 =================
 */
 
-void VL_Hlin	(unsigned x, unsigned y, unsigned width, unsigned color, ofs_t *ofs)
+void VL_Hlin	(unsigned x, unsigned y, unsigned width, unsigned color, global_game_variables_t *gvar)
 {
 	unsigned		xbyte;
 	byte			far *dest;
@@ -538,7 +537,8 @@ void VL_Hlin	(unsigned x, unsigned y, unsigned width, unsigned color, ofs_t *ofs
 	rightmask = rclip[(x+width-1)&3];
 	midbytes = ((x+width+3)>>2) - xbyte - 2;
 
-	dest = MK_FP(SCREENSEG,ofs->bufferofs+ofs->ylookup[y]+xbyte);
+	//dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+gvar->video.ofs.ylookup[y]+xbyte);
+	dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+(y*gvar->video.page[0].stridew)+xbyte);
 
 	if (midbytes<0)
 	{
@@ -571,7 +571,7 @@ void VL_Hlin	(unsigned x, unsigned y, unsigned width, unsigned color, ofs_t *ofs
 =================
 */
 
-void VL_Vlin	(int x, int y, int height, int color, ofs_t *ofs)
+void VL_Vlin	(int x, int y, int height, int color, global_game_variables_t *gvar)
 {
 	byte	far *dest,mask;
 	VCLIPDEF
@@ -579,12 +579,13 @@ void VL_Vlin	(int x, int y, int height, int color, ofs_t *ofs)
 	mask = pclip[x&3];
 	VGAMAPMASK(mask);
 
-	dest = MK_FP(SCREENSEG,ofs->bufferofs+ofs->ylookup[y]+(x>>2));
+	//dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+gvar->video.ofs.ylookup[y]+(x>>2));
+	dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+(y*gvar->video.page[0].stridew)+(x>>2));
 
 	while (height--)
 	{
 		*dest = color;
-		dest += ofs->linewidth;
+		dest += gvar->video.ofs.linewidth;
 	}
 
 	VGAMAPMASK(15);
@@ -599,7 +600,7 @@ void VL_Vlin	(int x, int y, int height, int color, ofs_t *ofs)
 =================
 */
 
-void VL_Bar (int x, int y, int width, int height, int color, ofs_t *ofs)
+void VL_Bar (int x, int y, int width, int height, int color, global_game_variables_t *gvar)
 {
 	byte	far *dest;
 	byte	leftmask,rightmask;
@@ -610,9 +611,10 @@ void VL_Bar (int x, int y, int width, int height, int color, ofs_t *ofs)
 	leftmask = lclip[x&3];
 	rightmask = rclip[(x+width-1)&3];
 	midbytes = ((x+width+3)>>2) - (x>>2) - 2;
-	linedelta = ofs->linewidth-(midbytes+1);
+	linedelta = gvar->video.ofs.linewidth-(midbytes+1);
 
-	dest = MK_FP(SCREENSEG,ofs->bufferofs+ofs->ylookup[y]+(x>>2));
+	//dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+gvar->video.ofs.ylookup[y]+(x>>2));
+	dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+(y*gvar->video.page[0].stridew)+(x>>2));
 
 	if (midbytes<0)
 	{
@@ -621,7 +623,7 @@ void VL_Bar (int x, int y, int width, int height, int color, ofs_t *ofs)
 		while (height--)
 		{
 			*dest = color;
-			dest += ofs->linewidth;
+			dest += gvar->video.ofs.linewidth;
 		}
 		VGAMAPMASK(15);
 		return;
@@ -657,13 +659,14 @@ void VL_Bar (int x, int y, int width, int height, int color, ofs_t *ofs)
 =================
 */
 
-void VL_MemToScreen (byte far *source, int width, int height, int x, int y, ofs_t *ofs)
+void VL_MemToScreen (byte far *source, int width, int height, int x, int y, global_game_variables_t *gvar)
 {
 	byte    far *screen,far *dest,mask;
 	int		plane;
 
 	width>>=2;
-	dest = MK_FP(SCREENSEG,ofs->bufferofs+ofs->ylookup[y]+(x>>2) );
+	//dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+gvar->video.ofs.ylookup[y]+(x>>2));
+	dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+(y*gvar->video.page[0].stridew)+(x>>2));
 	mask = 1 << (x&3);
 
 	for	(plane = 0; plane<4; plane++)
@@ -674,7 +677,7 @@ void VL_MemToScreen (byte far *source, int width, int height, int x, int y, ofs_
 			mask = 1;
 
 		screen = dest;
-		for	(y=0;y<height;y++,screen+=ofs->linewidth,source+=width)
+		for	(y=0;y<height;y++,screen+=gvar->video.ofs.linewidth,source+=width)
 			_fmemcpy (screen,source,width);
 	}
 }
diff --git a/src/lib/bakapee.c b/src/lib/bakapee.c
index 0174d3c3..2026ed12 100755
--- a/src/lib/bakapee.c
+++ b/src/lib/bakapee.c
@@ -56,7 +56,7 @@ char global_temp_status_text2[512];
 //extern	ControlInfo	c;
 #define PIXPOSX			gvar->video.page[0].sw/2
 #define PIXPOSY			gvar->video.page[0].sh/2
-
+#ifdef BAKAFIZZUNSIGNED
 boolean baka_FizzleFade (unsigned source, unsigned dest, unsigned width, unsigned height, unsigned frames, boolean abortable, global_game_variables_t *gvar)
 {
 	word		p,pixperframe;
@@ -68,8 +68,8 @@ boolean baka_FizzleFade (unsigned source, unsigned dest, unsigned width, unsigne
 
 	pagedelta = dest-source;
 	rndval = 1;	esorig = 0; q = 16;
-	x = y = 0;//destpage->dx;
-	pixperframe = /*76800*/64000/(dword)frames;
+	x = y = 0;
+	pixperframe = 64000/(dword)frames;
 
 //	IN_StartAck ();
 
@@ -78,7 +78,7 @@ boolean baka_FizzleFade (unsigned source, unsigned dest, unsigned width, unsigne
 
 //	modexClearRegion(&(gvar->video.page[0]), 0, 0, gvar->video.page[0].width, gvar->video.page[0].height, 0);
 //	modexClearRegion(&(gvar->video.page[1]), 0, 0, gvar->video.page[0].width, gvar->video.page[0].height, 15);
-//	VL_SetLineWidth(80, gvar);
+//	VL_SetLineWidth(44, gvar);
 
 	__asm {
 		mov	[esorig],es
@@ -134,7 +134,8 @@ noxor:
 //			if (x<destpage->sw || y<destpage->sh)
 			if ((x>width || y>height) && (x<width*2 && y<height*2))
 				continue;
-			drawofs = source+(gvar->video.ofs.ylookup[y]) + (x>>2);
+			//drawofs = source+(gvar->video.ofs.ylookup[y]) + (x>>2);
+			drawofs = source+(y*gvar->video.page[0].stridew) + (x>>2);
 sprintf(global_temp_status_text, "draw - %Fp", drawofs);
 modexprint(&(gvar->video.page[0]), PIXPOSX, q+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text); q+=8;
 sprintf(global_temp_status_text, "pdet - %Fp", pagedelta);
@@ -175,6 +176,133 @@ modexprint(&(gvar->video.page[0]), PIXPOSX, q+PIXPOSY, 1, 0, 47, 0, 1, global_te
 	return false;
 }
 
+#else
+boolean baka_FizzleFade (page_t *sourcepage, page_t *destpage, unsigned width, unsigned height, unsigned frames, boolean abortable, global_game_variables_t *gvar)
+{
+	word		p,pixperframe;
+	unsigned	drawofs,pagedelta;
+//	byte 		mask,maskb[8] = {1,2,4,8};
+	unsigned	x,y,frame		,esorig,q;
+	dword		rndval;
+	unsigned	source,dest;
+	word screenseg = SCREENSEG;
+	source = ((word)sourcepage->data); dest = ((word)destpage->data);
+
+	pagedelta = dest-source;
+	rndval = 1;	esorig = 0; q = 16;
+	x = y = 0;//destpage->dx;
+	pixperframe = 76800/(dword)frames;
+
+//	IN_StartAck ();
+
+//	VL_ShowPage(&(gvar->video.page[0]), 1, 0);
+//	VL_ShowPage(&(gvar->video.page[1]), 1, 0);
+
+//	modexClearRegion(&(gvar->video.page[0]), 0, 0, gvar->video.page[0].width, gvar->video.page[0].height, 0);
+//	modexClearRegion(&(gvar->video.page[1]), 0, 0, gvar->video.page[0].width, gvar->video.page[0].height, 15);
+//	VL_SetLineWidth(80, gvar);
+
+	__asm {
+		mov	[esorig],es
+	}
+//	TimeCount=
+	frame=0;
+	do	// while (1)
+	{
+sprintf(global_temp_status_text, "%u", frame);
+modexprint(destpage, PIXPOSX, PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text);
+		if (abortable && kbhit())//IN_CheckAck () )
+			return true;
+
+		__asm {
+			mov	es,[screenseg]
+		}
+
+		for (p=0;p<pixperframe;p++)
+		{
+			__asm {
+				//
+				// seperate random value into x/y pair
+				//
+				mov	ax,[WORD PTR rndval]
+				mov	dx,[WORD PTR rndval+2]
+				mov	bx,ax
+				dec	bl
+				mov	[BYTE PTR y],bl			// low 8 bits - 1 = y xoordinate
+				mov	bx,ax
+				mov	cx,dx
+				mov	[BYTE PTR x],ah			// next 9 bits = x xoordinate
+				mov	[BYTE PTR x+1],dl
+				//
+				// advance to next random element
+				//
+				shr	dx,1
+				rcr	ax,1
+				jnc	noxor
+				xor	dx,0x0001
+				xor	ax,0x2000
+#ifdef __BORLANDC__
+			}
+#endif
+noxor:
+#ifdef __BORLANDC__
+			__asm {
+#endif
+				mov	[WORD PTR rndval],ax
+				mov	[WORD PTR rndval+2],dx
+			}
+
+//			if (x>destpage->width || y>destpage->height)
+//			if (x<destpage->sw || y<destpage->sh)
+			if ((x>width || y>height) && (x<width*2 && y<height*2))
+				continue;
+			drawofs = source+(gvar->video.ofs.ylookup[y]) + (x>>2);
+sprintf(global_temp_status_text, "draw - %Fp", drawofs);
+modexprint(destpage, PIXPOSX, q+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text); q+=8;
+sprintf(global_temp_status_text, "pdet - %Fp", pagedelta);
+modexprint(destpage, PIXPOSX, q+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text); q+=8;
+sprintf(global_temp_status_text, "srcp - %Fp", sourcepage->data);
+modexprint(destpage, PIXPOSX, q+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text); q+=8;
+sprintf(global_temp_status_text, "desp - %Fp", destpage->data);
+modexprint(destpage, PIXPOSX, q+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text); q+=8;
+sprintf(global_temp_status_text, "srce - %Fp", source);
+modexprint(destpage, PIXPOSX, q+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text); q+=8;
+sprintf(global_temp_status_text, "dest - %Fp", dest);
+modexprint(destpage, PIXPOSX, q+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text); q=16;
+
+			//
+			// copy one pixel
+			//
+/*
+			mask = x&3;
+			VGAREADMAP(mask);
+			mask = maskb[mask];
+			VGAMAPMASK(mask);
+/*/
+//			modexputPixel(&(gvar->video.page[0]), x, y, rand());
+//			VL_Plot (x, y, 15, &(gvar->video.ofs));
+			modexCopyPageRegion(destpage, sourcepage, x, y, x, y, 4, 4);
+
+			__asm {
+				mov	di,[drawofs]
+				mov	al,[es:di]
+				add	di,[pagedelta]
+				mov	[es:di],al
+			}
+
+			if (rndval == 1)		// entire sequence has been completed
+				return false;
+		}
+		frame++;
+//--		while (TimeCount<frame){}//;		// don't go too fast
+	} while (1);
+	__asm {
+		mov	es,[esorig]
+	}
+	return false;
+}
+#endif
+
 #if 0
 boolean baka_FizzleFade (page_t *sourcepage, page_t *destpage, unsigned width, unsigned height, unsigned frames, boolean abortable, global_game_variables_t *gvar)
 {
@@ -573,9 +701,11 @@ void ding(page_t *page, bakapee_t *pee, word q)
 			modexprint(page, page->sw/2, page->sh/2, 1, 0, 47, 0, 1, "bakapi");
 		break;
 		case 9:
+#ifdef BAKAFIZZUNSIGNED
 			baka_FizzleFade (ggvv->video.ofs.bufferofs, ggvv->video.ofs.displayofs, vga_state.vga_width, vga_state.vga_height, 70, true, ggvv);
-//			modexprint(page, page->sw/2, page->sh/2, 1, 0, 47, 0, 1, "bakapi start");
-//			if(!baka_FizzleFade ((unsigned)page, (unsigned)page, page->width, page->height, 70, false, ggvv))
+#else
+			baka_FizzleFade (&ggvv->video.page[1], &ggvv->video.page[0], vga_state.vga_width, vga_state.vga_height, 70, true, ggvv);
+#endif
 		break;
 		case 10:
 			ssd(page, pee, q); /*printf("%d\n", pee->coor);*/
diff --git a/src/lib/bakapee.h b/src/lib/bakapee.h
index d39a97e8..2626e708 100755
--- a/src/lib/bakapee.h
+++ b/src/lib/bakapee.h
@@ -41,7 +41,12 @@ typedef struct {
 	word bonk,lgq,hgq;
 } bakapee_t;
 
+#define BAKAFIZZUNSIGNED
+#ifdef BAKAFIZZUNSIGNED
 boolean baka_FizzleFade (unsigned source, unsigned dest, unsigned width, unsigned height, unsigned frames, boolean abortable, global_game_variables_t *gvar);
+#else
+boolean baka_FizzleFade (page_t *sourcepage, page_t *destpage, unsigned width, unsigned height, unsigned frames, boolean abortable, global_game_variables_t *gvar);
+#endif
 void clrstdin();
 void colortest(page_t *page, bakapee_t *pee);
 void colorz(page_t *page, bakapee_t *pee);