What would be the best way to create a two-dimensional pointer that points to the 0xA000 that goes like this:
Code: Select all
pointer[x][y] = color;
Thanks.
Code: Select all
pointer[x][y] = color;
Code: Select all
buffer[y][x] = color;
Code: Select all
char * buffer[y] = 0xA000
If "640x480x8" is a 256-colour mode, then that isn't a standard VGA mode. It requires (at least) 300 KiB of display memory (so you'd have to use bank switching or a linear frame buffer to access it because 300 KiB is more than 64 KiB), and the number of bytes per line may be more than 640 bytes (with padding, etc after the "real" data). For both of these reasons you wouldn't be able to treat it as a simple 2 dimensional array.myrk wrote:What would be the best way to create a two-dimensional pointer that points to the 0xA000 that goes like this:(for a 640x480x8 mode)Code: Select all
pointer[x][y] = color;
Nope. 320x240x8 is the safe maximum for square pixels, 320x480x8 is the real "safe" maximum. 400x300 (actually 416x312x8) is the maximum square pixel size with page flipping, which still works fairly well but not everywhere since it is a bit demanding on your monitor's timing circuitry (which is capable of destroying old fixed-sync CRTs, as well as some cheap LCDs that shouldn't have been made). And, for the record, you have the theoretic maximum of 588x441x8 which comes with a big fat epilepsy warning besides the standard monitor destruction disclaimer and the fact that I haven't actually seen it work.NickJohnson wrote:320x240x8 is the maximum possible with 8 bit depth.
There's 3 parts to this.myrk wrote:But if 640x480x8 isn't the standard VGA mode, then what is it?