schnarf283
12-15-2001, 01:57 PM
The following code does nothing. I'm compiling in Borland C++.
#include <conio.h>
void SetVideoMode(int mode)
{
asm {
mov ah, 0x0
mov al, byte ptr mode
int 0x10
}
}
void InitSVGA(int mode=0x116)
{
// 0x116 = 1024x786x32k
asm {
mov ax, 0x4f02
mov bx, byte ptr mode
int 0x10
}
}
void WritePixel(int x, int y, long int color)
{
asm {
mov ah, 0x0C
mov al, byte ptr color
mov bh, 0x01
mov cx, byte ptr x
mov dx, byte ptr y
int 0x10
}
}
void main(void)
{
InitSVGA(0x116);
for(int x=0;x<1024;x++) {
for(int y=0;y<768;y++) {
WritePixel(x, y, 0x50);
}
}
getch();
SetVideoMode(0x3);
}
----END CODE----
After setting windows to run it in fullscreen, it does set the graphics mode, but does no pixel plotting, and seems to make my screen sleep. Any ideas?
------------------
Specs:
Computer 1
------------
PII 450mHz
128 MB SDRAM
14.4 and 75.5 GB 7200 RPM Hard Drives
Riva TNT w/ 16 MB Video RAM
Windows 98/Windows 2000
Computer 2
------------
PI 200mHz
32 MB SDRAM
3 GB 2400 RPM Hard Drive
Matrox Something or Other
Debian 2.2r4, Kernel 2.4.16
#include <conio.h>
void SetVideoMode(int mode)
{
asm {
mov ah, 0x0
mov al, byte ptr mode
int 0x10
}
}
void InitSVGA(int mode=0x116)
{
// 0x116 = 1024x786x32k
asm {
mov ax, 0x4f02
mov bx, byte ptr mode
int 0x10
}
}
void WritePixel(int x, int y, long int color)
{
asm {
mov ah, 0x0C
mov al, byte ptr color
mov bh, 0x01
mov cx, byte ptr x
mov dx, byte ptr y
int 0x10
}
}
void main(void)
{
InitSVGA(0x116);
for(int x=0;x<1024;x++) {
for(int y=0;y<768;y++) {
WritePixel(x, y, 0x50);
}
}
getch();
SetVideoMode(0x3);
}
----END CODE----
After setting windows to run it in fullscreen, it does set the graphics mode, but does no pixel plotting, and seems to make my screen sleep. Any ideas?
------------------
Specs:
Computer 1
------------
PII 450mHz
128 MB SDRAM
14.4 and 75.5 GB 7200 RPM Hard Drives
Riva TNT w/ 16 MB Video RAM
Windows 98/Windows 2000
Computer 2
------------
PI 200mHz
32 MB SDRAM
3 GB 2400 RPM Hard Drive
Matrox Something or Other
Debian 2.2r4, Kernel 2.4.16