2000-01-30 07:32:33 +00:00
|
|
|
/*
|
2000-03-24 14:43:43 +00:00
|
|
|
vid_aa.c
|
2000-01-30 07:32:33 +00:00
|
|
|
|
2000-03-24 14:43:43 +00:00
|
|
|
(description)
|
2000-01-30 07:32:33 +00:00
|
|
|
|
2000-03-24 14:43:43 +00:00
|
|
|
Copyright (C) 1996-1997 Id Software, Inc.
|
|
|
|
Copyright (C) 1999-2000 Nelson Rush.
|
|
|
|
Copyright (C) 1999,2000 contributors of the QuakeForge project
|
|
|
|
Please see the file "AUTHORS" for a list of contributors
|
2000-01-30 07:32:33 +00:00
|
|
|
|
2000-03-24 14:43:43 +00:00
|
|
|
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.
|
2000-01-30 07:32:33 +00:00
|
|
|
|
2000-03-24 14:43:43 +00:00
|
|
|
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.
|
2000-01-30 07:32:33 +00:00
|
|
|
|
2000-03-24 14:43:43 +00:00
|
|
|
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:
|
|
|
|
|
|
|
|
Free Software Foundation, Inc.
|
|
|
|
59 Temple Place - Suite 330
|
|
|
|
Boston, MA 02111-1307, USA
|
|
|
|
|
|
|
|
$Id$
|
2000-01-30 07:32:33 +00:00
|
|
|
*/
|
|
|
|
|
2000-03-02 19:57:24 +00:00
|
|
|
#include <quakedef.h>
|
|
|
|
#include <d_local.h>
|
2000-01-30 07:32:33 +00:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <aalib.h>
|
|
|
|
|
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
#include <unistd.h>
|
|
|
|
#endif
|
|
|
|
#if defined(HAVE_SYS_IO_H)
|
|
|
|
# include <sys/io.h>
|
|
|
|
#elif defined(HAVE_ASM_IO_H)
|
|
|
|
# include <asm/io.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static byte *vid_surfcache;
|
|
|
|
static int VID_highhunkmark;
|
|
|
|
|
|
|
|
static int num_modes, current_mode;
|
|
|
|
static vga_modeinfo *modes;
|
|
|
|
|
2000-08-10 12:16:59 +00:00
|
|
|
static byte vid_current_palette[768];
|
2000-01-30 07:32:33 +00:00
|
|
|
|
|
|
|
static int UseDisplay = 1;
|
|
|
|
|
2000-02-27 07:13:32 +00:00
|
|
|
static cvar_t *vid_mode;
|
|
|
|
static cvar_t *vid_redrawfull;
|
|
|
|
static cvar_t *vid_waitforrefresh;
|
2000-03-19 15:59:51 +00:00
|
|
|
|
2000-01-30 07:32:33 +00:00
|
|
|
static char *framebuffer_ptr;
|
|
|
|
|
2000-08-10 12:16:59 +00:00
|
|
|
static byte backingbuf[48*24];
|
2000-01-30 07:32:33 +00:00
|
|
|
|
2000-08-10 12:16:59 +00:00
|
|
|
aa_context *context = NULL;
|
|
|
|
unsigned char *buffer;
|
|
|
|
aa_palette palette;
|
|
|
|
aa_renderparams *params;
|
|
|
|
int aaversion=0;
|
2000-01-30 07:32:33 +00:00
|
|
|
|
2000-08-10 12:16:59 +00:00
|
|
|
void aa_setpage()
|
2000-01-30 07:32:33 +00:00
|
|
|
{
|
2000-08-10 12:16:59 +00:00
|
|
|
int x,y;
|
|
|
|
unsigned char *img = aa_image(context);
|
2000-01-30 07:32:33 +00:00
|
|
|
|
|
|
|
switch(aaversion) {
|
|
|
|
case 11:
|
|
|
|
for (y = 0; y < 200; y++)
|
2000-08-10 12:16:59 +00:00
|
|
|
memcpy(img+y*aa_imgwidth(context),buffer+y*320,320);
|
2000-01-30 07:32:33 +00:00
|
|
|
break;
|
|
|
|
case 12:
|
|
|
|
for (y=0;y<100;y++)
|
2000-08-10 12:16:59 +00:00
|
|
|
memcpy(img+y*aa_imgwidth(context),buffer+y*320*2,320);
|
2000-01-30 07:32:33 +00:00
|
|
|
break;
|
|
|
|
case 13:
|
|
|
|
for (y=0;y<66;y++)
|
2000-08-10 12:16:59 +00:00
|
|
|
memcpy(img+y*aa_imgwidth(context),buffer+y*320*3,320);
|
|
|
|
break;
|
2000-01-30 07:32:33 +00:00
|
|
|
case 14:
|
|
|
|
for (y=0;y<50;y++)
|
2000-08-10 12:16:59 +00:00
|
|
|
memcpy(img+y*aa_imgwidth(context),buffer+y*320*4,320);
|
|
|
|
break;
|
2000-01-30 07:32:33 +00:00
|
|
|
case 21:
|
|
|
|
for (y = 0; y < 200; y++)
|
|
|
|
for (x=0;x<160;x++)
|
2000-08-10 12:16:59 +00:00
|
|
|
img[y*aa_imgwidth(context)+x]=buffer[y*320+x*2];
|
|
|
|
break;
|
2000-01-30 07:32:33 +00:00
|
|
|
case 22:
|
|
|
|
for (y=0;y<100;y++)
|
2000-08-10 12:16:59 +00:00
|
|
|
for (x=0;x<160;x++)
|
|
|
|
img[y*aa_imgwidth(context)+x]=buffer[y*2*320+x*2];
|
|
|
|
break;
|
2000-01-30 07:32:33 +00:00
|
|
|
case 23:
|
|
|
|
for (y=0;y<66;y++)
|
2000-08-10 12:16:59 +00:00
|
|
|
for (x=0;x<160;x++)
|
|
|
|
img[y*aa_imgwidth(context)+x]=buffer[y*3*320+x*2];
|
|
|
|
break;
|
2000-01-30 07:32:33 +00:00
|
|
|
case 24:
|
|
|
|
for (y=0;y<50;y++)
|
2000-08-10 12:16:59 +00:00
|
|
|
for (x=0;x<160;x++)
|
|
|
|
img[y*aa_imgwidth(context)+x]=buffer[y*4*320+x*2];
|
|
|
|
break;
|
2000-01-30 07:32:33 +00:00
|
|
|
default:
|
2000-08-10 12:16:59 +00:00
|
|
|
fprintf(stderr,"version = %i, unknown version!\n",aaversion);
|
2000-01-30 07:32:33 +00:00
|
|
|
exit(-1);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
aa_renderpalette(context, palette, params, 0, 0,
|
|
|
|
aa_scrwidth(context), aa_scrheight(context));
|
|
|
|
aa_flush(context);
|
|
|
|
}
|
|
|
|
|
2000-08-10 12:16:59 +00:00
|
|
|
void D_BeginDirectRect (int x, int y, byte *pbitmap, int width, int height)
|
2000-01-30 07:32:33 +00:00
|
|
|
{
|
2000-08-10 12:16:59 +00:00
|
|
|
int i, j, k, plane, reps, repshift, offset, vidpage, off;
|
2000-01-30 07:32:33 +00:00
|
|
|
|
|
|
|
if (vid.aspect > 1.5) {
|
|
|
|
reps = 2;
|
|
|
|
repshift = 1;
|
|
|
|
} else {
|
|
|
|
reps = 1;
|
|
|
|
repshift = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
vidpage = 0;
|
|
|
|
aa_setpage();
|
|
|
|
|
2000-08-10 12:16:59 +00:00
|
|
|
for (i=0 ; i<(height << repshift) ; i += reps) {
|
|
|
|
for (j=0 ; j<reps ; j++) {
|
|
|
|
offset = x + ((y << repshift) + i + j)
|
2000-01-30 07:32:33 +00:00
|
|
|
* vid.rowbytes;
|
2000-08-10 12:16:59 +00:00
|
|
|
off = offset % 0x10000;
|
|
|
|
if ((offset / 0x10000) != vidpage) {
|
|
|
|
vidpage=offset / 0x10000;
|
|
|
|
aa_setpage();
|
2000-01-30 07:32:33 +00:00
|
|
|
}
|
2000-08-10 12:16:59 +00:00
|
|
|
memcpy (&backingbuf[(i + j) * 24],
|
|
|
|
vid.direct + off, width);
|
|
|
|
memcpy (vid.direct + off,
|
|
|
|
&pbitmap[(i >> repshift)*width],
|
|
|
|
width);
|
2000-01-30 07:32:33 +00:00
|
|
|
}
|
2000-08-10 12:16:59 +00:00
|
|
|
}
|
2000-01-30 07:32:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-08-10 12:16:59 +00:00
|
|
|
void D_EndDirectRect (int x, int y, int width, int height)
|
2000-01-30 07:32:33 +00:00
|
|
|
{
|
2000-08-10 12:16:59 +00:00
|
|
|
int i, j, k, plane, reps, repshift, offset, vidpage, off;
|
2000-01-30 07:32:33 +00:00
|
|
|
|
|
|
|
if (vid.aspect > 1.5) {
|
|
|
|
reps = 2;
|
|
|
|
repshift = 1;
|
|
|
|
} else {
|
|
|
|
reps = 1;
|
|
|
|
repshift = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
vidpage = 0;
|
|
|
|
aa_setpage();
|
|
|
|
|
2000-08-10 12:16:59 +00:00
|
|
|
for (i=0 ; i<(height << repshift) ; i += reps) {
|
|
|
|
for (j=0 ; j<reps ; j++) {
|
|
|
|
offset = x + ((y << repshift) + i + j)
|
2000-01-30 07:32:33 +00:00
|
|
|
* vid.rowbytes;
|
2000-08-10 12:16:59 +00:00
|
|
|
off = offset % 0x10000;
|
|
|
|
if ((offset / 0x10000) != vidpage) {
|
|
|
|
vidpage=offset / 0x10000;
|
|
|
|
aa_setpage();
|
2000-01-30 07:32:33 +00:00
|
|
|
}
|
2000-08-10 12:16:59 +00:00
|
|
|
memcpy (vid.direct + off,
|
|
|
|
&backingbuf[(i +j)*24], width);
|
2000-01-30 07:32:33 +00:00
|
|
|
}
|
2000-08-10 12:16:59 +00:00
|
|
|
}
|
2000-01-30 07:32:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#if 0
|
2000-08-10 12:16:59 +00:00
|
|
|
static void VID_Gamma_f(void)
|
2000-01-30 07:32:33 +00:00
|
|
|
{
|
2000-08-10 12:16:59 +00:00
|
|
|
float gamma, f, inf;
|
2000-01-30 07:32:33 +00:00
|
|
|
unsigned char palette[768];
|
|
|
|
int i;
|
|
|
|
|
|
|
|
if (Cmd_Argc () == 2) {
|
|
|
|
gamma = Q_atof (Cmd_Argv(1));
|
|
|
|
|
|
|
|
for (i=0 ; i<768 ; i++) {
|
|
|
|
f = pow ( (host_basepal[i]+1)/256.0 , gamma );
|
|
|
|
inf = f*255 + 0.5;
|
|
|
|
if (inf < 0) inf = 0;
|
|
|
|
if (inf > 255) inf = 255;
|
|
|
|
palette[i] = inf;
|
|
|
|
}
|
|
|
|
|
|
|
|
VID_SetPalette (palette);
|
|
|
|
|
|
|
|
/* Force a surface cache flush */
|
|
|
|
vid.recalc_refdef = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2000-08-10 12:16:59 +00:00
|
|
|
static void VID_DescribeMode_f(void)
|
2000-01-30 07:32:33 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-08-10 12:16:59 +00:00
|
|
|
static void VID_DescribeModes_f(void)
|
2000-01-30 07:32:33 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
================
|
|
|
|
VID_NumModes
|
|
|
|
================
|
|
|
|
*/
|
2000-08-10 12:16:59 +00:00
|
|
|
static int VID_NumModes(void)
|
|
|
|
{
|
|
|
|
return 1;
|
2000-01-30 07:32:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-08-10 12:16:59 +00:00
|
|
|
static void VID_NumModes_f(void)
|
2000-01-30 07:32:33 +00:00
|
|
|
{
|
2000-08-10 12:16:59 +00:00
|
|
|
Con_Printf("%i modes\n", VID_NumModes());
|
2000-01-30 07:32:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-08-10 12:16:59 +00:00
|
|
|
static void VID_Debug_f (void)
|
2000-01-30 07:32:33 +00:00
|
|
|
{
|
2000-08-10 12:16:59 +00:00
|
|
|
/* Con_Printf("mode: %i\n",current_mode);
|
|
|
|
Con_Printf("height x width: %i x %i\n",vid.height,vid.width);
|
|
|
|
Con_Printf("bpp: %i\n",modes[current_mode].bytesperpixel*8);
|
2000-01-30 07:32:33 +00:00
|
|
|
Con_Printf("vid.aspect: %f\n",vid.aspect);
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-08-10 12:16:59 +00:00
|
|
|
void VID_Shutdown(void)
|
2000-01-30 07:32:33 +00:00
|
|
|
{
|
|
|
|
aa_close(context);
|
|
|
|
free(buffer);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-08-10 12:16:59 +00:00
|
|
|
void VID_ShiftPalette(unsigned char *p)
|
2000-01-30 07:32:33 +00:00
|
|
|
{
|
|
|
|
VID_SetPalette(p);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-08-10 12:16:59 +00:00
|
|
|
void VID_SetPalette(byte *palette)
|
2000-01-30 07:32:33 +00:00
|
|
|
{
|
2000-08-10 12:16:59 +00:00
|
|
|
static int tmppal[256*3];
|
|
|
|
int *tp;
|
|
|
|
int i;
|
2000-01-30 07:32:33 +00:00
|
|
|
|
|
|
|
memcpy(vid_current_palette, palette, sizeof(vid_current_palette));
|
|
|
|
|
|
|
|
tp = tmppal;
|
|
|
|
for (i=256*3 ; i ; i--) {
|
|
|
|
*(tp++) = *(palette++) >> 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (UseDisplay) {
|
|
|
|
vga_setpalvec(0, 256, tmppal);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-08-10 12:16:59 +00:00
|
|
|
int VID_SetMode(int modenum, unsigned char *palette)
|
2000-01-30 07:32:33 +00:00
|
|
|
{
|
2000-08-10 12:16:59 +00:00
|
|
|
int bsize, zsize, tsize;
|
|
|
|
int err;
|
2000-01-30 07:32:33 +00:00
|
|
|
|
|
|
|
vid.aspect = ((float)vid.height / (float)vid.width) * (320.0 / 240.0);
|
|
|
|
vid.colormap = (pixel_t *) host_colormap;
|
|
|
|
vid.fullbright = 256 - LittleLong (*((int *)vid.colormap + 2048));
|
|
|
|
vid.conrowbytes = vid.rowbytes;
|
|
|
|
vid.conwidth = vid.width;
|
|
|
|
vid.conheight = vid.height;
|
|
|
|
vid.numpages = 1;
|
2000-03-19 15:59:51 +00:00
|
|
|
|
2000-01-30 07:32:33 +00:00
|
|
|
vid.maxwarpwidth = WARP_WIDTH;
|
|
|
|
vid.maxwarpheight = WARP_HEIGHT;
|
|
|
|
|
|
|
|
/* alloc zbuffer and surface cache */
|
|
|
|
if (d_pzbuffer) {
|
|
|
|
D_FlushCaches();
|
|
|
|
Hunk_FreeToHighMark (VID_highhunkmark);
|
|
|
|
d_pzbuffer = NULL;
|
|
|
|
vid_surfcache = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
bsize = vid.rowbytes * vid.height;
|
|
|
|
tsize = D_SurfaceCacheForRes (vid.width, vid.height);
|
|
|
|
zsize = vid.width * vid.height * sizeof(*d_pzbuffer);
|
|
|
|
|
|
|
|
VID_highhunkmark = Hunk_HighMark ();
|
|
|
|
|
|
|
|
d_pzbuffer = Hunk_HighAllocName (bsize+tsize+zsize, "video");
|
|
|
|
|
|
|
|
vid_surfcache = ((byte *)d_pzbuffer) + zsize;
|
|
|
|
|
|
|
|
vid.conbuffer = vid.buffer = (pixel_t *)(((byte *)d_pzbuffer) + zsize + tsize);
|
|
|
|
|
|
|
|
D_InitCaches (vid_surfcache, tsize);
|
|
|
|
|
|
|
|
if (!context)
|
|
|
|
if (context = aa_autoinit(&aa_defparams)) {
|
|
|
|
if (buffer = malloc(64000)) {
|
|
|
|
params = aa_getrenderparams();
|
|
|
|
params->bright = 100;
|
|
|
|
params->contrast = 100;
|
|
|
|
memset(aa_image(context), 0,
|
|
|
|
aa_imgwidth(context) * aa_imgheight(context));
|
2000-08-10 12:16:59 +00:00
|
|
|
fprintf(stderr,"%i,%i\n",
|
2000-01-30 07:32:33 +00:00
|
|
|
aa_imgwidth(context),
|
|
|
|
aa_imgheight(context));
|
|
|
|
if (aa_imgwidth(context)>=320)
|
|
|
|
aaversion=10;
|
|
|
|
else
|
|
|
|
aaversion=20;
|
|
|
|
if (aa_imgheight(context)>=200)
|
|
|
|
aaversion+=1;
|
|
|
|
else if (aa_imgheight(context)>=100)
|
|
|
|
aaversion+=2;
|
|
|
|
else if (aa_imgheight(context)>=66)
|
|
|
|
aaversion+=3;
|
|
|
|
else
|
|
|
|
aaversion+=4
|
|
|
|
} else
|
|
|
|
exit((perror("malloc"),-1));
|
|
|
|
} else {
|
|
|
|
fprintf(stderr, "set video failed!\n", x);
|
|
|
|
exit(-1);
|
2000-08-10 12:16:59 +00:00
|
|
|
}
|
2000-01-30 07:32:33 +00:00
|
|
|
|
|
|
|
VID_SetPalette(palette);
|
|
|
|
|
|
|
|
aa_setpage();
|
|
|
|
|
|
|
|
/* Force a surface cache flush */
|
|
|
|
vid.recalc_refdef = 1;
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-08-10 12:16:59 +00:00
|
|
|
void VID_Init(unsigned char *palette)
|
2000-01-30 07:32:33 +00:00
|
|
|
{
|
2000-08-10 12:16:59 +00:00
|
|
|
int w, h, d;
|
|
|
|
int err;
|
2000-01-30 07:32:33 +00:00
|
|
|
|
|
|
|
#if 0
|
|
|
|
Cmd_AddCommand ("gamma", VID_Gamma_f);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (UseDisplay) {
|
2000-02-28 01:52:08 +00:00
|
|
|
vid_mode = Cvar_Get ("vid_mode","5",0,"None");
|
|
|
|
vid_redrawfull = Cvar_Get ("vid_redrawfull","0",0,"None");
|
2000-02-27 07:13:32 +00:00
|
|
|
vid_waitforrefresh = Cvar_Get ("vid_waitforrefresh","0",
|
2000-02-28 01:52:08 +00:00
|
|
|
CVAR_ARCHIVE,"None");
|
2000-03-19 15:59:51 +00:00
|
|
|
|
2000-01-30 07:32:33 +00:00
|
|
|
Cmd_AddCommand("vid_nummodes", VID_NumModes_f);
|
|
|
|
Cmd_AddCommand("vid_describemode", VID_DescribeMode_f);
|
|
|
|
Cmd_AddCommand("vid_describemodes", VID_DescribeModes_f);
|
|
|
|
Cmd_AddCommand("vid_debug", VID_Debug_f);
|
|
|
|
|
|
|
|
/* Interpret command-line params */
|
|
|
|
w = h = d = 0;
|
|
|
|
if (getenv("GSVGAMODE")) {
|
|
|
|
current_mode = get_mode(getenv("AAMODE"), w, h, d);
|
|
|
|
} else if (COM_CheckParm("-mode")) {
|
|
|
|
current_mode = get_mode(com_argv[COM_CheckParm("-mode")+1], w, h, d);
|
|
|
|
} else if (COM_CheckParm("-w") || COM_CheckParm("-h")
|
|
|
|
|| COM_CheckParm("-d")) {
|
|
|
|
if (COM_CheckParm("-w")) {
|
|
|
|
w = Q_atoi(com_argv[COM_CheckParm("-w")+1]);
|
|
|
|
}
|
|
|
|
if (COM_CheckParm("-h")) {
|
|
|
|
h = Q_atoi(com_argv[COM_CheckParm("-h")+1]);
|
|
|
|
}
|
|
|
|
if (COM_CheckParm("-d")) {
|
|
|
|
d = Q_atoi(com_argv[COM_CheckParm("-d")+1]);
|
|
|
|
}
|
|
|
|
current_mode = get_mode(0, w, h, d);
|
|
|
|
} else {
|
|
|
|
current_mode = 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Set vid parameters */
|
|
|
|
VID_SetMode(current_mode, palette);
|
|
|
|
|
|
|
|
VID_SetPalette(palette);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-08-10 12:16:59 +00:00
|
|
|
void VID_Update(vrect_t *rects)
|
2000-01-30 07:32:33 +00:00
|
|
|
{
|
2000-08-10 12:16:59 +00:00
|
|
|
int ycount;
|
|
|
|
int offset;
|
|
|
|
int vidpage=0;
|
|
|
|
|
|
|
|
vga_setpage();
|
|
|
|
|
|
|
|
while (rects) {
|
|
|
|
ycount = rects->height;
|
|
|
|
offset = rects->y * vid.rowbytes + rects->x;
|
|
|
|
while (ycount--) {
|
|
|
|
register int i = offset % 0x10000;
|
|
|
|
|
|
|
|
if ((offset / 0x10000) != vidpage) {
|
|
|
|
vidpage=offset / 0x10000;
|
|
|
|
aa_setpage();
|
2000-01-30 07:32:33 +00:00
|
|
|
}
|
2000-08-10 12:16:59 +00:00
|
|
|
if (rects->width + i > 0x10000) {
|
|
|
|
memcpy(framebuffer_ptr + i,
|
|
|
|
vid.buffer + offset,
|
|
|
|
0x10000 - i);
|
|
|
|
aa_setpage();
|
|
|
|
memcpy(framebuffer_ptr,
|
|
|
|
vid.buffer + offset + 0x10000 - i,
|
|
|
|
rects->width - 0x10000 + i);
|
|
|
|
} else {
|
|
|
|
memcpy(framebuffer_ptr + i,
|
|
|
|
vid.buffer + offset,
|
|
|
|
rects->width);
|
|
|
|
}
|
|
|
|
offset += vid.rowbytes;
|
2000-01-30 07:32:33 +00:00
|
|
|
}
|
2000-08-10 12:16:59 +00:00
|
|
|
rects = rects->pnext;
|
2000-01-30 07:32:33 +00:00
|
|
|
}
|
2000-03-19 15:59:51 +00:00
|
|
|
|
2000-02-27 07:13:32 +00:00
|
|
|
if (vid_mode->value != current_mode) {
|
|
|
|
VID_SetMode ((int)vid_mode->value, vid_current_palette);
|
2000-01-30 07:32:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-08-10 12:16:59 +00:00
|
|
|
static int dither = 0;
|
2000-01-30 07:32:33 +00:00
|
|
|
|
2000-08-10 12:16:59 +00:00
|
|
|
void VID_DitherOn(void)
|
2000-01-30 07:32:33 +00:00
|
|
|
{
|
|
|
|
if (dither == 0) {
|
|
|
|
#if 0
|
|
|
|
R_ViewChanged (&vrect, sb_lines, vid.aspect);
|
|
|
|
#endif
|
|
|
|
dither = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-08-10 12:16:59 +00:00
|
|
|
void VID_DitherOff(void)
|
2000-01-30 07:32:33 +00:00
|
|
|
{
|
|
|
|
if (dither) {
|
|
|
|
#if 0
|
|
|
|
R_ViewChanged (&vrect, sb_lines, vid.aspect);
|
|
|
|
#endif
|
|
|
|
dither = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
================
|
|
|
|
VID_ModeInfo
|
|
|
|
================
|
|
|
|
*/
|
2000-08-10 12:16:59 +00:00
|
|
|
char *VID_ModeInfo (int modenum)
|
2000-01-30 07:32:33 +00:00
|
|
|
{
|
2000-08-10 12:16:59 +00:00
|
|
|
/* static char *badmodestr = "Bad mode number";
|
|
|
|
static char modestr[40];
|
2000-01-30 07:32:33 +00:00
|
|
|
|
|
|
|
if (modenum == 0) {
|
2000-08-10 12:16:59 +00:00
|
|
|
snprintf(modestr, sizeof(modestr), "%i x %i, %i bpp",
|
2000-01-30 07:32:33 +00:00
|
|
|
vid.width, vid.height, modes[current_mode].bytesperpixel*8);
|
|
|
|
return (modestr);
|
|
|
|
} else {
|
|
|
|
return (badmodestr);
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
|
2000-08-10 12:16:59 +00:00
|
|
|
int VID_ExtraOptionDraw(unsigned int options_draw_cursor)
|
2000-01-30 07:32:33 +00:00
|
|
|
{
|
2000-08-10 12:16:59 +00:00
|
|
|
int drawn;
|
2000-01-30 07:32:33 +00:00
|
|
|
|
2000-08-10 12:16:59 +00:00
|
|
|
drawn = 0;
|
2000-01-30 07:32:33 +00:00
|
|
|
|
2000-08-10 12:16:59 +00:00
|
|
|
/* Port specific Options menu entries */
|
|
|
|
#if 0
|
|
|
|
M_Print (16, options_draw_cursor+=8, " Dummy");
|
|
|
|
M_DrawCheckbox (220, options_draw_cursor, dummy->value);
|
|
|
|
drawn++;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return drawn; // return number of drawn menu entries
|
|
|
|
}
|
|
|
|
|
|
|
|
void VID_ExtraOptionCmd(int option_cursor, int dir)
|
2000-01-30 07:32:33 +00:00
|
|
|
{
|
2000-08-10 12:16:59 +00:00
|
|
|
/* dir: -1 = LEFT, 0 = ENTER, 1 = RIGHT */
|
2000-01-30 07:32:33 +00:00
|
|
|
#if 0
|
2000-08-10 12:16:59 +00:00
|
|
|
switch(option_cursor) {
|
|
|
|
case 0: // Always start with 0
|
|
|
|
dummy->value = !dummy->value;
|
2000-01-30 07:32:33 +00:00
|
|
|
break;
|
2000-08-10 12:16:59 +00:00
|
|
|
}
|
2000-01-30 07:32:33 +00:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2000-02-28 19:13:16 +00:00
|
|
|
void VID_InitCvars ()
|
|
|
|
{
|
2000-08-10 12:16:59 +00:00
|
|
|
// It may not look like it, but this is important
|
2000-02-28 19:13:16 +00:00
|
|
|
}
|
2000-03-31 23:58:53 +00:00
|
|
|
|
2000-08-10 12:16:59 +00:00
|
|
|
void VID_LockBuffer ( void )
|
|
|
|
{
|
|
|
|
}
|
2000-03-31 23:58:53 +00:00
|
|
|
|
2000-08-10 12:16:59 +00:00
|
|
|
void VID_UnlockBuffer ( void )
|
|
|
|
{
|
|
|
|
}
|