www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/12/25/22:39:43

Message-ID: <3865011F.C5F7DE64@sgi.net>
From: John & Susie <jdk AT sgi DOT net>
X-Mailer: Mozilla 4.5 [en] (WinNT; I)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Rhide wierdness ??
Lines: 121
Date: Sat, 25 Dec 1999 12:38:39 -0500
NNTP-Posting-Host: 209.166.131.130
X-Complaints-To: abuse AT stargate DOT net
X-Trace: news.sgi.net 946143553 209.166.131.130 (Sat, 25 Dec 1999 12:39:13 EST)
NNTP-Posting-Date: Sat, 25 Dec 1999 12:39:13 EST
Organization: Stargate Industries, LLC
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I have a problem using Rhide version 1.4 running in DOS 6.22, but I'm
not sure if its Rhide or my program:

1. Running an executable (named g80.exe) from the command line (compiled
with no errors in Rhide) runs fine when the comp is initially booted
into DOS.

2. Running g80.exe inside Rhide stops with an error.

3. Exiting Rhide and re-running g80.exe from the command line stops with
the following error:


Error loading helv22b.dat!
 
Exiting due to signal SIGSEGV
Page fault at eip=000016b3, error=0004
eax=00000000 ebx=00001000 ecx=00000000 edx=00000035 esi=000025c5
edi=000dd16e
ebp=000dd120 esp=000dd118 program=C:\DJGPP\BP\G80.EXE
cs: sel=00a7  base=10000000  limit=000effff
ds: sel=00af  base=10000000  limit=000effff
es: sel=00af  base=10000000  limit=000effff
fs: sel=008f  base=00029a80  limit=0000ffff
gs: sel=00bf  base=00000000  limit=0010ffff
ss: sel=00af  base=10000000  limit=000effff
App stack: [000dd2c4..0005d2c4]  Exceptn stack: [0005d1a4..0005b264]
 
Call frame traceback EIPs:
  0x000016b3   _MouseOFF+11, line 43 of g80.c
  0x000025e7   _ProgramExit+31, line 122 of g80.c
  0x00009909   _main+41, line 1479 of g80.c
  0x00039972   ___crt1_startup+174

C:\DJGPP\BP>symify -o error.txt g80.exe


4. *After using symify* (to obtain the above core dump) g80.exe now runs
fine from the command line!


The referenced font file *is* present in the same directory as g80.exe.
I have no idea where to start on this one?


The function that loads the font file starts out like this:


OBJECT_TYPE *SetUpGraphics(void)
{
  /** temporary vars for calculating object size & screen placement */
 int x, y, x2, y2, n, nn, len, ht, len2, ht2, text_win_ht;

/***  Taken from one of Shawn's Allegro examples for loading a font
********/
   char buf1[80],
/********************************************************************/

       /** mouse button labels **/
        button_text[NUM_BUTTONS][10] = { "Filer",   "BD off",
                                         "Redraw",  "Zoom",
                                         "Unzoom",  "Rapid off",
                                         "NCode",   "TNR",     
                                         "Exit"
                                        };

   /** predefined object call back functions **/
   int (*func[NUM_BUTTONS])(OBJECT_TYPE *) =
       { Filer,SetBDflag,Redraw,Zoom,Unzoom,SetRapidFlag,
         SetNCodeFlag,InputTNR,UserExit
       };

    
   /** int to float conversion temps for even button spacing **/
   float f1,f2,f3,f4;
  

   
   /** Problem could be here, pointers to these two vars are used
throuout the program
       as globals. I'm assuming *static* vars persist even after this
function exits? **/

   static int mouse_status,font_ht;

    
   /** graphics objects for program startup **/
   OBJECT_TYPE *mouse_button[TOTAL_BUTTONS], /* clickable   */
               *text_window,           /*  non-clickable...   */
               *graphics_window,
               *mouselocbar, *mouseloc[2], *logo;


/**********   Also from one of Shawn's examples 
************************/
   char font_file[] = { "helv22b.dat" }; /* Big font for 1024 or 1280
screen */
/********************************************************************/


   /** Predefined (via include files) for mouse and object tracking. */
   LOCK_FUNCTION(MouseTrap);   /* trap a click on an object */
   LOCK_FUNCTION(FindMouse);   /* locate mouse vs. object   */
   LOCK_FUNCTION(MouseTrack);  /* mouse coordinate display  */
   LOCK_FUNCTION(TagSearch);   /* object address locator    */

   
/******  Here is where it fails in Rhide but not the command line? 
**********/
   /* Load the datafile. */
   strcpy(get_filename(buf1),font_file);
   datafile = load_datafile(buf1);
   if (!datafile) {
      allegro_exit();
      printf("Error loading %s!\n\n",font_file);
      return NULL;
   }
/********************************************************************/


...

- Raw text -


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