www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1993/04/30/10:57:39

Date: Fri, 30 Apr 1993 17:19:50 +0200
Conversion: Prohibited
From: <phc27 AT rz DOT uni-kiel DOT dbp DOT de>
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: Error in testing BCC2GRX library

Hi,

there is a problem with BCC2GRX v1.0 if you are using an old style (.grd)
graphics driver. Since the library couldn't set up the available modes,
an error is returned.

Replace the old bccgrx.c/__gr_set_up_modes() by the following code :

/* --------------------------------------------------- */
void __gr_set_up_modes(void)
{
  static int DidSetup = FALSE;
  GR_DRIVER_MODE_ENTRY *tm, *gm;
  int mode;

  if ( DidSetup || __gr_Mode < 0) return;
  DidSetup = TRUE;
  MM = -1;

  GrGetDriverModes(&tm, &__gr_DATA);
  if (__gr_DATA == NULL) {
    __gr_modeindx = (short *) malloc(sizeof(short));
    if (__gr_modeindx == NULL) {
      ERR = grError;
      return;
    }
    __gr_modeindx[0] = -1;  /* GR_default_graphics */
    MM = 0;
    return;
  }
  gm = __gr_DATA;
  mode = 1;
  while (gm->width != 0) {
    if (gm->BIOS_mode != 0xFF)
      ++mode;
    gm += 1;
  }
  __gr_modeindx = (short *) malloc(sizeof(short) * mode);
  if (__gr_modeindx == NULL) {
    ERR = grError;
    return;
  }
  gm = __gr_DATA;
  __gr_modeindx[0] = -1;  /* GR_default_graphics */
  mode = 1;
  while (gm->width != 0) {
    if (gm->BIOS_mode != 0xFF)
      __gr_modeindx[mode++] = gm-__gr_DATA;
    gm += 1;
  }
  MM = mode - 1;
}
/* --------------------------------------------------- */

Recompile the BCC2GRX (just type make in the src directory)

This new routined fixed the problem on my system.
Note that you should use the new style drivers (.grn) for
full featured performance.

If there are still problems with the demo programs, try using the
stdega.grn or stdvga.grn . There may be a serious problem in the
BCC2GRX library if you can't get the demos running with the standard
drivers. Please tell me about ...

(Wankoo, every thing ok now ?)

Hartmut



- Raw text -


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