atarist-sidecart-raspberry-pico icon indicating copy to clipboard operation
atarist-sidecart-raspberry-pico copied to clipboard

STOS error when loading .bas files when GEM Drive is active

Open NZSPY opened this issue 1 year ago • 3 comments

STOS lunches and appears to run correctly, but when you try to fload a .BAS file from the STOS CLI you get an error messages "Bad file format"

STE 4BM RAM Ultra Satan with PP V1.01hs Gotec with HXC Sidecart TOS emulator

I have tried the following and get the same error

STOS completely installed on the GEM drive. (no other drives running) :FAIL STOS completely installed on Ultra Satan Drive (.bas file on GEM Drive): FAIL STOS completely installed on Ultra Satan Drive (.bas file on US Drive): FAIL STOS completely installed on Ultra Satan Drive (.bas file on GoTec Drive): FAIL SidecarT in Floppy mode STOS on USD (.bas File on USD) : PASS SidecarT in Floppy mode STOS on USD (.bas File on SidecarT Floppy) : PASS SidecarT in Floppy mode STOS on USD (.bas File on GoTec Drive) : PASS

Repeated the same tests with the following TOS versions

EmuTOS 1.3.0 256KB - English UK - 50Hz.img EmuTOS 1.3.0 256KB - English US - 60Hz.img TOS 1.06 - English-UK 50Hz.img TOS 1.06 - English-US 60Hz.img TOS 1.62 - English-UK 50Hz.img TOS 1.62 - English-US 60Hz.img TOS 2.05 - English-UK 50Hz.img TOS 2.05 - English-US 60Hz.img TOS 2.06 - English-UK 50Hz.img TOS 2.06 - English-US 60Hz.img TOS 2.06 - SuperTOS 50Hz.img

Interestingly if I save a .bas while running the GEM drive, it does save it correctly and the file loads perfectly from there USD, SidecarT floppy and Gotec floppy once GEM drive functions are turned off

NZSPY avatar Nov 10 '24 17:11 NZSPY

I can confirm the same behavior with the provided version.

Based on the traces in the GEMDRIVE code, it reads the first ten bytes of the file where the magic word "Lionpoulos" appears, then closes the file and releases the file handle without reporting any errors. My guess is it should continue loading the rest of the .BAS file, but it stops after reading (correctly) the first 10 bytes.

I'll investigate further by enabling additional traces in various GEMDOS calls.

Thank you for the detailed feedback.

diegoparrilla avatar Nov 14 '24 00:11 diegoparrilla

Thanks for looking at this, besides playing games on my STE, trying to write some in STOS is my other hobby, and if this could work from the GEM drive. It would mean I don't need to have the Ultra Satan etc.. Can run everything from one Large Fat32 Partition... Rather than been limited to lots of 512kB Fat 16 partitions etc.

I did find a work around.. if I load a .bas file using the US drive with GEMdrive turned off and save it in the .asc format. STOS does load the .ASC file from the GEM drive etc

NZSPY avatar Nov 14 '24 04:11 NZSPY

I will continue investigating the issue. It can be an edge case where the file-read GEMDOS call "assumes" that some register is not going to change (or has to change), and the GEMDRIVE implementation modifies the value. The bad news is it's hard to debug and fix. The good news is it makes the driver more reliable.

The funny thing is that STOS loads the file header successfully, but it decides that it is not properly formatted.

diegoparrilla avatar Nov 14 '24 18:11 diegoparrilla