From: "Ben Davis" Newsgroups: comp.os.msdos.djgpp Subject: spawn*() functions with Allegro Date: Thu, 20 Apr 2000 23:41:51 +0100 Organization: Customer of Planet Online Lines: 52 Message-ID: <8do17k$eq9$1@news6.svr.pol.co.uk> NNTP-Posting-Host: modem-61.uranium.dialup.pol.co.uk X-Trace: news6.svr.pol.co.uk 956270644 15177 62.136.65.189 (20 Apr 2000 22:44:04 GMT) NNTP-Posting-Date: 20 Apr 2000 22:44:04 GMT X-Complaints-To: abuse AT theplanet DOT net X-Newsreader: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com I'm writing an editor for my game, Rock 'n' Spin. I designed Rock 'n' Spin so that if you type ROCKSPIN USERLVL it will let you test a level called USERLVL (saved as LEVELS\USERLVL.LVL), and I'm trying to take advantage of this in the editor. Both the game and the editor use DJGPP and Allegro 3.12. The sequence I'm using to invoke the game is as follows: allegro_exit(); spawnl(P_WAIT,"ROCKSPIN","ROCKSPIN",level->n,0); /* where level->n[9] is an array containing the level's name */ allegro_init(); /* reinstall timer, keyboard, mouse */ /* set gfx mode again, and redraw screen */ I'm not destroying and recreating/reloading the bitmaps and datafiles used by the editor. Should I be doing? It always invokes the game correctly, and the level can be tested. But as soon as I exit the game and try to resume in the editor, I have problems. Any of the following may happen: 1. It works (unusual). 2. The game displays a DPMI-style crash, and then the editor resumes. I tried to get it to stay on the screen (by running RHIDE, changing the source and recompiling), but then it worked! How typical. If I run the game by itself, with the same command line, it works. These results seem repeatable (as long as I don't run another program or restart Windows or anything). 3. Windows says "illegal operation". 4. The program freezes, but I can still press Alt+Esc and close it. 5. The whole computer freezes. 6. The computer resets itself. This is on a Windows 95 system, Pentium 233. The editor is invoked either by a DOS box, or by RHIDE. It seems to have the same problems either way. Has anyone had the same problems? Does anyone know what's wrong? Do I need to exit Allegro before calling spawnl()? If I'm exiting Allegro and re-initialising it, do I need to destroy and recreate/reload bitmaps? What about datafiles (containing palettes, fonts and bitmaps)? I'd be grateful for any help. Ben Davis PS Check out Rock 'n' Spin at http://members.tripod.co.uk/rocknspin/