top | item 27723772

Freespin: C64 demo running on 1541 floppy drive

174 points| matthiaskramm | 4 years ago |quiss.org

30 comments

order

stevep98|4 years ago

The processor in the 1541 was identical to the c64… 6502. (Or 6510C)

The serial link between them was notoriously slow. I studied them extensively as a teenager, and had reams of disassembly printed out in fanfold dot matrix, with my own scribbles. This is how I learned 80% of my computing skill set.

The signaling between the drive and computer used a clock line and a data line. When reading from the drive, the drive would set the data bit then invert the clock. The CPU would be polling the clock line, and when it changed, it would read the data bit. There wasn’t any fancy hardware like DMA. It was basically two cpus connected to get her with a couple of I/O pins.

I can’t remember where I saw it, but there was an extremely fast driver going around, and sure enough I disassembled it to find out what they were doing.

Before each 256-byte sector was transferred there was a loop which synchronized the cpus in the drive and host computer, down the the clock cycle. Then they used both clock line and data line to blast all the data, two bits at a time down the lines. The cpus didn’t wait for any clock to change, they just read the data as fast as possible. Wrapped with a bit of error detection to top it off.. in the end it was about a 10x speedup with the same hardware…. Which at the time was totally mind blowing

rasz|4 years ago

> in the end it was about a 10x speedup

10x speedup is what every disk Turbo was doing back in the day, with ActionReplay6 topping off at 5KB/s

https://www.c64-wiki.com/wiki/Comparison_of_fast_loaders standard C64+1541:

    SAVE/LOAD: 374/407 bytes/sec
    SEQ write/read: 349/395 bytes/sec
    Data transfer: 455 bytes/sec
http://tech.guitarsite.de/fastloader.html

Real state of the art is pushed by Krill using technique you describe, and is capable of 20x:

https://csdb.dk/release/?id=189130

Article about one aspect of modern fastloaders - decoding GCR on the fly: https://www.linusakesson.net/programming/gcr-decoding/index....

bloqs|4 years ago

As someone younger... how did a teenager in that time period possibly get that level of technical introduction to things at that level?

peter_d_sherman|4 years ago

>"Freespin is a Commodore 1541 demo, released in 2021. It runs on the Commodore floppy drive. It is is the first demo on this device. [Without the C64 attached!]

[...]

Freespin generates sound/music using the floppy drive mechanic (in particular, the stepper motor responsible for moving the head to the right track).

Video is generated through the [1541's] serial bus."

PDS: Absolutely amazing!

I have never seen this done before!

Related:

"How freespin bit bangs the video signal"

http://www.quiss.org/freespin/raster.html

Tommek|4 years ago

This! is! hacking! Making something new, out of the technology you have at your hands. Probably he did not even had to use any JavaScript.

ithkuil|4 years ago

it would be fun to try to fit a JavaScript interpreter into that.

I did write a very small once but far from fitting in 2k ram

jmull|4 years ago

This is crazy.

krallja|4 years ago

Yeah, I watched the whole video straight through with my mouth wide open. What in the heck!

a1369209993|4 years ago

> If needed, the 100 Ω resistor can be harvested out of the C64. (E.g. the not strictly necessary R14 AUD IN pulldown.) As such, this demo runs on stock C64 hardware and doesn't need any extra components.

This is wonderful.

ChrisGranger|4 years ago

I used to connect the line-out from my CD player to my Commodore 1702 monitor's RCA luma jack (I think) to make a primitive visualization that changed with the music, but this is amazing.

LocalH|4 years ago

Very impressive. I wonder if the burst mode of the 1571 would be useful at all

basementcat|4 years ago

Yes. The 6502 processor in the 1571 could run at 2 MHz (as opposed to 1 MHz in the 1541) so it has the potential to generate higher fidelity video and audio.