Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 109 → Rev 110

/shark/trunk/drivers/grx/include/drivers/gd.h
0,0 → 1,108
/*
* Project: S.Ha.R.K.
*
* Coordinators:
* Giorgio Buttazzo <giorgio@sssup.it>
* Paolo Gai <pj@gandalf.sssup.it>
*
* Authors :
* Paolo Gai <pj@gandalf.sssup.it>
* Massimiliano Giorgi <massy@gandalf.sssup.it>
* Luca Abeni <luca@gandalf.sssup.it>
* (see the web pages for full authors list)
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
*
* http://www.sssup.it
* http://retis.sssup.it
* http://shark.sssup.it
*/
 
/**
------------
CVS : $Id: gd.h,v 1.1 2003-03-24 13:26:13 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.1 $
Last update: $Date: 2003-03-24 13:26:13 $
------------
 
**/
 
/*
* Copyright (C) 2000 Luca Abeni
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
#ifndef __GD_H__
#define __GD_H__
 
#include <ll/sys/types.h>
/* Std 16 colors... are in cons.h !!!*/
#include <ll/i386/cons.h>
#include "ll/sys/cdefs.h"
 
__BEGIN_DECLS
 
/* 15bpp, 16bpp, 24bpp and 32bpp colors... */
#define color15(r, g, b) (((WORD)(r & 0x1F) << 10) | ((WORD)(g & 0x1F) << 5) | ((WORD)(b & 0x1F)))
#define color16(r, g, b) (((WORD)(r & 0x1F) << 11) | ((WORD)(g & 0x3F) << 5) | ((WORD)(b & 0x1F)))
#define color24(r, g, b) (((DWORD)(r & 0xFF) << 16) | ((DWORD)(g & 0xFF) << 8) | (DWORD)(b & 0xFF))
#define color32(r, g, b) (((DWORD)(r & 0xFF) << 16) | ((DWORD)(g & 0xFF) << 8) | (DWORD)(b & 0xFF))
 
#define rgb15(r, g, b) ((((WORD)(r & 0xF8)>>3) << 10) | (((WORD)(g & 0xF8)>>3) << 5) | ((WORD)(b & 0xF8)>>3))
#define rgb16(r, g, b) ((((WORD)(r & 0xF8)>>3) << 11) | (((WORD)(g & 0xFC)>>2) << 5) | ((WORD)(b & 0xF8)>>3))
#define rgb24(r, g, b) (((DWORD)(r & 0xFF) << 16) | ((DWORD)(g & 0xFF) << 8) | (DWORD)(b & 0xFF))
#define rgb32(r, g, b) (((DWORD)(r & 0xFF) << 16) | ((DWORD)(g & 0xFF) << 8) | (DWORD)(b & 0xFF))
 
/* Flags */
#define NOLINEAR 1
 
struct gmode {
WORD xdim;
WORD ydim;
WORD bpr;
BYTE bpp;
WORD modenum;
};
 
#include "comp.h"
 
int gd_init(WORD flags);
void gd_showinfo(void);
int gd_setmode(WORD mode);
int gd_bsetmode(WORD mode);
WORD gd_getbpr(void);
DWORD gd_getflb(void);
DWORD gd_getmem(void);
void gd_showmodeinfo(void);
int gd_modenum(WORD x, WORD y, BYTE depth);
int gd_getmodeinfo(grx_vga_modeinfo *m);
 
void Load_Write_Bank_256(BYTE bank);
 
void Seg_Off_256(WORD x, WORD y, WORD pitch, WORD *offs, WORD *seg);
void Seg_Off_Hi(WORD x, WORD y, WORD pitch, WORD *offs, WORD *seg);
 
 
void gd_getcolor(BYTE ind, BYTE *r, BYTE *g, BYTE *b);
void gd_setcolor(BYTE ind,BYTE r,BYTE g,BYTE b);
void gd_getpalette(BYTE start, BYTE num, BYTE *pal);
void gd_setpalette(BYTE start, BYTE num, BYTE *pal);
 
__END_DECLS
#endif
/shark/trunk/drivers/grx/include/drivers/glib.h
0,0 → 1,88
/*
* Project: S.Ha.R.K.
*
* Coordinators:
* Giorgio Buttazzo <giorgio@sssup.it>
* Paolo Gai <pj@gandalf.sssup.it>
*
* Authors :
* Paolo Gai <pj@gandalf.sssup.it>
* Massimiliano Giorgi <massy@gandalf.sssup.it>
* Luca Abeni <luca@gandalf.sssup.it>
* (see the web pages for full authors list)
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
*
* http://www.sssup.it
* http://retis.sssup.it
* http://shark.sssup.it
*/
 
/**
------------
CVS : $Id: glib.h,v 1.1 2003-03-24 13:26:13 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.1 $
Last update: $Date: 2003-03-24 13:26:13 $
------------
 
**/
 
/*
* Copyright (C) 2000 Luca Abeni
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
#ifndef __GLIB_H__
#define __GLIB_H__
 
#include <ll/sys/types.h>
#include <drivers/gd.h>
#include "ll/sys/cdefs.h"
 
__BEGIN_DECLS
 
int grx_init(void);
int grx_setmode(WORD mode);
int grx_close(void);
extern void (*grx_plot)(WORD x, WORD y, DWORD color);
extern DWORD (*grx_getpixel)(WORD x, WORD y);
extern void (*grx_getimage)(WORD x1, WORD y1, WORD x2, WORD y2, BYTE *img);
extern void (*grx_putimage)(WORD x1, WORD y1, WORD x2, WORD y2, BYTE *img);
extern void (*grx_box)(WORD x1, WORD y1, WORD x2, WORD y2, DWORD color);
extern void (*grx_rect)(WORD x1, WORD y1, WORD x2, WORD y2, DWORD color);
extern void (*grx_line)(WORD x1, WORD y1, WORD x2, WORD y2, DWORD color);
extern void (*grx_text)(char *text, WORD x, WORD y, DWORD fg, DWORD bg);
extern void (*grx_circle)(WORD x, WORD y, WORD r, DWORD col);
extern void (*grx_disc)(WORD x, WORD y, WORD r, DWORD col);
 
void grx_modeinfo(void);
int grx_getmode(WORD x, WORD y, BYTE depth);
void grx_cardinfo(void);
 
void grx_setcolor(BYTE ind,BYTE r,BYTE g,BYTE b);
void grx_getcolor(BYTE ind, BYTE *r, BYTE *g, BYTE *b);
void grx_setpalette(BYTE start, BYTE num, BYTE *pal);
void grx_getpalette(BYTE start, BYTE num, BYTE *pal);
 
int grx_open(WORD x, WORD y, BYTE depth);
 
void grx_clear(DWORD color);
 
__END_DECLS
#endif
/shark/trunk/drivers/grx/include/drivers/comp.h
0,0 → 1,91
/*
* Project: S.Ha.R.K.
*
* Coordinators:
* Giorgio Buttazzo <giorgio@sssup.it>
* Paolo Gai <pj@gandalf.sssup.it>
*
* Authors :
* Paolo Gai <pj@gandalf.sssup.it>
* Massimiliano Giorgi <massy@gandalf.sssup.it>
* Luca Abeni <luca@gandalf.sssup.it>
* (see the web pages for full authors list)
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
*
* http://www.sssup.it
* http://retis.sssup.it
* http://shark.sssup.it
*/
 
/**
------------
CVS : $Id: comp.h,v 1.1 2003-03-24 13:26:13 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.1 $
Last update: $Date: 2003-03-24 13:26:13 $
------------
**/
 
/*
* Copyright (C) 2000 Luca Abeni
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
 
#ifndef VGA_COMP
#define VGA_COMP
 
#ifdef __cplusplus
extern "C"
{
#endif
 
typedef struct {
int width;
int height;
int bytesperpixel;
int colors;
int linewidth; /* scanline width in bytes */
int maxlogicalwidth; /* maximum logical scanline width */
int startaddressrange; /* changeable bits set */
int maxpixels; /* video memory / bytesperpixel */
int haveblit; /* mask of blit functions available */
int flags; /* other flags */
 
/* Extended fields: */
int chiptype; /* Chiptype detected */
int memory; /* videomemory in KB */
int linewidth_unit; /* Use only a multiple of this as parameter for
set_logicalwidth and set_displaystart */
LIN_ADDR linear_aperture; /* points to mmap secondary mem aperture
of card (NULL if unavailable) */
int aperture_size; /* size of aperture in KB if size>=videomemory.
0 if unavail */
void (*set_aperture_page) (int page); /* if aperture_size<videomemory
select a memory page */
void *extensions; /* points to copy of eeprom for mach32 */
/* depends from actual driver/chiptype.. etc. */
} grx_vga_modeinfo;
 
#ifdef __cplusplus
}
 
#endif
#endif /* VGA_H */
 
/shark/trunk/drivers/grx/makefile
16,7 → 16,7
 
#vpath %.c drivers drawfun .
 
#OTHERINCL = -I$(BASE)/include/drivers
OTHERINCL = -I./include/
 
include $(BASE)/config/lib.mk