Mail Archives: djgpp/2003/03/04/03:15:16
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!
- Raw text -