clext.c revision 677833bc953b6cb418c701facbdcf4aa18d6c44e
//
// QEMU Cirrus CLGD 54xx VGABIOS Extension.
//
// Copyright (c) 2004 Makoto Suzuki (suzu)
//
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
//#define CIRRUS_VESA3_PMINFO
#ifdef VBE
#endif
#define PM_BIOSMEM_CURRENT_MODE 0x449
#define PM_BIOSMEM_CRTC_ADDRESS 0x463
#define PM_BIOSMEM_VBE_MODE 0x4BA
typedef struct
{
/* + 0 */
unsigned short mode;
unsigned short width;
unsigned short height;
unsigned short depth;
/* + 8 */
unsigned short hidden_dac; /* 0x3c6 */
unsigned short *seq; /* 0x3c4 */
unsigned short *graph; /* 0x3ce */
unsigned short *crtc; /* 0x3d4 */
/* +16 */
unsigned char bitsperpixel;
unsigned char vesacolortype;
unsigned char vesaredmask;
unsigned char vesaredpos;
unsigned char vesagreenmask;
unsigned char vesagreenpos;
unsigned char vesabluemask;
unsigned char vesabluepos;
/* +24 */
unsigned char vesareservedmask;
unsigned char vesareservedpos;
#define CIRRUS_MODE_SIZE 26
/* For VESA BIOS 3.0 */
#define CIRRUS_PM16INFO_SIZE 20
/* VGA */
/* extensions */
unsigned short cgraph_svgacolor[] = {
0x0000,0x0001,0x0002,0x0003,0x0004,0x4005,0x0506,0x0f07,0xff08,
0x0009,0x000a,0x000b,
0xffff
};
/* 640x480x8 */
unsigned short cseq_640x480x8[] = {
0x0300,0x2101,0x0f02,0x0003,0x0e04,0x1107,
0x580b,0x580c,0x580d,0x580e,
0x0412,0x0013,0x2017,
0x331b,0x331c,0x331d,0x331e,
0xffff
};
unsigned short ccrtc_640x480x8[] = {
0x2c11,
0x5f00,0x4f01,0x4f02,0x8003,0x5204,0x1e05,0x0b06,0x3e07,
0x4009,0x000c,0x000d,
0xea10,0xdf12,0x5013,0x4014,0xdf15,0x0b16,0xc317,0xff18,
0x001a,0x221b,0x001d,
0xffff
};
/* 640x480x16 */
unsigned short cseq_640x480x16[] = {
0x0300,0x2101,0x0f02,0x0003,0x0e04,0x1707,
0x580b,0x580c,0x580d,0x580e,
0x0412,0x0013,0x2017,
0x331b,0x331c,0x331d,0x331e,
0xffff
};
unsigned short ccrtc_640x480x16[] = {
0x2c11,
0x5f00,0x4f01,0x4f02,0x8003,0x5204,0x1e05,0x0b06,0x3e07,
0x4009,0x000c,0x000d,
0xea10,0xdf12,0xa013,0x4014,0xdf15,0x0b16,0xc317,0xff18,
0x001a,0x221b,0x001d,
0xffff
};
/* 640x480x24 */
unsigned short cseq_640x480x24[] = {
0x0300,0x2101,0x0f02,0x0003,0x0e04,0x1507,
0x580b,0x580c,0x580d,0x580e,
0x0412,0x0013,0x2017,
0x331b,0x331c,0x331d,0x331e,
0xffff
};
unsigned short ccrtc_640x480x24[] = {
0x2c11,
0x5f00,0x4f01,0x4f02,0x8003,0x5204,0x1e05,0x0b06,0x3e07,
0x4009,0x000c,0x000d,
0xea10,0xdf12,0x0013,0x4014,0xdf15,0x0b16,0xc317,0xff18,
0x001a,0x321b,0x001d,
0xffff
};
/* 800x600x8 */
unsigned short cseq_800x600x8[] = {
0x0300,0x2101,0x0f02,0x0003,0x0e04,0x1107,
0x230b,0x230c,0x230d,0x230e,
0x0412,0x0013,0x2017,
0x141b,0x141c,0x141d,0x141e,
0xffff
};
unsigned short ccrtc_800x600x8[] = {
0x2311,0x7d00,0x6301,0x6302,0x8003,0x6b04,0x1a05,0x9806,0xf007,
0x6009,0x000c,0x000d,
0x7d10,0x5712,0x6413,0x4014,0x5715,0x9816,0xc317,0xff18,
0x001a,0x221b,0x001d,
0xffff
};
/* 800x600x16 */
unsigned short cseq_800x600x16[] = {
0x0300,0x2101,0x0f02,0x0003,0x0e04,0x1707,
0x230b,0x230c,0x230d,0x230e,
0x0412,0x0013,0x2017,
0x141b,0x141c,0x141d,0x141e,
0xffff
};
unsigned short ccrtc_800x600x16[] = {
0x2311,0x7d00,0x6301,0x6302,0x8003,0x6b04,0x1a05,0x9806,0xf007,
0x6009,0x000c,0x000d,
0x7d10,0x5712,0xc813,0x4014,0x5715,0x9816,0xc317,0xff18,
0x001a,0x221b,0x001d,
0xffff
};
/* 800x600x24 */
unsigned short cseq_800x600x24[] = {
0x0300,0x2101,0x0f02,0x0003,0x0e04,0x1507,
0x230b,0x230c,0x230d,0x230e,
0x0412,0x0013,0x2017,
0x141b,0x141c,0x141d,0x141e,
0xffff
};
unsigned short ccrtc_800x600x24[] = {
0x2311,0x7d00,0x6301,0x6302,0x8003,0x6b04,0x1a05,0x9806,0xf007,
0x6009,0x000c,0x000d,
0x7d10,0x5712,0x2c13,0x4014,0x5715,0x9816,0xc317,0xff18,
0x001a,0x321b,0x001d,
0xffff
};
/* 1024x768x8 */
unsigned short cseq_1024x768x8[] = {
0x0300,0x2101,0x0f02,0x0003,0x0e04,0x1107,
0x760b,0x760c,0x760d,0x760e,
0x0412,0x0013,0x2017,
0x341b,0x341c,0x341d,0x341e,
0xffff
};
unsigned short ccrtc_1024x768x8[] = {
0x2911,0xa300,0x7f01,0x7f02,0x8603,0x8304,0x9405,0x2406,0xf507,
0x6009,0x000c,0x000d,
0x0310,0xff12,0x8013,0x4014,0xff15,0x2416,0xc317,0xff18,
0x001a,0x221b,0x001d,
0xffff
};
/* 1024x768x16 */
unsigned short cseq_1024x768x16[] = {
0x0300,0x2101,0x0f02,0x0003,0x0e04,0x1707,
0x760b,0x760c,0x760d,0x760e,
0x0412,0x0013,0x2017,
0x341b,0x341c,0x341d,0x341e,
0xffff
};
unsigned short ccrtc_1024x768x16[] = {
0x2911,0xa300,0x7f01,0x7f02,0x8603,0x8304,0x9405,0x2406,0xf507,
0x6009,0x000c,0x000d,
0x0310,0xff12,0x0013,0x4014,0xff15,0x2416,0xc317,0xff18,
0x001a,0x321b,0x001d,
0xffff
};
/* 1024x768x24 */
unsigned short cseq_1024x768x24[] = {
0x0300,0x2101,0x0f02,0x0003,0x0e04,0x1507,
0x760b,0x760c,0x760d,0x760e,
0x0412,0x0013,0x2017,
0x341b,0x341c,0x341d,0x341e,
0xffff
};
unsigned short ccrtc_1024x768x24[] = {
0x2911,0xa300,0x7f01,0x7f02,0x8603,0x8304,0x9405,0x2406,0xf507,
0x6009,0x000c,0x000d,
0x0310,0xff12,0x8013,0x4014,0xff15,0x2416,0xc317,0xff18,
0x001a,0x321b,0x001d,
0xffff
};
/* 1280x1024x8 */
unsigned short cseq_1280x1024x8[] = {
0x0300,0x2101,0x0f02,0x0003,0x0e04,0x1107,
0x760b,0x760c,0x760d,0x760e,
0x0412,0x0013,0x2017,
0x341b,0x341c,0x341d,0x341e,
0xffff
};
unsigned short ccrtc_1280x1024x8[] = {
0x2911,0xc300,0x9f01,0x9f02,0x8603,0x8304,0x9405,0x2406,0xf707,
0x6009,0x000c,0x000d,
0x0310,0xff12,0xa013,0x4014,0xff15,0x2416,0xc317,0xff18,
0x001a,0x221b,0x001d,
0xffff
};
{
{0x5f,640,480,8,0x00,
4,0,0,0,0,0,0,0,0},
{0x64,640,480,16,0xe1,
6,5,11,6,5,5,0,0,0},
{0x66,640,480,15,0xf0,
6,5,10,5,5,5,0,1,15},
{0x71,640,480,24,0xe5,
6,8,16,8,8,8,0,0,0},
{0x5c,800,600,8,0x00,
4,0,0,0,0,0,0,0,0},
{0x65,800,600,16,0xe1,
6,5,11,6,5,5,0,0,0},
{0x67,800,600,15,0xf0,
6,5,10,5,5,5,0,1,15},
{0x60,1024,768,8,0x00,
4,0,0,0,0,0,0,0,0},
{0x74,1024,768,16,0xe1,
6,5,11,6,5,5,0,0,0},
{0x68,1024,768,15,0xf0,
6,5,10,5,5,5,0,1,15},
{0x78,800,600,24,0xe5,
6,8,16,8,8,8,0,0,0},
{0x79,1024,768,24,0xe5,
6,8,16,8,8,8,0,0,0},
{0x6d,1280,1024,8,0x00,
4,0,0,0,0,0,0,0,0},
0xff,0,0,0,0,0,0,0,0},
{0xff,0,0,0,0,0,0,0,0,
0xff,0,0,0,0,0,0,0,0},
};
unsigned char cirrus_id_table[] = {
// 5430
0xA0, 0x32,
// 5446
0xB8, 0x39,
0xff, 0xff
};
unsigned short cirrus_vesa_modelist[] = {
// 640x480x8
0x101, 0x5f,
// 640x480x15
0x110, 0x66,
// 640x480x16
0x111, 0x64,
// 640x480x24
0x112, 0x71,
// 800x600x8
0x103, 0x5c,
// 800x600x15
0x113, 0x67,
// 800x600x16
0x114, 0x65,
// 800x600x24
0x115, 0x78,
// 1024x768x8
0x105, 0x60,
// 1024x768x15
0x116, 0x68,
// 1024x768x16
0x117, 0x74,
// 1024x768x24
//0x118, 0x79,
// 1280x1024x8
0x107, 0x6d,
// invalid
0xffff,0xffff
};
.ascii "cirrus-compatible VGA is detected"
.ascii "cirrus-compatible VGA is not detected"
.ascii "VGABIOS Cirrus extension"
.byte 0
.ascii "1.0"
.byte 0
#ifdef CIRRUS_DEBUG
#endif
#ifdef CIRRUS_DEBUG
#endif
#ifdef CIRRUS_VESA3_PMINFO
#else
#endif
#ifdef CIRRUS_DEBUG
#endif
#ifdef CIRRUS_DEBUG
#endif
#ifdef CIRRUS_DEBUG
#endif
#ifdef CIRRUS_VESA3_PMINFO
#else
#endif
;; VBE2
#ifdef CIRRUS_VESA3_PMINFO
#endif // CIRRUS_VESA3_PMINFO
int #0x10
#ifdef CIRRUS_VESA3_PMINFO
#else
#endif
#ifdef CIRRUS_VESA3_PMINFO
#else
#endif
;; 80h
;; 84h
;; 88h
;; 8Ch
;; 90h
;; 94h
;; 98h
;; 9Ch
;; A0h
;; A4h
;; A8h
;; ACh
;; 00h
;; 04h
;; 08h
;; 0Ch
#ifdef CIRRUS_VESA3_PMINFO
/* + 0 */
/* + 4 */
/* + 8 */
/* +12 */
/* +16 */
#endif // CIRRUS_VESA3_PMINFO
#ifdef CIRRUS_DEBUG
{
}
#endif