| |
Majikeyric
Registered: Sep 2002 Posts: 83 |
Problem coding my own loading routine
Hi,
I'm not a loading routine programming guru, in fact in so many years that's the fist time I try myself to this...
I have read a lot of manuals and all say that if an error occurs when calling a kernal routine the carry flag is set but it doesn't seem to be really the case, here is my problem when in this little piece of code, there is an error when calling the OPEN routine, the carry is not set ?!! (e.g when opening a non existing file) and the CHKIN call just behind makes the machine crashes... :-(
How can I check if the file was successfully opened ???
lda FilenameLen
ldx #<Filename --> a non existing file
ldy #>Filename
jsr SETNAM
lda #8
ldx $ba
ldy #0
jsr SETLFS
jsr OPEN
bcs ERROR --> carry not set if an error occured ?!!
ldx #8
jsr CHKIN --> crash !!! :-(
I want my loading routine to run on all kind of drives (1541/CMD HD+FD/IDE64...).
Thank you very much !!! |
|
... 20 posts hidden. Click here to view all posts.... |
| |
soci
Registered: Sep 2003 Posts: 480 |
Yes, I know that with careful timing it's possible to find out from the expansion port if it's "safe" to map in external ROM to $e000 using the ultimax configuration. But with the IDE64 hardware available it's only possible to replace the KERNAL with an SCPU or other hacks. Unfortunately this still stands today ;( |
| |
Flavioweb
Registered: Nov 2011 Posts: 463 |
The original question is how to intercept errors during a file OPEN function.
OPEN don't set carry because in kernal routines are LOAD and SAVE that do this job, checking $90 and setting carry accordingly with value readed.
If we need to use OPEN, we need also to check 90 manually seting carry propely if an error (timeout or others) is detected.
Checking error channel is only to know what kind of error is, because 90 reports generic timeout, eof, or device not present flags.
This works on all devices, including IDE64. |
Previous - 1 | 2 | 3 - Next |