From: "Carlos Alfredo Barahona FrenÁNdez" Newsgroups: comp.os.msdos.djgpp Subject: Problems with Allegro Lines: 101 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Message-ID: Date: Sun, 30 Jul 2000 21:51:08 GMT NNTP-Posting-Host: 213.4.238.216 X-Complaints-To: usenet AT teleline DOT es X-Trace: telenews.teleline.es 964993868 213.4.238.216 (Sun, 30 Jul 2000 23:51:08 MET DST) NNTP-Posting-Date: Sun, 30 Jul 2000 23:51:08 MET DST Organization: Clientes_Teleline To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com 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: 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. Here is a piece of my code: 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"); 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 if(error==-1) { printf("\nNO SE HA PODIDO PONER EL MODO 13\n"); remove_keyboard(); } else { And here the piece of code where it crashes(inside Allegro´s code): 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 I have recompile Allegro as the FAQ says: 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. And i have the same results.I don´t know why it always crashes. Sorry for my bad English(i have forgotten it as you can read) Carlos Barahona.(Spain).