Chameleon

Chameleon Svn Source Tree

Root/branches/diebuche/i386/libsaio/nvidia_resolution.h

Source at commit 132 created 14 years 1 month ago.
By diebuche, Adding lebidous latest changes
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
22typedef struct {
23unsigned charucTable_Major; //These names are probably wrong
24unsigned charucTable_Minor;
25unsigned charucTable_Rev;
26unsigned shortusTable_Size;
27} NV_COMMON_TABLE_HEADER;
28
29typedef struct {
30unsigned shortusPixel_Clock;
31unsigned shortusH_Active;
32unsigned short usH_Active_minus_One;
33unsigned shortreserved1;
34unsigned short usH_Active_minus_One_;
35unsigned shortusH_SyncStart;
36unsigned shortusH_SyncEnd;
37unsigned shortusH_Total;
38unsigned shortusV_Active;
39unsigned short usV_Active_minus_One;
40unsigned shortreserved2;
41unsigned short usV_Active_minus_One_;
42unsigned shortusV_SyncStart;
43unsigned shortusV_SyncEnd;
44unsigned shortusV_Total;
45unsigned shortreserved3;
46} NV_MODELINE;
47
48typedef struct {
49unsigned short h_disp;
50unsigned short v_disp;
51unsigned char h_blank;
52unsigned char h_syncoffset;
53unsigned char h_syncwidth;
54unsigned char v_blank;
55//unsigned char v_syncwidth;
56unsigned char flags; //looks like flags & 1 means "Graphics Mode", to oppose to "Console Mode"
57//on 7xxx the high four bits look like a mode id number.
58//on 8xxx only the low four bits are used, standard graphics mode are always 5.
59//it can be 1 (1400x1050 and 2048x1536) (HSync High, VSync High ?)
60// 3 (1440x900, 1680x1050 and 1920x1200) (Hsync High, VSync Low ?)
61// 3 (Standard Timings) (Hsync Low, VSync High ?)
62// or 7 (1280x800 and 768x340) (Hync Low, VSync Low ?)
63} NV_MODELINE_2;
64
65typedef struct {
66NV_COMMON_TABLE_HEADERsHeader;
67NV_MODELINE*sModelines;
68} NV_VESA_TABLE;
69
70vbios_map * open_nvidia_vbios(vbios_map *map);
71
72bool nvidia_set_mode(vbios_map* map, UInt8 idx, UInt32* x, UInt32* y, char Type);
73
74#endif

Archive Download this file

Revision: 132