News:

2022.06.03 added links to LisaList1 and LisaFAQ to the General Category

Main Menu

ESFloppy - An Floppy Emulator for Sony 400K/800K and Twiggy Drives

Started by AlexTheCat123, August 03, 2026, 01:48:12 PM

Previous topic - Next topic

AlexTheCat123

As promised when I released the LisaFPGA boards, I've gotten to work on ESFloppy after my break from the project, and I have some really good progress to report.

Sony 400K/800K emulation is fully-working at this point, with reads, writes, and formats tested in every Lisa OS/environment that I could get my hands on. And it appears to be faster than the Floppy Emu too, which has noticably-longer seek times.

Twiggy emulation is also pretty much done. As far as I know, this is the first emulator capable of emulating a Twiggy, so I'm pretty excited about this! Reads, writes, and formats are fully tested and working on Twiggy, and while it can only emulate the lower Twiggy drive right now, the full framework is in place to add upper drive capability so that both can be emulated simultaneously. This should honestly be quite easy to add; it'll likely be done by today or tomorrow.

Twiggy emulation was significantly harder than I expected for a variety of reasons. Even though Twiggy uses the same sector encoding as Sony, just with a different track count and different numbers of sectors per track, it's got some seriously-annoying quirks:

- This one's probably pretty obvious to anyone who's worked with Twiggies before: Given the odd positioning of the heads, when one head is on track T of the disk, the other one is on track 45-T, so you have to read in two separate tracks from the disk image for each seek. And to make matters worse, in the vast majority of cases, each side will have a different number of sectors too...
- Twiggy has a set of "speed sync" bytes that have to be sent out before sector 0 on each track that the controller uses to fine-tune the spindle speed before a format op. This isn't present on Sony at all.
- Twiggy has a weird "track -1" that's used as a timing track during a format. Before the format begins, the controller seeks to track -1 and writes a pattern of 14 sectors, then 15, and then 21, measuring and adjusting the disk speed each time. This requires making a "dynamic track" that allows storage of different numbers of sectors instead of hard-coding it to the expected number of sectors per track like you can for all the others.
- During a format, the Twiggy controller expects each track to take a very specific amount of time between consecutive starts of sector 0. If the track is too long or too short, the format will fail. On an emulator, you generally want to send data out as quickly as possible with minimal padding in between sectors (which works fine on Sony), but on Twiggy you're forced to use very specific (and different) amounts of padding on each track to ensure that the track time is exactly what the controller expects.
- And that just scratches the surface!

Here's a video showing the Twiggy emulation in action; I didn't bother making a video about Sony emulation since that's boring by comparison: https://www.youtube.com/watch?v=8sN7Cv-MONM

The big thing left to do (after I emulate the upper Twiggy) is to make the UI that runs on the OLED. This won't really be hard (the hard part was all of the optimization necessary to get the actual disk routines to run fast enough), but it will certainly be tedious, and will probably take a little while.

bmwcyclist

Using my LISA for writing blogs and other work projects, and for fun and games at home.
Visit my shares on GlobalTalk! LISAGamingZone
Check out the NEW Lisa Software! https://github.com/GyroPilot
telnet theapplelisabbs.duckdns.org 1983

ried


bmwcyclist

Using my LISA for writing blogs and other work projects, and for fun and games at home.
Visit my shares on GlobalTalk! LISAGamingZone
Check out the NEW Lisa Software! https://github.com/GyroPilot
telnet theapplelisabbs.duckdns.org 1983

AlexTheCat123

Quote from: bmwcyclist on September 13, 2026, 07:31:10 PMIs this released in an update?

Yeah, if you clone the latest version of the repo and run the program_board.sh script, you'll get all of this functionality on your board!

wottle

Awesome.  I'll have to pull your latest into my fork and make sure my changes don't conflict with yours.  For my all in one case, I added a long-press to the center ESFloppy button to open an on screen menu that allows me to shift the video output left or right (so I could center it on my widescreen LCD in the cutout of my case).  If it does conflict, I'll have to come up with another way to set the offset (ideally not at build time, but now that my case design is basically final, it probably would be OK. 

Let me know if you would be interested in a case.  I could print you one if you wanted to build your own: https://github.com/wottle/lisa-mini


AlexTheCat123

Quote from: wottle on September 14, 2026, 10:05:39 PMAwesome.  I'll have to pull your latest into my fork and make sure my changes don't conflict with yours.  For my all in one case, I added a long-press to the center ESFloppy button to open an on screen menu that allows me to shift the video output left or right (so I could center it on my widescreen LCD in the cutout of my case).  If it does conflict, I'll have to come up with another way to set the offset (ideally not at build time, but now that my case design is basically final, it probably would be OK. 

Long-press is how you force-eject a disk and how you exit the file picker if you change your mind and decide not to insert a disk, so unfortunately I think we might have a conflict!

wottle

Quote from: AlexTheCat123 on September 15, 2026, 12:30:33 AM
Quote from: wottle on September 14, 2026, 10:05:39 PMAwesome.  I'll have to pull your latest into my fork and make sure my changes don't conflict with yours.  For my all in one case, I added a long-press to the center ESFloppy button to open an on screen menu that allows me to shift the video output left or right (so I could center it on my widescreen LCD in the cutout of my case).  If it does conflict, I'll have to come up with another way to set the offset (ideally not at build time, but now that my case design is basically final, it probably would be OK. 

Long-press is how you force-eject a disk and how you exit the file picker if you change your mind and decide not to insert a disk, so unfortunately I think we might have a conflict!


Ah, not a problem.  I may try long press both the arrow buttons.  This should be something they have to do once during setup.  I think I fried something in my USB-C port trying to power the lisaFPGA and an LCD with a single 5v trigger board, and now my board doesn't show up when I plug it into my computer.  It still boots fine and still has my fork with the menu and video adjustments, but I cannot push changes to it.  I did pick up a dedicated JTAG programmer that I'm hoping to use to flash the device again.  I was hoping to dig into the USB handling for glint devices to improve support for usb keyboards with a port built in, and maybe wireless usb mice.

Love the work you've done and excited to be able to throw some floppy images on mine and play around more. 

bmwcyclist

Got the update done this is fantastic functionality! Thank you so much for everything!

Here's a walk-through, especially for people that are not used to Linux.

The text can also be found on the lisa BBS.

Now, if I can only get someone to help me with my real 400 K hardware! ;)
Using my LISA for writing blogs and other work projects, and for fun and games at home.
Visit my shares on GlobalTalk! LISAGamingZone
Check out the NEW Lisa Software! https://github.com/GyroPilot
telnet theapplelisabbs.duckdns.org 1983

Lisa1

Quote from: bmwcyclist on September 15, 2026, 01:14:59 PMNow, if I can only get someone to help me with my real 400 K hardware!

I was able to run a physical 400K drive off of the LisaFPG (and a 4:3 LCD monitor) at the VCF Midwest last weekend. What kind of help do you need with your 400k drive?


bmwcyclist

Quote from: Lisa1 on September 15, 2026, 07:51:16 PM
Quote from: bmwcyclist on September 15, 2026, 01:14:59 PMNow, if I can only get someone to help me with my real 400 K hardware!

I was able to run a physical 400K drive off of the LisaFPG (and a 4:3 LCD monitor) at the VCF Midwest last weekend. What kind of help do you need with your 400k drive?

You cannot view this attachment.

NICE!!!!

Here is the thread thanks!

https://lisalist2.com/index.php/topic,848.0.html

Using my LISA for writing blogs and other work projects, and for fun and games at home.
Visit my shares on GlobalTalk! LISAGamingZone
Check out the NEW Lisa Software! https://github.com/GyroPilot
telnet theapplelisabbs.duckdns.org 1983

wottle

FYI, I spent some time working on USB support and I have a working build with full USB support for hubs, high- and low-speed devices.  Really enjoy being able to use my wireless keyboard and mouse with it.  I have it in a fork.  I also have my LCD adjustment OSD, but changed the trigger key combination to long pressing the left and right ESFloppy buttons.  I broke my ESFloppy screen during removal, so I'm waiting to get a replacement to fully test the functionality, but I'm hoping that won't interfere with any of the core functionality of the ESFloppy. 

Here's a video of the changes I made, along with my latest enclosure for it: https://youtu.be/pqCL28MwJus?si=xf3Ojbwr_nXFs0mA

sigma7

Quote from: wottle on October 05, 2026, 10:36:48 PMFYI, I spent some time working on USB support and I have a working build with full USB support for hubs, high- and low-speed devices.

Awesome! Hoping (expecting) it will work with my KVM setup now... thanks!
Warning: Memory errors found. ECC non-functional. Verify comments if accuracy is important to you.

wottle

Quote from: sigma7 on October 05, 2026, 11:12:47 PMAwesome! Hoping (expecting) it will work with my KVM setup now... thanks!

It should. Go ahead and install from my fork at https://github.com/wottle/LisaFPGA#about-this-fork-lisa-mini and run the program_board.sh script.  Let me know if you have any issues with it.  I'm going to see if Alex would be interested in adding the USB support changes to the main repo.  I think it would be nice to add it to the new batch of boards he has being created by Joe's Computer Museum.   

AlexTheCat123

I just wanted to give an update about the standalone version of ESFloppy since it's been a while. I've been very hard at work finishing it up, and the code is just about done at this point. It can currently emulate:

- A single Sony 400K/800K drive, for both Lisa and Mac
- Dual Twiggies
- Up to 4 Hard Disk 20s for the Mac (not limited to 20MB despite the name); compatible with Apple Partition Map and ISO images in addition to raw
- Dual Disk IIs for the Apple II
- Up to 4 SmartPort Unidisk 3.5" 800K floppy drives for the Apple II
- Up to 4 SmartPort hard drives for the Apple II
- Up to 3 Disk /// drives for the Apple ///

I'm sure that, as Lisa enthusiasts, the people on here probably only care about the first two bullets on that list, but perhaps there are some people who care about the others too!

It also has archive encapsulation functionality for Mac OS, where you can select a .sit, .hqx, or .bin archive from the file picker on the OLED and it'll automatically create a 400K or 800K HFS or MFS volume around it in RAM with the proper type and creator codes, allowing for really easy transfer to the Mac.

I need to do some additional testing to make sure that everything is completely functional, order the final revision of the boards to make sure they work, and update the readme with all of these new changes, and then I think things will be ready for release! Given the lead time on PCB orders, it'll probably be a few weeks before we get to that point, but all the hard work is done at least.