Message-ID: <3E6454E3.D29B507C@yahoo.com> From: CBFalconer <cbfalconer AT yahoo DOT com> Organization: Ched Research X-Mailer: Mozilla 4.75 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: Vesa 2.0 References: <17326N022 AT web2news DOT com> <Xns9333C01A96E16asu1cornelledu AT 132 DOT 236 DOT 56 DOT 8> <17482N497 AT web2news DOT com> <Xns9333E7234487Dasu1cornelledu AT 132 DOT 236 DOT 56 DOT 8> <17488N404 AT web2news DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 59 Date: Tue, 04 Mar 2003 08:03:50 GMT NNTP-Posting-Host: 12.90.167.41 X-Complaints-To: abuse AT worldnet DOT att DOT net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1046765030 12.90.167.41 (Tue, 04 Mar 2003 08:03:50 GMT) NNTP-Posting-Date: Tue, 04 Mar 2003 08:03:50 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Joel_S wrote: > > Huh? Here's all of the code, exactly what's in the link I gave: > #include <dpmi.h> > #include <stdlib.h> > #include <sys/movedata.h> > typedef struct VESA_PM_INFO > { > unsigned short setWindow __attribute__ ((packed)); > unsigned short setDisplayStart __attribute__ ((packed)); > unsigned short setPalette __attribute__ ((packed)); > unsigned short IOPrivInfo __attribute__ ((packed)); > } VESA_PM_INFO; > VESA_PM_INFO *vesa_pm_info; > void *pm_bank_switcher; > int get_vesa_pm_functions() > { > __dpmi_regs r; > > /* check that the driver is at least VBE version 2.0 */ > > /* call the VESA function */ > r.x.ax = 0x4F0A; > r.x.bx = 0; > __dpmi_int(0x10, &r); > if (r.h.ah) return -1; > /* allocate space for the code stubs */ > vesa_pm_info = malloc(r.x.cx); > /* copy the code into our address space */ > dosmemget(r.x.es*16+r.x.di, r.x.cx, vesa_pm_info); > /* store a pointer to the bank switch routine */ > pm_bank_switcher = (void *)((char *)vesa_pm_info + > vesa_pm_info->setWindow); > > return 0; > } > > > "Joel_S" <jbs30000 DOT news DOT invalid AT web2news DOT net> wrote in > > news:17482N497 > > @web2news.com: > > > >>> Hint: The code on that page is C, not C++. > > > >> Yes, and I'm compiling it as a C file, and not a CPP file, so do you > >> have any other advice? > > > > yes, post a minimal, compilable code sample so we can > > diagnose the problem. Don't top-post. Look at the mess above. Your original posting had an error message referencing a .cpp file, which gcc will compile as C++ unless specially instructed. Name C source files as .c. -- Chuck F (cbfalconer AT yahoo DOT com) (cbfalconer AT worldnet DOT att DOT net) Available for consulting/temporary embedded and systems. <http://cbfalconer.home.att.net> USE worldnet address!