//modexPalUpdate(bmp.palette); //____\r
//modexDrawBmp(VGA, 0, 0, &bmp, 0); //____\r
//getch(); //____\r
- VL_SetLineWidth (40, &gvar);\r
+ //VL_SetLineWidth (40, &gvar);\r
\r
VL_ShowPage(&gvar.video.page[showpage], 0, 0);\r
{\r
word w;\r
for(w=0;w<64000;w++)\r
{\r
- ding(&gvar.video.page[showpage], &bakapee, 4);\r
- ding(&gvar.video.page[1], &bakapee, 4);\r
+ ding(&gvar.video.page[showpage], &bakapee, 2);\r
+ ding(&gvar.video.page[1], &bakapee, 2);\r
}\r
+#ifdef BAKAFIZZUNSIGNED\r
if(!baka_FizzleFade (gvar.video.ofs.bufferofs, gvar.video.ofs.displayofs, vga_state.vga_width, vga_state.vga_height, 70, true, &gvar))\r
+#else\r
+ if(!baka_FizzleFade (&gvar.video.page[1], &gvar.video.page[0], vga_state.vga_width, vga_state.vga_height, 70, true, &gvar))\r
+#endif\r
//ding(&gvar.video.page[showpage], &bakapee, 9);\r
modexprint(&gvar.video.page[0], gvar.video.page[0].sw/2, gvar.video.page[0].sh/2, 1, 0, 47, 0, 1, "bakapi ok");\r
}\r
\r
////////////////////////////////////////////////////////////////////////////\r
//#ifdef __BORLANDC__\r
-void VL_Startup (global_game_variables_t *gvar){}\r
+//void VL_Startup (global_game_variables_t *gvar){}\r
void VL_Shutdown (global_game_variables_t *gvar){}\r
void VGAmodeX(sword vq, boolean cmem, global_game_variables_t *gv)\r
{\r
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;
#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);
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);
\r
if ((x>width || y>height) && (x<width*2 && y<height*2))\r
continue;\r
- drawofs = source+(gvar->video.ofs.ylookup[y]) + (x>>2);\r
+ //drawofs = source+(gvar->video.ofs.ylookup[y]) + (x>>2);\r
+ drawofs = source+(y*gvar->video.page[0].stridew) + (x>>2);\r
\r
//\r
// copy one pixel\r
if(gvar.in.inst->Keyboard[sc_P]){ modexpdump(&gvar.video.page[0]); IN_UserInput(1, &gvar); } \\r
if(gvar.in.inst->Keyboard[sc_Y]){ dbg_delayanimation=!dbg_delayanimation; IN_UserInput(1, &gvar); } \\r
if(gvar.in.inst->Keyboard[sc_Q]){ VL_modexPrintTextBox(&gvar); IN_UserInput(1, &gvar); } \\r
- if(gvar.in.inst->Keyboard[sc_W]){ VL_MemToScreen((byte __far *)&gvar, 64, 64, 16, 16, &gvar.video.ofs); IN_UserInput(1, &gvar); } \\r
+ if(gvar.in.inst->Keyboard[sc_W]){ VL_MemToScreen((byte __far *)&gvar, 64, 64, 16, 16, &gvar); IN_UserInput(1, &gvar); } \\r
RFDEBUGFUNCTIONS\r
//FIZZLEFADEFUNCTION\r
\r
\r
typedef struct\r
{\r
+ //ylookup[MAXSCANLINES],\r
unsigned int offscreen_ofs;\r
unsigned int pattern_ofs;\r
- unsigned bufferofs, ylookup[MAXSCANLINES], linewidth,displayofs;\r
+ unsigned bufferofs,linewidth,displayofs;\r
pan_t pan;\r
} ofs_t; //unfinished\r
\r
}\r
break;\r
}\r
- VL_SetLineWidth (cm.offset, gv);\r
+// VL_SetLineWidth (cm.offset, gv);\r
+ gv->video.ofs.displayofs = 0;\r
+ gv->video.ofs.bufferofs = gv->video.page[0].width*gv->video.page[0].height;//gvar->video.page[0].pagesize;\r
gv->video.curr_mode=vq;\r
gv->video.VL_Started=1;\r
}\r
video->vga_state.vga_draw_stride= vga_state.vga_draw_stride;\r
video->vga_state.vga_draw_stride_limit= vga_state.vga_draw_stride_limit;\r
//sprite render switch and bgpreservation switch\r
- video->vga_state.rss= 1;\r
+ video->vga_state.rss= 1;\r
video->vga_state.bgps= 1;\r
\r
//setup the buffersize\r
void modexPalUpdate(byte *p);\r
void VL_modexPalScramble(byte *p);\r
word modexPalOverscan(word col);\r
-void VL_Plot (int x, int y, int color, ofs_t *ofs);\r
-void VL_Hlin (unsigned x, unsigned y, unsigned width, unsigned color, ofs_t *ofs);\r
-void VL_Vlin (int x, int y, int height, int color, ofs_t *ofs);\r
-void VL_Bar (int x, int y, int width, int height, int color, ofs_t *ofs);\r
-void VL_MemToScreen (byte far *source, int width, int height, int x, int y, ofs_t *ofs);\r
+void VL_Plot (int x, int y, int color, global_game_variables_t *gvar);\r
+void VL_Hlin (unsigned x, unsigned y, unsigned width, unsigned color, global_game_variables_t *gvar);\r
+void VL_Vlin (int x, int y, int height, int color, global_game_variables_t *gvar);\r
+void VL_Bar (int x, int y, int width, int height, int color, global_game_variables_t *gvar);\r
+void VL_MemToScreen (byte far *source, int width, int height, int x, int y, global_game_variables_t *gvar);\r
void modexputPixel(page_t *page, int x, int y, byte color);\r
byte modexgetPixel(page_t *page, int x, int y);\r
\r
=\r
====================\r
*/\r
-\r
+#if 0\r
void VL_SetLineWidth (unsigned width, global_game_variables_t *gvar)\r
{\r
int i,offset;\r
gvar->video.ofs.ylookup[i]=offset;\r
offset += gvar->video.ofs.linewidth;\r
}\r
- gvar->video.ofs.displayofs = 0;\r
- gvar->video.ofs.bufferofs = gvar->video.page[0].width*gvar->video.page[0].height;//gvar->video.page[0].pagesize;\r
}\r
-\r
+#endif\r
/*\r
=============================================================================\r
\r
=================\r
*/\r
\r
-void VL_Plot (int x, int y, int color, ofs_t *ofs)\r
+void VL_Plot (int x, int y, int color, global_game_variables_t *gvar)\r
{\r
byte mask;\r
VCLIPDEF\r
\r
mask = pclip[x&3];\r
VGAMAPMASK(mask);\r
- *(byte far *)MK_FP(SCREENSEG,ofs->bufferofs+(ofs->ylookup[y]+(x>>2))) = color;\r
+ //*(byte far *)MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+(gvar->video.ofs.ylookup[y]+(x>>2))) = color;\r
+ *(byte far *)MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+((y*gvar->video.page[0].stridew)+(x>>2))) = color;\r
VGAMAPMASK(15);\r
}\r
\r
=================\r
*/\r
\r
-void VL_Hlin (unsigned x, unsigned y, unsigned width, unsigned color, ofs_t *ofs)\r
+void VL_Hlin (unsigned x, unsigned y, unsigned width, unsigned color, global_game_variables_t *gvar)\r
{\r
unsigned xbyte;\r
byte far *dest;\r
rightmask = rclip[(x+width-1)&3];\r
midbytes = ((x+width+3)>>2) - xbyte - 2;\r
\r
- dest = MK_FP(SCREENSEG,ofs->bufferofs+ofs->ylookup[y]+xbyte);\r
+ //dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+gvar->video.ofs.ylookup[y]+xbyte);\r
+ dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+(y*gvar->video.page[0].stridew)+xbyte);\r
\r
if (midbytes<0)\r
{\r
=================\r
*/\r
\r
-void VL_Vlin (int x, int y, int height, int color, ofs_t *ofs)\r
+void VL_Vlin (int x, int y, int height, int color, global_game_variables_t *gvar)\r
{\r
byte far *dest,mask;\r
VCLIPDEF\r
mask = pclip[x&3];\r
VGAMAPMASK(mask);\r
\r
- dest = MK_FP(SCREENSEG,ofs->bufferofs+ofs->ylookup[y]+(x>>2));\r
+ //dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+gvar->video.ofs.ylookup[y]+(x>>2));\r
+ dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+(y*gvar->video.page[0].stridew)+(x>>2));\r
\r
while (height--)\r
{\r
*dest = color;\r
- dest += ofs->linewidth;\r
+ dest += gvar->video.ofs.linewidth;\r
}\r
\r
VGAMAPMASK(15);\r
=================\r
*/\r
\r
-void VL_Bar (int x, int y, int width, int height, int color, ofs_t *ofs)\r
+void VL_Bar (int x, int y, int width, int height, int color, global_game_variables_t *gvar)\r
{\r
byte far *dest;\r
byte leftmask,rightmask;\r
leftmask = lclip[x&3];\r
rightmask = rclip[(x+width-1)&3];\r
midbytes = ((x+width+3)>>2) - (x>>2) - 2;\r
- linedelta = ofs->linewidth-(midbytes+1);\r
+ linedelta = gvar->video.ofs.linewidth-(midbytes+1);\r
\r
- dest = MK_FP(SCREENSEG,ofs->bufferofs+ofs->ylookup[y]+(x>>2));\r
+ //dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+gvar->video.ofs.ylookup[y]+(x>>2));\r
+ dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+(y*gvar->video.page[0].stridew)+(x>>2));\r
\r
if (midbytes<0)\r
{\r
while (height--)\r
{\r
*dest = color;\r
- dest += ofs->linewidth;\r
+ dest += gvar->video.ofs.linewidth;\r
}\r
VGAMAPMASK(15);\r
return;\r
=================\r
*/\r
\r
-void VL_MemToScreen (byte far *source, int width, int height, int x, int y, ofs_t *ofs)\r
+void VL_MemToScreen (byte far *source, int width, int height, int x, int y, global_game_variables_t *gvar)\r
{\r
byte far *screen,far *dest,mask;\r
int plane;\r
\r
width>>=2;\r
- dest = MK_FP(SCREENSEG,ofs->bufferofs+ofs->ylookup[y]+(x>>2) );\r
+ //dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+gvar->video.ofs.ylookup[y]+(x>>2));\r
+ dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+(y*gvar->video.page[0].stridew)+(x>>2));\r
mask = 1 << (x&3);\r
\r
for (plane = 0; plane<4; plane++)\r
mask = 1;\r
\r
screen = dest;\r
- for (y=0;y<height;y++,screen+=ofs->linewidth,source+=width)\r
+ for (y=0;y<height;y++,screen+=gvar->video.ofs.linewidth,source+=width)\r
_fmemcpy (screen,source,width);\r
}\r
}\r
//extern ControlInfo c;\r
#define PIXPOSX gvar->video.page[0].sw/2\r
#define PIXPOSY gvar->video.page[0].sh/2\r
-\r
+#ifdef BAKAFIZZUNSIGNED\r
boolean baka_FizzleFade (unsigned source, unsigned dest, unsigned width, unsigned height, unsigned frames, boolean abortable, global_game_variables_t *gvar)\r
{\r
word p,pixperframe;\r
\r
pagedelta = dest-source;\r
rndval = 1; esorig = 0; q = 16;\r
- x = y = 0;//destpage->dx;\r
- pixperframe = /*76800*/64000/(dword)frames;\r
+ x = y = 0;\r
+ pixperframe = 64000/(dword)frames;\r
\r
// IN_StartAck ();\r
\r
\r
// modexClearRegion(&(gvar->video.page[0]), 0, 0, gvar->video.page[0].width, gvar->video.page[0].height, 0);\r
// modexClearRegion(&(gvar->video.page[1]), 0, 0, gvar->video.page[0].width, gvar->video.page[0].height, 15);\r
-// VL_SetLineWidth(80, gvar);\r
+// VL_SetLineWidth(44, gvar);\r
\r
__asm {\r
mov [esorig],es\r
// if (x<destpage->sw || y<destpage->sh)\r
if ((x>width || y>height) && (x<width*2 && y<height*2))\r
continue;\r
- drawofs = source+(gvar->video.ofs.ylookup[y]) + (x>>2);\r
+ //drawofs = source+(gvar->video.ofs.ylookup[y]) + (x>>2);\r
+ drawofs = source+(y*gvar->video.page[0].stridew) + (x>>2);\r
sprintf(global_temp_status_text, "draw - %Fp", drawofs);\r
modexprint(&(gvar->video.page[0]), PIXPOSX, q+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text); q+=8;\r
sprintf(global_temp_status_text, "pdet - %Fp", pagedelta);\r
return false;\r
}\r
\r
+#else\r
+boolean baka_FizzleFade (page_t *sourcepage, page_t *destpage, unsigned width, unsigned height, unsigned frames, boolean abortable, global_game_variables_t *gvar)\r
+{\r
+ word p,pixperframe;\r
+ unsigned drawofs,pagedelta;\r
+// byte mask,maskb[8] = {1,2,4,8};\r
+ unsigned x,y,frame ,esorig,q;\r
+ dword rndval;\r
+ unsigned source,dest;\r
+ word screenseg = SCREENSEG;\r
+ source = ((word)sourcepage->data); dest = ((word)destpage->data);\r
+\r
+ pagedelta = dest-source;\r
+ rndval = 1; esorig = 0; q = 16;\r
+ x = y = 0;//destpage->dx;\r
+ pixperframe = 76800/(dword)frames;\r
+\r
+// IN_StartAck ();\r
+\r
+// VL_ShowPage(&(gvar->video.page[0]), 1, 0);\r
+// VL_ShowPage(&(gvar->video.page[1]), 1, 0);\r
+\r
+// modexClearRegion(&(gvar->video.page[0]), 0, 0, gvar->video.page[0].width, gvar->video.page[0].height, 0);\r
+// modexClearRegion(&(gvar->video.page[1]), 0, 0, gvar->video.page[0].width, gvar->video.page[0].height, 15);\r
+// VL_SetLineWidth(80, gvar);\r
+\r
+ __asm {\r
+ mov [esorig],es\r
+ }\r
+// TimeCount=\r
+ frame=0;\r
+ do // while (1)\r
+ {\r
+sprintf(global_temp_status_text, "%u", frame);\r
+modexprint(destpage, PIXPOSX, PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text);\r
+ if (abortable && kbhit())//IN_CheckAck () )\r
+ return true;\r
+\r
+ __asm {\r
+ mov es,[screenseg]\r
+ }\r
+\r
+ for (p=0;p<pixperframe;p++)\r
+ {\r
+ __asm {\r
+ //\r
+ // seperate random value into x/y pair\r
+ //\r
+ mov ax,[WORD PTR rndval]\r
+ mov dx,[WORD PTR rndval+2]\r
+ mov bx,ax\r
+ dec bl\r
+ mov [BYTE PTR y],bl // low 8 bits - 1 = y xoordinate\r
+ mov bx,ax\r
+ mov cx,dx\r
+ mov [BYTE PTR x],ah // next 9 bits = x xoordinate\r
+ mov [BYTE PTR x+1],dl\r
+ //\r
+ // advance to next random element\r
+ //\r
+ shr dx,1\r
+ rcr ax,1\r
+ jnc noxor\r
+ xor dx,0x0001\r
+ xor ax,0x2000\r
+#ifdef __BORLANDC__\r
+ }\r
+#endif\r
+noxor:\r
+#ifdef __BORLANDC__\r
+ __asm {\r
+#endif\r
+ mov [WORD PTR rndval],ax\r
+ mov [WORD PTR rndval+2],dx\r
+ }\r
+\r
+// if (x>destpage->width || y>destpage->height)\r
+// if (x<destpage->sw || y<destpage->sh)\r
+ if ((x>width || y>height) && (x<width*2 && y<height*2))\r
+ continue;\r
+ drawofs = source+(gvar->video.ofs.ylookup[y]) + (x>>2);\r
+sprintf(global_temp_status_text, "draw - %Fp", drawofs);\r
+modexprint(destpage, PIXPOSX, q+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text); q+=8;\r
+sprintf(global_temp_status_text, "pdet - %Fp", pagedelta);\r
+modexprint(destpage, PIXPOSX, q+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text); q+=8;\r
+sprintf(global_temp_status_text, "srcp - %Fp", sourcepage->data);\r
+modexprint(destpage, PIXPOSX, q+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text); q+=8;\r
+sprintf(global_temp_status_text, "desp - %Fp", destpage->data);\r
+modexprint(destpage, PIXPOSX, q+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text); q+=8;\r
+sprintf(global_temp_status_text, "srce - %Fp", source);\r
+modexprint(destpage, PIXPOSX, q+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text); q+=8;\r
+sprintf(global_temp_status_text, "dest - %Fp", dest);\r
+modexprint(destpage, PIXPOSX, q+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text); q=16;\r
+\r
+ //\r
+ // copy one pixel\r
+ //\r
+/*\r
+ mask = x&3;\r
+ VGAREADMAP(mask);\r
+ mask = maskb[mask];\r
+ VGAMAPMASK(mask);\r
+/*/\r
+// modexputPixel(&(gvar->video.page[0]), x, y, rand());\r
+// VL_Plot (x, y, 15, &(gvar->video.ofs));\r
+ modexCopyPageRegion(destpage, sourcepage, x, y, x, y, 4, 4);\r
+\r
+ __asm {\r
+ mov di,[drawofs]\r
+ mov al,[es:di]\r
+ add di,[pagedelta]\r
+ mov [es:di],al\r
+ }\r
+\r
+ if (rndval == 1) // entire sequence has been completed\r
+ return false;\r
+ }\r
+ frame++;\r
+//-- while (TimeCount<frame){}//; // don't go too fast\r
+ } while (1);\r
+ __asm {\r
+ mov es,[esorig]\r
+ }\r
+ return false;\r
+}\r
+#endif\r
+\r
#if 0\r
boolean baka_FizzleFade (page_t *sourcepage, page_t *destpage, unsigned width, unsigned height, unsigned frames, boolean abortable, global_game_variables_t *gvar)\r
{\r
modexprint(page, page->sw/2, page->sh/2, 1, 0, 47, 0, 1, "bakapi");\r
break;\r
case 9:\r
+#ifdef BAKAFIZZUNSIGNED\r
baka_FizzleFade (ggvv->video.ofs.bufferofs, ggvv->video.ofs.displayofs, vga_state.vga_width, vga_state.vga_height, 70, true, ggvv);\r
-// modexprint(page, page->sw/2, page->sh/2, 1, 0, 47, 0, 1, "bakapi start");\r
-// if(!baka_FizzleFade ((unsigned)page, (unsigned)page, page->width, page->height, 70, false, ggvv))\r
+#else\r
+ baka_FizzleFade (&ggvv->video.page[1], &ggvv->video.page[0], vga_state.vga_width, vga_state.vga_height, 70, true, ggvv);\r
+#endif\r
break;\r
case 10:\r
ssd(page, pee, q); /*printf("%d\n", pee->coor);*/\r
word bonk,lgq,hgq;\r
} bakapee_t;\r
\r
+#define BAKAFIZZUNSIGNED\r
+#ifdef BAKAFIZZUNSIGNED\r
boolean baka_FizzleFade (unsigned source, unsigned dest, unsigned width, unsigned height, unsigned frames, boolean abortable, global_game_variables_t *gvar);\r
+#else\r
+boolean baka_FizzleFade (page_t *sourcepage, page_t *destpage, unsigned width, unsigned height, unsigned frames, boolean abortable, global_game_variables_t *gvar);\r
+#endif\r
void clrstdin();\r
void colortest(page_t *page, bakapee_t *pee);\r
void colorz(page_t *page, bakapee_t *pee);\r