www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/04/12/22:20:59

From: Dan Nelson <dnelson AT xnet DOT com>
Subject: Re: port borland to djgpp
To: djgpp AT sun DOT soe DOT clarkson DOT edu (djgpp)
Date: Wed, 12 Apr 1995 20:23:11 -0500 (CDT)

in the last episode, Mark Mathews said:
> 
> I' currently porting a Borland program called WADVIEW ( for DOOM) and I ran
> into several Borland Functions that have no DJGPP equivalents. Can
> somebody help me with the following:

Side note:  a new version of DEU has just been released.  Edit Doom, 
Doom ][, and Heretic levels!

> getvect, and setvect              <DOS.H>

Try to code around these.  A WAD viewer should not have to hook interrupts.

> poke, pokeb                       <DOS.H>
>   FP_OFF, FP_SEG, and MK_FP macros        <DOS.H>

I'm assuming the program is trying to do some low-level DOS suff here; maybe
updating the graphics screen directly?  If you can, use a graphics library
like libgrx.  Otherwise, study <farptr.h> and good luck.

> setmem                             <mem.H>
> Declaration:  void setmem(void *dest, unsigned length, char value);

use memset(char* dest,char val,int length).

>  
>  
> ltoa, ultoa               <STDLIB.H>
>  
>  - ltoa converts a long to a string
>  - ultoa converts an unsigned long to a string

use sprintf.

> getcurdir                          <DIR.H>
> Gets current directory for specified drive.

There is a similar function for djgpp called getcwd I believe, but it
returns the current drive also.  To find current directory on a specific
drive letter D:, do a chdir("D:"), then a getcwd.

> getftime, setftime                 <IO.H>
>  
> Gets or sets file date and time

Hmm.  According to the man pages, these exist.  I'm not on a DOS machine, so
I can't tell for sure.  If they don't, use stat()/utime() for reading and
writing.

> filelength                         <IO.H>
>  Declaration:  long filelength(int handle);

use stat().


-Dan Nelson       //      /\ /\/\ | (_, /\   Some people think MS-DOS is a
                \X/                          necessary evil.  They are wrong. 
dnelson AT xnet DOT com     dan AT nccseq DOT noctrl DOT edu   MS-DOS is *not* necessary.

- Raw text -


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