Only for mode 0x13h which is 320x200 8-bit. EGA and some CGA are mapped to B800:0000
Not realy Bubba , all graphic modes, in mcga,ega vga are in 0xa000:0000
0xB800 is to text modes only
Now... i have tested some other colors, and i dont see the light.
do not worry this is only an exercise
and if I could take this function of my brain, not copy & paste
for mode 0x12 680x480x16 planar mode,
I also get there in mode 0x101,later
Code:
/*
*** vbeMemCpy(...) ***
copy pixels one by one to all four planes
first to call this function
you may set
far Pointer to destination memory *dst
reserv buf where store the image *src
Set WriteMode to 3
MapMask Register to all four planes outpw(0x3c4,0x0f02)
BitMapRegister to all 8 bits outpw(0x3ce,0xff08)
set index reg to SetReset register outp(0x3ce ,0)
now
SetReset define de color outp(0x3f,*src++)
and cpu data define the index pixel *dst=i
*/
void vbeMemCpy(unsigned char far*src,unsigned char far*dst,unsigned int x,unsigned x1,unsigned int len){
unsigned char tmp;
unsigned char i,i1;
i=(0x80>>(x1&0x07)); // i= what pixel in the first 8 dst pixels?
i1=x&0x01; // i1=what pixel in the first 2 src pixels
if(i1)tmp=*src&0x0f;else tmp=*src>>4;
while(len--){
outp(0x3cf,tmp); //SetReset set color
tmp=*dst; // upload the latches
*dst=i; //set this bit in all 4 planes
i=(i>>1); // next pixel
i1++;
if(i==0){ i=0x80;dst++; }
if(i1&0x01)tmp=*src&0x0f;else{ src++;tmp=*src>>4;}
}
}