Retrochallenge 2012: Apple ][ screen sharing

 

I’ve been trying think of something to do for Retrochallenge 2012. I’ve had this as a project idea for a little while, so maybe I’ll use this one. We’ll see how it goes.

The goal is this: Be able to “screen share” with an Apple ][ over an internet connection.

The idea is this: Write an I/O driver in 6502 assembler that will read from and write to a serial input (basically recycling existing code I'd written 25 years ago for doing this kind of thing over a modem connection) and patch this into the DOS I/O hooks so that it's possible to use the DOS 3.3 command line remotely. I will explore whether it can be done with ProDOS as well, but I have no experience doing that (whereas I do with DOS). So long as this serial connection can be interacted with over something like a Mac OS X command line, the control of the Apple ][ can be truly remote. However, this only handles text input and output. Part two of the project would be to send the composite video output into a capture device that can stream the output over the internet, so it is possible to see what is on the screen (not just text going in and out in order). Part three would be to intercept the audio as well, so that beeps and boops can be heard streaming over the internet.

That would be the main bit. Further bits might include working out some way to flip the serial connection into a data transfer mode in order to run programs that are remotely stored, and also possibly connecting the Reset key and even a panic coldstart signal so that if the computer hangs it can be restarted.

It'll be interesting to see if/where this goes. But I'll plan to post updates here.


July 1, 2012. I've made it onto the entrants list. Step zero accomplished. I'm enjoying looking around at some of blogs of other entrants, and as a side effect seeing ways in which this blog I'm typing on could be improved. One point of mitigation: yesterbits.com is only about a week old at the moment, but still, I'll probably spend part of my "retro energy" on tidying things up here.

Schedule-wise, I'm not sure how this is going to work, since July is actually fairly busy for me. I will be out of town far more than I will be in town. I'd initially envisioned this as a way to use an Apple ][+ over the network, but if this is not done by the time I leave for KansasFest, it will probably transform into a project for the Apple IIc+ that I’ll have with me during the latter half of the month. Time will tell.


July 2, 2012. Since I was stuck on a bus overnight (I brought my Apple IIc+ with me, but the power cord was not with me in the cabin), I spent some time trying to figure out where I’d gotten back in “the day.” This involved digging around in images of old disks for a while until I found the source code (written with the Merlin assembler) for the most recently-numbered version of the modem driver I’d written.

C5noc intro comments

Apparently in 1985, I had been toying with the idea of using “Sam Hoover” as my alias. I have no idea where that would have come from, I think it was completely arbitrary, not based on any kind of literature or anything. Of course, there are probably plenty of real people with that name as well. Who can understand the mindset of 1985?

The way this worked is it would patch the &-command in Applesoft, so all of the driver commands were invoked by & and some instruction. This particular driver had actually quite a lot of &-commands.

C5noc many ampcommands

Anyway, I refamiliarized myself with how to assemble code with Merlin, assembled it, and ran it, just to remind myself of how it worked, so I can move on to the business of re-understanding my code and then trying to adapt it (or a simpler version of it) to non-modem communication that can be used for this remote control.

C5noc assembled

C5noc src1 C5noc src2 C5noc src3

There are a couple of interesting features, kind of “hip” back in the days of the Cat-Furs and BBSes. One was that spinning cursor, made by sending /, –, \, and ! in alternation with the backspace character. That was pretty neat at first. At first. The other thing that is kind of interesting is the use of the I/O bars at the top of the screen. I don’t know where this came from first, though I think my use of it here was borrowed from Cat-Fur. There may have also been other BBS drivers that did this. It was interesting, and maybe sometimes a little bit useful, to see what characters are coming in and going out. I demo this briefly in the movie below. I also demo switching the Apple-Cat into 202 (1200 baud half duplex) mode, and back into 103 (300 baud full duplex mode)—you can see in the I/O bars what happens: a special escape code is sent to tell the modem on the other end to follow along and switch speeds.

Anyway, this probably doesn’t really count as progress, more as groundwork. But, it’s a start, and gave me something to do on the bus while the internet was poor.


July 3, 2012. Disaster! Sort of. It occurred to me today that possibly the hardest part of this was going to be the part on the modern end—if I have the Apple II connected over a serial port, how do I talk to it from the Mac? I thought I’d need to dig around in the ADTpro code to work something up. What I need is something like a modem program from the days of yore.

Like ZTerm.

And, bless the heart of it and David P. Alverson, ZTerm still works under Lion. So, leveraging the connection I’d already made for the purposes of using ADTpro, I downloaded ZTerm and started it up. Connection settings: 9600 N81 local echo. Modem settings: USA28Xfa13P1.1. On the IIc+, the standard Ctrl-A and 14B (which is how you get it into receive mode for ADTpro).

Iicplus via in2

So, I already have control of the command line that way. My initial reaction was that this was stupid, now the project is already pretty much over, I just need to stream the audio and video to the internet. But that’s not really true, although it is true that for the most basic version of this idea, all of the work that needs to be done is going to need to be done on a modern computer, since the connection to the Apple II is already functional. Plus, I can’t do much better for a driver than one that’s built into the Super Serial Card ROM. Nothing I could write would be more compatible with more things than that.

There is possibly an issue with the output, though maybe all this is going to require is reading the documentation for the Super Serial Card, since it wouldn’t surprise me if I couldn’t just send the output back to the card as well. Actually, hang on. PR#2.

Iicplus via pr2

Yep, indeed. No problem whatsoever in just typing PR#2 at the command prompt, the Apple’s output appears in my ZTerm window. It no longer appears on the Apple screen (and I have to turn local echo off in ZTerm), that’s about it.

It kind of looks like what I was trying to do was mostly a wheel reinvention. I’ll finish this up, but I’ll see if I can work out some other interesting stuff as well; I did have some ideas about doing file transfers and stuff. But I think one of the next steps is going to be to move the goalposts and define an auxiliary project, something useful to do with this connection once it exists, perhaps.

  One Response to “Retrochallenge 2012: Apple ][ screen sharing”

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>