Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2004-09

Yet another impossible task

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Jérémie LEFRANCOIS

I would be very happy to solve the following problem, any suggestion is welcome. I work with MS-DOS 6.2, trying to port from TP55 to Freepascal GO32. There is a terminate stay resident program (for which I have no access to the sources) that deals with the interface part of the application (GUI). It is started and installed at boot time (remember the old autoexec.bat). It is the acceessed by just writing to the screen sequences with a special begin sequence and end sequence. To put it more simply, in order to open a window the Pascal program must issue a writeln('#19#254#1,'open window mywindow.aid',#1); I want to avoid writing over again all the screen managing routines.

Of course I know that the TSR concept is 16 bits and that freepascal works in 32 bit.

Any ideas ?
__________________
Jérémie Lefrançois
Consultant
Altran Technologies

Reply by email

Thomas Schatzl
to Jérémie LEFRANCOIS

Hello,

Show quoted text 14 lines
I would be very happy to solve the following problem, any suggestion is welcome. I work with MS-DOS 6.2, trying to port from TP55 to Freepascal GO32. There is a terminate stay resident program (for which I have no access to the sources) that deals with the interface part of the application (GUI). It is started and installed at boot time (remember the old autoexec.bat). It is the acceessed by just writing to the screen sequences with a special begin sequence and end sequence. To put it more simply, in order to open a window the Pascal program must issue a writeln('#19#254#1,'open window mywindow.aid',#1); I want to avoid writing over again all the screen managing routines. Of course I know that the TSR concept is 16 bits and that freepascal works in 32 bit. Any ideas ?

From your description the TSR program seems to intercept DOS-interrupt 21h and interpretes the given data if it goes to the standard output (just a guess - maybe wrong :)

You can verify this if you set 'directvideo := true;' in the TP5.5 program (if it uses CRT) and interacting with the TSR should not work anymore ;-)
[Not sure if there's already this flag in TP 5.5 CRT unit]

So *if* this is the case, the TSR should already work with FPC programs that don't use the CRT unit. This is because the CRT unit basically always does direct writing to the video memory, bypassing the DOS interface similar to when 'directvideo := true' in TP.

You can try by making a simple example program which does not use CRT trying to send some data to the TSR.
If this works, you only have to redo the parts of the CRT unit which assume direct memory access and are required by your program. I think this is easier than doing the windowing stuff.

But, then again, I'm just guessing....

Regards,
Thomas

Reply by email

Stefan Becker
to Jérémie LEFRANCOIS: I would be very happy to solve the following problem, any suggestion is welcome. I work…

Am Donnerstag, 2. September 2004 11:23 schrieb Jérémie LEFRANCOIS:

What does this "writing to screen" accually need to do. Create colors? change charator fonts? You mentiononed Create Windows for example.

Probably ANYTHING you need to do can be done with the oCrt or nCrt units. Remember the win.pas unit in Turbopascal. I have a working portation for that if you want it. Compiles for DOS or LINUX.

Could it be that your TSR is a simple ANSI.SYS display driver?

my regards,

Stefan Becker

Show quoted text 23 lines
I would be very happy to solve the following problem, any suggestion is welcome. I work with MS-DOS 6.2, trying to port from TP55 to Freepascal GO32. There is a terminate stay resident program (for which I have no access to the sources) that deals with the interface part of the application (GUI). It is started and installed at boot time (remember the old autoexec.bat). It is the acceessed by just writing to the screen sequences with a special begin sequence and end sequence. To put it more simply, in order to open a window the Pascal program must issue a writeln('#19#254#1,'open window mywindow.aid',#1); I want to avoid writing over again all the screen managing routines. Of course I know that the TSR concept is 16 bits and that freepascal works in 32 bit. Any ideas ? __________________ Jérémie Lefrançois Consultant Altran Technologies _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Jérémie LEFRANCOIS
to Thomas Schatzl: From your description the TSR program seems to intercept DOS-interrupt 21h and…

Yes, you got the point.
This works fine if you remove the "uses crt" clause. Thanks. And thanks to Stefan Becker as well.

En réponse à Thomas Schatzl :

Show quoted text 58 lines
Hello, Jérémie LEFRANCOIS schrieb: > I would be very happy to solve the following problem, any suggestion is welcome. > I work with MS-DOS 6.2, trying to port from TP55 to Freepascal GO32. > There is a terminate stay resident program (for which I have no access to the > sources) that deals with the interface part of the application (GUI). > It is started and installed at boot time (remember the old autoexec.bat). > It is the acceessed by just writing to the screen sequences with a special begin > sequence and end sequence. To put it more simply, in order to open a window the > Pascal program must issue a writeln('#19#254#1,'open window mywindow.aid',#1); > I want to avoid writing over again all the screen managing routines. > > Of course I know that the TSR concept is 16 bits and that freepascal works in 32 > bit. > > Any ideas ? From your description the TSR program seems to intercept DOS-interrupt 21h and interpretes the given data if it goes to the standard output (just a guess - maybe wrong :) You can verify this if you set 'directvideo := true;' in the TP5.5 program (if it uses CRT) and interacting with the TSR should not work anymore ;-) [Not sure if there's already this flag in TP 5.5 CRT unit] So *if* this is the case, the TSR should already work with FPC programs that don't use the CRT unit. This is because the CRT unit basically always does direct writing to the video memory, bypassing the DOS interface similar to when 'directvideo := true' in TP. You can try by making a simple example program which does not use CRT trying to send some data to the TSR. If this works, you only have to redo the parts of the CRT unit which assume direct memory access and are required by your program. I think this is easier than doing the windowing stuff. But, then again, I'm just guessing.... Regards, Thomas _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

__________________
Jérémie Lefrançois
06 73 27 35 97
Consultant
Altran Technologies

Reply by email