DOSBOX scrambles screen when running FreePascal

Developer's Forum, for discussion of bugs, code, and other developmental aspects of DOSBox.

DOSBOX scrambles screen when running FreePascal

Postby jcoppens » 2010-4-05 @ 23:00

Hello guys,

I ran into trouble using DOSemu and FreePascal, so I thought giving DosBox a try. While in DosEmu there seem to be problems with resources, Dosbox does another, quite strange trick:

Just the text output from 'fpc', which lists the command line options, shows scrambled on the screen. I tried several options for the screen modes, no luck. I'll attach a screenshot of the window, as it's difficult to describe.

I'd appreciate suggestions!
John

(Running Linux, kernel 2.6.33, X-windows 7.5, DosBox 0.73, fpc 2.4.0)
Attachments
dosbox.png
Screenshot of the first page of the help, which appears when running 'fpc'.
dosbox.png (21.9 KiB) Viewed 3322 times
jcoppens
Newbie
 
Posts: 4
Joined: 2008-7-15 @ 21:29

Re: DOSBOX scrambles screen when running FreePascal

Postby jcoppens » 2010-4-05 @ 23:03

The first line (under c:\) should say 'Free Pascal Compiler...)
Apparently columns 3, 4, 7, 8, 11, 12, etc are ok. The other
two are scrambled
jcoppens
Newbie
 
Posts: 4
Joined: 2008-7-15 @ 21:29

Re: DOSBOX scrambles screen when running FreePascal

Postby wd » 2010-4-05 @ 23:33

Works fine here (dosbox 0.73 under vista, free pascal 2.4.0). Anybody else under linux who can try that please?
wd
DOSBox Author
 
Posts: 10819
Joined: 2003-12-03 @ 21:23

Re: DOSBOX scrambles screen when running FreePascal

Postby fluxit » 2010-4-06 @ 09:24

I don't know if this helps as my "current" environment is very different from the op, but here is dosbox .73 on Puppy Linux 1.09ce (xorg 6.8.1, kernel 2.4.29)
Attachments
dosbox.png
dosbox.png (16.61 KiB) Viewed 3281 times
fluxit
Newbie
 
Posts: 17
Joined: 2008-2-29 @ 03:43
Location: The Last Frontier

Re: DOSBOX scrambles screen when running FreePascal

Postby HunterZ » 2010-4-06 @ 20:08

Almost looks like some kind of interleaving or endianness issue going on inside of DOSBox.

I see that there are characters such as ` and @ that are in the corrupted screenshot but not in the uncorrupted one.
You're perfect, yes it's true...but without me, you're only you.
User avatar
HunterZ
l33t++
 
Posts: 5777
Joined: 2003-1-31 @ 19:04
Location: Seattle

Re: DOSBOX scrambles screen when running FreePascal

Postby wd » 2010-4-06 @ 20:50

I'd expect the colours/attributes to be scrambled as well then.
wd
DOSBox Author
 
Posts: 10819
Joined: 2003-12-03 @ 21:23

Re: DOSBOX scrambles screen when running FreePascal

Postby ripsaw8080 » 2010-4-06 @ 21:03

The first line where it has "$FP HUL XER JON" instead of the 2.4.0 version number does not appear to be anything like an endian issue... it's like the % format identifiers in a printf have been mis-processed or something. Do other apps and games work correctly on the same system?
User avatar
ripsaw8080
DOSBox Author
 
Posts: 3342
Joined: 2006-4-25 @ 23:24

Re: DOSBOX scrambles screen when running FreePascal

Postby nickysn » 2012-1-09 @ 21:27

Yesterday I spent some time debugging this problem. I found the reason and submitted a bug report with more details here:

https://sourceforge.net/tracker/?func=detail&aid=3471200&group_id=52551&atid=467232
nickysn
Newbie
 
Posts: 1
Joined: 2012-1-09 @ 21:19

Re: DOSBOX scrambles screen when running FreePascal

Postby wd » 2012-1-09 @ 21:54

There's not much way round that besides using a full-softfloat implementation which is quite the worst thing to do anyways.
wd
DOSBox Author
 
Posts: 10819
Joined: 2003-12-03 @ 21:23

Re: DOSBOX scrambles screen when running FreePascal

Postby Qbix » 2012-1-10 @ 07:22

I recall that lately here was a patch to enable the dynamic fpu on 64 bit linux. maybe try that one
Water flows down the stream
How to ask questions the smart way!
User avatar
Qbix
DOSBox Author
 
Posts: 9763
Joined: 2002-11-27 @ 14:50
Location: Fryslan

Re: DOSBOX scrambles screen when running FreePascal

Postby Zorbid » 2012-1-10 @ 09:36

Possible workaround, with a smaller overhead than a full soft float implementation:

You could duplicate the FPU stack (full and double precision). Have fild push to both, and fist(p) pop from the full precision stack only if no other FPU operation occurred in the mean time.
User avatar
Zorbid
Member
 
Posts: 424
Joined: 2002-8-30 @ 18:38

Re: DOSBOX scrambles screen when running FreePascal

Postby TeaRex » 2012-1-10 @ 10:53

wd wrote:There's not much way round that besides using a full-softfloat implementation which is quite the worst thing to do anyways.


Besides Microsoft compilers, are there any other major compilers currently in use for building DOSBox that offer no native support for an 80 bits or larger "long double" type, and/or lack the basic math functions for long double?

In case you have a 128-bit type but not 80 bits, a few (ugly) bit-shifting macros should be enough to convert between 80 bits and 128 bits, no? True, it'd probably end up as an #ifdef mess but still might help with problems such as the one described in this thread.

If some compiler or library just doesn't offer functions such as square root, trigonometrics and logarithms with better than 64 bit precision - I'd assume that compatibility with many programs might be improved even if you use 80 bits just for elementary arithmetics in the emulated FPU and leave the special functions in 64 bit precision.

Probably there's some mistake in my thinking or else you'd have done this already, but I'd love to know where I go wrong...
tearex
TeaRex
Member
 
Posts: 398
Joined: 2005-2-06 @ 07:39

Re: DOSBOX scrambles screen when running FreePascal

Postby wd » 2012-1-10 @ 15:24

if no other FPU operation occurred in the mean time.

That's exactly the problem. But maybe it works for the compiler thing.
wd
DOSBox Author
 
Posts: 10819
Joined: 2003-12-03 @ 21:23

Re: DOSBOX scrambles screen when running FreePascal

Postby Zorbid » 2012-1-11 @ 10:07

More accurate approach: tag each FPU register as pristine or tainted.

But I would be surprised if FPU operations were performed during a memcpy.
User avatar
Zorbid
Member
 
Posts: 424
Joined: 2002-8-30 @ 18:38

Re: DOSBOX scrambles screen when running FreePascal

Postby wd » 2012-1-11 @ 12:47

At least one game very well does operations on it (to have screen masks).
wd
DOSBox Author
 
Posts: 10819
Joined: 2003-12-03 @ 21:23


Return to DOSBox Development

Who is online

Users browsing this forum: Bing [Bot] and 0 guests