Solved

GRAPHICS PROBLEM!!!!!!!!!!

Posted on 2000-04-20
7
357 Views
Last Modified: 2012-06-21
HELP !:):(:(
Well, I'm making a simple graphics screen for a school assignment in Pascal.  I want to work on it on my home computer, but when I tried to it said,"Error in Unit Vesa: 4-bit mode not implemented", and I think it's because of my graphic card.  So I downloaded the universal vesa driver but when I tried to run my program, it said,"superVGA not detected - installation aborted,"   My graphic card is a Creative Labs TNT.  Is there something I can do?  I have the correct code (uses dos, crt, graph.....etc) to put it into graphics mode, it works at school but not at home.  I tried using an older computer I have and it runs the program but the graphics on the screen are like lines running across the screen. I think it's something with the moniter, but I don't know. I don't know what's wrong :( please HELP!! :)
JT
0
Comment
Question by:bluetwinkle
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 49

Expert Comment

by:dbrunton
ID: 2738320
How are you trying to put the computers into graphics mode?

If you are using Turbo Pascal the code is

uses Graph;
var
  grDriver : integer;
  grmode : integer;
  ErrCode : integer;
begin
  grDriver := Detect;
  InitGraph(grDriver, grMode, ' ');
  ErrCode := GraphResult;
  if ErrCode =grOk then
    ....   {Do what you want to do}
  else
     writeln('Graphics error:', GraphErrorMsg(ErrCode));
0
 

Author Comment

by:bluetwinkle
ID: 2738569
Edited text of question.
0
 

Author Comment

by:bluetwinkle
ID: 2738575
Edited text of question.
0
Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

 
LVL 49

Expert Comment

by:dbrunton
ID: 2739099
What is unit VESA?

And what mode are you trying to put the screen into?  640 x 480, 800 x 600 or something else?
0
 
LVL 2

Expert Comment

by:VIBESPRO
ID: 2739417
explain some more so we may understand the exact problem
0
 
LVL 3

Accepted Solution

by:
Mathias earned 75 total points
ID: 2739571
4-bit is a VESA memory mode. If your program say "4-bit not implemented" then your graphic card doesn't support this mode. SuperVESA is an extender which will enhance your VESA compatibility (virtual).

The following short program will show you how to determine the VESA modes and which mode it is (e.g. 4-bit).

If this program not help you, try to find a VESA extender. But newer graphic cards have a special VESA BIOS (like TNT) which isn't very compatible to earlier versions.

PROGRAM TestVESA;
USES
    Crt;
TYPE
    String0=ARRAY[0..65534] OF Char;
    String0Ptr=^String0;
    VESABlock=RECORD
                    VESASignature:ARRAY[0..3] OF Char;
                    VESAVersion:Word;
                    OEMStringPtr:String0Ptr;
                    Capabilities:ARRAY[0..3] OF Byte;
                    VideoModePtr:String0Ptr;
              END;
    ModeBlock=RECORD
                    ModeAttr:Word;
                    WinAAttr:Byte;
                    WinBAttr:Byte;
                    WinGranularity:Word;
                    WinSize:Word;
                    WinASegment:Word;
                    WinBSegment:Word;
                    WinFuncPtr:Pointer;
                    BytesPerScanLine:Word;
                    XRes:Word;
                    YRes:Word;
                    XCharSize:Byte;
                    YCharSize:Byte;
                    NumberOfPlanes:Byte;
                    BitsPerPixel:Byte;
                    NumberOfBanks:Byte;
                    MemoryModel:Byte;
                    BankSize:Byte;
              END;
VAR
   Block:^VESABlock;
   Status:Word;
   Mode:ARRAY[0..255] OF RECORD
                               Nr:Word;
                               Info:^ModeBlock;
                         END;
   Modes:Byte;

PROCEDURE WriteStr0(S:String0Ptr);
VAR
   I:Byte;
BEGIN
     I:=0;
     WHILE S^[I]<>#0 DO
     BEGIN
          Write(S^[I]);
          Inc(I);
     END;
     WriteLn;
     WriteLn;
END;

FUNCTION Hex(B:Byte):String;
CONST
     HexTable:ARRAY[0..15] OF Char=('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
BEGIN
     Hex:=HexTable[B SHR 4]+HexTable[B AND 15];
END;

PROCEDURE WriteList(S:String0Ptr);
VAR
   I:Byte;
   P:Pointer;
   ModeNr:Word;
BEGIN
     I:=0;
     Modes:=0;
     WHILE Ord(S^[I])+Ord(S^[I+1]) SHL 8<>$FFFF DO
     BEGIN
          ClrScr;
          ModeNr:=Ord(S^[I])+Ord(S^[I+1]) SHL 8;
          Mode[Modes].Nr:=ModeNr;
          GetMem(Mode[Modes].Info,256);
          P:=Mode[Modes].Info;
          ASM
             les di,p
             mov cx,modenr
             mov ax,$4f01
             int $10
          END;
          WriteLn('Mode Nr: ',Hex(Ord(S^[I+1])),Hex(Ord(S^[I])));
          WriteLn('Mode Information:');
          WITH Mode[Modes].Info^ DO
          BEGIN
               IF ModeAttr AND 1=1 THEN
                  WriteLn('Mode can be initialled in present video configuration.')
               ELSE WriteLn('Mode can not be initialled in present video configuration.');
               IF ModeAttr AND 2=2 THEN
                  WriteLn('Extended Mode Information is available, as seen below.')
               ELSE WriteLn('Extended Mode Information is not available, as seen below.');
               IF ModeAttr AND 4=4 THEN
                  WriteLn('BIOS support for output functions.')
               ELSE WriteLn('No BIOS support for output functions.');
               IF ModeAttr AND 8=8 THEN
                  Write('Mode is a color')
               ELSE Write('Mode is a monochrome');
               IF ModeAttr AND 16=16 THEN
                  WriteLn(' graphics mode.')
               ELSE WriteLn(' text mode.');
               WriteLn;
               WriteLn('The granularity of a window is ',WinGranularity,' KBytes.');
               WriteLn('The size of a window is ',WinSize,' KBytes.');
               IF WinAAttr AND 1=1 THEN
               BEGIN
                    IF WinAAttr AND 2=2 THEN
                       WriteLn('Window A is readable.')
                    ELSE WriteLn('Window A is not readable.');
                    IF WinAAttr AND 4=4 THEN
                       WriteLn('Window A is writeable.')
                    ELSE WriteLn('Window A is not writeable.');
                    WriteLn('Window A is located at ',Hex(Hi(WinASegment)),Hex(Lo(WinASegment)),'hex in host address space.');
               END
               ELSE WriteLn('Window A is not supported.');
               WriteLn;
               IF WinBAttr AND 1=1 THEN
               BEGIN
                    IF WinBAttr AND 2=2 THEN
                       WriteLn('Window B is readable.')
                    ELSE WriteLn('Window B is not readable.');
                    IF WinBAttr AND 4=4 THEN
                       WriteLn('Window B is writeable.')
                    ELSE WriteLn('Window B is not writeable.');
                    WriteLn('Window B is located at ',Hex(Hi(WinASegment)),Hex(Lo(WinASegment)),'hex in host address space.');
               END
               ELSE WriteLn('Window B is not supported.');
               IF WinFuncPtr<>NIL THEN
                  WriteLn('Windowing procedure exists.')
               ELSE WriteLn('Windowing procedure does not exist.');
               WriteLn;
               WriteLn('Bytes per scan line: ',BytesPerScanLine);
               IF ModeAttr AND 2=2 THEN
               BEGIN
                    WriteLn('Resolution: ',XRes,' x ',YRes);
                    WriteLn('Character cell: ',XCharSize,' x ',YCharSize);
                    WriteLn('Number of memory planes: ',NumberOfPlanes,'.');
                    WriteLn('Bits per pixel: ',BitsPerPixel,'.');
                    WriteLn('Number of Banks: ',NumberOfBanks,'.');
                    Write('Memory model: ');
                    CASE MemoryModel OF
                         0:WriteLn('Text mode.');
                         1:WriteLn('CGA mode.');
                         2:WriteLn('Hercules mode.');
                         3:WriteLn('4 plane planar mode.');
                         4:WriteLn('Packed pixel mode.');
                         5:WriteLn('Non-chain 4, 256 color mode.');
                         6:WriteLn('Hi-Color / True-Color mode.');
                         7..15:WriteLn('Not defined yet by the VESA standard. Nr=',MemoryModel);
                         16..255:WriteLn('Special mode of the chip or card.');
                    END;
                    WriteLn('Bank size: ',BankSize,' KBytes.');
               END;
          END;
          ReadLn;
          Inc(I,2);
          Inc(Modes);
     END;
END;

BEGIN
{
     ASM
        mov ax,$13
        int $10
     END;
     ASM
        mov ax,$4f07
        xor bx,bx
        mov dx,200
        int $10
     END;
     ASM
        mov ax,$4f05
        xor bx,bx
        mov dx,0
        int $10
     END;
     ASM
        mov ax,$a000
        mov es,ax
        xor di,di
        mov ax,$0407
        mov cx,160
        cld
        rep stosw
     END;
     ReadLn;
     Halt;
}
     ClrScr;
     GetMem(Block,256);
     ASM
        mov di,word ptr block
        mov es,word ptr block+2
        mov ax,$4f00
        int $10
        mov status,ax
     END;
     IF Status<>$4F THEN
     BEGIN
          WriteLn('VESA BIOS Extension not installed!');
          Halt(1);
     END;
     WITH Block^ DO
     BEGIN
          IF VESASignature<>'VESA' THEN
          BEGIN
               WriteLn('VESA Information Structure Block not identified!');
               Halt(2);
          END;
          WriteLn('VESA Version: ',Hi(VESAVersion),'.',Lo(VESAVersion));
          WriteStr0(OEMStringPtr);
          ReadLn;
          WriteList(VideoModePtr);
     END;
END.
0
 

Author Comment

by:bluetwinkle
ID: 2740857
Thanks for helping me with my problem everyone, but I actually found The turbo pascal 5.5 program and my graphics work fine now! :) :)
JT
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The conference as a whole was very interesting, although if one has to make a choice between this one and some others, you may want to check out the others.  This conference is aimed mainly at government agencies.  So it addresses the various compli…
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question