/* Copyright (C) 1998 BJ Eirich (aka vecna) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public Lic See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include "mode13h.h" // SetMode() #include "modex.h" #include "vdriver.h" // ================================= Data ==================================== #define SEQU_ADDR 0x3c4 #define CRTC_ADDR 0x3d4 #define MISC_OUTPUT 0x3c2 char *screen1, *screen2; // page banks; char *screenx, curscr; // ptr to active page | page flip ctr char *screenbase; // ptr to A000:0000 extern unsigned char* translucency_table; //zero extern void CheckTimerStuff(); extern void *valloc(int amount,char*,int); extern int vfree(void *); // ================================= Code ==================================== static void plane(char p) { int hi=1<>2); while (d>2); } s+=tsx; d+=(sx>>2); } return 0; } int ModeXCopySprite(int x, int y, int width, int height, char *src) { char *d; d=screen+(y*tsx)+x; for (; height; height--) { memcpy(d,src,width); src+=width; d+=tsx; } return 0; } int ModeXCCopySprite(int x,int y,int width,int height,char *src) { int cx1,cy1,cx2,cy2; char *s,*d; int xl,yl,xs,ys; xl=width; yl=height; xs=ys=0; cx1=0; cy1=0; cx2=tsx-1; cy2=tsy-1; if (x>cx2 || y>cy2 || x+xl cx2) xl=cx2-x+1; if (y+yl > cy2) yl=cy2-y+1; if (xcx2 || y>cy2 || x+xl cx2) xl=cx2-x+1; if (y+yl > cy2) yl=cy2-y+1; if (xcx2 || y>cy2 || x cy2) length=cy2-y+1; if (ycx2 || y>cy2 || x+width cx2) width=cx2-x+1; if (x336 || y<0 || y>256) return 0; d=screen+(y*tsx)+x; for (y=0; y<8; y++) { d[0]=c; d[2]=c; d[4]=c; d[6]=c; d[8]=c; d[10]=c; d[12]=c; d[14]=c; d+=(tsx+1); d[0]=c; d[2]=c; d[4]=c; d[6]=c; d[8]=c; d[10]=c; d[12]=c; d[14]=c; d+=(tsx-1); } return 0; } int ModeXClearScreen() { memset(screen,0,90117); return 0; } int ModeXCopySpriteLucentClip(int x, int y, int width, int height, unsigned char *src) { int cx1,cy1,cx2,cy2; unsigned char *s,*d,c; int xl,yl,xs,ys; cx1=0; cy1=0; cx2=tsx-1; cy2=tsy-1; xl=width; yl=height; xs=ys=0; if (x>cx2 || y>cy2 || x+xl cx2) xl=cx2-x+1; if (y+yl > cy2) yl=cy2-y+1; if (x