zeta0134 / rusticnes-core

I decided to teach myself Rust by writing an NES emulator. Things quickly got out of hand.
MIT License
34 stars 4 forks source link

Mapper: FamiCom Disk System #19

Open zeta0134 opened 2 years ago

zeta0134 commented 2 years ago

This is probably the most complex commonly requested mapper type remaining, beyond esoteric homebrew boards. It's less a cartridge type and more an entire suite of external peripherals and complications:

https://wiki.nesdev.org/w/index.php?title=Family_Computer_Disk_System

The hardware is reasonably straightforward, but the bios is pretty complicated:

https://wiki.nesdev.org/w/index.php?title=Family_Computer_Disk_System#Registers https://wiki.nesdev.org/w/index.php?title=FDS_BIOS

So the simplest thing to do would be to start by reading in an FDS file and producing a raw disk image by re-inserting the gaps:

https://wiki.nesdev.org/w/index.php?title=FDS_disk_format

Then tracking down a copy of the original FDS bios to test with, and implementing the hardware interface. If my math is right (~64k, read in ~7 seconds) there should be around 190 CPU cycles between bytes when the drive motor is doing its thing. In theory that is enough to get the FDS bios reading the disk contents, and if it can do so successfully, it should be able to hand control over to the game once the data is read in.