Chameleon

Chameleon Svn Source Tree

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

Source at commit 133 created 14 years 30 days ago.
By diebuche, Futher fixes..
1
2/* Copied from 915 resolution created by steve tomljenovic
3 *
4 * This code is based on the techniques used in :
5 *
6 * - 855patch. Many thanks to Christian Zietz (czietz gmx net)
7 * for demonstrating how to shadow the VBIOS into system RAM
8 * and then modify it.
9 *
10 * - 1280patch by Andrew Tipton (andrewtipton null li).
11 *
12 * - 855resolution by Alain Poirier
13 *
14 * This source code is into the public domain.
15 */
16#ifndef __915_RESOLUTION_H
17#define __915_RESOLUTION_H
18
19#include "edid.h"
20
21#define NEW(a) ((a *)(malloc(sizeof(a))))
22#define FREE(a) (free(a))
23
24#define VBIOS_START 0xc0000
25#define VBIOS_SIZE 0x10000
26
27#define FALSE 0
28#define TRUE 1
29
30typedef struct {
31unsigned char width;
32unsigned char height;
33} s_aspect;
34
35
36typedef enum {
37CT_UNKWN, CT_830, CT_845G, CT_855GM, CT_865G,
38CT_915G, CT_915GM, CT_945G, CT_945GM, CT_945GME, CT_946GZ,
39CT_955X, CT_G965, CT_Q965, CT_965GM, CT_975X,
40CT_P35, CT_X48, CT_B43, CT_Q45, CT_P45,
41CT_GM45, CT_G41, CT_G31, CT_G45, CT_500
42} chipset_type;
43
44
45typedef enum {
46BT_UNKWN, BT_1, BT_2, BT_3, BT_ATI_1, BT_ATI_2, BT_NVDA
47} bios_type;
48
49typedef struct {
50UInt32clock;
51UInt16x;
52UInt16hsyncstart;
53UInt16hsyncend;
54UInt16htotal;
55UInt16y;
56UInt16vsyncstart;
57UInt16vsyncend;
58UInt16vtotal;
59} generic_modeline;
60
61
62typedef struct {
63UInt32 chipset_id;
64chipset_type chipset;
65bios_type bios;
66
67UInt32 bios_fd;
68unsigned char* bios_backup_ptr;
69unsigned char* bios_ptr;
70
71char * mode_table;
72char * nv_mode_table_2;
73UInt32 nv_mode_table_2_size;
74
75UInt32 mode_table_size;
76UInt32 modeline_num;
77UInt32 nv_modeline_num_2;
78UInt8 b1, b2;
79
80s_aspect aspect_ratio;
81
82UInt8 unlocked;
83} vbios_map;
84
85vbios_map * open_vbios(chipset_type);
86void close_vbios (vbios_map*);
87void unlock_vbios(vbios_map*);
88void relock_vbios(vbios_map*);
89void save_vbios(vbios_map*);
90void restore_vbios(vbios_map*);
91
92void gtf_timings(UInt32 x, UInt32 y, UInt32 freq,
93 unsigned long *clock,
94 UInt16 *hsyncstart, UInt16 *hsyncend, UInt16 *hblank,
95 UInt16 *vsyncstart, UInt16 *vsyncend, UInt16 *vblank);
96
97void cvt_timings(UInt32 x, UInt32 y, UInt32 freq,
98 unsigned long *clock,
99 UInt16 *hsyncstart, UInt16 *hsyncend, UInt16 *hblank,
100 UInt16 *vsyncstart, UInt16 *vsyncend, UInt16 *vblank, bool reduced);
101
102void patch_vbios(vbios_map*, UInt32, UInt32, UInt32, UInt32, UInt32);
103
104#endif
105

Archive Download this file

Revision: 133