Technically, the VGA has no VESA-style bank-switching support at all. Instead it has a plane mask register where you can enable writes to one of four separate planes. Worse, in text mode, Odd-even mode is in use which partially overrides the plane selection based on bit 0 of the address. Text mode also dedicates banks to their respective purposes: you can only use plane 0+1 for character and attribute data, leaving 128k max to use.
There are two partial solutions here: - change the mapping from 32k at 0xb8000 to 64k at 0xa0000, which allows you to access double the memory amount without the need of any planeswitching code. - disable odd-even mode. You can then use the mask register to switch between planes 0-3, and write either characters, attributes, or font data. You get 4x the VGA ram at your disposal, or 2x more character-attribute pairs. You might also want to make sure you're in byte mode so that the display can actually display the newly accessible characters. If you do this, you'll have to adapt all writing routines to match. It also gives more opportunity to use VGA latches if you want to bother with them.
If you do both, you have access to 64k of characters and 64k of attributes, as well as the complete font set if you feel a need to change it.
Be careful though, VGA emulation in this regard is a bit flaky. Depending on the amount of tricks you try to pull off here, you'll lose increasingly more emulators that actually do what you want. Bochs and qemu(-clones) are generally the first to go. Real hardware is pretty conformant, fortunately.
_________________ "Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie [ My OS ] [ VDisk/SFS ]
|