OLD code with machine specific instructions lazarus / 21-General ---------------------------------------------------------------------- juanirias · 2021-07-09 19:28 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][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Procedure Cursor_On;Procedure Cursor_Off;  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 ---------------------------------------------------------------------- Bart · 2021-07-09 20:52 Unit Crt has CursorOff and CursorOn procedures. Maybe you can use those? Bart ---------------------------------------------------------------------- winni · 2021-07-09 21:04 Hi! CurserOn is #27'[?2c' CursorOff is #27'[?1c' Winni ---------------------------------------------------------------------- MarkMLl · 2021-07-09 21:26 Quote from: winni on July 09, 2021, 11:04:01 pmHi! 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 ---------------------------------------------------------------------- Bart · 2021-07-09 21:29 Quote from: MarkMLl on July 09, 2021, 11:26:15 pmI 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 · 2021-07-09 21:40 I attach a pictures of the error when try to build. (original code) Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i fpc "support.pas" (in directory: /home/developer/wip/kelso)Free Pascal Compiler version 3.0.4+dfsg-22 [2019/01/24] for x86_64Copyright (c) 1993-2017 by Florian Klaempfl and othersTarget OS: Linux for x86-64Compiling support.passupport.pas(7,2) Warning: Unsupported switch "$N"support.pas(81,12) Error: Identifier not found "registers"support.pas(81,21) Error: Error in type definitionsupport.pas(83,13) Error: Expression type must be class or record type, got support.pas(85,5) Error: Identifier not found "ah"support.pas(86,5) Error: Identifier not found "ch"support.pas(87,5) Error: Identifier not found "cl"support.pas(89,3) Error: Identifier not found "Intr"support.pas(94,12) Error: Identifier not found "registers"support.pas(94,21) Error: Error in type definitionsupport.pas(96,13) Error: Expression type must be class or record type, got support.pas(98,5) Error: Identifier not found "ah"support.pas(99,5) Error: Identifier not found "ch"support.pas(100,5) Error: Identifier not found "cl"support.pas(102,3) Error: Identifier not found "Intr"support.pas(501) Fatal: There were 14 errors compiling module, stoppingFatal: Compilation abortedError: /usr/bin/ppcx64 returned an error exitcodeCompilation failed. regards, JUAN ---------------------------------------------------------------------- Bart · 2021-07-09 22:15 You simply don't need those procedures. Just replace them with CursorOn and CursorOff. Bart ---------------------------------------------------------------------- Fred vS · 2021-07-09 22:57 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][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i $ fpc TRAKSTAR.PAS Fre;D ---------------------------------------------------------------------- juanirias · 2021-07-10 18:56 Yes, when delete this, program work! How can try to get running under LINUX with modern PC? regards, JUAN ---------------------------------------------------------------------- Fred vS · 2021-07-10 19:02 Quote from: juanirias on July 10, 2021, 08:56:15 pmYes, 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: ---------------------------------------------------------------------- Bart · 2021-07-10 22:32 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 · 2021-07-10 22:51 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 ---------------------------------------------------------------------- Fred vS · 2021-07-11 03:11 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][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i $ cd /directrory/of/startrak Code: Bash  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i $ ./STARTRAK Fre;D ---------------------------------------------------------------------- Bart · 2021-07-11 09:13 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 · 2021-07-11 10:32 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 ---------------------------------------------------------------------- Bart · 2021-07-11 22:31 In the old days of TP 6, there was a unit called win. It came with a win.obj file, no source code. It was very fast. It was used by TurboVision framework IIRC. I used it in all my DOS programs that had title and statusbars. It had IIRC the following functions FrameWin: single- or double frame a window, with a title, then shrink the dimensions of the window by 1 in all directionsUnFrameWin: remove the frame border, increase window by 1 in all directions. It acted on the current defined Window IIRC. SaveWin: save the contents of the current window in an untyped bufferRestoreWin: put the saved content of a window back in the current window (dimensions must match)WriteStr: writes a string at current position, but does not cause a linefeed to occur. So you could write a character at the last X position of the screen I made a modified implementation of the first 2. It only needs the functionality of Crt unit. The latter 3 and 4 might be hard to implement. Don't know if 5 is possible. Bart ---------------------------------------------------------------------- marcov · 2021-07-12 08:37 Afaik TV does not use CRT. win.obj probably are assembler implementation of direct screenwrites. So 16-bit and optimized for old CPUs with slow muls, without cheap LEA etc.  Unless you plan to develop for 16-bit, probably useless. ---------------------------------------------------------------------- lucamar · 2021-07-12 09:22 AFAICT that unit has nothing to do with TV; it was just example code introduced in TP55 and, yes, it relies mostly on 16 bit assembler. I do have the source code (as would anyone with TP55), if anyone is interested; being an example I don't think Borland would care much about it ---------------------------------------------------------------------- Bart · 2021-07-12 09:58 Quote from: marcov on July 12, 2021, 10:37:02 amwin.obj probably are assembler implementation of direct screenwrites. So 16-bit and optimized for old CPUs with slow muls, without cheap LEA etc.  Unless you plan to develop for 16-bit, probably useless. I don't plan to do so. I was just trying to say that above similar procedures/functions as mentioned above would be a nice thing to have. Quote from: lucamar on July 12, 2021, 11:22:11 amI do have the source code (as would anyone with TP55), if anyone is interested; being an example I don't think Borland would care much about it Well, I do have the interface. Implementation  is most in the form of function_header; external; {WIN} Bart ---------------------------------------------------------------------- lucamar · 2021-07-12 13:24 Quote from: Bart on July 12, 2021, 11:58:05 amWell, I do have the interface. Implementation  is most in the form of function_header; external; {WIN} I've got the three: win.pas, win.asm and win.obj. Tell me if you're interested; it's basically what one would expect, direct read/writes from video memory, but it has some interesting quirks ---------------------------------------------------------------------- Bart · 2021-07-12 21:08 Quote from: lucamar on July 12, 2021, 03:24:36 pmI've got the three: win.pas, win.asm and win.obj. Tell me if you're interested; it's basically what one would expect, direct read/writes from video memory, but it has some interesting quirks I imagine it has. But, I'm not interested in the implementation code. I just was curious if similar functionality could be implemented in fpc, cross-platform that is. FrameWin/UnframeWin are the easy ones. Having WriteChar/WriteStr, especially the "don't insert a new line" when writing to the the right most X value, would really be nice. Bart ---------------------------------------------------------------------- MarkMLl · 2021-07-13 06:50 Quote from: Bart on July 12, 2021, 11:08:52 pmI just was curious if similar functionality could be implemented in fpc, cross-platform that is. I would suggest that that depends entirely on whether the underlying platforms allow you to do such a thing. If you're writing to a shell (command line) session in a character- oriented terminal emulator which doesn't provide an API for getting the instantaneous screen/window size (and doesn't provide an API for raising size-change events) then being 100% confident in your edge handling is impossible. MarkMLl