Categories
goatee-stroking musing, or something

For completeness: Level 9 “Snowball” bitmap font

The Snowball font on the Amstrad CPC 464

Oooh blecch — did I really like this when I was a young ‘un? Following on from the same process as in The coolest font (when I was 15, that is) here’s the bitmap font from Level 9’s Snowball.

 10 REM    *** L9SFONT.BAS ***
 15 REM bitmap font from Level 9's
 20 REM Snowball text adventure
 30 REM  on the Amstrad CPC 464
 40 REM (it was so cool at the time…)
 50 REM Dug up by scruss, 2020-01
 60 REM ==============================
 100 SYMBOL AFTER 32
 110 MODE 1
 120 GOSUB 1000
 130 PRINT" *** It's the Level 9 font ***"
 140 PRINT" ***    from  Snowball!    ***"
 150 PRINT"   Dug up by scruss, 2020-01"
 160 PRINT
 170 PEN 2
 180 PRINT"Lorem ipsum dolor sit amet, consectetur"
 190 PRINT"adipiscing elit, sed do eiusmod tempor"
 200 PRINT"incididunt ut labore et dolore magna"
 210 PRINT"aliqua. Ut enim ad minim veniam, quis"
 220 PRINT"nostrud exercitation ullamco laboris"
 230 PRINT"nisi ut aliquip ex ea commodo consequat"
 240 PRINT"arfle barfle gloop? | | |"
 250 PRINT
 260 PEN 1
 270 FOR i%=32 TO 127
 280 PRINT CHR$(i%); " ";
 290 NEXT i%
 300 PRINT
 310 PRINT
 990 END
 1000 SYMBOL 33,&10,&28,&28,&28,&10,0,&38,0
 1010 SYMBOL 34,&66,&66,&44,&88,0,0,0,0
 1020 SYMBOL 35,0,&24,&7e,&24,&24,&7e,&24,0
 1030 SYMBOL 36,&10,&7c,&40,&7c,&04,&7c,&10,0
 1040 SYMBOL 37,&e4,&a4,&e8,&10,&2e,&4a,&4e,0
 1050 SYMBOL 38,&70,&88,&88,&72,&84,&88,&76,0
 1060 SYMBOL 39,&0c,&0c,&08,&10,0,0,0,0
 1070 SYMBOL 40,&0c,&10,&30,&30,&20,&14,&0c,0
 1080 SYMBOL 41,&30,&28,&04,&0c,&0c,&08,&30,0
 1090 SYMBOL 42,&10,&54,&38,&fe,&38,&54,&10,0
 1100 SYMBOL 43,0,&10,&10,&7c,&10,&10,0,0
 1110 SYMBOL 44,0,0,0,0,&18,&18,&10,&20
 1120 SYMBOL 45,0,0,0,&fc,0,0,0,0
 1130 SYMBOL 46,0,0,0,0,&1c,&14,&1c,0
 1140 SYMBOL 47,0,&06,&0e,&08,&10,&70,&60,0
 1150 SYMBOL 48,&fc,&8c,&8c,&84,&c4,&c4,&fc,0
 1160 SYMBOL 49,&30,&10,&10,&10,&18,&18,&38,0
 1170 SYMBOL 50,&f8,&98,&08,&f8,&80,&c8,&f8,0
 1180 SYMBOL 51,&7c,&64,&04,&3c,&34,&04,&7c,0
 1190 SYMBOL 52,&c8,&88,&88,&f8,&08,&18,&18,0
 1200 SYMBOL 53,&f8,&98,&80,&f0,&08,&c8,&f0,0
 1210 SYMBOL 54,&78,&98,&80,&f8,&98,&c8,&f8,0
 1220 SYMBOL 55,&fc,&c4,&04,&08,&08,&18,&18,0
 1230 SYMBOL 56,&fc,&c4,&8c,&fc,&84,&9c,&fc,0
 1240 SYMBOL 57,&fc,&e4,&84,&fc,&04,&0c,&0c,0
 1250 SYMBOL 58,&38,&28,&38,0,&38,&28,&38,0
 1260 SYMBOL 59,&18,&18,0,&18,&18,&10,&20,0
 1270 SYMBOL 60,&04,&08,&10,&20,&10,&08,&04,0
 1280 SYMBOL 61,0,0,&7e,0,&7e,0,0,0
 1290 SYMBOL 62,&80,&40,&20,&10,&20,&40,&80,0
 1300 SYMBOL 63,&7c,&04,&1c,&10,&10,0,&10,0
 1310 SYMBOL 64,&3e,&22,&2e,&2a,&2e,&20,&3e,0
 1320 SYMBOL 65,&fc,&c4,&8c,&fc,&84,&c4,&c4,0
 1330 SYMBOL 66,&f8,&84,&e4,&f8,&84,&9c,&f8,0
 1340 SYMBOL 67,&fc,&8c,&80,&80,&c0,&c4,&fc,0
 1350 SYMBOL 68,&f8,&64,&64,&44,&4c,&4c,&f8,0
 1360 SYMBOL 69,&fc,&8c,&c0,&f8,&c0,&8c,&fc,0
 1370 SYMBOL 70,&fc,&9c,&80,&f8,&80,&c0,&c0,0
 1380 SYMBOL 71,&fc,&9c,&80,&9c,&c4,&c4,&fc,0
 1390 SYMBOL 72,&c4,&c4,&84,&fc,&84,&8c,&8c,0
 1400 SYMBOL 73,&7c,&14,&10,&10,&10,&50,&7c,0
 1410 SYMBOL 74,&7c,&54,&10,&18,&18,&90,&60,0
 1420 SYMBOL 75,&c8,&90,&a0,&d0,&88,&8c,&8c,0
 1430 SYMBOL 76,&c0,&c0,&c0,&80,&80,&98,&f8,0
 1440 SYMBOL 77,&82,&ee,&92,&92,&ba,&82,&c6,0
 1450 SYMBOL 78,&8c,&c4,&c4,&b4,&8c,&8c,&84,0
 1460 SYMBOL 79,&fc,&c4,&c4,&84,&8c,&8c,&fc,0
 1470 SYMBOL 80,&fc,&c4,&8c,&fc,&80,&c0,&c0,0
 1480 SYMBOL 81,&fc,&c4,&c4,&84,&94,&88,&f4,0
 1490 SYMBOL 82,&fc,&c4,&8c,&fc,&90,&c8,&cc,0
 1500 SYMBOL 83,&fc,&84,&80,&78,&04,&84,&fc,0
 1510 SYMBOL 84,&7c,&10,&10,&10,&30,&30,&30,0
 1520 SYMBOL 85,&c4,&c4,&84,&8c,&8c,&8c,&fc,0
 1530 SYMBOL 86,&c4,&84,&84,&48,&48,&30,&30,0
 1540 SYMBOL 87,&84,&84,&84,&b4,&b4,&cc,&84,0
 1550 SYMBOL 88,&cc,&cc,&48,&30,&48,&cc,&cc,0
 1560 SYMBOL 89,&86,&86,&44,&28,&10,&18,&18,0
 1570 SYMBOL 90,&fc,&84,&08,&30,&40,&84,&fc,0
 1580 SYMBOL 91,&7c,&60,&60,&40,&40,&4c,&7c,0
 1590 SYMBOL 92,0,&60,&30,&10,&08,&0c,&06,0
 1600 SYMBOL 93,&3e,&32,&02,&02,&06,&06,&3e,0
 1610 SYMBOL 94,&18,&24,&42,&42,0,0,0,0
 1620 SYMBOL 95,0,0,0,0,0,0,&ee,&bb
 1630 SYMBOL 96,&3c,&22,&78,&20,&78,&20,&7e,0
 1640 SYMBOL 97,0,0,&f8,&98,&88,&cc,&fc,0
 1650 SYMBOL 98,&80,&80,&f8,&98,&88,&c8,&f8,0
 1660 SYMBOL 99,0,0,&f8,&88,&c0,&c8,&f8,0
 1670 SYMBOL 100,&08,&08,&f8,&98,&88,&c8,&f8,0
 1680 SYMBOL 101,0,0,&f8,&80,&e0,&80,&f8,0
 1690 SYMBOL 102,0,&1c,&10,&38,&38,&10,&70,0
 1700 SYMBOL 103,0,0,&f8,&98,&88,&f8,&08,&78
 1710 SYMBOL 104,&c0,&c0,&80,&f8,&88,&cc,&cc,0
 1720 SYMBOL 105,0,&60,0,&60,&60,&70,&70,0
 1730 SYMBOL 106,&08,0,&18,&18,&08,&08,&68,&78
 1740 SYMBOL 107,&c0,&c0,&cc,&d8,&f0,&d8,&cc,0
 1750 SYMBOL 108,&30,&30,&30,&30,&30,&30,&30,0
 1760 SYMBOL 109,0,0,&cc,&b4,&b4,&84,&84,0
 1770 SYMBOL 110,0,0,&f8,&98,&88,&cc,&cc,0
 1780 SYMBOL 111,0,0,&f8,&98,&88,&c8,&f8,0
 1790 SYMBOL 112,0,0,&f8,&98,&88,&f8,&80,&80
 1800 SYMBOL 113,0,0,&f8,&88,&c8,&f8,&0c,&0c
 1810 SYMBOL 114,0,0,&f8,&98,&80,&c0,&c0,0
 1820 SYMBOL 115,0,0,&f8,&80,&70,&08,&f8,0
 1830 SYMBOL 116,&60,&60,&20,&78,&20,&28,&38,0
 1840 SYMBOL 117,0,0,&c8,&c8,&98,&98,&f8,0
 1850 SYMBOL 118,0,0,&cc,&cc,&88,&70,&20,0
 1860 SYMBOL 119,0,0,&84,&84,&b4,&b4,&cc,0
 1870 SYMBOL 120,0,0,&cc,&48,&30,&48,&cc,0
 1880 SYMBOL 121,0,0,&88,&c8,&f8,&08,&08,&78
 1890 SYMBOL 122,0,0,&f8,&90,&20,&48,&f8,0
 1900 SYMBOL 123,&0c,&30,&10,&60,&10,&30,&0c,0
 1910 SYMBOL 124,&df,&db,&db,&9f,&83,&9b,&fb,0
 1920 SYMBOL 125,&30,&0c,&08,&06,&08,&0c,&30,0
 1930 SYMBOL 126,&7c,&82,&ba,&a2,&ba,&82,&7c,0
 1940 SYMBOL 127,&FF,&FF,&FF,&FF,&FF,&FF,&FF,&FF
 1950 RETURN

Process was the same:

  1. Load the disk image into an emulator
  2. Load the game
  3. Save the game as a v2 snapshot – these are uncompressed memory dumps
  4. Dump the snapshot to a png using phooky’s PROM/bin2png.py
  5. Crop that image down to just the character data and save as a plain PBM
  6. For each column, create the hex dump using shell code a bit like this:
sc=32; pnminvert snowball_font.pbm | pnmnoraw | tail +3 | cut --character="1-8"|while read f; do echo "printf '&%02x, \n' "\"\$((2#${f}))\"; done | bash | fmt -w43 | sed 's/,$//;' | while read g; do echo SYMBOL $sc", "$g; sc=$((sc + 1)); done | awk '{print 10 * (NR + 0) " " $0;}' > schars032to063.bas
Categories
computers suck

The coolest font (when I was 15, that is)

vaguely uncial style bitmap font from old 8-bit Level 9 text adventure
The Colossal Cave font on the Amstrad CPC 464

Though I didn’t really have the patience for text adventures, Level 9 used what I thought was the coolest font (circa 1985). After checking through them all on the Internet Archive Amstrad CPC software library, I couldn’t find a version that used this bitmap font. I eventually found it on nvg. After lots of messing about, I extracted it and present it here. I’m sure I’ll make a TTF of it soon enough.

Tastes change a bit, don’t they?

 10 REM     *** L9FONT.BAS ***
 15 REM bitmap font from Level 9's
 20 REM Colossal Cave adventure
 30 REM  on the Amstrad CPC 464
 40 REM (it was so cool at the time…)
 50 REM Dug up by scruss, 2019-12
 60 REM ==============================
 100 SYMBOL AFTER 32
 110 MODE 1
 120 GOSUB 1000
 130 PRINT" *** It's the Level 9 font ***"
 140 PRINT" ***  from Colossal Cave!  ***"
 150 PRINT"   Dug up by scruss, 2019-12"
 160 PRINT
 170 PEN 2
 180 PRINT"Lorem ipsum dolor sit amet, consectetur"
 190 PRINT"adipiscing elit, sed do eiusmod tempor"
 200 PRINT"incididunt ut labore et dolore magna"
 210 PRINT"aliqua. Ut enim ad minim veniam, quis"
 220 PRINT"nostrud exercitation ullamco laboris"
 230 PRINT"nisi ut aliquip ex ea commodo consequat"
 240 PRINT"arfle barfle gloop? | | |"
 250 PRINT
 260 PEN 1
 270 FOR i%=32 TO 127
 280 PRINT CHR$(i%); " ";
 290 NEXT i%
 300 PRINT
 310 PRINT
 990 END
 1000 SYMBOL 33,&18,&24,&24,&24,&18,&0,&18,&0
 1010 SYMBOL 34,&66,&66,&44,&88,&0,&0,&0,&0
 1020 SYMBOL 35,&0,&24,&7E,&24,&24,&7E,&24,&0
 1030 SYMBOL 36,&12,&7C,&D0,&7C,&16,&FC,&10,&0
 1040 SYMBOL 37,&E4,&A4,&E8,&10,&2E,&4A,&4E,&0
 1050 SYMBOL 38,&70,&D8,&D8,&72,&D6,&CC,&76,&0
 1060 SYMBOL 39,&30,&30,&20,&40,&0,&0,&0,&0
 1070 SYMBOL 40,&1C,&38,&70,&70,&70,&38,&1C,&0
 1080 SYMBOL 41,&70,&38,&1C,&1C,&1C,&38,&70,&0
 1090 SYMBOL 42,&10,&54,&38,&FE,&38,&54,&10,&0
 1100 SYMBOL 43,&0,&10,&10,&7C,&10,&10,&0,&0
 1110 SYMBOL 44,&0,&0,&0,&0,&30,&30,&20,&40
 1120 SYMBOL 45,&0,&0,&0,&F8,&0,&0,&0,&0
 1130 SYMBOL 46,&0,&0,&0,&0,&0,&60,&60,&0
 1140 SYMBOL 47,&0,&4,&8,&10,&20,&40,&0,&0
 1150 SYMBOL 48,&7C,&C6,&CE,&D6,&E6,&C6,&7C,&0
 1160 SYMBOL 49,&8,&18,&38,&18,&18,&18,&3C,&0
 1170 SYMBOL 50,&3C,&66,&C,&18,&30,&62,&7E,&0
 1180 SYMBOL 51,&7E,&4C,&18,&3C,&6,&66,&3C,&0
 1190 SYMBOL 52,&4,&C,&1C,&2C,&7E,&C,&1E,&0
 1200 SYMBOL 53,&3E,&66,&60,&7C,&6,&6,&7C,&0
 1210 SYMBOL 54,&3C,&66,&60,&7C,&66,&66,&3C,&0
 1220 SYMBOL 55,&7E,&46,&6,&C,&C,&18,&18,&0
 1230 SYMBOL 56,&3C,&66,&34,&18,&2C,&66,&3C,&0
 1240 SYMBOL 57,&3C,&66,&66,&3E,&6,&66,&3C,&0
 1250 SYMBOL 58,&0,&30,&30,&0,&0,&30,&30,&0
 1260 SYMBOL 59,&0,&30,&30,&0,&30,&30,&20,&40
 1270 SYMBOL 60,&1C,&30,&60,&C0,&60,&30,&1C,&0
 1280 SYMBOL 61,&0,&0,&F8,&0,&F8,&0,&0,&0
 1290 SYMBOL 62,&E0,&30,&18,&C,&18,&30,&E0,&0
 1300 SYMBOL 63,&7C,&64,&C,&18,&10,&0,&10,&0
 1310 SYMBOL 64,&7C,&C6,&DE,&D2,&DE,&C0,&7E,&0
 1320 SYMBOL 65,&18,&6C,&C6,&C6,&FE,&66,&F6,&0
 1330 SYMBOL 66,&FC,&C6,&C6,&FC,&C6,&C6,&FC,&0
 1340 SYMBOL 67,&3C,&66,&C0,&C0,&C0,&66,&3C,&0
 1350 SYMBOL 68,&D8,&EC,&C6,&C6,&C6,&EC,&D8,&0
 1360 SYMBOL 69,&FE,&62,&60,&78,&60,&62,&FE,&0
 1370 SYMBOL 70,&FE,&62,&60,&78,&60,&60,&E0,&0
 1380 SYMBOL 71,&3C,&66,&C0,&CE,&C6,&66,&3C,&0
 1390 SYMBOL 72,&C6,&C6,&C6,&FE,&C6,&C6,&C6,&0
 1400 SYMBOL 73,&7E,&18,&18,&18,&18,&18,&7E,&0
 1410 SYMBOL 74,&FE,&8C,&C,&C,&C,&CC,&78,&0
 1420 SYMBOL 75,&E6,&CC,&D8,&F0,&D8,&CC,&C6,&0
 1430 SYMBOL 76,&E0,&C0,&C0,&C0,&C0,&C2,&FE,&0
 1440 SYMBOL 77,&C6,&EE,&FE,&D6,&C6,&C6,&CC,&0
 1450 SYMBOL 78,&CE,&E6,&F6,&DE,&CE,&C6,&C6,&0
 1460 SYMBOL 79,&38,&6C,&C6,&C6,&C6,&6C,&38,&0
 1470 SYMBOL 80,&DC,&E6,&C6,&C6,&FC,&C0,&C0,&0
 1480 SYMBOL 81,&38,&6C,&C6,&C6,&CA,&64,&3A,&0
 1490 SYMBOL 82,&DC,&E6,&C6,&C6,&FC,&CC,&C6,&0
 1500 SYMBOL 83,&7C,&C6,&C0,&7C,&6,&C6,&7C,&0
 1510 SYMBOL 84,&FE,&B2,&30,&30,&30,&30,&30,&0
 1520 SYMBOL 85,&E6,&66,&C6,&C6,&C6,&C6,&7C,&0
 1530 SYMBOL 86,&E6,&66,&C6,&C6,&CC,&78,&30,&0
 1540 SYMBOL 87,&EC,&66,&C6,&C6,&D6,&D6,&6C,&0
 1550 SYMBOL 88,&EE,&C6,&6C,&38,&6C,&C6,&EE,&0
 1560 SYMBOL 89,&EE,&C6,&2C,&18,&18,&18,&18,&0
 1570 SYMBOL 90,&FE,&8C,&18,&30,&60,&C2,&FE,&0
 1580 SYMBOL 91,&7C,&64,&60,&60,&60,&60,&7C,&0
 1590 SYMBOL 92,&0,&60,&30,&10,&8,&C,&6,&0
 1600 SYMBOL 93,&3E,&6,&6,&6,&6,&26,&3E,&0
 1610 SYMBOL 94,&18,&24,&42,&42,&0,&0,&0,&0
 1620 SYMBOL 95,&0,&0,&0,&0,&0,&0,&EE,&BB
 1630 SYMBOL 96,&3C,&22,&78,&20,&78,&20,&7E,&0
 1640 SYMBOL 97,&0,&0,&74,&DC,&C4,&CC,&74,&0
 1650 SYMBOL 98,&C0,&C0,&DC,&E6,&C6,&E6,&DC,&0
 1660 SYMBOL 99,&0,&0,&78,&CC,&C0,&CC,&78,&0
 1670 SYMBOL 100,&0,&70,&18,&7C,&CC,&CC,&78,&0
 1680 SYMBOL 101,&0,&0,&78,&CC,&FC,&C0,&7C,&0
 1690 SYMBOL 102,&68,&74,&60,&F8,&60,&60,&60,&C0
 1700 SYMBOL 103,&0,&0,&78,&CC,&C0,&CC,&7C,&C
 1710 SYMBOL 104,&C0,&C0,&D8,&EC,&CC,&D8,&DC,&0
 1720 SYMBOL 105,&C,&0,&38,&18,&18,&18,&38,&0
 1730 SYMBOL 106,&6,&0,&1C,&C,&C,&C,&4C,&38
 1740 SYMBOL 107,&C0,&C0,&CC,&D8,&F0,&D8,&CE,&0
 1750 SYMBOL 108,&30,&30,&30,&30,&30,&36,&3E,&0
 1760 SYMBOL 109,&0,&0,&AC,&D6,&D6,&C6,&CC,&0
 1770 SYMBOL 110,&0,&0,&BC,&C6,&C6,&CC,&DE,&0
 1780 SYMBOL 111,&0,&0,&7C,&C6,&C6,&C6,&7C,&0
 1790 SYMBOL 112,&0,&0,&DC,&E6,&C6,&E6,&DC,&C0
 1800 SYMBOL 113,&0,&0,&76,&CE,&C6,&CE,&76,&6
 1810 SYMBOL 114,&0,&0,&DC,&E6,&C6,&FC,&C6,&0
 1820 SYMBOL 115,&0,&0,&3C,&60,&3C,&8E,&7C,&0
 1830 SYMBOL 116,&18,&30,&FC,&30,&30,&32,&1C,&0
 1840 SYMBOL 117,&0,&0,&E6,&66,&C6,&C6,&7A,&0
 1850 SYMBOL 118,&0,&0,&EC,&66,&C6,&EC,&38,&0
 1860 SYMBOL 119,&0,&0,&EC,&C6,&D2,&7C,&28,&0
 1870 SYMBOL 120,&0,&0,&EE,&6C,&38,&6C,&EE,&0
 1880 SYMBOL 121,&0,&0,&EC,&C6,&6C,&18,&30,&E0
 1890 SYMBOL 122,&0,&0,&FE,&9C,&30,&62,&FE,&0
 1900 SYMBOL 123,&C,&30,&30,&60,&30,&30,&C,&0
 1910 SYMBOL 124,&CF,&DB,&DB,&CF,&C3,&DB,&FB,&0
 1920 SYMBOL 125,&60,&18,&18,&C,&18,&18,&60,&0
 1930 SYMBOL 126,&7C,&C6,&BA,&A2,&BA,&C6,&7C,&0
 1940 SYMBOL 127,&FF,&FF,&FF,&FF,&FF,&FF,&FF,&FF
 1950 RETURN

Categories
computers suck

Sometimes, things do not go exactly as planned … C development for Amstrad CPC on Raspberry Pi

If you crash an Amstrad CPC, you often got some pretty patterns. Like the one above, which was supposed to print the alphabet, but got about as far as R, then started making coloured spots on the screen. My alphabet doesn’t (usually) contain coloured spots, so something went wrong.

This post is only about the Raspberry Pi in that it’s the nearest always-on Linux system that I have. This would likely work fine on any Linux machine. While the Z80 cross compiler I use (z88dk) is available in the repos, I can’t get it to build anything, so I just pulled down the latest version. To build the compiler:

wget http://nightly.z88dk.org/z88dk-latest.tgz
tar xvzf z88dk-latest.tgz
cd z88dk
export Z80_OZFILES=$(pwd)/lib/
export ZCCCFG=${Z80_OZFILES}config/
export PATH=${PATH}:$(pwd)/bin
./build.sh

This should result in a working environment. We can test it with a simple C program:

/* alfa.c - print the alphabet */
#include

int main(void) {
  char a='A';
  char b=26;
  while (b>0) {
    putchar(a);
    a++;
    b--;
  }
}

You can build it with:

zcc +cpc -create-app -make-app -O3 -unsigned -o alfa.bin alfa.c -lcpcfs -zorg=16384

You should end up with a file alpha.bin of approximately 4749 (!) bytes. You can copy it to a disc image using iDSK:

iDSK blank.dsk -i alfa.bin -c 4000 -e 4000 -t 1

It runs like this:

You can do the same with Z80 assembly language (shown here in the most gratuitously pretty Amstrad assembler, Maxam):
Although this results in only 11 bytes of code, it’s not portable; the C code above compiled and ran on both my Raspberry Pi and my Mac. It wouldn’t even run properly on a different Z80 system, as only the Amstrad CPC knows that call #bb5a prints the character in the A register. On the ZX Spectrum, for example, it was the completely different instruction rst 16 to print a character.

(There’s a lot more on z88dk on the CPCWiki.)

Categories
computers suck

2D Star Dodge flies again!

There’s rather more nostalgia in this post than I’d want to deal with. If you want to just play the game, go here here and skip this blurb.

Update: the Java emulator doesn’t work in the browser any more, so here’s Arnold playing the BASIC version: http://scruss.com/cpc/6128s.html?stardoj.dsk/run%22stardoj2

About 25 years ago, I was a smallish computer nerd obsessed with programming his Amstrad CPC464. I had got a BCPL rom-based compiler for cheap and was looking for things to do with it. “Why not write a game?” I asked myself.

There were two minor hurdles. I had no imagination, and I certainly wasn’t focused enough to write anything big. Fortunately, it was still the 80s, so we knew how to rip stuff off without being called out for it. I merrily copied a game my friend Alan Cook had written for the Dragon 32, and called it 2D Star Dodge.

2D Star Dodge was the perfect rip off. Not merely had I ripped off the idea from Alan, but he had ripped off the idea in turn from a BBC Basic one-liner game called (as verified by Graeme Smith) “One Line” Asterisk Tracker. The name 2D Star Dodge was an, um, homage to Realtime Games’ 3D Starstrike, which itself was “strongly influenced” by the Star Wars arcade game. Originality? Pfft.

So I wrote the game. Well, okay, I wrote a mockup in Locomotive BASIC, which ran a bit slowly, but gave me something to work from. Here it is, if you want to play it in you (Java-enabled) browser: 2D Star Dodge – BASIC. I then meticulously translated it into BCPL, and ended up with something that looked liked this:

(if you click on that image, you can play the BCPL version in your browser.)

this is actuall screen three, hope no-one notices ...

 

The gameplay — press a key to go up, stop pressing a key to go down — is a bit like SFCave (obligatory Java version: Lab6 SFCave) or even my current favourite Tiny Wings.

Once I’d finished the BCPL version, I had bought the MAXAM assembler ROM, and got learning the Z80 opcodes. Soon, a third port was complete, now needing hardcoded delays to be playable as it would kill you off in about one screen refresh without them.

So, now I had three versions of the same game. There was only a limited number of local folks I could give it to, so I decided to send all three versions to Amstrad Computer User magazine to print as a type-in. Thankfully, it arrived on the desk of the freshly minted (yet still beardy) assistant editor Jeff Walker, who had founded the jam econo CPC magazine/club WACCI. Jeff had the idea for me to turn the simple game into a comparison of programming in three languages.

Thanks to the CPCWiki forum, you can now read the articles I wrote in Amstrad Computer User in 1988 that went with the code. Writing style best described as “typing”:

To play the game in an astonishing JavaScript emulator:

  1. Download this disc image file: stardoj
  2. Unzip it
  3. Go to CPCBox
  4. “Choose configuration …” of Boot CPC464 (or 664, or 6128)
  5. Select your downloaded stardoj.dsk as Drive A:
  6. Annoyingly, it seems to be stuck with an AZERTY keymap, so to catalogue the disc (cat) you have to type cqt
  7. To run the BASIC version, type run"stardoj2 (on my American keyboard, that becomes run@stqrdoj2; quotes are Shift+2). Hitting Escape twice will quit back to the prompt.
  8. To run the BCPL version, type run"2dstardo. The only way to quit is to reset the emulator.

The BASIC version is based on the published type-in. The BCPL version I found as a disk image (2dstardo.dsk) on a download site — it’s exactly as I submitted it to the magazine, dubious copyright message and all. I’m not sure how it got out there; I suspect either my network of, ahem, software protection experts I knew through Colin Harris of Nemesis, or it went via my CPC-owning French penpal (Hi Benoit Hébert, formerly of Le Havre).

I had to modify the BCPL binary to run on modern emulators, as the real Amstrad CPC did a thing with its keymapping that is really hard to get right on modern systems. Originally, the game used the Shift key, but I modified it to use Space, which is easier to emulate as it’s a printing character. Can I just say that I remembered how to read and modify Z80 binaries after a quarter century? Old school, literally. I used iDsk‘s disassembler/hex dumper and emacs’s hexl mode to do the deed.

I recently discovered that someone created a Flash game based on my type-in: Star Dodger. Mind = Blown.

Update, 2018: Lawks! Someone wrote a PureScript version! It doesn’t exactly work for me on Firefox, but it does on Chromium.

Categories
goatee-stroking musing, or something

my juvenalia: 2D Star Dodge / Stardodger

Oh dear:

And here’s the Locomotive BASIC version, as published in Amstrad Computer User:

10 ' ** Initialise **
20 MODE 1
30 INK 0,0
40 BORDER 0
50 INK 1,26
60 INK 3,0
70 q=5
90 LOCATE 16,1
100 PRINT"Stardodger"
110 LOCATE 1,5
120 PRINT"Avoid the killer Asterisqs, and seek the"
130 LOCATE 9,6
140 PRINT"wondrous Nextscreen Gap."
150 LOCATE 12,13
160 PRINT"Use SHIFT to climb"
170 GOSUB 700
190 MODE 1
200 DRAWR 629,0
210 DRAWR 0,170
220 MOVER 0,60
230 DRAWR 0,169
240 DRAWR -629,0
250 DRAWR 0,-399
260 DRAWR 0,2
270 DRAWR 627,0
280 DRAWR 0,168
290 MOVER 0,60
300 DRAWR 0,167
310 DRAWR -625,0
320 DRAWR 0,-399
330 MOVE 636,0
340 DRAW 636,399,3
350 MOVE 638,0
360 DRAW 638,399
370 PLOT -1,-1,1
380 TAG
390 FOR s=1 TO q
400 MOVE 50+RND*561,20+RND*361
410 PRINT"*";
420 NEXT
430 TAGOFF
440 MOVE 0,200
450 dy=4
470 DRAWR 4,dy
480 IF INKEY(21)<>-1 THEN dy=4 ELSE dy=-4
490 t=TESTR(2,dy/2)
500 IF t=1 GOTO 550  
510 IF t=3 GOTO 620
520 MOVER -2,-dy/2
530 GOTO 470
550 MODE 1
560 PRINT TAB(16);"YOU GOOFED"
570 LOCATE 5,13
580 PRINT"Number of Screens completed = "+STR$((q/5)-1)
590 GOSUB 700
600 RUN
620 MODE 1 
630 PRINT TAB(16);"WELL DONE"
640 LOCATE 10,13
650 PRINT"Stand by for Screen "+STR$((q/5)+1)
660 GOSUB 700
670 q=q+5
680 GOTO 190
700 LOCATE 8,25
710 PRINT"Press any key to continue"
720 WHILE INKEY$<>""
730 WEND
740 WHILE INKEY$=""
750 WEND
760 RETURN

Here’s Asterisk Tracker, the original inspiration from 1984