# game and bakapi executables
#
16.exe: 16.$(OBJ) $(16LIB) gfx.lib $(DOSLIB)
-bakapi.exe: bakapi.$(OBJ) gfx.lib $(DOSLIB) 16_wcpu.$(OBJ)
+bakapi.exe: bakapi.$(OBJ) 16_vl.$(OBJ) 16_vl_1.$(OBJ) 16text.$(OBJ) bakapee.$(OBJ) $(DOSLIB) 16_wcpu.$(OBJ)# gfx.lib
#
# Test Executables!
VL_modexPalScramble(gvar.video.palette);\r
\r
/* load color palette */\r
- VL_LoadPalFile(bakapee2, &gvar.video.palette);\r
+ VL_LoadPalFile(bakapee2, &gvar.video.palette, &gvar);\r
\r
/* preprocess the sprite to generate line offsets */\r
vrl_lineoffs = vrl1_vgax_genlineoffsets(vrl_header,buffer+sizeof(*vrl_header),bufsz-sizeof(*vrl_header));\r
main(int argc, char *argvar[])\r
{\r
static global_game_variables_t gvar;\r
+ struct glob_game_vars *ggvv;\r
char *a;\r
int i;\r
word panq=1, pand=0;\r
boolean panswitch=0;\r
\r
+ ggvv=&gvar;\r
+\r
// allow changing default mode from command line\r
for (i=1;i < argc;) {\r
a = argvar[i++];\r
\r
/* setup camera and screen~ */\r
gvar.video.page[0] = modexDefaultPage(&gvar.video.page[0]);\r
+ gvar.video.page[1] = modexNextPage(&gvar.video.page[0]);\r
\r
//modexPalUpdate(bmp.palette); //____\r
//modexDrawBmp(VGA, 0, 0, &bmp, 0); //____\r
//getch(); //____\r
\r
VL_ShowPage(&gvar.video.page[0], 0, 0);\r
+ {\r
+ word w;\r
+ for(w=0;w<64000;w++)\r
+ {\r
+ ding(&gvar.video.page[1], &bakapee, 4);\r
+ }\r
+ if(!baka_FizzleFade (&gvar.video.page[1], &gvar.video.page[0], 70, true, &gvar))\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
+ while(!kbhit()){}\r
\r
// screen savers\r
//#ifdef BOINK\r
}else c=getch();\r
}\r
\r
- if(!panswitch) ding(&gvar.video.page[0], &bakapee, key);\r
- else ding(&gvar.video.page[0], &bakapee, 2);\r
+ if(!panswitch) ding(&gvar.video.page[0], &bakapee, 2);\r
+ else ding(&gvar.video.page[0], &bakapee, 9);\r
if(panswitch!=0)\r
{\r
//right movement\r
panq++;\r
} else { panq = 1; pand = 0; }\r
}\r
+ if((c==0x4d && pand == 0) || pand == 2)\r
+ {\r
+ if(pand == 0){ pand = 2; }\r
+ if(panq<=(TILEWH/(4)))\r
+ {\r
+ gvar.video.page[0].dx++;\r
+ VL_ShowPage(&gvar.video.page[0], 0, 0);\r
+ panq++;\r
+ } else { panq = 1; pand = 0; }\r
+ }\r
+ if(c==0x01+1)\r
+ {\r
+ VL_ShowPage(&gvar.video.page[0], 0, 0);\r
+ }\r
+ if(c==0x02+1)\r
+ {\r
+ VL_ShowPage(&gvar.video.page[1], 0, 0);\r
+ }\r
if(c==0x71 || c==0xb1 || c=='p')\r
{\r
//getch(); // eat keyboard input\r
key = c - '0';\r
VGAmodeX(vgamodex_mode, 0, &gvar);\r
gvar.video.page[0] = modexDefaultPage(&gvar.video.page[0]);\r
+ gvar.video.page[1] = modexNextPage(&gvar.video.page[1]);\r
// this code is written around modex16 which so far is a better fit than using DOSLIB vga directly, so leave MXLIB code in.\r
// we'll integrate DOSLIB vga into that part of the code instead for less disruption. -- J.C.\r
VL_ShowPage(&gvar.video.page[0], 0, 0);\r
break;\r
default:\r
key=0;\r
+ clrscr(); //added to clear screen wwww\r
break;\r
}\r
}\r
* Fifth Floor, Boston, MA 02110-1301 USA.\r
*\r
*/\r
-\r
-#ifndef __BAKAPI_H_\r
-#define __BAKAPI_H_\r
+/*\r
+ * BAKAPEE!\r
+ */\r
+#ifndef __BAKAPI_H__\r
+#define __BAKAPI_H__\r
\r
#include "src/lib/bakapee.h"\r
#include "src/lib/wcpu/16_wcpu.h"\r
//project 16 testing define switch for veiwing the contents of the video memory --sparky4\r
#define BOINK // what does this mean? --J.C.\r
\r
-#endif /*__BAKAPI_H_*/\r
+#endif /*__BAKAPI_H__*/\r
\r
////////////////////////////////////////////////////////////////////////////\r
//#ifdef __BORLANDC__\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
printf("VGAmodeX dummy:\n %Fp %Fp %Fp\n", &vq, &cmem, gv);\r
MM_Shutdown(gvar);\r
#ifdef __WATCOMC__\r
if(gvar->video.VL_Started)\r
- VGAmodeX(0, 1, gvar);\r
+ VL_Shutdown (gvar);//VGAmodeX(0, 1, gvar);\r
#endif\r
}\r
\r
\r
if (rndval == 1) // entire sequence has been completed\r
{\r
-//++++ VGABITMASK(255);\r
-//++++ VGAMAPMASK(15);\r
+ VGABITMASK(255);\r
+ VGAMAPMASK(15);\r
return;\r
}\r
}\r
frame++;\r
-//++++ while (TimeCount<frame){} // don't go too fast\r
+ while (TimeCount<frame){} // don't go too fast\r
} while (1);\r
\r
\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
RFDEBUGFUNCTIONS\r
//FIZZLEFADEFUNCTION\r
\r
if(gvar.in.inst->Keyboard[sc_I]){ dbg_maptext=!dbg_maptext; IN_UserInput(1, &gvar); } \\r
if(gvar.in.inst->Keyboard[sc_PgDn]){ \\r
rotateR(gvar.video.palette, sizeof(gvar.video.palette)/sizeof(gvar.video.palette[0])); \\r
- VL_UpdatePaletteWrite(&gvar.video.palette, 0); IN_UserInput(1, &gvar); } \\r
+ VL_UpdatePaletteWrite(&gvar.video.palette, 0, &gvar); IN_UserInput(1, &gvar); } \\r
if(gvar.in.inst->Keyboard[sc_PgUp]){ \\r
rotateL(gvar.video.palette, sizeof(gvar.video.palette)/sizeof(gvar.video.palette[0])); \\r
- VL_UpdatePaletteWrite(&gvar.video.palette, 0); IN_UserInput(1, &gvar); }\r
+ VL_UpdatePaletteWrite(&gvar.video.palette, 0, &gvar); IN_UserInput(1, &gvar); }\r
#ifdef __BORLANDC__\r
#define PAL_WRITE_REG 0x03C8 /* Color register, write address */\r
#define PAL_DATA_REG 0x03C9 /* Color register, data port */\r
+/* Project 16 Source Code~\r
+ * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
+ *\r
+ * This file is part of Project 16.\r
+ *\r
+ * Project 16 is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 3 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * Project 16 is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program. If not, see <http://www.gnu.org/licenses/>, or\r
+ * write to the Free Software Foundation, Inc., 51 Franklin Street,\r
+ * Fifth Floor, Boston, MA 02110-1301 USA.\r
+ *\r
+ */\r
+/*\r
+ * 16 tail library\r
+ */\r
+\r
#include "src/lib/16_tail.h"\r
\r
void TL_VidInit(global_game_variables_t *gvar)\r
// get old video mode\r
//in.h.ah = 0xf;\r
//int86(0x10, &in, &out);\r
- if(!gvar->video.old_mode) gvar->video.old_mode = vgaGetMode();//out.h.al;\r
- VL_LoadPalFileCore(gvar->video.palette);\r
+ if(!gvar->video.old_mode) gvar->video.old_mode = VL_vgaGetMode();//out.h.al;\r
gvar->video.VL_Initiated = 1;\r
}\r
static void fadePalette(sbyte fade, sbyte start, word iter, byte *palette);\r
static byte tmppal[PAL_SIZE];\r
\r
+//===========================================================================\r
+\r
+/*\r
+=======================\r
+=\r
+= VL_Startup\r
+=\r
+=======================\r
+*/\r
+\r
+void VL_Startup (global_game_variables_t *gvar)\r
+{\r
+ __asm cld;\r
+\r
+ VGAmodeX(1/*TODO other modes*/, 1, gvar);\r
+ VL_LoadPalFileCore(gvar->video.palette, gvar);\r
+ //Quit ("Improper video card! If you really have a VGA card that I am not\ndetecting it!", gvar);\r
+}\r
+\r
+\r
+\r
+/*\r
+=======================\r
+=\r
+= VL_Shutdown\r
+=\r
+=======================\r
+*/\r
+\r
+void VL_Shutdown (global_game_variables_t *gvar)\r
+{\r
+ VGAmodeX(0, 1, gvar);\r
+}\r
+\r
+/*\r
+=======================\r
+=\r
+= VL_SetVGAPlaneMode\r
+=\r
+=======================\r
+*/\r
+#if 0\r
+void VL_SetVGAPlaneMode (global_game_variables_t *gvar)\r
+{\r
+ VL_vgaSetMode(VGA_256_COLOR_MODE);\r
+ VL_DePlaneVGA ();\r
+ VGAMAPMASK(15);\r
+ VL_SetLineWidth (40, &gvar->video.ofs);\r
+}\r
+#endif\r
+\r
+//===========================================================================\r
+\r
+/*\r
+=================\r
+=\r
+= VL_ClearVideo\r
+=\r
+= Fill the entire video buffer with a given color\r
+=\r
+=================\r
+*/\r
+\r
+void VL_ClearVideo (byte color)\r
+{\r
+ __asm {\r
+ mov dx,GC_INDEX\r
+ mov al,GC_MODE\r
+ out dx,al\r
+ inc dx\r
+ in al,dx\r
+ and al,0xfc // write mode 0 to store directly to video\r
+ out dx,al\r
+\r
+ mov dx,SC_INDEX\r
+ mov ax,SC_MAPMASK+15*256\r
+ out dx,ax // write through all four planes\r
+\r
+ mov ax,SCREENSEG\r
+ mov es,ax\r
+ mov al,[color]\r
+ mov ah,al\r
+ mov cx,0x8000 // 0x8000 words, clearing 8 video bytes/word\r
+ xor di,di\r
+ rep stosw\r
+ }\r
+}\r
+\r
+/*\r
+=============================================================================\r
+\r
+ VGA REGISTER MANAGEMENT ROUTINES\r
+\r
+=============================================================================\r
+*/\r
+\r
+\r
+/*\r
+=================\r
+=\r
+= VL_DePlaneVGA\r
+=\r
+=================\r
+*/\r
+#if 0\r
+void VL_DePlaneVGA (void)\r
+{\r
+\r
+//\r
+// change CPU addressing to non linear mode\r
+//\r
+\r
+//\r
+// turn off chain 4 and odd/even\r
+//\r
+ outportb (SC_INDEX,SC_MEMMODE);\r
+ outportb (SC_INDEX+1,(inportb(SC_INDEX+1)&~8)|4);\r
+\r
+ outportb (SC_INDEX,SC_MAPMASK); // leave this set throughought\r
+\r
+//\r
+// turn off odd/even and set write mode 0\r
+//\r
+ outportb (GC_INDEX,GC_MODE);\r
+ outportb (GC_INDEX+1,inportb(GC_INDEX+1)&~0x13);\r
+\r
+//\r
+// turn off chain\r
+//\r
+ outportb (GC_INDEX,GC_MISCELLANEOUS);\r
+ outportb (GC_INDEX+1,inportb(GC_INDEX+1)&~2);\r
+\r
+//\r
+// clear the entire buffer space, because int 10h only did 16 k / plane\r
+//\r
+ VL_ClearVideo (0);\r
+\r
+//\r
+// change CRTC scanning from doubleword to byte mode, allowing >64k scans\r
+//\r
+ outportb (CRTC_INDEX,CRTC_UNDERLINE);\r
+ outportb (CRTC_INDEX+1,inportb(CRTC_INDEX+1)&~0x40);\r
+\r
+ outportb (CRTC_INDEX,CRTC_MODE);\r
+ outportb (CRTC_INDEX+1,inportb(CRTC_INDEX+1)|0x40);\r
+}\r
+#endif\r
+//===========================================================================\r
+\r
+/*\r
+====================\r
+=\r
+= VL_SetSplitScreen\r
+=\r
+====================\r
+*/\r
+\r
+void VL_SetSplitScreen (int linenum)\r
+{\r
+ VL_WaitVBL (1);\r
+ linenum=linenum*2-1;\r
+ outportb (CRTC_INDEX,CRTC_LINECOMPARE);\r
+ outportb (CRTC_INDEX+1,linenum % 256);\r
+ outportb (CRTC_INDEX,CRTC_OVERFLOW);\r
+ outportb (CRTC_INDEX+1, 1+16*(linenum/256));\r
+ outportb (CRTC_INDEX,CRTC_MAXSCANLINE);\r
+ outportb (CRTC_INDEX+1,inportb(CRTC_INDEX+1) & (255-64));\r
+}\r
+\r
/////////////////////////////////////////////////////////////////////////////\r
-// //\r
-// setvideo() - This function Manages the video modes //\r
-// //\r
+// //\r
+// setvideo() - This function Manages the video modes //\r
+// //\r
/////////////////////////////////////////////////////////////////////////////\r
void VGAmodeX(sword vq, boolean cmem, global_game_variables_t *gv)\r
{\r
// get old video mode\r
//in.h.ah = 0xf;\r
//int86(0x10, &in, &out);\r
- gv->video.old_mode = vgaGetMode();//out.h.al;\r
+ gv->video.old_mode = VL_vgaGetMode();//out.h.al;\r
// enter mode\r
modexEnter(vq, cmem, gv);\r
break;\r
}\r
}\r
\r
-static void\r
-vgaSetMode(byte mode)\r
+//---------------------------------------------------\r
+//\r
+// Use the bios to set the current video mode\r
+//\r
+\r
+/*static */void\r
+VL_vgaSetMode(byte mode)\r
{\r
union REGS regs;\r
\r
regs.h.ah = SET_MODE;\r
regs.h.al = mode;\r
int86(VIDEO_INT, ®s, ®s);\r
- //int10_setmode(mode);\r
}\r
\r
//---------------------------------------------------\r
// Use the bios to get the current video mode\r
//\r
\r
-byte/*FIXME: why long? "long" is 32-bit datatype, VGA modes are 8-bit numbers. */\r
-vgaGetMode()\r
+byte\r
+VL_vgaGetMode(void)\r
{\r
return int10_getmode();\r
}\r
/* -========================= Entry Points ==========================- */\r
void modexEnter(sword vq, boolean cmem, global_game_variables_t *gv)\r
{\r
- word i;\r
+ //word i;\r
struct vga_mode_params cm;\r
//int CRTParmCount;\r
\r
- vgaSetMode(VGA_256_COLOR_MODE);\r
+ VL_vgaSetMode(VGA_256_COLOR_MODE);\r
vga_enable_256color_modex();\r
\r
update_state_from_vga();\r
vga_state.vga_stride = cm.offset * 2;\r
vga_write_crtc_mode(&cm,0);\r
\r
- /* clear video memory */\r
+ // clear video memory //\r
switch (cmem)\r
{\r
- case 1: {\r
- /* clear video memory */\r
- dword far*ptr=(dword far*)vga_state.vga_graphics_ram;//VGA; /* used for faster screen clearing */\r
+ case 1:\r
+ {\r
+#if 0\r
+ dword far*ptr=(dword far*)vga_state.vga_graphics_ram;//VGA; // used for faster screen clearing //\r
vga_write_sequencer(2/*map mask register*/,0xf/*all 4 planes*/);\r
for(i = 0;i < 0x4000; i++) ptr[i] = 0x0000; // 0x4000 x dword = 64KB\r
- /* fix up the palette and everything */\r
- modexPalBlack(); //reset the palette~\r
+ // fix up the palette and everything //\r
+ modexPalBlack(); //reset the palette~//\r
+#endif\r
+ //\r
+ // clear the entire buffer space, because int 10h only did 16 k / plane\r
+ //\r
+ VL_ClearVideo (0);\r
}\r
break;\r
}\r
-// VL_SetLineWidth (cm.offset, &gv->video.ofs);\r
+ VL_SetLineWidth (cm.offset, &gv->video.ofs);\r
gv->video.VL_Started=1;\r
}\r
\r
-void\r
-modexLeave() {\r
- /* VGAmodeX restores original mode and palette */\r
- vgaSetMode(TEXT_MODE);\r
+void modexLeave(void)\r
+{\r
+ // VGAmodeX restores original mode and palette\r
+ VL_vgaSetMode(TEXT_MODE);\r
}\r
\r
page_t\r
}\r
\r
\r
-/* save and load */\r
-void\r
-modexPalSave(byte *palette) {\r
+// save and load\r
+void modexPalSave(byte *palette)\r
+{\r
int i;\r
\r
- outp(PAL_READ_REG, 0); /* start at palette entry 0 */\r
- for(i=0; i<PAL_SIZE; i++) {\r
- palette[i] = inp(PAL_DATA_REG); /* read the palette data */\r
+ outp(PAL_READ_REG, 0); // start at palette entry 0\r
+ for(i=0; i<PAL_SIZE; i++)\r
+ {\r
+ palette[i] = inp(PAL_DATA_REG); // read the palette data\r
}\r
}\r
\r
fclose(file);\r
}\r
\r
-void VL_LoadPalFile(const char *filename, byte *palette)\r
+void VL_LoadPalFile(const char *filename, byte *palette, global_game_variables_t *gvar)\r
{\r
- VL_LoadPalFilewithoffset(filename, palette, 8);\r
- VL_LoadPalFileCore(palette);\r
+ VL_LoadPalFilewithoffset(filename, palette, 8, gvar);\r
+// VL_LoadPalFileCore(palette);\r
}\r
\r
-void VL_LoadPalFileCore(byte *palette)\r
+void VL_LoadPalFileCore(byte *palette, global_game_variables_t *gvar)\r
{\r
- VL_LoadPalFilewithoffset("data/16.pal", palette, 0);\r
+ VL_LoadPalFilewithoffset("data/16.pal", palette, 0, gvar);\r
}\r
\r
-void VL_LoadPalFilewithoffset(const char *filename, byte *palette, word o)\r
+void VL_LoadPalFilewithoffset(const char *filename, byte *palette, word o, global_game_variables_t *gvar)\r
{\r
int fd;\r
\r
read(fd,palette, PAL_SIZE);\r
close(fd);\r
\r
- VL_UpdatePaletteWrite(palette, o);\r
+ VL_UpdatePaletteWrite(palette, o, gvar);\r
}\r
}\r
\r
-void VL_UpdatePaletteWrite(byte *palette, word o)\r
+void VL_UpdatePaletteWrite(byte *palette, word o, global_game_variables_t *gvar)\r
{\r
word i;\r
vga_palette_lseek(/*1+*/o);\r
- for (i=o;i < 256-o;i++) vga_palette_write(palette[(i*3)+0]>>2,palette[(i*3)+1]>>2,palette[(i*3)+2]>>2);\r
+ //for (i=o;i < 256-o;i++)\r
+ for (i=0;i < 256-o;i++)\r
+ vga_palette_write(palette[(i*3)+0]>>2,palette[(i*3)+1]>>2,palette[(i*3)+2]>>2);\r
+\r
+ VL_PaletteSync(gvar);\r
+}\r
+\r
+void VL_PaletteSync(global_game_variables_t *gvar)\r
+{\r
+ modexPalSave(&gvar->video.palette);\r
}\r
\r
void\r
}\r
}\r
}\r
-\r
+#if 0\r
/////////////////////////////////////////////////////////////////////////////\r
// //\r
// cls() - This clears the screen to the specified color, on the VGA or on //\r
//_fmemset(VGA, color, 16000);\r
_fmemset(Where, color, page->stridew*page->height);\r
}\r
-\r
+#endif\r
//\r
// pattern filler from joncampbell123's code\r
//\r
//\r
// VGA hardware routines\r
//\r
-\r
-void VGAMAPMASK(byte x);\r
-void VGAWRITEMODE(byte x);\r
-void VGAREADMAP(byte x);\r
+void VGAWRITEMODE(byte x),\r
+ VGAMAPMASK(byte x),\r
+ VGAREADMAP(byte x),\r
+ VGABITMASK(byte x);\r
\r
#define VW_Hlin(x,z,y,c,q) VL_Hlin(x,y,(z)-(x)+1,c,q)\r
#define VW_Vlin(y,z,x,c,q) VL_Vlin(x,y,(z)-(y)+1,c,q)\r
\r
/* -============================ Functions =============================- */\r
/* mode switching, page, and plane functions */\r
-void VGAmodeX(sword vq, boolean cmem, global_game_variables_t *gv);\r
-void modexEnter(sword vq, boolean cmem, global_game_variables_t *gv);\r
-byte vgaGetMode();\r
+void VL_Startup (global_game_variables_t *gvar),\r
+ VL_Shutdown (global_game_variables_t *gvar),\r
+ VL_SetVGAPlaneMode (global_game_variables_t *gvar),\r
+ VL_ClearVideo (byte color),\r
+ VL_DePlaneVGA (),\r
+ VGAmodeX(sword vq, boolean cmem, global_game_variables_t *gv),\r
+ modexEnter(sword vq, boolean cmem, global_game_variables_t *gv);\r
+void VL_vgaSetMode(byte mode);\r
+byte VL_vgaGetMode(void);\r
extern void TL_VidInit(global_game_variables_t *gvar);\r
-void modexLeave();\r
+void modexLeave(void);\r
void modexsetBaseXMode();\r
page_t modexDefaultPage(page_t *p);\r
page_t modexNextPage(page_t *p);\r
void modexPalSave(byte *palette);\r
//byte *modexNewPal();\r
void modexLoadPalFile(char *filename, byte *palette);\r
-void VL_LoadPalFile(const char *filename, byte *palette);\r
-void VL_LoadPalFileCore(byte *palette);\r
-void VL_LoadPalFilewithoffset(const char *filename, byte *palette, word o);\r
-void VL_UpdatePaletteWrite(byte *palette, word o);\r
+void VL_LoadPalFile(const char *filename, byte *palette, global_game_variables_t *gvar);\r
+void VL_LoadPalFileCore(byte *palette, global_game_variables_t *gvar);\r
+void VL_LoadPalFilewithoffset(const char *filename, byte *palette, word o, global_game_variables_t *gvar);\r
+void VL_UpdatePaletteWrite(byte *palette, word o, global_game_variables_t *gvar);\r
+void VL_PaletteSync(global_game_variables_t *gvar);\r
void modexSavePalFile(char *filename, byte *palette);\r
#define MenuFadeIn() VL_FadeIn(0,255,&gamepal,10)\r
\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 modexputPixel(page_t *page, int x, int y, byte color);\r
byte modexgetPixel(page_t *page, int x, int y);\r
\r
void modexprintbig(page_t *page, word x, word y, word t, word col, word bgcol, const byte *str);\r
void VL_modexPrintTextBox(global_game_variables_t *gvar);\r
void modexpdump(page_t *pee);\r
-void modexcls(page_t *page, byte color, byte *Where);\r
void VL_PatternDraw(video_t *video, word pn, boolean sw, boolean allsw);\r
void modexWaitBorder();\r
void modexWaitBorder_start();\r
*\r
* This file is part of Project 16.\r
*\r
- * Project 16 is free software; you can redistribute it and/or modify\r
+ * Project 16 is free software; you can redistribute it and/or modify\r
* it under the terms of the GNU General Public License as published by\r
* the Free Software Foundation; either version 3 of the License, or\r
* (at your option) any later version.\r
*\r
- * Project 16 is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- * GNU General Public License for more details.\r
+ * Project 16 is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
*\r
* You should have received a copy of the GNU General Public License\r
* along with this program. If not, see <http://www.gnu.org/licenses/>, or\r
- * write to the Free Software Foundation, Inc., 51 Franklin Street,\r
+ * write to the Free Software Foundation, Inc., 51 Franklin Street,\r
* Fifth Floor, Boston, MA 02110-1301 USA.\r
*\r
*/\r
\r
mov dx,STATUS_REGISTER_1\r
\r
- // wait for a display signal to make sure the raster isn't in the middle\r
+ // wait for a display signal to make sure the raster isn't in the middle\r
// of a sync\r
\r
#ifdef __BORLANDC__\r
__asm {\r
#endif\r
// set CRTC start\r
- // for some reason, my XT's EGA card doesn't like word outs to the CRTC index...\r
+ // for some reason, my XT's EGA card doesn't like word outs to the CRTC index...\r
\r
mov cx,[crtc]\r
mov dx,CRTC_INDEX\r
// set horizontal panning\r
\r
mov dx,ATR_INDEX\r
-// mov al,ATR_PELPAN or 20h\r
+// mov al,ATR_PELPAN or 20h\r
out dx,al\r
jmp SetScreen_done\r
mov al,[BYTE PTR pelpan] //pel pan value\r
=\r
= VL_SetLineWidth\r
=\r
-= Line witdh is in WORDS, 40 words is normal width for vgaplanegr\r
+= Line witdh is in WORDS, 40 words is normal width for vgaplanegr\r
=\r
====================\r
*/\r
\r
offset = 0;\r
\r
- for (i=0;i<MAXSCANLINES;i++)\r
+ for (i=0;i<MAXSCANLINES;i++)\r
{\r
ofs->ylookup[i]=offset;\r
offset += ofs->linewidth;\r
int i;\r
\r
outportb (PAL_WRITE_REG,0);\r
- for (i=0;i<256;i++)\r
+ for (i=0;i<256;i++)\r
{\r
outportb (PAL_DATA_REG,red);\r
outportb (PAL_DATA_REG,green);\r
fastpalette=v->fastpalette;\r
\r
// outportb (PAL_WRITE_REG,0);\r
-// for (i=0;i<768;i++)\r
+// for (i=0;i<768;i++)\r
// outportb(PAL_DATA_REG,*palette++);\r
\r
__asm {\r
test [ss:fastpalette],1\r
jz slowset\r
//\r
-// set palette fast for cards that can take it\r
+// set palette fast for cards that can take it\r
//\r
//mov cx,768\r
//rep outsb\r
//jmp done\r
\r
//\r
-// set palette slowly for some video cards\r
+// set palette slowly for some video cards\r
//\r
#ifdef __BORLANDC__\r
}\r
int i;\r
\r
outportb (PAL_READ_REG,0);\r
- for (i=0;i<768;i++)\r
+ for (i=0;i<768;i++)\r
*palette++ = inportb(PAL_DATA_REG);\r
}\r
\r
=\r
= VL_FadeOut\r
=\r
-= Fades the current palette to the given color in the given number of steps\r
+= Fades the current palette to the given color in the given number of steps\r
=\r
=================\r
*/\r
//\r
// fade through intermediate frames\r
//\r
- for (i=0;i<steps;i++)\r
+ for (i=0;i<steps;i++)\r
{\r
origptr = &v->palette1[start][0];\r
newptr = &v->palette2[start][0];\r
- for (j=start;j<=end;j++)\r
+ for (j=start;j<=end;j++)\r
{\r
orig = *origptr++;\r
delta = red-orig;\r
//\r
// fade through intermediate frames\r
//\r
- for (i=0;i<steps;i++)\r
+ for (i=0;i<steps;i++)\r
{\r
- for (j=start;j<=end;j++)\r
+ for (j=start;j<=end;j++)\r
{\r
delta = palette[j]-v->palette1[0][j];\r
v->palette2[0][j] = v->palette1[0][j] + delta * i / steps;\r
=\r
= VL_TestPaletteSet\r
=\r
-= Sets the palette with outsb, then reads it in and compares\r
+= Sets the palette with outsb, then reads it in and compares\r
= If it compares ok, fastpalette is set to true.\r
=\r
=================\r
{\r
int i;\r
\r
- for (i=0;i<768;i++)\r
+ for (i=0;i<768;i++)\r
v->palette1[0][i] = i;\r
\r
v->fastpalette = true;\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, ofs_t *ofs)\r
{\r
unsigned xbyte;\r
byte far *dest;\r
\r
if (midbytes<0)\r
{\r
- // all in one byte\r
+ // all in one byte\r
VGAMAPMASK(leftmask&rightmask);\r
*dest = color;\r
VGAMAPMASK(15);\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, ofs_t *ofs)\r
{\r
byte far *dest,mask;\r
VCLIPDEF\r
\r
if (midbytes<0)\r
{\r
- // all in one byte\r
+ // all in one byte\r
VGAMAPMASK(leftmask&rightmask);\r
while (height--)\r
{\r
VGAMAPMASK(15);\r
}\r
\r
+//==========================================================================\r
+\r
+/*\r
+=================\r
+=\r
+= VL_MemToScreen\r
+=\r
+= Draws a block of data to the screen.\r
+=\r
+=================\r
+*/\r
+\r
+void VL_MemToScreen (byte far *source, int width, int height, int x, int y, ofs_t *ofs)\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
+ mask = 1 << (x&3);\r
+\r
+ for (plane = 0; plane<4; plane++)\r
+ {\r
+ VGAMAPMASK(mask);\r
+ mask <<= 1;\r
+ if (mask == 16)\r
+ mask = 1;\r
+\r
+ screen = dest;\r
+ for (y=0;y<height;y++,screen+=ofs->linewidth,source+=width)\r
+ _fmemcpy (screen,source,width);\r
+ }\r
+}\r
+\r
+//==========================================================================\r
\r
/*\r
==============\r
\r
VL_WaitVBL ******** NEW *********\r
\r
- Wait for the vertical retrace (returns before the actual vertical sync)\r
+ Wait for the vertical retrace (returns before the actual vertical sync)\r
\r
==============\r
*/\r
\r
mov cx,[num]\r
//\r
- // wait for a display signal to make sure the raster isn't in the middle\r
+ // wait for a display signal to make sure the raster isn't in the middle\r
// of a sync\r
//\r
#ifdef __BORLANDC__\r
}\r
\r
//===========================================================================\r
+#if 0\r
+#define VGAWRITEMODE(x) asm{\r
+ cli\r
+ mov dx,GC_INDEX\r
+ mov al,GC_MODE\r
+ out dx,al\r
+ inc dx\r
+ in al,dx\r
+ and al,252\r
+ or al,x\r
+ out dx,al\r
+ sti\r
+}\r
\r
-void VGAMAPMASK(byte x)\r
-{\r
- __asm {\r
-// cli\r
+#define VGAMAPMASK(x) asm{\r
+ cli\r
mov dx,SC_INDEX\r
mov al,SC_MAPMASK\r
mov ah,x\r
out dx,ax\r
-// sti\r
- }\r
+ sti\r
}\r
\r
+#define VGAREADMAP(x) asm{\r
+ cli\r
+ mov dx,GC_INDEX\r
+ mov al,GC_READMAP\r
+ mov ah,x\r
+ out dx,ax\r
+ sti\r
+}\r
+\r
+#define EGABITMASK(x) asm{\r
+ mov dx,GC_INDEX\r
+ mov ax,GC_BITMASK+256*x\r
+ out dx,ax\r
+ sti\r
+}\r
+#endif\r
void VGAWRITEMODE(byte x)\r
{\r
__asm {\r
-// cli\r
+ cli\r
mov dx,GC_INDEX\r
mov al,GC_MODE\r
out dx,al\r
and al,252\r
or al,x\r
out dx,al\r
-// sti\r
+ sti\r
+ }\r
+}\r
+\r
+void VGAMAPMASK(byte x)\r
+{\r
+ __asm {\r
+ cli\r
+ mov dx,SC_INDEX\r
+ mov al,SC_MAPMASK\r
+ mov ah,x\r
+ out dx,ax\r
+ sti\r
}\r
}\r
\r
void VGAREADMAP(byte x)\r
{\r
__asm {\r
-// cli\r
+ cli\r
mov dx,GC_INDEX\r
mov al,GC_READMAP\r
mov ah,x\r
out dx,ax\r
-// sti\r
+ sti\r
+ }\r
+}\r
+\r
+void VGABITMASK(byte x)\r
+{\r
+ word q = 256*x;\r
+ __asm {\r
+ mov dx,GC_INDEX\r
+ mov ax,GC_BITMASK+q\r
+ out dx,ax\r
+ sti\r
}\r
}\r
\r
\r
#include "src/lib/bakapee.h"\r
\r
+struct glob_game_vars *ggvv;\r
+//static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */\r
+char global_temp_status_text[512];\r
+char global_temp_status_text2[512];\r
+\r
+//==========================================================================\r
+\r
+/*\r
+===================\r
+=\r
+= FizzleFade\r
+=\r
+= returns true if aborted\r
+=\r
+===================\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
+boolean baka_FizzleFade (page_t *source, page_t *dest, unsigned frames, boolean abortable, global_game_variables_t *gvar)\r
+{\r
+ dword p,pixperframe;\r
+ unsigned drawofs,pagedelta;\r
+ byte mask,maskb[8] = {1,2,4,8};\r
+ unsigned x,y,frame ,esorig;\r
+ dword rndval;\r
+// word TimeCount = *clockw;\r
+ word screenseg = SCREENSEG;\r
+\r
+ pagedelta = (word)dest->sw*dest->sh;//(word)(source->data - dest->data);//(dest->data - source->data)\r
+ rndval = 1; esorig = 0;\r
+ x = y = dest->dx;\r
+ pixperframe = 76800/(dword)frames;\r
+\r
+// IN_StartAck ();\r
+\r
+// VL_ShowPage(dest, 1, 0);\r
+// VL_ShowPage(source, 1, 0);\r
+\r
+// modexClearRegion(dest, 0, 0, (dest->width), (dest->height), 12);\r
+ modexClearRegion(source, 0, 0, (source->width), (source->height), 64);\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(dest, 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>dest->sw || y>dest->sh)\r
+ continue;\r
+ drawofs = (word)(source->data)+gvar->video.ofs.ylookup[y] + (x>>2);\r
+sprintf(global_temp_status_text, "draw - %Fp", drawofs);\r
+modexprint(dest, PIXPOSX, 16+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text);\r
+sprintf(global_temp_status_text, "pdet - %Fp", pagedelta);\r
+modexprint(dest, PIXPOSX, 24+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text);\r
+sprintf(global_temp_status_text, "srce - %Fp", source->data);\r
+modexprint(dest, PIXPOSX, 32+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text);\r
+sprintf(global_temp_status_text, "dest - %Fp", dest->data);\r
+modexprint(dest, PIXPOSX, 40+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text);\r
+\r
+ //\r
+ // copy one pixel\r
+ //\r
+ mask = x&3;\r
+ VGAREADMAP(mask);\r
+ mask = maskb[mask];\r
+ VGAMAPMASK(mask);\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
+#if 0\r
+boolean baka_FizzleFade (unsigned source, unsigned dest, unsigned width,unsigned height, unsigned frames, boolean abortable, global_game_variables_t *gvar)\r
+{\r
+ int pixperframe;\r
+ unsigned drawofs,pagedelta;\r
+ byte mask,maskb[8] = {1,2,4,8};\r
+ unsigned x,y,p,frame;\r
+ dword rndval;\r
+ word TimeCount = *clockw;\r
+ word screenseg = SCREENSEG;\r
+\r
+ pagedelta = dest-source;\r
+ rndval = 1;\r
+ x = y = 0;\r
+ pixperframe = 64000/frames;\r
+\r
+ VGAmodeX(0, 0, gvar);\r
+// IN_StartAck ();\r
+// VL_ShowPage((page_t *)dest, 1, 0);\r
+ VGAmodeX(1, 0, gvar);\r
+\r
+ TimeCount=frame=0;\r
+ do // while (1)\r
+ {\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
+noxor:\r
+ mov [WORD PTR rndval],ax\r
+ mov [WORD PTR rndval+2],dx\r
+ }\r
+\r
+ if (x>width || y>height)\r
+ continue;\r
+ drawofs = source+gvar->video.ofs.ylookup[y] + (x>>2);\r
+\r
+ //\r
+ // copy one pixel\r
+ //\r
+ mask = x&3;\r
+ VGAREADMAP(mask);\r
+ mask = maskb[mask];\r
+ VGAMAPMASK(mask);\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
+ return false;\r
+}\r
+#endif\r
/* clrstdin() clear any leftover chars tha may be in stdin stream */\r
void clrstdin()\r
{\r
{\r
//if(pee->coor < 256)\r
//{\r
- modexcls(page, pee->coor, VGA);\r
+// modexcls(page, pee->coor, VGA);\r
+ VL_ClearVideo (pee->coor);\r
pee->coor++;\r
//}else pee->coor = 0;\r
}\r
{\r
if(pee->coor <= pee->hgq)\r
{\r
- modexcls(page, pee->coor, VGA);\r
+// modexcls(page, pee->coor, VGA);\r
+ VL_ClearVideo (pee->coor);\r
pee->coor++;\r
}else pee->coor = pee->lgq;\r
}\r
modexprint(page, page->sw/2, page->sh/2, 1, 0, 47, 0, 1, "bakapi");\r
break;\r
case 9:\r
- if(pee->coor <= pee->hgq)\r
- {\r
- ssd(page, pee, q);\r
- pee->coor++;\r
- }else pee->coor = pee->lgq;\r
+ //baka_FizzleFade (ggvv->video.ofs.bufferofs, ggvv->video.ofs.displayofs, page->sw, page->sh, false, 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
break;\r
case 10:\r
ssd(page, pee, q); /*printf("%d\n", pee->coor);*/\r
word bonk,lgq,hgq;\r
} bakapee_t;\r
\r
+boolean baka_FizzleFade (page_t *source, page_t *dest, unsigned frames, boolean abortable, global_game_variables_t *gvar);\r
void clrstdin();\r
void colortest(page_t *page, bakapee_t *pee);\r
void colorz(page_t *page, bakapee_t *pee);\r
gv->video.page[/*!*/(gv->video.p)].dx,\r
gv->video.page[/*!*/(gv->video.p)].dy,\r
96, 16);\r
- modexprint(&(gv->video.page[/*!*/(gv->video.p)]), x, y, type, 1, col, 1, bgcol, global_temp_status_text);\r
+ modexprint(&(gv->video.page[/*!*/(gv->video.p)]), x, y, type, 1, col, bgcol, 1, global_temp_status_text);\r
//0000printf("dx=%u dy=%u\n", gv->video.page[/*!*/(gv->video.p)].dx, gv->video.page[/*!*/(gv->video.p)].dy);\r
}\r
#endif\r
*\r
*/\r
#include "src/lib/16_vl.h"\r
-void main(int argc, char *argv[]) {\r
+void main(int argc, char *argv[])\r
+{\r
static global_game_variables_t gvar; word i; char bakapee[64] = "data/16.pal";\r
if(argv[1]) strcpy(bakapee, argv[1]);// modexPalSave(&gvar.video.dpal); modexFadeOff(4, &gvar.video.dpal); modexPalBlack();\r
\r
TL_VidInit(&gvar); VGAmodeX(1, 0, &gvar);\r
- VL_LoadPalFile(bakapee, &gvar.video.palette); //modexLoadPalFile(bakapee, &(gvar.video.palette));\r
+ VL_LoadPalFile(bakapee, &gvar.video.palette, &gvar); //modexLoadPalFile(bakapee, &(gvar.video.palette));\r
gvar.video.page[0] = modexDefaultPage(&gvar.video.page[0]);// modexFadeOn(4, &gvar.video.palette);\r
VL_ShowPage(&gvar.video.page[0], 1, 0);\r
modexpdump(&gvar.video.page[0]);\r
modexPalBlack();\r
\r
/* load our palette */\r
- VL_LoadPalFile("data/16.pal", &gvar.video.palette);\r
+ VL_LoadPalFile("data/16.pal", &gvar.video.palette, &gvar);\r
bmp1.offset=(paloffset/3);\r
VL_palette(&bmp1, &gvar.video.palette, &paloffset, 0, 0, &gvar);\r
\r
/*modexLoadPalFile("data/spri/chikyuu.pal", &pal);\r
modexPalUpdate(pal);*/\r
//modexClearRegion(&gvar.video.page[0], 0, 0, gvar.video.page[0].width, gvar.video.page[0].height, 2);\r
- VL_LoadPalFile("data/spri/chikyuu.pal", &gvar.video.palette);\r
+ VL_LoadPalFile("data/spri/chikyuu.pal", &gvar.video.palette, &gvar);\r
for (i = 0; i < 10; i++){\r
enti.spri.delay = 1;\r
\r
modexPalBlack();\r
#endif\r
\r
- VGAmodeX(1/*bakapee*/, 1, &gvar);\r
+ //--VGAmodeX(1/*bakapee*/, 1, &gvar);\r
+ VL_Startup(&gvar);\r
\r
/* load color palette */\r
/*ptmp.offset=(paloffset/3);\r
//printf("1: %d\n", paloffset);\r
map.tiles->data->offset=(paloffset/3);\r
modexPalUpdate(map.tiles->data, &paloffset, 0, 0);*/\r
- VL_LoadPalFile(bakapee1p, &gvar.video.palette);\r
+ VL_LoadPalFile(bakapee1p, &gvar.video.palette, &gvar);\r
//VL_LoadPalFile("data/default.pal", &gvar.video.palette);\r
\r
#ifdef FADE\r
}\r
//read_vrs(&gvar, bakapee1, gvar.player[0].enti.spri->spritesheet);\r
VRS_ReadVRS(bakapee1, &gvar.player[0].enti, &gvar);\r
- VL_LoadPalFile(bakapee1p, &gvar.video.palette);\r
+ VL_LoadPalFile(bakapee1p, &gvar.video.palette, &gvar);\r
}//JK\r
#ifdef FADE\r
if(gvar.in.inst->Keyboard[10]){ modexPalOverscan(rand()%56); modexPalUpdate(gvar.video.dpal); IN_UserInput(1, &gvar); }\r