A
Alan Brown
Subject: Setting Pointer to Video memory
Newsgroups: Optus:comp.lang.c++.moderated
Hi People,
[Sorry for the cross-posting - my post seems not to have reached the other
group.]
I am trying to create a Help Screen in a program. I want to swap out the
video memory, use the screen, then swap back the original contents of the
screen.
The following is the relevant parts of a program that works -
---------------------------------------------------------
#include <dos.h>;
#include <conio.h>;
...
...
...
struct Scrn // struct for Screen memory
{
char n[4000];
};
...
...
...
void ScreenSwap() // Test swapping windows
{
ShowHeader("Screen Swapping");
int i;
Scrn dest;
for (i=0; i<4000; i++) // Write out Video memory to structure
{
dest.n = peekb(0xb800, 0000 + i);
}
getch(); // Pause...
textcolor(LIGHTRED); // Clear Screen to different colors
textbackground(BLACK);
clrscr();
getch(); // Pause...
for (i=0; i<4000; i++) // Read back from structure into Video memory
{
pokeb(0xb800, 0000 + i, dest.n);
}
getch();
}
...
...
...
---------------------------------------------------------
The above works. But I want to use 'memcopy' or 'memmove' instead. But I
am not able to set a pointer to an absolute address such as 0xB8000000.
If it is possible to do this I would be grateful if someone could help me
please.
Alan
Newsgroups: Optus:comp.lang.c++.moderated
Hi People,
[Sorry for the cross-posting - my post seems not to have reached the other
group.]
I am trying to create a Help Screen in a program. I want to swap out the
video memory, use the screen, then swap back the original contents of the
screen.
The following is the relevant parts of a program that works -
---------------------------------------------------------
#include <dos.h>;
#include <conio.h>;
...
...
...
struct Scrn // struct for Screen memory
{
char n[4000];
};
...
...
...
void ScreenSwap() // Test swapping windows
{
ShowHeader("Screen Swapping");
int i;
Scrn dest;
for (i=0; i<4000; i++) // Write out Video memory to structure
{
dest.n = peekb(0xb800, 0000 + i);
}
getch(); // Pause...
textcolor(LIGHTRED); // Clear Screen to different colors
textbackground(BLACK);
clrscr();
getch(); // Pause...
for (i=0; i<4000; i++) // Read back from structure into Video memory
{
pokeb(0xb800, 0000 + i, dest.n);
}
getch();
}
...
...
...
---------------------------------------------------------
The above works. But I want to use 'memcopy' or 'memmove' instead. But I
am not able to set a pointer to an absolute address such as 0xB8000000.
If it is possible to do this I would be grateful if someone could help me
please.
Alan