Qbasicnews.com

QBasic => QB Discussion & Programming Help => Topic started by: torstum on July 06, 2006, 06:47:22 PM



Title: Is PCOPY faster than SCREEN mode,,apage, vpage?
Post by: torstum on July 06, 2006, 06:47:22 PM
I've discovered this really old command (already present in GW-Basic) that copies the content of one video page to another. Is it faster than the SCREEN command? My interpreted code would certainly appreciate some added boost.

  I've also read somewhere that the GW-Basic interpreter is faster than QBasic 1.1. Is this true?


Title: Is PCOPY faster than SCREEN mode,,apage, vpage?
Post by: Anonymous on July 06, 2006, 07:47:01 PM
Feel free to do tests, and bring them back. Thanks!


Title: Is PCOPY faster than SCREEN mode,,apage, vpage?
Post by: DrV on July 06, 2006, 08:57:54 PM
PCOPY is almost certainly slower than page flipping.  Page flipping only requires writing a couple of bytes to a video controller register, whereas PCOPY has to move all that memory around.  On the other hand, if port I/O is emulated, it might end up slower than the memory copy.


Title: Is PCOPY faster than SCREEN mode,,apage, vpage?
Post by: RyanKelly on July 11, 2006, 11:51:30 PM
The screen command does not perform page flipping.  The active page parameter sets the screen buffer drawn to by graphical and output statements, and the visible page parameter sets the the screen buffer that is actually display on the monitor.  PCOPY can be used to implement double buffering by copy from the active page and to the visible page.


Title: Is PCOPY faster than SCREEN mode,,apage, vpage?
Post by: DrV on July 12, 2006, 09:50:27 AM
If that's not page flipping then what is?


Title: Is PCOPY faster than SCREEN mode,,apage, vpage?
Post by: RyanKelly on July 13, 2006, 12:26:38 AM
Quote from: "DrV"
If that's not page flipping then what is?


The way torstum phrased his question made it appear that he had gotten the impression that he could perform page flipping by using the the screen statement alone, which until three minutes ago, I didn't think was possible.  I've always thought that the screen statement cleared the screen buffers, but I just ran a test and found that it in fact does not.

This being the case, I would assume that using the screen statement might be faster than using pcopy, however vsync techniques will wash out any advantage one approach might have over another.


Title: Is PCOPY faster than SCREEN mode,,apage, vpage?
Post by: na_th_an on July 13, 2006, 06:17:40 AM
The SCREEN thingo just points the start of the display page somewhere in the video memory *if* the current video mode is the same to that specified in the command. If not, it changes video modes and initializes everything (sets the default values in the DAC registers and clears video memory).

The fastest way to achieve flickerless animation would be using page flipping VSync'd (when you switch pages you just move a pointer, so it takes virtually no time), the problem is that if we are under Windows (whatever version) the timing is not accurate and you get "ghost zones" and lots of flickering here and there. You have to go to pure MSDOS for this to work.