I think I have found a way to solve my problem, bypassing the impossibility of inserting a protected disk into the drive.
I make SEDORIC believes that the disc is protected by "manually" forcing the variable $C017 to $40 just before the output test of the disc write routine in $CFE5.
for that, in the oricutron debugger, you must first put a breakpoint: bs $CFE5, return to the game and try to save a file, the debugger opens, type mm$ C017 $40 then exit the debugger to check if your disk error handling routine is giving the expected results
Code: Select all
The end of the code of the SEDORIC XRWTS routine, extracted from SEDORIC a NU by André C
CFE3 LDA #FF mask for C017 test
CFE5 BIT C017 set Z,N and V
CFE8 RTS
ref.
P 12 SEDORIC A NU : C017 - 00 ________ I/O error code
In the Annex 11 page 108 of the MICRODIC and SEDORIC users manual one can read
#FFC4 XRWTS : Access to the drive management routine.... Output Z=1 if no error, Z=0 otherwise. V=1 if the diskette is write-protected.
V being the bit 6 of the status register, the BIT instruction between #FF and the value #40 set this bit to 1.
I tested this method.... It works
(and my I/O error handling works too
)