www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/04/25/04:45:19

Date: Thu, 25 Apr 1996 10:57:37 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: dunder <dunder AT nyongwa DOT montreal DOT qc DOT ca>
Cc: djgpp AT delorie DOT com
Subject: Re: V2 = hmmm
In-Reply-To: <Pine.LNX.3.91.960423135047.16701A-100000@noether.nyongwa.montreal.qc.ca>
Message-Id: <Pine.SUN.3.91.960425104335.23363N-100000@is>
Mime-Version: 1.0

On Tue, 23 Apr 1996, dunder wrote:

>   if(option_nb < 5)
>   {
>    int pos_y = (option_nb * 3) + 4;
>    gotoxy(1,1);
>         ScreenPrimary[pos_y * 80 + 31] =
>           ((ScreenPrimary[pos_y * 80 + 31] & (0x00FF)) | 0x7C00);
> 
> rooedit.cc:136: invalid types `long unsigned int[int]' for array subscript

`ScreenPrimary' is not an array, it's a number!  You cannot index into it
in v2.0!  You should instead use it in calls to functions such as
`dosmemput' that accept linear addresses (which is what `ScreenPrimary'
is).  If you want to access the screen directly with the ``nearptr'' 
facility, you should generate a pointer to short using the value of 
`ScreenPrimary' and then index into that pointer.  For an example, see 
the section on `__djgpp_nearptr_enable' in the on-line docs of the C 
library.

> I also had to add a #include "c:\djgpp\src\libc\co80\sc.h" in order for 
> GCC to be able to actually recognise the variable ScreenPrimary (which 
> now point to some other structure..)

That's not the correct way to do this.  You should include <pc.h> that 
defines ScreenPrimary.

> Well it didn't have to have a DPMI host. Although DJGPP may come with 
> one, writing any commercial, or even shareware programs that require a 
> special driver is somehow tricky. Salvation for Windows users but DOS 
> users will bark!

No they won't.  Look at the games: almost every one of them comes with 
such an external program, and nobody complains.  The latest and hottest 
QUAKE (a successor to DOOM) is compiled with DJGPP and comes with 
CWSDPMI, so apparently not everyone barks on it.

> Yep, as stated I would, I read the FAQ. But the problem was with 
> Smartdrive which ate 2.5M of my memory ;) 

Too much for a 8MB machine.  And if you run under Win95 (do you?) what do 
you need SmartDrive for anyway?

> DPMI memory available: 5420 Kb
> DPMI swap space available: 2556 Kb
> 
> and I setted the DOS Box to 16M which as far as I could set.

That is too low amount of swap space.  Please read section 15.8 of the
FAQ; it tells you to set the EMS and XMS memory to -1 on the PIF file for
the DOS box, so that Windows will let you use all the virtual memory it 
can get.

For Win95, you should set the DPMI memory on the DOS box property sheet 
to 65535K (not Auto!), for Win95 to let you use maximum virtual memory.

- Raw text -


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