tschak909 / platoterm64

PLATOTerm for the Commodore 64
GNU General Public License v3.0
35 stars 11 forks source link

[C64] [C128] Proposal: Support connections over 1541 Ultimate II network interface #31

Open rhalkyard opened 5 years ago

rhalkyard commented 5 years ago

Recent firmware versions of the 1541 Ultimate II cartridge allow the C64 to open TCP connections on its onboard ethernet interface. I use one, and it would be nice to be able to use that to connect, rather than my (unfortunately rather flakey) wifi-to-serial modem.

While documentation is thin on the ground right now, https://github.com/xlar54/ultimateii-dos-lib provides a library interface and some example applications, and the firmware source code describes the interface in a fairly straightforward manner. I'd be happy to throw together an implementation if you think this would be a useful addition.

Since the Ultimate II handles all the TCP logic and just exposes a byte stream to the C64, this (hopefully) shouldn't require much in the way of architectural changes, but I thought I'd open this issue before I started working on an implementation, in case you had any thoughts about how you'd like it integrated.

My initial thought would be to make it a general-purpose CC65 serial driver that can just be loaded in place of UP2400 or SwiftLink, with an additional driver-specific ioctl interface to specify a host to connect to. That way, the only major change required to the PlatoTerm code would be to prompt the user for a host and port at startup if using the Ultimate II driver.

rhalkyard commented 4 years ago

I've got a quick-and-dirty prototype of this working at https://github.com/rhalkyard/platoterm64/tree/u2ethernet. Needs some tidying and comments and the like before it's ready for a PR, but the basics work on the C64 at least.

tschak909 commented 4 years ago

Dude, I could hug you.

Anything I can do to help?

-Thom

rhalkyard commented 4 years ago

Glad to help! It’s been a fun challenge.

The code that I just pushed is all extremely preliminary - i just got it working well enough to post a note, so I thought I’d better put the code out there! I’ll tidy it up and add some comments explaining a bit more about what’s going on, and then we can figure out how best to integrate it.

The standout thing that it’ll need will be some way of choosing a host to connect to - probably a prompt at startup, but it might be nice to save a default into the configuration. Could probably use a lot of the same infrastructure to save a modem dial string as well, which would be kinda neat.

Unfortunately it can only really be tested and debugged on real hardware - I’m not aware of any emulators that support the Ultimate-II. But confirmation that my changes haven’t catastrophically broken the other ports (or serial functionality on the C64 port) would be nice :) - it’ll automatically fall back to serial if the Ultimate-II hardware isn’t detected.

tschak909 commented 4 years ago

where can I get the hardware? -Thom

rhalkyard commented 4 years ago

where can I get the hardware?

https://ultimate64.com. Looks like they're on backorder right now (they're made in small batches and sell out fairly quickly). A bit pricey, but worth it - drive emulator, flashcart, ethernet interface, 16MB REU, and a whole lot more, all in one box.

The Ultimate 64, available from the same site, is a reproduction of the C64 with all that functionality built in. I don't own one so I can't know for sure, but I gather that the same code should work on that too.

rhalkyard commented 4 years ago

As I said in commonotes, I've made a few revisions that (I think) are getting this close to being ready for prime time. It now works on the C128 too, and I've added a simple prompt that allows the user to specify a host to connect to. Just want to get the preferences switching between serial and ethernet working properly, and I think we can call it good!

(Here's a screenshot of the connection prompt; I don't have anything handy that will capture the output of the VDC, so a phone photo of my monitor will have to do 😅) IMG_8295

rhalkyard commented 4 years ago

Since technotron/commodor requested this on IRATA, I've uploaded pre-built .D64s to Google Drive:

I've added support for switching devices - serial is the default, and you can switch between serial and Ultimate-II under I)nterfaces in setup. I haven't tested it extensively yet, so I'd greatly appreciate help in shaking out the bugs!

tschak909 commented 4 years ago

Groovy, I'll be able to test this in a few days. I am trying to get the Atari cartridge better squared away. This is awesome! I really hoped that a good ethernet solution for the C64 would materialize!

Hopefully on the Atari side, Jeff Piepmeier's ESP cart will firm up for high-speed ethernet on the Atari, and we'll also have a budget-conscious ESP solution for the SIO bus.

The Apple 2 can use the off-loading features of the Uthernet II, I just need to hack it in. (I have a IIgs with an Uthernet II, now that I think about it...)