Thread: No acess to the video memory????

  1. #16
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    under DOS video memory is memory mapped to A000:0000 IIRC

  2. #17
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    under DOS video memory is memory mapped to A000:0000 IIRC
    Only for mode 0x13h which is 320x200 8-bit. EGA and some CGA are mapped to B800:0000 AFAIK and most VBE modes are mapped in a different manner.

  3. #18
    Registered User
    Join Date
    Oct 2009


    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

    								*** 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)
    		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;
    			 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
    			 if(i==0){ i=0x80;dst++; }
    			 if(i1&0x01)tmp=*src&0x0f;else{ src++;tmp=*src>>4;}
    Last edited by joseCarlos; 10-29-2009 at 08:52 AM. Reason: add comment

  4. #19
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Plano, Texas, United States
    you cannot use the LFB without a DOS extender
    Just out of curiosity, Bubba, what do you mean by that? I've never heard the term "DOS extender" before.

    Do you just mean that you need a compiler that can compile to DOS?

    Every once in awhile I open up my old 13h graphics programs and recompile them and run them. I do it under Borland C++ 5.02 which is the IDE I developed them all on, and it compiles to DOS. I haven't tried doing it with Visual Studio or gcc...but I should try. I would need to change all the assembly code (which isn't that much honestly) to be in gcc's assembly format rather than Borland's.
    My Website

    "Circular logic is good because it is."

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. tools for finding memory leaks
    By stanlvw in forum C++ Programming
    Replies: 4
    Last Post: 04-03-2009, 11:41 AM
  2. Help with insert/delete binary search tree
    By Nazgulled in forum C Programming
    Replies: 39
    Last Post: 03-25-2009, 04:24 PM
  3. Problems with shared memory shmdt() shmctl()
    By Jcarroll in forum C Programming
    Replies: 1
    Last Post: 03-17-2009, 10:48 PM
  4. pointers
    By InvariantLoop in forum C Programming
    Replies: 13
    Last Post: 02-04-2005, 09:32 AM
  5. Onboard video card memory access
    By HermioneFan in forum Game Programming
    Replies: 1
    Last Post: 05-28-2003, 09:53 AM