MEGA65 / mega65-core

MEGA65 FPGA core
Other
240 stars 85 forks source link

HYPPO: d81attach0/1 fails with D64 size check #620

Closed lydon42 closed 1 year ago

lydon42 commented 1 year ago

A d64 image is not attached, as the dos_d81check routine does not check it's size correctly.

In addition the whole "which image is it" is done double in d81check and d81attach0 and d81attach1. So it would be reasonable to store the detection result of d81check, and not check sizes again in attach to set the flags correctly.

lydon42 commented 1 year ago

There is currently a systematic problem with the image attach/detach functions.

Currently we have a d81attach0 and d81attach1 function call, to attach an image to either drive 0 or 1. Then there is a d81detach which will detach both images at once. Both calls will update the internal processdescriptor to reflect the image currently attached.

There is no call to just detach one image, which in my eyes is missing. Because of that BASIC MOUNT will just use pokes to unmount the image on one drive, which is then not reflected in the display of the FREEZER. In the same way it is not actually detaching the image, but it is attaching the internal drive. For this there is also no call. And so there is also no update to processdescriptor.

The proposal is to:

This way all old calls will stay compatible.

lydon42 commented 1 year ago

494 has the same "problem" as d81_detach. We should implement a similar solution here.

lydon42 commented 1 year ago

This fixes the size check close file problem, But I keep it open, because I would like to reorganize the hyppo mount functions and also provide a single drive unmount.

lydon42 commented 1 year ago

Working in 620-hyppo-dos13

lydon42 commented 1 year ago

Removing enhancement part from bug part for clarity. Work continues in #628