| |
Cybernator
Registered: Jun 2002 Posts: 154 |
Job codes - again
I'm having some strange problems:
1. Execute ($E0) doesn't seem to be positioning the head as mentioned in some docs.
2. Seek ($B0) works the first time I call it, but later it returns an error: "SYNC not found".
Upon closer investigation, I realized that the head is not in read-mode. Seek is supposed to activate the motor, and the head on its own. I've tried disabling ATN IRQ, just in case it causes some trouble. But nope... Does anyone have any clue of what could be wrong? Any tips? |
|
| |
cadaver
Registered: Feb 2002 Posts: 1160 |
Do you mess with the head/motor etc. on your own, too? Not sure if this will cause confusion though..
What happens if you "play nice" and let interrupts be on & don't touch yourself anything but the bits in $1800 necessary to transmit data? |
| |
Cybernator
Registered: Jun 2002 Posts: 154 |
No, I don't mess with the mechanics on my own. All I'm doing is this:
lda track
ldx sector
sta 6
stx 7
lda #$e0
sta 0
lda 0
bmi *-2
And the code in the buffer:
jsr $f50a (to find the data block)
<gcr reader/decoder>
rts
Btw, will RTS work, or do I need to do JMP somewhere at ROM??? (like doing JMP $EA31 to exit interrupt on C64, assuming I'm using software vectors).
|
| |
Stryyker
Registered: Dec 2001 Posts: 468 |
Apologies to SounDemoN for giving some of his source but his exits via JMP $F505. |
| |
Cybernator
Registered: Jun 2002 Posts: 154 |
Hey dudez! How come no one told me that I mustn't use $0200-$02FF ??? ;-P
Ugh! This was a pain, really. Another waste of CSDb's web space.
Oh, well! :-) |
| |
raven Account closed
Registered: Jan 2002 Posts: 137 |
Hmm Cybernator..
Its a good thing to take a look at the 1541's ROM
listing & memory-map before actually coding
something for it ;)
|
| |
Puterman Account closed
Registered: Jan 2002 Posts: 188 |
My boss always says that if there's something you don't know, call someone and ask. Cybernator seems to have the same policy. |
| |
Cybernator
Registered: Jun 2002 Posts: 154 |
I've, of course, checked various docs, eg. 'Inside C= DOS', and noticed something like 'working buffer' at $0200. I wasn't sure what exactly this meant. Then I remembered that I wasn't able to place my code at $0200 using memory-write, so the problem was immediately clear.
The reason I've asked is because I couldn't find solution for a while. |
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
$0200+ contains a lot of system variables just like the zeropage. as "working buffer" i would describe $01BA-$01FF and $0300-$03FF since all block encoding/decoding is done there. |
| |
6R6
Registered: Feb 2002 Posts: 245 |
Hello Cybernator
Here's something to load a file.
* = $0400
nextsec lda #3 ;Use buffer 0 ($0300-$0400)
sta $31
jsr $f50a (to find the data block)
<gcr reader/decoder>
<handshaking>
lda $0301
sta 9 ;next sector
lda $0300
beq lastsec
cmp 8
beq nextsec
.byte $2c
lastsec lda #0
sta 8
jmp $f418 ;Exit to disk controller, all ok
lda track
ldx sector
sta 8 ;t+s for buffer $0400
stx 9
more
lda #$e0
sta 1 ;Execute at $0400
lda 1
bmi *-2
lda 9
bne more
jmp $c194 ;Exit control to drive with no errors.
;Incase you invoked this with a
;user command. (U3,4,5,6 etc..)
If I am not mistaking you have to exit to disk controller
when the track link (0300) in the data block changes,
else there be errors...
<< GRG / SHAPE >> |
| |
6R6
Registered: Feb 2002 Posts: 245 |
lda 8
bne more
jmp $c194 ;Exit control to drive with no errors.
<a quick bug patch > |
... 5 posts hidden. Click here to view all posts.... |
Previous - 1 | 2 - Next |