Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > [drive coding] Returning error 00 instead of 73.
2009-01-07 19:04
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


2009-01-07 19:16
tlr

Registered: Sep 2003
Posts: 1790
EB22  A2 45  LDX #$45
EB24  9A     TXS

i.e never returns, won't work.
2009-01-07 19:20
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
2009-01-07 19:40
tlr

Registered: Sep 2003
Posts: 1790
Perhaps sending a trivial drive command from the c64 side that does nothing and never fails?
2009-01-07 19:48
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.
2009-01-07 20:14
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.
2009-01-07 20:21
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
2009-01-07 20:43
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. :)
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
JSL
kbs/Pht/Lxt
Peacemaker/CENSOR/Hi..
REBEL 1/HF
krissz
Mibri/ATL^MSL^PRX
DeMOSic/MS^LSD^ONS
Sepa/OCD
Andy/AEG
MCM/ONSLAUGHT
theK/ATL
New Design/Excess
MightyAxle
Guests online: 104
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top Crackers
1 Mr. Z  (9.9)
2 Antitrack  (9.8)
3 OTD  (9.8)
4 Fungus  (9.8)
5 S!R  (9.8)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.042 sec.