Slashdot Mirror


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."

63 of 211 comments (clear)

  1. Alternative tools by stryyker · · Score: 5, Interesting

    Probably would have been useful for the person to look at how C64 emulators and people handle transfer C64 tapes to PC.

    1. Re:Alternative tools by Alioth · · Score: 5, Interesting

      Yes - I thought this too - the article's slashdotted at the moment but the summary makes me think he made a mountain from a molehill. In the Sinclair Spectrum world, loading Speccy tapes on to a PC, and encoding them in a useful format (TZX) has been a solved problem for years.

      All these tape formats were physically pretty similar when it comes to how they were encoded, and the same techniques could have been used by looking at any home computer emulator that loaded stuff from tape even if the details were different.

    2. Re:Alternative tools by KGIII · · Score: 3, Funny

      I was actually thinking VIC 20. (I painfully admit that the first was not a woman but a PET and my father and I built a wooden case for it but that predated the VIC 20 by about a year or so.) I played FLOG off of tape and saved my SkiDownHillFaster game to tape damn it! Now somoene better get off my lawn but probably not you.

      --
      "So long and thanks for all the fish."
    3. Re:Alternative tools by lpontiac · · Score: 4, Insightful

      the summary makes me think he made a mountain from a molehill.

      I think the emphasis is more on the historical significance, given the rarity of the tapes and the fact that the only digitised copy floating about has been patched.

    4. Re:Alternative tools by CharlieG · · Score: 2, Interesting

      Actually, If I remember right (digging back oh, nearly 30 years into the recesses of my mind), the C-64 had a fairly unusual tape format, unlike almost everyone else, just like their disk drive was unique (everyone else used a fixed number of sectors/track, where Commodore used a variable number, with more sectors/track as you moved out, to get more data on the disk)

      --
      -- 73 de KG2V For the Children - RKBA! "You are what you do when it counts" - the Masso
    5. Re:Alternative tools by Lumpy · · Score: 4, Interesting

      Didn't the Apple I use PSK instead of FSK encoding for the tape audio?

      I though instead of Shifting frequency they shifted phase which is quite a but harder to detect than frequency shift.

      BTW: Computer Tapes worked great to load software across Ham radio. 2 meter radio, I would load a game from a friend across the city over 2 meters by simply patching audio from the rig to the computer.

      Luckily the C64 had a very slow bitrate (even the floppy drive was slow as hell) for it's storage tapes so it worked great.

      --
      Do not look at laser with remaining good eye.
    6. Re:Alternative tools by YeeHaW_Jelte · · Score: 2, Insightful

      The code being simple does not necessarily mean the though process of coming to those 15 lines was simple and/or straightforward.

      --

      ---
      "The chances of a demonic possession spreading are remote -- relax."
    7. Re:Alternative tools by daBass · · Score: 5, Interesting

      There used to be a Dutch radio program in the 80s called "NOS Hobbyscoop" that had their own basic interpreter for many computers of the day. (MSX, Acorn, Sharp MZ, etc.)

      They actually broadcast computer programs every week on medium wave AM. They'd count down, you start the cassette recorder and you had some new programs.

      Fun for the whole family, even if a bit painful on the ears!

    8. Re:Alternative tools by Mr+Z · · Score: 4, Interesting

      No. It's FSK, but it used a constant number of zero crossings per bit, rather than a constant bit period. So, to decode it, you count the average time between zero crossings rather than the number of zero crossings in a fixed time window.

      On the plus side, it seems like the Woz scheme has some benefits. If you assign the shorter bit period to the more common bit value (likely, '0'), you shorten your average recording length a little. On the minus side, if you get an extra zero crossing in there (say, due to noise that wasn't filtered away by a Schmitt trigger or other hysteresis somewhere), recovery may be awkward.

      BTW, the C64 floppy drives were slow as heck, but that had nothing to do with the bitrate for its media. There's some goofy history there, involving bugs in the shift register on the VIC-20's PIA, the decision to use CPU control loops instead to determine the bit period when communicating between the drive and the machine, and then the greater cycle-stealing period of the VIC-II as you get to the C64 throwing a monkey wrench in the works. The fast-load carts worked by restoring the native CIA hardware shift register to get rid of the CPU-controlled bit shifting to read bits from the floppy, restoring its speed to performance levels similar to the old IEEE-488 based bus they used back in the Commodore PET era. But that's a different story for another day.

      --Joe

    9. Re:Alternative tools by linhux · · Score: 5, Insightful

      When I was a teenager, I used to decode FAT tables and directory structures by hand, using pen and paper and printouts from a raw hex dump of a hard disk. I didn't do this because there was a problem needed to be solved; I knew what was on the disk and there sure were plenty of tools to read the data (like MS-DOS). But it was a fun challenge and I learned how FAT worked.

      I can see how this is a similar challenge. It's nothing more than a geeky sudoku.

    10. Re:Alternative tools by C0vardeAn0nim0 · · Score: 4, Interesting

      here in brasil, UFRGS (federeal university of rio grande do sul) broadcasted test programs using stereo FM. one chanel would broadcast audio, the other encoded text to be decoded by an MSX computer and displayed on screen. the idea was to make talk radio accessible to def people.

      --
      What ? Me, worry ?
    11. Re:Alternative tools by Mr+Z · · Score: 3, Interesting

      Probably the most elaborate scheme I've seen so far is the Mattel Electronics Keyboard Component. It encodes everything into blocks of 32 10-bit words, each protected by a 5-bit detect-2-correct-1 Hamming code. The 32 words are then re-interleaved as 15 32-bit words. Each 32-bit word gets prefixed with a 5-bit framing header. That's prefixed by a block of zeros and a special 64-bit sync pattern per block. (I believe the whole sync structure was about 256 bits long.) The whole shebang is then Manchester encoded and put out to tape. Furthermore, the drive had a carrier-detect signal that it supplied in addition to the Manchester decoded bits.

      The net result is a fairly robust protocol. Because the 32 data words were interleaved, dropout errors would get spread among multiple words. Thus, a burst error would show up only as 1 or 2 bit errors in each individual word. In addition, if a given word shows up as non-correctable, it was sometimes recoverable by flipping bits based on where the carrier was lost and trying again.

      Other nifty aspects of its design: There was an additional pre-header on blocks that was recorded at (I think) 1/3rd the normal carrier frequency. This allowed the drive to detect interesting headers while fast-forwarding or rewinding. Since the drive was computer controlled, it allowed for fully automatic operation, including hardware seeks.

      What was the bit rate? Well, I believe the raw bit rate for data bits coming off the tape was about 3000 bps. Factoring in encoding overhead, though, I'd say the final throughput was less than half that. A quick calculation suggests a nominal throughput around 1200 baud, give or take.

      --Joe

    12. Re:Alternative tools by Tumbleweed · · Score: 2, Interesting

      There used to be a Dutch radio program in the 80s called "NOS Hobbyscoop" that had their own basic interpreter for many computers of the day. (MSX, Acorn, Sharp MZ, etc.)

      They actually broadcast computer programs every week on medium wave AM. They'd count down, you start the cassette recorder and you had some new programs.

      Very interesting - that may be the first instance of P2P!

    13. Re:Alternative tools by HTH+NE1 · · Score: 2, Interesting

      What really got me hooked on the ][ was the release of Sabotage and Sneakers in 1981.

      Heh, I liked SABOTAGE so much I first repackaged it as a SYS file to run it under ProDOS, then a full disassembly of it, which led to removal the last bit of copy protection in it (intended to prevent memory dump cards, it would periodically test the data in the second text screen's screen holes and go into a memory-wiping loop, which also prevented going into the Apple IIgs Control Panel to adjust the processor speed).

      I had intended eventually to upgrade the game to use Apple IIgs graphics, a saved high score list, and include day, night, and weather cycles. Unfortunately, even with a complete disassembly of the code, a lookup table for the new screen memory and new raster sprites, I never got myself a real assembler to make the final product (the new sprites required more memory than the original, so memory would have to shift to accommodate them).

      If anyone knows of a free cross-assembler for Mac OS X to compile 65c02/65c816 assembly source, I'll dig out my old disks.

      --
      Oh, say does that Star-Spangled Banner entwine / The myrtle of Venus with Bacchus's vine?
    14. Re:Alternative tools by Detritus · · Score: 2, Informative

      I've done work on recovering data from old analog tapes. You could clean up the signal by running it through a DC-blocking filter, which is a high-pass filter with a very low cut-off, and a software AGC with a short time-constant. Some of the noise can be eliminated with a low-pass filter. There isn't much that can done to eliminate speed variations. The best thing that you can do is to write a demodulator routine that can track the speed variations and has generous allowances for timing errors in the signal. Looking for zero crossings works OK on relatively clean signals. For more challenging material, you want to integrate over the time period of each bit.

      --
      Mea navis aericumbens anguillis abundat
    15. Re:Alternative tools by Mr+Z · · Score: 2

      It was put together by a handful of bright folks working for APh Consulting out of Cal-Tech, actually. I've actually met one of the two people involved in that project.

  2. this makes me want to take a dump of my own by Anonymous Coward · · Score: 4, Funny

    *off to bathroom*

    I'll report my findings later

    1. Re:this makes me want to take a dump of my own by Anonymous Coward · · Score: 4, Funny

      be sure to check the logs

    2. Re:this makes me want to take a dump of my own by eclectro · · Score: 2, Informative

      be sure to check the logs

      There are no logs with a cload.

      --
      Take the cheese to sickbay, the doctor should see it as soon as possible - B'Elanna Torres, "Learning Curve"
    3. Re:this makes me want to take a dump of my own by Tiro · · Score: 2, Funny

      Funny, I thought they were called core dumps.

  3. Sounds like a great idea for an iPhone app. by jcr · · Score: 4, Funny

    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."
  4. Teach it! by VincenzoRomano · · Score: 4, Insightful

    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]
    1. Re:Teach it! by Technician · · Score: 4, Interesting

      I think that at least the basic interpreter should be taught to the new generations.

      To rain on the parade, I wonder if there is a copyright violation in posting the code online un-edited. How long is copyright nowdays?

      It's something we need to address in this age of IP property where the market has expired years ago but the copyright is in force for many more decades.

      --
      The truth shall set you free!
    2. Re:Teach it! by Digital+Vomit · · Score: 4, Insightful

      How long is copyright nowdays?

      Functionally "forever".

      --
      Modern copyright is theft of culture from everyone and it retards the progress of the useful arts and sciences.
    3. Re:Teach it! by QuantumG · · Score: 5, Insightful

      If Apple tried to sue, Woz would likely pay for your defense.

      --
      How we know is more important than what we know.
    4. Re:Teach it! by SimonGhent · · Score: 2, Insightful

      Really? I am not sure about that, it would effectively be telling them to to not use what was available to them. Should we also deny access to color? I understand the need to write tight code, but not sure putting the equivalent of shackles on a sprinter makes sense.

      Yeah, but runners sometime train with weights on to build strength. When they remove them their speed improves.

      --
      simon
    5. Re:Teach it! by 3waygeek · · Score: 3, Funny

      There's a simple solution; post it as a hex (or binary or octal) dump. You can then claim that it's just an excerpt of the first trillion or so digits of pi. By the time Apple's lawyers determine it isn't, the guys who decoded & published it will be long dead.

    6. Re:Teach it! by morgan_greywolf · · Score: 3, Insightful

      How long is copyright nowdays?

      How old is Mickey Mouse?

    7. Re:Teach it! by Anonymous Coward · · Score: 5, Interesting

      Of course I would! But this gets sticky. I gave away the Apple I schematics and monitor ROM (256 bytes to replace a front panel with a keyboard) but only a couple of copies of the BASIC, which I also intended to be in the open domain. I don't know if I ever gave away the completed Apple I BASIC because by then it was virtually the same for the Apple ][ (now completed) as well. We took the steps to retain the copyright for BASIC on the Apple ][. Any steps we took for the Apple I would be in the gray. I can't believe that it matters to Apple at all anyway.

    8. Re:Teach it! by object88 · · Score: 2

      You can then claim that [the hex/binary/octal dump is] just an excerpt of the first trillion or so digits of pi. By the time Apple's lawyers determine it isn't, the guys who decoded & published it will be long dead.

      Lawyer1: Is the first digit "3"?

      Lawyer2: No.

      Lawyer1: UNLEASH THE HOUNDS!!

  5. Re:Doing it the hard way by Hal_Porter · · Score: 5, Interesting

    Yes. But a few people did some very magical things with tapes before the became obsolete. I saw a demo of a turbo tape system on an Atari 800XL which could load games "faster than a disk drive". Actually it about tied, but that was still impressive. The disk drive could probably managed 9600 baud sustained.

    The modulator / demodulator was lump of potted electronics I could easily fit in my hand. Potting compound was a blank gunk you applied to electronics you didn't want people to tamper with, in this case to stop people seeing the components used. But whatever they were they could modulate and demodulate data at around 9600 baud. This was in the 80's back before DSPs too, so whatever circuit was used must have been made of Op Amps, transistors and passive components.

    I never worked out how it worked. Though I can imagine exploiting the stereo nature of the tapes to send one carrier and phase shifted signal might work. Phase modulation is easy and demodulation is too if you have the carrier. 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, the selling price (about twenty English pounds, or $40), and the primitive nature of 80's technology.

    --
    echo -e 'global _start\n _start:\n mov eax, 2\n int 80h\n jmp _start' > a.asm; nasm a.asm -f elf; ld a.o -o a;
  6. Electron ROM Ripping, ol' school by ga5p0d3 · · Score: 5, Interesting

    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)

    1. Re:Electron ROM Ripping, ol' school by CountBrass · · Score: 2, Funny

      "Vacuum tubes"? You were lucky, we had to play Space Invaders on an abacus made from a handful of hot gravel. And if we missed a single alien our father would flay us alive!

      --
      Bad analogies are like waxing a monkey with a rainbow.
    2. Re:Electron ROM Ripping, ol' school by Nefarious+Wheel · · Score: 3, Funny

      You think you had it bad? We had to play Pong with wooden mallets!

      --
      Do not mock my vision of impractical footwear
    3. Re:Electron ROM Ripping, ol' school by Megane · · Score: 2, Informative

      It was 500 baud. I've done a similar thing trying to read some of my own Model I tapes, but noise makes the simple decoding mechanism in TFA not work so well. (The Model III used 1500 baud)

      I've also done some experimenting with Apple II and C-64 GCR decoding with a Catweasel board (FM/MFM already having been handled quite well), and the C-64 GCR is a lot harder to keep in sync because it doesn't have address-mark-only nibbles.

      --
      #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
  7. Very interesting by Dan+East · · Score: 2, Interesting

    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.
    1. Re:Very interesting by clickety6 · · Score: 3, Interesting
      --
      ----------------------------------- My Other Sig Is Hilarious -----------------------------------
  8. Uhh... by consonant · · Score: 5, Funny

    Terrific fun for the whole family.

    That must be one weird family...

  9. Re:Doing it the hard way by MichaelSmith · · Score: 2, Interesting

    My 6502 system accessed the tape at 300 baud. I used an old cassette recorder for the job. I had my eyes on my uncles reel to reel hi-fi system. I reckon I could have got 9600 baud out of that just by exploiting the frequency response.

  10. Nick Hodge Says by Anonymous Coward · · Score: 4, Interesting
    (scroll down to the comments, in case you ever RTFA):

    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.

  11. Memories by buddhaunderthetree · · Score: 3, Insightful

    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
    1. Re:Memories by troon · · Score: 4, Interesting

      Tape, yes. But do you remember 45rpm floppy 7" "records" that came with magazines? Or programs broadcast over the radio late at night?

      I've just written this article, coincidentally:

      http://mark.tranchant.co.uk/2008/07/a-unique-generation

      --
      Ydco co ,df C erb-y go. a Ekrpat t.fxrapev
  12. QAM by tepples · · Score: 2, Interesting

    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.

  13. Re:Doing it the hard way by Hal_Porter · · Score: 5, Interesting

    The computer I designed and built around 1981 did 9600 bps with some TTL logic i designed myself. The format used was Manchester II, very simple to encode and decode if the clock can be recovered (the difficult part) for the decode phase. I think I used less PCB space than what was needed for the common 300 bps Kansas City format.

    When the Atari sent data to the tape it had an internal modulator. But IIRC the demodulator was in the tape deck. And in any case you could output data to the disk drive, when it was a selectable baud 0-19200 rate and not modulated. So it seems like the turbo tape interface could use custom software to get 9600 baud TTL data to or from the tape and do its 9600 modem baud magic internally with a handful of components.

    Tapes are stereo, so you could send the clock one one channel and the phase shifted clock (the signal) on the other.

    You need an oscillator and a phase shifter made out of an XOR gate to modulate. Shifted single goes on one channel say left, unshifted one on the other, say right

    To demodulate you use a phase detector made out of an XOR gate to compare the phase of the two channels.

    This would be analogous to Manchester BPSK coding, except that you use one of the two audio channels to store the carrier so you don't need to spend expensive electronics regenerating it.

    So something like this seems plausible. Unfortunately I didn't know enough about electronics back in the Atari days to try it.

    --
    echo -e 'global _start\n _start:\n mov eax, 2\n int 80h\n jmp _start' > a.asm; nasm a.asm -f elf; ld a.o -o a;
  14. MP3 ? by XNormal · · Score: 3, Informative

    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.
  15. Pom1 by anarkavre · · Score: 4, Informative

    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."
    1. Re:Pom1 by morgan_greywolf · · Score: 2, Funny

      Hmmm....an Apple in Java....I'll have to try that.

      *dunks a piece of Washington Golden Delicious in his coffee*

      *munch*Not*munch*bad*munch*

  16. Amazed it actually works by pslam · · Score: 4, Interesting

    The interesting thing about this article is:

    • a) The MP3 encoding process didn't totally mangle the signal. A decent encoder should have dropped all those 1ms duration waves due to masking. Must be a crappy encoder or a forced high bitrate :)
    • b) 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.

    This could have been done so much more easily :)

  17. There is a MUCH Easier Way... by macs4all · · Score: 5, Informative

    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...

  18. Those were the days... by Digital_Mercenary · · Score: 4, Funny

    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...."

    1. Re:Those were the days... by Gordonjcp · · Score: 3, Informative

      That's because they're electric trains with big spinning magnets ;-)

      The BBC used to get people to take taxis rather than use the Underground, for the same reason.

    2. Re:Those were the days... by Detritus · · Score: 2, Informative

      It's those traction motors. They are notorious for emitting a magnetic field that is strong enough to erase magnetic tape. If they can move a train, they can erase your tapes. The same thing used to happen to couriers transporting 9-track magnetic tapes in NYC via the subway.

      --
      Mea navis aericumbens anguillis abundat
  19. Re:Apple I BASIC? by Zaatxe · · Score: 3, Insightful

    Isn't that the buggy version that Woz built (and hated?)

    Who cares? The fun is in recovering it, not using it! I'm sure that the archeologists that find mummies don't want to mummify dead people, they just want to learn about how the ancient people lived.

    --
    So say we all
  20. Why they didn't use MESS? by marcomarrero · · Score: 3, Interesting

    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.

  21. 6502 assembly - now there's a blast from the past by GogglesPisano · · Score: 2

    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.

  22. Re:Apple I BASIC? by sootman · · Score: 2

    If you can read Portuguese, check my blog

    If you can use Babelfish, check out his blog :-)

    --
    Dear Slashdot: next time you want to mess with the site, add a rich-text editor for comments.
  23. The decoder uses a Schmitt trigger by tepples · · Score: 2, Insightful

    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?

    1. Re:The decoder uses a Schmitt trigger by pslam · · Score: 2, Insightful

      That's nice but,

      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.

      He doesn't do that.

      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 doesn't do that

      If there were more noise than the DIVISOR could reject, then wouldn't it fail to load on the original hardware too?

      Yes, he's lucky.

    2. Re:The decoder uses a Schmitt trigger by tepples · · Score: 2, Insightful

      the decoder uses two comparators: one at 32768/DIVISOR and one at -32768/DIVISOR.

      He doesn't do that.

      Read the code in the article. I'll summarize the relevant part:

      if (sample > (32768/DIVISOR)) {
      // handle positive transition
      } else if (sample < -(32768/DIVISOR)) {
      // handle negative transition
      }

      That looks like a Schmitt trigger to me.

  24. Re:Kansas City Standard by macs4all · · Score: 2, Informative

    Nope. Woz rolled his own standard. MUCH faster and MUCH more reliable than the Kansas City standard.

    In fact, of all the cassette interfaces of the day, including some REALLY elaborate S-100 ones developed by Don Tarbell, the Apple 1 (and Apple ][) cassette interface stands alone in reliability and "forgiveness" to things like playback level and tape quality. That is because Woz depended SOLELY on the timing of ZERO CROSSINGS of the signal, which, unless the tape speed is enormously out of whack, or enormously unstable millisecond-to-millisecond, have ZERO (pun intended) effect.

    I have some original engineering notes by Woz regarding his development and testing of the cassette interface, where he describes his own amazement at how reliable his cassette interface is. He describes hunting down the cheeziest recorders, and the most horrible cassettes, to try it on, and it works like a charm. It just also happened to be either the fastest, or the second fastest (and easily the most reliable!) of anything available. Before or since.

  25. In Federated Brazil... by Tetsujin · · Score: 3, Funny

    the idea was to make talk radio accessible to def people.

    Like Mos Def and Def Leppard?

    --
    Bow-ties are cool.
  26. Neither Steve nor Woz owns an Apple I? by SteveWoz · · Score: 4, Informative

    I still own a couple Apple I's.

    --
    OK a new size TV
  27. Re:Apple I BASIC? by Kj0n · · Score: 3, Funny

    The fun is in recovering it, not using it!

    The real fun is in irritating Woz by reporting all the bugs to him again.

    Hey Woz. I just found this small program you wrote and boy, is this code terrible!