Not used anymore
This commit is contained in:
parent
a6b023edc3
commit
c1c5292812
3 changed files with 0 additions and 736 deletions
599
vgamodes.h
599
vgamodes.h
|
@ -1,599 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
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 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.
|
||||
|
||||
*/
|
||||
//
|
||||
// vgamodes.h: VGA mode set tables
|
||||
//
|
||||
|
||||
#include "vregset.h"
|
||||
|
||||
int VGA_InitMode (viddef_t *vid, vmode_t *pcurrentmode);
|
||||
void VGA_SwapBuffers (viddef_t *vid, vmode_t *pcurrentmode, vrect_t *rects);
|
||||
void VGA_SetPalette (viddef_t *vid, vmode_t *pcurrentmode,
|
||||
unsigned char *pal);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// the following base mode descriptors plus extra data together provide all
|
||||
// the data needed to do VGA mode sets
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef struct {
|
||||
int vidbuffer;
|
||||
int *pregset;
|
||||
} vextra_t;
|
||||
|
||||
int vrsnull[] = {
|
||||
VRS_END,
|
||||
};
|
||||
|
||||
int vrs320x200x256planar[] = {
|
||||
//
|
||||
// switch to linear, non-chain4 mode
|
||||
//
|
||||
VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
|
||||
VRS_BYTE_OUT, SC_DATA, 1,
|
||||
|
||||
VRS_BYTE_OUT, SC_INDEX, MEMORY_MODE,
|
||||
VRS_BYTE_RMW, SC_DATA, ~0x08, 0x04,
|
||||
VRS_BYTE_OUT, GC_INDEX, GRAPHICS_MODE,
|
||||
VRS_BYTE_RMW, GC_DATA, ~0x13, 0x00,
|
||||
VRS_BYTE_OUT, GC_INDEX, MISCELLANOUS,
|
||||
VRS_BYTE_RMW, GC_DATA, ~0x02, 0x00,
|
||||
|
||||
VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
|
||||
VRS_BYTE_OUT, SC_DATA, 3,
|
||||
|
||||
//
|
||||
// change the CRTC from doubleword to byte mode
|
||||
//
|
||||
VRS_BYTE_OUT, CRTC_INDEX, UNDERLINE,
|
||||
VRS_BYTE_RMW, CRTC_DATA, ~0x40, 0x00,
|
||||
VRS_BYTE_OUT, CRTC_INDEX, MODE_CONTROL,
|
||||
VRS_BYTE_RMW, CRTC_DATA, ~0x00, 0x40,
|
||||
|
||||
VRS_END,
|
||||
};
|
||||
|
||||
int vrs360x200x256planar[] = {
|
||||
//
|
||||
// switch to linear, non-chain4 mode
|
||||
//
|
||||
VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
|
||||
VRS_BYTE_OUT, SC_DATA, 1,
|
||||
|
||||
VRS_WORD_OUT, SC_INDEX, 0x0604,
|
||||
VRS_BYTE_OUT, MISC_OUTPUT, 0x67,
|
||||
|
||||
VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
|
||||
VRS_BYTE_OUT, SC_DATA, 3,
|
||||
|
||||
//
|
||||
// unprotect CRTC0 through CRTC0
|
||||
//
|
||||
VRS_BYTE_OUT, CRTC_INDEX, 0x11,
|
||||
VRS_BYTE_RMW, CRTC_DATA, ~0x80, 0x00,
|
||||
|
||||
//
|
||||
// change the CRTC from doubleword to byte mode
|
||||
//
|
||||
VRS_BYTE_OUT, CRTC_INDEX, UNDERLINE,
|
||||
VRS_BYTE_RMW, CRTC_DATA, ~0x40, 0x00,
|
||||
VRS_BYTE_OUT, CRTC_INDEX, MODE_CONTROL,
|
||||
VRS_BYTE_RMW, CRTC_DATA, ~0x00, 0x40,
|
||||
|
||||
//
|
||||
// set up the CRT Controller
|
||||
//
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x6B00,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x5901,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x5A02,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x8E03,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x5E04,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x8A05,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x3013,
|
||||
|
||||
VRS_END,
|
||||
};
|
||||
|
||||
int vrs320x240x256planar[] = {
|
||||
//
|
||||
// switch to linear, non-chain4 mode
|
||||
//
|
||||
VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
|
||||
VRS_BYTE_OUT, SC_DATA, 1,
|
||||
|
||||
VRS_BYTE_OUT, SC_INDEX, MEMORY_MODE,
|
||||
VRS_BYTE_RMW, SC_DATA, ~0x08, 0x04,
|
||||
VRS_BYTE_OUT, GC_INDEX, GRAPHICS_MODE,
|
||||
VRS_BYTE_RMW, GC_DATA, ~0x13, 0x00,
|
||||
VRS_BYTE_OUT, GC_INDEX, MISCELLANOUS,
|
||||
VRS_BYTE_RMW, GC_DATA, ~0x02, 0x00,
|
||||
|
||||
VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
|
||||
VRS_BYTE_OUT, SC_DATA, 3,
|
||||
|
||||
//
|
||||
// unprotect CRTC0 through CRTC0
|
||||
//
|
||||
VRS_BYTE_OUT, CRTC_INDEX, 0x11,
|
||||
VRS_BYTE_RMW, CRTC_DATA, ~0x80, 0x00,
|
||||
|
||||
//
|
||||
// set up the CRT Controller
|
||||
//
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x0D06,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x3E07,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x4109,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0xEA10,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0xAC11,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0xDF12,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x0014,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0xE715,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x0616,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0xE317,
|
||||
|
||||
VRS_END,
|
||||
};
|
||||
|
||||
int vrs360x240x256planar[] = {
|
||||
//
|
||||
// switch to linear, non-chain4 mode
|
||||
//
|
||||
VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
|
||||
VRS_BYTE_OUT, SC_DATA, 1,
|
||||
|
||||
VRS_WORD_OUT, SC_INDEX, 0x0604,
|
||||
VRS_BYTE_OUT, MISC_OUTPUT, 0xE7,
|
||||
|
||||
VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
|
||||
VRS_BYTE_OUT, SC_DATA, 3,
|
||||
|
||||
//
|
||||
// unprotect CRTC0 through CRTC0
|
||||
//
|
||||
VRS_BYTE_OUT, CRTC_INDEX, 0x11,
|
||||
VRS_BYTE_RMW, CRTC_DATA, ~0x80, 0x00,
|
||||
|
||||
//
|
||||
// set up the CRT Controller
|
||||
//
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x6B00,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x5901,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x5A02,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x8E03,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x5E04,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x8A05,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x0D06,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x3E07,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x4109,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0xEA10,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0xAC11,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0xDF12,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x3013,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x0014,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0xE715,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x0616,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0xE317,
|
||||
|
||||
VRS_END,
|
||||
};
|
||||
|
||||
int vrs320x350x256planar[] = {
|
||||
//
|
||||
// switch to linear, non-chain4 mode
|
||||
//
|
||||
VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
|
||||
VRS_BYTE_OUT, SC_DATA, 1,
|
||||
|
||||
VRS_BYTE_OUT, SC_INDEX, MEMORY_MODE,
|
||||
VRS_BYTE_RMW, SC_DATA, ~0x08, 0x04,
|
||||
VRS_BYTE_OUT, GC_INDEX, GRAPHICS_MODE,
|
||||
VRS_BYTE_RMW, GC_DATA, ~0x10, 0x00,
|
||||
VRS_BYTE_OUT, GC_INDEX, MISCELLANOUS,
|
||||
VRS_BYTE_RMW, GC_DATA, ~0x02, 0x00,
|
||||
VRS_BYTE_OUT, MISC_OUTPUT, 0xA3, // 350-scan-line scan rate
|
||||
|
||||
VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
|
||||
VRS_BYTE_OUT, SC_DATA, 3,
|
||||
|
||||
//
|
||||
// unprotect CRTC0 through CRTC0
|
||||
//
|
||||
VRS_BYTE_OUT, CRTC_INDEX, 0x11,
|
||||
VRS_BYTE_RMW, CRTC_DATA, ~0x80, 0x00,
|
||||
|
||||
//
|
||||
// stop scanning each line twice
|
||||
//
|
||||
VRS_BYTE_OUT, CRTC_INDEX, MAX_SCAN_LINE,
|
||||
VRS_BYTE_RMW, CRTC_DATA, ~0x1F, 0x00,
|
||||
|
||||
//
|
||||
// change the CRTC from doubleword to byte mode
|
||||
//
|
||||
VRS_BYTE_OUT, CRTC_INDEX, UNDERLINE,
|
||||
VRS_BYTE_RMW, CRTC_DATA, ~0x40, 0x00,
|
||||
VRS_BYTE_OUT, CRTC_INDEX, MODE_CONTROL,
|
||||
VRS_BYTE_RMW, CRTC_DATA, ~0x00, 0x40,
|
||||
|
||||
//
|
||||
// set the vertical counts for 350-scan-line mode
|
||||
//
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0xBF06,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x1F07,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x8310,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x8511,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x5D12,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x6315,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0xBA16,
|
||||
|
||||
VRS_END,
|
||||
};
|
||||
|
||||
int vrs360x350x256planar[] = {
|
||||
//
|
||||
// switch to linear, non-chain4 mode
|
||||
//
|
||||
VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
|
||||
VRS_BYTE_OUT, SC_DATA, 1,
|
||||
|
||||
VRS_WORD_OUT, SC_INDEX, 0x0604,
|
||||
VRS_BYTE_OUT, MISC_OUTPUT, 0xA7, // 350-scan-line scan rate
|
||||
|
||||
VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
|
||||
VRS_BYTE_OUT, SC_DATA, 3,
|
||||
|
||||
//
|
||||
// unprotect CRTC0 through CRTC0
|
||||
//
|
||||
VRS_BYTE_OUT, CRTC_INDEX, 0x11,
|
||||
VRS_BYTE_RMW, CRTC_DATA, ~0x80, 0x00,
|
||||
|
||||
//
|
||||
// stop scanning each line twice
|
||||
//
|
||||
VRS_BYTE_OUT, CRTC_INDEX, MAX_SCAN_LINE,
|
||||
VRS_BYTE_RMW, CRTC_DATA, ~0x1F, 0x00,
|
||||
|
||||
//
|
||||
// change the CRTC from doubleword to byte mode
|
||||
//
|
||||
VRS_BYTE_OUT, CRTC_INDEX, UNDERLINE,
|
||||
VRS_BYTE_RMW, CRTC_DATA, ~0x40, 0x00,
|
||||
VRS_BYTE_OUT, CRTC_INDEX, MODE_CONTROL,
|
||||
VRS_BYTE_RMW, CRTC_DATA, ~0x00, 0x40,
|
||||
|
||||
//
|
||||
// set the vertical counts for 350-scan-line mode and 360 pixels across
|
||||
//
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x6B00,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x5901,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x5A02,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x8E03,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x5E04,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x8A05,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0xBF06,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x1F07,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x8310,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x8511,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x5D12,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x3013,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x6315,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0xBA16,
|
||||
|
||||
VRS_END,
|
||||
};
|
||||
|
||||
int vrs320x400x256planar[] = {
|
||||
//
|
||||
// switch to linear, non-chain4 mode
|
||||
//
|
||||
VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
|
||||
VRS_BYTE_OUT, SC_DATA, 1,
|
||||
|
||||
|
||||
VRS_BYTE_OUT, SC_INDEX, MEMORY_MODE,
|
||||
VRS_BYTE_RMW, SC_DATA, ~0x08, 0x04,
|
||||
VRS_BYTE_OUT, GC_INDEX, GRAPHICS_MODE,
|
||||
VRS_BYTE_RMW, GC_DATA, ~0x10, 0x00,
|
||||
VRS_BYTE_OUT, GC_INDEX, MISCELLANOUS,
|
||||
VRS_BYTE_RMW, GC_DATA, ~0x02, 0x00,
|
||||
|
||||
VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
|
||||
VRS_BYTE_OUT, SC_DATA, 3,
|
||||
|
||||
//
|
||||
// stop scanning each line twice
|
||||
//
|
||||
VRS_BYTE_OUT, CRTC_INDEX, MAX_SCAN_LINE,
|
||||
VRS_BYTE_RMW, CRTC_DATA, ~0x1F, 0x00,
|
||||
|
||||
//
|
||||
// change the CRTC from doubleword to byte mode
|
||||
//
|
||||
VRS_BYTE_OUT, CRTC_INDEX, UNDERLINE,
|
||||
VRS_BYTE_RMW, CRTC_DATA, ~0x40, 0x00,
|
||||
VRS_BYTE_OUT, CRTC_INDEX, MODE_CONTROL,
|
||||
VRS_BYTE_RMW, CRTC_DATA, ~0x00, 0x40,
|
||||
|
||||
VRS_END,
|
||||
};
|
||||
|
||||
int vrs360x400x256planar[] = {
|
||||
//
|
||||
// switch to linear, non-chain4 mode
|
||||
//
|
||||
VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
|
||||
VRS_BYTE_OUT, SC_DATA, 1,
|
||||
|
||||
VRS_WORD_OUT, SC_INDEX, 0x0604,
|
||||
VRS_BYTE_OUT, MISC_OUTPUT, 0x67,
|
||||
|
||||
VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
|
||||
VRS_BYTE_OUT, SC_DATA, 3,
|
||||
|
||||
//
|
||||
// unprotect CRTC0 through CRTC0
|
||||
//
|
||||
VRS_BYTE_OUT, CRTC_INDEX, 0x11,
|
||||
VRS_BYTE_RMW, CRTC_DATA, ~0x80, 0x00,
|
||||
|
||||
//
|
||||
// stop scanning each line twice
|
||||
//
|
||||
VRS_BYTE_OUT, CRTC_INDEX, MAX_SCAN_LINE,
|
||||
VRS_BYTE_RMW, CRTC_DATA, ~0x1F, 0x00,
|
||||
|
||||
//
|
||||
// change the CRTC from doubleword to byte mode
|
||||
//
|
||||
VRS_BYTE_OUT, CRTC_INDEX, UNDERLINE,
|
||||
VRS_BYTE_RMW, CRTC_DATA, ~0x40, 0x00,
|
||||
VRS_BYTE_OUT, CRTC_INDEX, MODE_CONTROL,
|
||||
VRS_BYTE_RMW, CRTC_DATA, ~0x00, 0x40,
|
||||
|
||||
//
|
||||
// set up the CRT Controller
|
||||
//
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x6B00,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x5901,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x5A02,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x8E03,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x5E04,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x8A05,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x3013,
|
||||
|
||||
VRS_END,
|
||||
};
|
||||
|
||||
int vrs320x480x256planar[] = {
|
||||
//
|
||||
// switch to linear, non-chain4 mode
|
||||
//
|
||||
VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
|
||||
VRS_BYTE_OUT, SC_DATA, 1,
|
||||
|
||||
VRS_BYTE_OUT, SC_INDEX, MEMORY_MODE,
|
||||
VRS_BYTE_RMW, SC_DATA, ~0x08, 0x04,
|
||||
VRS_BYTE_OUT, GC_INDEX, GRAPHICS_MODE,
|
||||
VRS_BYTE_RMW, GC_DATA, ~0x10, 0x00,
|
||||
VRS_BYTE_OUT, GC_INDEX, MISCELLANOUS,
|
||||
VRS_BYTE_RMW, GC_DATA, ~0x02, 0x00,
|
||||
|
||||
VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
|
||||
VRS_BYTE_OUT, SC_DATA, 3,
|
||||
|
||||
//
|
||||
// unprotect CRTC0 through CRTC0
|
||||
//
|
||||
VRS_BYTE_OUT, CRTC_INDEX, 0x11,
|
||||
VRS_BYTE_RMW, CRTC_DATA, ~0x80, 0x00,
|
||||
|
||||
//
|
||||
// stop scanning each line twice
|
||||
//
|
||||
VRS_BYTE_OUT, CRTC_INDEX, MAX_SCAN_LINE,
|
||||
VRS_BYTE_RMW, CRTC_DATA, ~0x1F, 0x00,
|
||||
|
||||
//
|
||||
// change the CRTC from doubleword to byte mode
|
||||
//
|
||||
VRS_BYTE_OUT, CRTC_INDEX, UNDERLINE,
|
||||
VRS_BYTE_RMW, CRTC_DATA, ~0x40, 0x00,
|
||||
VRS_BYTE_OUT, CRTC_INDEX, MODE_CONTROL,
|
||||
VRS_BYTE_RMW, CRTC_DATA, ~0x00, 0x40,
|
||||
|
||||
//
|
||||
// set up the CRT Controller
|
||||
//
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x0D06,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x3E07,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0xEA10,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0xAC11,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0xDF12,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0xE715,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x0616,
|
||||
|
||||
VRS_END,
|
||||
};
|
||||
|
||||
int vrs360x480x256planar[] = {
|
||||
//
|
||||
// switch to linear, non-chain4 mode
|
||||
//
|
||||
VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
|
||||
VRS_BYTE_OUT, SC_DATA, 1,
|
||||
|
||||
VRS_WORD_OUT, SC_INDEX, 0x0604,
|
||||
VRS_BYTE_OUT, MISC_OUTPUT, 0xE7,
|
||||
|
||||
VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
|
||||
VRS_BYTE_OUT, SC_DATA, 3,
|
||||
|
||||
//
|
||||
// unprotect CRTC0 through CRTC0
|
||||
//
|
||||
VRS_BYTE_OUT, CRTC_INDEX, 0x11,
|
||||
VRS_BYTE_RMW, CRTC_DATA, ~0x80, 0x00,
|
||||
|
||||
//
|
||||
// set up the CRT Controller
|
||||
//
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x6B00,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x5901,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x5A02,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x8E03,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x5E04,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x8A05,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x0D06,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x3E07,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x4009,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0xEA10,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0xAC11,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0xDF12,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x3013,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x0014,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0xE715,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0x0616,
|
||||
VRS_WORD_OUT, CRTC_INDEX, 0xE317,
|
||||
|
||||
VRS_END,
|
||||
};
|
||||
|
||||
//
|
||||
// extra VGA-specific data for vgavidmodes
|
||||
//
|
||||
vextra_t extra320x200x256linear = {
|
||||
1, vrsnull
|
||||
};
|
||||
vextra_t extra320x200x256planar = {
|
||||
1, vrs320x200x256planar
|
||||
};
|
||||
vextra_t extra360x200x256planar = {
|
||||
1, vrs360x200x256planar
|
||||
};
|
||||
vextra_t extra320x240x256planar = {
|
||||
1, vrs320x240x256planar
|
||||
};
|
||||
vextra_t extra360x240x256planar = {
|
||||
1, vrs360x240x256planar
|
||||
};
|
||||
vextra_t extra320x350x256planar = {
|
||||
1, vrs320x350x256planar
|
||||
};
|
||||
vextra_t extra360x350x256planar = {
|
||||
1, vrs360x350x256planar
|
||||
};
|
||||
vextra_t extra320x400x256planar = {
|
||||
1, vrs320x400x256planar
|
||||
};
|
||||
vextra_t extra360x400x256planar = {
|
||||
1, vrs360x400x256planar
|
||||
};
|
||||
vextra_t extra320x480x256planar = {
|
||||
1, vrs320x480x256planar
|
||||
};
|
||||
vextra_t extra360x480x256planar = {
|
||||
1, vrs360x480x256planar
|
||||
};
|
||||
|
||||
//
|
||||
// base mode descriptors, in ascending order of number of pixels
|
||||
//
|
||||
|
||||
vmode_t vgavidmodes[] = {
|
||||
{
|
||||
NULL,
|
||||
"320x200", " ***** standard VGA modes ***** ",
|
||||
320, 200, (200.0/320.0)*(320.0/240.0), 320, 0, 1, &extra320x200x256linear,
|
||||
VGA_InitMode, VGA_SwapBuffers, VGA_SetPalette,
|
||||
VGA_BeginDirectRect, VGA_EndDirectRect
|
||||
},
|
||||
{
|
||||
NULL,
|
||||
"320x200", " ***** Mode X-style modes ***** ",
|
||||
320, 200, (200.0/320.0)*(320.0/240.0), 320, 1, 1, &extra320x200x256planar,
|
||||
VGA_InitMode, VGA_SwapBuffers, VGA_SetPalette,
|
||||
VGA_BeginDirectRect, VGA_EndDirectRect
|
||||
},
|
||||
{
|
||||
NULL,
|
||||
"360x200", NULL, 360, 200, (200.0/360.0)*(320.0/240.0),
|
||||
384, 1, 1, &extra360x200x256planar, VGA_InitMode,
|
||||
VGA_SwapBuffers,
|
||||
VGA_SetPalette, VGA_BeginDirectRect, VGA_EndDirectRect
|
||||
},
|
||||
{
|
||||
NULL,
|
||||
"320x240", NULL, 320, 240, (240.0/320.0)*(320.0/240.0),
|
||||
320, 1, 1, &extra320x240x256planar, VGA_InitMode,
|
||||
VGA_SwapBuffers,
|
||||
VGA_SetPalette, VGA_BeginDirectRect, VGA_EndDirectRect
|
||||
},
|
||||
{
|
||||
NULL,
|
||||
"360x240", NULL, 360, 240, (240.0/360.0)*(320.0/240.0),
|
||||
384, 1, 1, &extra360x240x256planar,
|
||||
VGA_InitMode, VGA_SwapBuffers, VGA_SetPalette,
|
||||
VGA_BeginDirectRect, VGA_EndDirectRect
|
||||
},
|
||||
{
|
||||
NULL,
|
||||
"320x350", NULL, 320, 350, (350.0/320.0)*(320.0/240.0),
|
||||
320, 1, 1, &extra320x350x256planar, VGA_InitMode,
|
||||
VGA_SwapBuffers,
|
||||
VGA_SetPalette, VGA_BeginDirectRect, VGA_EndDirectRect
|
||||
},
|
||||
{
|
||||
NULL,
|
||||
"360x350", NULL, 360, 350, (350.0/360.0)*(320.0/240.0),
|
||||
384, 1, 1, &extra360x350x256planar, VGA_InitMode,
|
||||
VGA_SwapBuffers,
|
||||
VGA_SetPalette, VGA_BeginDirectRect, VGA_EndDirectRect
|
||||
},
|
||||
{
|
||||
NULL,
|
||||
"320x400", NULL, 320, 400, (400.0/320.0)*(320.0/240.0), 320,
|
||||
1, 1, &extra320x400x256planar, VGA_InitMode,
|
||||
VGA_SwapBuffers,
|
||||
VGA_SetPalette, VGA_BeginDirectRect, VGA_EndDirectRect
|
||||
},
|
||||
{
|
||||
NULL,
|
||||
"360x400", NULL, 360, 400, (400.0/360.0)*(320.0/240.0),
|
||||
384, 1, 1, &extra360x400x256planar, VGA_InitMode,
|
||||
VGA_SwapBuffers,
|
||||
VGA_SetPalette, VGA_BeginDirectRect, VGA_EndDirectRect
|
||||
},
|
||||
{
|
||||
NULL,
|
||||
"320x480", NULL, 320, 480, (480.0/320.0)*(320.0/240.0),
|
||||
320, 1, 1, &extra320x480x256planar, VGA_InitMode,
|
||||
VGA_SwapBuffers,
|
||||
VGA_SetPalette, VGA_BeginDirectRect, VGA_EndDirectRect
|
||||
},
|
||||
{
|
||||
NULL,
|
||||
"360x480", NULL, 360, 480, (480.0/360.0)*(320.0/240.0),
|
||||
384, 1, 1, &extra360x480x256planar, VGA_InitMode,
|
||||
VGA_SwapBuffers,
|
||||
VGA_SetPalette, VGA_BeginDirectRect, VGA_EndDirectRect
|
||||
},
|
||||
};
|
||||
|
81
vregset.c
81
vregset.c
|
@ -1,81 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
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 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.
|
||||
|
||||
*/
|
||||
//
|
||||
// vregset.c: video register-setting interpreter
|
||||
//
|
||||
|
||||
#include <dos.h>
|
||||
#include <conio.h>
|
||||
|
||||
#include "quakedef.h"
|
||||
#include "vregset.h"
|
||||
|
||||
//#define outportb loutportb
|
||||
|
||||
void loutportb (int port, int val)
|
||||
{
|
||||
printf ("port, val: %x %x\n", port, val);
|
||||
getch ();
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
VideoRegisterSet
|
||||
================
|
||||
*/
|
||||
void VideoRegisterSet (int *pregset)
|
||||
{
|
||||
int port, temp0, temp1, temp2;
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
switch (*pregset++)
|
||||
{
|
||||
case VRS_END:
|
||||
return;
|
||||
|
||||
case VRS_BYTE_OUT:
|
||||
port = *pregset++;
|
||||
outportb (port, *pregset++);
|
||||
break;
|
||||
|
||||
case VRS_BYTE_RMW:
|
||||
port = *pregset++;
|
||||
temp0 = *pregset++;
|
||||
temp1 = *pregset++;
|
||||
temp2 = inportb (port);
|
||||
temp2 &= temp0;
|
||||
temp2 |= temp1;
|
||||
outportb (port, temp2);
|
||||
break;
|
||||
|
||||
case VRS_WORD_OUT:
|
||||
port = *pregset++;
|
||||
outportb (port, *pregset & 0xFF);
|
||||
outportb (port+1, *pregset >> 8);
|
||||
pregset++;
|
||||
break;
|
||||
|
||||
default:
|
||||
Sys_Error ("VideoRegisterSet: Invalid command\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
56
vregset.h
56
vregset.h
|
@ -1,56 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
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 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.
|
||||
|
||||
*/
|
||||
//
|
||||
// vregset.h: header file for video register-setting interpreter
|
||||
//
|
||||
|
||||
//
|
||||
// registers & subregisters
|
||||
//
|
||||
#define MISC_OUTPUT 0x3C2
|
||||
|
||||
#define SC_INDEX 0x3C4
|
||||
#define SC_DATA 0x3C5
|
||||
#define SYNC_RESET 0
|
||||
#define MAP_MASK 2
|
||||
#define MEMORY_MODE 4
|
||||
|
||||
#define GC_INDEX 0x3CE
|
||||
#define GC_DATA 0x3CF
|
||||
#define READ_MAP 4
|
||||
#define GRAPHICS_MODE 5
|
||||
#define MISCELLANOUS 6
|
||||
|
||||
#define CRTC_INDEX 0x3D4
|
||||
#define CRTC_DATA 0x3D5
|
||||
#define MAX_SCAN_LINE 9
|
||||
#define UNDERLINE 0x14
|
||||
#define MODE_CONTROL 0x17
|
||||
|
||||
//
|
||||
// register-set commands
|
||||
//
|
||||
#define VRS_END 0
|
||||
#define VRS_BYTE_OUT 1
|
||||
#define VRS_BYTE_RMW 2
|
||||
#define VRS_WORD_OUT 3
|
||||
|
||||
void VideoRegisterSet (int *pregset);
|
||||
|
Loading…
Reference in a new issue