Programming the Atari 8-bit

My programming started in 1979 with the TRS-80 Model I, but in late 1981? early 1982?, I got my Atari 800, and later a 1200XL, then Atari ST. Those are what I consider "my computers".

Last few weeks for hobby time, I've taken up playing with an Atari 8-bit emulator, and may soon buy an old machine (130XE? I guess?) and a modern SD-card reader, and HDMI adapter unless I want to set up my old CRT… Yes, this is "pointless", but it's the most emotionally rewarding programming I've done in some time.

Had to do a lot of setup to get to this point, though. Follows are my excessive notes, which will hopefully be useful to others.

The keyboard mapping in AtariMacX is weird, I finally figured out:

Mac Key Atari Key
` Break
F2 Option
F3 Select
F4 Start
F5 Reset
Sh-F5 Cold Boot
Opt-F5 Insert Char (be REAL DAMN CAREFUL not to miss the Opt key!)
Sh-Opt-F5 Insert Line (same, DANGER WILL ROBINSON DANGER)
Home / Opt-F7 Clear
End Atari/Inverse
PgDn / Opt-F10 Help (XL/XE)
Opt-F1 F1 (1200XL)
Opt-F2 F2 (1200XL)
Opt-F3 F3 (1200XL)
Opt-F4 F4 (1200XL)
Capslock Cycle caps, may take several tries of caps A backspace repeat until you get lowercase, not graphics or uppercase.
Sh-Capslock Uppercase, almost always works

Typing on a real Atari keyboard is probably the #1 reason to get real hardware instead of emulation.

Immediately it comes rushing back, how much I didn't like the default environment of blue screen, clicky keyboard, inset margins. Easy to fix with a few pokes, but I don't want to do that every time I reboot, so I need a startup program.

  • First, configure Atari800MacX with the subdirectories next to it. It comes with all these folders in user space, but it's actually mapped to somewhere in /var, which is awful.
  • Make a boot disk. Media -> Disk Image Conversions -> XFD to ATR, pick the DOS25.XFD image in OSRoms, and call that boot.atr, store it in Disks, Load it in D1 Cmd-1 and pick boot.atr.
  • Reboot into DOS, by Control -> Disable BASIC. Bask in the glory of Atari DOS 2.5.
  • Make a data disk, Media -> New Floppy Image, I went with Medium Density (130K) since almost everything can read that, assign to Drive 2, and call that disk2.atr or whatever.
    • From Atari DOS, Format: I <return> D2: <return> Y <return>
    • Preferences -> Boot Media -> Set to Current Media, Save Configuration
  • My Atari BASIC project on Gitlab
    • Based on what I remember of my old main menu, I had a ton more stuff but I'm slowly adding routines as I need them. This can also be a shell for new programs, delete 11-9998 and use the subroutines. I wrote Draw to test joystick & function key scanning, not to be a good paint program, typed in a Music demo to make sure I had sound working.
      • Digression: This is not an efficient structure, because high line numbers take longer to find; an optimizing Poindexter would put the subroutines tightly packed at 1-999 and the program at 1000+, but it's massively easier to read & work with this way. I won't be in BASIC that much anyway, it's just for utility work.
    • Download AUTO.LST, convert Unix newlines (char 10) to the ATASCII newline (char 155 õ), and drop it in the HardDrive1 folder.
    • % LANG=C tr '\233' '\n' <AUTO.LST.TXT >AUTO.LST
    • Or you can just Media -> Edit an .ATR disk image, import file, and that has a newline conversion.
    • From BASIC, E."H1.AUTO.LST" <return> RUN <return>, pick Y. (Script AUTORUN.SYS), and enter:
      • ?"MAINMENU"
      • E."H1:AUTO.LST"
      • RUN
      • .
    • Change H1 to D1 if you saved it in your boot.atr.
    • Now it'll do that on every bootup from that floppy. Reboot to be sure it works.
    • If you make changes to your main menu, remember to LIST "H1:AUTO.LST". I use LIST/ENTER (text LST format) instead of SAVE/LOAD (tokenized BAS format) so I can read it from the Mac; BAS is slightly smaller and much faster to load/save, but it doesn't matter with emulation or an SD-card.

    • Atari-autorunsys

  • BASIC set up and tested, and it's a convenient place for little utilities, but now for real programming.

  • Atari Macro Assembler and Program Text Editor

    • Download this, read the fine manuals; more for MEDIT than the assembler unless you're really hardcore. I will probably do little or no assembly, even tho back in the '80s I could hand-assemble short programs directly into ATASCII codes to run from BASIC; bug-eating freak that I was.
    • Read the MEDIT manual. It's quite a respectable full-screen editor with command mode for search/replace, block editing, etc.
    • Open the Atari Macro Assembler and Program Text Editor.atx (ATX is write-protected or encrypted or something; you can't use them directly, and have to disable the SIO speedup hack in emulator) disk in drive 2 of your Atari (Cmd-2), Control -> Disable BASIC (which will reboot to DOS). So you want the program files off that:
      • DOS: C <return> D2:MEDIT,D1:MEDIT <return>
      • DOS: C <return> D2:MEDITCM.BAS,D1:MEDITCM.BAS <return>
      • DOS: C <return> D2:AMAC,D1:AMAC <return> (skip if you'll never write ASM)
      • DOS: C <return> D2:SYSTEXT,D1:SYSTEXT <return> (I think only needed for AMAC?)
      • Eject: Ctrl-Cmd-2
      • Reload your data disk, Cmd-1, disk2.atr.
    • Control -> Enable BASIC, LOAD "D1:MEDITCM.BAS" <return> RUN <return> and configure MEDIT however you like.
      • Language: PAS
      • Tabstops: Set at 5 and +4 after the existing ones, because 8-wide tabs are crazy in a 40-column screen. Yes, I'm a tabs not spaces guy, OBVIOUSLY.
      • Margins: 1,40
      • Colors: 12,4,14 (sadly can't be 0 or 2 background luminance, because the cursor is black)
      • Flags: Tabs: Expand, Shift-Lock: No (starts in lowercase).
      • Save & Return to DOS.
      • You can just copy the MEDITPAS.ECF to MEDITTXT.ECF, etc., you don't need to run the tool for each language, but it doesn't have a default mode. Note you also have to copy these to each disk you're editing on, or it switches back to the stupid defaults:
      • DOS: C <return> D1:*.ECF,D2: <return>
      • DOS: L <return> MEDIT <return>, filename D2:HELLO.PAS, and enter:
        program hello;
        var c: char;
        begin
          writeln('Hello, Atari!');
          read(c);
        end.
        
      • <option> exit <start> to save & exit. Note return doesn't execute commands in MEDIT, start does. Kids Today™ have some meme about how hard it is to exit vi? Ha ha, they have no idea. RTFM.

  • Finally ready to program in Action! or Pascal, which is what I mainly did back in the day.

    • Deep Blue C: Tragically underpowered version of Small-C. I loved it as an intro to C, but didn't use C for real until the Atari ST. It did produce standalone binaries and the compiler was easy to use, IIRC.
      UNSUPPORTED FEATURES
        Features in C not supported in DEEP BLUE C are:
        1) structures, unions
        2) multidimension arrays
        3) Floating point numbers
        4) Functions returning anything but int
        5) Unary operators: sizeof
        6) Binary operators: typecasting
      DIFFERENCES FROM STANDARD C
        THE DEEP BLUE C language has the  following nonstandard features:
        1. The last clause of a "switch" statement, either "case" or "default", must
      be terminated with a "break", a "continue" or a "return" statement.
        2. The ancient =<op> construct has been removed. Use <op>= instead.
        3. Characters are unsigned. Chars range in value from 0 to 255.
        4. Strings can not be continued on the next logical line.
        5. C source code lines can be a maximum of 79 characters long.
        6. Functions can have a maximum of 126 arguments.
      SPECIAL SYNTAX
        C uses several ASCII characters not available on the ATARI computer's
      keyboard. In particular the braces have been replaced by to two-letter
      combinations $( and $), and the tilde has been replaced by $-.  The $ character
      is not used in C, so your editor's find and replace command can be used to
      convert standard c programs into a format acceptable to DEEP BLUE C.
      
    • Action!: Custom language on cart for Atari, fantastic built-in editor (later the basis for the Paperclip word processor!), had a disk runtime system so you could distribute programs (also on AtariMania). But it came out a little later than my Pascal adventures, and it's a weird super-low-level language, and I think I'm in no mood to relearn it right now. Super goddamned fast, tho. May get into this if I'm frustrated later.

    • APX Pascal: Excessively complex process with a disk swap for every compile, compiles & links into PCode, no explanation of how to boot it. This is a very user-hostile compiler.
    • Kyan Pascal: Maze of command line tools. Doesn't work, at least for me, on emulation. It cycles through the tools, but never actually builds anything, eventually crashes and corrupts video. Makes a big deal of being usable from RAMDisk, but that doesn't matter on modern hardware.
    • Draper Pascal: Which I used in the '80s. Hilariously bad editor (but I can use MEDIT, so fuck that), compiler just fucking works, but only produces PCode (.PCD), so has to start from bootdisk or run Draper's menu then your program, ick. But this was no trouble to get running, so it wins.
      • Insert drpascal.atr in drive 1, reboot, boots into a menu.
      • 3 Compile program: D2:HELLO.PAS
      • 1 Run program: D2:HELLO
      • Total success! \o/ Hit any key to exit the program.
      • Drive 1, boot.atr, Drive 2, drpascal.atr, reboot
      • DOS: C <return> D2:AUTORUN.SYS,D1:PASCAL.COM <return>
      • DOS: C <return> D2:INIT.PCD,D1:INIT.PCD <return>
      • Cmd-2, disk2.atr
      • So now I can: DOS: L <return> PASCAL.COM <return>
      • And run Pascal programs. I could make a more focused runtime menu for it, maybe dir & list all the PCD files, the INIT.PAS source is included. If I ask it to compile, it prompts to insert drpascal.atr, and then I can switch back, which is reasonable.
      • Standard library is small but effective, seems like it has all the BASIC equivalent commands, and enough POKE/PEEK/ADDR stuff to let me do everything, including Player-Missile Graphics.
      • I can presumably now move all my source and disk2.atr contents to H1, so they can be managed & edited on the Mac, but I just wanted to get things running first.
      • Probably make another gitlab project (and actually sync it from git) when I get somewhere with that.

This took quite a lot of my hobby time doing something harder than actual work, to be honest. But I'm in a good place with it now.

Where Did Music Go?

Listening to these performances from 1979, when I was a kid, and they sound so much better than anything new.

"A lot of you might not've heard it, because we've only just become fashionable."
—Lemmy, 1979, throwing all the shade at new-fans

It is very weird to me that there's been basically no new music made in the last 20 years. Some '80s-'90s bands keep truckin' along, Reznor, TOOL, and Mustaine still rock. We get some last-gasp geriatrics from Black Sabbath and Van Halen. There's like a half-dozen good new retro bands like Raveonettes, Within Temptation, Zeal & Ardour, BABYMETAL. A very few good new bands like Anamanaguchi; most chiptune is shit, but the 'guch are half rock 'n roll. I liked Slime Girls a few years ago, but that's trashy pop. Rock ain't dead but it's on life support. All the hardcore bands are gone. Rap is in a sad state when Snoop Dogg, bad joke of the '90s, is a top star of the present.

What are the kids listening to? Literally muzak, neutered Madonna imitators like Spears, Swift, and Gaga, and sucker MCs like Drake.

Yeah, yeah, I'm a cliché: Unfrozen caveman John Spartan doesn't like "mini-tunes" the kids listen to, put him back in the fridge. Middle-aged man wears black leather and wants the kids to scream into their speakers and mosh in a pit, and they dress like yuppies and want an early bedtime and quiet background noise.

Halloween Countdown Sunday Music

Odd film, but I love it. Halloween I & II completed the Michael Myers story. Then III was a totally new thing. The intent was to make an anthology series, but no, dumb people just wanted more of Michael; I think all subsequent "Halloween" films are irrelevant and stupid (OK, I do like the Rob Zombie movies). I was a spooky monster kid, but still wasn't allowed to watch the first two at the time of their release, but somehow H3 at 12 was OK. The soundtrack is one of Carpenter's better mood pieces, not as iconic or repetitive as the first two; people sometimes forget Carpenter's as much a musician as a filmmaker.

Plot & characters of the film remind me strongly of The Stuff, Phantasm (especially II-III), and Killer Klowns From Outer Space; losers struggling to expose some terrible danger to Humanity, mostly failing and running. That's what Lovecraft was on about, and how every Call of Cthulhu game should be, not gangsters throwing dynamite at Shoggoths, but truck drivers and kids running for their lives and coming across as crazy people to the useless pigs.

"And don't forget to wear your masks. The clock is ticking, it's almost time! Happy happy Halloween, Silver Shamrock!"

Bonus:

Pandos Go Extinct

I was as surprised as anyone to hear Pando was still in business, I figured by now Sarah Lacy would've egged Paul Carr on to punch someone and the both of them go to prison. And now they've sold their site to, no shit, "BuySellAds". The "we run on investment and vapor like a tech company", no, "we run a LOT of ads but paywalls are evil!", no, "we run a LOT of ads AND a paywall!" business models never supported them becoming big.

Say what you want about Michael Arrington and Techcrunc, the business model worked. Just as hated, still kind of a shitty site, but they pay their bills and provide consistent mediocre tech industry news coverage.

Examine why everyone hated them. First, they bit the hand that feeds; you can't run FuckedCompany 2.0 and also schmooze with the companies you openly fuck over. Second, their site was awful even before the paywall, and after, you had to search around for someone with a sharing link or find a bugmenot login, complete pain in the ass; I never gave them a penny and read anything I wanted, back when I cared about the "Tech Industry". Third, they thought they were the smartest gal/guy in the room, when generally they were unaware of basic technology and business principles.

Take the site Pandering Dozily continuously compared itself to, despite a vast difference in scale and ambitions: The NY Times, with 100x more staff (?). NYT has shitty tech coverage, too, but nobody feels anything but mild contempt for them, because they don't try to suck up to Silicon Valley; and fundamentally everyone hates New Yorkers including New Yorkers, so it's just urine off a rat's back to them. NYT has a big solid base of not-tech-news to support this dangerous hobby of insulting every tech company they report on, despite half of them having universal surveillance systems, AI killer drones, and whatever else in the labs. Nobody expects New Yorkers to know anything except shitty pizza, Wall Street nonsense, and Broadway, so their tech gaffes are ignorable. Pandilly had no such backup base.

Oh, don't worry about them. Paul can fall back on writing midlist quasi-self-help books, Sarah's trying to teach women how to be mothers because clearly they need her help.

Lester Bangs Sunday Music

So the playlist:

So I was thinking about Lester Bangs, who basically taught me how to write with his reviews (which explains a lot, you know? I had higher ambitions but some rambling reviews with moments of clarity and profanity are what I can manage), then remembered Bruce Sterling wrote an alt-history biography "Dori Bangs" about him and Dori Seda hooking up, reread it. Fucking fantastic and a little heartbreaking, highly recommend it.

Tech Noir Saturday Music

Styx famously sang:

"The problem's plain to see
Too much technology
Machines to save our lives
Machines dehumanize"

But of course that wasn't the problem at all. People were the monsters all along. Machines only suck because people program them to suck.

The solution is clear.