-
Notifications
You must be signed in to change notification settings - Fork 23
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
Modification for 256 bytes sectors #8
Comments
It seems Sinclair ZX use FD1793 as FDC which is capable of both FM and MFM. avrFlux is mostly compatible to arbitrary sector sizes, just |
Please check commit 546b867. I didn't test anything so it might work or might not work. Edit: Sinclair wiki says TRD images might be smaller if they contain less data this might interfere with raw floppy image detection as it is based on image size |
I gave it a try. New firmware does recognize the image file in Betadisk format and can load it as a TRD images have fixed sizes, but there is another "compressed" format called SCL which is stripping down unused sectors on the disk. There is a conversion utility SCL2TRD which allows you to restore the image to |
If I enable After this, fddEMU hangs with LED flashing, but not responding to the host system. |
Interesting debug: just after cyl=0 head=0 sector=16 it changes to cyl=0 head=1 sector=0 at the end after cyl=0 head=1 sector=16 it wraps to sector=1. I would say it doesn't recognize the sector header (your previous message points to it), but if so how can it change to head 1 exactly at the end of the head 0 sectors. If fddEMU is responding to serial commands it is not frozen (if so watchdog timer should kick in and restart at 8 seconds) so FDC is releasing motor or select pins or both.
This error message might mean floppy controller couldn't find the sector header it is looking for, but as I said above if it couldn't read the sector header how does it know to change side to 1 at just after the last sector of side 0. Is there a working baseline where we can do step by step modifications from ? Does the host system recognize 512 byte/sector floppy images ? FD1793 datasheet states Edit: Writing to floppy image is disabled for half sector floppy disk images so it is normal for format to fail. What does it do while trying to read ? |
Based on Beta controller schematic, it seems that |
I don't have anything to test TR-DOS images, so I tried making ArduinoFDC compatible to TR-DOS floppies here is my fork of ArduinoFDC. This fork now has the capability to read my 256b_sectors branch. As I don't have any TR-DOS images, I created an image using |
Thanks for forking the ArduinoFDC and testing 256b sector branch of fddEMU. I didn't have a chance yet to build ArduinoFDC, but that was my plan alongside building the ZX Floppy Emulator which might help to understand the differences between processing the TR-DOS image by fddEMU and other floppy emulators. By using Fuse emulator I've created a simple TR-DOS image which can be downloaded here. Of course plenty of others with more meaningful content can be also downloaded here. |
Thanks for reminding me the ZX Floppy Emulator. I can use the test image you built with the |
Here is the debug output from my fork of ArduinoFDC when used with ZX_FDD_Emulator (used image test.trd built by @ikonko ). I checked and this is same as what test.trd's first 256 bytes looks like in hexedit. So 256b_branch of fddEMU should also have worked. ??? Reading track 0 sector 1 side 0 |
Could you please also check sector 8 on track 0 side 0? This is the 1st one TR-DOS is trying to read and in my case fails. There is a data about disk format, free sectors and the label. |
Full ArduinoFDC debug outputs of sector 0, sector 8, sector 9, and sector 17 read from ZX_FDD_Emulator (image: test.trd). Sector 8 was empty so I also added debug output sectors 9 and 17 (r0,1,1) where there is some data Drive A: 3.5" HD Command: s0 Command: t5 Command: r0,1,0 Command: r0,8,0 Command: r0,9,0 Command: r0,1,1 |
Today I've done testing of ZX FDD Emulator as I was able to obtain I2C LCD and rotary encoder just yesterday. The result is exactly the same - unable to read Sector 8 on Track 0. I've tested two Betadisk controllers with WD2793 and there was no difference, both failed. I'm about to finalize another Betadisk with MB8877A controller and test both solutions again. Will post the update once ready. |
Interesting, it (WD2793) only fails at sector 8. So it is able to read other sectors ? |
I performed the Pentagon 48k (a clone of ZX Spectrum with built-in Betadisk based on MB8877A controller or its local equivalent) testing today. The results bring a good news and a bad news. The good one is that this machine works with ZX FDD Emulator, and the bad one that it doesn't work with 256b_sectors branch of fddEMU. I only tried to read the directory and load a program with standard TR-DOS routines. The next step is to prepare assemly routines to understand what's failing and why. |
Sorry for the late answer, I didn't have time until now. Unmodified output of ArduinoFDC after this commit: Command: s0 Command: t5 Command: r0,1,0 Command: r0,8,0 Command: r0,9,0 Command: r0,1,1 Note: I realize this is not the same as ZX_FDD_Emulator; There is no |
Hi @ikonko , it seems over two weeks have passed since my last modification 1217e4d for 256b_sectors and I haven't heard from you since. I guess 1217e4d also didn't work. |
Hi @acemielektron, I'm very sorry I didn't have the opportunity to check the latest modification with multiple controllers. I've only checked with one, and it didn't work straight away. But then I realized that controller didn't work with regular floppy either. I'm waiting for spare 2793 to come so I can test more. In addition to that I'm awaiting version 1.1 PCBs to come to confirm there is no interference or other electrical issue with board 1.0. If you could please leave the issue open for at least two more weeks, so I can run more tests once goods will arrive. Thank you! |
Thank you for the prompt response. I hoped 1217e4d would work, but not hearing from you for so long, I guessed it didn't work after all. |
Hi @acemielektron, it took a while for me to get back to testing due to various delays, but finally I can confirm your fork for 256 bytes probably works. I tested the ArduinoFDC together with fddEMU and real floppy on the cable at the same time.Your 256b fork of ArduinoFDC could read both fddEMU emulated and real Betadisk formatted floppy well and without issues. What I've found in additional testing was incompatibility between fddEMU and FDC WD2793 or TMS2793NL respectivelly. I managed to get PC formatted floppies to be read by Betadisk with external program not using standard TR-DOS routines. And these disks are, of course, formatted to 720kB (using 512b sectors). The real drive on the same cable with fddEMU connected to Betadisk FDC and the results was the same - real floppies could be read without any issue while fddEMU still struggling to be read by FDC. Another test had been taken with MSX computers (another 8-bit platform) - Philips VG-8235 and NMS-8245. Both using TMS2793NL. Original main repo HEX file used for programming the Nano in fddEMU, MSXDOS format using same physical layout as MS-DOS DD diskettes, and again - on the same cable real drive and fddEMU together. Still the same result - floppies are readable, while the same image on SD card served by fddEMU reporting reading error. I tried to tweak pull-ups too, but without success. There are few more test scheduled for Didaktik Kompakt where fddEMU will be connected as external drive B (FDC: WD2797), ZX Spectrum +3 (FDC: Z0765) and Amstrad CPC6128 (FDC: NEC uPD765). All these systems support 512b sectors, and they should be able to read such floppies natively. I will come back with results once tests completed. Thank you for your continuous support for this great project. |
Hi @ikonko, thank you for the extensive test using multiple computers and floppy controllers. After reading your post I looked at avrFlux, ArduinoFDC and ZX_FDD_Emulator code again and again. What I found is that I have shortened 12 bytes of pre-data-filler zeroes to 10 bytes to account for the time lost waiting. PC FDC tolerates this well, after all it is just filler. For ArduinoFDC 10 bytes of zeroes are enough. Another try after restoring default value might worth a shot. |
Hello I have implemented a few changes to fddEMU, here is fddEMU-4db7038.zip compiled from 4db7038. If ZX spectrum is compliant to IBM System 34 disk format it should/might/hopefully work. |
Hi,
Would it be possible to modify the code (primarily avrFlux I assume) to accommodate DD disk format with 40 or 80 tracks 2 sides and 16 sectors 256 bytes in length? More about the format here: https://sinclair.wiki.zxnet.co.uk/wiki/TRD_format
TR-DOS uses 256 BPS and 16 SPT for disks, so a
Due to current code length (~23 out of 32k) this may require a separate branch?
The text was updated successfully, but these errors were encountered: