From: eglebbk AT dds DOT nl (Evert Glebbeek) Newsgroups: comp.os.msdos.djgpp Subject: Re: Problems with Allegro Date: Mon, 31 Jul 2000 00:06:30 GMT Organization: Physics student, University of Amsterdam Lines: 79 Distribution: world Message-ID: <3984bd90.50939536@news.wins.uva.nl> References: NNTP-Posting-Host: stol-117-205.uva.studentennet.nl X-Trace: info.wins.uva.nl 965001870 14684 145.98.117.205 (31 Jul 2000 00:04:30 GMT) X-Complaints-To: usenet AT science DOT uva DOT nl NNTP-Posting-Date: Mon, 31 Jul 2000 00:04:30 +0000 (UTC) X-Newsreader: Forte Free Agent 1.11/32.235 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Newsgroup: comp.os.msdos.djgpp From: "Carlos Alfredo Barahona FrenÁNdez" On Sun, 30 Jul 2000 21:51:08 GMT >Hi, my name is Carlos Barahona,i´m working in my final career´s project and >i´m using DJGPP with ALLEGRO libraries, and i´m in a trouble: Which versions? >I´m using a Pentium 200 MMX with a 1M video card,and i´m working on MS-DOS, >and when i compile and run an Allegro´s program i have a Segmentation >Fault.It happens inside Allegro code, always in set_gfx_mode, i have >followed the trace and i when i arrive to 88th line in vga.c file, it >crashes. Only for mode 13h, or also for text mode? > >Here is a piece of my code: Post the smallest sampleprogram that reproduces the error instead. That way, other people can run it and try to reproduce your problem. >void main(void){ should be int main >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"); > printf("\nQue modo desea poner:\n\t\t0->Modo Texto\n\t\t1->Modo >13\n\t\tCualquiera->Salir\n\t\t"); > 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"); > remove_keyboard(); > } >else > { > remove_keyboard(); > printf("\nSE HA PUESTO CON EXITO EL MODO TEXTO\n"); > } >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 Looks fine to me. > r.x.ax = 0x13; > __dpmi_int(0x10, &r);//Here it crashes Strange to say the least. It sounds to me like you're dealing with corrupted memory, but without seeing all of your code, I can't say for sure. >Sorry for my bad English(i have forgotten it as you can read) Quite alright. Feel free to post in Spanish if you prefer to do so. Most posts in non-english languages get answered anyway. Regards, Evert Glebbeek