nealcrook / nascom

Software, utilities and documentation for the Z80-based NASCOM2 computer
14 stars 4 forks source link

setdrv does not complain about non-existent file #1

Closed nealcrook closed 4 years ago

nealcrook commented 6 years ago

setdrive 3 FILE.BIN

expects FILE.BIN to exist and blindly opens it by name. If the file did not exist it gets created and is zero-sized which causes havoc when you try to do eg a DIR on it.

It's a Known/defined behaviour of the code on the arduino that it responds to an open in this way, so the bug is in the z80 utility. I already coded a kinda-fix for this in the PolyDos ROM TSTDSK routine and just need to replay it here. Alternatively, think about creating a new command on the arduino to handle this

nealcrook commented 4 years ago

This is fixed in the latest version of setdrv.asm and in the built version on the PolyDos disk image PD001.BIN

The fix is to do an OPENR (open for read) command and error out if it fails. If it succeeds, do an OPEN (open for read/write)

I also now allow file 4 to be specified; this file is reserved for a yet-to-be-implemented print spooler.