Qbasicnews.com

Full Version: Is PCOPY faster than SCREEN mode,,apage, vpage?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?

Anonymous

Feel free to do tests, and bring them back. Thanks!
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.
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.
If that's not page flipping then what is?
Quote: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.
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.