Strange behavior in ESXDOS 0.8.6 beta 4

The place for codemasters or beginners to talk about programming any language for the Spectrum.
Post Reply
User avatar
Alessandro
Dynamite Dan
Posts: 1908
Joined: Wed Nov 15, 2017 11:10 am
Location: Messina, Italy
Contact:

Strange behavior in ESXDOS 0.8.6 beta 4

Post by Alessandro »

Yesterday I was performing some tests on real hardware, namely my two "guinea pigs" - a 48K with composite video and a +2A with a v4.1 ROM - and my DivMMC EnJoy! interface. In particular, I was checking that the forthcoming new version of my Al's Double Bill compilation would run without problems.

In the same occasion, I updated the interface's OS to ESXDOS 0.8.6 beta 4. And then something strange happened.

This is the listing for the BASIC "boot" loader program for the TRD disk image file. It checks whether the Beta Disk it is running on is an ordinary one or a clone, e.g. the Brazilian Arcade AR-20, IDS-91 or CBI-95 interfaces - I test these interfaces with SpecEmu v3.1 build 01/10/17 and ROM files for the interfaces as well as for the TK-90/95 Brazilian clones supplied by Victor Trucco and Flávio Matsumoto. Their point of access for BASIC commands is 15363 instead of 15619 as with the ordinary Beta Disk:

Code: Select all

10 BORDER NOT PI: PAPER NOT PI: INK NOT PI: BRIGHT SGN PI: CLEAR VAL "24499"
20 LET d=VAL "15363"+VAL "256"*(PEEK 15363<>195)
30 RANDOMIZE USR d : REM : LOAD "ADB" CODE
40 RANDOMIZE USR VAL "24500"
I explained the logic behind this loader in another thread.

Now, in ESXDOS 0.8.5 this gave me no problems. But in 0.8.6 beta 4 the file suddenly stopped working on the 48K. Soon I realized there could be something strange with the boot program and, after assigning the TRD image file to virtual drive A, I entered:

RANDOMIZE USR 15619 : REM : LOAD "boot"

and a LIST command showed me this:

Code: Select all

10 BORDER NOT PI: PAPER NOT PI: INK NOT PI: BRIGHT SGN PI: CLEAR VAL "24499"
20 LET d=VAL "15169"+VAL "256"*(PEEK 15619<>195)
30 RANDOMIZE USR d : REM : LOAD "ADB" CODE
40 RANDOMIZE USR VAL "24500"
Both 15363's had been mysteriously replaced by a 15619 and the variable d took the value 15875, thus making the file unusable.

Doing the same with a MERGE instead of a LOAD showed me that the 15363's in line 20 were left untouched instead.

I also ran a test with an emulated DivIDE in SpecEmu v3.1 build 01/10/17 and the results were the same.

To avoid problems and ensure compatibility I had to rework the boot program this way:

Code: Select all

10 BORDER NOT PI: PAPER NOT PI: INK NOT PI: BRIGHT SGN PI: CLEAR VAL "24499"
20 LET d=VAL "15169"-VAL "256"*(PEEK 15619=195)
30 RANDOMIZE USR d : REM : LOAD "ADB" CODE
40 RANDOMIZE USR VAL "24500"
This time no problems surfaced, both on real and emulated hardware.

I also updated the multi-language TRD and SCL files for Sophia accordingly, tested them successfully, and uploaded them to my website, where you can download them from if you experienced the same issues after updating the interface's OS to 0.8.6 beta 4. I will make them available in the SC archive as well of course.

Did anyone experience the same issue, or could anyone cast some light upon it, or both?

I wished to perform some tests with ESXDOS 0.8.6 beta 5.1 too, but I was unable to find a download link for it; moreover, I read several nasty stories about it - software incompatibilities, missing commands, crashes etc.
User avatar
Alessandro
Dynamite Dan
Posts: 1908
Joined: Wed Nov 15, 2017 11:10 am
Location: Messina, Italy
Contact:

Re: Strange behavior in ESXDOS 0.8.6 beta 4

Post by Alessandro »

A correction. The BASIC "boot" program listing is in fact as follows:

Code: Select all

10 BORDER NOT PI: PAPER NOT PI: INK NOT PI: BRIGHT SGN PI: CLEAR VAL "24499"
20 LET d=VAL "15169"-VAL "256"*(PEEK 15363=195)
30 RANDOMIZE USR d : REM : LOAD "ADB" CODE
40 RANDOMIZE USR VAL "24500"
With a real and emulated DivIDE/DivMMC with ESXDOS 0.8.6. beta 4, that 15363 in line 20 gets changed, the same mysterious way I illustrated in my previous post, to 15619. Therefore, the expression becomes

LET d = 15619 - 256 * 0 = 15619 - 0 = 15619

and the program works.

With the Beta Disk and clones thereof (at least under emulation ;) ) , the 15363 stays as it is, and the program works too. It is not a real correction after all, more like a workaround, but after all it makes the program compatible across all of the target platforms.

It seems that the LOAD routine in ESXDOS 0.8.6 beta 4 is bugged, then. Who knows?
lordcoxis
Drutt
Posts: 6
Joined: Sat Feb 17, 2018 9:15 pm

Re: Strange behavior in ESXDOS 0.8.6 beta 4

Post by lordcoxis »

Hi Alessandro,

What's causing that issue is the Beta48 parameter in the file /SYS/CONFIG/TRDOS.CFG:

Code: Select all

# Beta48 should be set to 1 to enable Beta 48 compatibility (BETA128 software should work as normal in most cases)
Beta48=1
Set it to 0 to disable that behaviour.
User avatar
Alessandro
Dynamite Dan
Posts: 1908
Joined: Wed Nov 15, 2017 11:10 am
Location: Messina, Italy
Contact:

Re: Strange behavior in ESXDOS 0.8.6 beta 4

Post by Alessandro »

Thank you lordcoxis! :D

For now, I think I will leave the loader as it is; I don't know whether the 'average' user would be able to modify the TRDOS.CFG file accordingly, or not. But at least now I know where the problem arises from.
Post Reply