Re: [fpc-pascal] Textmode IDE splitscreen?

2016-07-25 Thread James Richters
Thanks for the info. I will give it a try.   I was doing some DOS function 
calls, inline assembly,  and direct hardware access with PORT[ ] commands.  I 
just went though and commented out everything that wouldn’t work so it would 
compile and now I’m finding ways to make those things work.  I have the bulk of 
it working great, still a few minor details to work out, but it’s a LOT less 
work than a complete rewrite!

 

From: fpc-pascal-boun...@lists.freepascal.org 
[mailto:fpc-pascal-boun...@lists.freepascal.org] On Behalf Of Sven Barth
Sent: Monday, July 25, 2016 6:25 PM
To: FPC-Pascal users discussions 
Subject: Re: [fpc-pascal] Textmode IDE splitscreen?

 

Am 25.07.2016 22:52 schrieb "James Richters"  >:
> I've tried Lazarus, for some reason I can't even get my program to compile
> with Lazarus, I get pages of errors.  Maybe I just don't know how to get
> Lazarus into Turbo Pascal Compatible mode..

In your project's settings there is somewhere among the compiler options 
(sorry, I don't have it on front of me right now) a combobox that allows you to 
select the default mode. This is normally "ObjFPC", but you want to switch that 
to "TP".
Alternatively you can add "{$mode tp}" at the top of each of your units.

Please keep in mind though that quite some DOS tricks won't work when compiled 
on Windows (due to virtual memory, different API, etc.). Though as long as your 
program does not do any strange hardware accesses you should be fine.

Regards,
Sven

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Weird string behavior

2016-07-25 Thread Mattias Gaertner
On Mon, 25 Jul 2016 23:23:23 +0200
Jonas Maebe  wrote:

> On 25/07/16 23:07, Mattias Gaertner wrote:
> > DefaultSystemCodePage = 1252
> > s3 = "abcdef" cp = 65001  
> 
> Thanks. So the rule for concatenation appears to be:
> * the dynamic code page of the result of a string concatenation is that 
> of the left operand (except if it's an empty string, then it's that of 
> the right operand)
> * the declared code page of the final concatenation result is that of 
> the left operand

Here are some more hints:

{$APPTYPE CONSOLE}

type
   tcp866 = type ansistring(866);

var
   s1, s2: tcp866;
   u1: UTF8String;
   r1: RawByteString;
begin
   s1:='abc';
   setcodepage(rawbytestring(s1),65001,false);
   Writeln('s1 = "', s1, '" cp = ', StringCodePage(s1));
   u1:='nop';
   Writeln('u1 = "', u1, '" cp = ', StringCodePage(u1));
   s2:=s1+u1;
   Writeln('s2 = "', s2, '" cp = ', StringCodePage(s2));
   s2:=u1+s1;
   Writeln('s2 = "', s2, '" cp = ', StringCodePage(s2));
   r1:=s1+u1;
   Writeln('r1 = "', r1, '" cp = ', StringCodePage(r1));
   r1:=u1+s1;
   Writeln('r1 = "', r1, '" cp = ', StringCodePage(r1));
   readln;
end.

s1 = "abc" cp = 65001
u1 = "nop" cp = 65001
s2 = "abcnop" cp = 866
s2 = "nopabc" cp = 866
r1 = "abcnop" cp = 1252
r1 = "nopabc" cp = 1252


Mattias
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Textmode IDE splitscreen?

2016-07-25 Thread Sven Barth
Am 25.07.2016 22:52 schrieb "James Richters" :
> I've tried Lazarus, for some reason I can't even get my program to compile
> with Lazarus, I get pages of errors.  Maybe I just don't know how to get
> Lazarus into Turbo Pascal Compatible mode..

In your project's settings there is somewhere among the compiler options
(sorry, I don't have it on front of me right now) a combobox that allows
you to select the default mode. This is normally "ObjFPC", but you want to
switch that to "TP".
Alternatively you can add "{$mode tp}" at the top of each of your units.

Please keep in mind though that quite some DOS tricks won't work when
compiled on Windows (due to virtual memory, different API, etc.). Though as
long as your program does not do any strange hardware accesses you should
be fine.

Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Weird string behavior

2016-07-25 Thread Jonas Maebe

On 25/07/16 23:07, Mattias Gaertner wrote:

DefaultSystemCodePage = 1252
s3 = "abcdef" cp = 65001


Thanks. So the rule for concatenation appears to be:
* the dynamic code page of the result of a string concatenation is that 
of the left operand (except if it's an empty string, then it's that of 
the right operand)
* the declared code page of the final concatenation result is that of 
the left operand


You then process the assignment as if you are assigning a string with 
the above declared/dynamic code page to whatever you are assigning the 
result of the concatenation to (which means no code page conversion in 
case the declared code pages match, like in the above case).


That's indeed not what FPC does currently. It's mainly complicated by 
the fact that FPC contains optimised helpers to avoid the final 
assignment if possible and directly concatenate into the destination 
when possible (those helpers right now only get passed the declared code 
page of the final destination, and not that of the concatenation, and 
hence virtually always convert the result to the dynamic code page of 
the destination at this time -- there are some exceptions for rawbytestring)



Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Weird string behavior

2016-07-25 Thread Mattias Gaertner
On Mon, 25 Jul 2016 22:25:59 +0200
Jonas Maebe  wrote:

> On 23/07/16 13:31, Petr Kohut wrote:
> > Hello,
> > here are results:  
> 
> Thanks a lot. Could you test one more? I think I will have all 
> information I need then.
> 
> 
> Jonas
> 
> {$APPTYPE CONSOLE}
> 
> type
>tcp866 = type ansistring(866);
> var
>s1, s2, s3: tcp866;
> begin
>s1:='abc';
>setcodepage(rawbytestring(s1),65001,false);
>s2:='def';
>setcodepage(rawbytestring(s2),437,false);
>s3:=s1+s2;
>Writeln('DefaultSystemCodePage = ',DefaultSystemCodePage);
>Writeln('s3 = "', s3, '" cp = ', StringCodePage(s3));
>Readln;
> end.

DefaultSystemCodePage = 1252
s3 = "abcdef" cp = 65001

Mattias
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Textmode IDE splitscreen?

2016-07-25 Thread James Richters
>If you are using Windows, you can compile the IDE in FPC trunk with gdb/mi
support, 
>which works by opening your program in a new console window, so it gets the
effect
>you want already under Windows. Lazarus also does the same thing, if you
don't mind 
>using a newer IDE.

I'm using Windows,  Can you explain exactly what you mean by "compile the
IDE in FPC trunk with gdb/mi support" to be honest that went right over my
head.Are you talking about an option inside the existing IDE I should
turn on that changes how my program compiles so it gets a separate window,
or that I somehow recompile the IDE itself with some option so that it
always executes my program in a new window? 

I've tried Lazarus, for some reason I can't even get my program to compile
with Lazarus, I get pages of errors.  Maybe I just don't know how to get
Lazarus into Turbo Pascal Compatible mode..   

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Weird string behavior

2016-07-25 Thread Jonas Maebe

On 23/07/16 13:31, Petr Kohut wrote:

Hello,
here are results:


Thanks a lot. Could you test one more? I think I will have all 
information I need then.



Jonas

{$APPTYPE CONSOLE}

type
  tcp866 = type ansistring(866);
var
  s1, s2, s3: tcp866;
begin
  s1:='abc';
  setcodepage(rawbytestring(s1),65001,false);
  s2:='def';
  setcodepage(rawbytestring(s2),437,false);
  s3:=s1+s2;
  Writeln('DefaultSystemCodePage = ',DefaultSystemCodePage);
  Writeln('s3 = "', s3, '" cp = ', StringCodePage(s3));
  Readln;
end.


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Textmode IDE splitscreen?

2016-07-25 Thread Nikolay Nikolov



On 07/25/2016 12:57 AM, James Richters wrote:

Is there a way to get the textmode IDE to do splitscreen the way Turbo
Pascal used to if you had both a color and monochrome monitor?  It was very
handy to trace through the source code on the monochrome monitor and watch
it execute on the other one.. It prevented all the screen flashing when it
had to output something to the screen as you traced through the program.
I've been doing this on windows with TurboPascal with a customized version
of DOSBOX that would show the monochrome monitor in a separate window from
the color monitor.  Any suggestions for getting two windows with Free Pascal
textmode IDE?
If you are using Windows, you can compile the IDE in FPC trunk with 
gdb/mi support, which works by opening your program in a new console 
window, so it gets the effect you want already under Windows. Lazarus 
also does the same thing, if you don't mind using a newer IDE.


For go32v2, it is possible to add dual (color and monochrome) display 
support and in fact I have such a machine working right now (featuring a 
CGA and an EGA in monochrome mode), but it only has an 8088 CPU, so 
go32v2 (which requires a 386+) won't run on it. But thanks to that I 
have already added detection of two video cards in the graph and crt 
units for i8086-msdos and I have ported the code to go32v2 as well. But 
these units provide support for only writing/drawing to a single 
display, so my dual display code involve only detection of all the 
available video modes from both monitors and video cards, but when you 
set an actual video mode, you still only write to a single screen. 
That's how the interface of these units was designed. The same thing 
applies to the video unit, which the IDE uses. But, as Pierre said, the 
IDE uses special code for switching to/from the user screen, so that 
support can be implemented in the IDE code. And the IDE can only be 
compiled on go32v2, because it includes the compiler and that doesn't 
fit in the memory constraints of i8086-msdos (640kb isn't enough for 
everybody :) ).


I've thought about trying to setup a dual-monitor configuration on a 
386+ and adding dual-monitor go32v2 IDE support, but the only 386+ I 
have, that has two ISA slots, is a K6-2 and I doubt if it's possible to 
configure it to run with two 8-bit ISA video cards, provided that this 
is a PCI/AGP era machine. I haven't tried it yet, but I suspect the BIOS 
would scream bloody murder if it doesn't find a VGA card on either one 
of the PCI slots or on the AGP slot. Has anybody tried something like 
this yet? :) I know it sounds fun to try, but it'd be a lot of hassle 
swapping all of these cards (both the ISA slots are occupied by sound 
cards right now, and there's an AGP video card as well, which has to be 
removed, otherwise it would conflict with the CGA and the EGA).


Nikolay
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] old school crc32

2016-07-25 Thread wkitty42

On 07/25/2016 11:22 AM, geneb wrote:

On Sun, 24 Jul 2016, wkitt...@windstream.net wrote:

On 07/24/2016 10:15 AM, geneb wrote:

I don't know if you've looked at SWAG yet, but there's a couple of 32
bit CRC routines there.


hey gene! fancy seeing you here instead of the flightgear areas ;) ;) ;)

i do have all of SWAG here... back in the day, we grabbed each new release
as it was available from Fidonet... we've even had some of our stuff
published in SWAG back in the day :)


Excellent. :)  Do you happen to have archives of the PASCAL and PASCAL_LESSONS
echos by chance?


sorry, i do not... my system only keeps the last three years of posts based on 
their date... i wish that i had set numerous echomail areas to no purging but 
back then (early '80s) the message base formats were rather limited and blew up 
spectacularly when their limits were exceeded (think hudson message base)... 
when i was able to switch to another message base format, much of the 
interesting stuff was already long gone :(



--
 NOTE: No off-list assistance is given without prior approval.
   *Please keep mailing list traffic on the list* unless
   private contact is specifically requested and granted.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Textmode IDE splitscreen?

2016-07-25 Thread James Richters
I stand corrected, Now that I think of it, I also had the IDE on the color
screen and program executing on monochrome. however most of my programs used
the turbo pascal graph unit so my executing program needed the VGA screen...
I guess I got used to it being set up like that. 
Thanks for correcting me.

-Original Message-
From: fpc-pascal-boun...@lists.freepascal.org
[mailto:fpc-pascal-boun...@lists.freepascal.org] On Behalf Of Ralf Quint
Sent: Monday, July 25, 2016 8:32 AM
To: fpc-pascal@lists.freepascal.org
Subject: Re: [fpc-pascal] Textmode IDE splitscreen?

On 7/25/2016 5:06 AM, James Richters wrote:
> The TurboPascal version used to write to B800-B7FF for the monochrome 
> monitor and A000-AFFF for the color monitor, the IDE was always on 
> monochrome and the program executing was always on color... that's how 
> it worked,
No, it didn't.

The monochrome screen RAM is at segment address $B000 and while a whole 32KB
is reserved ($-B7FF), only the first 4KB are in fact used. (80x25
characters, 2 bytes per character=4000 bytes) The Hercules graphics card did
use the whole 32KB when in graphics mode.

The default page for color text mode (mode 3) starts at $B800, is also 4KB
and a total of 8 pages are available up to $BFFF, though an original CGA
card had  only 16KB and hence only the first 4 pages are available.

And it was a choice which screen appears on which monitor, selectable as a
parameter upon start of the IDE. I in fact used to run most of the time with
the IDE on the color screen and the program output on the monochrome screen,
unless I would explicitly test a program with color screen features.

$A000 is the start of the EGA/VGA graphics screen, not a text screen segment
address...

Ralf

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] old school crc32

2016-07-25 Thread geneb

On Sun, 24 Jul 2016, wkitt...@windstream.net wrote:


On 07/24/2016 10:15 AM, geneb wrote:


I don't know if you've looked at SWAG yet, but there's a couple of 32 bit
CRC routines there.


hey gene! fancy seeing you here instead of the flightgear areas ;) ;) ;)

i do have all of SWAG here... back in the day, we grabbed each new release as 
it was available from Fidonet... we've even had some of our stuff published 
in SWAG back in the day :)


Excellent. :)  Do you happen to have archives of the PASCAL and 
PASCAL_LESSONS echos by chance?


g.

--
Proud owner of F-15C 80-0007
http://www.f15sim.com - The only one of its kind.
http://www.diy-cockpits.org/coll - Go Collimated or Go Home.
Some people collect things for a hobby.  Geeks collect hobbies.

ScarletDME - The red hot Data Management Environment
A Multi-Value database for the masses, not the classes.
http://scarlet.deltasoft.com - Get it _today_!
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Textmode IDE splitscreen?

2016-07-25 Thread Ralf Quint

On 7/25/2016 5:06 AM, James Richters wrote:

The TurboPascal version used to write to B800-B7FF for the monochrome
monitor and A000-AFFF for the color monitor, the IDE was always on
monochrome and the program executing was always on color... that's how it
worked,

No, it didn't.

The monochrome screen RAM is at segment address $B000 and while a whole 
32KB is reserved ($-B7FF), only the first 4KB are in fact used. (80x25 
characters, 2 bytes per character=4000 bytes) The Hercules graphics card 
did use the whole 32KB when in graphics mode.


The default page for color text mode (mode 3) starts at $B800, is also 
4KB and a total of 8 pages are available up to $BFFF, though an original 
CGA card had  only 16KB and hence only the first 4 pages are available.


And it was a choice which screen appears on which monitor, selectable as 
a parameter upon start of the IDE. I in fact used to run most of the 
time with the IDE on the color screen and the program output on the 
monochrome screen, unless I would explicitly test a program with color 
screen features.


$A000 is the start of the EGA/VGA graphics screen, not a text screen 
segment address...


Ralf

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Textmode IDE splitscreen?

2016-07-25 Thread James Richters
The TurboPascal version used to write to B800-B7FF for the monochrome
monitor and A000-AFFF for the color monitor, the IDE was always on
monochrome and the program executing was always on color... that's how it
worked,  but all that is really needed to help improve debugging with
freepascal is to get the "User Screen ALT-F5" to be in a different window so
you don't need to switch windows back and forth when trying to trace through
a program or watch variables.   It is updating both screens now, just you
can only see one at a time.   I have no idea how to get a second window
though, since it's running in a command prompt.  DOSBox already had 2
windows, someone made a patch to display the monochrome addresses in the
status window.. it was a little quirky but it worked.Maybe there needs
to be another program running in another DOS window and the two programs
have some way to send the screen to the second window and receive keystrokes
back.


-Original Message-
From: fpc-pascal-boun...@lists.freepascal.org
[mailto:fpc-pascal-boun...@lists.freepascal.org] On Behalf Of Pierre Free
Pascal
Sent: Monday, July 25, 2016 5:21 AM
To: 'FPC-Pascal users discussions' 
Subject: Re: [fpc-pascal] Textmode IDE splitscreen?

  Hello,

  The TextMode IDE is based on the package FV short for Free Vision, which
tries to follow TurboVision interface.

  But there is nothing inside that package that deals with dual monitor, so
I don't think this is possible with the current TextMode IDE.

  

  If you are only looking for a solution for the go32v2 IDE, what Dos Video
mode does your split screen correspond to?

  The switching between User and IDE is done mainly in ide/fpusrscr.pas
unit.
  Look for TDosVideoInfo record and TDosScreen object, and try to look into
the code how the support for your special split mode could be integrated.

  If the two screens have different Segments associated (look for VSeg local
variables in SaveIDEScreen, SaveConsoleScreen, SwitchToConsoleScreen and
SwitchBackToIDEScreen methods), it might be possible to  the code quite
easily.

In the hope it could lead to an improvement of the go32v2 IDE,

Pierre Muller



> -Message d'origine-
> De : fpc-pascal-boun...@lists.freepascal.org [mailto:fpc-pascal- 
> boun...@lists.freepascal.org] De la part de James Richters Envoyé : 
> dimanche 24 juillet 2016 23:57 À : 'FPC-Pascal users discussions'
> Objet : [fpc-pascal] Textmode IDE splitscreen?
> 
> Is there a way to get the textmode IDE to do splitscreen the way Turbo 
> Pascal used to if you had both a color and monochrome monitor?  It was 
> very handy to trace through the source code on the monochrome monitor 
> and watch it execute on the other one.. It prevented all the screen 
> flashing when it had to output something to the screen as you traced 
> through the program.
> I've been doing this on windows with TurboPascal with a customized 
> version of DOSBOX that would show the monochrome monitor in a separate 
> window from the color monitor.  Any suggestions for getting two 
> windows with Free Pascal textmode IDE?
> 
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org 
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Textmode IDE splitscreen?

2016-07-25 Thread Pierre Free Pascal
  Hello,

  The TextMode IDE is based on the package FV
short for Free Vision, which tries to follow
TurboVision interface.

  But there is nothing inside that package that deals with
dual monitor, so I don't think this is possible with the
current TextMode IDE.

  

  If you are only looking for a solution for the go32v2 IDE,
what Dos Video mode does your split screen correspond to?

  The switching between User and IDE is done mainly in
ide/fpusrscr.pas unit.
  Look for TDosVideoInfo record and TDosScreen object,
and try to look into the code how the support for your special
split mode could be integrated.

  If the two screens have different Segments associated (look for VSeg 
local variables in SaveIDEScreen, SaveConsoleScreen, SwitchToConsoleScreen
and SwitchBackToIDEScreen methods),
it might be possible to  the code quite easily.

In the hope it could lead to an improvement of the go32v2 IDE,

Pierre Muller



> -Message d'origine-
> De : fpc-pascal-boun...@lists.freepascal.org [mailto:fpc-pascal-
> boun...@lists.freepascal.org] De la part de James Richters
> Envoyé : dimanche 24 juillet 2016 23:57
> À : 'FPC-Pascal users discussions'
> Objet : [fpc-pascal] Textmode IDE splitscreen?
> 
> Is there a way to get the textmode IDE to do splitscreen the way Turbo
> Pascal used to if you had both a color and monochrome monitor?  It was
> very
> handy to trace through the source code on the monochrome monitor and
> watch
> it execute on the other one.. It prevented all the screen flashing when
> it
> had to output something to the screen as you traced through the
> program.
> I've been doing this on windows with TurboPascal with a customized
> version
> of DOSBOX that would show the monochrome monitor in a separate window
> from
> the color monitor.  Any suggestions for getting two windows with Free
> Pascal
> textmode IDE?
> 
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal