From: Ludvig Larsson Newsgroups: comp.os.msdos.djgpp Subject: The First __dpmi_int in prog doesn't work! Date: Wed, 17 Dec 1997 14:09:18 +0100 Organization: Hey!! Lines: 69 Message-ID: <3497CEFE.1112@club-internet.fr> Reply-To: ludvig AT club-internet DOT fr NNTP-Posting-Host: ppp-135-38.romans.club-internet.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Hi everybody! Back after moving to a new town, with new questions! I am building a graphic interface that I will use in my game one day and I'v run into a strange problem. First I sometimes got really strange problems with the graphic initialisation(I'm using 640x480x65536colors), sometimes it's a lot of graphics,trash, on top of the graphic screen(like 80-90% of the screen is covered), I can write and read on vram and everything works perfect exept that images and stuff only can be seen in the holes between all this strange stuff that is covering screen. No graphic operation is actually interfered with, if I make a get_bitmap from a blank screen(blank or blanc, all this wierd stuff is there anyway) i get a bitmap that is actually blank. So, I changed my code, if I push the Q-button, the graphic is reinstalled and that works perfectly. I start tha game, only shit on the screen, I push "q" and everything goes normal. *huh*. Aha! I tried to initialize the graphic twice in the beginning of the program, three four times, doesn't work. Have to push the "q" button to get the graphics right. But! Then i changed place of the init_mouse(that was just after the init_graph) and init_graph; No more problems!! That was what I thought. Now, every time I start the game the first time when I have switched the computer on, I got no mouse. I quit(ctrl alt del) restart the program and everything works perfect. It's like the computer don't like the first interruptcall. What is wrong? I'm using __dpmi_int with __dpmi_regs reg; like: int setmode(short mode) { int ret; __dpmi_regs reg; __dpmi_meminfo mi; int vesa_err; reg.h.ah=0x4f; reg.h.al=0x02; reg.h.bl=mode; if(mode>255) reg.h.bh=1; else reg.h.bl=0; __dpmi_int(0x10, ®); ret=reg.h.ah; return(ret); } And it's actually working, if it isn't the first interrupt the program launches. I'm working under windows, actually, the graphic problems tended to be worse when I had a 'short-cut' to the .exe. Any guesses? BTW when I started building this package I almost never got these wierd screens, but I haven't changed the code to make the initialisations. So, If anyone have a guess, please send me a mail!!