Showing posts with label Games. Show all posts
Showing posts with label Games. Show all posts

Saturday, May 25, 2024

Cronosoft Releases: Minoss Knossoss for the ZX81 on Tape

Leave a Comment

Cronosoft has announced the release of Minoss Knossoss for the ZX81 on Tape. You can now dive deep into the legendary labyrinth and embark on an unforgettable adventure that brings the rich mythology of ancient Minoan Crete to life on your ZX81.


ZX81 Game: Minoss Knossoss Tape Cover Art
Minoss Knossoss the ZX81 game Released on Tape by Cronosoft 

For any great release you need exceptional cover art: I produced the base artwork for the cover of the physical release, featuring a menacing Minotaur alluding to the horrors that await the adventurous archaeologist. With Simon of Cronosoft completing the stunning package design and putting the game through rigorous testing on real hardware, ensuring smooth loading from the tapes.


So now there's no excuse not to experience the thrill of the labyrinth and the beauty of retro gaming with Minoss Knossoss on your ZX81. Stay tuned for the official release date and prepare for an epic journey! 



Uncover a Copy of Minoss Knossoss


ZX81 Version







Read More

Monday, April 08, 2024

ZX81 Game: Minoss Knossoss

Leave a Comment

ZX81 Game Minoss Knossoss, Screen shot  of Minoss Knossoss Title / attract screen

Having had Tut-Tut successfully ported to numerous 8-bit systems, it feels fitting to elevate the gaming experience by launching a sequel to the original tomb-raiding puzzle adventure in the form of 'Minoss Knossoss'.


Minoan Archaeology with the ZX81

Life on the ancient history speaking circuit had grown dull. Tired of recounting your successes at the tombs of Tut-Tut, you yearned for the exciting life of a practical archaeologist. Now, in 1924, after a month's journey by tramp steamers, you arrived in Crete at the Palace of Knossos.


Initially finding little, concrete leads began emerging from your excavations, presenting opportunities too good to pass up. Ancient tales of curses and the fabled Minotaur, along with the legendary workshops of Daedalus, beckon to the grand adventurer.


Here in Crete, where the labyrinth of the Minotaur lies, with mysteries and dangers aplenty, you'll cement your reputation as the greatest archaeologist of all time, or die trying.


ZX81 Game Minoss Knossoss, Screen shot of level 1 "kephala Naos"
Can you find your way into the labyrinths beneath Knossos?

Playing the Game

Minoss Knossoss is one part puzzle, two parts arcade action. The game comprises 20 levels, with the final level being the hidden workshops of the mythical craftsman Daedalus; accessible only to those who have mastered the labyrinths (accumulated 2500 points).


Collect gems, amulets, bracelets, keys, and hourglasses to earn points. Amulets freeze the player, while bracelets halt creatures. Hourglasses award you extra time to complete a level. Completing a level requires the player to collect keys, open doors, and move blocks before finding exits to lower labyrinthine levels, all while keeping an eye out for King Minos's mythical guardians.


Labyrinth Guardians

Strategically utilise hidden crevices to evade enemies, capitalising on the predatory instincts of Harpies and Minotaurs to distract them while you unravel the puzzles.

  • Serpents: Massive snakes roam the levels. They are timid, and while they won't actively hunt you down, be cautious—cornering them may provoke a strike.
  • Harpies: With the body of a bird and the visage of a human, these winged creatures embody an avian ferocity and supernatural penchant for vengeance.
  • Minotaurs: Renowned as the ultimate terror within the labyrinth, these formidable creatures relentlessly pursue their prey, turning the maze into a deadly game of survival.

Controls

  • Keys: ‘O’ left, ‘P’ right, ‘Q’ up, ‘A’ down, 'F' to pause and ‘R’ to reset the level (at a cost).
  • Joystick / Gamepad: A Kempston standard Joystick addaptor is supported.

Sound

  • AY Sound is supported via ZON-X sound cards and compatibles such as the ZXPand+



The Making of Minoss Knossoss

Minoss Knossoss stands as the direct sequel to Tut-Tut, a game I originally crafted for Paleotronic Magazine and the Sinclair ZX Spectrum. Following its initial release, Tut-Tut underwent widespread porting to various 8-bit platforms by a diverse array of developers. Notable among them are Dave Curran for the PET, myself and Dave for the Vic20, Sheila Dixon's adaptations for the RC2014 and MSX machines, and George Beckett's rendition for the Jupiter Ace.


Having played a role in each iteration of Tut-Tut's porting process, we seized the opportunity to introduce numerous enhancements with each development cycle. However, there inevitably comes a point where further improvements reach a natural limit, paving the way for a full-fledged sequel.


ZX81 Game Minoss Knossoss,  Screen shot of level  "Teucers Bow"
Deeper into the Labyrinth, Level Teucers Bow

In essence, the gameplay of Minoss Knossoss will feel familiar to fans of its predecessor. However, the sequel introduces additional monster types, including Serpents, Harpies (with movement similar to the mummies from Tut-Tut), and, of course, Minotaurs, each contributing an extra layer of challenge. And what would be the point of new monster types without the ability to have more of them on screen at one time? Furthermore, players will encounter a new item type in the form of hourglasses, which provide valuable extra time to navigate through certain levels.


Among the less conspicuous enhancements are newfound abilities to strategically trap monsters, sparing players from potentially frustrating level restarts. Also note that, players can now enjoy the long-awaited feature of pausing the game, particularly notable feature for ZX81 users. Additionally, the playing area has been expanded, offering a more immersive gaming experience.


Behind the scenes, I've implemented enhancements to optimize how levels are stored, Refined game timing to synchronize directly with the clock cycles of the ZX81/Z80, resulting in smoother gameplay. And, of course, I've finally integrated joystick support and rudimentary sound for those fortunate enough to be using ZON-X sound cards and Kempston Joystick adapters (or emulators).


Regrettably, the one feature omitted is the level code input option, allowing players to skip completed levels. Unfortunately, due to space constraints, this feature couldn't be included. However, rest assured that it will make a comeback in future ports for other 8-bit machines—just a hint of things to come.


With all of these features and more, I hope you enjoy Minoss Knossoss.



Uncover a Copy of Minoss Knossoss


ZX81 Version








Read More

Wednesday, December 06, 2023

Tut-Tut: Egyptomania the RC2014 Way

Leave a Comment

Sheila Dixon unwraps a spooktacular new version of Tut-Tut, the modern Retro classic, playfully bringing 'Egyptomania' to the premier home-built computer of the modern Retro era, the RC2014.


Tut-Tut Level Ruby Rhod playing on the RC2014
Tut-Tut Level Ruby Rhod playing on the RC2014

What's New is Old when Tomb Raiding

Why let the ancient microcomputers of the Pharaohs have all the fun when there are splendidly modern Z80 machines ready to embark on the Tut-Tut adventure. With the RC2014 debut, Sheila has seamlessly amalgamated elements from diverse game versions, infusing captivating sonic enhancements that add an extra layer of discovery.


Part of the discovery may entail constructing your own RC2014 and then crafting a suitable video card for this petite computer, either a TMS9918A video module designed for RC2014 or a TMSEMU graphics card designed for RC2014, required as notably a base RC2014 kit only provides serial out.


The TMS9918A video IC was a fixture in numerous 80s home computers, including MSX1, so fittingly a touch of ancient technology is required to play the new RC2014 version of Tut. The TMS9918A brings a very vibrant palette to the game, remenicant of the ZX Spectrum, yet with it's own unique touches and a level of colour variety that puts the Sinclair to shame, delivering a new visulal experiance to the all the levels.


Screen Shot of a Screen of a Level of Tut-Tut RC2014
Screen Shot of a Screen of a Level of Tut-Tut RC2014

Talking about levels, this edition incorporates both the freshest additions and timeless classics from the Vic20 release. What might not be immediately apparent is that, for the most part, they are constructed using the ZX81 level definitions. This peels back a layer of the game, restoring a slightly more claustrophobic ambience and an oddly menacing urgency to escape each tomb. Just like in the Vic20 release, level codes are provided, so you need not remained encased in a failed level forever however. 


One of the most exciting additions to the RC2014 version is the audio overhaul. Sheila has added a new score and sound effects thanks to an optional requirement of an AY sound module. (Another fun addition to the RC2014 to build). Perhaps the best way to judge is to hear and see the game in action in a short clip taken during the games deveopment.




In short, the RC2014 proves to be an outstanding addition to the Tut-Tut lineup, coupled with the added bonus of running the game on a system you've constructed yourself.


You can dig up a copy of Tut-Tut RC2014 over at Itch IO, and don't forget to check out all the other versions of the games listed below.



Raid the Pyramids for a Copy of TuT-TuT


RC2014 CPM Version for the TMS9918A Video Card

Commodore Vic-20

Commodore PET

ZX81 Versions

ZX Spectrum Versions

Jupiter Ace

TRS80 MC-10

Read More

Sunday, July 16, 2023

Tut-Tut: Tomb Raiding on the Vic-20

1 comment

Tut-Tut Concept Art

A New Version of a Modern Retro Classic

Given the resounding success of my little game of Tut-Tut on platforms such as ZX Spectrum, ZX81, Jupiter ACE, and the commendable port by Tynemouth Software's Dave Curran to the Commodore PET, it was an inevitable progression to broaden the game's horizons and introduce it to the illustrious Vic-20, the "Wonder Computer of the 1980s."


New to Tut-Tut? What's this Game About?

As the digging season of 1921 draws to a close in Egypt's Valley of the Kings, it becomes evident that your excavations have yielded disappointing results. Despite your ardent efforts, no traces of the fabled and elusive Pharaohs' tombs have been uncovered. However, as the final weeks approach, intriguing rumours begin to circulate, recounting chilling accounts of vengeful mummies exacting retribution upon local would-be tomb raiders.


These wild stories, though tinged with the supernatural and curses, cannot be ignored. As an Egyptologist and daring adventurer, you find yourself presented with concrete leads and irresistible opportunities. The allure of uncovering long-lost secrets and ancient treasures proves too tempting to resist, even in the face of ominous tales of wrathful spirits.


Tut-Tut Vic20 Screen Shots
Screen Shots from the Vic-20 version of TuT-TuT

Now, on the cusp of a new expedition, you stand poised to delve into the unknown depths of the Valley of the Kings, ready to face the mysteries and potential dangers that lie ahead. Will you emerge unscathed from the clutches of ancient curses, or will the vengeful spirits lurking in the shadows prove to be more than mere legends? The answers await, as you embark on a daring quest that will test your courage, knowledge, and perhaps even your beliefs.

Prepare to embark on a journey like no other as Tut-Tut takes you on an adventure through the treacherous Egyptian tombs, with its visually stunning colour scheme and a myriad of intricately woven graphic tile sets that bring the ancient world to life before your very eyes.


The Making of the Vic-20 Version  

Tut-Tut initially originated as a BASIC type-in game, designed specifically for the ZX Spectrum and published in Paleotronic Magazine. Further versions of the game for the ZX81, Enhanced 2020 Spectrum Edition and Jupiter Ace, the latest version was one ported to the Commodore PET by Dave Curran. All varieties have all kept the core structure and mechanics as outlined there.

After witnessing the success of Dave's PET version, I couldn't help but ponder the possibility of bringing Tut-Tut to the Vic-20. While considering the similarities between the two machines, I became aware of the numerous disparities that needed to be addressed, particularly in terms of screen real-estate and the Vic-20's unconventional memory management scheme. Luckily i raised the conversion idea with Dave, and he was up to a joint challenge, as I'm in no way sure I'd have got there without our joint efforts.

Screen Real-Estate and Luck by Design

Due to Tut-Tut's origin as a ZX BASIC game, one that need to run quickly, lead to the adoption of a 26x17 character grid for the game board layout (excluding score bars etc). The ZX Spectrum's character resolution is 32x24, constraining the board size to a smaller grid made for more time efficient code in the very orriginal ZX BASIC version. These dimensions sunsiquently stuck for all future conversions.

However, while the grid size was suitable for the ZX line, it posed a challenge when porting Tut-Tut to the Vic-20. Those familiar with the Vic-20 immediately noticed the issue: the Vic-20's screen width is only 22 characters wide (and 23 high). This presented a hurdle that needed to be addressed in order to adapt the game for the Vic-20.

A possible solution could have been to reconfigure the game's levels to fit within the Vic-20's 22x23 screen limitations. This would have been easily achievable code wise, but level design wise it would come at a cost to the overall feel and immersion. A particular issue, as the existing levels are heavily constructed around the games mechanics and already small(ish) screen size.

Tut-Tut Vic20 Screen Shots / PAL vs NTSC Geometry
PAL vs NTSC Geometry Comparison

As luck would have it, the Vic-20's screen sizes can be redefined to an extent. Values in memory location 36864 to 36867 can be POKED to set screen geometry and centring. The results of doing so yielded just the right amount screen width to fit the existing level structure.

Yet another obstacle presented itself: the disparities in screen geometry between PAL and NTSC standards. NTSC, in particular, occupies a wider physical width on a display (not pixels) compared to PAL. However, by a stroke of luck, the constraints imposed by the level width inadvertently resulted in an image that delicately brushes the very edge of an NTSC display. This serendipitous alignment allowed Tut-Tut to make the most of the available screen space on both PAL and NTSC systems.

Graphics Updates

The Vic-20 is perhaps renowned for its vibrant and colourful display, you'd think this would be directly comparable to the ZX Spectrum in terms of its rich palette. However, an intriguing aspect arises when considering the variation in colour appearance based on factors such as the age, make, and region (PAL/NTSC) of the Vic Chip utilised on any given machine. Then there is the screen fuzziness / blurriness, which again varies. 

The diversity in colour appearance on different Vic-20 machines prompted us to reevaluate tile design and colour choices for Tut-Tut. In the Spectrum version, the game employed various palettes that cycled based on the level number, creating a dynamic and ever-changing visual experience. However, for the Vic-20 version, we've opted for a different approach. Instead of cycling palettes, we focused on expanding the selection of available thematic tiles while exercising tighter control over the colour schemes. (A good approach, and If I hadn't mentioned it, would probably gone unnoticed.)

We're pretty confident we reached the required level of ancient Egyptian cinematic charm / ham.

Memory for Mummies?

Another challenge we faced was determining how much memory we could allocate to the game on the Vic-20. By default, the Vic-20 only had a modest 3k of onboard memory, which was insufficient to accommodate even the most streamlined versions of Tut. The issue was further compounded by the lack of a standardised expansion memory layout and location of that memory on a Vic-20. This variability made it difficult to rely on expanded memory for larger games, often leading to the reliance on cartridges for larger game titles.

Ultimately, we proceeded with the assumption that modern enthusiasts would likely possess a contemporary memory solution, such as the Penultimate+, offering a generous 32k of memory. This assumption gave us the confidence that the game could be released on cassette. Little did we know at the time of developing the game that Tut-Tut would eventually become a pack-in title on the Penultimate+2 Cart from TFW8b.com.

Pharaohs' (Pen)Ultimate Enhancements

The Vic-20 version of Tut-Tut comes packed with all 36 levels from the ZX Spectrum 2020 Edition. In addition, we have incorporated 6 exciting new levels (bringing the total to 40) that are carefully integrated throughout the game, providing fresh challenges and surprises.

We have also included the convenient pause option from the PET version, allowing intrepid Archaeologists to take much needed meal and rest breaks. Furthermore, one of the most highly requested features we have implemented is the inclusion of level codes: Enter specific codes to access the harder levels previously reached.

All very good reasons to call this Vic-20 version, the Ultimate Tut-Tut.
 

Playing Vic20 Tut-Tut with the Peultimate+2 Cartridge
Playing Tut-Tut Vic-20 as included on the Penultimate+2 Cart

Special Thanks

I Can't end this post without thanking Dave Curran for sharing in the creation of the Vic-20 conversion, he'd paved much of the ground work during his PET efforts.

Additionally, thanks very much to Rob Hull for including the game in the Penultimate+2 games lineup. Very happy indeed to have it listed alongside the other TFW8b titles.


Fancey Delving Deeper into the Vic-20 Conversion?

Further Readings  unraveling the mysteries of Tut-Tut Tomb's and the Vic-20 conversion are now available on the Illustrious Tynemouth Software Blog.


Raid the Pyramids for a Copy of TuT-TuT


Commodore Vic-20

Commodore PET

ZX81 Versions

ZX Spectrum Versions

Jupiter Ace

TRS80 MC-10


Read More

Sunday, August 15, 2021

Tut-Tut on the Commodore PET

Leave a Comment

For a game that started out as type-in program for Paleotronic Magazine, Tut-Tut has received a load of love. I'm constantly surprised at Tuts success throughout all the versions I and others have released. 


The various Spectrum versions feature in YouTube videos, the ZX81 version made the review pages of Retro Gamer, George Becketts' Jupiter Ace port has become quite the hit in Forth Circles and the original type in version even made it to the TRS-80 MC-10 courtesy of Jim Gerrie. Yes for a game that I wrote initially to prove Sinclair BASIC games didn't have to be a slow boring mess, Tut-Tut found it's mummified legs and ran with them.


All of which brings us around to the latest port, Dave Currans' 2021 Commodore PET release of Tut-Tut.  


Pharaohs' 6502 Tomb of PETs

Ostensibly the PET port is based on the source code from the ZX81 version of the game. Considering the graphical limitations of Commodores first line of computers, the ZX81 version provides the perfect starting point.  Of course the source code is only the beginning, there are many challenges in transposing  games from system to system. 


Dave has done a brilliant job of porting and preserving the overall feeling of the game. Game play is smooth and crisp, and you certainly don't ever feel cheated when caught out by Pharaohs' treasure guardians.


Tut-Tut on the Commodore Pet


In the PETs favour, the limited music and sound effects from the Spectrum and Ace versions have been incorporated, along with the ability to pause the game. All features that lend to your immersion into the game world. (Why I forgot to include 'pause' in the ZX81 release I've been meaning to ask myself for ages.)


I'm not going to dive any deeper into reviewing the game, I feel that's best left to others, after all I've got quite a stake in this title in general. What I will say however is that PET Tut-Tut is every bit Tut-Tut, and if you've enjoyed the other varieties then you're sure to love this one as well.


The game is now available from The Future was 8bit on Cassette as part of their £4.99 range or digitally at Itch.io. I strongly recommend loading up ASAP, Pharaohs' treasures await.


One again, great Job Dave!





Raid the Pyramids for a Copy of TuT-TuT


ZX81 Versions

ZX Spectrum Versions

Jupiter Ace

Commodore PET

TRS80 MC-10

Love the Game?









Read More

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