Double buffering

Posts 1–3 of 3 · Page 1 of 1
Double buffering
I'm currently on working on implementing double buffering in a real mode program.

My best Idea is that you write everything to page 1 first, then when everything is written you copy the memory of page 1 to page 0 and voila.

Any better implementations?
I think 'copying' all the data isn't "double buffering" in the sense I'm used to. ?

I thought it was generally..
Have a pointer which points to either "page1" or "page2" ...it's always pointing to the "old copy", and the new copy is used for new writes. When the new copy is full, switch the pointer to point to it.

Idk, just my 2 cents. This for the OS you're writing? Graphics?

edit: 'full' is the wrong word: complete*. maybe.
Quote Originally Posted by abuckau907 View Post
I think 'copying' all the data isn't "double buffering" in the sense I'm used to. ?

I thought it was generally..
Have a pointer which points to either "page1" or "page2" ...it's always pointing to the "old copy", and the new copy is used for new writes. When the new copy is full, switch the pointer to point to it.

Idk, just my 2 cents. This for the OS you're writing? Graphics?

edit: 'full' is the wrong word: complete*. maybe.
Well, at least on IBM Compatible PCs, I'm quite sure that page 0 is the only visible page, meaning you cannot display any other pages

So I don't think pointing to the page will do anything. Unless you are using BIOS interrupts (slow) to write to the screen, you are writing directly to video memory.

On IBM Compatible with a color video card (mode 0x03 in this case) , only the first 80x25x2 (4000) bytes of video memory are shown on the screen, and the rest is put in the next page. So as far as I see it, the only way to display is to actually copy the next page memory to the 0th page, or else there is no other way to display.

On color text modes, it works like. Byte 1 is the character, byte 2 is the attribute. so
Code:
int8 far* vram = (int8 far*)0xB800;
vram[0] = 'a'; //character
vram[1] = 0x0F //Attribute, white char on black background
Posts 1–3 of 3 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us