ZxBlastar

Blastar for the ZX Spectrum and Commodore VIC-20 is a conversion of Elon Musk's first paid-for game (he earned $500) for the Spectravideo SV-328 at the tender age of 13. I wondered what the game would look like, primarily as a listing if it was converted to more primitive computers, in both cases, because they lack sprite support and because they should be able to run on unexpanded computers (16Kb and 5K respectively). Blastar.tap is for the VIC-20 and ZXBlastar.zip is the ZX Spectrum version. In both cases, the programs take up about 2.5KB.

The VIC-20 version is particularly challenging for several reasons. Firstly, it's possible, but really tricky, to set up a graphics mode so that you only allocate space for the graphics characters you need (in my case 5 characters) and are also able to access normal text characters.

The solution is to allocate one page of memory for the graphics chars starting at 7168 (28*256), and it turns out that inverse characters appear as normal upper case + some block graphic characters. Because I only wanted 5 graphical chars, I used video (not ASCII) characters 59 to 63. I then set the end of BASIC to point to the address 7640, which meant that BASIC in fact could encroach on the character set!

The second major problem for the VIC-20 version is that it's tricky to print at any location on the screen. I chose to poke the printing position to where I wanted it, which needed 3 pokes, but subsequent testing shows that using cursor controls is much neater. This had the consequence that the VIC-20 version of the game is slower than the ZX Spectrum version, though ironically the sluggishness and keyboard buffering on the emulator makes the game more fun and challenging to play.

The VIC-20 version of the listing seems rather long, it's 81 lines long, but most of these are multi-statement lines to reduce program memory used.