DOS Crash

DOS specific questions.
DOS386
Posts: 798
Joined: Jul 02, 2005 20:55

Re: DOS Crash

Postby DOS386 » Mar 30, 2014 7:41

> until I added the CLS after the ScreenRes statement many of the modes
> also displayed garbage at various locations on the screen. This suggests to me
> that fbgfx might be failing to clear the display memory at mode set

Maybe BIOS should do this, but is buggy?

http://sourceforge.net/p/fbc/code/ci/ma ... esa_core.c

Many FIXME's, no clearing ... does the garbage vanish if you hunt the rat arrow up and down?
MichaelW
Posts: 3500
Joined: May 16, 2006 22:34
Location: USA

Re: DOS Crash

Postby MichaelW » Mar 30, 2014 9:53

DOS386 wrote:> until I added the CLS after the ScreenRes statement many of the modes
Maybe BIOS should do this, but is buggy?

The BIOS on both of my test systems works as it should, clearing the display memory if bit 15 of the mode number is clear, or preserving the display memory if bit 15 is set.

Code: Select all

''=============================================================================
function VideoModeVbe naked() as integer
    asm
        push ebx
        mov ax, 0x4f03
        int 0x10
        movzx eax, bx
        pop ebx
        ret
    end asm
end function
''=============================================================================

dim as integer vmode

screenres 640,480,8
line (20,20)-(120,120),9,B
circle (70,70),48,12
vmode = VideoModeVbe()
print hex(vmode);"h"
sleep

''-------------------------------------------------
'' Reset mode without clearing the display memory.
''-------------------------------------------------

vmode xor= &h8000

asm
    push ebx
    mov ax, 0x4f02
    mov bx, [vmode]
    int 0x10
    pop ebx
end asm

print "display memory not cleared"

sleep

''-----------------------------------------
'' Reset mode clearing the display memory.
''-----------------------------------------

vmode xor= &h8000

asm
    push ebx
    mov ax, 0x4f02
    mov bx, [vmode]
    int 0x10
    pop ebx
end asm

print "display memory cleared"

sleep

And in gfx_vesa_core.c, so far I have not seen any code to set bit 15 of the mode number, so AFAIK the function should clear the display memory. Perhaps the problem has something to do with banked versus linear?

does the garbage vanish if you hunt the rat arrow up and down?

I’m testing with no mouse driver so no mouse cursor.

And in the previous test, eliminating the shift to screen 0 did not eliminate the garbage.

Return to “DOS”

Who is online

Users browsing this forum: No registered users and 1 guest