www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/08/07/21:15:21

From: Damian Yerrick <Bullcr_pd_yerrick AT hotmail DOT comRemoveBullcr_p>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: set_gfx_mode doesn´t work!! (in Spanish)
Organization: Pin Eight Software http://pineight.8m.com/
Message-ID: <timuos881a8v4lmkes0s9bevcngbggai1h@4ax.com>
References: <PmHj5.4089$X84 DOT 17473 AT telenews DOT teleline DOT es>
X-Newsreader: Forte Agent 1.7/32.534
MIME-Version: 1.0
Lines: 151
X-Trace: /w/FGpl3ERNXgaQO8c/3o40eXUtcui3VsYUKx0NdAopgg0frNWzY62sGJ6gfxfjKs84HrRm1/SQp!VHlfQi6W+zH/Ogx1PAlG282TXuKSzW+3Md6dyB40CAzCyvvknkqdjfChiQNsRx2dLY4gKRf/QZZk!s+QNuA==
X-Complaints-To: abuse AT gte DOT net
X-Abuse-Info: Please be sure to forward a copy of ALL headers
X-Abuse-Info: Otherwise we will be unable to process your complaint properly
NNTP-Posting-Date: Tue, 08 Aug 2000 01:06:32 GMT
Distribution: world
Date: Tue, 08 Aug 2000 01:06:32 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

On Mon, 07 Aug 2000 23:11:43 GMT, "Carlos Alfredo Barahona FrenÁNdez"
<CARLOSABF AT terra DOT es> wrote:

>Hola ,me llamo Carlos Barahona y estoy trabajando en mi proyecto de final de
>carrera utilizando DJGPP y Allegro, en MS-DOS.
>Yo creo que mi instalación del DJGPP está correctamente realizada,ya que he
>realizado algun programa ejemplo y me lo ha compilado y ejecutado bien.El
>problema viene cuando llamo a la función set_gfx_mode de Allegro, cuando la
>ejecuto me da un error de Desbordamiento de División, entonces el Rhide se
>deja de ejecutar y no puedo hacer ni un simple dir /p porque el ordenador se
>queda colgado.He seguido la traza del programa y he llegado al punto donde
>me falla,y siempre es en el mismo sitio, en la linea número 88 del archivo
>vga.c.

What the OP means is:

Hello, my name is Carlos Barahona and I am working on my Final Project
using DJGPP and Allegro, in DOS.  I believe that DJGPP is installed
correctly, since I have compiled Hello World and run it.

Problem: When I call Allegro's set_gfx_mode(), it gives me a divide
overflow error, then RHIDE quits and I can't even `dir /p' because the
computer freezes(?). I've traced the program, and I've arrived at the
point where it fails to me, and always is in the same point, in line
88 of file vga.c.

Powered by Systran at http://translator.go.com/

>A continuación está el codigo de  mi programa:

Source code snippet follows:

>void main(void){
>int eleccion,color=0;
>PALETTE defecto;
>allegro_init();
>eleccion='0'&0xFF;
>
>while((eleccion=='1'&0xFF) || (eleccion=='0'&0xFF))
>  {
>   install_keyboard();
>   printf("\n\nVAMOS A CAMBIAR EL MODO GRµFICO ...\n\n");
                LET'S CHANGE THE GRAPHICS MODE...
>   printf("\nQue modo desea poner:\n\t\t0->Modo Texto\n\t\t1->Modo
>13\n\t\tCualquiera->Salir\n\t\t");
              What mode do you want to set?  0->Text Mode  1->Mode 13h
         Whatever->Leave
>   eleccion=readkey();
>   if((eleccion & 0xff)=='0')
>        modo_texto();
>     else if((eleccion & 0xff)=='1')
>             modo_13();
>   else
>     {
>  modo_texto();
>  allegro_exit();
>     }
>  }
>}
>END_OF_MAIN();
>void modo_texto(void)
>{
>int error=0;
>error=set_gfx_mode(GFX_TEXT,0,0,0,0);
>if(error==-1)
>  {
>  printf("\nNO SE HA PODIDO PONER EL MODO TEXTO\n");
             COULDN'T SET TEXT MODE
>  remove_keyboard();
>  }
>else
>    {
>    remove_keyboard();
>    printf("\nSE HA PUESTO CON EXITO EL MODO TEXTO\n");
               COULD SUCCESSFULLY SET TEXT MODE
>    }
>getch();
>clrscr();
>}
>
>void modo_13(void)
>{
>int error=0,onda=0,opval=0,i=0,j=0;
>PALETTE defecto;
>error=set_gfx_mode(GFX_VGA,320,200,0,0);//Here it crashes
>if(error==-1)
>  {
>  printf("\nNO SE HA PODIDO PONER EL MODO 13\n");
             COULDN'T SET MODE 13h
>  remove_keyboard();
>  }
>else
>    {
>
>Y ahora el trozo de codigo de las Allegro donde falla:

And now the piece of Allegro code where it fails:

>   if ((w == 320) && (h == 200) && (v_w <= 320) && (v_h <= 200)) {
>      /* standard mode 13h */
>      b = _make_bitmap(320, 200, 0xA0000, &gfx_vga, 8, 320);
>      if (!b)
>  return NULL;
>
>      r.x.ax = 0x13;
>      __dpmi_int(0x10, &r);//Here it crashes
>
>
>He intentado recompilar las Allegro tal y como lo explicaba un FAQ:

I have tried to recompile Allegro so and as it explained a FAQ:

>" Note: if the crash happens deep inside an Allegro function, this traceback
>may not be so useful. When this happens you can recompile Allegro with
>debugging information (in your Allegro directory, run "make clean", "set
>DEBUGMODE=1", and "make install", but note that this requires the GNU
>fileutils package to be installed), and then recompile your program to use
>the debugging library. Don't forget to rebuild a normal Allegro version (as
>above, but "set DEBUGMODE=") when you are done, because the debugging lib is
>very slow. "
>
>Y los resultados son los mismos.
>
>Mi ordenador es un Pentium 200 MMX con 1 Mega de targeta gráfica

Halfway decent CPU with crappy graphics card

>los dos ficheros adjuntos infogfx.txt, infogfx2.txt
>son los resultados de ejecutar
>el programa vesainfo y vesainfo -v respectivamente.

vesainfo > infogfx.txt
vesainfo -v > infogfx2.txt

>Por curiosidad,instalé DJGPP y Allegro en Windows-95 y he comprobado que el
>mismo programa que en MS-DOS no funcionaba, (he probado tanto ejemplos de
>Allegro,como distintos programas hechos por mi con Allegro), si que lo hace
>en Windows 95.

Out of curiosity, I installed DJGPP and Allegro in Windows 95 and have
verified that the same program that bombed in DOS (I have proven as
much examples of Allegro, as different programs done by my with
Allegro), if that does in Windows 95.

-- 
Damian Yerrick
"I refuse to listen to those who refuse to listen to reason."
See the whole sig: http://www.rose-hulman.edu/~yerricde/sig.html

This is McAfee VirusScan. Add these two lines to your signature to
prevent the spread of signature viruses.  http://www.mcafee.com/

- Raw text -


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