Using Mode 13

Because Mode 13 is a linear mode, unlike the Mode X modes, DirectDraw can give an application direct access to the frame buffer.You can call the IDirectDrawSurface4::Lock, IDirectDrawSurface4::Blt, and IDirectDrawSurface4::BltFast methods to gain direct access to the primary surface.

When using Mode 13, DirectDraw supports an emulated IDirectDrawSurface4::Flip that is implemented as a straight copy of the contents of a back buffer to the primary surface. You can emulate this yourself by copying all or part of the back-buffer's contents to the primary surface using Blt or BltFast.

There is one warning concerning Lock and Mode 13. Although DirectDraw allows direct linear access to the Mode 13 VGA frame buffer, do not assume that the buffer is always located at address 0xA0000, since DirectDraw can return an aliased virtual-memory pointer to the frame buffer which will not be 0xA0000. Similarly, do not assume that the pitch of a Mode 13 surface is 320, because display cards that support an accelerated 320x200x8 mode will very likely use a different pitch.