Chameleon

Chameleon Svn Source Tree

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

Source at commit 132 created 14 years 1 month ago.
By diebuche, Adding lebidous latest changes
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
49
50typedef struct {
51UInt32 chipset_id;
52chipset_type chipset;
53bios_type bios;
54
55UInt32 bios_fd;
56unsigned char* bios_backup_ptr;
57unsigned char* bios_ptr;
58
59char * mode_table;
60char * nv_mode_table_2;
61
62UInt32 mode_table_size;
63UInt32 modeline_num;
64UInt8 b1, b2;
65
66s_aspect aspect_ratio;
67
68UInt8 unlocked;
69} vbios_map;
70
71vbios_map * open_vbios(chipset_type);
72void close_vbios (vbios_map*);
73void unlock_vbios(vbios_map*);
74void relock_vbios(vbios_map*);
75void save_vbios(vbios_map*);
76void restore_vbios(vbios_map*);
77
78void gtf_timings(UInt32 x, UInt32 y, UInt32 freq,
79 unsigned long *clock,
80 UInt16 *hsyncstart, UInt16 *hsyncend, UInt16 *hblank,
81 UInt16 *vsyncstart, UInt16 *vsyncend, UInt16 *vblank);
82
83/*void cvt_timings(UInt32 x, UInt32 y, UInt32 freq,
84 unsigned long *clock,
85 UInt16 *hsyncstart, UInt16 *hsyncend, UInt16 *hblank,
86 UInt16 *vsyncstart, UInt16 *vsyncend, UInt16 *vblank, BOOL reduced);*/
87
88void patch_vbios(vbios_map*, UInt32, UInt32, UInt32, UInt32, UInt32);
89
90#endif
91

Archive Download this file

Revision: 132