Results 1 to 3 of 3
  1. #1
    Auxilium's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    深い碧の果てに
    Posts
    4,518
    Reputation
    445
    Thanks
    609
    My Mood
    Happy

    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?

  2. #2
    abuckau907's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    other side of the wire
    Posts
    1,342
    Reputation
    162
    Thanks
    239
    My Mood
    Cold
    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.
    Last edited by abuckau907; 03-11-2013 at 05:36 AM.
    'Some things that can be counted, don't matter. And some things that matter, can't be counted' - A.E.
    --
     

    My posts have some inaccuracies/are wrong/wrong keyword(s) used.
    They're (maybe) pretty close, and I hope they helped you, not created confusion. Take with grain of salt.

    -if you give rep, please leave a comment, else it means less.

  3. #3
    Auxilium's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    深い碧の果てに
    Posts
    4,518
    Reputation
    445
    Thanks
    609
    My Mood
    Happy
    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
    Last edited by Auxilium; 03-11-2013 at 09:58 AM.

Similar Threads

  1. Replies: 0
    Last Post: 03-25-2008, 12:31 PM
  2. Replies: 14
    Last Post: 11-06-2007, 04:29 PM
  3. Double your FF speed!
    By smartie in forum General Game Hacking
    Replies: 0
    Last Post: 07-01-2007, 04:37 PM
  4. C++ Buffer Overrun Detected
    By warrockk1ngs in forum WarRock - International Hacks
    Replies: 6
    Last Post: 06-08-2007, 12:10 AM
  5. [search]Warrock double window
    By ryan5458 in forum WarRock - International Hacks
    Replies: 8
    Last Post: 01-15-2006, 10:56 AM