www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1993/11/19/10:38:21

From: Paul Harness <gapa83 AT udcf DOT gla DOT ac DOT uk>
Subject: Re: Which driver for svga I should use?
To: PAWUSER AT MAIN1 DOT JINR DOT DUBNA DOT SU
Date: Fri, 19 Nov 1993 15:01:46 +0000 (GMT)
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu (djgpp)

>  So, I have one trouble:
>  I don't know which graphics driver I should use: when trying to work
>  with paradise.grd - I have bad resolution, and unfortunately all my
>  attempts to change it failed ( for example, I try to set 
> 
>     GO32=drivers ...\paradise.grd gw 800 gh 600   
> 
>  but this don't changes anything. 
>  Version, linked with -lgrx plots "black pictures on black background".
>  Would anybody help me ?
> 

I've just had the exact same problem!  The solution is to modify
djsvga.trm to use the standard colours of the 16 colour mode. This has
worked fine for me using the tseng4k and tr8900.grn drivers (on two
different machines) that come with LIBGRX and so should also work with
the paradise driver. (I found it useful to make sure that the
graphics/driver were working ok with a simple test program to draw a
line on the screen). Here is my modified djsvga.trm:-

/*____________________________________________________________________*/
/*
 * $Id: djsvga.trm%v 3.50 1993/07/09 05:35:24 woo Exp $
 */

/* GNUPLOT - djsvga.trm */
/*
 * Copyright (C) 1992
 *
 * Permission to use, copy, and distribute this software and its
 * documentation for any purpose with or without fee is hereby granted, 
 * provided that the above copyright notice appear in all copies and 
 * that both that copyright notice and this permission notice appear 
 * in supporting documentation.
 *
 * Permission to modify the software is granted, but not the right to
 * distribute the modified code.  Modifications are to be distributed 
 * as patches to released version.
 *
 * This software  is provided "as is" without express or implied warranty.
 *
 * This file is included by ../term.c.
 *
 * This terminal driver supports:
 *  svga
 *
 * AUTHORS
 *  Russell Lang
 *
 *
 * send your comments or suggestions to (info-gnuplot AT dartmouth DOT edu).
 *
 */

/* SVGA driver using DJGPP and LIBGRX */
#include <grx.h>
#include <pc.h>

int dj_startx, dj_starty;
int dj_xlast, dj_ylast;
int dj_color;

#define DJSVGA_XMAX 640
#define DJSVGA_YMAX 480

#define DJSVGA_XLAST (DJSVGA_XMAX - 1)
#define DJSVGA_YLAST (DJSVGA_YMAX - 1)

#define DJSVGA_VCHAR 16
#define DJSVGA_HCHAR 8
#define DJSVGA_VTIC 4
#define DJSVGA_HTIC 4

#define DJNUMCOLOR 15
static int dj_colors[DJNUMCOLOR] = {7,8,2,3,4,5,9,14,12,15,13,10,11,1,6};


DJSVGA_init()
{
	/* Get the screen size: */
	GrSetMode(GR_default_graphics); /* */
	dj_xlast = GrMaxX();
    	term_tbl[term].xmax = dj_xlast + 1;
	dj_ylast = GrMaxY();
    	term_tbl[term].ymax = dj_ylast + 1;
	GrSetMode(GR_default_text); /* */
}

DJSVGA_graphics()
{
	GrSetMode(GR_default_graphics);
}

DJSVGA_text()
{
	(void)getkey();
	GrSetMode(GR_default_text);
}

DJSVGA_reset()
{
int i;
	/* Free colors */
	for (i=0; i<DJNUMCOLOR; i++) {
		GrFreeColor(dj_colors[i]);
	}
}

DJSVGA_linetype(linetype)
int linetype;
{
	if (linetype >= 13)
		linetype %= 13;
	dj_color = dj_colors[linetype+2];
}

DJSVGA_move(x,y)
unsigned int x,y;
{
	dj_startx = x;
	dj_starty = y;
}


DJSVGA_vector(x,y)
unsigned int x,y;
{
	GrLine(dj_startx,dj_ylast-dj_starty,x,dj_ylast-y,dj_color);
	dj_startx = x;
	dj_starty = y;
}


DJSVGA_put_text(x,y,str)
unsigned int x, y;
char *str;
{
	GrTextXY(x,dj_ylast-y-DJSVGA_VCHAR/2,str,dj_color,GrNOCOLOR);
}

/*___________________________________________________________________*/

Good luck!

-- 
Paul Harness,                        |  Internet: gapa83 AT udcf DOT gla DOT ac DOT uk
Department of Physics and Astronomy, |
University of Glasgow,               |  Tel +44-41-339-8855 ext 8359
Glasgow, G12 8QQ, SCOTLAND.          |  Fax +44-41-334-9029

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019