C Board  

Go Back   C Board > General Programming Boards > Game Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 10-28-2009, 10:28 PM   #16
Rampaging 35 Stone Welsh
 
abachler's Avatar
 
Join Date: Apr 2007
Posts: 2,929
under DOS video memory is memory mapped to A000:0000 IIRC
__________________
He is free, you say. Ah! That is his misfortune… These men… [have] the most terrible, the most imperious of masters, that is, need. … They must therefore find someone to hire them, or die of hunger. Is that to be free? - Simon Linguet
abachler is offline   Reply With Quote
Old 10-28-2009, 10:45 PM   #17
Super Moderator
 
Bubba's Avatar
 
Join Date: Aug 2001
Posts: 7,472
Quote:
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.
__________________
If you aim at everything you will hit something but you won't know what it is.
Bubba is offline   Reply With Quote
Old 10-29-2009, 02:55 AM   #18
Registered User
 
Join Date: Oct 2009
Posts: 11
Wink

Quote:
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;}
	  }

}

Last edited by joseCarlos; 10-29-2009 at 08:52 AM. Reason: add comment
joseCarlos is offline   Reply With Quote
Old 10-29-2009, 07:58 AM   #19
l'Anziano
 
DavidP's Avatar
 
Join Date: Aug 2001
Posts: 2,573
Quote:
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."
DavidP is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

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


All times are GMT -6. The time now is 10:29 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22