Rev 1063 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1063 | tullio | 1 | |
2 | /* |
||
3 | * This program is free software; you can redistribute it and/or modify |
||
4 | * it under the terms of the GNU General Public License as published by |
||
5 | * the Free Software Foundation; either version 2 of the License, or |
||
6 | * (at your option) any later version. |
||
7 | * |
||
8 | * This program is distributed in the hope that it will be useful, |
||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
11 | * GNU General Public License for more details. |
||
12 | * |
||
13 | * You should have received a copy of the GNU General Public License |
||
14 | * along with this program; if not, write to the Free Software |
||
15 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
||
16 | * |
||
17 | */ |
||
18 | |||
2 | pj | 19 | #include <ll/i386/x-dos.h> |
1689 | fabio | 20 | #include <arch/sys/cdefs.h> |
80 | pj | 21 | |
22 | __BEGIN_DECLS |
||
23 | |||
2 | pj | 24 | /****************************************************************************/ |
25 | /* DEFINIZIONE DEI TIPI */ |
||
26 | /****************************************************************************/ |
||
27 | |||
28 | typedef struct { /* Questa struttura ci serve per definire */ |
||
29 | BYTE red, green, blue; /* la nostra palette. */ |
||
30 | } TYPE_PALETTE; |
||
31 | |||
32 | typedef TYPE_PALETTE palette[256]; |
||
33 | |||
34 | /* |
||
35 | Tipo VbeInfoBlock: in esso sono contenute tutte le caratteristiche del |
||
36 | display grafico a nostra disposizione. |
||
37 | */ |
||
38 | typedef struct { |
||
39 | unsigned char VbeSignature[4]; /* Deve essere 'VBE2' */ |
||
40 | unsigned short int VbeVersion; /* Versione del driver */ |
||
41 | unsigned short int OemNameOffset; /* Nome della scheda grafica */ |
||
42 | unsigned short int OemNameSegment; |
||
43 | unsigned char Capabilities[4]; /* Caratt. display grafico */ |
||
44 | unsigned short int SupportedModesOffset; /* Puntatore alla lista dei modi */ |
||
45 | unsigned short int SupportedModesSegment; /* supportati */ |
||
46 | unsigned short int TotalMemory; /* Memoria a bordo della scheda*/ |
||
47 | |||
48 | unsigned short int OemSoftwareRev; /* Livello revisione VBE */ |
||
49 | unsigned short int OemVendorNameOffset; /* Nome del produttore */ |
||
50 | unsigned short int OemVendorNameSegment; |
||
51 | unsigned short int OemProductNameOffset; /* Nome del prodotto */ |
||
52 | unsigned short int OemProductNameSegment; |
||
53 | unsigned short int OemProductRevOffset; /* Livello revisione display */ |
||
54 | unsigned short int OemProductRevSegment; |
||
55 | |||
56 | unsigned char reserved[222]; /* Riservato */ |
||
57 | unsigned char OemData[256]; |
||
58 | } VbeInfoBlock; |
||
59 | |||
60 | /* |
||
61 | Tipo ModeInfoBlock: in esso sono contenute tutte le caratteristiche |
||
62 | del modo grafico che vogliamo attivare. |
||
63 | */ |
||
64 | typedef struct { |
||
65 | unsigned short int ModeAttributes; /* Specifiche del modo */ |
||
66 | unsigned char WinAAttributes; /* Caratt. della window A */ |
||
67 | unsigned char WinBAttributes; /* Caratt. della window B */ |
||
1063 | tullio | 68 | unsigned short int WinGranularity; /* Granularit?-> window */ |
2 | pj | 69 | unsigned short int WinSize; /* Dimensione -> window */ |
70 | unsigned short int WinASegment; /* Indirizzo window A */ |
||
71 | unsigned short int WinBSegment; /* Indirizzo window B */ |
||
72 | void (*WPF) (signed long int page); /* Indirizzo funzione */ |
||
73 | unsigned short int BytesPerScanLine; |
||
74 | |||
75 | unsigned short int XResolution; /* Larghezza in pixel */ |
||
76 | unsigned short int YResolution; /* Altezza in pixel */ |
||
77 | unsigned char XCharSize; /* Larghezza carattere */ |
||
78 | unsigned char YCharSize; /* Altezza carattere */ |
||
79 | unsigned char NumberOfPlanes; /* Numero dei planes disponibili*/ |
||
80 | unsigned char BitsPerPixel; /* Num. bit per ogni pixel */ |
||
81 | unsigned char NumberOfBanks; /* Num. dei banchi presenti*/ |
||
82 | unsigned char MemoryModel; /* Tipo di memoria utilizzato*/ |
||
83 | unsigned char BankSize; /* Dimensione di ogni banco*/ |
||
84 | unsigned char NumberOfImagePages; /* Num. -1 di schermate */ |
||
85 | unsigned char Reserved; /* Riservato */ |
||
86 | |||
87 | unsigned char RedMaskSize; /* Maschera per rosso */ |
||
88 | unsigned char RedFieldPosition; /* Posizione bit rosso */ |
||
89 | unsigned char GreenMaskSize; /* Maschera per verde */ |
||
90 | unsigned char GreenFieldPosition; /* Posizione bit verde */ |
||
91 | unsigned char BlueMaskSize; /* Maschera per blu */ |
||
92 | unsigned char BlueFieldPosition; /* Posizione bit blu */ |
||
93 | unsigned char RsvdMaskSize; |
||
94 | unsigned char RsvdFieldPosition; |
||
95 | unsigned char DirectColorModeInfo; /* Caratt. colori modo diretto*/ |
||
96 | |||
97 | unsigned long int PhysBasePtr; /* Linear Frame Buffer */ |
||
98 | unsigned long int OffScreenMemoryOffset; /* Offset mem. "fuori schermo"*/ |
||
99 | unsigned long int OffScreenMemSize; /* Mem. disponibile "" ""*/ |
||
100 | unsigned char Reserved2 [206]; /* Riservato */ |
||
101 | } ModeInfoBlock; |
||
102 | |||
103 | /****************************************************************************/ |
||
104 | /* PROTOTYPES */ |
||
105 | /****************************************************************************/ |
||
106 | |||
107 | int vbe_getinfo(void); |
||
108 | int vbe_check_id(void); |
||
109 | void vbe_showinfo(void); |
||
110 | DWORD vbe_getmodeinfo(ModeInfoBlock *ModeInfo, WORD Vbe_Mode); |
||
111 | int vbe_setmode (WORD Vbe_Mode); |
||
112 | WORD vbe_getbpr(ModeInfoBlock *ModeInfo); |
||
113 | DWORD vbe_getflb(void); |
||
114 | int vbe_setbank(ModeInfoBlock *ModeInfo, BYTE bank); |
||
115 | void vbe_showmodeinfo (ModeInfoBlock *ModeInfo); |
||
116 | int vbe_checkmode(WORD mode); |
||
117 | |||
118 | DWORD vbe_getmem(void); |
||
80 | pj | 119 | __END_DECLS |