stephen_usher wrote: Fri Aug 08, 2025 1:42 pm
So, potentially an update to the Pico Microdrive emulation has to do is count the toggles and use that to select the image in memory that it's accessing.
I wonder if the simplest method of selecting which image the SD card loads into would be to maybe have two edge connectors, one for each BBQL microdrive location with a switch to tell the Pico which one is occupied. A main PCB with the Pico and a second daughter board with just an edge connector. The switch could be purely on the main board for simplicity. If someone only wanted to replace one internal drive then they just wouldn't have the daughter board.
Pretty simple. Yes.
You could define a VAR in the CONFIG file to define which units you want to emulate. That implies some care about conflicts with other units.
In the code as simple as read the CONFIG file VAR and catch the FLAG from ZX8302 with the ticks to do not pass the FLAG to the next REAL drive.
That way you are using mapping by software more than 1 unit.
Something like this protocode:
Code: Select all
ZXCLKCounter = zx8301Clocks();
MDVinit = readCONFIG(initialUnit);
MDVFinal = readConfig(finalUnit);
If (ZXCLKCounter >= MDVinit && ZXCLKCounter <= MDVFinal && CommsIN == High) then RESPOND()
Else if { zx8301Clocks > MDVFinal & CommsIN == Low) then {COmmsOUT = High}
Else { DoNothing()}
In the cofing File you could set the VAR or couple as for example:
VirtualDrive=1,2 ; it catch all signals and responds always that the access signals (MDCLKSEL & MDSEL) are for MDV1 and MDV2 units.
VirtualDrive=1,8 ; it catch all signals and responds always that the access signals (MDCLKSEL & MDSEL) are for MDV1 till MDV8 units.
VirtualDrive=2,3 ; it catch all signals and responds always that the access signals (MDCLKSEL & MDSEL) are for MDV2 and MDV3 units.
That implies the user MUST be careful to DO NOT ocupied MDV2 or MDV3 with other units, or they will clash or hidden.
About the need of another board connected also in MDV2 place, that is not necessary at all. It is a bus where you are telling to the MDP to answer all the time that the selected unit is one of the group defined in the CONFIG file.
So no more hardware would be necessary at all. Be aware... due to lack of memory of Pico2040, all the units will have the same image. That is something like QEmulator does (comparison for better understanding).
Could be possible to have different images? could be but it requires to measure timings to read from mSD and the logic analyzer for that matter. Or just test it. I have not a logic analyzer.
In the code it requires to know which parameter has the responsibility of answering the COMMSIN signal, I didn't dig that much in the code. I was refactoring to let it more legible and understable for other programmers and applying a MVC architecture. So there are a lot of part already improved in that sense with the new capabilities but another part (ASM, Cores Comms & DMA managing) that I dind't touched yet.
Who read my code will find it pretty easy to understand and structured. Also enough decoupled the View from the Controller and Model talking about a part of the code.
Probably a light reading of the part that I didn't touch would tell where is that signal. But till September (middle) I won't have the time to check it out or dig deeper.