Recent

Author Topic: WriteLn and DOSBox  (Read 11103 times)

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1125
    • Burdjia
WriteLn and DOSBox
« on: April 05, 2021, 05:28:01 pm »
Not sure if it is a problem of Free Pascal or DOSBox, but WriteLn isn't working correctly in that emulator.  It does in Windows XP.

See next simple program:
Code: Pascal  [Select][+][-]
  1. program test;
  2. begin
  3.   WriteLn ('This is a test program.  Should write text in the console.');
  4.   WriteLn ('This is a test program.', '  Should write text in the console.')
  5. end.
  6.  
Compiling for DOS 32bit Go32V2 and executing in DOSBox it looks like the attached file.  See that first WriteLn renders incorrectly, while second renders correctly.

Also see that heaptrc output has issues too.

Maybe that's why FPC doesn't work in DOSBox (internal error 2004121202)?
« Last Edit: July 03, 2021, 06:00:27 pm by Ñuño_Martínez »
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: WriteLn and DOSBox
« Reply #1 on: April 05, 2021, 06:16:27 pm »
I can confirm that there is somethign fishy going on; see attached image (FPC 3.0.4 in DOSBox 0.74 under Linux x86_64)
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 897
Re: WriteLn and DOSBox
« Reply #2 on: April 05, 2021, 07:27:28 pm »
You may want to try DOSBox-X, which aims for compatibility with regular programs as well rather than just with games. I recently read something about issues with FPC's LFN support and DOSBos-X, but afaik other than that it works.

MarkMLl

  • Hero Member
  • *****
  • Posts: 3034
Re: WriteLn and DOSBox
« Reply #3 on: April 05, 2021, 07:45:33 pm »
I swear I've seen something like that before, but I've never used DOSBox, only DosEmu,

Lucamar's example is downright weird: every 4th column lost except for the vertical lines.

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1125
    • Burdjia
Re: WriteLn and DOSBox
« Reply #4 on: April 05, 2021, 09:39:30 pm »
You may want to try DOSBox-X, which aims for compatibility with regular programs as well rather than just with games. I recently read something about issues with FPC's LFN support and DOSBos-X, but afaik other than that it works.
I didn't know about this project.  I should take a look. Thanks.

I can confirm that there is somethign fishy going on; see attached image (FPC 3.0.4 in DOSBox 0.74 under Linux x86_64)
Lucamar's example is downright weird: every 4th column lost except for the vertical lines.
That's just what happens with the installer.

And the same problem with FreeDOS. :(
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

Re-searcher

  • New Member
  • *
  • Posts: 16
Re: WriteLn and DOSBox
« Reply #5 on: May 21, 2021, 07:41:54 pm »
@ Ñuño_Martínez ,

You should not use Dosbox but the command prompt from windowsXP
Now install the program Go32V2 in de command prompt.

Erik

Handoko

  • Hero Member
  • *****
  • Posts: 4327
  • My goal: build my own game engine using Lazarus
Re: WriteLn and DOSBox
« Reply #6 on: May 21, 2021, 08:04:40 pm »
I remember the issue write does not work correctly on DosBox was asked one or two years ago.

MarkMLl

  • Hero Member
  • *****
  • Posts: 3034
Re: WriteLn and DOSBox
« Reply #7 on: May 21, 2021, 08:36:05 pm »
Lucamar's example is downright weird: every 4th column lost except for the vertical lines.

...The difference obviously being that the vertical lines aren't in the Unicode BMP.

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: WriteLn and DOSBox
« Reply #8 on: May 21, 2021, 09:35:45 pm »
Lucamar's example is downright weird: every 4th column lost except for the vertical lines.
...The difference obviously being that the vertical lines aren't in the Unicode BMP.

I don't understand what you're trying to say; the problem is everywhere; just look at the menus: intead of:
| New from template...|
it shows:
  Ne  f om t mpl te . .|

Note also that there is no problem with the right-side vertical lines. In fact, of no single character can be said that it never appears except those on the far left, and that's probably because their position not their values.

Last, WTH has the unicode BMP to do with this? Like any other DOS emulator (or even DOS itself), DOSBox doesn't use Unicode but IBM code pages and FP has been working correctly* inside it up to now. Which means something has changed in the IDE itself, introducing some bug.


* Well, more or less, depending on the code page since some don't contain all the "box" characters.
« Last Edit: May 21, 2021, 09:38:51 pm by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

MarkMLl

  • Hero Member
  • *****
  • Posts: 3034
Re: WriteLn and DOSBox
« Reply #9 on: May 21, 2021, 10:00:58 pm »
The point I'm trying to make is that characters outside the BMP appear to be going through OK, so it could be something very weird related to character handling on that platform. As I've said, I think I've seen something similar with DOSEmu in the past... which probably wouldn't have been FPC, which suggests a platform problem (e.g. a commonly-used library to convert between DOS-like screen handling and Curses or whatever).

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: WriteLn and DOSBox
« Reply #10 on: May 21, 2021, 10:37:53 pm »
Note that Ñuño also said:
And the same problem with FreeDOS. :(
so it doesn't seem to be a problem of the host platform but of the IDE itself. Unless he means "FreeDOS in DosEmu" or alike, o.c.

I'll have to take the dust out of one of my older computers and test in real hardware ... some day or other :D
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

MarkMLl

  • Hero Member
  • *****
  • Posts: 3034
Re: WriteLn and DOSBox
« Reply #11 on: May 28, 2021, 09:30:09 pm »
If I were to look at this running natively e.g. because I decided to re-cap a scrap PC, what would I need to know? Presumably I'd need FreeDOS (which I've never played with) but what else... Go32V2? Where do I find the latter etc.?

I'd be very surprised if there really were a FreeDOS problem, since it's used by HP etc. to host setup programs.

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: WriteLn and DOSBox
« Reply #12 on: May 28, 2021, 11:15:27 pm »
If I were to look at this running natively e.g. because I decided to re-cap a scrap PC, what would I need to know? Presumably I'd need FreeDOS (which I've never played with) but what else... Go32V2? Where do I find the latter etc.?

You'd need a DOS (it doesn't have to be FreeDOS, though I'd recommend it) computer and the Go32v2 release of Free Pascal, nothing else. Though, if you can (and want to) I'd also install a full Borland/Turbo Pascal (e.g. v7.0).
And maybe Windows 3.1 and Delphi 1.0* ;)

I have got preconfigured IDE disks with MS/Free/Open- DOS with quite a lot of things (editors, TP/BP, BC++, MASM, FP, Win3.11+Delphi, several tools, ...) but that might be overkill if you just want to do a little test :-[


* There is a free download of Delphi 1 Client/Server at Embarcadero ... :-X
« Last Edit: May 28, 2021, 11:22:35 pm by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

MarkMLl

  • Hero Member
  • *****
  • Posts: 3034
Re: WriteLn and DOSBox
« Reply #13 on: May 29, 2021, 10:43:19 pm »
Well, that's been an interesting exercise... ** ***

Leaving everything else aside, I can confirm that FPC 3.2.0 on Go32V2 running directly on i386 hardware (Sony Miaow laptop) renders all characters and character positions correctly, in particular the menu that you showed in your posting.

So I'd put my money on this being a problem in a library or BIOS facility used by multiple x86 emulators. ****

** The reason I was interested in looking at this was that I wanted to see how nicely FreeDOS played with other OSes etc. So far, I suspect that most of the problems I've seen were down to misinterpreted sector addresses, i.e. LBA vs non-LBA partition table entries, but things were hardly helped by- at one point- my thinking that I couldn't boot the FreeDOS CD and inadvertently having my drive letters messed up by the USB loader on floppy. This really takes me back to messing around with LILO 25 years ago...

*** I must admit that I've got a weakness for reimagined OSes. One of the nicest I've come across was IBM's VM/CMS, where the mainframe card reader and punch had been quietly turned into an inter-user messaging system.

**** I think this is the first time I've played with a DOS extender since about 1989.

MarkMLl

Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Re-searcher

  • New Member
  • *
  • Posts: 16
Re: WriteLn and DOSBox
« Reply #14 on: June 21, 2021, 11:40:56 am »
@MarkMLI

Can you tell us which dos version is installed on this laptop (Sony Miaow laptop) ?

Before installing GO32V2.

Erik

 

TinyPortal © 2005-2018