Mode 13h is too Slow?

Jumping into graphics a bit early, I set up mode 13h and got the palette controls and vertical blank syncronization all hooked up. I set up a simple back buffer for the 320x200 pixel/byte display, and wrapped it all up in a simple double buffering setup. Then I ran into a problem.

Turns out, if you copy 64000 bytes from system memory to VRAM on a 486DX2, it takes about 7 milliseconds. To hit that 70fps goal, I have about 14 milliseconds to do everything for the entire frame. Game logic, sound mixing, rendering to the backbuffer, and then... this. This 7ms monstrosity of an operation just to copy the backbuffer to the front buffer. Even distilling it down to a simple "REP MOVSD" in assembly didn't save me any time.

pageflip.jpg

Then everyone told me I should be using Mode X instead of mode 13h. So I guess I'll be doing that once I get back to graphics.

Time to do some studying.

Posted: 2017-04-14

Tags: dos, devlog