Tuesday, 17 October 2017

RetroChallenge 2017/10: Binary Room

Binary Land is a puzzle video game developed by Hudson Soft in 1983 for the MSX, FM-7 and NEC PC-6001. In the game players have to unite two characters (male and female), who are in love. The MSX version features a human boy and a human girl. The player controls the two characters simultaneously, with a timer adding to the difficulty. These characters move in mirror images of each other. The game features many different puzzles stages that the characters must navigate, and there are enemies within the mazes that add extra challenges.
The MSX Version with boy and girl characters
I found out about this game when I stumbled across a Japanese website dedicated to people's computing projects using arduinos and raspberry pie devices. Some of these devices implement versions of Basic to allow for simple programming projects in the style of old 8-bit computers.
This one seemed to display a simple text like game.  The author explained that they had created a puzzle game inspired by the game Binary Land.  He called his game Binary Room. I suspect this was because it involved a simple rectangle with some randomly placed blocks in it, rather than complex set puzzles/mazes.  The movement system was the same though, with two "characters" A and B being maneuvered in a mirror like fashion.  The object of the game was to move them so that they straddle numbers in sequence.  Each stage has a set of numbers equal to the stage number randomly placed in the room, up to stage 9.  Here's the source code for the game as listed by Taisuke Fukuno, who I take to be the programmer, although he might just be the person responsible for the "Create Everyday" website.
10 S=1 15 CLS:LC4,0:?"STAGE:";S
20 FOR I=0 TO 15
30 LC8+I,2:?"#":LC8+I,17:?"#"
50 LC8,2+I:?"#":LC23,2+I:?"#"
90 X=RND(12)+10:Y=RND(12)+4:IF SCR(X,Y) CONT
100 LCX,Y:IF I%3 ?"#" ELSE ?I/3
110 NEXT
120 X=15:Y=16:V=16:W=16:C=1:CLT 125 K=INKEY()
130 A=-(K=28)+(K=29):B=-(K=30)+(K=31)
140 IF SCR(X+A,Y+B)=0 LCX,Y:?CHR$(0):X=X+A:Y=Y+B
150 IF SCR(V-A,W+B)=0 LCV,W:?CHR$(0):V=V-A:W=W+B
160 LCX,Y:?"A":LCV,W:?"B" 165 LC(X+V)/2,(Y+W)/2:IF SCR()-48=C IF Y=W AND ABS(X-V)=2 OR X=V AND ABS(Y-W)=2 ?CHR$(0);:C=C+1:IF C=S+1 LC4,20:?"CLEAR!":WAIT30:IF S=9 END ELSE S=S+1:GOTO 15
170 LC16,0:?"TIME:";TICK()/60:WAIT3:GOTO 125
The questions marks represent PRINT commands.  The LCx,y commands are equivalent to PRINT@ or LOCATE commands in MS Basics.  SCR(x,y) commands do the job of checking the character values stored at specific screen locations.  The rest are pretty much standard Basic.

I found that the logic for placing the numbers was completely random, so sometimes they could be placed in a way, depending on where other numbers and blocks were placed, that there was not room on either side or above and below, to maneuver the characters around it to straddle it.  This would make a stage impossible to complete.  I changed the logic so that after placement, each number is checked to see if there are spaces to the right and left or above and below.  If not, the number is moved somewhere else and re-checked. This vastly decreased the possibility of generating incompletable stages, but not entirely.  Very occasionally you might end up with something like this:

#  #

The check shows that the top and bottom spaces are clear, but not really because the top space is not really accessible but has been blocked off to access by the character.  The number of blocks placed per round is equivalent to the number of the round multiplied by two, so this possibility is very rare.  Even on level nine there will only be 18 random blocks placed on screen.  But to prevent frustration I added the ability of the player to press R to redraw any stage and allow play to continue.  So check your stage before setting out!  The object of the game is to complete the 9 stages before 1000 seconds run out.  The faster you complete, the higher your score.  High score is saved.  When you complete the puzzle Beethoven's 'Ode to Joy' is played.  I tried to translate the music from an updated version that Taisuke also posted.  It's not a very good job, but my son Charlie is away at university, and he's my musical expert.  Perhaps when he comes back at Christmas I get him to take a listen and try to improve on my poor job.

Here's a video that Taisuke posted showing his updated version with music:
Here is a video of my port.  I have made some changes since making this video.  Now the counter counts down to zero and a higher score is the score with the most seconds left on the clock when stage 9 is completed, which is a bit more intuitive.  I also added the R redraw function to the instruction screen.

Anyway, hi to the folks doing the RetroChallenge 2017/10! I've been peeking around a little but hope to have some more time soon to check out the other projects being done.  If you are not one of the participants please check out the RetroChallenge website.

Sunday, 15 October 2017

RetroChallenge 2017/10: Zector Adventure

"Zector Adventure" is a text adventure program distributed by T&D Software in 1984. From a clue in the game itself it seems like the original programmer's name was Darrell Ulm and that he had subtitled it Adventure #1.  It is science fiction themed and based roughly on the original Star Wars film. You must escape from the Death Star with some battle plans that will help aid the rebel fleet defeat the station you are on.
The game has a handy "MAP" command
The original version was programmed for the TRS-80 Color Computer. It has a hires graphics "MAP" command that shows you your progress. In porting it to the MC-10 I had to change the map command to display a simple text graphics map instead.  I used a subroutine to translate the former graphic commands to insert into a text array space "O" characters for rooms and "-" and "!" characters for passages that you haven't explored yet.  I also added a circular "Death Star"graphic into which the unfolding map is inserted.

I also fixed up a tonne of spelling mistakes. So I guess you could call the MC-10 version a bit of a "fix" of the Coco version. The author, for example, had spelled the "examine" command as "exemine" and many of the words with "ie" were spelled with "ei" instead.  I suspect, he was a teen programmer.  The game is a lot like the classic game "Dog Star Adventure" written by Lance Micklus for TRS-80 and published in SoftSide magazine.  I have also ported that game to MC-10:
I played through Zector Adventure and created the following walkthrough, which has been posted on the CASA Solutions Archive website:



I hope you enjoy the Zector Adventure!

Friday, 6 October 2017

RetroChallenge 2017/10: Atanarjuat

This was just a silly little program I put together over the course of an evening. I don't know where the idea came from. Probably while browsing images of 8-bit Basic games.  I think I saw a picture of a simple maze that used the basic principle of alternating vertical lines with random hole put in them.  The thought struck me that the number of random passages would determine the difficulty of the maze. Then I thought, hey could an A.I. beat a human being in navigating such a maze?  I mean, it could be made to ruthlessly search for a way across as it moved up and down, but unlike a human it could not survey the maze as a whole to discern where the zones of parallel horizontal passages were most richly laid out and navigate towards them. So I made an A.I. that just moves up and down the passages seeking a way right.  It takes the first way it finds and continues right until blocked.  If it hits a block at top or bottom, it reverses directions and continues looking for a right passage. Of course, creating an algorithm that is fast took a little thinking, but I got one that allows plenty of time to pole the user for input so that navigation for the player is pretty smooth. The brute force of the computer provides a real challenge for a human player. I fiddled with the number of passages for each row to a point that I felt the game was challenging, but not impossible for a human to sometimes beat the computer. In future I might play a little with the variables that draw the maze and see if making more passages makes it much harder or easier to beat the computer.  I named the game after a legendary Inuit character "The Fast Runner" or Atanarjuat.  There is also a famous film made by an Inuit director of that name. The story originally centres on a clan feud and monumental revenge quest. So in my game I decided to add the feature of being able to hit space and lay down a "block", which can trap the computer player in a row if placed right.
I've managed 3 wins against the computer out of 5 but never higher than that. If you manage better hit the F11 key in the VMC10 emulator to take a screen shot, or snap a picture and send it to me!  Also, the program is small enough and simple enough to fit in 4K, so it's available for those MC-10ers out there who like using the real hardware, but who don't have a 16K RAM expansion.  Enjoy.

Friday, 22 September 2017

RetroChallenge 2017/10: Fly Wheel

When I have an idea for game, there can sometimes be a number of false starts before I get something that works. This is the case for my game Fly Wheel. Originally I thought I might be able to recreate the shifting 3 dimensional highway affect of Pole Position type games using a complex algorithm to adjust the road to represent straightaways and curves and sections of strings for moving the horizon with shifting mountains and clouds. My first attempt was rather crude.  It kind of worked, but it was obviously going to be far too slow once I added all the code needed for a full game, such as being able to move the car, collision detection, scoring etc.  Here's what my first attempt looked like:
Pretty funky that snaky road! The car looks a little weird too. What I needed was something much simpler for the road graphics. Nothing sprung to mind, and so I let the project languish. Then I paid a visit to a site for ZX81 programming that I have been visiting on and off for some time maintained by Steven Reid.  He, like me, is an old 1980s BASIC programming hack who really enjoyed (enjoys) cooking up programs for his beloved Sinclair machine. I've created programs based on some of his ideas, such as Tower Dodge and Joust. This time I spotted his game "Fly Wheel."  What it showed me is that creating the illusion of moving road curves could be as simple as slanting two perspective lines creating the road from joining at the centre of the horizon to joining a little to the left or right. Like this:

He also provided inspiration for the other elements for a game of this type such as how to depict the horizon (a simple unmoving city skyline) as well as some other nice graphic touches, such as the starting line and explosion when you die:

It's obvious that Steven got a real kick out of coming up with compelling visuals for games on his limited little machine (only 4 chips!). I can't imagine all the hellishly complex keystrokes he must have had to execute on the ZX81's infamous membrane keyboard to get the graphics characters input into strings on a real machine. Nor the horrors of the ZX's infamous ROM pack wobble possibly obliterating all his work before it could be saved to tape. It's nice to program these days in a Windows editor and then "quicktype" it into the VMC10 emulator.

The ZX81 has lowres graphics in the resolution 64X48, which is just like the resolution of the MC-10 when you put it in Semigraphic 6 mode (POKE 49151,28 or POKE 49151,68). The only difference is that the MC-10 doesn't allow mixing of text with graphic when in that mode. But that's okay. It just means using cut scenes to display messages, such as the score. The advantage of the MC-10 is that its Basic runs must faster than the ZX81's, especially if you use as few variables as possible, and other speed up techniques that I have built up over the years. So unlike Steven's game, mine is actually a little more than somewhat challenging.  As Steven is obviously aware (just read his many blog postings) it was very easy for ZX user's dreams for their Basic game programs to far exceed their grasp, but that was okay back then, when half the fun was simply getting something to work. It's still fun now.

The higher speed allowed me to add a feature I wanted in the game from the beginning. I wanted the car to drift to the outside of a curve as you took the corners.  In my program there are actually two degrees of road curve and the sharper the curve the more the drift. You therefore must continuously counteract the drift when cornering and be sensitive to the different degrees of curve that you are currently on. Straightaways don't have drift, but they do have a little bit of randomness. Your car will occasionally bump right or left, so you also have to be a little careful on the straight sections.

Steven's program was based roughly on Atari's Night Driver game, so the other cars appear only as oncoming tail lights. I borrowed his model of how to show the progression of those lights in size and spacing, and then, thanks to the two colours available in SG6, made them red. They come down the road in a line starting at a random location at the top, so they are either some degree left, central, or to the right side of the road. Where they appear gives you some warning of the path they will take. If needed, you can drive a little over the edge of the road, but you lose points every time you do and if you go too far over the edge your tires go and your car blows up. So the trick for getting high score is trying to limit the number of times you overshoot the edge as much as possible. A little sound attends any move over the edge. Thanks to Robert Sieg for providing me with a POKE routine that allows this sound to be generated while in SG6 mode (Q=PEEK(9)AND128:POKE49151,4+Q:POKE49151,128-Q+4). This routine works for the POKE 49151,28 colour set. Using the normal SOUND command automatically takes you out of SG6 and bumps you back into normal text mode.

Generating the sequence of the curves was something I simply encoded into DATA statements. Each cycle through the main loop a road variable is read indicating straight, or one of two degrees of left or right curve. Then I just coded the sequences of numbers for a simple oval, a slightly more complex liver shaped track, and a multiple tight-hairpin-curve track. The score you achieve is a sum of how far you go through these variables, minus any times you have gone over the edges and multiplied by the degree of difficulty of track (1-3). I have found it easiest to keep to the inside of curves as you try to counteract drift, so it's a good idea to study the maps and make preemptive moves on straightaways to get positioned for the upcoming curves. Thanks to Pippa from over on the CASA Adventure database forum for showing me the PEEKs and POKEs to reset the pointer for the READ statement. This allows me not to have to re-read all the prior DATA again for the other tracks each time you restart, which really helps speed things up.

Find position of next date item to be READ and store it in variable E:

Restore next READ to the E position:

I'm under no illusions that this game is a rival to a real Pole Position or night driver game. Like Steven, I'm just in it for the challenge of seeing whether a certain vision for a game can be carried out given the limits of the machine and the limits of Basic as a programming language. I think the game I have come up with is a nice extension of Steven's concept. In particular I'm really pleased about how I was able to make use of the only two other useful characters (dark green and light green blocks) that are available in SG6. Because of the way the MC-10 was wired by Tandy, the lower 128 characters are not really rendered properly and simply show up as varying (ugly) sequences of green and dark lines. But the two useful ones (solid dark and solid green) provide some contrast to the red and blue graphics characters. I like the "brooding" green night skyline and the dark green tires actually alternate with one's with an outer light line to add some effect of tire movement. In Steven's program for ZX the skyline is rendered by the light grey stippled block character, as are the tires, with an alternating stipple to give the tires the illusion of motion. It was a neat challenge to figure out how to achieve similar effects using the MC-10's quirky semi-graphics. I have also figured out a way to render chunky alphabetic characters using only the graphics blocks, which I used on the start/finish sign.
The start sign with graphic text
Cars collide

First level of left turn (car coming!)

3 Tracks with starting direction indicated
Here's a video of the game running.  I have chosen Track 3 (I think):
Thanks to Steven Reid for the inspiration and to John Linville for running another RetroChallenge. Please feel free to comment.

Thursday, 21 September 2017

RetroChallenge 2017/10: Pyramid Solitaire

I saw my wife playing Pyramid Solitaire on the MS solitaire games collection for Windows 10. I immediately thought, hey you don't need a Windows 10 class computer to play a simple game like that!  I could program that on an MC-10!  I dug out a game I had converted recently from Coco Basic. Solo Poker by James Garon.  I had seen the original in a video by the HighRetrogamingLord:
I had simply converted it from using the hires graphics screen to using lowres Semigraphics 4 representations of the playing cards.
I had created this card set for several prior card games like Crazy 8s. Since Garon had worked out a nice little routine for "shuffling" the deck and I had already worked out routines for displaying the cards, all I had to do was figure out the rules to Pyramid Solitaire and put those routines to use. I ran the MS Card games pack and called up the help screen for Pyramid Solitaire.  A little research on Wikipedia helped clarify some issues.

First I made a routine to lay out the first 28 cards out from the randomized deck in a pyramid, starting with the top card.  Then I created a simple cursor routine to jump between the cards in a diamond direction pattern using the ASZX keys.  It just checks that it doesn't jump off into the cyan border area around the cards.  As part of that routine I took note of the card value of the current card highlighted by the cursor.  Hitting (Enter) would select and reverse video that value and then allow you to move again to select another card, or simply choose from the deck (D) or from the wast pile (W).  Pressing (C) would cycle the cards from the deck to the waste pile for a max of three cycles.

The biggest challenge was creating a refresh routine for the pyramid that would recreate the proper illusion of the cards lying on top of each other with some being only partially revealed as they alternate from top to bottom.  In the end it was simplest just to blank the removed cards and then refresh the pyramid from top to bottom and the top of the piles, but leaving out removed cards.

The whole process took surprisingly little time. I am getting proficient creating simple card games. Don't know what to try next, but if anyone out there has any ideas of card games they would like brought to the MC-10, or Coco, just let know.  Here's what the final product looked like:
And this is what happens when you win:
After playing the game for a while I got much better at it.  At one point I had a real run of victories.  5 to be exact, with no losses.  A total fluke I think.

Monday, 10 July 2017

Wizard's Castle and Star Traders

David Ahl was one of the giants of the earliest era of  personal computers in the late 1970s and 80s. He edited Creative Computing magazine and published several major type-in program books such as Basic Computer Games, which sold millions of copies.

I thought he was the author behind a game I had in my collection (VENTURE.C10) for the MC-10 called "Castle Adventure." The title screen mentions his name:
The instructions mention a "Wizard Bergal" and a "Orb of Zot."  I don't know where I got this piece of code. Its been in my collection for quite some time, and might have been one of the programs I had from tapes for my original MC-10 from the 1980s. Recently I came across some discussion on the Net for a "classic" Basic game called "The Wizard's Castle" by Joseph Power. The discussion mentioned the "orb of Zot," which triggered my memory of Venture. However, as I explored people's discussion of Power's game and its influence I began to realize that it was a very different program from the one I had. For example, in Power's game there are flares that can be used to shine light into all the cells immediately surrounding the one you are in. Also, you can buy a lamp, but it never runs out of oil. You can also choose other equipment (and can find better equipment in the dungeon). People commented about the simple but interesting D&D like character creation (Hobbits, Elves, Human, etc.) and equipping choices in Wizard's Castle. Such features, along with others that occur while you are exploring, were completely absent from Venture:
Clearly the program in my collection was not the classic program by Power. I had to lay my hands on the source code of the original and take a look. I went to my standby go to source for source, software repositories for the original TRS-80. I easily found references to Power's Wizard's Castle. Once I had the source roughly converted (including removing a modification that simply revealed all the locations) it was obvious that its 8X8X8 multi-dimensional array blew the lid off the memory requirements of a standard MC-10 with just the 16K RAM pack expansion. I would have to do some cutting or figure out a way to organize the info into a less memory demanding form than 5 byte floating point numbers for each array element. I began to suspect that the "Venture" program I had was a significantly simplified version of the game that made space for the massive numeric array by removing many of the minor, more quixotic features, of the original. Sadly, these features were what gave the program much of its charm. If I was going to preserve these features, I'd have to be creative.

I realized that each location in the array only needed to store an ASCII character representing the different items in each room, "B" for books, "C" for chests, etc. All I needed was to create a string space so each item could be stored as a single byte character poked into that space. As I read more about Power's efforts to create the program for the 16K Exidy Sourcerer computer he developed the game on, he'd had to do a similar thing. In fact, he used a memory space used for storing user definable characters. When someone had ported the program to TRS-80 they had simply removed this stuff and substituted simpler integer numeric array references. But the subroutines for doing all the fancy "poking" were all still there for me to re-engineer back into place a routine for poking the memory into a string space using VARPTR command (to find the appropriate locations in that space).

Eventually I got the program pared down (removing spaces, creating long multi-command lines, etc) to work in a standard 20K of the MC-10 with RAM pack. I even had enough space left over to create a simple "castle" graphic to wrap around the presentation of the grid map. The parring down also helped with the speed of set-up for the map layout, which was quite long.  Here are videos of the first version and the final product. Notice the difference in the length of time for setup:

Having completed this conversion of a classic program to the MC-10 I went in search of another kind of classic game program that I have wanted for some time to add to my collection-- a "Space Trader" type game. I had been aware of a version of such called "Star Lanes" for a while, but I wasn't overly enthused by its "corporate" theme (company creation and share buying and trading). So it was a pleasant surprise to discover that the original granddaddy of such games, called "Star Trader" by Dave Kaufman, was less corporate in character, and more in keeping with the spirit of Issac Asimov's "Foundation" series of novels-- with its developed Galactic core planets, and wilder less developed frontier planets.

The only problem with getting a version of this program up and running was that there seemed to be nothing on the Net regarding running versions. The original source I was able to find was for some kind of DEC minicomputer (HP Basic?). It came in two parts that were run in a "CHAINed" fashion. The first set up basic parameters and variables, which were left in memory when the second program was loaded by the CHAIN command. The source also mentioned "loading the tape into the tape reader" (tape reel? paper tape?) as a means of saving and loading games in progress. Yikes! I could find some tantalizing screen shots of an Atari 8-bit Basic version by someone who had a tribute page for the program, but that page now existed only in "archived" format on the "way-back machine." Most of the links were broken, and I could find no reference to the program in any of the Atari software archives that I searched. So I had to work from the original source helpfully provided by a tribute webpage to the multiplayer on-line "Trade Wars" games that descended from the original program by Kaufman.

When I finally got the two programs merged and running and most of the bugs worked out, I noticed that there seemed to be something wrong with the economies of the various star systems. They did not seem to develop or change their demand for products in the way I expected. However, after combing my source for possible errors introduced during porting, I could find nothing that would explain the weird behaviour of their economies. I began to suspect that there was simply something wrong with the data used to define the subroutine calculating the productivity for each system. It seemed skewed towards high production of goods, which resulted in very low demand for new goods. So I went in search of the original publication of Kaufman's program.

Apparently the game originally appeared in the People's Computer Company (PCC) newsletter (later magazine) and latter in a book compilation What to Do After You Hit Return. I was able to get a PDF from the Net of the book, and sure enough when I looked at the DATA statements for the "econometric" data, it was different from the data listed in the on-line source code from the Trade Wars tribute site. Swapping in the data from the scan seemed to solve the problem--a fun little piece of retro-programming archaeology! I don't know why the values were changed (transcription error from the scan, weird considerations of a networked version?), but now there is a working version of the program for people out there to try. It includes a save to cassette tape feature, as opposed to (possibly) save to tape reel or paper tape. Here's a vid:
Rogers Cadenhead, one of the many commentator's on the Star Trader and its influence, discussed its history with David Ahl to get his perspective on the game. The following is a quote of Ahl's response:
As far as I know, the game Star Traders originally appeared in People's Computer Company (a newspaper/magazine) published by P.C.C. (an alternative education computer center) in Menlo Park, CA. (It's a bit confusing that the physical storefront computer center and the newspaper both had the same name.) The game also appeared in What to Do After You Hit Return subtitled "PCC's first book of computer games." PCC was a rather egalitarian organization, hence credit was only rarely given to the authors of the various games they published and there is no author credit affixed to Star Traders. So it could have been written by any one of the 40-50 people cited in the acknowledgements of the book. The game, written in "standard" HP Basic, is a monster and, unusual for the time (1973) has both a set-up module and a main playing module. Also unusual for the time, it had the capability of saving the playing data (1) from one session to the next and (2) for different users who logged onto other nodes of the timesharing system. It was this that allowed it to be a multi-player game with games often lasting a matter of weeks or months. The book had some interesting suggestions and ideas for extending and modifying the game to make it more interesting and longer lasting; I believe that over the years many (or most) of these have been implemented.
I can understand how on a timesharing system you could easily have rigged up an ad-hoc way to make the game one of the first multiplayer net-based games (tape reels or paper taps must have been replaced by electronic files at some point). You can save all the main game variables at the end of any round of trading at the prompt for picking your next planet to visit (i.e at the end of your turn). Early players could have organized games with other players on a system. All you would have to do is send the game data file to the other players or save it in publicly open file space. Then the next player could load the data file and continue with their turn and then re-save and so on for each player (it can handle up to 12). The only problem is that in the version of the code as I found it, when you re-load the data, the first thing the program asks for is the choice of next planet for the last player, since that player would have typed 'save' at the prompt instead of their choice. Either people modified the game so each player could enter the choice before saving the game data, or ad hoc solutions were worked out, such as sending a message mentioning one's desired choice to the next player. In fact simply sending a message with a planet name might have been the way players let other players know the file was available and it was their turn. Then they could simply enter it and continue with their own turn.

It's funny but similar systems could easily be worked out today for people wanting to play the game on the Web for "1970's" experience of early network multiplayer gaming. Just fire up the virtual MC-10 and save your game data "STRADATA.C10" file (the emulator will create this for you when you save) to Yahoo public file space or e-mail to a friend. Then text your opponent the name of your desired planet. They can download the file and load it up into the VMC10 on their computer running the game. A little clunky perhaps, but it would give you a feel for early network computer gaming.

Recently, I created a Google files site for all my MC-10 programs, including STARTRAD.C10, which contains WAV sound file versions of the programs. These sound files can simply be played with your original MC-10 plugged into the sound-out jack of your PC. I find a half volume setting seems to work best and make sure to turn of any "noise reduction" features in your player software. Of course, they can also be obtained as .C10 emulator files in my MC-10 zip compilation, which includes Tamer's great Virtual MC-10 emulator (VMC10.exe).

Monday, 22 May 2017

Galaxy Trek Adventure #1

Galaxy Adventure #1
I have already ported Howard Batie's second Star Trek themed text adventures for the Coco to the MC-10. The Coco program for his first adventure, which can be found in Hot Coco Magazine August 1983, was based on an original game for the TRS-80 16K by Randy Hawkins in 80 Micro (August 1982, pp. 174-184). In fact, the version I ported might be more akin to Mr. Hawkins' original, as I based it on some source code that I found for the TRS-80 Model 100, which might have come from the Model I version rather than the Coco version.  However, the fact that Batie's name is on it leads me to believe that it must be from the Coco version. I have source for the Hot Coco magazine version, but it's from OCR text of a scan of the article, and it was getting very tedious trying to get it into running form, so I switched to the source for the TRS-80 Model 100. I might still plunk away at the original magazine source, because Mr. Batie suggests in the article that there are some differences between his version and the TRS-80 Model I version, which might be nice to uncover. Also, the magazine version uses the technique of encoding all of the messages, so you can't cheat by looking at the source code.

There were a number of errors in the Model 100 source. Some of these problems are outlined in a Gaming After 40 blog post. I found others and corrected them. There was a big problem with how the game handled the button pushing for the impulse engines, that essentially allowed you to correct the orbit without having to solve the puzzle. GamingAfter40 suggests that the way to get rid of the Klingon guarding the Tribble on level 2 is to get the phaser, but really it was because he pushed the button for the engines on level 1 and triggered the bug (which moves the guards to the planet). The real way to get rid of the guards is to shoot all of them with the phaser. The phaser only self-destructs on the planet after you've done all the necessary shooting on the ship. There were also problems with beaming routines, that allowed you to beam down without Spock being present, but which indicate that he is present by the messages displayed. There were also some problems with how the score was accumulated.

I have bug tested the program pretty extensively and played it to completion a number of times. Here's a play-through for those who may have been frustrated by the game in their youth.


A D V E N T U R E    # 1



I also completed the clean up of two simple programs taken from OCR text of scans from Color Computer Magazine and Hot Coco Magazine. The first is a simple game called SPRINKS the second is a Mother's Day graphic and simple music demo called MOTHER:

Thursday, 11 May 2017

4 Mile Island Adventure: Update

4 Mile Island Adventure, not to be confused by another Basic adventure for a recent programming contest (in the 2000s) of the same name, was a text adventure made by Owls Nest Software for TRS-80 Color Computer and MC-10 in 1983. Ported the Coco version to MC-10. Made some changes in the save game routine. In addition to the object list of locations, it now also saves the following variables:
F,G,CF,TB,GB,CA (# of objects being carried), RT (reactor temperature), YO (present location), DO,NOT,DR,M
This means that you don't start fresh every time you save and re-load a game, which makes the game more challenging (as there is a countdown to meltdown).

Brief Outline:
The 'impossible' has happened! This area was devastated by a severe earthquake. The reactor has been severely damaged. The plant has been deserted. Only you can save the area from a major disaster! Your goal is to achieve a cold shutdown of the reactor at Four Mile Island. Alternative? Death!


Type CLOAD & hit ENTER. Select TOWER.​C10 in the JimG subdirectory of the Cassette directory. Type RUN...

Sunday, 30 April 2017

RetoChallange 2017: Graf Spee

Came across a neat game for the Sinclair ZX81. It's a World War II naval simulation. You play the role of the captain of the German battle cruiser the Admiral Graf Spee. You must destroy shipping and avoid being captured or destroyed. I have't got it working quite yet, but I have made substantial progress.  Here are some screens showing a little of what the game will look like.

 I still have to finish converting all the lowres graphics for all the ship types.

This is likely my last posting for RetroChallenge 2017. Thanks to John for organizing another competition for this year. Thanks to all the other posters. I'm still working through browsing all the projects. They are wonderful inspiration for further efforts in my own retrocomputing hobby activities. Good luck to everyone and I hope to see you all again next year!


Here's a video of the completed game:

Monday, 24 April 2017

RetroChallenge 2017: 4 Mile Island Adventure

Found another obscure adventure in the TRS-80 Color Computer Archive. This one's called 4 Mile Island Adventure. It's loosely based on the 3-Mile Island nuclear disaster. Everyone has fled and it's up to you to cold-shutdown the reactor.

Couple of weird things about the adventure. First the save routine seems to just save the objects array. It doesn't appear to store anything else, such as your location, the reactor temp, radiation level or how many items you're carrying (although this may be generated when you take an inventory).  So when you restore, you seem to start off at the beginning location, but you have any items you found previously.  Since you are racing against the reactor temperature going up, it seems like you can reset the clock by saving.  Don't know if this is important or unimportant, but I might change it.

There is a link in the archive to the manual by Owls Nest software. I can't find a link to the game in the CASA: Solution Archive, although there is a listing for a program of the same name written for a recent text adventure contest.

Since there's no listing, I'm working on solving it.

Friday, 21 April 2017

Retro Challenge 2017: Greg Hassett Adventures

I have finished porting two Greg Hassett adventures. "Atlantis" was ported from a Coco version. It was very buggy and the screen formatting was very weird. It also lacked save and restore routines. So I had to go back to the TRS-80 16K version and put them back in based on what I found in that source code. I have played it through using a walkthrough, so I hope it is pretty much bug free now.

I also ported "Enchanted Island." I used source from TRS-80 16K source. Working on Atlantis had prepared me well for Hassett's programming style, so this conversion went very fast.

After completing these two adventures, I realized from internal advertising that Hassett displays in them that he had set of adventures.
These messages get displayed at various occasions, such as when your character reads a newspaper, or at the end of the game. I realized that I had previously ported the others. So I went back and fixed them up to use a common visual aesthetic (eg. solid line demarcating main messages from input prompt). Now I have a set of six Hassett adventures:
  1. Voyage to Atlantis (ATLANTIS.C10)
  2. Sorcerer's Castle (SORCAST.C10)
  3. King Tut's Tomb (TUTSTOMB.C10)
  4. Enchanted Island (ENCHANTI.C10)
  5. The House of Seven Gables (GABLES.C10)
  6. Journey to the Centre of the Earth (JOURNEY.C10)

The House of Seven Gables

Journey to the Centre of the Earth

Sorcerer's Castle

Tut's Tomb with my own intro screen
They can all be found on my distro: http://faculty.cbu.ca/jgerrie/Home/JG_MC-10_GAMES.zip

Sunday, 16 April 2017

RetroChallenge 2017: Dr. Livingston Adventure

I noticed a BASIC adventure "Dr. Livingston: The Search For" listed on Curtis Boyle's site. I have searched through many Coco archives, but I couldn't recall every seeing a copy of this game. I also found a listing for it under Gaming after 40 blog. It sounded like an interesting game, that was having a little fun with the famous story of the search for Dr. Livingston, who disappeared into the heart of Africa in the early period of European contact with that continent.

I also found a listing for it under the Interactive Fiction Database. The reviews were't very good, but I think this was because most people had played an unofficial version of it for the Commodore 64 that was a little buggy. Here's what I said for a review I wrote for the the database:
I have read the other reviews and can't but wonder whether some of the frustrations result from the versions they are playing. The parser is not so problematic in the TRS-80 versions of the program. These machines often ran in all caps mode (the original TRS-80 didn't have uppercase characters and the TRS-80 MC-10 never had them). Apparently there were also changes made to the puzzles in many of the unofficial versions. The TRS-80 version I ported remains entirely true to the original TRS-80 16K version.

There are some intentional inconsistencies to the movement in the game. I didn't find them all that bad (especially compared to some other games from the era). For the most part I think they were carefully chosen and meant to enhance the effect of being "lost in the jungles and savannas" of central Africa. To a large extent, I think this technique works successfully in this adventure, where the setting makes it appropriate to use. Once I had some mapping in place, it wasn't all that problematic and there is a kind of logic to the backs-and-forths.

There are some really charming aspects to the game. The quicksand graphic is a wonderful piece of TRS-80 chunky pixel 8-bit animation. If you die the program simulates a return to the basic command prompt, before surprising you with a resurrection to a restore point part way into the game (preventing a need for a complete restart).

The game is challenging and doesn't have any of the totally arbitrary deaths that are so common in games from this genera. I found the plot to be a nice balance between slightly humorous almost fantastical whimsy and an attempt to remain true to the Victorian mythology of the original quest for Dr. Livingston.

For fans of 8-bit Basic adventuring I would highly recommend this game. But for less hardy souls, it might be better to stay away from venturing into the dark heart of the Victorian imaginary.
I had asked if Curtis could put his hand on his copy, but it sounds like he's buried under a pile of original disks. He said he'd keep his eyes peeled. In the meantime, I put my hands on the original TRS-80 version of the source code and over Good Friday and this Easter Weekend I plunked away at converting it to Micro Color Basic. I don't think I have ever come across so many convoluted long IF-ELSEIF lines before. Some took a number of different stabs at it before I got them right. The really fun part was re-creating the graphic for the jumping character animation.

I ran into some snags at the end in the form of some strange behaviour with FOR/NEXT loops.  I think this might have been a result of the fact that like a lot of early programmers the author of this game use a lot of FOR/NEXT loops for searches which they exit ungracefully from the middle of using a GOTO statement when they find what they're looking for.  I always try to properly finish a FOR/NEXT.  Anyway, I fixed a few of these and started using my own variable for my additions to the program to avoid conflicts with the FOR/NEXT variables used in the original.  Another, difficulty with porting was the use in the original TRS-80 16K version of IF structures like this:


It's possible in original TRS-80 Basic to dispense with the THEN command.  In Micro Color BASIC this can only be done using the GOTO command. Others, like LET don't work.  Had to weed all these out.  Also the programmers had used DEFSTR to define a bunch of character string variables without dollar signs, another feature missing from Micro Color Basic. I think it is fully debugged now.  I have played it through to its end a number of times and in a number of ways.  Here's a vid of LIVNGSTN.C10. At the end of it you can see the effect of the fake "exit to Basic prompt" before it revives you to a restore point.  Very clever little effect that demonstrates the care lavished on the game by its original programmers, Carl Russell, Karen Russell, Ralph Fullerton, Becky Fullerton. (published in Softside, Vol. 2. no 12):

Thursday, 13 April 2017

RetroChallenge 2017: Tackle Penguin

Someone besides myself finds it interesting to scan through old Japanese Basic computer magazines looking for code to convert to an 8-bit computer with a Motorola MC6847.

Emerson Costa shared the following post on facebook:
A video of mine describing my odyssey in converting a type-in BASIC program found in an old Japanese magazine (1988), originally for Fujitsu FM-7/77, to my Brazilian CCE MC1000, based on CPU Z80 & VDG MC6847 & PSG AY-3-8910.
It's in Portuguese, but here is an abstract:
I describe the game mechanics and rant about some of the FM-7/77 BASIC instructions that write text and stamp images on the graphic screen.
I talk about how game logic is mixed with interface logic, and give an example of how I separated those things in my conversion (reading keys from the keyboard vs getting commands from the player).
I show a first version in text mode, and then go on to make it graphic (using MC6847's Resolution Graphics 6, which is set by MC1000's HGR instruction). Machine language comes into stage with routines to draw 8x8 characters/sprites on graphic mode, and remove keyboard beeping. A final section of the BASIC program is added to POKE the corresponding bytes into memory.
Sound is still lacking. The original program uses the PLAY instruction, MC1000 has TEMPO & SOUND instead. I studied them all instructions and came up with an HTML page with JavaScript code that translated PLAY strings into a series of SOUND commands.
Then the conversion is complete. Oof! 😅It should be easy to adapt the program to MC-10?
Emerson was very generous to provide some further conversion advice:
Some machine-specific info:
CALL 49158 -- Waits for a key to be pressed and released.
POKE 910,0 -- Avoids an annoying behavior of PRINT, just ignore it.

PEEK(483) -- ASCII code of last key pressed.
PEEK(485) -- 255 if a key is pressed; 0 if none.
POKEs after HOME -- Makes cursor invisible. Ignore.
POKEs at the end of program -- Machine code routine related to keyboard reading. Ignore.
The CCE MC-1000 is an interesting machine. It's got the screen of a Coco, the keyboard of an MC-10, and the Basic of an Apple II. It's a totally unique hybrid. The Brazilian government really fostered some interesting creativity in 8-bit computers with its protectionist policies. Anyway, with Ensjo's help I was able to get a version working for the MC-10.
Your penguin is an A
It's able to jump in the following ways:
                       A  to here
It can jump from here  A  up through the block (using the W key jumps straight up).
It can jump up and left or right using the Q and E keys.
             A to here using the E key         A  to here using the Q key
from here  A ■               or                ■  A  from here
You can also push blocks left and right if there is only one and there is open space for it to move into. Blocks don't fall if you push them off other blocks. But you will fall if you jump off a block.  Some weird physics, but it makes for a neat puzzle. I still haven't solved puzzle 1 yet, so the game has yet to be fully bug checked. If there are any puzzle fanatics out there who solve it, let me know.  I'll put the game up as it currently is in my distro:

The following is an update of my original attempt, with improved handling of the move sound and music interludes (I hope):

And here are some further updates to messaging and a demonstration of the Win music routine:

Tuesday, 11 April 2017

RetroChallenge 2017: X Rally Fixes

I have done some more tinkering to speed up the Basic part of the program (e.g. renumbering lines). The big change is now smoke only lingers for a few moves and then dissipates, which is more like the original. I think I am coming close to the definitive edition...
As well, I'm still finding the occasional bug regarding the walls, which I fix by changing the numbers in an numeric array representing the map. It uses the basic 4 number code for walls (and zero for open space):
    3  > ■  < 4
So if you hit a wall marked as 3 you will turn left and so on. It took a bit of trial and error to work out the proper system for such deflection. Hopefully I've sniffed out the last of idiosyncratic places that would let the enemy car "pass through walls." But if there's anyone out there who notices any....


Monday, 10 April 2017

RetroChallenge 2017: Cross Rally, Now with Added M/L Code!

Thanks to Darren Atkinson and Robert Sieg for volunteering to do some M/L coding to help me speed up Cross Rally. In this video you can see the latest version in which I have implemented Darren's USR routine. Its speed boost allowed me to add a permanent update of the mini-map with the enemy car's position relative to yours.  Also, the game will get slightly faster each round.

There is only about 400 bytes left, so I can't put in any REM statements with thanks to Robert and Darren, but I will try to acknowledge their contribution with a included text file of some sort in my distro: http://faculty.cbu.ca/jgerrie/Home/JG_MC-10_GAMES.zip

This is a video of the demo that Robert worked up for displaying the Map info:

Sunday, 9 April 2017

RetroChallenge 2017: Cross Rally Complete (I Think)

Well I have added the final bells and whistles. The intro screen explains the basic keys of the game. Hopefully the rules are not too opaque. In brief, you must collect the 10 regular Checkpoint flags and then make your way to the Level Checkpoint flag. The regular flags appear on the mini-map on the bottom right of the screen, but the Level Checkpoint flag does not, so you must keep your eyes peeled for it while you rove. You can run over it, but it will not take you to the next level until you have collected the 10 regular flags. Completing the level faster adds a bonus to your score when you level up. There is also a special Bonus flag, which will give you an extra car. Be carefully when collecting these, as you can only have a max of 5 cars and if you run over the bonus with a full car complement, it will be wasted. You can also create a smoke screen (oil slick?) by hitting space. You only can do this 6 times per car.  The dark green bar labeled "F:" tells you if you have any left. You can run over these smoke puffs without any problem.  Avoid the rocks. They're as deadly as the enemy car. Pressing the "C" key or the "B" key will flash the current location of the you and the enemy car.  It would be nice to have this continuously updated, but it would slow down the game too much.  You have to make some sacrifices when you make a game in Basic. When you exit the game it will report the last score and the highest score.

Here's a video of the original for comparison purposes.

This project is for Retrochallenge 2017. For more info about retro-programming projects see:

Saturday, 8 April 2017

RetroChallenge 2017: X Rally (Cross Rally)

Well, it's a game now. Just have to fix up a few more fiddly bits and maybe add smoke and some point bonuses. Might be a possibility someone will take my offer on the Yahoo group to program a slightly speedier screen rendering routine for refreshing the map on screen. Right now I use a bunch of MID$ print commands.  If that were possible, it could possibly be even speedier. I guess we'll see.

I suspect this will be my major effort for RetroChallenge 2017. Hope I can get it finished.

Friday, 7 April 2017

RetroChallenge 2017: Rally X

Found a really neat site listing Basic programs for the NEC PC-6001. One of the games called "Car Rally," written by Maiden Artist, looked liker a good prospect for porting or re-programming for the MC-10.  Apparently he had ported it from a Pocket Computer version of a classic arcade game Rally X rally.  It used semi-graphics 6 mode.

You must collect flags.
While avoiding an enemy car.
And watching the map on the right side of the screen that indicates where the flags are.
You can release smoke to block the enemy.

The game is over when the remaining fuel runs out. If you collect all the flags you can go to the next stage, but the number of enemy vehicles will increase.

I have been working on a version that uses strings for the map and the MID$ function to display the section you are. Its pretty speedy so far but I have yet to add the enemy care and its search algorithm. Hopefully I can keep the code tight enough to keep the speed up with the tracking added.  I'm going to use the VARPTR function to poke the obstacles directly into the map strings, and maybe even the moving enemy car too. Here was the test of concept:
Here is an update with the routines added to prevent hitting walls.
Next, enemy car tracking and collision detection.  The routines to randomly place flags in the maze and plot their locations on the little map.