Revisiting A Z80 Game From 1990

Back in the days of 8-bit computers, like no doubt many readers of similar age, we wrote little games. First in BASIC, then augmented with little machine code speed-ups. We didn’t come close to [Óscar Toledo Gutiérrez] though, who’s reverse engineering a 2K all-machine-code game he wrote back in 1990. As a tale of software archaeology it’s fascinating.

The game itself is an avoid-the-monsters platformer with plenty of ladders for the little sprite-based protagonist to run down. The computer was a Mexican homebrew educational machine with a TMS9118 display chip and an AY-3-8910 synthesizer, so the result had both color and music. His run through the code breaks it down neatly into individual sections, so it’s possible to see what’s going on without an in-depth knowledge of machine code.

He readily admits it bears all the hallmarks of an 11-year-old’s knowledge at the time, and that it has some parts less elegant, but nevertheless it’s something of an achievement at any age. It was out of date gameplay-wise in 1990 but in 1982 it could probably have been bought on a tape by eager kids. Here in 2024 he’s got it for download should you have a Colecovision or an MSX. There’s a gameplay video below the break, take a look.

Continue reading “Revisiting A Z80 Game From 1990”

Z80 I/O Madness

While the 8080 started the personal computer revolution, the Z80 was quickly a winner because it was easier to use and had more capabilities. [Noel] found out though that the Z80 OUT instruction is a little odd and, in fact, some of the period documentation was incorrect.

Many CPUs used memory-mapped I/O, but the 8080 and Z80 had dedicated I/O addressing pins and instructions so you could fill up the memory map with actual memory and still have some I/O devices. A quick look in the famous Zak’s book on Z80 programming indicates that an instruction like OUT (C),A would write the A register to the output device indicated by the BC register pair (even though the instruction only mentions C. However, [Noel] missed the note about the B register and saw in the Zilog documentation that it did. Since he didn’t read the note in the Zak’s book until later, he assumed it was a discrepancy. Therefore, he went to the silicon to get the correct answer.

Breadboarding a little Z80 system allowed him to look at the actual behavior of the instruction. However, he also didn’t appreciate the syntax of the assembly language statements. We’ve done enough Z80 assembly that none of it struck us as particularly crazy, especially since odd instruction mnemonics were the norm in those days.

Still, it was interesting to see him work through all the instructions. He then looks at how Amstrad used or abused the instructions to do something even stranger.

If you want to breadboard a minimal Z80 system, consider this one. If you enjoy abuse of the Z80 I/O system, you don’t want to miss this Z80 hack for “protected mode.”

Continue reading “Z80 I/O Madness”

Brand-New PCB Makes Replica TRS-80 Possible

If like us, you missed out on the TRS-80 Model I back when it first came out, relax .With this brand-new PCB that’s a trace-for-trace replica of the original and a bunch of vintage parts, you can build your own from scratch.

Now, obviously, there are easier ways to enjoy the retro goodness that is the 46-year-old machine that in many ways brought the 8-bit hobby computing revolution to the general public’s attention. Sadly, though, original TRS-80s are getting hard to come by, and those that are in decent enough shape to do anything interesting are commanding top dollar. [RetroStack]’s obvious labor of love project provides the foundation upon which to build a brand new TRS-80 as close as possible to the original.

The PCB is revision G and recreates the original in every detail — component layout, connectors, silkscreen, and even trace routing. [RetroStack] even replicated obvious mistakes in the original board, like through-holes that were originally used to fixture the boards for stuffing, and some weird unused vias. There are even wrong components, or at least ones that appear on production assemblies that don’t show up in the schematics. And if you’re going to go through with a build, you’ll want to check out the collection of 3D printable parts that are otherwise unobtainium, such as the bracket for rear panel connectors and miscellaneous keyboard parts.

While we love the devotion to accuracy that [RetroStack] shows with this project, we know that not everyone is of a similar bent. Luckily there are emulators and clones you can build instead. And if you’re wondering why anyone would devote so much effort to half-century-old technology — well, when you know, you know.

Thanks to [Stephen Walters] for the tip.

Feature image: Dave Jones, CC BY-SA 4.0, via Wikimedia Commons

 

Cowgol Development Environment Comes To Z80 And CP/M

Cowgol on Z80 running CP/M ties together everything needed to provide a Cowgol development environment (including C and assembler) on a Z80 running the CP/M operating system, making it easier to get up and running with a language aimed to be small, bootstrapped, and modern.

Cowgol is an experimental modern language for (very) small systems.

The Zilog Z80 was an 8-bit microprocessor common in embedded systems of the 1970s and 1980s, and CP/M was a contemporary mass-market operating system. As for Cowgol? It’s an Ada-inspired compiler toolchain and programming language aimed at very small systems, such as the Z80.

What’s different about Cowgol is that it is intended to be self-hosted on these small systems; Cowgol is written in itself, and is able to compile itself. Once one has compiled the compiler for a particular target architecture (for example, the Z80) one could then use that compiler on the target system to compile and run programs for itself.

Thankfully, there’s no need to start from scratch. The Cowgol on Z80 running CP/M repository (see the first link of this post) contains the pre-compiled binaries and guidance on using them.

Cowgol is still under development, but it works. It is a modern language well-suited to (very) small systems, and thanks to this project, getting it up and running on a Z80 running CP/M is about as easy as such things can get.

Thanks to [feinfinger] for the tip!

Is Microsoft BASIC Hidden In This Educational Child’s Toy?

The VTech PreComputer 1000 is a rather ancient toy computer that was available in the distant misty past of 1988. It featured a keyboard and a variety of simple learning games, but does it also feature Microsoft BASIC? [Robin] of 8-Bit Show and Tell dove in to find out.

Officially, the PreComputer was programmable in a form of BASIC, referred to by VTech as PRE-BASIC V1.0. Given that the system has a Z80 CPU and there’s little information in the manual about this programming language, [Robin] was suspicious as to whether it was based on Microsoft BASIC-80. Thus, an examination was in order to figure out just how this BASIC implementation worked, and whether it shared anything with Microsoft’s own effort.

We won’t spoil the conclusions, but there are some strong commonalities between VTech’s BASIC and Microsoft’s version from this era. The variable names in particular are a strong hint as to what’s going on under the hood. The video is worth a watch for anyone that’s a fan of early microcomputer history, BASIC, or just the weird computer-like devices of yesteryear. We also love the idea that the PreComputer 1000 was actually quite a capable machine hiding behind a single-line LCD display.

Continue reading “Is Microsoft BASIC Hidden In This Educational Child’s Toy?”

How To Chase The Beam With A Z80

The more accomplished 8-bit microcomputers of the late 1970s and early 1980s had a dedicated display chip, a CRT controller. This took care of all the jobs associated with driving a CRT display, generating the required timing and sequencing all the dots to make a raster. With a CRT controller on hand the CPU had plenty of time to do other work, but on some cheaper machines there was no CRT controller and the processor had to do all the work of assembling the display itself.

[Dr. Matt Regan] had a Sinclair ZX81 which relied on this technique, and he’s put up the first of what will become a series of videos offering a deep dive into this method of creating video. The key to its operation lies in very careful use of timing, with operations executed to keep a consistent number of clock cycles per dot on the display. He’s making a very low resolution version of the display in the first video, which he manages to do with only an EPROM and a couple of 74 logic chips alongside the Z80. We’re particularly impressed with the means of creating the sync pulses, using opcodes carefully chosen to do nothing of substance except setting a particular bit.

This method of assembling a display on such a relatively slow microprocessor has the drawback of no means of creating a grayscale, and of course it’s only available in glorious black and white. But it’s the system which gave a first experience of computing to millions, and for that we find the video fascinating. Take a look, below the break.

If this has caused you to yearn for all things Sinclair, read our tribute to the man himself.

Continue reading “How To Chase The Beam With A Z80”