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 | typedef struct {␊ |
23 | ␉unsigned char␉ucTable_Major; //These names are probably wrong␊ |
24 | ␉unsigned char␉ucTable_Minor;␊ |
25 | ␉unsigned char␉ucTable_Rev;␊ |
26 | ␉unsigned short␉usTable_Size;␊ |
27 | } NV_COMMON_TABLE_HEADER;␊ |
28 | ␊ |
29 | typedef struct {␊ |
30 | ␉unsigned short␉usPixel_Clock;␊ |
31 | ␉unsigned short␉usH_Active;␊ |
32 | ␉unsigned short usH_Active_minus_One;␊ |
33 | ␉unsigned short␉reserved1;␊ |
34 | ␉unsigned short usH_Active_minus_One_;␊ |
35 | ␉unsigned short␉usH_SyncStart;␊ |
36 | ␉unsigned short␉usH_SyncEnd;␊ |
37 | ␉unsigned short␉usH_Total;␊ |
38 | ␉unsigned short␉usV_Active;␊ |
39 | ␉unsigned short usV_Active_minus_One;␊ |
40 | ␉unsigned short␉reserved2;␊ |
41 | ␉unsigned short usV_Active_minus_One_;␊ |
42 | ␉unsigned short␉usV_SyncStart;␊ |
43 | ␉unsigned short␉usV_SyncEnd;␊ |
44 | ␉unsigned short␉usV_Total;␊ |
45 | ␉unsigned short␉reserved3;␊ |
46 | } NV_MODELINE;␊ |
47 | ␊ |
48 | typedef struct {␊ |
49 | ␉unsigned short h_disp;␊ |
50 | ␉unsigned short v_disp;␊ |
51 | ␉unsigned char h_blank;␊ |
52 | ␉unsigned char h_syncoffset;␊ |
53 | ␉unsigned char h_syncwidth;␊ |
54 | ␉unsigned char v_blank;␊ |
55 | ␉//unsigned char v_syncwidth;␊ |
56 | ␉unsigned 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 | ␊ |
65 | typedef struct {␊ |
66 | ␉NV_COMMON_TABLE_HEADER␉sHeader;␊ |
67 | ␉NV_MODELINE␉*␉␉␉sModelines;␊ |
68 | } NV_VESA_TABLE;␊ |
69 | ␊ |
70 | vbios_map * open_nvidia_vbios(vbios_map *map);␊ |
71 | ␊ |
72 | bool nvidia_set_mode(vbios_map* map, UInt8 idx, UInt32* x, UInt32* y, char Type);␊ |
73 | ␊ |
74 | #endif |