I'm the author of the ZEsarUX emulator, which has experimental QL support.
First of all, I don't emulate microdrive hardware. Instead, I trap some QL rom calls and I emulate them by reading files from disk. For example, I can do a:
LBYTES mdv1_examplefile,address
Where this "examplefile" is a real file located on my PC.
So, LBYTES works but not LOAD (or LRUN) basic programs
I have been debugging and when loading from basic uses the call "IO.FLINE" (and loading by lbytes uses FS.LOAD).
Here comes my problems...
According to the QL Technical Guide manual, that call:
Input parameters:
D2.W length of buffer
D3.W timeout
A0 channel lD
A1 base of buffer
Output parameters:
D1.W nr. of bytes fetched
A1 updated ptr to buffer
Possible errors:
NC not complete
NO channel not open
EF end of file
B0 buffer overflow (fetch line only)
So, my doubts are with input A1 and output A1, and where to put the file read data. I tried with a simple example with "1 REMark"+ascii code 10, returning 9 as the data lenght, but I don't know where I have to write those bytes... I tried writing at A1, but A1 seems to have value 100H, and it's not a RAM area... Reading docs some people says that the destination address is A6+A1, which is 28100H (ram space) but it doesn't seem to work. Seems that "base of buffer" is not the real pointer...
So, is there anyone that could explain me:
-Where is the input destination buffer, so I could write my "1 REMark" example. When it works, it will load the real file, of course!
-What are the output registers? specially A1
I will be happy if someone help me with this, I have spent today 6 hours (I'm not joking) trying to complete this

Thanks!!

Cesar