Tuesday, May 12, 2020

TuT-TuT on the Jupiter Ace: Part 2

Leave a Comment
Welcome to the second and final article on Porting the ZX81 and ZX Spectrum Game Tut-Tut to the Jupiter Ace:  This time George Beckett takes us through the gritty details of programming in Forth, leaving few treasures undiscovered in the process.

If you missed Part 1, be sure to read up before continuing below.

Jupiter Ace Game: TuT-TuT
Archaeology is just as fun in the Jupiter Ace version of TuT-TuT

The Forth Tut-Tut is Ace

Previously, I told you a little about what motivated me to port Tut-tut to the Ace and promised to describe how the game is written. However, before we get on to the game, I should explain a bit about the Forth language, which was developed in the late 1960s for the control system of a telescope. Since then, its scope has grown, being used for a range of scientific and other serious applications in the 1980s and 90s. Even today, Forth lives on and can be found at the heart of various embedded systems.

The basis of any Forth system is a dictionary of words that encapsulate the functions of the machine. There are simple words for manipulating data (bytes of memory) or performing rudimentary arithmetic, as well as more complex words for printing on the screen, making sound, and saving or loading files. The programmer combines these words together to make new words, continuing to build up the functionality until the final program is represented by one top-level word. In that way, writing a Forth program is a bottom-up process, starting at the lowest-level elements and working up. In contrast, the design of a Forth program is a top-down process. You iteratively break the program’s function down into smaller and smaller elements until you reach the level of the built-in words.

The overall structure of Tut-tut is relatively simple, with the player completing a sequence of levels, which involves collecting objects, unlocking doors, dodging mummies and finding the exit. The bulk of the logic is in how each level plays: how the player navigates the maze, collects objects and is chased by the mummies.

In Rabbit Run, the core of the game was a loop in which the player first had the opportunity to make their move and then each possible outcome was tested for—in that case, eating carrots, falling down mole holes, or being caught by a fox. At the end of the loop, the fox made their move and it was back to the beginning.  The same game loop could be used for Tut-tut, though replacing foxes by mummies, carrots by gems, and so on.

For both Rabbit Run and Tut-tut, the game state is held in the display buffer. For example, to check the location the player wants to move to, you look up what is there in the display buffer. This is useful for saving both memory and time. In Tut-tut (and Rabbit Run) on the ZX Spectrum, objects are distinguished by colour. This makes it very fast to check what an object is by looking up its colour using the ATTRIB function (or PEEK-ing the right location in the display buffer). The Ace has a monochrome display, so this approach does not carry over immediately. However, the Ace display is very simple, formed from a two-dimensional array of characters, just like the attributes on the Spectrum is as two-dimensional array of colour values, and so it should be just as quick to look up the character code in the Ace’s screen memory as it is to look up a colour on the Spectrum. Thus, a crucial word to define in the Forth version of Tut-tut is SCREEN, which retrieves the character at a particular location in the level:

    : SCREEN ( X Y -- CHAR )
        SWAP 32 * + ( 32 CHARS PER ROW )
        9216 +  ( START OF SCREEN MEMORY )
        C@
    ;


For player movement, I decided to use the Rabbit Run core as the starting point for Tut-tut, though there were some differences. Surprisingly, Ace Forth does not include a CASE statement (which would allow a number of different program paths to be followed depending on the value of an input field—such as, a key-press or the object at a location). For example:

    ( X Y -- NEW_X NEW_Y )
    INKEY
    CASE
        ASCII P OF 1+ ENDOF            ( RIGHT )
        ASCII O OF 1- ENDOF            ( LEFT )
        ASCII A OF SWAP 1+ SWAP ENDOF  ( DOWN )
        ASCII Q OF SWAP 1- SWAP ENDOF  ( UP )
    ENDCASE


Sadly, there is no CASE word in Ace Forth, so the above code would not work. I investigated options to implement a CASE structure (a big selling point of Forth is the ability to add your own commands). However, while I found a few candidates on the Internet and in 1980’s magazines, none of them proved to be very effective nor reliable. I therefore decided to use brute force, writing multiple IF statements. This is an ugly approach though has proved adequate for Tut-tut.

Another weakness of FORTH (and, to a lesser extent, BASIC) is that it is difficult to define large input datasets—in this case, I was thinking about how to get the data for game levels into the game. In the BASIC version, David used DATA statements, RESTORE-ing to the correct line and then READ-ing the data for each level. However, FORTH does not have a DATA statement and the method for entering data described in the Ace manual is very laborious. In the end, I decided to bypass FORTH and to define the level data in binary code blocks to be loaded into memory inside suitable ALLOT’ed arrays. For example:

Tut-tut UDGs and character codes on the Ace.
    ( RESERVES 4,000 BYTES FOR LEVEL DATA )
    CREATE GAMELEVELS 4000 ALLOT
    GAMELEVELS 4000 BLOAD tut-tut.lev


There is a reasonable amount of logic involved in drawing each level in Tut-tut, as a level is stored in a compressed form to save memory. In the original ZX Spectrum version, a technique based on trios of character cells was use to reduce the memory requirements of a level by a factor of three. However, since finishing the BASIC version, David updated the compression strategy to one inspired by the GIF image format and described on his website [link]. This gives better compression and has been used in the ZX81 version to allow more levels to be added. Given that David planned to back-port his new compression algorithm to the ZX Spectrum, I decided to adopt the GIF-inspired approach for the Ace.

On the Ace version of Tut-tut, the logic for drawing a level is encoded in a word called DRAWLEVEL. Using Forth is an advantage here, as it excels at integer arithmetic, which is fundamental to how the encoding works. The only complication, for the Ace version, comes because I needed to remap the character values encoded in the (ZX81) level data onto the correct Ace character codes. For example, in David’s level encoding, the four sliding walls are represented by values 5, 6, 7, and 8. For the Ace version, I need to map these onto inverse-video ASCII characters 177, 178, 179, and 180. The same is true for the keys, gems, bracelets, and so on. This remapping of the character encoding represents the majority of the work of DRAWLEVEL, as you can see if you look at the source code.

As well as level data, Tut-tut also contains a reasonable amount of text for the instructions and splash screen, plus user-defined graphics. I also encoded these into two other binary code blocks, called MESSAGES and CHARSET, respectively.  CHARSET includes two sets of graphics. There are stylised versions of capital letters that overwrite the default bitmaps for these letters, the same as on the ZX Spectrum version, and a set of objects, held in character code 1—14 (except character 13, which is reserved for carriage return).

Otherwise, the port to Ace Forth was relatively straightforward (accepting I needed to brush up on my Forth skills). I tried to follow good Forth programming practice and to keep the most important game data (the position of the player plus temporary variables) on the stack.  This, and the fact that the state of the level is kept in the display memory, means there are relatively few variables needed: for score, air, keys, mummy locations, and a couple of useful flags to help in quickly exiting from the depths of program loops.

Some words involve a fair amount of stack acrobatics, which is a common trait of Forth programs. A particularly complex stack is required for the word CHECKLOCK (which moves a sliding wall, if possible). At one point, CHECKLOCK has a stack depth of 14 numbers, to hold the various permutations of player moving a sliding wall, not having the right key, and/ or a sliding wall being unable to move because of a blocking object behind it.

The word MOVEMUMMY also descends into some scary stack manipulation when the mummy needs to change direction. What was a relatively simple logic in the BASIC version, to make the mummy follow the player, proved particularly challenging in Forth, because I tried to avoid using variables as much as possible. MOVEMUMMY is the element of the program that I most struggled with, spending a good few hours debugging mummies that wandered off the screen or worse still teleported into other parts of the Ace’s memory, typically causing it to crash.

Talking about debugging, this was one of my bugbears with Ace Forth. The programming environment on the Ace is not typical for Forth. Most contemporary versions of Forth required the programmer to enter program source code into screens, which correspond to space reservation on disk (or tape). Manipulating screens was often a clumsy process, though it did mean the programmer could access and change any part of the program at any time.

Instead, on the Ace, you interactively develop the dictionary using : (colon), EDIT, and REDEFINE, creating the new words that make up your program in the active dictionary. If you need to fix a bug or change a word, you must first EDIT the word, which creates a second copy of the word at the top of the dictionary. Then, to get rid of the old version of the word and update any references to the old definition, you must remember to REDEFINE the word, otherwise you can quickly end up with confused dictionaries with multiple versions of a word in use. Because the dictionary is a stack of words, if you forget to REDEFINE a word after changing it, and then define further words, you end up trapped in a situation where you cannot remove the out-of-date version of the word nor can you update the definition of any other words that link to that out-of-date version. The only work around is to FORGET everything that you did afterwards and then re-enter the lost words. On my first attempt at Tut-tut, I fell into this trap on several occasions, and ended up with a hopelessly corrupted dictionary with stale links that made the game unstable.

Eventually, it became clear I needed to start again, from scratch. This was not all bad, as it gave me the opportunity to fix some wrong decisions I had made in that first attempt. I suspect that when writing a program on the Ace, this was a relatively common requirement. Unless you have a very thorough design, the first attempt at a program was likely to end up as a prototype, because once you had moved on from a word definition, you could not go back.

Debugging is not a strong point for Ace Forth (nor Forth, in general). The common trick from the 1980s (because no one does that now!) of adding print statements at key points in a program is slightly more tricky in Forth, as you have to make sure not to affect the state of the stack. The Ace User Guide has a useful word, named .S, which prints out a full copy of the stack without affecting it. I took .S and extended it a little, so that the stack is printed on the first line of the display (a line that is not used in Tut-tut):

: .S ( -- ) ( PRINT STACK )
  15419 @ HERE 12 + ( FIND THE TOP AND BOTTOM OF THE STACK )
  OVER OVER – ( IF TOP = BOTTOM, WE ARE DONE )
  IF
    DO
      I @ . 2
    +LOOP
  ELSE
    DROP DROP
  THEN
;

: .T ( PRINT STACK ON ROW 0 )
  0 0 AT 32 SPACES ( CLEAR ANY PREVIOUS TEXT )
  0 0 AT .S
;


Otherwise, debugging typically meant studying the source code and manually tracking the changes to the state of the stack after each line. It was sometimes quite laborious; though I noticed, as the game developed, I tended to make fewer mistakes, so suspect my Forth competence was growing. I also found useful tips by looking at other people’s code, especially some of the old magazine listings archived on www.jupiter-ace.co.uk, as well as the Ace ROM disassembly [link].

The full listing of Tut-tut is available on GitHub [link]. There are four files. The main file, called ‘tut-tut.fs’, is the Forth source for all of the words, including constants, arrays, and a small amount of machine code. The other three files contain the level data ‘tut-tut_levels.asm’, the help text ‘tut-tut_messages.asm’, and the user-defined graphics ‘tut-tut_charset.asm’. These need to be assembled using a Z80 assembler, such as Z80ASM [https://savannah.nongnu.org/projects/z80asm], to create binary files that can then be inserted into the memory on an Ace emulator, such as EightyOne; into arrays called GAMELEVELS, MESSAGES, and CHARSET, respectively, which have been pre-allocated appropriately.

The process for inserting the binary blocks is a little involved, so I outline it here for GAMELEVELS.

1. First, assemble the source file ‘tut-tut_levels.asm’ and make sure to write a label file, so you can work out how big the binary block is. Using Z80ASM, the following command would do the trick:

z80asm –L –o tut-tut_levels.bin tut-tut_levels.asm

The block is assembled to address 0x0000, though this is not significant. If you print the labels, you should see a label END, which is used to work out the length of the block. At the time of writing, my test version has three levels and END is reported as 0x017D (or, decimal 381).

2. In your Ace emulator, with your in-progress Tut-tut dictionary loaded, create some space for the game levels, with:

CREATE GAMELEVELS 381 ALLOT

—substituting the right value for the length of the block.

3. Check where GAMELEVELS is located in memory, using

GAMELEVELS .

—and use the address returned as the start point to which you load the block—for example, using [File] [Load Memory Block] on EightyOne.

4.    If necessary, remember to:

REDEFINE GAMELEVELS

—if you have a previous version of the array earlier in the dictionary.

I hope you will agree that the Ace version of Tut-tut is a reasonable tribute to David Stephenson’s original and that you will consider attempting to type in the game. I never found a way to automatically output the program from EightOne, so tut-tut.fs has been transcribed by hand. This means I have almost certainly made some mistakes—just like back in the 1980s!

Having written the game, I have come to like Forth a little more, and I have developed a fondness for the Jupiter Ace. Richard and Steven were right that a micro powered by Forth is better able to run software without the need for machine code and I suspect I would indeed have produced more useful programs if I had discovered Forth in the 1980s. I like to think I would have been happy had I owned a Jupiter Ace rather than a ZX Spectrum, when I was younger. However, I suspect I would have been envious of my Commodore- and Spectrum-owning friends and would have missed classic games like Jet Pac and Manic Miner too much.


Read More

Tuesday, May 05, 2020

TuT-TuT on the Jupiter Ace: Part 1

Leave a Comment

Exciting news this week as Tut-Tut launches on the Jupiter Ace: As a special treat to celebrate, guest blogger George Beckett takes us through his journey in porting the game to the Forth Language an onto the Jupiter Ace.

George has spent the last few months converting the original BASIC source listings and some of the latter adaptations made for the ZX81 and 2020 Spectrum versions of the game.

Join us for a new series of articles as we dig up an ancient micro treasure and explore the depths of game conversion.


Evolution of Tut-Tut: ZX Spectrum BASIC, ZX81, ZX Spectrum 2020 Edition, Jupiter Ace.

Porting TuT-TuT to the ACE

Towards the end of August (2019), David Stephenson (a.k.a. zx81adventures) started posting screenshots, on Twitter, from a new ZX Spectrum game that he was working on. The previews showed an arcade, maze game with bright, clear graphics and an Ancient Egyptian theme. What made the game stand out was that David was using Sinclair BASIC to write the entire game: it was to be a type-in game, harking back to the 1980’s home computing scene, when it was not uncommon to invest many hours into typing in, debugging, and playing such games. Given Sinclair BASIC’s sluggish performance and appetite for consuming memory, David needed to employ some careful tuning and compression tricks to achieve reasonable speed from, and to fit the game into, the rubber-keyed 48k Spectrum.

Very Early BASIC version of Tut-Tut on the ZX Spectrum.
The game, called Tut-tut, was finally published in the online retro-computing magazine Paleotronic in early November [link], along with a YouTube review and taster from Villordsutch [link]. Those who did not want to type in the game could download a copy from Paleotronic’s website. However, the download included a subtle warning that it was not quite complete: If you wanted to be sure of having the full game, you needed to invest the time to type it in yourself.

Tut-tut had some similarities to a very rudimentary game I had made, called Rabbit Run, as part of a series of articles I had written on programming for the Spectrum Show Magazine (issues 16—26) [link]. I had produced a few different versions, including several BASIC versions, a machine-code version, and—a little more unusually—a version written in Forth. The Forth version of Rabbit Run worked surprisingly well, being similar in speed and size to the machine code version, though being much quicker to write.

I started to think about revisiting my Forth version of Rabbit Run and using it as the basis for a port of Tut-tut. However, rather than write it for the ZX Spectrum, I decided I would try to write it for the Jupiter Ace, a less well-known British micro from the early 1980s that was unusual in that it had Forth as its built-in language, rather than the ubiquitous BASIC.

The Ace was developed by Richard Altwasser and Steven Vickers, who had been designers at Sinclair Research until they left to form their own company called Jupiter Cantab. The Ace was their first (and only) computer, and was launched in 1983. The Ace had much in common with the ZX81, which almost certainly inspired it but, by using Forth instead of BASIC, the limited RAM (2 kilobytes, built-in, usable) was much less of a constraint than had been the case for the ZX81.

Source - https://k1.spdns.de/Vintage/Sinclair/80/Jupiter%20Ace/Advertisements/
Sadly, while Forth was compact and efficient, its more primitive functionality and idiosyncratic syntax (based on Reverse Polish notation [link]) put people off, and the machine only ever sold a few thousand units. Also, the arrival, soon after, of Sinclair’s next micro, the ZX Spectrum, which for similar money gave you 16kb of RAM and full-colour, high-resolution graphics would have made the Ace look a poor proposition.

The demise of the Ace signalled a change in the way people viewed home computers. The hobbyists and electronics tinkerers of the 1970s had been replaced by a new breed of users who wanted to play arcade-like games and do useful things such as organise their accounts or run small businesses. The Ace, which was billed as “the programmer’s computer”, arrived on the scene too late, after most micro hobbyists had moved on.

I missed out on the Ace, in the early 1980s, instead being lured by the pull of the ZX Spectrum. However, I probably spent at least as much time trying to program my Spectrum as I did playing games. I soon outgrew BASIC, so spent much of my time wrestling with machine code and crashing my computer. Perhaps if I had started out with an Ace rather than the Spectrum, my programming would have been more fulfilling (if a little less colourful). In an attempt to find out if this was the case, I downloaded an Ace emulator (EightyOne), purchased a copy of the 35th-anniversary Ace User Guide, and set to work on a new version of Tut-tut.

Tut-Tut on Jupiter Ace.
The finished product is available from GitHub [link] as either a TAP file to be used in an emulator, such as EightyOne, or a source code that you can type in and modify, consisting of a Forth program occupying around 4kb once compiled and three assembly language files, which hold various game data to be assembled and loaded into the Forth program as binary code blocks.

While based on David’s Sinclair BASIC version, the Ace version uses the newer levels from the ZX81 version and, thanks to some help from David, includes the extra features such as bracelets, amulets, and a hidden treasury for the final level.

The game requires roughly 12kb of memory, so if you are lucky enough to own a real Jupiter Ace, you will also need a 16kb RAM pack as well. Alternatively, you could buy and build a Minstrel 4th [link], a modern day Z80 microcomputer that is compatible with the Ace and can run Tut-tut without any problems.

In the next blog post, I will provide some insight into how the game is written in the hope it will encourage some to have a go at typing in the game rather than loading it from a tape file. However, for now, I suggest you power up your Ace (or Minstrel 4th), or install an Ace emulator, and get on with some Egyptian-themed adventuring.



Read More

Wednesday, April 22, 2020

ZX Spectrum Game: TuT-TuT 2020 Ed

Leave a Comment


After the success of the ZX81 version of Tut-Tut it was suggested to me by several people that it should be ported to the ZX Spectrum. But didn't the game start on the Spectrum you say? Indeed, back in October 2019 the very first version of Tut-Tut was released as a good old fashioned type in game for Paleotronic Magazine. 

Brining Tomb Raiding Back to the Speccy

The initial version of Tut-Tut was a sizeable challenge to get working in pure Sinclair BASIC. The ZX81 version proved a nice little conversion project in C. This time around I've taken both versions, squashed them together and used ZXbasic as the modern development tool of choice.

Keeping it Early 8bit

Despite constantly changing implementation languages, TuT's core game mechanics and functionality are all based around the algorithms and techniques outlined in the Paleotronic article.

Staying true to the BASIC version of the game became a key style choice for new Spectrum edition of Tut-Tut. In particular the decision not to introduce fluid animation into the game was something that I'd much internally debated about.

In the end I felt retaining character square based movement lead heavily to an early 80s home micro aesthetic, one that most retro games (understandably) shy away from. That's not to say the game feels old, it's just meant after a fashion to feel like a kick arse earlier tittle.


TuT-TuT for the ZX Spectrum Screen Shots
Screen Shots from ZX Spectrum TuT-TuT 2020 Edition

New Elements for the Ancient  

Of course nothing stands still, the new edition includes all the enhanced game play elements introduced in the ZX81 version, including bracelets and amulets. All 29 ZX81 levels have been updated for the Spectrum; plus 6 new levels to discover if you've previously played the ZX81 game.

Being that this game is for the ZX Spectrum I've really tried to give the Tut-Tut a great Ancient Egyptian tomb raiding colour vibe. All the graphics have had a good makeover from those in the original BASIC version. In addition the game now contains several minor graphic tile sets that weave together throughout the tombs.

For ease of play-ability, the 2020 Spectrum edition adds joystick support and a much converted ability to pause the game; having to play the ZX81 version in one sitting without coffee became a little taxing.

Download Excavate a Copy of the Game

ZX Spectrum TuT-TuT 2020 Cassette Cover Art

Thanks for Helping it Happen

I'd really like to thank a number of people in particular for helping out and generally supporting the Tut-Tut project from the beginning till the present:

  • Melody Ayres-Griffiths for suggesting something Halloween inspired for the Paleotronic Article.
  • Rod (Villordsutch) Bell and his support for the game, plus suggesting the ZX81 version really ought to be on a real tape.
  • Simon Ullyatt of Cronosoft fame for publishing the game and being generally enthusiastic and awesome.
  • Jim (Magenta) Blimey gets much thanks for play testing a lot of demo versions and providing some really useful dev tools. 


Read More

Friday, January 03, 2020

ZX-Key, Minstrel 3 Keyboard Adapter

Leave a Comment
The ZX-Keys ZX81 Keyboard attached to the Minstrel Issue 3 via the ZX-Key Breakout Board.
The ZX-Keys Keyboard attached to the Minstrel Issue 3 via the ZX-Key Breakout Board.

Since building the ZX81 Minstrel 3 kit I've been using the initial kludge keyboard adapter I'd made up on protoboard with the ZX-Keys. All perfectly fine, although it was a little unsightly, missing the ability to reset the computer and devoid of the reassuring LED indicators.

It's not all about making things tidy though. I still have further plans to encase the Minstrel and need to ensure everything is working as expected before finalising that design. But more of that in latter posts.

The ZX-Key Minstrel adapter is really just a simple breakout board for the standar ZX-Key keyboard. The breakout board can be soldered directly in place, or clipped into the ZX81 keyboard header or slotted into a regular female header. Provision has been made for mounting it firmly to the Minstrel, held in with a bold

To make simple use of the ZX-Keys Keyboard adapter nothing needs to be done other than plug it in and attach the keyboard. However an additional 3 wires may be soldered to the Minstrels 5v, GND and Reset lines to restoring computer reset and LED functionality to the Keyboard.

In the coming weeks I plan to make the Minstrel 3 ZX-Keys Keyboard kit available on Tindie. This will be in addition to the regular fully assembled units designed for the ZX81 that I currently make available on Sell My Retro. So stay tuned for that.

Minstrel Issue 3 ZX-Key Breakout Board.

Read More

Saturday, December 14, 2019

All New ZX81 : A Minstrel Issue 3 Kit

Leave a Comment
A long time ago in a land far far away Sinclair Research released unto the world a ZX81 kit computer. This is not that kit, this is a brand new Minstrel Issue 3 computer, that happens to be an enhanced reworked ZX81 clone with 32k RAM.

Part Minstrel Review, Part Not

Over the last couple of years Dave Curran of Tynemouth Software has been busy designing and producing modern recreations of Sinclair's early home computer kit, the ZX80. Although in fairness, to call them recreations is probably a disservice. One of the major goals has always been to take the project to the next level and launch a full ZX81 work alike.

This of course is where the Minstrel Issue 3 comes into the picture, it being the first of Dave's fully functional ZX81 clones-ish computers. There are of course some differences, the most obvious being that there is no ULA, or modern equivalent, and the computer is entirely designed around discrete logic IC's . In a world full of FPGAs this refreshing.

To find out more on the inner working of the Minstrel family and the Minstrel 3 in particular Dave has written a number of exceptional blog posts that deserve a good read through.

See a Kit, Build a Minstrel

Kits Done Right: ICs Layed out as per the Minstrel Circuit Board
One of the first things I noticed when opening the kit is just how much thought and care has gone into producing it. From the PCB design to how the IC parts tray was laid out to match the PCB, all the way down to included documentation. First impressions count, and the overall presentation put me in a very good mood before I dared assemble anything.

With 25 ICs, plenty of resistors and capacitors the Minstrel takes some time to put together. While It's certainly no picnic to build, thanks to the layout and documentation it never seemed an insurmountable chore. In the end I managed to construct my kit in 4 reasonable sittings with a similar amount of coffee (coffee being a very accurate measure of time).

Using the Minstrel

After completion comes the power on, will it work will it not work? It didn't, but that was entirely my fault. A quick inspection latter, seems I'd failed to solder exactly one IC pin leg. Power on two, success! Aside from being quite elated at a fully working Minstrel, I was immediately amazed at just how clear the image emanating from it was. Truly the image quality is better than using an emulator, which in the case of a ZX81 style computer is a brilliant thing.

Of course it's not all about image quality. The Minstrel is designed to fit within a standard UK ZX81 case, as such it makes a pretty perfect replacement for a dead ZX81 board. Note that American ZX81 and Timex 1000 cases would require some modification around the video output holes for the board to fit.  

Minstrel Issue 3 Mostly Assembled
If placed inside a ZX81 case the only real clue to it not being a ZX81 would be the swapping out of the mono phono jack power socket for a barrel style one. This is possibly one of the finest moves possible, at least to the user. Going out on a limb here, but in my experience a wobbly phono jack is far more likely to cause an unexpected reset than that legendary RAM pack wobble ever did.

Like the original ZX81, the Minstrel does lack a of a power button. That's not really the Minstrels fault, it's more of a design limitation brought about by ZX81s case design. There are a number of solutions, the easiest is to just go out a buy an external switch from the 'The Future was 8 Bit'. It might be something that Tynemouth could include as an extra option at purchase time.

How Compatible is Compatible

I've not found any software so far that wouldn't work with the Minstrel, I dare say I won't be able to. The little computer is even compatible with a number of newer games and programs that take advantage of hires graphics modes, modes that required hardware modification on an actual ZX81.

Hardware expansions on the other hand may be a little to harder to guarantee due to both the modern design of the Minstrel and the esoteric nature of ZX81 expansions.

I've only a couple of expansion that I can test with the Minstrel, and I don't any 80s period hardware to throw at it. The best news is that the most required modern add-on, the ZXpand works perfectly, indeed Dave Curran in consultation with Charlie Robson the creator of the ZXpand is planning a special edition of the ZXpand specifically for the Minstrel. 

Also of note, the Zeddynet network interface, a card I've had trouble with on some actual ZX81s  work flawlessly. Internet meet Minstrel, a perfectly modern retro way to connect to the world.

Sadly for me one expansion didn't work, my ZX-Keys Expansion card. After speaking to Dave on the matter I have some leads on as to why, I'll have to see what can be done on a revision 2 of my boards. For the moment the ZX-Keys keyboard works perfectly using the Minstrels internal keyboard connector. 

Adding a ZX-Key Keyboard

I have some future plans for my Minstrel involving a custom case and a full sized keyboard. For the moment though I need a working keyboard (There are keyboard options at kit purchase time). As discovered earlier my ZX-Key Expansion card didn't work so I built a temporary adapter board for the ZX-Keyboard.

Internal ZX-Key Keyboard Adaptor
The resulting kludge is a simple wire up job on some protoboard On the Minstrel I soldered on a Female Header Socket Strip to plug it into. Nothing groundbreaking here then. The next step will be to make up a proper PCB board. On the temporary one I've only wired up the bare essentials, the keys. The keyboards LEDs and reset button don't work and it all looks a little messy. Still I do have a nice modern-ish keyboard to use with a nice modern-ish ZX81 clone.

In Summary

I have to say I've been very pleased with the Minstrel kit. It's fun and rewarding to put together and in all honesty it's a much better computer than ZX81. If you enjoy assembling kits then go get one, if you don't know one end of a soldering iron from another Dave supplies them pre-built too.

Now of to play some games, how about a nice game of Tut-Tut?

Minstrel up and running playing a little bit of Tut-Tut

Read More

Wednesday, November 20, 2019

The NEC PC-8401 Reexamined: Part 2

Leave a Comment

RAM Expansion Cartridges

One of the shortcomings of the NEC PC-8401 is the lack of RAM. By default the computers base 64k is divided in half between file storage and system memory. While 32k is plenty for running the software available in ROM, this limits options when running other software that may require large amounts of memory. Conversely the remaining 32k of RAM dedicated to file storage as a RAM disk places similar constraints on user file and program retention.

Fortunately memory limitations could be alleviated with the addition of RAM expansion cards. These RAM cartridges were to be available in 3 sizes, 128k, 64k and 32k. Rather than adding directly to available application memory, the expansions are used as RAM Disks and must be formatted by the Operating System before use. Once the additional storage is available the PC-8401s base memory may be configured to use the full base 64k as application memory or you may keep existing 32k shared memory split.

No RAM Expansion Attached
32k: Applications RAM
32k: RAM Disk Drive A:

RAM Expanded Machine Option 1
32k: Applications RAM
32k: RAM Disk Drive A:
32/64/128k: RAM Disk Drive B:

RAM Expanded Machine Option 2
64k: Applications RAM
32/64/128k: RAM Disk Drive A:

The PC-8406A 32k RAM Cartridge

The PC-8406A 32k cartridge internals are relatively compact, containing 74 Series logic chips and 16 D446G-15 NEC 2K X 8-BIT SRAM chips mounted on both sides of the circuit board. The SRAM contents are maintained by a CR2032 lithium battery; during battery changes the carts can be powered externally via a 5v barrel jack. Interestingly for the time, just about all the chips contained on the PCB are SMD variants.

The PC-8406A 32k RAM Cartridge.

Unfortunately the PC-8406A 32k pack is on the smaller side of useful, and probably best as a temporary storage device for moving files around. It's not a serious contender as a mass storage device. Even by the file and program sizes of the 1980s it's small. You could for example install MS BASIC on the drive, but then you have very little storage space left for saving programs.

Underside of the PC-8406A 32k RAM Cartridge.

Niggling issues with the NEC PC-8401s overall design choices only increase from there, being that other mass storage devices available of the computer such as the PC-8431A Micro Floppy Disk Unit make no provision for using the RAM carts at the same time, and even the CRT adaptor precludes the usage of the RAM cart as the PC-8401's expansion port provides no means of connecting multiple add-ons.

Effectively there is no easy method of copying the contents of the RAM cart to less volatile floppy disk media. The limitations of the 32k cart apply to a lesser extent to the 64k and 128k expansions, however due to how the PC-8041's memory management works the higher rated cards are inherently more useful as storage mechanisms to begin with.

Severe limitations and all, the RAM carts do help turn the base unit into a more practical computer. Even the 32k cart certainly enhances the PC-8401 user experience, especially in its predicted role as a word processing and spreadsheet powerhouse.

See all entries for this project:  Part 1, Part 2



Read More

Sunday, November 17, 2019

ZX81 Game: TuT-TuT - Editions

Leave a Comment

What news of the ZX81 version of the TuT-TuT since the initial release you ask? Well there are some exciting developments that need some sharing.

Physical Tape Release of TuT-TuT

I'd mentioned in the previous post that a physical tape release was in the works. Simon Ullyatt and his brilliant retro publishing label Cronosoft will be releasing the game in the not to distant future.

Simon is busy putting the game through some additional testing on real hardware, checking the loading from real tapes and the like. Then of course there is the small matter of cassette production, once all is confirmed the release date will be announced, so stay tuned for exact dates.

Of course what's a physical tape release without some good cover art? After an intense drawing session on my part and some quality layout work on Simon's side of things we have a tape inlay cover ready to go. Those mummies really look menacing, would you dare enter this tomb? (Of course you will)


Coming to a Tape Player near you, the Soon to be released Tape version of TuT-TuT  

UDG 4 ZXpand Edition 

For those fortunate enough to own both a ZXpand and a UDG 4 ZXpand expansion cards for their ZX81s, Moggy from over on the Sinclair ZX World forums created a User Defined Graphics set for TuT-TuT. Don't have the expansion or a ZX81, no need to worry the enhancements can be used with the excellent EightyOne Sinclair Emulator.

All instructions on how to use the UDG version in an Emulator or with a real ZX81, along with the required files are all now included in the TuT-TuT tape file download.

Original ZX81 version and the enhanced UDG 4 ZXpand graphics set.

Get TuTing on an iPhone

In need of a mobile on the go fix of some TuT-TuT action? Kevin Palser has your desires covered if you're an iPhone / IOS user. TuT-TuT is to be included in the next release of the his ZX81 for IOS emulator. The latest version of the emulator should be appearing later this week (Late Nov 20119).




The ZX Spectrum Version

The ZX Spectrum version of TuT-TuT has been a huge success all off it's own. A big thanks for the overwhelmingly positive reviews circulating out there in the wild.

A special shoutout to Ewan Spence for his play through of the game on his Retro Spectrum YouTube channel. It's been great to see so many great reactions to the game. Who would have thought a game written in Spectrum BASIC could be such a hit in 2019.



The Spectrum version of the game was all about challenging the idea that Sinclair BASIC couldn't be used effectively in games creation, I think I've managed to help in some way to bust that myth. If you haven't yet, go grab yourself a copy from Paleotroic Magazine and get playing, remember to check out some of the other articles while there.

The ZX81 Version is more than a Conversion

If you've had fun playing TuT-TuT on the ZX Spectrum be sure to give the ZX81 version a play through.

Unlike the Spectrum TuT-TuT, the ZX81 game is not written in BASIC, this left the door open for some enhancements of gameplay and features. While some of the levels will be familiar, many have been subtly changed and many more added, in fact there are almost twice the amount on the ZX81.





Getting a Copy of TuT-TuT


ZX81 Versions


ZX Spectrum Versions


Love the Game?


Read More

Tuesday, October 29, 2019

ZX81 Game: TuT-TuT

4 comments
For the October 2019 issue of Paleotronic Magazine I took on the challenge of writing a ZX Spectrum game in BASIC. The result being the fast paced Halloween inspired, Ancient Egyptian themed arcade puzzler Tut-Tut. Now with the Spectrum version sorted, how about a ZX81 version of the same game, only better?!


Tomb Raiding with a ZX81

It's coming to the end of 1921's digging season in Egypt. Your excavations have not gone so well this year, failing to find any trace of the legendary and as yet undiscovered Pharaohs tomb. Then in your final weeks wild stories recounting the wrath of vengeful mummies strangling would be tomb local raiders filter back to base camp.

At last some concrete leads worth looking into, and opportunities to good to pass up. Oculist tales of curses be dammed, you're an Egyptologist and grand adventurer, such nonsense can't possibly hurt you. Or can it?

How far into the tomb of the Pharaoh can you make it? 

Playing the Game

Tut-Tut is one part puzzle, two parts arcade action. The game is comprised of 28 levels, plus a hidden treasure chamber which may only be opened if you are deemed worthy.

Collect gems, amulets and bracelets for points, you'll need 5000 before the end of "Sutekh's Eye" (level 28) for the treasure chamber to open. Amulets and Bracelets will freeze the player or halt mummies respectively.

To complete each level the player will need to collect keys, open doors, move blocks before finding exits to lower crypt levels. Keep an eye out for Pharaohs roaming guardians, they're not the smartest of the undead but they are relentless.

Keys are: ‘O’ left, ‘P’ right, ‘Q’ up, ‘A’ for down and ‘R’ to reset the level (at a cost).

Details on where and how to acquire a copy of TuT-Tut are listed at the end of this blog entry.


The reMaking of TuT-TuT


The original version of Tut-Tut was written as a type-in game for the ZX Spectrum and published in Paleotronic Magazine. The game was entirely constructed in BASIC, this presented numerous challenges, the the greatest being the problem of speed and squeezing enough of it out of the machine. The trials and tribulations of undertaking that task on the ZX Spectrum is pretty well documented in the magazine.

I had considered re-pointing the BASIC game to the ZX81, but the challenge of writing a good game in BASIC had kind of been dealt with. The greater challenge on the ZX81 is in presenting an atmospheric game that transcends the limits imposed by the machines most obvious shortcomings; black and white predefined chunky graphics. To that end the ZX81 version of Tut-Tut has been written in C, targeted towards Z88dk for compilation.

TuT-TuT: ZX Spectrum vs ZX81 Version
I've been careful to maintain the core game play between versions. The choice not to use BASIC could have been a catalyst to greatly enhance elements such as enemy mummy movement for example. The choice not to change to much has however kept the feel of the game, and ensured the overall design feels consistent.

Despite remaining essentially the same game, opportunities have been taken to add additional elements. The size and scope of TuT-TuT has increased, there are now 28 normal levels, plus 1 special level. Extra levels necessitated the creation of a couple of additional items to hold player interest; Amulets and Bracelets provide chances for scoring extra points alongside the potential disadvantage of actually interacting with the items.

That's about it, be sure to check out the article in Paleotronic and enjoy both the original and especially this ZX81 enhancements. Special thanks to Paleotronic for both suggesting and providing the space the Spectrum game and a shout out to Rod Bell for supporting the project.

Be sure to check out Rods video review of the ZX81 TuT-TuT Demo Version


Getting a Copy of TuT-TuT


ZX81 Versions


ZX Spectrum Versions


Love the Game?






Read More