Skip to content

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
@Konamiman Konamiman merged commit feaa833 into v2.1.3 Jun 2, 2025
1 check failed
@Konamiman Konamiman mentioned this pull request Jun 2, 2025
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

2 participants