Debugging High Resolution EGA or VGA Graphics with CodeView

ID Number: Q23308

1.x 2.x 3.00 3.10 3.11 3.14 | 2.x 3.00 3.10 3.11 3.12 3.50

MS-DOS | OS/2

Question:

I am trying to debug a program that does EGA or VGA graphics. When I

continue from a breakpoint after the program has painted the screen,

the screen appears differently than before the breakpoint; all colors

seemingly have been turned to black. The program is using the EGA in

640x350, 16-color mode. Is this mode supposed to work? If it does not

work, why not?

Response:

This behavior is partly related to the size of the buffer that

CodeView creates for storing screen information. If you are running on

a CGA, EGA, or VGA board, this buffer is 16K by default. If you are

running on a monochrome board, this buffer is 4K by default. As you

are finding, 16K is not enough memory for a color image using 640x350

resolution (the maximum resolution supported is 640x200), hence the

loss of color after the breakpoint.

The best way to work around this limitation is to use a dual-monitor

setup for debugging applications that run in a high resolution

graphics mode. Invoke CodeView with the /2 switch and the CodeView

display will appear on the secondary monitor while the program's

graphical output will remain on the main monitor. Because the output

is going to a different screen, CodeView won't have to worry about

changing the video modes or the buffering.

Additional reference words: 1.0 1.00 1.1 1.10 1.11 2.0 2.00 2.1 2.10

2.2 2.20 2.30 2.30 2.35 3.0 3.00 3.1 3.10 3.11 3.12 3.14 3.5 3.50