| |
sailor
Registered: Jan 2002 Posts: 90 |
[drive coding] Returning error 00 instead of 73.
Hello,
i stumbled upon a fastloader that uploads the drivecode and then resets the drive through a JMP $EB22 (this is done on every load, and yes, i know its not optimal).
Anyhow... it will ofcourse set the (next) errormsg to "73, CBM DOS V2.6 1541", but some (external) programs checking the errorchannel might expect error "00, OK" coming up after a load.
Whats a safe way to change this?
I thought something of:
JSR $EB22 ; reset (Without RAM/ROM test)
LDA #$00 ; err message 0
JMP $E6C1
..is this safe, or will the reset waste drivemem at $0300-$07ff, or is there a "better" built in reset ?
Regards
Jani
|
|
| |
tlr
Registered: Sep 2003 Posts: 1790 |
EB22 A2 45 LDX #$45
EB24 9A TXS
i.e never returns, won't work. |
| |
sailor
Registered: Jan 2002 Posts: 90 |
hm yes, i realized that now when i started poking on it..
any ideas to solve this ?
edit: this could of course be solved on the c64 side, querying the chan after each load, but that sounds a bit overkill...
/Jani |
| |
tlr
Registered: Sep 2003 Posts: 1790 |
Perhaps sending a trivial drive command from the c64 side that does nothing and never fails? |
| |
tlr
Registered: Sep 2003 Posts: 1790 |
Even better:
1: copy $eb22-$ebd4 somewhere.
2: add rts at end.
3: jsr <location>
4: lda #$00
5: jmp $ebd7
That segment of code seems relocatable enough. |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: Even better:
1: copy $eb22-$ebd4 somewhere.
2: add rts at end.
3: jsr <location>
4: lda #$00
5: jmp $ebd7
That segment of code seems relocatable enough.
Well, don't forget to remove that evil TXS or bye bye with the RTS. So, I'd suggest copy $eb25-$ebd4 instead. |
| |
sailor
Registered: Jan 2002 Posts: 90 |
Thanks for your replies, has given some ideas :)
Had a thought, that the drive _might_ always return 73* even if an error occures since it hits the reset, not verified though. Got to check that out too.
If the case above is true and if the errorchan is read for example "file not found". It will give trouble if it's used in a turn disk query.
/Jani |
| |
tlr
Registered: Sep 2003 Posts: 1790 |
Quote: Well, don't forget to remove that evil TXS or bye bye with the RTS. So, I'd suggest copy $eb25-$ebd4 instead.
doh!
Of course. I was meaning to terminate with a jump and then screwed up. :) |