You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When switching back to the internal drive after having mounted a D64 image, DIR returns an "ILLEGAL TRACK OR SECTOR" error.
To Reproduce
Steps to reproduce the behavior:
MOUNT <D64 image>
DIR that image (important as DOS initializes things at this point)
MOUNT (use internal drive with formatted disk)
DIR this shows the error: 66, ILLEGAL TRACK OR SECTOR,62,63
Expected behavior
The directory of the disk inserted in the internal drive should be shown.
Additional context
The Freezer's internal disk mount doesn't have this issue (while using HICKUP.M65 that includes $D084 -- the last track accessed). This is curious as MOUNT tries to mimic Freezer's behavior when switching to the internal drive.
I noticed that set_dimag isn't using $D68B's flags that indicate if a disk image is mounted. It only uses $D68A's flags that indicate if the mounted drive is D64 or D81. The $D68A flags don't seem to be valid if an image isn't mounted. Just fixing that isn't enough, however. I was thinking that set_dimag should also force a disk change flag if an image is mounted or its type changes (i.e. dimag changes). That should cause DOS to recalculate certain things about the disk.
However, since the Freezer works, perhaps there is a simpler solution.
I do wonder if we'll keep dancing around these types of issues and, in the end, finally bite the bullet and just re-initialize the drive when MOUNT is called (using UI drive command). The Freezer would not be able to do that directly though.
The text was updated successfully, but these errors were encountered:
Using hyppo_attach won't reset the internal DOS state unless it's updating the disk change flag. That flag ($D083.0), which doesn't currently as far as I know, is probably the key to helping DOS know when to reset the state for a drive.
In https://github.com/MEGA65/mega65-rom/pull/81 I'm simulating that flag getting set when the mounted image type changes or an image is mounted/unmount (using flags in $D68A and $D68B). This seems to sufficiently simulate a working disk change flag for now.
Test Environment (required)
Describe the bug
When switching back to the internal drive after having mounted a D64 image, DIR returns an "ILLEGAL TRACK OR SECTOR" error.
To Reproduce
Steps to reproduce the behavior:
MOUNT <D64 image>
DIR
that image (important as DOS initializes things at this point)MOUNT
(use internal drive with formatted disk)DIR
this shows the error:66, ILLEGAL TRACK OR SECTOR,62,63
Expected behavior
The directory of the disk inserted in the internal drive should be shown.
Additional context
The Freezer's internal disk mount doesn't have this issue (while using HICKUP.M65 that includes $D084 -- the last track accessed). This is curious as MOUNT tries to mimic Freezer's behavior when switching to the internal drive.
I noticed that
set_dimag
isn't using $D68B's flags that indicate if a disk image is mounted. It only uses $D68A's flags that indicate if the mounted drive is D64 or D81. The $D68A flags don't seem to be valid if an image isn't mounted. Just fixing that isn't enough, however. I was thinking thatset_dimag
should also force a disk change flag if an image is mounted or its type changes (i.e.dimag
changes). That should cause DOS to recalculate certain things about the disk.However, since the Freezer works, perhaps there is a simpler solution.
I do wonder if we'll keep dancing around these types of issues and, in the end, finally bite the bullet and just re-initialize the drive when
MOUNT
is called (usingUI
drive command). The Freezer would not be able to do that directly though.The text was updated successfully, but these errors were encountered: