A browser-based emulator for Zeal 8-bit Computer

Overview

Zeal 8-bit Computer emulator

screenshot Licence

This project is a software emulator for Zeal 8-bit Computer: a homebrew 8-bit computer based on a Z80 CPU.

Click here for a live demo

Why this project?

The goal of this project is to reproduce the exact same behavior of the real machine, in order to be able to execute and mainly debug the programs written for it directly from a host computer, without the need to flash any EEPROM or NOR Flash in order to test it. This makes development and test cycles much faster and more convenient.

Why a web-based emulator ? (HTML/CSS/JavaScript)

The main goal is to integrate this emulator as part of zeal8bit.com website. Thus, choosing HTML/CSS and Javascript was a bit obvious on this side.

On the other side, another goal of this project is also to let anybody test or write programs for Zeal 8-bit Computer on any platform (Linux/Windows/Mac OS X) without the need of a toolchain installed.

The emulator has been tested on Opera and Google Chrome.

What about performance then?

The emulator is slower than the real hardware, even though the real hardware is using a Z80 running at 10MHz. This is due to the overhead of Javascript itself and the web browser itself. But as I said above, the main feature this was made for is debugging programs and for this, there is no doubt it is efficient.

Moreover, the emulator is not really accurate it terms of timings, more details below, in the features section.

Writing a native emulator in C (w/ SDL) would cover the requirement of a full-speed emulator, which would be more accurate in terms of timings. However, this needs some time investment. Feel free to contact me or contribute if such project interest you.

Features

Currently, the following features from Zeal 8-bit Computer are emulated:

  • Z80 CPU (thanks to Molly Howell)
  • 22-bit MMU
  • 256KB ROM
  • 512KB RAM
  • Video chip: 640x480 text mode w/ colors, 640x480 graphic mode w/ colors
  • PS/2 Keyboard, with interrupts

Features of the emulator itself implemented:

  • Debugger: breakpoints, step, step over instruction, continue until next breakpoint
  • Load a binary file, loaded into ROM directly
  • Load a dump file generated from z88dk-dis to view assembly code while doing step by step debugging
  • Set breakpoints with either a hexadecimal PC address or a symbol (from the dump file)
  • View memory content when doing step by step debugging

TODO

Of course a lot of things are still remaining to do. On the emulation side:

  • PIO: complete the implementation for the user port (A) to act as a regular GPIO, and system port (port B) to activate/deactivate the interrupts, the H-blank, V-blank, I2C, UART, etc...
  • UART emulation (needs PIO port B)
  • I2C 32KB EEPROM emulation (needs PIO port B)
  • I2C RTC (needs PIO port B)
  • Sound support¹
  • SD Card emulation²
  • Video chip: 320x240 text mode, 320x240 graphic mode², sprites², 4-bit palettes², etc...

¹: feature that may be modified on the real hardware.

²: features not in high priority as they have not been implemented on real hardware yet.

On the project/debugger side itself:

  • A better interface for the debugger's buttons, with some shortcuts
  • A better way to parse breakpoint input. A know bug is providing a label starting hex letters would be interpreted as a PC value instead of a label. For example, inputting date_routine as a label to break in would result in the addition of a breakpoint at address 0xda instead of the address of label date_routine (because date starts with hex letters da)
  • Refactoring. Some part of the code, mainly in zeal.js are a bit dirty in the sense that several different things are managed by this file: breakpoints, disassembly view, memory viewer, Zeal emulation, etc... It should be cleaned and split up between multiple files.
  • A disassembler! Today, the disassembler view only takes the disassembly from a file generated by z88dk-dis toolchain. A much better (or complementary) way is to disassemble the instructions on the fly and show them in the disassembly view at the bottom of the screen.
  • An integrated code editor with an assembler! In the (far?) future, integrating a code editor, ideally CodeMirror, would be a very nice addition. It would let anyone write code, assemble it, inject it in the emulator and test it directly. No need to have a toolchain, or an assembler installed. Everything would be available directly from the browser. It would also be possible to connect the debugger to the code editor in order to be able to debug the code written more easily.

Contributing

Anyone can contribute to this project, contributions are welcome!

Feel free to fix any bug that you may see or encounter, implement any feature that is present in the TODO list or a new one that you find useful or important.

To contribute:

  • Fork the Project
  • Create your feature Branch (optional)
  • Commit your changes. Please make a clear and concise commit message (*)
  • Push to the branch
  • Open a Pull Request

(*) A good commit message is as follow:

Module: add/fix/remove a from b

Explanation on what/how/why

For example:

Video chip: implement 320x240 text-mode

It is now possible to switch to 320x240 text-mode and display text.

License

Z80.js file is distributed under the MIT licence (originated from Molly Howell repository: https://github.com/DrGoldfire/Z80.js)

All the other files are distributed under the Apache 2.0 License. See LICENSE file for more information.

You are free to use it for personal and commercial use, the boilerplate present in each file must not be removed.

Contact

For any suggestion or request, you can contact me at contact [at] zeal8bit [dot] com

For features requests, you can also open an issue or a pull request.

You might also like...

A web-based 3D visualization tool for 3D computer vision.

A web-based 3D visualization tool for 3D computer vision.

Wis3D: A web-based 3D visualization tool for 3D computer vision Online Demo | Installation | Tutorial | Documentation Wis3D is a web-based 3D visualiz

Dec 27, 2022

Converts your IPv4 address to a 4x4 2-bit PNG which you can extract the IP from.

Converts your IPv4 address to a 4x4 2-bit PNG which you can extract the IP from.

IP-to-PNG Converts your IPv4 address to a 4x4 2-bit PNG which you can extract the IP from. https://www.npmjs.com/package/ip2png Run npm install ip2png

Nov 30, 2022

Papers from the computer science community to read and discuss.

Papers We Love (PWL) is a community built around reading, discussing and learning more about academic computer science papers. This repository serves

Dec 31, 2022

An interpreter for College Board's specified pseudocode for the AP Computer Science Principles Exam.

College Board Pseudocode Interpreter A playground for this interpreter is up on my website. This project is a mostly-functioning interpreter for Colle

Nov 16, 2022

The ICPverse service to extract the metadata from an existing NFT project on the Internet Computer.

Infinity_Rank The ICPverse service to extract the metadata from an existing NFT project on the Internet Computer. Requirements for Use: npm installed

Nov 5, 2022

Scans your computer for node modules that are potentially vulnerable to supply chain attacks

Scans your computer for node modules that are potentially vulnerable to supply chain attacks

Scans your computer for node modules that are potentially vulnerable to supply chain attacks. You still need to review the code of modules that are not vulnerable, but this helps.

Apr 11, 2022

PEARL (Planetary Computer Land Cover Mapping) Platform API and Infrastructure

PEARL (Planetary Computer Land Cover Mapping) Platform API and Infrastructure

PEARL API & Infrastructure PEARL is a landcover mapping platform that uses human in the loop machine learning approach. This repository contains the A

Dec 23, 2022

API4AI is cloud-native computer vision & AI platform for startups, enterprises and individual developers

API4AI is cloud-native computer vision & AI platform for startups, enterprises and individual developers

API4AI is cloud-native computer vision & AI platform for startups, enterprises and individual developers. This repository contains sample mini apps that utilize Brand Recognition API provided by API4AI.

May 24, 2022

Open-source NFID SDK for Internet Identity, a blockchain authentication system for the Internet Computer.

Open-source NFID SDK for Internet Identity, a blockchain authentication system for the Internet Computer.

NFID-SDK is an open source software development kit that contains examples and packages for developers to integrate NFID into your application

Dec 23, 2022
Owner
Zeal 8-bit
In the process of making an 8-bit computer from scratch, based on the awesome Z80 processor Follow my progress on Youtube: http://youtube.zeal8bit.com
Zeal 8-bit
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
jQuery Terminal Emulator - JavaScript library for creating web-based terminals with custom commands

JavaScript Library for Web Based Terminal Emulators Summary jQuery Terminal Emulator is a plugin for creating command line interpreters in your applic

Jakub T. Jankiewicz 2.8k Jan 1, 2023
🕹 GBA emulator on your React project - easy and powerful to use!

GBA emulator on your React project - easy and powerful to use! Just three steps to set it up ✨ 1 - Apply GbaProvider import { GbaProvider } from 'reac

Bruno Macabeus 43 Dec 23, 2022
A Chip-8 Emulator written in javascript

Chippy A Chip-8 Emulator written in javascript Live DEMO Features Display Controls CPU Controls Sound Controls Rom Selection Debug Features Register D

Kenneth Lamb 4 Jun 15, 2022
A chip8 and super chip8 emulator.

(s)chip8 Emulator CHIP-8 是一种解释型编程语言,由 Joseph Weisbecker 开发。它最初用于 COSMAC VIP 和 Telmac 1800 8 位微型计算机在 70 年代中期。CHIP-8 程序在一个 CHIP-8 虚拟机上运行。它的问世是为了让电子游戏更容易

daief 2 Jun 13, 2022
INeedHelp is a Game Boy, Game Boy Advance, and Nintendo DS emulator written in JavaScript and TypeScript.

INeedHelp INeedHelp is a Game Boy Advance and Nintendo DS emulator written in JavaScript/TypeScript. FAQ Why is it called INeedHelp? You would need he

Powerlated 6 Jun 29, 2022
Multithread emulator. The wrun allows you to dynamically run a function inside a Web Worker on the client side, without the needing of a dedicated file

wrun This lib allows you to dynamically run a function inside a Web Worker on the client side, without the needing of a dedicated file. This means tha

Felippe Regazio 9 Nov 5, 2022
The new BASIC computer that runs in your browser!

atto The new BASIC computer that runs in your browser! Try it live: jamesl.me/atto What is atto? atto is a virtual fantasy computer system that's desi

James Livesey 34 Dec 29, 2022
Easiest 1-click way to install and use Stable Diffusion on your own computer. Provides a browser UI for generating images from text prompts and images. Just enter your text prompt, and see the generated image.

Stable Diffusion UI Easiest way to install and use Stable Diffusion on your own computer. No dependencies or technical knowledge required. 1-click ins

null 3.5k Dec 30, 2022