Subversion Repositories shark

Rev

Rev 1618 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
110 giacomo 1
/*
2
 * Project: S.Ha.R.K.
3
 *
4
 * Coordinators:
5
 *   Giorgio Buttazzo    <giorgio@sssup.it>
6
 *   Paolo Gai           <pj@gandalf.sssup.it>
7
 *
8
 * Authors     :
9
 *   Paolo Gai           <pj@gandalf.sssup.it>
10
 *   Massimiliano Giorgi <massy@gandalf.sssup.it>
11
 *   Luca Abeni          <luca@gandalf.sssup.it>
12
 *   (see the web pages for full authors list)
13
 *
14
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
15
 *
16
 * http://www.sssup.it
17
 * http://retis.sssup.it
18
 * http://shark.sssup.it
19
 */
20
 
21
/**
22
 ------------
23
 CVS :        $Id: gd.h,v 1.1 2003-03-24 13:26:13 giacomo Exp $
24
 
25
 File:        $File$
26
 Revision:    $Revision: 1.1 $
27
 Last update: $Date: 2003-03-24 13:26:13 $
28
 ------------
29
 
30
**/
31
 
32
/*
33
 * Copyright (C) 2000 Luca Abeni
34
 *
35
 * This program is free software; you can redistribute it and/or modify
36
 * it under the terms of the GNU General Public License as published by
37
 * the Free Software Foundation; either version 2 of the License, or
38
 * (at your option) any later version.
39
 *
40
 * This program is distributed in the hope that it will be useful,
41
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
42
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
43
 * GNU General Public License for more details.
44
 *
45
 * You should have received a copy of the GNU General Public License
46
 * along with this program; if not, write to the Free Software
47
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
48
 *
49
 */
50
 
51
#ifndef __GD_H__
52
#define __GD_H__
53
 
54
#include <ll/sys/types.h>
55
/* Std 16 colors... are in cons.h !!!*/
56
#include <ll/i386/cons.h>
1621 fabio 57
#include <arch/sys/cdefs.h>
110 giacomo 58
 
59
__BEGIN_DECLS
60
 
61
/* 15bpp, 16bpp, 24bpp and 32bpp colors... */
62
#define color15(r, g, b) (((WORD)(r & 0x1F) << 10) | ((WORD)(g & 0x1F) << 5) | ((WORD)(b & 0x1F)))
63
#define color16(r, g, b) (((WORD)(r & 0x1F) << 11) | ((WORD)(g & 0x3F) << 5) | ((WORD)(b & 0x1F)))
64
#define color24(r, g, b) (((DWORD)(r & 0xFF) << 16) | ((DWORD)(g & 0xFF) << 8) | (DWORD)(b & 0xFF))
65
#define color32(r, g, b) (((DWORD)(r & 0xFF) << 16) | ((DWORD)(g & 0xFF) << 8) | (DWORD)(b & 0xFF))
66
 
67
#define rgb15(r, g, b) ((((WORD)(r & 0xF8)>>3) << 10) | (((WORD)(g & 0xF8)>>3) << 5) | ((WORD)(b & 0xF8)>>3))
68
#define rgb16(r, g, b) ((((WORD)(r & 0xF8)>>3) << 11) | (((WORD)(g & 0xFC)>>2) << 5) | ((WORD)(b & 0xF8)>>3))
69
#define rgb24(r, g, b) (((DWORD)(r & 0xFF) << 16) | ((DWORD)(g & 0xFF) << 8) | (DWORD)(b & 0xFF))
70
#define rgb32(r, g, b) (((DWORD)(r & 0xFF) << 16) | ((DWORD)(g & 0xFF) << 8) | (DWORD)(b & 0xFF))
71
 
72
/* Flags */
73
#define NOLINEAR 1
74
 
75
struct gmode {
76
    WORD xdim;
77
    WORD ydim;
78
    WORD bpr;
79
    BYTE bpp;
80
    WORD modenum;
81
};
82
 
83
#include "comp.h"
84
 
85
int gd_init(WORD flags);
86
void gd_showinfo(void);
87
int gd_setmode(WORD mode);
88
int gd_bsetmode(WORD mode);
89
WORD gd_getbpr(void);
90
DWORD gd_getflb(void);
91
DWORD gd_getmem(void);
92
void gd_showmodeinfo(void);
93
int gd_modenum(WORD x, WORD y, BYTE depth);
94
int gd_getmodeinfo(grx_vga_modeinfo *m);
95
 
96
void Load_Write_Bank_256(BYTE bank);
97
 
98
void Seg_Off_256(WORD x, WORD y, WORD pitch, WORD *offs, WORD *seg);
99
void Seg_Off_Hi(WORD x, WORD y, WORD pitch, WORD *offs, WORD *seg);
100
 
101
 
102
void gd_getcolor(BYTE ind, BYTE *r, BYTE *g, BYTE *b);
103
void gd_setcolor(BYTE ind,BYTE r,BYTE g,BYTE b);
104
void gd_getpalette(BYTE start, BYTE num, BYTE *pal);
105
void gd_setpalette(BYTE start, BYTE num, BYTE *pal);
106
 
107
__END_DECLS
108
#endif