Recent

Author Topic: Ported my old TP7 code to FPC without changes  (Read 412 times)

anyone

  • Jr. Member
  • **
  • Posts: 53
    • ASCII Art Online
Ported my old TP7 code to FPC without changes
« on: October 12, 2020, 05:04:45 pm »
I have a lot of TP7 code made 20 years ago, among them, some were using Turbo Vision, and some were command-line interface (CLI).
Recently, I understand that FPC has Free Vision which is equivalent to Turbo Vision. I tried the Free Vision demo and it was quite good (the only thing that did not work was mouse)

I have this particular compression library unit written in TP7 based on RLE (or RLE-alike algorithm). I can ported it to FPC without single changes. Though, when I tried to ported it to Delphi 10.xxx(?), it says it does not support the BlockRead in such a way:

Code: Pascal  [Select][+][-]
  1.       {$I-}
  2.       Seek(InputFile,SegmentIndex*64000);
  3.       BlockRead(InputFile,Data^,64000,AccessStatus);
  4.       {$I+}
  5.  

Does anyone know why? I ended up supporting file less than 64KB on Windows version (instead of multiple 64KB chunk R/W access) of my compression utility.

I am not sure if anyone would find my COMPRESS.pas useful. I used a pair of two funny words "Squeeze"(compress) and "Stretch"(expand).

The compression ratio is very limited (in real world scenario), maybe worthwhile for learning purposes only?

Then there are some TP7 programs of mine which access screen buffer B800:0 directly. I will keep them in archive.org anyway, because no more direct memory access in post-DOS era.  :(
FPC 3.2.0 (i386-Win32) on Windows 10 32-bit.

Alextp

  • Hero Member
  • *****
  • Posts: 1145
    • UVviewsoft
Re: Ported my old TP7 code to FPC without changes
« Reply #1 on: October 12, 2020, 05:38:41 pm »
You can create GitHub account. No need to install git.
Using only website, you can  make the repo. And upload all files there (button "add file").

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8784
  • FPC developer.
Re: Ported my old TP7 code to FPC without changes
« Reply #2 on: October 12, 2020, 07:45:01 pm »
Please reproduce the errormessage.

Possibly it is just the VAR parameter acccesstatus, which is word in 16-bit versions, and longint in 32-bits version.

FPC probably does both, in unit dos the 16-bit and in in $mode delphi/objfpc the 32-bit

winni

  • Hero Member
  • *****
  • Posts: 1894
Re: Ported my old TP7 code to FPC without changes
« Reply #3 on: October 12, 2020, 08:16:27 pm »
Hi!


We don't know your error message.
But this works:


Code: Pascal  [Select][+][-]
  1. type
  2.   DataType=array [0..63999] of byte;
  3.  
  4. var
  5.   Data:  DataType;
  6. .....
  7.  BlockRead(InputFile,Data[0],64000,AccessStatus);
  8.  
  9.  

Winni

anyone

  • Jr. Member
  • **
  • Posts: 53
    • ASCII Art Online
Re: Ported my old TP7 code to FPC without changes
« Reply #4 on: October 12, 2020, 09:35:53 pm »
Please reproduce the errormessage.

Possibly it is just the VAR parameter acccesstatus, which is word in 16-bit versions, and longint in 32-bits version.

FPC probably does both, in unit dos the 16-bit and in in $mode delphi/objfpc the 32-bit

Thanks for your help. It says: [dcc32 Error] COMPRESS.PAS(86): E2008 Incompatible types
FPC 3.2.0 (i386-Win32) on Windows 10 32-bit.

anyone

  • Jr. Member
  • **
  • Posts: 53
    • ASCII Art Online
Re: Ported my old TP7 code to FPC without changes
« Reply #5 on: October 12, 2020, 09:40:04 pm »
Hi!


We don't know your error message.
But this works:


Code: Pascal  [Select][+][-]
  1. type
  2.   DataType=array [0..63999] of byte;
  3.  
  4. var
  5.   Data:  DataType;
  6. .....
  7.  BlockRead(InputFile,Data[0],64000,AccessStatus);
  8.  
  9.  

Winni

Thank you for trying to help.

I removed the pointer, and now uses Data[0], the error now is:
[dcc32 Error] COMPRESS.PAS(86): E2008 Incompatible types
FPC 3.2.0 (i386-Win32) on Windows 10 32-bit.

anyone

  • Jr. Member
  • **
  • Posts: 53
    • ASCII Art Online
Re: Ported my old TP7 code to FPC without changes
« Reply #6 on: October 12, 2020, 09:41:52 pm »
You can create GitHub account. No need to install git.
Using only website, you can  make the repo. And upload all files there (button "add file").

Thanks pal.

I do have two of them, but none of them attract any traffic.... :(
FPC 3.2.0 (i386-Win32) on Windows 10 32-bit.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8784
  • FPC developer.
Re: Ported my old TP7 code to FPC without changes
« Reply #7 on: October 12, 2020, 09:49:55 pm »
Thanks for your help. It says: [dcc32 Error] COMPRESS.PAS(86): E2008 Incompatible types

Incomplete, widen the window.

anyone

  • Jr. Member
  • **
  • Posts: 53
    • ASCII Art Online
Re: Ported my old TP7 code to FPC without changes
« Reply #8 on: October 12, 2020, 09:54:19 pm »
Thanks for your help. It says: [dcc32 Error] COMPRESS.PAS(86): E2008 Incompatible types

Incomplete, widen the window.

Okay, sir.
FPC 3.2.0 (i386-Win32) on Windows 10 32-bit.

anyone

  • Jr. Member
  • **
  • Posts: 53
    • ASCII Art Online
Re: Ported my old TP7 code to FPC without changes
« Reply #9 on: October 12, 2020, 09:58:22 pm »
Please reproduce the errormessage.

Possibly it is just the VAR parameter acccesstatus, which is word in 16-bit versions, and longint in 32-bits version.

FPC probably does both, in unit dos the 16-bit and in in $mode delphi/objfpc the 32-bit


Yes, you'right! After I changed to longint, it has no more issues......
FPC 3.2.0 (i386-Win32) on Windows 10 32-bit.

 

TinyPortal © 2005-2018