From: "Michael Stewart" Newsgroups: comp.os.msdos.djgpp Subject: Re: more problems settings the correct mode Date: Tue, 30 Mar 1999 19:09:40 +0100 Organization: Customer of Planet Online Lines: 49 Message-ID: <7dr52l$l90$1@news4.svr.pol.co.uk> References: <36F8F860 DOT 5E2F109F AT iocc DOT com> <36F9B4AD DOT A5FE0B52 AT iocc DOT com> NNTP-Posting-Host: modem-20.germanium.dialup.pol.co.uk X-Trace: news4.svr.pol.co.uk 922818453 21792 62.136.15.148 (30 Mar 1999 18:27:33 GMT) NNTP-Posting-Date: 30 Mar 1999 18:27:33 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 ... >Mode 0x76 : 640x480 32 bpp direct color (RGB 888) Don't hardcode the mode numbers into your program. From VESA 2 and above there is no guarantee that the mode numbers will refer to the same resolution and colour depth. >seeing the mode numbers off to the left side, i also tried ot use the old >setmode function i was using before i had allegro. the call to the funciton >in my code looks liek this: >setmode(0x111); >here is the code for the function, which requires either the header >file or the file (not sure which) >void setmode(int mode) >{ > __dpmi_regs r; > > r.x.ax = mode; > __dpmi_int (0x10,&r); >} > This won't work. You're trying to set a VESA mode with a VGA mode set routine. You need something a little different : bool VESA_set_mode (int mode) { __dpmi_regs r; r.x.ax = 0x4F02; // VESA set mode function r.x.bx = mode; __dpmi_int (0x10, &r); if (r.h.ah) return (false); // An error setting the mode has occured return (true); } This is the minimum you need to set the VESA mode. If you need some more sample VESA code then take a look at the Allegro source, or email me direct and I'll send you some. Michael Stewart mike AT reggin DOT freeserve DOT co DOT uk "Just because you're paraniod doesn't mean they aren't after you..."