Thursday, 30 December 2021

XTREE for Vintage Computing Christmas Challenge 2021


This is my response to Logiker's Christmas Challenge for 2021. Interesting exercise.


Author: Jim Gerrie (Sydney, Nova Scotia, Canada) http://faculty.cbu.ca/jgerrie/Home/Type-in-Mania.html

System: TRS-80 Micro Color Computer (MC-10)

Language used: Micro Color BASIC 1.0

Length of source code: 74 bytes (or 70 bytes if I use ? instead of PRINT)

Length of "executable" file: XTREE.C10 (365) 4TREE.C10 (679)-- these are files loadable by emulator.


Instructions on how to run the code: 

VMC10.exe is the Virtual MC-10 emulator. Unzip the emulator zip file into a directory of your choosing.  Execute VMC10.exe. Ignore any warnings. You should be fine.

The Challenge (XTREE.C10)

Type CLOAD & hit ENTER in the main emulator window. Select XTREE.C10 in the "Cassette" directory. Type RUN...


The Challenge - Variation 2 (4TREE.C10)

Type CLOAD & hit ENTER. Select 4TREE.C10 in the Cassette directory. Type RUN...

The source code for both programs are in the "quicktype" directory as text files.  These files can also be

loaded into the emulator via the "quicktype" feature in the Files menu.  Screenshots of the games are in the "screenshots" directory.


Description:

XTREE

0 FORY=1TO14:L=ASC(MID$("!#%'#'+/%+17##",Y))-32:PRINT,TAB((33-L)/2);:FORX=1TOL:PRINT"*";:NEXTX,Y

The XTREE program basically encodes the tree line lengths as a series of ASCII characters. The ASCII value

encodes the length of each line, which the program then decodes and prints the number of asterisks centred.

4TREE

0 FORC=1TO4:CLS0:FORR=1TO10:ONCGOSUB1,2,3,4:GOSUB6:ONCGOSUB5:NEXT:NEXT:GOTO

1 POKE49151,68:A$="":FORT=1TO23:A$=A$+CHR$(127+RND(128)):NEXT:RETURN

2 POKE49151,28:A$="":FORT=1TO23:A$=A$+CHR$(32+RND(64)):NEXT:RETURN

3 POKE49151,.:A$="":FORT=1TO23:A$=A$+CHR$((RND(8)-1)*16+143):NEXT:RETURN

4 POKE49151,28:A$="":FORT=1TO23:A$=A$+CHR$(32+RND(112)-(RND(2)=1)*64):NEXT:RETURN

5 FORT=1TO50:POKE49151,4-(RND(2)=1)*64:NEXT:RETURN

6 FORT=1TO14:L=ASC(MID$("!#%'#'+/%+17##",T))-32:PRINT@(T-1)*32+((32-L)/2),LEFT$(A$,L);:NEXT:RETURN

4TREE just uses a faster version of XTREE multiple times through GOSUBs but creates different type of characters strings in A$ such as the solid color graphic strings stored above ASCII 128.

It also puts the MC-10 into some of its stranger graphics modes to create some interesting special effects.  The POKES put the machine into these different modes.



Sunday, 26 December 2021

"Dropship" by Darren Ottery Ported to Micro Color BASIC

I've been working on Jaz's (Darren Ottery) "Dropship." Trying to make it all fit in one program that only needs regular Micro Color BASIC.

Dropship by Darren Ottery

My hope was not to mangle it too much by down shifting it from the more capable and feature rich MCX BASIC provided with the MCX Micro SD pack. Many compromises had to be made, since I was worried I wouldn't have enough memory with over 20 unique screens of data for its complex map and the merging of the two minigame sub-programs into one large program, but it actually turns our that there's quite a bit of memory left (3000 bytes).  So, I was able to add back in a few features I'd taken out, such as the exit indicators that flash in the initial room at program startup.

I asked Darren if he'd mind me adding my initials to the splash screen-- a lot of work went in to converting all the screens to strings, as opposed to using the MCX LOADM command, which allows whole screens to be loaded directly. The effort made me appreciate all the work Darren put into the game. It's an incredible program. I'm still amazed it's all done just in BASIC, so many cool effects, such as the swooping fighters in the minigame and the flapping animation. I have wanted for some time to make sure others without an MCX expansion pack could play it too. Darren graciously agreed to let me put my initials on the splash screen.  He wrote:

"you go Jim! This was an exercise in learning what the MCX could do in some respects. Perfect that you are bringing it back. I've pushed pause on my current MCX project which I'll finish one day. I want to focus writing in Color basic and compiling with Greg Dionne's tool. I need to figure if I can do it all on real hardware."

And go I did . I added lot's of speedups, changes to the maps to get them to render appropriately in Micro Color BASIC. The big changes was that you can't have any special reverse characters, like space and punctuations embedded in strings in regular BASIC, unlike what the fancy MLOAD command allows for. Also, the inability to use reverse space (32) in strings meant areas that were open to having aliens or POWER put into them had to have another colour or character placed there.  For regular passages I chose 96, so that the strobe effect from alternating the screen colour (POKE419151,64) could still occur.  For the more complex rooms, I replaced 32 with black.  This toned down the strobe effect a little, but they looked odd with strips of regular space characters around them.

Reconciling the merging of the three main programs (Maze explore, Alien shoot'em up, Descent). required loading and renumbering the sub programs so they could be merged into the main program.  There's no equivalent to the CHAIN command and special variations of the RUN command that MCX BASIC provides, which allow programs to call and recall other programs. 

I also added to the dropship animation when it leaves the bay.  Now it actually looks like it is descending from the bay.  Instead of the whole screen simply scrolling upwards, the lander stays in place, which simulates its descent from the bay:

The exits to rooms are now alt black characters, so they aren't visible as in the original. Full scores appear on alien shoot'em-up, instead of being limited to 2 characters (100 would appear as 10). I changed the key input to WASD in the hopes of enticing my son Charlie to try the game, since he's home over Christmas. I made some changes to the final landing-- now crashes into the walls on the final screen don't end the entire game, they just take a life (if you have any left) just like what happens during the descent. I also made some edits to the instructions to condense them to fit the 128 character line limit of Micro Color BASIC. MCX BASIC allows for 255 character lines.

I hadn't implemented the shift between the shoot'em up subprogram and the main program properly initially. Darren had it so that after you do each shoot'em up minigame that room turns into a regular passage.  This meant you could only earn 2 stripes.  I had made it so that you returned to the start room after each shoot'em up and could return as much as you liked. I only noticed my mistake when I went back to play the original to do some checks on my sound translations.

Final speed enhancements involved basically chasing down unnecessary variables and replacing them with scratch variables. I needed as much speed as possible (a smaller number of variables means a smaller lookup table, which speeds things up) because the lack of a PLAY command and the necessity to use SOUND instead (which is a slower less subtle sound producer in general) for the footsteps of the player.  This meant I needed to scrape speed anywhere I could to keep the main loop as "tight" as possible. It took some trial and error to find reasonable replacements for PLAY sound effects using only SOUND.  I did my best, but it's only a rough approximation of Darren's cooler music and sound effects from the original, but I hope it will do.

DROPSHIP can, as for my other games, be played on my web page:

http://faculty.cbu.ca/jgerrie/MC10/JG_MC10_Recodings.html

Finally, I created a map, and I was thinking of attempting a recording of a complete playthrough (either me or my son), but I'm unsure if this would spoil the "mystery."  But the point is moot.  The game is too tough for me to complete it (I'm a crap gamer).

But as I said, maybe I can get me son Charlie to try. He's got nimble young fingers.  But if you're looking for some help, here's a map of the main game maze layout provided below:




WARNING!!!!!!!!!

********************

SPOILER ALERT!

********************

GAME MAP BELOW






       1  2  3  4  5  6  7

                          
1      +--+--A--+  N  +--D
       |  |     |  |  |   
       |  |     |  |  |   
2      S  +--+--T--+  L  P
       |        |  |  |  |
       |        |  |  |  |
3      +--+--+--+  I  +--+
             |     |  |  |
             |     |  |  |
4      C--+--+  +--+  +  +
          |     |     |  |
          |     |     |  |
5      +--+--+--+  +--O--+
       |        |  |  |  |
       |        |  |  |  |
6      +--A--+--+--+  +--+


S=START
A=ALIENS  C=CARD   I=ION DRIVE  L=AIR LOCK  
O=CORE    N=NUKE   P=POWER      T-TRS-80 ROOM

P.S.  I did finally complete the main level:




Sunday, 5 December 2021

Lots of Simple Type-ins


I  ported a bunch of simple small programs to Micro Color BASIC.  The first one, "Peeper" by David Wilkins, is from the Sinclair ZX81. I've sped it up a little and added colour in a way that I hope creates something of a nighttime ambience.  I'm not sure who "the peeper" is, but in my version he or she is someone in a well lit building with lots of windows.  I hope that's not a gun at the bottom, but just an annoying flashlight or possibly a non-dangerous laser pointer.

"Speedboat" by Steven Holiday. It's from TRS-80 Colour Computer: Fantastic Computer Games, published in Burlington Ontario by Hayes Publishing in 1984. I've added a few minor esthetic tweaks and programming speedups.  I added the white "wake" to add to the sense that you are slicing through the waves at great speed.  I changed the boat from a solid colour to a pointy "V."


And another program from that book called "Logger" by Brian Jaikens. It indicates the strong desire of early type-in programmers to make games based on popular arcade themes-- in this case: Donkey Kong.  This particular program demonstrates some nice character graphic animation.


Another was recommended by Erico Patricio Monteiro over on the Coco group. He called it "1K Space Invader."  Or at least that was what he called it initially, because he just had a partial page clipping provided by someone on Twitter of the source code:


I was able to locate the original, which was actually called "War of the Worlds" by David Healey.  I did this by typing in a few of the more unique program lines into a search engine.  I put quotes around them to search for the exact line.  This doesn't always work, since scans of magazines can often fail to capture the actual program listing accurately.  But I tried a few different lines and eventually found it on the Internet Archive.

WARWORLD

You can try "Haiku," a BASIC poetry generating program by John Krutch, by going to my GameJolt page, selecting PLAY and then choosing the "Educational Programs" menu item. Then select HAIKU from the Cassette menu and type RUN and hit Enter.  It was intended as an example of computer generated artwork as a demonstration of AI in Krutch's book AI for Small Computers.  Whether it truly constitutes "AI" is an issue I will leave to you, the reader, but it is is certainly an interesting bit of early 1980s artificial intelligence research.


And finally a program of my own making called FLAGS.  I just wanted to add the flag graphics for every country on my Type-in Mania main page.


The reorganization of the page involved changing it to just include a rotation of flags of the countries mentioned and screen shots of the programs actually listed on the page.

I've moved into a programming phase where I plan to focus on getting copies of simple classic type-in programs working, especially those that demonstrate simple examples of so-called AI programing techniques like the program "Guess the Animal" that I discussed in my last post.  This is in part a result of expediency.  I think I've simply gleaned all the more significant programs that weren't already well represented out there on the Net.  But of course, I could be being too hasty.  In the past when I've thought I had exhausted the possibilities for finding important but "missing" BASIC programs, I've turned out to be wrong.  So anyone out there who might be reading this, please feel free to post suggestions for significant, but perhaps neglected, type-in BASIC programs to look for.

Wednesday, 1 December 2021

Early Machine Learning: "Animal" from David Ahl's BASIC Games


I teach a philosophy course on AI.  One of the things we look at are historical programs from the beginning of AI research. One of these is the "Guess the Animal" game included in David Ah's classic BASIC Games compendium from 1978.  However, when I went to look for easily accessible and playable versions of the original program I was surprised to discover that they were kind of hard to access.  Like so many of the programs on the list of Ahl classics, you can easily find copies of the source, and scans of the original book, such as:


But finding an easily playable version of the original was tough.  I did find some modern remakes, including one that is trying to compile an ever increasing list of inputs from people on the Net:

https://www.animalgame.com/play/faq.php

The reason this site is so interesting is that Animal is one of the early simple and accessible examples of a program involving "machine learning", which is a big buzz word these day in the field of AI. The intelligence of the program really relies on the input of the users and the intelligence of the program grows with additions to the input from users, who slowly train and expand the ability of the program.  The program tries to accurately guess the animal your are currently thinking of simply by asking questions and answers input by prior users.  It only has a limited number of questions that it starts with, but the users must supply all the rest.

Obviously, on the early 8-bit home computers this kind of program was limited by a number of factors.  The first was the reliance on slow and awkward forms of long term storage such as cassette tapes.  The second was limits on machine RAM memory for dealing with any growing body of input data.  The program was originally developed for networked minicomputer systems, which allowed for data to be more easily compiled, and for more users to be interacted with:

https://www.animalgame.com/play/misc/source.php

However, the Microsoft BASIC version for Ahl's book dispenses with the the "save" and "loading" features.  As a result, in its accessible type-in form it is easy to understand why people might not have been particularly interested in the program, with its data limited to single sessions on an un-networked 8-bit home computer.

Another possible reason for the relative lack of prominence on the Net among retrocomputing enthusiasts is that the Ahl version seems to have some bugs.  In the version I worked from the question printing routine didn't properly parse the questions, which are saved as text strings with numeric values tacked onto the end of them for directing the Y and N responses. The result is that the computer posses question with some of this Y/N numeric info tacked on at the end.  It was more an esthetic nuisance, than a fatal error.

The Original Question Print Routine:

400 Q$=A$(K)

410 FOR Z=3 TO LEN(Q$)

415 IF MID$(Q$,Z,1)<>"\" THEN PRINT MID$(Q$,Z,1);

417 NEXT Z

420 INPUT C$

My Question Print Routine:

400 Q$=A$(K)

410 FOR Z=3 TO LEN(Q$)

415 IF MID$(Q$,Z,1)<>"^" THEN 417

416 M$=MID$(Q$,3,Z-3)+"?":GOSUB1:Z=255:REM JUMP TO WORD WRAP PRINT ROUTINE

417 NEXT Z

However, there were possibly other more fatal problems involving the creation of new data items due to improper conversion of the numeric values into strings for concatenation onto new question strings.

370 A$(K)="\Q"+X$+"\"+A$+STR$(Z1+1)+"\"+B$+STR$(Z1)+"\"

In Microsoft BASIC, the lingua Franca of Ahl's publications, the proceeding space of unsigned positive number values is preserved when the STR$ function is used to convert those values to a string.  I think the original program, based on some version of minicomputer BASIC, probably automatically stripped all spaces from numbers, and just returned the number alone. But the program was re-written for Microsoft BASIC for Ahl's publication, and seems to possibly to have been a little rushed. I decided to add some MID$ treatments to the STR$ function used, in order to make sure the spaces were stripped.

370 A$(K)="^Q"+X$+"^"+A$+MID$(STR$(Z1+1),2)+"^"+B$+MID$(STR$(Z1),2)+"^"

I think the program might have possibly messed up otherwise in its interpretation of the numeric data of those generated strings, although perhaps not, since the final result is processed by a VAL function, which will simply ignore spaces.  But I wanted to make sure that the data was in the same non-spaced format as the original DATA statements for questions: DATA "\QDOES IT SWIM\Y2\N3\"

I also added word wrap so the output of the program, regardless of the length of questions and animal names would be nicely formatted for a 32 character screen.  I suspect that it would be possible for some questions to easily go over the 32 character or even the more standard 40 character limit of most home computers of the day.

So maybe because of its obvious limitations and bugs relatively few people using home computers ever actually typed in this program and played around with it.  Hence, it is not widely recalled or discussed by people on the Net today.  Which is sad because it is an important historical forerunner of modern AI developments and particularly machine learning techniques.


Thursday, 11 November 2021

"Capture" by Mac Oglesby

This is a puzzle/board game by Mac Oglesby. I converted it from Commodore PET source to TRS-80 MC-10 Micro Color BASIC. The source can be found on the Internet Archive as a book scan of PET Games and Recreations from 1981:


The version from PET Games and Recreations that I primarily worked from was dated from 1980, but there is an older version published in the People's Computer Magazine July/Aug 1977, but dated in the source to 1976.  I also used a version from Recreational Computing magazine dated 1979, that I picked up somewhere along the line and printed out and had stuck in a binder. I decided to convert the 1980 version because it was the latest and it had a computer player option.  However, it did still allow for two human players to play.  It seems like Oglesby kept tweaking the program along the way.  The 1980 version was similar to the 1979 version (both had 2-player ability) except for a modified input routine at 10000 that didn't require users to hit Return to confirm their selections.  The 1977 version seems to have been only for 2 players and wasn't written specifically for the PET. The grid dimension were smaller and it didn't use an special graphic characters.

Mac Oglesby was a very prolific programmer, who contributed games to the early 101 BASIC Classic games collection by David Ahl and to other type-in game publications. Here's a brief list of some of of his type-in games from Moby Games:

Cross-Country Balloon Trip (1978), Capture (1976), Exagon (1976), Planets (1976), Pounce (1976), Sinners (1976), Survivor (1976), Watchman (1976), Dodgem (1975), Motie (1975), Rescue (1975) Square (1975) and Frogs (1974).

I have also converted his Frogs game. I hope to convert some more because not all of them seem to be widely available on the Net. I have found one PET software repository, which lists Sinners among its collection. But I can't seem to find any others, so I am not sure how easy it is to find working copies of Oglesby's games on the Web, which is sad because he seems like a pretty significant early contributor to the home computing revolution and the type-in game phenomenon. Perhaps this is because most of his games are of the logic puzzle variety, which can be a little annoying to most folks. Capture, however, is a game where you try to pick the letters with the most blocks around them, in order to capture the most letters and blocks by the end of the game. So it is kind of a spatial recognition/strategy game. It's rather unique, and quite entertaining.

The source of my port of CAPTURE can be found here: https://github.com/jggames/trs80mc10/tree/master/quicktype/Board%20Games/Capture
The earliest numbered file version, of course, represents the rough text capture from the digital scan from the PET book.

The game can be played here: http://faculty.cbu.ca/jgerrie/MC10/Educational.html

Or here under the Educational Game category:

Saturday, 6 November 2021

"Mystery Mania" from Compute! December 1987

Mystery Mania David Leithauser was published in Compute! Magazine December 1987. It creates logic puzzles with a murder mystery theme to them; 32000 variations with five levels of play to choose from. I've added a graphic title screen and made a few changes to make it more Sherlock Holmes like. For example, when you win, the level your win is recognized by being awarded different levels of the Order of the British Empire.


The game can be played at my GameJolt page:

Just select "Play Our Educational Game."  Then select MYSTMANI and type RUN in the main emulator window.  Thanks to Mike Tinnes for letting me use his emulator.

The source code can be viewed on my Github here:

Just look for the highest numbered listing for the latest most debugged version.

Tuesday, 2 November 2021

Retrochallenge 2021: Star Lanes

Star Trader was a BASIC game written by Dave Kaufman and published by the "People's Computer Company" in 1974 or possibly earlier.  I have written elsewhere about the challenges I had converting this game to run on the MC-10.  Kaufman's game is the forerunner of the vast array of open world space exploration and trading games, such as the Trade Wars series.

According to some sources on the Net, Star Trader was "copied" and "modified" into a different game called Star Lanes some time by the late 70s or early 80s.  Some Star Lanes games use the filename TRADE.BAS while others use LANES.BAS or some variation of either these.

However, I have ported the source code for both games to Micro Color Basic and played them, and I find the contention that Star Lanes is a "variation" of Kaufmann's Star Traders to be ludicrous.  The two games are completely different in both code and conception.

In Star Lanes, players take turns building outposts, creating companies, and purchasing stock.  It is a grid based game in which you select locations on the grid to slowly form "lanes" between star systems and outposts.  These lanes are owned by different companies, that you can buy stock in, and by selecting the companies that are most likely to merge, when their lanes intersect, you can make huge returns on your investments.  The fundamental dynamic is to construct interconnected trading routes.


Star Trader, on the other hand is played on a star map where players can travel directly between different star systems.  Players travel about buying and selling six types of merchandise: uranium, metals, gems, software, heavy equipment, and medicine.  They have to plan their routes and stops while considering efficiency of routing and the likelihood of the needs and likely sale goods of the different planet types located in each star system.  You can occasionally be hit by random events, such as space pirates.  The fundamental dynamic is to be an effective travelling salesperson, which includes haggling effectively when both purchasing and selling goods.

I think that the use of the term "trade" in the filenames of these two games and the fact that they are set in space is all that really connects these games.  People with vague recollections of playing various "interstellar space trading" BASIC games has allowed them to become interconnected in people's minds. I am not sure who wrote Star Lanes, but I have come across a number of variations, including one for the TRS-80 Color Computer that have AI built into it so that you can play against the computer.  I didn't convert that one because I wanted to get a very early version of the program running, and the Altair was one of the first 8-bit hobby computers, so I figured that it must be a pretty early variation.  However, no original author's name is mentioned in the documentation.  Just these remarks

REM ***** STAR LANES *****
REM MODIFIED BY S J SINGER
REM FOR ALTAIR BASIC 4.0

I also have some source that states:

REM - MODIFIED FOR THE MICROBEE BY JOHN ZAITSEFF, 1988

As I mentioned, I also have uncovered a TRS-80 Coco version with these remarks and title page code:

1 ' Coco Version enhancements over          original PC version.
2 ' 1. Marked display of players poss-         ible move locations.                 2. Computer added as a player.             (Using the advanced heuristic            programming technique called            RND numbers).
3 ' 
4 ' I intend to improve the computers       playing ability in the near future,     but it may be a while before I have     time.
5 '
6 ' I hope you enjoy playing the game.

2510 V=10: CT$="-:*  Original PC version by  *:-": GOSUB 2290
2520 V=12: CT$="John Bernauer": GOSUB 2290: V=14: CT$="Malcom  Higgins": GOSUB 2290: V=16: CT$="Brian Irvine": GOSUB 2290:V=18:CT$="-:*  Coco III Version by  *:-":GOSUB 2290
2530 V=20:CT$="Martyn Phillips":GOSUB 2290

Not sure if John Bernauer, Malcolm  Higgins (I've added an l), Brian Irvine are the original authors, or simply folks who converted the game to PC.  A search of the Net doesn't turn up anything definitive.  This is the only functioning link that I could find, but it doesn't actually seem to reference the names.

So I am not completely sure who to attribute authorship to for this game.  For the time being, I will use the names mentioned in the Coco source code: J Bernauer, M Higgins, B Irvine.  But if anyone could shed more light, I would really appreciate it.

Anyway, this is the last project I mentioned in my description of my Retrochallenge for Fall 2021.  It's a little late, I know.  I've already made my excuses in prior posts. Thanks again to the other Retrochallengers, and to the folks organizing again this year.


P.S. 

Here is the link to my Github with the various source code files for the different versions of the program Star Lanes that I reference in this post:

Here is a link to the source for Star Traders by Kaufman. Feel free to compare them. They seem to be completely different programs

Sunday, 31 October 2021

RetroChallenge 2021: Happy Halloween!

Well just to prove that I haven't been completely skiving off lately, here are some videos of a couple of projects that I have been doing this month.  The first is the slide show from the Cocotalk Live presentation I did a week ago.  The kind folks there organized a show focused on the MC-10.  Great to finally see some of the folks I've been corresponding with since the days of the old MC-10 Yahoo group.  Anyone remember Yahoo?  Thanks especially to Curtis Boyle for all the coordinating for the show.  


The other video is of a program called DRAC that I worked on recently.  James Host the admin of the MC-10 Facebook group challenged folks to come up with some seasonal programs.  So I whipped up something quickly over an evening.  Just stole some ASCII graphics of Dracula and some lips with fangs from the Net.  Plot them using SET/RESET.  Little graphic work with my SKETCH program for some big text and graphics for a few wee animated bats and Bob's your uncle.

I decided to put them on my real MC-10 and then put them on a loop using the MCX-SD.  Just have each program RUN the other.  MCX BASIC lets you use a filename with RUN so you can easily chain programs together.  Who says BASIC isn't useful anymore!


Saturday, 30 October 2021

RetroChallenge 2021: Greg Dionne's BASIC Compiler Compared to Interpreted BASIC

Well this hasn't been my most productive Retrochallenge. My real job has finally caught up with me and I find myself unable to devote the same amount of time I used to for coding.  Or perhaps it is simply life that has caught up with me and body, so that I no longer have the spare energy to devote to amount of coding I might otherwise like to do.  I can't be sure.

In any case I can report that Les Cavernes basically works as I think it was intended to work.  It's simply not an overly great game. It's a simple little type-in program RPG/Text adventure hybrid that provides a very basic level of game play.  Still, an interesting little bit of type-in history.

My compiled Freecell is working well.  It seems to play a decent little game of solitaire.  And all I had to do was mangle a beautifully designed piece of QBasic code (nicely indented and without line numbers) into a GOTOed piece of nightmarish 8-bit Color Basic code.  Kind of like taking a Porsche and removing the body and putting a rusty Volkswagen Beatle body on to the chassis instead. The original code was from some French bloke.  His site can be found here:

http://jemaf.free.fr/index.php?page=qbasic

He's got a bunch of other programs in Qbasic.  Mostly puzzle games.  I might try converting some of these others to Micro Color Basic.  But it was really Freecell I wanted to try.  I thought it would be a good test for Greg Dionne's Basic compiler because QBasic programs are compiled, and I suspected it would run a little slow under regular interpreted Basic on the MC-10.  Here's the comparison:

Interpreted Basic Freecell:



Compiled Basic Freecell:


My wife Patty has played it a number of times.  She's an experienced card player, so I hope her assessment is a good indication that all the bugs are out.  Still if anyone would like to play, it can be played via the following link. After you select "Play" below select the "Educational" programs item and then choose "FREECELL" from the "Cassette" menu of the Javascript emulator and type EXEC in the main window:

Saturday, 11 September 2021

RetroChallenge 2021: Les Cavernes by Charles Feydy 1982


Auraes from over on the CASA text adventures forum put me onto a game for possible porting.  He wrote:

“A tiny game found in the French magazine Trace with an esoteric and unreadable source code, but which may be of interest to jgerrie”

Auraes made a transcription of the article available, but acknowledged that there could be some mistakes in the listing.  I did find one:

240: G=INT N-10*INT (B/10)

It should have read as:

240: G=INT B-10*INT (B/10)

“Les cavernes” was originally designed for the TRS-80 Pocket Computer.  It was a fascinating little program. From my meagre French, it appeared to use a special method of entering the list of descriptions into variable memory. Rather than entering it by a traditional READ/DATA statement approach), to conserve as much memory as possible, it has the user simply enter the list of text descriptions into the array variables by typing them in direct mode. The main program itself is highly condensed using every trick possible in pocket TRS-80 Basic. All this to shoe-horn a simple text adventure game into 4K. So cool. I have tried to get it to work in the 4K space of the unexpanded TRS-80 MC-10.

I had to figure out that for the pocket computer an expression like F=4F is interpreted as F=4*F.  This is one of the ways the programmer, Charles Feydy, used to save precious memory.

Here's the link for the original source code in TRACE magazine, page 62 to 63:

https://www.abandonware-magazines.org/affiche_mag.php?mag=205&num=4090&album=oui

Auraes noticed that there seemed to be infinite loop at the heart of the program, that provided no way to jump out of it to the various subroutines of the program.  However, the pocket computer turned out to have some ability to auto sense the pressing of “programmable” keys.  If a line started with a string of a key

“K”

for example, it would be automatically jumped to when that key was pressed.  It must have been based on some form of interrupt driven key sensing working in the background while Basic was running.

Auaes tried to reproduce the code using PureBasic, but like me he was having trouble with the memory management of the Pocket computer.  He was able to help me figure out that the variables, which could only be single letters, could also be treated as a single digit array.  For example, we had both noticed that the variable B was not initialized anywhere in the program when in fact it was being indirectly initialized by references to A(2).  So single numeric variables like B equate to ordered array instances of A.

A(1) = A

A(2) = B

A(3) = C

Thanks to Auraes pointing this out to me I finally made some progress converting the program to Micro Color Basic:

https://github.com/jggames/trs80mc10/tree/master/quicktype/Text%20Adventures/Cavernes

The problem is that the game seems very difficult and the map seems basically arbitrary. I’m not sure if there are still bugs in it, that I have somehow missed.  I am not sure how it is supposed to be won.  So I will keep you folks posted on any progress I make testing them game, and if this reveals any bugs.

Anyone interested can try playing the game here:

http://faculty.cbu.ca/jgerrie/MC10/JG_MC_Ports2.html

Just select CAVERNES from the Cassette menu. It can be a little tricky sometimes to select it. Then type RUN in the main emulator screen and hit Enter.

I translated the game to use English text.  I updated the interrupt key sensing to a more standard system using INPUT and the following commands:

  • RESTART
  • N
  • E
  • S
  • W
  • GET
  • INVENT
  • KILL
  • QUIT
  • LOOK

The first letter is actually all that is needed.  Enjoy.

P.S.

Auaes posted a response that suggests that the way to "win" is wander and collect keys, that will allow you to kill certain monsters, which is how you earn points.  I think there are 10 keys, so conceivably you are playing for the highest score possible.  This is likely to be pretty challenging, as you sometimes can find yourself in rooms with no exit, either because there aren't any, or the monster blocks the only exit.  At that point it's "game over."  However, there is no randomness in the mazes numerically generated from the numbers you enter at game startup in response to the "No" and "Level" prompts.  Those numbers determine the maze you get, so there should be room for retrying until you make some progress.  Type Q to end the game and see your final score.

Retro Challenge 2021

Freecell in Micro Color Basic

I hope to blog about a couple of projects this month and next as part of RetroChallenge 2021, and possibly also for Septandy.  The main project involves my port of Freecell from some QBasic source I found on the Net.  I am also working on a port of a 4K adventure game "Cavernes" for the TRS-80 Pocket computers.  The source is from the French computer magazine Trace from the early 80s.  I am also going to work on porting "Star Lanes" from Altair Basic to the MC-10.  But my projects are always mutating, so I am not completely sure what I will be getting up to over September and October.  There are also some past projects I might have forgotten that I might blog about.

Wednesday, 25 August 2021

Old Maid for One Player and Computer


This week's Basic program is from Chapter 1 of "Atari Fun and Game" published by Tab Books in 1984. It's by L.M. Schreiber. I ported it to Micro Color Basic for the TRS-80 MC-10 from Atari 8-bit Basic, which presented some unique challenges. The first dozen lines of the program, for example, contained a small machine language loader for a program to relocate the native character set, so that some suit graphics could be added to the character set replacing the  % & ' and (  characters. I had to remove this part of the program. This routine was meant to help facilitate the printing of the suit characters.  The Atari character set does already contain suit characters, but they are spread throughout the character set, rather than being in order.  Schreiber used a method of symbolizing the cards as numbers with decimals for the suits:

.1 for HEARTS

.2 for CLUBS

.3 for DIAMONDS

.4 for SPADES

This allowed for certain basic calculations to be used to determine if suits matched by determining if the absolute differences between values of selected cards equaled .2.  If not, then the cards are not related by suit colour, which pairs must be in the game of Old Maid.  For some reason, the MC-10 couldn't handle subtraction of these fractions without a loss of decimal accuracy.  I'm hoping this is just some quirk in the emulator, rather than a fault of the MC-10. But just in case, I changed the calculations to involve multiplications by 10 before doing the subtractions and then looking for a difference of 2.

Since I removed the suit character routine, and the MC-10 can't modify its character set, I designed a two character semi graphic representation of the suit characters instead.  They're very schematic, but they give the impression of the suits enough for the purpose of play.  And Old Maid is often played with special card decks anyways, so I think it's okay.  The cards are presented as a character from the llist A23456789TJQK, which correspond to a value from 1-13. Then a two character "suit" symbol is displayed.  The program already formatted the player's initial 24 cards in 3 row of 7 cards, plus 3 cards in a fourth row.  This all fit nicely on the MC-10s 32 character wide screen.  I think the screen mode for the Atari was some double wide character mode (half the normal 40), so it only had 20 columns to play with.  So the 3-character-wide cards (Symbol+Suit+space) allowed for these to be printed in 20 columns-- the space of the last column was not needed.  For my version I printed the cards with 4 characters each (Symbol+2 Suit chars+space), making 28 for a row, so there was some room to spare.

A bunch of special "POSTION" commands, which are unique to the Atari for moving the cursor to specific locations on the screen had to be modified to PRINT@ statements.  I also had to change PRINT CHR$(125) to CLS.  The Atari also doesn't appear to have MID$ LEFT$ and RIGHT$ for manipulating strings, but uses the method of defining strings as  2 dimensional arrays.  So this all had to fixed to use Microsoft Basic string handling methods instead.  The SOUND commands also had to be translated, but I found an Atari Basic manual to help me translate the values of notes.  Besides making such changes and fixing up some of my own typos resulting from inputting the program from a PDF scan that I found on line, the only other problem is a bug I think might have also affected the Atari version of the program too.  Line 1070 read:

1070 FORX=1TO5:FORQ=49TO1STEP-1:V=INT(RND(0)*Q):REM PICK A CARD

It was followed by the lines:
1080 C(0)=C(V):C(V)=C(Q):C(Q)=C(0):REM MOVE THE CARDS
1090 NEXTQ:NEXTX:RETURN:REM DO IT 5 TIMES

This routine was for shuffling.  A FOR/NEXT loop counts down through the 49 card special deck.  Then a random card is selected, ranging from position 1 to the position of the current card of the countdown.  Then the cards are "swapped" by shunting the random one to position 0 in the array moving the other from the current countdown position to that random position, and then putting the card shunted to 0 to the position of the countdown. But by not adding one to the RND number routine you actually get a value from 0 to just below the current card in the countdown. If RND produced 0 this would result in an extra card being introduced into the deck. Whatever was last shunted there would be swapped into the deck. This was clearly not ideal for the game being played properly.  So I switched it to the following:

1070 FORX=1TO5:FORQ=49TO1STEP-1:V=INT(RND(0)*Q)+1:REM PICK A CARD

It's possible that the RND function of Atari BASIC functions correctly and produces a number from 1 to the number that is multiplied by the RND function, but if so, this would be very unusual. The Atari uses the RND(1) format rather RND(0) of the TRS-80 line of computers, but unlike Commodore Basic, which also uses RND(1), I don't think Atari Basic is a Microsoft variation of Basic.

So if my bug fix affects the original program, and if as appears to be the case from my searches on the Net, there is no obvious downloadable copy of this specific program in any of the Atari repositories out there, then this might be the only properly working and playable copy of this interesting Basic type- card game from the early days of 8-bit computing.  If you want a taste of a simple child's game using "AI" for an opponent, then give it a try.

The game can be played via the following link. After you select "Play" below select the "Educational" programs item and then choose "OLDMAID" from the "Cassette" menu of the Javascript emulator and type RUN in the main window:


Friday, 13 August 2021

Sunrise Over Bethselamine Update

I've discovered a few more bugs in the code of this interesting adventure for the Sinclair Spectrum. When you climb down the side of building the computer loses track of which floor you are on. So when you enter the building via the cut glass and get back on the elevator, the elevator thinks you are still on the roof (the last floor you got off from).  This is because the elevator (room 8) re-adjusts its West exit only when you "PRESS UP" or "PRESS DOWN" (the buttons in the elevator).  So it is correctly adjusted when you get on from the main floor and go to the top, but not when you get on the elevator after having scaled down the building.

So I added a routine to readjusts the elevator's WEST exist to the floor you are on any time you enter one of the lobby rooms in the hotel (rooms 9-13):

13 IFRO>8ANDRO<14THENR(8,4)=RO

That way the elevator is always adjusted to the floor you are on any time you get on, including when you get there by scaling down the side of the building.  Anyway, you might think that's enough spoilers for the program, but here are some more.  I made a complete walkthrough:

(SPOILER ALERT--- WALKTHROUGH BELOW)

Vanquishing the Green Monster: Accessing the MC6847's Lesser-known Screen Colours

 


Some Coco users may wonder why the MC-10 seems to be able to use the alternate screen colours so much more easily than the Coco. Allen Huffman has a post about the difficulties of accessing these other screen modes on the Coco over on the Vintage is the New Old site. 

The TRS-80 MC-10 doesn't automatically switch back to the Green screen like the Coco does. If you POKE49151,64 you get the orange mode and you stay in that mode until you POKE49151,0 or use the SOUND command.  This has enabled me to make a fair number of games using these alternate screens (see the above for a few examples).  I have a bunch of Basic routines that allow me to use the alternate color sets without having to resort to hardware modifications.

The first trick I use is a routine for printing reverse video easily on the MC-10. Here's my latest version: 

0 DIMC1,C2,M$,MC:M=16384:GOTO10

7 C1=(PEEK(17024)AND1)*256+PEEK(17025)-1+M:FORC2=1TOLEN(M$):C3=ASC(MID$(M$,C2)):POKEC1+C2,C3-(C3AND64):NEXT:?@C1-M+C2,:RETURN

10 PRINT:INPUT M$:GOSUB7:GOTO10
To make this routine work on the Coco all you have to do is switch the PEEKS in line 7, which are just the ROM locations for storing the current location of the print cursor, and the screen memory location from M=16384 to M=1024.

The other routine I use is a little machine language routine by Greg Dionne, that changes the color used for new lines when the screen scrolls.
0 CLS0:CLEAR260,36762:DIMC2,C3,C4,M,CC,ZZ,VP,M$,I$,K$,W$:M=16384:M$="O"+"K":W$=CHR$(127):GOSUB15:GOTO10
5 FORCC=1TO16:GOSUB6:NEXT:PRINT@.,;:RETURN
6 PRINT@511,W$;:POKEM+479,32:RETURN

10 GOSUB5:PRINT@480,;:M$="HELLO WORLD!":GOSUB7:PRINT@0,;:END

15 FORCC=0TO103:POKE36762+CC,PEEK(64022+CC):NEXT:DATA49,49,60,55,54
16 FORCC=0TO4:READC2:POKE36762+CC,C2:NEXT:POKE36855,32:POKE17033,143:POKE17034,154:POKE17032,126:RETURN
17 FORN=1TO2500:NEXTN:RETURN
If you know that you are not going to be scrolling the screen then a simple M/L routine for clearing to reverse color has also been made by Anders Carlson
0 CLEAR200:DIMC1,C2,C3,M,M$:M=16384:GOSUB8:GOTO10
7 C1=(PEEK(17024)AND1)*256+PEEK(17025)-1+M:FORC2=1TOLEN(M$):C3=ASC(MID$(M$,C2)):POKEC1+C2,C3+64*(C3>63):NEXT:?@C1-M+C2,:RETURN
8 C1=20000:FORC2=0TO4:READC3:POKEC1+C2,C3:NEXT:DATA198,32,126,251,214
25 EXEC20000:PRINT@32*7+5,;:M$="SOME REVERSE VIDEO FUN! ":GOSUB7
30 M$=INKEY$:IFM$=""THEN30
40 GOSUB100
50 GOTO30
100 FORC2=33TO63:POKE 20001,C2:EXEC 20000:NEXT
110 RETURN
120 REM C1=36858 FOR 16K PACK
130 REM ANDERS CARLSSON 2020
I also have a routine for recreating the INPUT command on a reverse video screen, which can be found in my implementation of Hamurabi.

Anyway, people using Coco Basic might be able to implement some of these techniques to get a little more variety in their text screens.

Tuesday, 3 August 2021

Sorcellerie/Sorcery by Rafi Deryeghiyan: Inspiration for Harry Potter?


It was quite a while back that I translated to English and ported the source code for a text adventure written for the Matra-Hachette Alice 8-bit computer called "Sorcellerie" (Sorcery) by Rafi Deryeghiyan. This is a fascinating game: Here is the brief intro provided to the program:

Until 2036 the world was at peace, then unrest began to stir in society.

22 June 2037: Sorcerers reappear with terrifying powers. Small in number, they are easily controlled.

Christmas 2037: A wizard coup--all armies are destroyed. The dictatorship of witchcraft is proclaimed.

February 2038: Wizards are about to break the will of human resistance. Aware of the danger, some have tried to combat this evil power, but in vain.

After 6 years of research, you finally find a clue: the ultimate weapon is in a castle. What is this ultimate weapon? That is for you to discover!
This game was published in the December 1985 of L'Ordinateur Individuel, as a generic Basic listing. The IF Database site reports that machine-specific variations are known to exist for the Matra Alice and Thomson computers as well as my TRS-80 MC-10 port from the Matra version. I know that a French retro-hobbyist has also ported it to Applesoft Basic:

https://www.retroprogrammez.fr/listings/aventure/sorcellerie/

One thing that has always struck me about this program is the parallels it has with the Harry Potter stories:  The idea of sorcerers appearing from a "parallel universe" hidden existence; The attempt by them to take over the non-magical world; A mysterious castle.  It makes me wonder if there was some possible path of inspiration that helped contribute to J.K. Rowling's development of the wizarding world of Harry Potter?

I know that she studied romance languages. A quick search of the internet reveals that: 

"Between 1983 and 1986, J. K. Rowling studied French with a subsidiary (i.e., minor) in Classics at the University of Exeter in Britain."

I'm sure she might have travelled to France in that time period, or after. Who knows, maybe she met someone with an 8-bit computer and played a game of "Sorcellerie" and it helped plant a seed of a parallel world of wizards?  Perhaps the author Rafi Deryeghiyan might deserve some credit in helping inspire one of the most influential stories of our age.

The storyline itself is clearly very different. You can get a sense of the game from the following game map:

Progenitor of Hogwarts?

Here's a text walkthrough by Alex Dijkstra for the Alice 32 version of the program:

"E, E, E, E, PRENDS GANTS, O,  N, OBSERVE LIT (you find some batteries), PRENDS PILE, S, O, DEVISSE
AMPOULE (you need the gloves to do this else you'll burn your hands),  PRENDS LAMPE, POSE
GANTS, E, S, POUSSE TABLEAU (you find a cave behind the painting), ALLUME LAMPE (you need the lamp
and the battery to see in the dark), VA GROTTE, E, PRENDS SCIE, PRENDS FIOLE, O, O, LANCE FIOLE,
PORTE (the acid from the flask burns a hole in the door), VA PORTE, POSE LAMPE, POSE PILE, N, PRENDS
DRAPS, S, O, S, PRENDS GATEAU, S, O, OBSERVE MUR, POUSSE BOUTON, VA PASSAGE, OUVRE FENETRE, OBSERVE
FENETRE, SCIE BARREAU (wit saw), POSE SCIE,  ATTACHE DRAPS, ANNEAU, DESCENDS DRAPS, DONNE GATEAU,
CHIENS (the dogs are killed by the poison inside the cake), S, PRENDS ECHELLE, N, N, N, MONTE DRAPS,
N, E, N, N, E, N, OBSERVE PLAFOND (you see an opening where you can pass), POSE ECHELLE, MONTE
ECHELLE, OBSERVE STATUE (it's an image of satan), EMBOUTIS STATUE (if you don't do this
you will get hit by lightning in the next location), E, PRENDS PARCHEMIN, E, INSERE PARCHEMIN, FENTE
(the text of the parchment now is readable), PRENDS PARCHEMIN, LIS PARCHEMIN. 
You've found the secret weapon you were searching for!! The parchment reveals a way to get rid of all the sorcerers. You obtain the title of superman of the 21st century."

The game is your basic "Basic" text adventure. You explore the castle, figure out puzzles by collecting items and interpreting clues. These lead you to do certain actions that allow you to penetrate deeper into the castle. Eventually you find a parchment that allows you to destroy the wizards.  No Voldemort or "Hogwarts," obviously, but there is a basement with a long abandoned room (Chamber of Secrets?).  Yet the idea of Wizards taking over after coming out of hiding is intriguing. Unless someone can ask J.K. Rowling whether she played a manky 8-bit French text adventure from the mid-80s, we'll never know...

Monday, 2 August 2021

"Sunrise Over Bethselamine" by Armadillo Soft.

"Sunrise Over Bethselamine" is a text adventure program I have converted to the MC-10. I've made many bug fixes and spelling and grammar corrections.  There were sooooo many spelling and grammar mistakes I'd have to guess this program was written by a 13-year-old British kid.  However, it is officially attributed to Armadillo Soft with a release date of 1986, and apparently had a commercial release.

My interest in converting this game started with a comment by posted by boldir (Fri Jul 23, 2021 5:50 pm) over on CASA The Solution Archive.

"I'm currently playing this adventure and I have even fixed it, but nevertheless I get stuck when I have to use the comlink in order to get the code number for the terminal in the small computer room (37). When I PRESS BLACK inside the alien craft (having the comlink and the translator) the message "A voice comes from the comlink, the translator translate it for you, 'calling agent 29326'" should appear. Instead of this, the comlink says 'gargle gloop gleep glop zing. In this context there are two conditions I can't explain to myself: w=0/1 and ww=0/1 (see BASIC lines 663 => 955 and 1050 - 1070). Is there anybody who has any idea?"

My response was the following:

boldir,

That's some messed up code.

The original:

1050 IF X=43 THEN FOR F=1 TO 10: IF G(F)=22 THEN W=1
1051 IF X=43 THEN IF G(F)=7 THEN W=1
1052 IF X=43 THEN IF G(F)=22 THEN WW=1: IF X=43 THEN NEXT F
1057 IF X=43 AND W=0 THEN PRINT "YOU DONT HAVE THE COMLINK": GOTO520
1060 IF X=43 AND WW=0 THEN PRINT "A VOICE COMES FROM THE COMLINK,'GARGLE GLOOP GLEEP GLOP ZING'": PRINT : GOTO520
1070 IF X=43 THEN PRINT "A VOICE COMES FROM THE COMLINK, THE TRANSLATOR TRANSLATES IT FORYOU,'CALLING AGENT 29326'"

Here's what I would recommend:

1050 IFX<>43THEN1080
1051 FORF=1TO10:IFG(F)=22THENWW=1
1052 IFG(F)=7THENW=1
1054 NEXTF
1057 IFW=0THENPRINT"YOU DON'T HAVE THE COMLINK":GOTO520
1060 IFWW=0THENPRINT"A VOICE COMES FROM THE COMLINK, 'GARGLE GLOOP GLEEP GLOP ZING'":PRINT:GOTO520
1070 PRINT"A VOICE COMES FROM THE COMLINK. THE TRANSLATOR TRANSLATES IT: 'CALLING AGENT 29326'":PRINT

Basically this routine was supposed to be checking that you have both the Comlink and the translator when you push the button. If you don't have the Comlink, it was supposed to tell you that you don't have it. Or if you have the Comlink, but not the translator, it transmits a gibberish message. But if you have both, you get the message with the code number.  The problem is that the programmer uses multiple IF statements sandwiched between a FOR/NEXT loop, with the NEXT actually in one of those IFs, so it doesn't necessarily get triggered.  So the loop doesn't function properly.

My new version works. It disentangles the IFs from the FOR/NEXT loop and properly organizes the variable flags W and WW for signaling whether you have the translator and the Comlink.

Boldir also posted this concern:

"I think the problem lies deeper. It's not enough to get the comlink and the translator to receive the necessary message; I've noticed that the program (randomly?) swaps the collected objects, eg at room 15 (the apartment of the hotel receptionist) it happened that, when I dropped the glass cutter and took the comlink, the cutter was in this room when I looked again, but the inventory still shows the glass cutter, and the small box that I had before was gone! It has also happened that I had two laser pistols in my inventory, so I suspect that the comlink or the translator could be exchanged for another object without being noticed in the inventory. I have no idea what's going on here; I've played the adventure many times and only happened to get the correct message once although I've always owned comlink and translator."

I was able to find this problem as well.  There was simply an incorrect variable used in the loop used to reorder the "items carried list" after you use the Rope. That item needs to get removed from the items list once it is being used (i.e. dangling down the side of a building).  But the incorrect variable would simply corrupt the items list instead of reordering it after deleting the Rope item.

I made many fixes (but there are other minor one's I can't recall).  Here's a rough list:

  • Players of the Sinclair original will notice some corrections to the directions involved in entering and leaving the apartments on the floors above Steve's.  You enter the window from outside by going east, but returning from inside was south. I changed the return values to west.
  • The routine for using the rope is fixed. Now it doesn't garble the items list.
  • Now Steve does not make his "gormless" remark until after his initial speech when you enter the room.
  • To get access to Steve's room you had to say your name into a "speach grill"--> "speech grill" (microphone would have been better).  This is the kind of typo stuff I corrected.  I also replaced lots of commas used to separate clauses with separate sentences using periods.  I added lots of missing apostrophes to contractions.
  • The routine for wearing the crampons and removing them from the items list now works as the programmers intended (I think).
  • The routine managing the Comlink and the translator interaction so that you can hear the secret code number is now working properly.
  • Some quirks with the card routine sorted (it was a little mixed up with the "WEAR" routine.
  • The directions from the West and East sides of the bottom of the cavern were fixed. When you select "DOWN" in those locations, you would be taken back to room 1 (your ship on the landing pad at the start) as the missiles came in that were launched by the GLOBE ship at the bottom of the cavern.

Additions/changes:

  • Instructions at the start (so you can know your own name, which is necessary for the game).
  • Line numbers point to specific line numbers for subroutines.  The Speccy allows pointing to non-existent line numbers and just jumps to the next line number in sequence in the code.  This should allow for easier porting to other versions of Basic
  • Use of my word wrap subroutine at line 1 for printing most messages.  Just change the "32"s in that routine to switch it to other screen widths.
  • Lots of shortening of descriptions to fit within the 128 character word limit of the MC-10.  My hope is that nothing of value has been lost.
  • New simpler graphics replacing the ones for the Speccy version. Just change line 2150 to a CLEAR SCREEN command for your system and a RETURN to get rid of this feature.  It doesn't affect game play.
Original Sinclair Version

I'm not sure exactly how the graphics worked. But guessing led me to have four basic graphic images for four main "stages" of the game.  When you (Jason) are exploring, you just see a human figure.  When you're in the "planet hopper" you see a little ship graphic.  When you hanging from the building, you see a figure with a rope.  And when you're using a "computer terminal" you see a little graphic of a computer and keyboard.  If anyone can enlighten me about the graphics in the original, it would be much appreciated.

For a complete listing of the code look for the highest numbered "SUNRISE" file here: https://github.com/jggames/trs80mc10/tr ... es/Sunrise

And here's a complete walkthrough (SPOILER ALERT):

https://youtu.be/4Rpj5X2KrGc


Friday, 30 July 2021

"Euchre for Two" by Victor J. Raybaud

I have converted the program "Euchre for Two" Victor J. Raybaud to TRS-80 MC-10. It's from a listing in The Best of Creative Computing (Vol. 3, 1980). Originally for the Univac 1106, I had to debug it for Micro Color Basic operation. For example, it contains many uncompleted FOR/NEXT loops, which needed to be dealt with. Also, there was a recursive use of GOSUB. I suspect that the Univac could easily handle these techniques without problem, but they were causing hiccups for 8-bit Microsoft Basic. I also found some formatting bugs for the main card layout screen, which I also fixed. Or at least they seem like bugs, but perhaps there is some strange nuance to Univac Basic string formatting that somehow eluded me.

It was somewhat puzzling why I couldn't find  working version of this program that you can run in any of the regular online software repositories that I keep track of. I think that it is possible that the quirks of Univac Basic that I had to find work-arounds for might have frustrated enough people back in the day, that the program was unable to make the leap from the Univac to the 8-bit personal computer world. Lack of 8-bit distribution could easily prevent copies from surviving to the current day. It's a big complex program, that would be very intimidating to type in. The line numbers skip by 100s and have leading zeros, which adds to the intimidation factor. Coupled with the quirks, which would have been very frustrating to hunt down in the old line editor environment of the home machines of the day, and you have a perfect recipe for a "missing program."

It's sad that the game seems to have been lost, because it is a wonderful piece of early artificial intelligence programming.  It plays what appears to me to be a reasonable version of a complex card game.  There's bidding that requires predication. Some of your cards are hidden and some are displayed, which demands strategy to manage well. Like many of the programs of the Creative Computing crowd, it has an elegant simplicity to its user interface.  I typed it in with the idea of converting it to a new small graphic "card set" that I had developed recently:

But in the end I didn't want to mess with the elegance of the original.  So perhaps on some other future card game project I'll find an opportunity to use the new graphic card set.

I've also been fiddling with another David Ahl/Creative Computing conversion. I did "Hockey" this week.  It's a simulation from David Ahl's 1978 collection. There were a number of typos, such as wrong line numbers and garbled variable names, in the TRS-80 source code that I worked from, which I corrected. There was also an error in the original source.  In the routine  that allows you to take a shot from the Red Line (i.e. no passing selected), the option 2 subroutine just bleeds into the option 3 routine, so that you would get both result messages.  Since most people would only select option 1 (slap shot), I suspect the original programmer didn't notice the problem in his debugging.

I had to use my word wrap routine for the messages, since the MC-10's screen is so confining, but I think it looks pretty good.  It plays like the transcript of an old fashioned radio broadcast commentary.

I am currently working on the Ahl card game "War." It's a very simple game, so there is not a lot of incentive to complete the project, but I'll get to it eventually.

I've also done a number of conversions from Australian Coco magazine, including "AUSMAP" which I blogged about last week.  But I also did a game called "Space Bar Bandit," which is a simple slot machine simulation:

I also spent a little time working on some variations of the classic 10PRINT program. I was inspired by Robin of 8-bit Show and Tell, who looked at a neat new "orthogonal" variation of the program created for the Commodore 64.  That version was supposed to fit in just 32 bytes and was written for a programming contest.  Inspired by his vid, I created a new shorter version of my own "orthogonal" version of the 10PRINT program.  As typed in, it should be less than 32 bytes. In the video jump to the 50 second point to avoid my excruciating typo at the beginning:


All this prompted Emerson Costa to a do a little refining of his own for the Brazilian MCE-1000 8-bit computer:

https://www.facebook.com/groups/mc1000/posts/2573299429388227/

https://www.facebook.com/groups/mc1000/posts/4456715507713267/

I also created a version of the program using the SG6 screen mode.  This one creates a maze that should be functionally equivalent to the one created by Commodore version:

Finally, I don't think I have blogged about a simple game I converted from the Sinclair ZX81 last week. It's called "Space Taxi" which many folks pointed out was the name of a famous Commodore 64 action game. Robin from 8-Bit Show And Tell mentioned:

"this is both 1) a super-early example of an "infinite runner" game and 2) has the same name as a legendary Commodore 64 game, but was made 2 years earlier! Neat game, too bad it's so unfair at the beginning of each screen with random spawn positions."

So the game is not a rip-off but a trailblazer for a neat game title!