PDA

View Full Version : C64 disk drive (1541) emulation


tcdev
24th September 2009, 06:34 AM
I've resurrected the 1541 emulation again.

Some background. The c1541 logic - processor, memory etc - is implemented in the c1541_logic module. This module can then be used two different ways:

1. using the diskif module, it translates the drive signals from the core into track, sector, offset etc which is useful for hooking directly to a random access device (eg. memory).

2. using the c1541_core_fifo module, it adds a fifo to the data path and exports the drive signals such as wps, step etc. This allows a (read-only) media emulation to simply push data into the FIFO.

I had #2 "sort-of" working with an internal NIOS-II processor reading data from SD card. I say "sort-of" because it was quite flaky and I was never sure where the problem lay.

A while back, Arnim Läuger took my "sort of working" core and managed to get reads and writes working via the "diskif" (1.) module. He tweaked the diskif module to basically make it work. I haven't had a suitable platform to test his changes, although I integrated them back into the PACE source tree.

And back to the present:

I wanted to get the FIFO core (2) running again, on a platform with a suitably high-speed off-board processor for emulating the disk media. I hooked it all up into the new "custom_io" framework and - presto - it all appears to work correctly. At least, good enough to run some games!

I can only surmise that the previous NIOS-II/SD combination was too slow and couldn't meet the data timing required by the 1541 - because I haven't changed anything in the HDL or the software running on the media emulation!?!

The software part is a real mess, but the FIFO interface is quite clean and with sufficiently grunty on/off-chip support for the media emulation, it would be a perfectly workable (read-only) solution.

vanfanel
24th September 2009, 07:39 AM
Does this mean we could see some .D64 loading from SD card in the Altera DE1 and other boards soon? I hadn't luck with the FAMPIGA, but maybe this one will work for my DE1!

Thanks for the effort you're putting in these projects!

tcdev
25th September 2009, 12:53 AM
Does this mean we could see some .D64 loading from SD card in the Altera DE1 and other boards soon? I hadn't luck with the FAMPIGA, but maybe this one will work for my DE1!

Soon? No. The DE1 doesn't have enough internal memory to emulate the 1541 drive as well as the C64.

You can, however, connect a real 1541 drive to the DE1 via the GPIO connector. I just got it working (again) on the DE2 build, it should be working on the DE1 shortly...

I'm thinking of doing a PCB with the following i/o, suitable for C64 as well as Minimig and Zet...

PS/2 (for mouse)
NGC controller x2
Dreamcast controller x2
C64 serial bus for drive(s)
and maybe:
atari joystick connector x2
psx controller x2