Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify ZAP_ALL to skip drives assigned to device-based drivers #147

Open
wants to merge 1 commit into
base: v2.1.3
Choose a base branch
from

Conversation

Konamiman
Copy link
Owner

@Konamiman Konamiman commented Jan 25, 2025

The ZAP_ALL routine, called when the _FLUSH function call is executed with the "invalidate" flag, deletes all the unit descriptors, the idea being that they will be regenerated on the next drive access.

While this works fine for MSX-DOS drives and Nextor drives assigned to drive-based drivers, for device-based drives this means that the drive will undergo an autoassign procedure, which often will result in the drive either getting a different mapping or no mapping at all; this is confusing and probably not what the user wants.

This pull request modifies ZAP_ALL so that it skips the deletion of unit descriptors assigned to device-based drivers.

Closes #146

How to test

This can be tested by mapping ani drive to a non-default mapping, for example mapdrv h: 2 1 0 to map partition 2 of device 1 in the primary mapper to drive H: (assuming that the drive is unmapped by default). Then run the following code:

ld b,0FFh ;All drives
ld c,5Fh ;_FLUSH
ld d,0FFh ;Invalidate
call 5

Without this fix this results in drive H: getting unmapped, with this fix the drive mapping is unaffected.

ZAP_ALL deletes all unit descriptors, and is called
when _FLUSH with the "invalidate" option is executed.
While on MSX-DOS and drive-based drivers this has no
negative consequences, for units on device-based drivers
this implies that the drive is reverted to its default
state, which may mean "unmapped". Thus these must be
skipped in the zapping process.
@Konamiman Konamiman self-assigned this Jan 25, 2025
@Konamiman Konamiman added this to the v2.1.3 milestone Jan 25, 2025
@Konamiman Konamiman changed the base branch from v2.1 to v2.1.3 January 25, 2025 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

_FLUSH (5Fh) unmaps drives when the "flush and invalidate" flag is set
1 participant