1200-Baud Archeology
jamie found this singularly geeky article on reconstructing Apple I BASIC from a cassette tape. It claims to offer the first confirmed perfect dump (BIN) of the 4096 bytes of this venerable interpreter. Terrific fun for the whole family. "The Apple I is extremely rare. Only 200 were built, and less than 100 are believed to be in existence. Neither Steve nor Woz own an Apple I any more, and neither does Apple Inc. The cassettes are even rarer, as not every Apple I came with one... So here is how to decode the signal. Let us first open the audio file in Audacity and look at the waveform... It is now time to write a small program to measure and dump the width of the pulses."
Probably would have been useful for the person to look at how C64 emulators and people handle transfer C64 tapes to PC.
*off to bathroom*
I'll report my findings later
It would be way cool to have an Apple I emulator on my phone. Come to think of it, a DEC PDP-1 emulator with SpaceWar would be pretty sweet, too.
-jcr
The only title of honor that a tyrant can grant is "Enemy of the State."
It is now time to write a small program to measure and dump the width of the pulses
Its just an FSK modem. I have an old computer right here in my house which would demodulate that, once I bumped the clock rate up by a factor of four.
http://michaelsmith.id.au
Isn't that the buggy version that Woz built (and hated?)
The opposite of progress is congress
I think that at least the basic interpreter should be taught to the new generations.
They don't feel confortable enough in less than 1 GB, what if they had just 4 KB?
Maybe Computers will never be as intelligent as Humans.
For sure they won't ever become so stupid. [VR-1988]
Reminds me of my housemate and I at university ('92-'95) using the tape control relay on an Acorn Electron wired to a PC serial port to rip the ROM so we could start writing an emulator. A small BASIC program PWM encoded the whole ROM in about an hour IIRC. Was a great start to the project, we got as far as CPU emulator, multi-window debugger, VGA display driver, and had it running basic no problems. He got it reading WAV's of games recorded from tape too. Got as far as the in-game screen of Chuckie Egg before we ran out of knowledge and became stuck trying to fathom the hardware keyboard input. (for the BASIC interpreter we just injected characters into the key buffer). Ahh, happy days. :o)
I have a TI-99/4A that has been dead for nearly two decades, along with several hours worth of data stored on cassettes. I would love to recover the data off of those tapes. Most of it is the type of stuff a 10 year old would write in TI BASIC (and Extended Basic!), and it would really bring back some fond memories and certainly some good laughs.
Are there any generic utilities that can extract binary out of low-baud modem audio files? With the advantage of performing various audio processing and analysis in a non-linear, non-realtime manner, certainly data could be extracted by modern software that not even the actual legacy computer could decode.
Better known as 318230.
That must be one weird family...
[Slashdot Comments We Liked]
Seriously... teach assembler in school, with the same memory limitation... let them squeeze out the last bit of the hardware, just like the hackers did with Commodore 64.
But that had a dedicated "digital" tape drive (ie. it was optimized for recording those sorts of signals, not music.
No sig today...
So when will we actually see a javascript vm being able to execute it?
Apple Inc does own an Apple I
It is actually owned by Apple Computer Australia, and on loan and display at the Powerhouse Museum in Sydney.
For many years, it was under a glass box in the foyer of the Apple Australia offices.
I tell my kids about loading programs off cassette tapes but they just don't get it. I guess they'll never know the agony of having a program ruined by fragility of magnetic tape.
"Technology.....the knack of so arranging the world that we don't have to experience it." Max Firsch
Still phase modulation at 9kbaud+ would be a tight fit on an audio tape. I don't think things like QAM would be possible given the size of the package
Quadrature amplitude modulation was in use in the 1960s: it's just two AM carriers out of phase by 90 degrees. The color encoding in NTSC and PAL used QAM.
The psychoacoustic models of MP3 compression must have done wonders for the ancient recording.
It's like compressing a bitmap of line art with JPEG.
Stop worrying about the risks of nuclear power and start worrying about the risks of not using nuclear power.
I wrote, ahem, ported a Java Apple 1 emulator about a year ago to SDL and added a few of my own features. Haven't done much more to it since then. But for those nostalgic geeks out there, you can find it at the following link.
http://pom1.sourceforge.net/
"Without curiosity and knowledge, the mind is a vast void. Without the mind, curiosity and knowledge are nonexistent."
The interesting thing about this article is:
This could have been done so much more easily :)
Really? I am not sure about that, it would effectively be telling them to to not use what was available to them.
As long as there are integrated circuits, there will always be dirt-cheap microcontrollers that don't have a lot of ROM and RAM available to them.
I get the distinct impression the author doesn't know what FSK is, or that it's the encoding for the signal. Yet he still manages to decode it. The HARD way.
The author treated it as period shift keying, which is equivalent to frequency shift keying. What makes decoding an FSK signal in the period domain "the hard way"?
I own an Apple 1. ...And a copy of Apple 1 BASIC on cassette, and Woz's Mini-Assembler that is "origin-ed" for the Apple 1. (This is the same Mini-Assembler that was in the Apple ][ ROMs, at $F666). And a few other Apple 1 goodies.
Do you realize that the cassette interface for the Apple 1 and the Apple ][ are identical?
Yep, you can read an Apple 1 audio cassette with any old, easy-to-find Apple ][. And from there, you can use any one of a million methods to get the data out of memory and onto another medium.
Also, you can simply use the Apple ][ to create a NEW cassette for your Apple 1 (if you happen to be lucky enough to have one).
BTW, I think mine is "serial number" 0064. At least that's what I think the "0064 that is written in Sharpie on the PC board means...
Many seasons ago, in a high school computer lab in the Bronx. I would save programs from computer labs Commodore PET to tape and wonder why they would always be blank the next day. Over time I realized that riding the NYC trains with my school bag on the car floor was not such a cool idea. NYC trains were somehow erasing the tapes when they were place closed to the floor. Until I figured this out there were many nights spent pondering what the gods of computing had against me. Curse you Number 6 Line! Curse you!!!
"Ahhh the suffering...."
This is way cool. But we have seen lately how strict Apple behaves when unlocking iPhones, etc. Wouldn't it be ironic if Apple sues this guy for copyright infringement and pushing the DMCA instead of being thankful that he recovered this piece of history?
The negative sample is probably right. If you look at the wave form sample, you can see where it drops. I think he's looking for errors in the data from the tape.
The command line is simple the is to redirect stdout to the output file of choice.
Anyone remember Turbo Pascal 3.02? It had a pretty decent editor, compiler, overlay support and was able to create .COM files by copying parts of itself into the compiled file. And everything packed together in a single .COM file of 37 kilobytes. Impressing. Check out The Borland Museum and have a look for yourself.
They really knew how to create small and elegant code in those days. I'd like to have the assembly code for that, just for fun and inspiration.
That doesn't make sense in the context of the program though. If you look at the code, the if clause I asked about does --direction, the variable is initialized to 1 and there's a check...
So if direction is less than 1 then it hits the if statement I wrote about and becomes --direction. My guess is it's to handle silence at the end of the sample data and the if statement I posted about is actually...
Which is very strange... since direction will never be greater than 1 it may as well be a break/return.
I know about the command line, the original was...
I was curious about why someone why write it like that.
I ran TurboTape for the Commodore64 for quite a while... You actually had to enter the program using Compute's special assembly entering program, the name is eluding me at the moment (It was over 25 years ago!)... the early release had an error that blew 7414's so I had to replace them a couple of times in the datasette. Amazing that a single incorrect byte in the assembly could take out hardware.
MESS emulates the Apple I, can read WAVE files, and the entire source code is available. :)
I miss my old CoCo3, but I hated cassette tapes. The saddest thing is that Audio Cassettes were designed to be lousy as a data storage media - they used two sides (interference), and were created to record just human voice. The only other option were floppy drives, and back then they were expensive and/or overpriced ($200 and up) which is equivalent to $400+ now in 2008. Most drives had to include the entire controller I/O inside the unit, and probably also a disk OS.
Back in the TRS-80 Model 1 days, I wrote a bunch of BASIC arcade style games. The tapes are long lost, destroyed, or unreadable. But even then, I was smart enough to PRINT. I can easily read them today, and the only device I need is a pair of reading glasses. I could even easily load them into an emulator running on modern hardware using OCR software.
There's nothing like a good old hardcopy.
I disassembled a few dozen bytes of the dump to see what it looked like. I have no idea what it's supposed to be doing, but seeing the code does take me back a few decades...
E000 4C B0 E2 JMP $E2B0
E003 AD 11 D0 LDA $D011
E006 10 FB BPL $E003
E008 AD 10 D0 LDA $D010
E00B 60 RTS
E00C 8A TXA
E00D 29 20 AND #$20
E00F F0 23 BEQ $E034
E011 A9 A0 LDA #$A0
E013 85 E4 STA $E4
E015 4C C9 E3 JMP $E3C9
E018 A9 20 LDA #$20
E01A C5 24 CMP $24
E01C B0 0C BCS $E02A
E01E A9 8D LDA #$8D
E020 A0 07 LDY #$07
E022 20 C9 E3 JSR $E3C9
E025 A9 A0 LDA #$A0
E027 88 DEY
E028 D0 F8 BNE $E022
E02A A0 00 LDY #$00
E02C B1 E2 LDA ($E2),Y
E02E E6 E2 INC $E2
E030 D0 02 BNE $E034
E032 E6 E3 INC $E3
E034 60 RTS
Back in my C64 days, I used to practically think in 65xx assembly code... ah, memories.
Surprised none of the other grammar nazis* picked up on this:
"...neither Steve nor Woz..."
Erm, isn't Steve Wozniak one person?** Perhaps he meant "...neither Jobs nor Woz..."?
* sorry if I mis-capitalized/mis-punctuated "Nazi's"
** spare the fat jokes
Dear Slashdot: next time you want to mess with the site, add a rich-text editor for comments.
I thought that cassette storage for Apple computers was based on the Kansas City Standard http://en.wikipedia.org/wiki/Kansas_City_Standard/? Get off my lawn
Let's see how my memory serves:
$E000 - BASIC Coldstart
$E003 - Wait for a key (wait for bit 7 "set" of address $D011), then Load Accumulator with the ASCII keycode (from location $D010), and Return.
$E00C - (Do Uppercase conversion on ASCII, I think), and Jump to the CharOut routine ($E3C9).
$E018 - Looks like the "scroll" routine. That #$8D is a Carriage Return char (Apple 1 and ][ 'ASCII' always had bit 7 SET). The Apple 1 had a "TV Typewriter"-style interface (with apologies to Don Lancaster), that used some "odd" Fairchild shift-registers for the "screen memory". There was no such thing on the Apple 1 as "VTAB()" or "HTAB", or the "BASECALC" routines in the Apple ][ monitor. In fact, there was no random access to the screen position at all. That's why the scroll routine looks like it is simply re-writing stuff to CharOut. It is...
As an interesting aside, my copy of Apple 1 BASIC, which is from May, 1976, nonetheless does NOT give a "SYNTAX ERR" when given the following Apple ][ Integer BASIC verbs: "COLOR=", "PLOT", and "HLIN" (but not "VLIN", which returns an error). This says to me that Woz was already heavily into developing the Apple ][ even when the Apple 1 was barely on the market, so to speak. It would be interesting to find out if other owner's versions of Apple 1 BASIC respond to more, or less, Apple ][ BASIC commands...
It's not quite equivalent. The recorded wave file is heavily bandlimited so you can't reliably use a comparator to convert it to a period shift signal.
Which is why the decoder uses two comparators: one at 32768/DIVISOR and one at -32768/DIVISOR. In order to count a pair of transitions, the decoder has to see the waveform cross below the negative threshold and then above the positive threshold. This Schmitt trigger provides a bit of hysteresis that cleans up the signal. The value of this DIVISOR corresponds to the tape deck's volume control.
If there were any noise around the zero-crossing point, it wouldn't work at all.
Such noise is what the DIVISOR is supposed to filter out. I disassembled parts of the Apple II BIOS once, and it turned out that the original Apple I/II cassette interface also implemented period shift keying.
He's lucky that method works.
If there were more noise than the DIVISOR could reject, then wouldn't it fail to load on the original hardware too?
Back in my C64 days, I used to practically think in 65xx assembly code... ah, memories.
The sad thing is I was able to disassemble the first few lines from memory. How come I knew 4C was JMP when I can get to the top of the stairs and forget what I went up for?!?
the idea was to make talk radio accessible to def people.
Like Mos Def and Def Leppard?
Bow-ties are cool.
Fairly standard cat abuse. Nothing to be alarmed about.
E020 A0 07 LDY #$07. Aaaah. The memories!
I think I saw one there, but that was two years ago. At the time the Googleplex had just taken over the other half of the old SGI building and threatened to devour the rest of the SGI campus.
When the two Steves showed off their Apple-1 at the SLAC Homebrew Club in the 1976 they has it in a wooden case, I recall seeing.
Actually does own an Apple I, unless he gave it away in the last week.
I still own a couple Apple I's.
OK a new size TV
Didn't the terminator run on 6502 assembly? I seem to recall watching a scene where they scrolled a bunch of assembly as the guvanator was deciding how to answer a question. I was sure I saw a load accumulator instruction in there somewhere! Thanks for the memories.
I remember that display, too.
Yes, it was definitely 6502 assembly. Even scrolling by that fast I caught some of the code.
Ha, I did the same thing. Glad I'm not the only one.
And strangely I'm sure I haven't touched 6502 in 25 years. Strange the little things you remember. I did a lot of programming on the Atari platform and I'm sure if I stopped and thought about it I could remember enough details of using the Pokey to generate sound or tricks in the CTIA/GTIA to still be able to write code to put a few different video modes on screen at once.
Those were the days.
We built an Apple 1 in my electronics class back when I was in high school. I had not realized they were so rare :)
It is spelled archaeology, not archeology. I'm surprised no one caught this or maybe no one cared enough. Seeing as how we have some BSD folks here I would think that the missing 'a' would have been obvious since 'daemon' is spelled and pronounced the same way.
this nation, under God, shall have a new birth of freedom. -- Lincoln, Gettysburg Address
I built a replica apple I with cassette interface a few years ago using kits of parts sold on ebay (following the original design). I was able to to load apple 1 basic, via a serial interface, too much to type, and successfully save it to tape (computer sound card) and load it back. I have the audio file here.
Got to put Apple aside to flagwave the excellent GFA BASIC which ran in interpreted mode decently and when compiled quite close to C compiled. It ignored line numbers (an advance in those days for a BASIC) and in later versions included matrix operations. It was also very easy to learn partly down to the decent manual. Perhaps I recall this wrongly but I'm sure the GFA Interpreter only version was included free on magazine cover discs.
You write the audio to an audio CD so that the signal won't detriorate.