Solved

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

Posted on 2000-04-20
7
329 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
7 Comments
 
LVL 47

Expert Comment

by:dbrunton
Comment Utility
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
Comment Utility
Edited text of question.
0
 

Author Comment

by:bluetwinkle
Comment Utility
Edited text of question.
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 47

Expert Comment

by:dbrunton
Comment Utility
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
Comment Utility
explain some more so we may understand the exact problem
0
 
LVL 3

Accepted Solution

by:
Mathias earned 75 total points
Comment Utility
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
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now