I know this is not about Win32 programming, but I really want to understand this:
I recently replaced my ATI Rage Pro with a nvidia TNT2 card. After that, the following program didn't work any more:

mov ax,0013h
lop:
int 10h
mov al,20h
inc cx
mov ah,0ch
jmp lop

With my ATI card, the screen went blue. But now it stayes black. As far as I know this is standard VGA code, so doesn't the TNT2 support VGA anymore or what??? I have already tried setting the palette entry 20h to white, and again it worked perfectly with the ATI-card, but with the nvidia card everything was only black again.
Posted on 2003-09-14 08:14:02 by MedO
VGA should still be supported by all video cards, since its required for boot process (at least first steps of it).

I would suggest to execute your prog under native dos. So you may be able to recognize if the error is in BIOS or VDM/VXD driver.
Posted on 2003-09-14 08:36:07 by japheth
I had already tried that, with the same result.
An interesting thing is, that under Windows in windowed mode it works. I guess this is because the video output is emulated in windowed mode. But still, I don't understand why it doesn't work in real DOS / fullscreen mode.
Any other ideas?
Posted on 2003-09-14 09:15:49 by MedO
Hello MedO,

Your code looks like it should work. Int 10h, Function 0ch should be supported by all video adapters.

Only thing I noticed about your code snippet is you are not incrementing DX register. This sets the screen line. Are you doing this elsewhere?

Btw, when you switch to mode 13h why bother using the BIOS interupts? Just write direct to video memory.

best regards,

czDrillard
Posted on 2003-09-14 11:26:32 by czDrillard
Thanx alot, now I got it! But I don't like the answer:

I only incremented the cx register and bothered with int10h because of size reasons. I have written one of the smallest demos ever, and you cannot get that size (11 bytes) with direct videomem access.
Here's my demo:

mov al,13h
lop:
int 10h
inc ax
adc cx,ax
mov ah,0ch
jmp lop

It worked perfectly and drew over the entire screen, because the int10h didn't calculate the line boundaries, so with cx=0200h a pixel was drawn on the second line, for example.
The problem is that the value of dx after the first call of int 10h depends on the graphics card, so the output may be different depending on the graphics card.
So, if the demo doesn't work for you, please add a "mov dx,0FFFFh" after the int10h. This should work.

MedO
Posted on 2003-09-14 12:06:09 by MedO