Chameleon

Chameleon Svn Source Tree

Root/branches/azimutz/Chazi/i386/libsaio/nvidia_resolution.h

1/*
2 * nvidia_resolution.h
3 *
4 *
5 * Created by Le Bidou on 19/03/10.
6 * Copyright 2010 ---. All rights reserved.
7 *
8 */
9
10#ifndef _NVIDIA_RESOLUTION_HEADER_
11#define _NVIDIA_RESOLUTION_HEADER_
12
13//#include "libsaio.h"
14#include "io_inline.h"
15#include "autoresolution.h"
16
17#define NVIDIA_SIGNATURE "NVIDIA Corp"
18
19#define OFFSET_TO_VESA_TABLE_INDEX 2
20#define MAIN_VESA_TABLE 0
21#define SECOND_VESA_TABLE 1
22
23#define HSyncPolarityMask0x4
24#define VSyncPolarityMask0x2
25#define isGraphicsModeMask0x1
26
27typedef struct {
28unsigned chartableMajor; //These names are probably wrong
29unsigned chartableMinor;
30unsigned chartableRev;
31unsigned shorttableSize;
32}__packed nvCommonTableHeader;
33
34typedef struct {
35unsigned shortclock;
36unsigned shorthActive;
37unsigned short hActiveMinusOne;
38unsigned shortreserved1;
39unsigned short hActiveMinusOne_;
40unsigned shorthSyncStart;
41unsigned shorthSyncEnd;
42unsigned shorthTotal;
43unsigned shortvActive;
44unsigned short vActiveMinusOne;
45unsigned shortreserved2;
46unsigned short vActiveMinusOne_;
47unsigned shortvSyncStart;
48unsigned shortvSyncEnd;
49unsigned shortvTotal;
50unsigned shortreserved3;
51}__packed nvModeline;
52
53typedef struct {
54unsigned short hActive;
55unsigned short vActive;
56unsigned char hBlank;
57unsigned char hSyncOffset;
58unsigned char hSyncWidth;
59unsigned char vBlank;
60//unsigned char vSyncwidth;
61unsigned char flags; //looks like flags & 1 means "Graphics Mode", to oppose to "Console Mode"
62//on 7xxx the high four bits look like a mode id number.
63//on 8xxx only the low four bits are used, standard graphics mode are always 5.
64//it can be 1 (1400x1050 and 2048x1536) (HSync High, VSync High ?)
65// 3 (1440x900, 1680x1050 and 1920x1200) (HSync High, VSync Low ?)
66// 5 (Standard Timings) (HSync Low, VSync High ?)
67// or 7 (1280x800 and 768x340) (HSync Low, VSync Low ?)
68}__packed nvModeline_2;
69
70typedef struct {
71nvCommonTableHeaderheader;
72nvModeline*modelines;
73}__packed nvVesaTable;
74
75vBiosMap * openNvidiaVbios(vBiosMap *map);
76
77bool nvidiaSetMode(sModeTable* table, uint8_t idx, uint32_t* x, uint32_t* y);
78
79#endif

Archive Download this file

Revision: 515