Mail Archives: djgpp-workers/1999/10/18/04:30:14
Eli Zaretskii writes:
> Regarding the one below: is it a good idea to add code to the exit
> code that switches the display to mode 3 (after v2.03 is released)?
I would say not: IMHO it is the responsibility of whoever changed the
video mode to put it back when they are done. For instance Allegro does
try to do this automatically, hooking into atexit() and various signal
handlers to deal with abnormal terminations, but I don't think this code
belongs in libc.
One practical consideration is that it can be surprisingly hard to
correctly reset the mode, as a simple BIOS call is often not sufficient
for this. I've found several buggy VESA implementations that are
unable to select a text mode directly after using a truecolor SVGA
resolution, so you have to use a VESA call to select a 640x480x8 mode,
and then go from there to mode 3. Also, if the program is using more
unusual video systems like a VBE/AF hardware accelerator driver, it may
be left in an unusable state unless that system is closed down gracefully
(waiting for accelerator idle, disabling the linear framebuffer, etc).
> Do other DOS compilers do that?
Not that I'm aware of.
Shawn Hargreaves.
- Raw text -