[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 372
  • Last Modified:

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

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
bluetwinkle
Asked:
bluetwinkle
1 Solution
 
dbruntonCommented:
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
 
bluetwinkleAuthor Commented:
Edited text of question.
0
 
bluetwinkleAuthor Commented:
Edited text of question.
0
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.

 
dbruntonCommented:
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
 
VIBESPROCommented:
explain some more so we may understand the exact problem
0
 
MathiasCommented:
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
 
bluetwinkleAuthor Commented:
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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now