Mail Archives: djgpp/2000/08/13/01:01:43
Here is a little hint that might just help:
To set Mode 13h, just do
#include <dpmi.h>
void main()
{
__dpmi_regs r;
r.x.ax = 0x13;
__dpmi_int(0x10, &r);
// access video memory here through _dos_ds and proper offset;
int OffsetToBeginningOfVideoMemory = 0xA0000;
_farpokeb(_dos_ds, OffsetToBeginningOfVideoMemory, 4);
// puts char #4 at the top left corner
getch();
// go back to mode 3
r.x.ax = 0x03;
__dpmi_int(0x10, &r);
}
I think this will compile. _dos_ds is a selector to the beginning of dos
memory. You need it to get to A000:0000 (or A0000 in linear memory). All real
mode interrupts must be called with the __dpmi_int(..) function.
Check onlike help at www.delorie.com/djgpp/docs/ for more info (or in RHIDE).
The bad thing about DJGPP is that there are no far pts hence the need for the
far functions. But it is still good.
Hope some of this helps,
Adam
yidaki wrote:
> Im trying to learn gfx programming in c++ but with no actual result...
> I know streams arrays and all of the basic programming but when i see a gfx
> tutorial i see all these strange words and calls ive never seen before.
> theres several links to gfx tutorial but setting mode 13 doesnt work.
> i take the example code and try to compile it with gpp but the compiler
> complains about _ax* and such not being initiated. im no expert but i
> believe thats a call to a lib i dont have or something like that. please
> help me...
>
> Robin
>
> www.robinoberg.com
- Raw text -