Basic DERR command returns the last error code after the failure of a read or write file command1). UniDOS uses the very same error codes than AMSDOS, and like AMSDOS does, 7th bit let you know if the error was already reported or not, and 6th bit is set in case of low level error2).
In addition, UniDOS introduces some new error codes which are explained in the list bellow (added in bold to the AMSDOS errors):
Error AMSDOS/UniDOS | DERR value | Error description |
---|---|---|
0 | 0 ou 22 | [ESC] was pressed. |
14 | 142 (128+14) | Invalid channel state. |
15 | 143 (128+15) | Hardware end of file. |
16 | 144 (128+16) | Bad command. |
17 | 145 (128+17) | File already exists. |
18 | 146 (128+18) | File does not exist. |
19 | 147 (128+19) | Directory full. |
20 | 148 (128+20) | Media full. |
21 | 149 (128+21) | Media changed while files were opened. |
22 | 150 (128+22) | File is read-only. |
23 | 151 (128+23) | Path is a directory. |
24 | 152 (128+24) | File is not a symbolic link. |
25 | 153 (128+25) | Access type not supported by this physical drive. |
26 | 154 (128+26) | Software end of file. |
27 | 155 (128+27) | Path is a file whilst a directory was expected. |
28 | 156 (128+28) | Attempt to rename a file accross two different physical drives. |
29 | 157 (128+29) | Move file not supported by this physical drive. |
30 | 158 (128+30) | Real time clock not found. |
31 | 159 (128+31) | Real time clock is read only. |
When using the BASIC command LOAD or SAVE to change the current directory or to create a new one, it is returning a silent error (without any displayed message) to prevent the Basic from actually loading or saving anything (because obviously, no file at all is involved).
If it is harmless with direct input, this error will interrupt the execution of any Basic program issuing a LOAD or a SAVE on a directory, just like if a file was not found or of a bad type, with the notable difference that no message is displayed. If this behavior is not what you expect, you can simply use the |LOAD and |SAVE RSX instead of the Basic commands; those will not generate an error and the program will not be interrupted.
10 |LOAD,"SD:GAME/ACTION/" 20 PRINT"The current path is:":|PATH
If you want to use the LOAD and SAVE anyway, in case of an interactive program, you can actually catch the generated error with the ON ERROR GOTO command, and then determine if the user selected a directory, a file3) or if an error occured. Of course, you will have to take care of this in any Basic program dealing with directories through LOAD and SAVE commands. But if you just want to ignore the silent error related to directory change, here is an example:
10 ON ERROR GOTO 20:GOTO 100 20 IF ERR=32 AND DERR=151 THEN RESUME NEXT ELSE END 100 ' 110 LOAD"SD:GAMES/ACTION/" 120 PRINT"The current path is:":|PATH
UniDOS is, thanks to its paths and drives smart handling, strongly compatible with softwares designed for AMSDOS. And because of that, UniDOS is already able to run most major softwares from any modern drive whereas they were only planned to be launched from floppy discs. Almost all games in file versions will run under UniDOS, even the ones which are very restrictives regarding memory.
Please note that UniDOS is not CP/M compatible; all programs that have to be started using |CPM RSX will still require to be stored on floppy disc.
Even if they are compatible with UniDOS, most of the programs in the list bellow will only work if you are using the optimal installation4). Please also note that all games and demos available in files5) should work in this configuration.
In addition to the softwares exclusively designed to work from floppies and using trackloads, some utilities apparently system friendly do not work (yet)10).
Here are some tips and advices to use UniDOS at its best with applications initialy designed for AMSDOS and which obviously do not know how to deal with directories and drives (apart of legacy A: and B:).
Most softwares such as “The Advanced OCP Art Studio”, “Starkos” or “The Soundtrakker” are filtering file names depending on their extension so that they will only show you files they can handle. To be able to use directories anyway, you will just have to rename them with the expected extension (.SCR, .WIN, .PAT, .FNT, .SKS…). An error will be generally displayed when trying to load them, but it will be harmless and the directory will be actually changed!
That said, it will not work with some softwares (such as “The Soundtrakker”) because they do not properly handle file attributes or are also checking their size (directories are listed as protected file or size zero). Also, you won't be able to go to the parent directory, which can be annoying. In both cases, you will just have to use the symbolic links as explained bellow.
Symbolic links are very powerful objects which can be used in a number of cases. Actually, they will allow you to create anywhere entry points to any file, directory or drive. And when dealing with old softwares designed for AMSDOS, they can ease directory navigation.
For instance:
Thanks to its RSX |DEVTOOLS.ON
and |DEVTOOLS.OFF
, UniTools can activate (default state) and deactivate developper tool ROMs at CPC boot. To do so, ROMs considering themselves as developper tools must check a memory tag during their initialization phase. It can be done as follow:
; ; Code to insert at the beginning of the init routine of developper tool ROMs ; MagicNumber Equ &feca DisableROMTagAdr Equ &baf7 ROM_Init push hl ld bc,-MagicNumber ld hl,(DisableROMTagAdr+0) add hl,bc ld a,h or l pop hl jr nz,ROM_ActualInit ld a,(DisableROMTagAdr+2) and &40 ret nz ; NC ROM_ActualInit ... ; Actual ROM initialization code
Please note that Arnor's ROM proposed in the download section (Utopia, Protext and Maxam) have been patched to be considered as developper tools.
Here are some numbers to give you an idea to what you can expect performance wise.
Numbers given bellow are average on reading and writing 16 KiB files; time required for file system management is then included, which gives realistic speed for standard usage rather than burst values you will never reach.
Read | Write (direct) | Write (ROM overlay) |
|
---|---|---|---|
Floppy disc drives | 10 KiB/sec | 10 KiB/sec | 9 KiB/sec |
Albireo - MicroSD card11) | 70 KiB/sec | 25 KiB/sec | 16 KiB/sec |
Albireo - USB storage12) | 86 KiB/sec | 23 KiB/sec | 13 KiB/sec |
M4 Board - MicroSD card | 107 KiB/sec | 50 KiB/sec | 43 KiB/sec |
FatFs - X-Mass | 58 KiB/sec | 18 KiB/sec | 12 KiB/sec |
Theorical maximum | 120 KiB/sec | 120 KiB/sec | 80 KiB/sec |