Recent

Author Topic: Go32v2 DOS: Compilation of HW Acceleraded GraphiX Lib  (Read 3109 times)

tol

  • New member
  • *
  • Posts: 8
Go32v2 DOS: Compilation of HW Acceleraded GraphiX Lib
« on: March 20, 2024, 01:10:01 pm »
Is anybody able to compile the (hardware accelerated) GraphiX Lib vor Go32v2? ( http://downloads.freepascal.org/fpc/contrib/gxfp405.zip ).

It seems to be made for an older FPC version but not available any more.
I finally got parts of it to compile (graphix.pp), by simply commenting out (hopefully not needed parts) parts that won't compile anymore.
But I get stuck now when trying to compile gxdemo.pas

Current Errors:

gximg.pp(1368,31) Error: You cannot reach COSTAB from that code
gximg.pp(1424,31) Error: You cannot reach COSTAB from that code
gximg.pp(5660,18) Error: function header doesn't match the previous declaration "Read(var <Formal type>;LongInt);"
gximg.pp(5771,18) Error: function header doesn't match the previous declaration "Read(var <Formal type>;LongInt);"

If someone somehow manages to create/obtain the compiled units, or tell me how to fix this error, that would be a great help to me.

cdbc

  • Hero Member
  • *****
  • Posts: 1646
    • http://www.cdbc.dk
Re: Go32v2 DOS: Compilation of HW Acceleraded GraphiX Lib
« Reply #1 on: March 20, 2024, 02:18:14 pm »
Hi
At least I can tell you that these
Quote
gximg.pp(5660,18) Error: function header doesn't match the previous declaration "Read(var <Formal type>;LongInt);"
gximg.pp(5771,18) Error: function header doesn't match the previous declaration "Read(var <Formal type>;LongInt);"
errors are to do with the function declaration in interface section doesn't match the function implementation in the implementation section of the unit. Have you changed one or the other?!? Should be easy to fix  8)
The rest... I dunno.
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

tol

  • New member
  • *
  • Posts: 8
Re: Go32v2 DOS: Compilation of HW Acceleraded GraphiX Lib
« Reply #2 on: March 20, 2024, 02:57:07 pm »
I've not changed anything.

This is the implementation within gximg.pp:

Code: Pascal  [Select][+][-]
  1. TYPE PMyStream=^TMyStream;
  2.      TMyStream=OBJECT(TStream)
  3.        f:file;
  4.        buffer,curbufferpos:pointer;
  5.        buffersize:longint;
  6.        bufferstartpos,bufferendpos,bytesinbuffer:longint;
  7.        io:longint;
  8.        fmode:word;
  9.        CONSTRUCTOR Init(name:string;mode,size:word);
  10.        DESTRUCTOR Done;virtual;
  11.        PROCEDURE read(var buf;count:sw_word);virtual;
  12.        PROCEDURE seek(pos:longint);virtual;
  13.        FUNCTION getpos:longint;virtual;
  14.        FUNCTION getsize:longint;virtual;
  15.      END;

According to this the proc read(..) is a new overloaded proc ( besides
Code: Pascal  [Select][+][-]
  1. function Read(var Buffer; Count: LongInt) : LongInt; Virtual; Overload
of the TStream base class. Or do I misunderstand this? Maybe I should just change the parameter LongInt to override the base implementation?

cdbc

  • Hero Member
  • *****
  • Posts: 1646
    • http://www.cdbc.dk
Re: Go32v2 DOS: Compilation of HW Acceleraded GraphiX Lib
« Reply #3 on: March 20, 2024, 03:30:07 pm »
Hi
1)
Quote
Maybe I should just change the parameter LongInt to override the base implementation?
Yes you should, the overriding method MUST match exactly the virtual overridden method!!!
2)
This function:
Code: Pascal  [Select][+][-]
  1. function Read(var Buffer; Count: LongInt) : LongInt; Virtual; Overload
has got nothing to do with the same-named method of "TMyStream" if anything it would look like this:
Code: Pascal  [Select][+][-]
  1. PROCEDURE TMyStream.read(var buf;count:sw_word);
  2. begin
  3.   ...
  4. end;
in the implementation section that is...
It seems to me, that you need to read up on your /old-school/ Object-framework(s) to fet more acquanted with the workings of it/them...
I can recommend the programming guides and manuals from Borland on TP 5.5, they're available allover the place to download for free. I even think 'Embarcadero' has one for download at their site  :D
If you feel adventurous, you can have a 'looksee' at our own 'Free Vision' framework, you'll find it in the fpc source-tree, under 'fv' ...and there's even a version for unicode.
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

tol

  • New member
  • *
  • Posts: 8
Re: Go32v2 DOS: Compilation of HW Acceleraded GraphiX Lib
« Reply #4 on: March 20, 2024, 06:21:11 pm »
If I understand correctly, declaring a method with different parameter(s) does not create a new (overloaded) method in FP?
(Because then the error message would be wrong).

( Keine Ahnung ob im Code der Lib die Methode read überschrieben werden soll oder eine neue Methode read eingeführt werden sollte, von daher die Verwirrung )
« Last Edit: March 20, 2024, 06:24:30 pm by tol »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11935
  • FPC developer.
Re: Go32v2 DOS: Compilation of HW Acceleraded GraphiX Lib
« Reply #5 on: March 20, 2024, 06:22:17 pm »
I think TP was simply more forgiving because it didn't have any form of procedural overloading.

Anyway, the best solution seems to simply correct and move on.

cdbc

  • Hero Member
  • *****
  • Posts: 1646
    • http://www.cdbc.dk
Re: Go32v2 DOS: Compilation of HW Acceleraded GraphiX Lib
« Reply #6 on: March 20, 2024, 07:07:45 pm »
Hallo
Eine Lösung wäre:
Code: Pascal  [Select][+][-]
  1. TYPE PMyStream=^TMyStream;
  2.      TMyStream=OBJECT(TStream)
  3.        f:file;
  4.        buffer,curbufferpos:pointer;
  5.        buffersize:longint;
  6.        bufferstartpos,bufferendpos,bytesinbuffer:longint;
  7.        io:longint;
  8.        fmode:word;
  9.        CONSTRUCTOR Init(name:string;mode,size:word);
  10.        DESTRUCTOR Done;virtual;
  11.        PROCEDURE read(var buf;count:sw_word);virtual;
  12.        ///// ein neuer Funktionsname /////
  13.        function ReadBuffer(var Buffer; Count: LongInt) : LongInt; Virtual;
  14.        PROCEDURE seek(pos:longint);virtual;
  15.        FUNCTION getpos:longint;virtual;
  16.        FUNCTION getsize:longint;virtual;
  17.      END;
  18.  
Und dann die neue Funktion zu implementieren:
Code: Pascal  [Select][+][-]
  1. function TMyStream.ReadBuffer(var Buffer; Count: LongInt) : LongInt;
  2. begin
  3.   ...
  4. end;
HTH
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

tol

  • New member
  • *
  • Posts: 8
Re: Go32v2 DOS: Compilation of HW Acceleraded GraphiX Lib
« Reply #7 on: March 22, 2024, 04:52:26 pm »
I finally got everything to compile, including the FreeType lib.
(I simply quickly removed the JPEG support).
Unfortunately, everything was for nothing: the program crashes deep in the assembler code when initializing the graphics mode. (Dosbox-X, for all emulated graphics cards).
Unfortunately I'm out here.
Does anyone know of another graphics lib that offers hardware acceleration for the first 2D accelerator cards?
(This offered hardware support for graphics cards in the mid-90s, which would be exactly my historical goal PC). If necessary also in C via DJGPP, adding a Pascal interface is not the world.

dbannon

  • Hero Member
  • *****
  • Posts: 3156
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Go32v2 DOS: Compilation of HW Acceleraded GraphiX Lib
« Reply #8 on: March 23, 2024, 09:47:06 am »
You can still download the source code for FPC 2.6.4 from github, thats the one mentioned on the wiki page. I wonder of someone can tell us when you can download either a compiled version or a boot compiler to build 2.6.4 ?

The link to old compilers on the main FPC website is broken.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

tol

  • New member
  • *
  • Posts: 8
Re: Go32v2 DOS: Compilation of HW Acceleraded GraphiX Lib
« Reply #9 on: March 23, 2024, 11:30:16 am »
I'm afraid I need a 1.X version of Free Pascal.
And even then it doesn't seem clear whether the runtime errors that I get after compiling with 3.2.0 when running in Dosbox-X don't have something to do with dosbox-x's hardware emulation. 

 

TinyPortal © 2005-2018