The archive. Confetti. Type in programs. Read.

syncmagAs part of putting together a package of materials for Half-Byte Tiny Basic, I came across several gems that either reminded me of my early computing days or are cool enough for me to write about.

One such site is the Internet Archive. (The link takes you to the magazine rack. From there, use the search bar near the top of the page, and search for, say, ‘Byte’. Or computer magazines.)

Now, this site has a treasure trove of material, including the Way-Back machine. The Way-Back machine allows you to enter a URL and then see it in various incarnation through the years. It’s really interesting to see how the Internet and web design have developed. But, that’s not what caught my eye, as cool as that is.

No, it was the site’s collection of magazines, specifically, computer magazines. You can download scanned images of whole magazines, going back to the mid 1970’s.  I remember quite a few and even had many of them. At one point, I had the first ten years of Byte Magazine, THE computer magazine of the 1970’s and ‘80s.

Now, the magazines I was looking for, Dr Dobb’s (another one that I had the first seven years worth, but, no longer) Journal and a bunch of Sinclair ZX related magazines. Unfortunately, CMP has Dr Dobbs, so you won’t find it here, however, you will find Byte and a whole slew of Tandy, Commodore, Atari and, of course, Sinclair related magazines.

The quality of the scans various widely. Some are really nicely done and care taken to line them up correctly, etc. BUT…some were not cared for very well. But, hey, they ARE scanned and there’s no charge to download them, so…all considered, it is a treasure trove that I’ll not complain about.

So, I did find a few things that I was looking for, namely some type-in BASIC programs.  I am putting together a booklet of short type-in programs-games-to use on the Half-Byte Console and Tiny Basic. And, the Sinclair flavour of BASIC is close and the ZX-81 lunarzx81specs are very close to the Half-Byte Console, so the conversion is pretty easy. I will also be writing about such a conversion process. The downside is that there are few examples of Tiny Basic software, or other BASIC for that matter.  Type in software is a thing of the past and pre-dates the Internet. 

I certainly remember the thrill of getting my next issue of Computer Shopper, Compute! or Sync Magazine and anxiously looking at the type in games or utilities and converting them to whatever computer I wanted to use them on.  I had my ZX-81, my TRS-80 Color Computer and, eventually, a Xerox 820 that ran CP/M and several flavors of Basic. Of course, the 32k Extended Microsoft Basic was my favorite, but the Xerox had no graphics, so I spent a lot of time on the ZX or the CoCo. 

Typing in games was great. I got to learn what the program did, hone my typing skills and felt accomplished when I typed that last line, saved and then type RUN.  Inevitably, of course, I would have made a mistake and would have to fix it. Sometimes, I made no mistake-the listing was just wrong. Other times, I made a mistake converting the code and would have to correct it. Sometimes, that took minutes. Other times…DAYS. Oh my. I remember one game that took me hours to type in on my CoCo. I had an original CoCo, which had a crummy key board. UGH.  I hated that thing.  Never replaced it though.  Should have. 

Anyway, I get through typing in this game. Saved it on two different tapes, just to make sure. I type RUN, press RETURN and…nothing.  The damned computer hung.  I had to TURN IT OFF! Now, this meant re-loading the game and trying to figure out why it choked.  Loading anything from a tape was a laborious and risky task.  Will it load? You pray, even if you don’t believe, you pray that the Tape Gods are  favorable to you today and will allow the software to load.  Fortunately, I had not upset the Tape Gods and all was good.  I figured out that I had reversed two numbers that were in some MACHINE CODE that was getting POKED into memory and run.  So, I fix that.  Re-save. On three tapes, this time. I want to be safe.

I type RUN.

Boom! Confetti!

It started. 

I followed the directions and pressed the space bar to start the game.

Boom! No Jimmy Johnson. No Confetti. Only a damned Syntax Error and that stupid multi-colored cursor blink at me.

This problem, a multi-statement line where I left out a bloody colon in the middle of the line. That…took a week to find.  I ended up just retyping the line. Three times! I mistyped that same line two different times. The third time was the charm.  This time, there was confetti. And, it was good.

Ah, those were the days. ‘Free’ and open source software before it was called that. Well, not totally free. You still had to buy the magazine.

So, sit right back my friends, you are sure to get a smile…or a chuckle. Once the console is out of the door, expect to see a few type in games or utilities on these pages from time to time.

Advertisements

Retro-computing: old school programming

In my last post, I spoke about the TRS-80 Model 100 Portable Computer and how I wrote up a crude little game that sort of resembles Space Invaders. Well, if you take away all of the invaders except for one of them, neuter their ability to return fire and take away the sound, that is. Anyway, I thought I would post the code from an enhanced version of that one hour exercise. I found an emulator that let me take screen shots and test the code before hand keying it on the real thing.  The code is posted twice: once as you would actually enter it into the Model 100 and once formatted and commented.

Type it into the Model EXACTLY as you see here (you do not need to enter blank lines between each line of code):

10 CLS

20 LINE(0,38)-(66,48),1,B

100 SC=0:BP=20

105 PRINT @201,”Score: 0″;

110 H=669:L=75:X=0

115 B$=CHR$(230)+CHR$(239)+CHR$(229):B=(40*7)+19

116 C$=CHR$(144):C1$=CHR$(145):L$=CHR$(152)

117 ALIEN$=C$:D=LEN(ALIEN$)

120 PRINT @X, ALIEN$;

121 PRINT @B, B$;

122 IF X/2 = INT(X/2) THEN ALIEN$=C1$ ELSE ALIEN$=C$

130 PRINT @X, ” “;

140 X=X+D

200 K$=INKEY$

210 IF K$=”q” THEN END

215 IF K$=”,” THEN BP=BP-1:BM=-1

216 IF K$=”.” THEN BP=BP+1:BM=-1

217 IF BP<13 THEN BP=13 ELSE IF BP>27 THEN BP=27

220 IF K$=” ” THEN F=6:SHOOT=1

221 IF BM=-1 THEN PRINT @B,”   “;:B=(40*7)+BP:PRINT @B,B$;

230 IF SHOOT=1 THEN PRINT @(40*F)+BP+1, L$;

231 F1=F

232 IF SHOOT=1 THEN F=F-1:IF F=0 THEN SHOOT=2

233 MP=(F*40)+BP+1

234 IF SHOOT=2 AND X=MP THEN FOR Z=1 TO 4: PRINT @X,”*”;: FOR YY=1 TO

100:NEXT YY:PRINT @X,”+”;: FOR YY=1 TO 100:NEXT YY:NEXT Z:PRINT @X,” “;

235 IF SHOOT=2 AND X=MP THEN PRINT @140,”HIT!”;:SOUND H,L:FOR DL=1 TO

300:NEXT:PRINT @140,”     “;

238 IF SHOOT=2 AND X=MP THEN SC=SC+10:X=0:D=LEN(ALIEN$): PRINT

@201,”Score:”+STR$(SC);
239 IF SHOOT=2 THEN F=6

240 IF SHOOT=-1 THEN PRINT @(F1*40)+BP+1, ” “;

245 IF SHOOT<>-1 THEN PRINT @(F1*40)+BP+1,” “;

390 IF X<40-LEN(ALIEN$) THEN D=+D ELSE D=-D

395 IF X<0 THEN X=1: D=LEN(ALIEN$)

400 GOTO 120

And here is the formatted, commented code:

10 CLS                ‘Clear the screen
20 LINE(0,38)-(66,48),1,B    ‘Draw the score box
100 SC=0:BP=20            ‘Set score and base position
105 PRINT @201,”Score: 0″;    ‘Write our score label
110 H=669:
    L=75:
    X=0            ‘Set the pitch and length for our sound
                 and set the initial alien position to zero
115 B$=CHR$(230)+CHR$(239)+CHR$(229):
    B=(40*7)+19        ‘Create the base and set the position
116 C$=CHR$(144):
    C1$=CHR$(145):
    L$=CHR$(152)        ‘Create the alien and missile character
117 ALIEN$=C$:
    D=LEN(ALIEN$)        ‘D holds the direction for the alien
120 PRINT @X, ALIEN$;        ‘Draw the alien
121 PRINT @B, B$;        ‘Draw the missile
122 IF X/2 = INT(X/2) THEN
        ALIEN$=C1$
    ELSE
        ALIEN$=C$    ‘Animate the alien
130 PRINT @X, ” “;        ‘Erase alien from previous position
140 X=X+D            ‘Calculate the new position for the alien
200 K$=INKEY$            ‘poll the keyboard
210 IF K$=”q” THEN END    ‘Q will quit
215 IF K$=”,” THEN
    BP=BP-1:
    BM=-1            ‘comma (<) moves base left
216 IF K$=”.” THEN
    BP=BP+1:
    BM=-1            ‘period  (>) moves base right
217 IF BP<13 THEN
        BP=13
    ELSE
        IF BP>27 THEN
            BP=27    ‘determine the boundary for the base
220 IF K$=” ” THEN
    F=6:
    SHOOT=1        ‘space bar fires your missile
221 IF BM=-1 THEN
    PRINT @B,”   “;:B=(40*7)+BP:
    PRINT @B,B$;        ‘Move the base
230 IF SHOOT=1 THEN
    PRINT @(40*F)+BP+1, L$; ‘Show Missile
231 F1=F            ‘Remember the missile’s previous position
232 IF SHOOT=1 THEN
    F=F-1:
    IF F=0 THEN
        SHOOT=2    ‘Row calculation
233 MP=(F*40)+BP+1        ‘Calculate the new missile position
234 IF SHOOT=2 AND X=MP THEN
    FOR Z=1 TO 4:
        PRINT @X,”*”;:
        FOR YY=1 TO  100:
        NEXT YY:
        PRINT @X,”+”;:
        FOR YY=1 TO 100:
        NEXT YY:
    NEXT Z:
    PRINT @X,” “;        ‘If the alien was hit, show an explosion
235 IF SHOOT=2 AND X=MP THEN
    PRINT @140,”HIT!”;:
    SOUND H,L:
    FOR DL=1 TO  300:
    NEXT:
    PRINT @140,”     “;    ‘If alien was hit, show ‘hit!’ on screen and play sound
238 IF SHOOT=2 AND X=MP THEN
    SC=SC+10:
    X=0:
    D=LEN(ALIEN$):
    PRINT  @201,”Score:”+STR$(SC); ‘If alien was hit, update score and reset alien position and direction
239 IF SHOOT=2 THEN
    F=6            ‘Reset the missile row after destruction of alien
240 IF SHOOT=-1 THEN
    PRINT @(F1*40)+BP+1, ” “;     ‘Erase the Missile
245 IF SHOOT<>-1 THEN
    PRINT @(F1*40)+BP+1,” “;    ‘Erase the Missile (added to fix a bug)
390 IF X<40-LEN(ALIEN$) THEN
        D=+D
    ELSE
        D=-D        ‘ Update the alien direction
395 IF X<0 THEN
    X=1:
    D=LEN(ALIEN$)
400 GOTO 120            ‘Loop back for more

Yeah, the code is crap, but it was fun to go back in time and mess around with such an ancient language on an ancient computer (that still works and works well.) 

The Gameinvader

Objective: Shoot the alien until you are bored of doing so.

Controls:

, {comma} Move base to the left
. {period} Move base to the right
  {space bar} Fire missile
Digg This