Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user eightbitswide ! (Registered 2024-12-24) You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Job codes - again
2003-10-14 20:53
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?
2003-10-14 20:58
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?
2003-10-15 14:52
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).
2003-10-16 00:46
Stryyker

Registered: Dec 2001
Posts: 468
Apologies to SounDemoN for giving some of his source but his exits via JMP $F505.
2003-10-16 17:02
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! :-)
2003-10-16 17:41
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 ;)

2003-10-17 10:11
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.
2003-10-17 10:33
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.
2003-10-17 14:37
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.
2003-10-17 23:41
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 >>
2003-10-17 23:47
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
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
slimeysmine
Martin Piper
No-XS
E$G/HF ⭐ 7
Guests online: 108
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 The Demo Coder  (9.6)
6 Edge of Disgrace  (9.6)
7 What Is The Matrix 2  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Cubic Dream  (9.6)
3 Party Elk 2  (9.6)
4 Copper Booze  (9.6)
5 X-Mas Demo 2024  (9.5)
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 Logo Graphicians
1 t0m3000  (10)
2 Sander  (9.8)
3 Mermaid  (9.5)
4 Facet  (9.4)
5 Shine  (9.4)

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