ZX81 emulator written in TypeScript (transcompilation)
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Documents
Programs
zx81-typescript-emulator
.gitignore
HISTORY.md
LICENSE
NOTICE.md
README.md

README.md

ZX81 Emulator written in Typescript

Sinclair ZX81

The Sinclair ZX81 was my first computer, in 1982. It is one of those home computers very popular in the '80s and affordable (£49.95 in kit). Other very popular computers were the Commodore 64 and the Apple II but were far more expensive. The successor of the ZX81 was the ZX Spectrum.

ZX81

The ZX81 computer was based on a 8-bit processor (Z80A from Zilog or µPD780C from NEC) at 3.5 MHz with 1 KiB of RAM and 8 KiB of ROM. It was possible the buy a RAM extension (I had a 16 KiB one).

The characters set was not based on ASCII but was custom and includes only capital letters. It includes also some graphic characters:

CharactersSet.

Using these characters, it was possible to make some graphics but it was very limited (64x48). Using some tricks (and sometimes some hardware modifications), it was possible to achieve (more or less) 256x192 (more or less because it was not possible to get all pixel combinations per line).

Motivation

I wanted to learn Typescript and thus, I was looking for a project not too small (not just an example), but also not too big. I find also interresting to explore the question of how to transform a Java applet into a pure HTML5/Javascript program.

I find a HTML5/Javascript ZX81 emulator made by Simon Holdsworth, but I found only a minification version, so it was not usable. However, on the same page, there is also a Java version. So I took this Java application as a starting point.

Objectives

These are my objectives for this project:

  • Find a way to transform automatically Java code into Typescript. The Z80 emulation code is too big to be translated manually.
  • Use the latest version of Typescript but at the same time, be able to run on all major Internet browsers (i.e. be compatible with Javascript ECMAScript 5).
  • Use the latest version of Webpack.
  • Use Promise, fetch, async and await syntax.

Current status

Currently, all the objectives are fullfiled except those:

  • There are still some Javascript code, in particular for Webpack configuration.
  • The keyboard does not always display properly on iPad.

Game

I found one of my first applications: a game I build in 1985. Texts were in French and I have translated them in English.

It is written with a mix of BASIC (to display the menu, the rules of the game, etc) and Z80 assembly code (for the game itself).

Want to try the game and the emulator? It is available at the following address: www.andrivet.com/static/ZX81/:

FACTORY

Use q and a keys to move the left character, p and l to move the right one, and j to abandon. In the menu, if you choose item 5, you will exit the game and play with the ZX81 emulator. The original manual Sinclair ZX81 BASIC Programming is available.

Files

Folder Description
Documents Contains some documents related to ZX81, such as the original manual Sinclair ZX81 BASIC Programming, the Z80 CPU User document, etc.
Emulator The Typescript emulator
Programs The FACTORY game in English, USINE in French and their sources in text format.

Credits et Copyrights

Note: A full list of components used by the emulator can be found in NOTICE.md.

  • ZX81 Emulator written in Typescript Copyright © 2017 Sebastien Andrivet.
  • FACTORY and USINE games Copyright © 1985-2017 Sebastien Andrivet.

This emulator is based on these software:

License

The emulator code is released under GNU General Public License version 3 (GPLv3). Components are released under their respective licenses.