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 > Krill loader not working
2014-10-19 20:28
Chesoner

Registered: Apr 2013
Posts: 29
Krill loader not working

Hi There,

We are still strungling with the Krill loader, I have to say that we have progressed a lot but we get the following problem :

If we use the following command :

Make prg INSTALL=4000 RESIDENT=9000 zp=10

The install is working good at 4000 but the loader is still located at 0400. if we forced it to load at 9000 it ain't working.

Are we doing something wrong here ?
 
... 55 posts hidden. Click here to view all posts....
 
2014-12-05 10:43
Krill

Registered: Apr 2002
Posts: 2980
Maybe we should move the stepper discussion over to another thread. But i'll come to that in a future post.

Chesoner: Why did you post here before sending me a PM or mail or similar? Also your choice of topic is unfortunate, as it implies something is wrong with the loader, while so far it seems that the error lies elsewhere.
2014-12-05 11:33
Krill

Registered: Apr 2002
Posts: 2980
Concerning the stepper:

I'm not entirely sure if that's on-topic, but the stepper coils can indeed be misaligned with regard to the actual position, on real hardware and in emulation alike.

This is the case when the upper of the two stepper bits is flipped with regard to the "correct" value - the coil opposite to the "correct" coil is magnetized, but the head won't move.
In normal operation, by incrementing or decrementing the 2-bit stepper value, you'd magnetize either of the two other coils clockwise or counter-clockwise next to the original one, and the head would move one step.

However, with the upper bit flipped, the head would go in the wrong direction upon the first increment or decrement on the 2-bit stepper value, but in the intended direction afterwards, thus ultimately landing a bit off the desired destination.

In practice, a misaligned stepper value may happen on a drive reset. Disregarding the current stepper value, the two stepper bits are initialised to %00, and, when misaligned, only upon the first disk access would they be aligned with the actual position by the firmware.

Now, of course, if no disk access happens before running your custom loader code, it must correct things itself. In my loader, i solved the issue like this:
            lda INITBUF_TRACK_DIFF
            bne findtrackn; branch if the drive had already seeked before the loader has been started
            ; the drive was reset immediately before running the loader -
            ; step down a track: this works normally if the stepping bits are congruent with the stepper motor;
            ; however, it may happen that the bits are misaligned (opposite to the actual stepper position, bit 1
            ; reversed), this alone does not move the head but stepping makes it go into the direction opposite to
            ; the one desired when moving; the stepping down two halftracks will actually step up and step down one
            ; halftrack each and thus will end up on the same track as before, but align the stepper bits to the motor.
            ldx #$02
            stx CURTRACK
            dex
            jsr trackseekx

            ; find current track number
            ; this assumes the head is on a valid half track
findtrackn:
Thus, if the stepper bits were aligned, the head is moved for two steps, i.e., one track. If they were misaligned, the head is moved one half-track in one direction and another in the opposite, ultimately landing on the same track as before.
2014-12-05 12:09
Chesoner

Registered: Apr 2013
Posts: 29
Quote: Maybe we should move the stepper discussion over to another thread. But i'll come to that in a future post.

Chesoner: Why did you post here before sending me a PM or mail or similar? Also your choice of topic is unfortunate, as it implies something is wrong with the loader, while so far it seems that the error lies elsewhere.


Next time I post : Krill loader is working great but is not working correcly at my place.. oke ?
2014-12-05 12:12
Krill

Registered: Apr 2002
Posts: 2980
I'd prefer something more or less neutral, e.g. "Problems with Krill's loader".

Anyhow, feel free to send a minimal build that exhibits the symptoms you mentioned, and i'll see if i can find something.
2014-12-05 13:36
Celtic
Administrator

Registered: Jan 2002
Posts: 807
Krill to the rescue!
2014-12-05 13:38
doynax
Account closed

Registered: Oct 2004
Posts: 212
Chesoner: Sorry about all of the off-topic discussion. My bad.

Now then, to further compound my sins..

Krill: Good to know, thanks. I see you're testing $42 (seek target) instead of $22 (current track), thereby avoiding avoiding any problems if the drive should start-up on a misaligned directory track. I really should have taken a close look at all of these subtle details when rearranging your code into a loader of my own ;)

Did you ever notice the track slipping between motor stops? There's a big warning sign in the VICE sources which Groepaz linked to about the coils are being demagnetized while the motor is off, presumably to avoid overheating the coils. I suppose it might be safest to at least avoid parking the head too close to track 35.
2014-12-05 14:46
Krill

Registered: Apr 2002
Posts: 2980
Quoting doynax
Did you ever notice the track slipping between motor stops? There's a big warning sign in the VICE sources which Groepaz linked to about the coils are being demagnetized while the motor is off, presumably to avoid overheating the coils. I suppose it might be safest to at least avoid parking the head too close to track 35.
No, i never noticed. The motor is turned off long after the stepper has settled, and switching off the current coil presumably would not move the head.
Why track 35? Because you might end up in the woods (track 35.5) on a standard-format disk and wouldn't find your way out?
2014-12-05 15:22
chatGPZ

Registered: Dec 2001
Posts: 11386
btw: there are original games that step by toggling the motor off/on
2014-12-05 15:25
Krill

Registered: Apr 2002
Posts: 2980
Quoting Groepaz
btw: there are original games that step by toggling the motor off/on
Without touching the stepper bits? How would they control in which direction to step?
2014-12-05 15:27
chatGPZ

Registered: Dec 2001
Posts: 11386
of course the coil bits are changed as well, else nothing moves :) but the motor is started and stopped in between, and coils changed several times when motor is off (to obscure what really happens)
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 - 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
Brittle/Dentifrice^(?)
Guests online: 80
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 Triad  (9.3)
5 Censor Design  (9.3)
Top Diskmag Editors
1 Magic  (9.8)
2 hedning  (9.6)
3 Jazzcat  (9.5)
4 Elwix  (9.1)
5 Remix  (9.1)

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