Chameleon

Chameleon Svn Source Tree

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

Source at commit 132 created 14 years 1 month ago.
By diebuche, Adding lebidous latest changes
1/*
2 * gma_resolution.h
3 *
4 *
5 * Created by Le Bidou on 19/03/10.
6 * Copyright 2010 ---. All rights reserved.
7 *
8 */
9
10#ifndef _GMA_RESOLUTION_H_
11#define _GMA_RESOLTUION_H_
12
13#include "libsaio.h"
14#include "autoresolution.h"
15
16#define MODE_TABLE_OFFSET_845G 617
17#define INTEL_SIGNATURE "Intel Corp"
18
19typedef struct {
20UInt8 mode;
21UInt8 bits_per_pixel;
22UInt16 resolution;
23UInt8 unknown;
24} __attribute__((packed)) vbios_mode;
25
26typedef struct {
27UInt8 unknow1[2];
28UInt8 x1;
29UInt8 x_total;
30UInt8 x2;
31UInt8 y1;
32UInt8 y_total;
33UInt8 y2;
34} __attribute__((packed)) vbios_resolution_type1;
35
36typedef struct {
37unsigned long clock;
38
39UInt16 x1;
40UInt16 htotal;
41UInt16 x2;
42UInt16 hblank;
43UInt16 hsyncstart;
44UInt16 hsyncend;
45UInt16 y1;
46 UInt16 vtotal;
47 UInt16 y2;
48UInt16 vblank;
49UInt16 vsyncstart;
50UInt16 vsyncend;
51} __attribute__((packed)) vbios_modeline_type2;
52
53typedef struct {
54UInt8 xchars;
55UInt8 ychars;
56UInt8 unknown[4];
57
58vbios_modeline_type2 modelines[];
59} __attribute__((packed)) vbios_resolution_type2;
60
61typedef struct {
62unsigned long clock;
63
64UInt16 x1;
65UInt16 htotal;
66UInt16 x2;
67UInt16 hblank;
68UInt16 hsyncstart;
69UInt16 hsyncend;
70
71UInt16 y1;
72UInt16 vtotal;
73UInt16 y2;
74UInt16 vblank;
75UInt16 vsyncstart;
76UInt16 vsyncend;
77
78UInt16 timing_h;
79UInt16 timing_v;
80
81UInt8 unknown[6];
82} __attribute__((packed)) vbios_modeline_type3;
83
84typedef struct {
85unsigned char unknown[6];
86
87 vbios_modeline_type3 modelines[];
88} __attribute__((packed)) vbios_resolution_type3;
89
90
91vbios_resolution_type1 * map_type1_resolution(vbios_map * map, UInt16 res);
92vbios_resolution_type2 * map_type2_resolution(vbios_map * map, UInt16 res);
93vbios_resolution_type3 * map_type3_resolution(vbios_map * map, UInt16 res);
94
95char detect_bios_type(vbios_map * map, char modeline, int entry_size);
96
97vbios_map * open_intel_vbios(vbios_map *);
98
99bool intel_set_mode_1(vbios_map* map, UInt8 idx, UInt32* x, UInt32* y);
100bool intel_set_mode_2(vbios_map* map, UInt8 idx, UInt32* x, UInt32* y);
101bool intel_set_mode_3(vbios_map* map, UInt8 idx, UInt32* x, UInt32* y);
102
103#endif

Archive Download this file

Revision: 132