-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Test Environment (required)
Tested with V920418
Describe the bug
The ROM tracks the current position of the read/write head, which can only move via relative stepping. On first use, the head’s position is unknown, so it is stepped outward until the track 0 sensor is activated. However, the remembered head position is not reset when Hyppo switches between virtual and physical drives. While the controller’s auto-tune feature can partially compensate for this issue, disabling it makes the problem more noticeable.
To Reproduce
Steps to reproduce the behavior:
- Mount the physical disk via MOUNT and do DIR. This will make sure the physical head position is at track 40
- Clear $D696.7 which is related to the track auto-tuning feature
- Mount a D81 image with the MOUNT"IMAGE.D81" command
- Load a program, eg. via LOAD"*". This will make sure the virtual head position is not at track 40 anymore.
- MOUNT again the physical disk
- Do DIR. The head will move (but shouldn't as it already is on track 40, see above). It will try to find sector 40:0, but will only find sectors from a different track, eventually resulting in 27,READ ERROR,40,00
Expected behavior
The directory should be shown.
Additional context
I was looking into the ROM src how the current track position is handled for the internal drive. Indeed, there is a curtrack array keeping that information per drive. On reset, this is initialized with 128, and on each access, we check whether the NEG flag is set for that drive. If it is, we assume the head's track position is unknown and execute a seek-to-track-0 routine, and then keep track of the head position whenever we step in or out.
On the other hand, it seems the controller's auto-tune feature is still enabled, which also will trigger stepping of the motor. I am wondering whether it is better to turn that off as the DOS is doing its own positioning.
In any case, we should reset the drive's curtrack value to 128 if the drive's state changed from virtual to physical, as then the head position is unknown again. Maybe we can add a check of the related register whenever a new drive access is triggered. That check could be added to InitCtlr.
