Recent

Author Topic: OLD code with machine specific instructions  (Read 13200 times)

juanirias

  • Full Member
  • ***
  • Posts: 100
OLD code with machine specific instructions
« on: July 09, 2021, 09:28:21 pm »
Hi!

I would like it to work as intended, maybe you can help me and compile with all its functions: THANK YOU

I can compile the code by suppressing:
Code: Pascal  [Select][+][-]
  1. Procedure Cursor_On;
  2. Procedure Cursor_Off;
  3.  

These belong SUPPORT.PAS from sgp4-plb26a.zip

The goal is to run and compile the "TRAKSTAR.PAS" from trakstar26a.zip.

I attach the compressed files (they are public).

https://celestrak.com/software/tskelso-sw.php

I use FPC under LINUX


Regards, JUAN
« Last Edit: July 09, 2021, 09:52:49 pm by juanirias »

Bart

  • Hero Member
  • *****
  • Posts: 5706
    • Bart en Mariska's Webstek
Re: OLD code with machine specific instructions
« Reply #1 on: July 09, 2021, 10:52:49 pm »
Unit Crt has CursorOff and CursorOn procedures.

Maybe you can use those?

Bart

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: OLD code with machine specific instructions
« Reply #2 on: July 09, 2021, 11:04:01 pm »
Hi!

CurserOn is #27'[?2c'

CursorOff is #27'[?1c'

Winni

MarkMLl

  • Hero Member
  • *****
  • Posts: 8551
Re: OLD code with machine specific instructions
« Reply #3 on: July 09, 2021, 11:26:15 pm »
Hi!

CurserOn is #27'[?2c'

CursorOff is #27'[?1c'

Winni

I was thinking that might be necessary, but a lot depends on what libraries etc. are already being used (i.e. Bart's suggestion).

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Bart

  • Hero Member
  • *****
  • Posts: 5706
    • Bart en Mariska's Webstek
Re: OLD code with machine specific instructions
« Reply #4 on: July 09, 2021, 11:29:12 pm »
I was thinking that might be necessary, but a lot depends on what libraries etc. are already being used (i.e. Bart's suggestion).

AFAICS the program already uses the Crt unit.

Bart

juanirias

  • Full Member
  • ***
  • Posts: 100
Re: OLD code with machine specific instructions
« Reply #5 on: July 09, 2021, 11:40:06 pm »
I attach a pictures of the error when try to build. (original code)
Code: Pascal  [Select][+][-]
  1. fpc "support.pas" (in directory: /home/developer/wip/kelso)
  2. Free Pascal Compiler version 3.0.4+dfsg-22 [2019/01/24] for x86_64
  3. Copyright (c) 1993-2017 by Florian Klaempfl and others
  4. Target OS: Linux for x86-64
  5. Compiling support.pas
  6. support.pas(7,2) Warning: Unsupported switch "$N"
  7. support.pas(81,12) Error: Identifier not found "registers"
  8. support.pas(81,21) Error: Error in type definition
  9. support.pas(83,13) Error: Expression type must be class or record type, got <erroneous type>
  10. support.pas(85,5) Error: Identifier not found "ah"
  11. support.pas(86,5) Error: Identifier not found "ch"
  12. support.pas(87,5) Error: Identifier not found "cl"
  13. support.pas(89,3) Error: Identifier not found "Intr"
  14. support.pas(94,12) Error: Identifier not found "registers"
  15. support.pas(94,21) Error: Error in type definition
  16. support.pas(96,13) Error: Expression type must be class or record type, got <erroneous type>
  17. support.pas(98,5) Error: Identifier not found "ah"
  18. support.pas(99,5) Error: Identifier not found "ch"
  19. support.pas(100,5) Error: Identifier not found "cl"
  20. support.pas(102,3) Error: Identifier not found "Intr"
  21. support.pas(501) Fatal: There were 14 errors compiling module, stopping
  22. Fatal: Compilation aborted
  23. Error: /usr/bin/ppcx64 returned an error exitcode
  24. Compilation failed.


regards, JUAN

Bart

  • Hero Member
  • *****
  • Posts: 5706
    • Bart en Mariska's Webstek
Re: OLD code with machine specific instructions
« Reply #6 on: July 10, 2021, 12:15:16 am »
You simply don't need those procedures.
Just replace them with CursorOn and CursorOff.

Bart

Fred vS

  • Hero Member
  • *****
  • Posts: 3828
    • StrumPract is the musicians best friend
Re: OLD code with machine specific instructions
« Reply #7 on: July 10, 2021, 12:57:45 am »
Hello.

In attachment your "TRAKSTAR" project with the fixes of Bart.

It compiles and run but  needs some work for tuning the console-GUI.

Code: Bash  [Select][+][-]
  1. $ fpc TRAKSTAR.PAS

Fre;D
« Last Edit: July 10, 2021, 01:17:20 am by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

juanirias

  • Full Member
  • ***
  • Posts: 100
Re: OLD code with machine specific instructions
« Reply #8 on: July 10, 2021, 08:56:15 pm »
Yes, when delete this, program work!
How can try to get running under LINUX with modern PC?

regards, JUAN

Fred vS

  • Hero Member
  • *****
  • Posts: 3828
    • StrumPract is the musicians best friend
Re: OLD code with machine specific instructions
« Reply #9 on: July 10, 2021, 09:02:44 pm »
Yes, when delete this, program work!
How can try to get running under LINUX with modern PC?

regards, JUAN

Hello.

Did you try to compile + run the code in attachment of my previous post?

Here what I get on Linux 64 bit with a modern laptop:

I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Bart

  • Hero Member
  • *****
  • Posts: 5706
    • Bart en Mariska's Webstek
Re: OLD code with machine specific instructions
« Reply #10 on: July 11, 2021, 12:32:27 am »
Well, the program seems to be unresponsive (on Windows).
It turns out that unit SGP_Math uses Dialogs (well, it's in the uese clause, but it doesn not use it), but Dialogs unit is part op FV and that doesn't play nice with the ReadKey.

Bart

Fred vS

  • Hero Member
  • *****
  • Posts: 3828
    • StrumPract is the musicians best friend
Re: OLD code with machine specific instructions
« Reply #11 on: July 11, 2021, 12:51:44 am »
Hello.

Here, on Linux 64, I have better result (see gif anim).
(But I dont know that program and how it works, it seems to need data.).

Fre;D
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Fred vS

  • Hero Member
  • *****
  • Posts: 3828
    • StrumPract is the musicians best friend
Re: OLD code with machine specific instructions
« Reply #12 on: July 11, 2021, 05:11:56 am »
Hello.

Quote
(But I dont know that program and how it works, it seems to need data.).

OK, I get it.
You need to change file name of "noaa.tle" into "NOAA.TLE".

Also, when check-boxes appear in form, select with the "space" key.

Here on Linux it works and some "ECI25338.579" files are created (depend of what satellite you choose) .
In attachment the code + the binary for Linux 64 bit.

To run the binary:

Code: Bash  [Select][+][-]
  1. $ cd /directrory/of/startrak

Code: Bash  [Select][+][-]
  1. $ ./STARTRAK

Fre;D
« Last Edit: July 12, 2021, 01:55:15 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Bart

  • Hero Member
  • *****
  • Posts: 5706
    • Bart en Mariska's Webstek
Re: OLD code with machine specific instructions
« Reply #13 on: July 11, 2021, 11:13:29 am »
And now just adjust the frame characters, so it looks nice (I changed all to a single dot, it's easier on the eye than what it is now).

They should not be defined as string (assuming that the box/frame characters are not single-byte codepoints in utf8 (I assume utf8 since juanirias is on *nix)).
Either declare them as array of string (Utf8) or array of WideChar?
(Untested proposal.)

When doing so make sure you save the source files as UTF8 encoded, and maybe you need {$codepage utf8} at the top of the sourcecode as well.

@Fred: I ended up removing all {$N+} directives (compiler complained about them) and inserted {$mode TP} in all source files (so integers are of the expeced size: 16-bit), assuming that at some point data in this form might be read in or written to file.
Did you do that as well?

If you really "need" this program, it might be worth while rewriting it as a Lazarus GUI program?

Bart

Fred vS

  • Hero Member
  • *****
  • Posts: 3828
    • StrumPract is the musicians best friend
Re: OLD code with machine specific instructions
« Reply #14 on: July 11, 2021, 12:32:18 pm »
Hello Bart.

I only removed all the {$N+} directives  but no, I did not inserted {$mode TP}.

Personally I dont need the program but it was fun to make it work.
And pleasant to see that fpc can revive old TP programs.

Fre;D
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

 

TinyPortal © 2005-2018