Nanorogue2 in BASIC

I've completed my BASIC 10-Liner contest entry, download on

Just shove the disk (.atr) in Atari800MacX or any other compatible Atari 800XL emulator, disable BASIC and hit reset, it should boot up into the launcher:

Where you can read docs or source:

And play the game!

So, the source for my first pass was manually-packed down, and I couldn't really fit everything I wanted in there, or switch to text-graphics mode. With some rethinking, and a better source editing tool, I could… So I wrote a filter program "" that removes comments & blank lines, joins up everything after a numbered line with colons, lets me insert binary codes with \xFF escapes. It still looks a little dense, because I have to manually use abbreviated statement names or remove spaces, I'd like to make it smart enough about BASIC source to do that itself.

But it lets me turn source like:

5   POKE731,1       // noclick
    GR.1            // 20x20 wide chars, 40x4 regular
    SE.1,13,15      // palette 1 to gold
    W=20            // world size
    DIME$(27),M(W,W)    // E$() encounter table, M() map
    H=10        // Hit Points
    L=1     // Level
    // G=0      // Gold, default value


5 POKE731,1:GR.1:SE.1,13,15:W=20:DIME$(27),M(W,W):E$="RRRZZZD$$..........#######>":H=10:L=1:?"NANOROGUE BY MDHUGHES"

(except the RRR... are inverse & graphics chars)

See the Atari BASIC Quick Reference Guide to learn the abbreviations and some of Atari's peculiarities. And it's running in Turbo Basic XL which really helped the program size, so I was able to squeeze in stairs!

Last time I was using the compiler, and that worked but it distorted my sounds, and I couldn't make LAUNCHER.CTB run NANOROG2.CTB! So if I just left them all uncompiled (but tokenized) .BAS files it works fine.

The only down side is it's stuck in easy mode. I'd love to have a difficulty which increases the GP to Level Up, and makes monsters hit harder (but not reward more), but that didn't quite make the cut.

Generally I'm pretty pleased by this!

The ZX Spectrum (non-Next) port is turning out to be hard, it lacks a few things and doesn't have ELSE, either, so I don't know if it can be done.

10-Line BASIC Contest

Let's go back to the 1980s!

So I knocked down a tiny subset of my already tiny BASIC demo program, NANOROGUE, and plan to make 10-line versions for Atari 800 and ZX Spectrum. Getting it running on desktop in Chipmunk BASIC was trivial. Just a little ANSI for screen positioning.

Initially I just used standard Atari BASIC, and that worked fine, if very very tightly packed, and not fast… but the lack of an ELSE statement left me with an 11-line program, I wanted to end with 50 ... :GOTO 20:ELSE:GOTO 20:ENDIF but had to move it to a new line. Very frustrating. So I'm using an enhanced BASIC, which is allowed for the PUR-120 tier, for one command.

Being "compiled" (to bytecode, don't expect miracles) and making AUTORUN.SYS easier than my own utility is nice. TBXL is at least a 1985 tool; though at the time I was using the "official" BASIC XE cartridge instead, which had similar features, and mainly moving over to Action!, 6502 ASM, and C. But for retrocomputing it's fair game.

Making a TBXL executable & bootable disk is a little fussy.

  1. Make a blank floppy ATR (emulator disk format), format it, put Atari DOS 2.5 on it or whatever you like (from DOS 2.5, H to write DOS files). This is your program disk. Like TRON, everything you do will be encoded on it, and losing it will subject you to immediate deresolution.
  2. Turbo BASIC XL disk in D1, program disk in D2. Control menu, Disable BASIC, Cold Reset (Sh-F5). You should see a red load screen, then READY. Check you're in TBXL by typing DIR.
  3. Write your program. I recommend writing BASIC as LST files in a desktop editor, then Cmd-E "Edit an atr disk image", click "Atari/Mac Linefeed Translation", "Import Files From Mac". In BASIC, ENTER "D2:FOO.LST". RUN to test it. But if you like living the '80s lifestyle all the way (or using non-ASCII chars, which are annoying to work with), you can work entirely in TBXL.
  4. Save your program tokenized: SAVE "D2:FOO.BAS"
  5. BRUN "D1:COMPILER.COM", now swap D1 and D2 (Cmd-D, click the swap buttons; you want your program disk in D1!), hit 1, pick FOO.BAS, save as AUTORUN.CTB. Swap disks back (you want your program disk in D2!).
  6. Ctrl-D, J for Ja (yes) to go to DOS-XE. COPY D1:RUNTIME.COM D2:AUTORUN.SYS
  7. Now put your program disk in D1, reset, and it should come right up into your program, then prompt for Dos, Run, or Load when it ends. Nice!

So resuming work on NANOROG, I get:

The only down side is this tiny version has a very slow redraw, it renders the entire screen each move, instead of just fixing last/new positions. I'm pondering changing it to graphics 1 (wide text, 4 colors) and poking screen memory which is probably faster than printing. I made some acceptable bleeps and buzzes with SOUND commands; I'm a poor sound designer, but I get there with some trial and error.

Anyway, next week's task is the ZX Spectrum version. Speccy BASIC is pretty good, so I expect I can knock that out quick and without all these shenanigans.

What I'm Playing: Atari Flashback X Deluxe

Modern videogames suck. Let's go back to the '70s & '80s forever!

Ordered this for my birthday last month, I got screwed (but not charged) by a phony 'zon seller, then reordered. When it got here I discovered it doesn't have an HDMI cable in the box(!!! Some choice language was used that day, I assure you), and I only have micro-HDMI spares, so I had to order one (didn't feel like disassembling my existing systems). So weeks later, I can now set it up!

The "console" is hand-sized (joysticks on the box cover are to scale!), but looks just like the classic VCS, classic fake woodgrain on black plastic, very nice chunky silver switches that feel great when you flick them to set difficulty or choose game mode, smooth plastic where the cartridge slot would be; I think they missed an opportunity to put an SD card slot there. The previous Atari Flashbacks had a less authentic looking case, and goofy yellow plastic buttons.

There's two Atari-style joysticks with it, they have the usual one trigger button, and Home, Start, Select, Rewind buttons on the front base. I'm not in love with the joystick feel, it's much looser than a new Atari joystick which was a real struggle to move more than a few millimeters, these are closer in feel to 3rd party sticks, not as mushy and unresistant as Apple or CoCo joysticks. The device uses a standard Atari 9-pin joystick port, so I'm thinking about either getting old Atari sticks, or if I can find one in good condition the Spectravideo QuickShot which was my weapon of choice in the Atari 8-bit days.

The main screen has menus Favorites, Recently Played, Alphabetical, Atari, Paddle, Settings, About; everything's in Alphabetical, the Atari one is just 1st-party so you miss all the best games. Paddle games are extremely hard to control. Settings are limited to setting a "bezel" design, or wiping your saves. I do wish you could un-favorite games so they don't appear in a normal list, because I have no use for Atari's awful sports games.

So I hit up Yar's Revenge, obviously, and play that first. The first screen has an ugly and inadequate text summary of the manual, it doesn't have scans of the manuals or the comics, so you're going to need to find those; the game variations are not explained beyond 1 or 2 player versions. So on difficulty B (easy in this case; some games used A for easy), game 0 which the actual manual says "the simplest version, a good choice for young children to play. It features a slow Destroyer Missile", I got destroyed the first time, even shot myself with the Zorlon Cannon once, which is maybe the dumbest death I've ever had in a videogame. Second run I killed the first Qotile but got demolished fighting the scrolling shield; in theory it's easier because you can nibble the top or bottom and flee across the top/bottom border to avoid the missile, but timing the gap with the cannon is too much for my distracted old brain. I think some practice will get me back up to speed where I can actually get a decent score.

The Code Mystics iPhone ports of these games do include the manuals, but not all the peripheral material either, and playing on the phone is difficult; I have an "8-bitty" bluetooth joystick that talks to the phone, but BT has perceptible lag, and it's not a big chunky joystick, and then how do you prop up a teeny little phone so you can play a game? No, it's impossible except for the simplest games.

Of course the Swordquest games are unusable without the manuals and comics. I desperately need to find an archive with, say, PDFs of all 2600 game manuals, comics, Atari Force comics, etc. Some of that is in, but not organized for one-click download.

Went thru a bunch more games, and generally they look and play great; as fast as the originals without noticeable lag, tho I haven't done high-speed video recording to verify it's not dropping frames…

Most games have an inset screen with the above-mentioned bezel around it, tho some of Taito's and Activision's games are full-screen. There's no setting for this, and I'm displeased but it's on a 46" or something screen, as opposed to the 17" or smaller CRT of my yout'. There is a fake-scanline setting, which I don't understand the point of. CRTs looked fuzzy so you couldn't really see the scanline, and the pixels were soft and curved into each other, and had color artifacting. On a big LCD, a fake scanline isn't going to make the pixels look softer or change their harsh colors. It's just a completely different appearance. I do have a CRT TV, but only a DVI-to-RGB adapter, I'd have to find an HDMI-to-RGB to drive this.

The paddle games are unplayable with the joysticks; they work, but you can't move fast enough. I killed a bunch of clowns trying to do Circus Atari, and scored no points. I need to order some classic paddles.

Many of my favorite games are in this, but there are some obvious missing ones: Battlezone, Berzerk, Casino, Defender, The Empire Strikes Back, Pac-Man, Pitfall II, Raiders of the Lost Ark. The licensed ones are probably hard to get back; nobody misses E.T.

Several keypad-based games are missing; I'd happily pay for an optional keypad that enabled these: Basic Programming, Brain Games, Star Raiders.

But it does have the Sears Stellar Track which is BASIC Super Star Trek that runs on a dinky little 2600! I have no idea how that was technically possible in 128 bytes of RAM.

  1. 3D Tic-Tac-Toe
  2. Adventure
  3. Adventure II
  4. Air-Sea Battle
  5. Amidar
  6. Aquaventure
  7. Asteroids
  8. Asteroids Deluxe
  9. Atari Climber
  10. Basketball
  11. Beamrider
  12. Blackjack
  13. Bowling
  14. Breakout
  15. Burger Time
  16. Burnin Rubber
  17. Canyon Bomber
  18. Centipede
  19. Championship Soccer
  20. Chopper Command
  21. Circus Atari
  22. Combat
  23. Combat Two
  24. Cosmic Commuter
  25. Crackpots
  26. Crystal Castles
  27. Decathlon
  28. Demons to Diamonds
  29. Desert Falcon
  30. Dodge Em
  31. Double Dunk
  32. Dragster
  33. Enduro
  34. Fatal Run
  35. Fishing Derby
  36. Flag Capture
  37. Football
  38. Frogger
  39. Front Line
  40. Frostbite
  41. Golf
  42. Gravitar
  43. Gyruss
  44. H.E.R.O.
  45. Hangman
  46. Haunted House
  47. Home Run
  48. Human Cannonball
  49. Indy 500
  50. Jungle Hunt
  51. Kaboom
  52. Keystone Kapers
  53. Lock n Chase
  54. Maze Craze
  55. Megamania
  56. Millipede
  57. Miniature Golf
  58. Missile Command
  59. MotoRodeo
  60. Night Driver
  61. Off-the-Wall
  62. Oink
  63. Outlaw
  64. Pitfall
  65. Polaris
  66. Pong (Video Olympics)
  67. Pooyan
  68. Pressure Cooker
  69. Radar Lock
  70. Realsports Baseball
  71. Realsports Basketball
  72. Realsports Soccer
  73. Realsports Volleyball
  74. Return to Haunted House
  75. River Raid
  76. Saboteur
  77. Save Mary
  78. Seaquest
  79. Secret Quest
  80. Sky Diver
  81. Slot Racers
  82. Solaris
  83. Space Invaders
  84. Space Raid
  85. Space War
  86. Sprintmaster
  87. Stampede
  88. Star Ship
  89. Starmaster
  90. Steeplechase
  91. Stellar Track
  92. Street Racer
  93. Submarine Commander
  94. Super Baseball
  95. Super Breakout
  96. Super Cobra
  97. Super Football
  98. Surround
  99. Swordquest: Earthworld
  100. Swordquest: Fireworld
  101. Swordquest: Waterworld
  102. Tempest
  103. Tutankham
  104. Video Checkers
  105. Video Chess
  106. Video Pinball
  107. Warlords
  108. Wizard
  109. Yars Return
  110. Yars Revenge

Deluxe bonus games:

  1. Backgammon
  2. Chase It
  3. Escape It
  4. Frog Pond
  5. Fun with Numbers
  6. Marine Wars
  7. Miss It
  8. Shield Shifter
  9. Slot Machine
  10. Strategy X

Coal in Infogrames/Not-Atari's Stockings

  • Atari VCS Chief Operating Officer Michael Arzt: interviews himself with a sock-puppet:
    • Sock-Puppet: "You are very handsome and are shipping on time!"
    • COO: "These are both true, and you are entirely alive and questioning me, not just a filthy sock on my left hand."
    • Sock-Puppet: "Please don't put me on your cock again I don't want to get pregnant/sticky."
    • COO: "No promises."
  • Previously in Not-Atari News

Takeaway is that the new VCS box is delayed until Spring 2020, maybe later, with a number of excuses, and some more case photos but no working demos anywhere. The cases do have connectors inside now, which is very exciting if you're completely gullible, but there's zero evidence from Infogrames that anything can be powered on and do something.

There's a bunch more lies, such as that most Unity games will work on it; while it's true you can recompile many Unity games for Linux, it often requires specific hardware and software configs, like the SteamOS, and the odds that Infogrames' contractors who are building this have matched those configs is vanishingly small.

The "original software" they tout is a $100/year subscription to play classic Atari games, which you can get a bundle of for far less, existing consoles for $20-40, or "free" (pirated, but it's been 40 years; meh) with MAME.

The actual reason they used IndieGogo is that IndieGogo doesn't require shipping a product, you're throwing money into someone's pockets with no guarantees. I've been waiting since 2013-10-17 for the LotFP Hardcover Referee Book, Raggi says (posting a weekly update a month ago…) he's still working on it, and I believe him because he's an honest 6-years-late fuckup. I wouldn't believe the Infogrames people if they said "le ciel est bleu".

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!)
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;
          writeln('Hello, Atari!');
      • <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.
        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
        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.
        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.

Not-Atari Still Has No VCS

"Atari SA", formerly Infogrames who bought the name, are still not shipping their fantasy "modern VCS", to everyone's total lack of surprise.

This is just about physically painful as these useless parasites take peoples' money (not mine) for a grift, based on love of what a different company named Atari was like 30-50 years ago.

Now they're so shitty, their con so obvious, they've been removed from moderation of the subreddit about them.

Code Mystics' Atari Greatest Hits collection is unrelated, and a fantastic emulation on iOS and DS.