delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/04/29/17:46:50

From: Shawn Hargreaves <Shawn AT talula DOT demon DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: What is wrong with this?
Date: Wed, 29 Apr 1998 20:18:22 +0100
Organization: None
Message-ID: <Eg8LYAA+z3R1Ew3b@talula.demon.co.uk>
References: <6i7002$2ka$1 AT news DOT metronet DOT de>
NNTP-Posting-Host: talula.demon.co.uk
MIME-Version: 1.0
Lines: 28
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Lennart Marien writes:
>I try to change the pallette in VESA Mode 101h(640x480x256), using the
>Interrupt number 0x10:

>int *sel;
>int seg;
>
>seg=__dpmi_allocate_dos_memory((768+15)>>4,sel);

You aren't initialising your sel pointer, so the return value from
__dpmi_allocate_dos_memory() will be stored at some random address. You
should declare it as a normal int, and then pass &sel to the DPMI
function.

Better suggestion: instead of allocating your own conventional memory
region, use the transfer buffer that is already being maintained by the
djgpp libc. See the djgpp FAQ section 18.2 for details.

Even better suggestion: don't bother to call the BIOS at all. Instead,
write the index of the color you want to change to port 0x3C8, and then
three color values (r, g, and b, range 0-63), to port 0x3C9. See the
DJGPP User's Guide on www.delorie.com for more information and example
code.


--
Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
"Pigs use it for a tambourine" - Frank Zappa

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019