Chameleon

Chameleon Svn Source Tree

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

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

Archive Download this file

Revision: 465