H89 Emulator - The Virtual H89 All-in-One Computer

This page covers my Heathkit H89 emulator written in C++. There is a second online H89 emulator written in JavaScript.

Source has been released on github: VirtualH89.

Video clip of the Emulator

A quick little clip of the emulator running the snake game:

A longer clip of the emulator captured directly on the computer, showing the boot process and a short game of gravitron:

Goals

  • To work with both CP/M, HDOS, and UCSD Pascal.
  • Clock accurate emulation of the entire system. (Be able to play fast-action graphic games). Option to run emulator at 'max speed'.
  • Emulation of the H19 Terminal functions (including accurate character and graphic representation). Accurate baud rate between the computer and terminal.
  • Be able to select hardware options of the system, i.e. amount of memory, which ROM, which controllers, add-on disk drive systems.
  • Portable to a wide-range of the platforms (Windows, Linux, Mac, etc.).
  • Written in C++.

Status - Source has been uploaded to GitHub - VirtualH89

Currently runs on Mac OS and Linux.

Development is currently paused.

 Virtual H89 Operating System Status Table

OS Status Comments
HDOS 1.0
(Issue #50.00.00 890-1)
Unknown The disk I had with this title had apparently been overwritten by a previous owner. I do not have a copy of this software to test.
HDOS 1.0
(Issue #50.03.00 890-1-3)
Boots This release of version 1.0 supports the 8250 serial port and currently boots on the emulator. No obvious problems.
HDOS 1.5
(Issue #50.04.00 890-1-4)
Boots No obvious problems.
HDOS 1.6
(Issue #50.05.00 890-1-5)
Boots No obvious problems.
HDOS 2.0
(Issue #50.06.00 890-64)
Boots No obvious problems. Writing works. INIT is now working.
HDOS 3.02
(Issue #50.07.00)
Boots A hard-sectored HDOS 3.02 boot disk was located by Les Bird. This disk image boots without any obvious problems.
CP/M 2.2.02 Boots No obvious problems. Writing appears to work. DUP works. FORMAT works. SYSGEN appears to work.
CP/M 2.2.03 Boots The CONFIGUR.COM program now correctly auto-detects the virtual floppy drives, there was 2 flags in the H17 status register that needed to be set. FORMAT works.
CP/M 2.2.04 Boots Configur.com and the extra 'Setup' Disk correctly detects the virtual disk drives, but when generating the boot disk, it adds support for the H47. Need to determine why. DUP works. FORMAT works. SYSGEN appears to work.
UCSD Pascal Boots The image I have only supports 2 floppies, so I had to modify the source to have only 2 disks, to allow it to boot.

 

H89 Screen dump

H89 Screen dump

H89 Screen dump

More screenshots below.

  • Z80 Emulation selection (done)
    • Examined both z80pack and yaze-ag. Both are good, but z80pack provides the option to run at a given speed.
    • Started with z80pack.
      • Encapsulated the Z80 emulation into a new C++ class (done).
      • Added support for interrupt mode 0 (done - only supports RST xx instructions).
      • Updated the code to have accurate flag handling on some of the rarely used instructions. (done - documented behavior appears complete and accurate)
      • Abstracted the memory / address bus (done)
      • Added support for more 'undocumented' opcodes as defined in "The Undocumented Z80 Documented". (done)
  • Phase 1 (Done)
    • Support for both ROM and RAM objects are implemented(done)
      • The Monitor ROM (MTR-90-1) is running.
    • 2 ms timer works (done).
      • Changed the way the accurate clock emulation was coded, it now uses an interval timer instead of sleep() calls. (The existing code did not appear to take into account the amount of time executing instructions. Although on a current computer, this time was < 3% with the generic CP/M system z80pack provides. This could be a problem on slower systems or as more code is added for the emulator.)
      • Interrupts are working. 
      • A 2 mSec timer works on Linux and Leopard (10.5.x), but not on Tiger (10.4.x) (done).
        • A redesign would be needed to work on systems that only support a 10 mSec timer, this currently is low priority. (may not implement).
    • Basic 8250 Serial port support (done).
      • Very rudimentary support for the 8250 is complete. Input and output of characters work. But further work is needed to fully implement the 8250 into a C++ class.
      • Add support for baud rate selection/detection, mismatches between terminal/computer and the 'spaces' baud selection in HDOS(done)
  • Phases 2/3 (In progress)
    • Implementing the H-88-1 (Hard-sectored controller). Found the H17 ROM listing, which helps.
      • The Disk rotational speed test (Go 7372) is working(done)
      • Boot (done)
        • HDOS (done).
          • 1.0 - one of two 1.0 versions is working.
            • 890-1 Don't have a copy of this version to test with
            • 890-1-3 Version supporting 8250 serial port working
          • 1.5 working
          • 1.6 working
          • 2.0 working
          • 3.02 working
        • CP/M (done)
          • 2.2.02 working
          • 2.2.03 working
          • 2.2.04 working
      • Writing(done)
        • Writing to images that have already been FORMATed (CP/M) or INITed (HDOS) is working.
          • the changes to the disk  last while the program is running, and are written out to a new file. 
        • FORMAT(cp/m) and INIT(hdos) are now working. 
      • Saving Disk Images(done)
        • Currently saving disk image to a new file (raw format .h17raw) - working.
    • The Z-89-37 - soft-sectored controller (working)
    • The Z-89-47 - 8" controller (Delayed to a later phase)
    • The Z-89-67 - Winchester controller (Delayed to a later phase)
    • Working on H19 emulation from phase 3.
      • Accurate font (imported from ROM - done)
      • Accurate speed - 9600 baud (done)
      • Rendered in OpenGL, basic rendering, graphic symbols, reverse video (done
      • Design H19 class to emulate terminal (done)
      • Complete emulation of Serial Port 8250 chip (partially done).
      • Complete H19 processing of all Heathkit ESC sequences (done)
      • Handling of ANSI ESC Sequences (Delayed to a later phase)
      • H19 emulation will likely change from implementing ESC sequences in C++ to fully emulate the H19, with a Z80 and ROM.
  • Phase 4 (Done - Implemented with config file)
    • Users can select which controllers, which drives, amount of RAM, and which which ROM is used
  • Phase 5+ (Not yet started)

Future Plans

Note: further development of this emulator is currently pause.

  • Phase 5 - Add-on cards
    • Full support for HA-88-3 Serial card.
      • Connect a port to a physical USB->Serial on host.
      • Connect to other virtual devices (other virtual H89s, Votrax Talk-n-type, printer, modem, etc).
    • Support for Z-89-11 Parallel card
    • Add real floppy drive sounds for seek and read/write operations.
    • Support H-88-5 Cassette Interface card/Virtual tape drive
      • (real tape sound - be able to read/write audio files).
    • Third-party add-in cards
      • Graphics
        • Cleveland Codonics
        • New Orleans General Data Services (NOGDS).
        • Northwest Digital Systems - Graphics Plus GP-19.
        • SigmaSoft
      • Sound
      • Memory >64k (memory banks)
        • Magnolia Microsystems 128K RAM
        • DG Super 89 (Up to 256k)
        • CDR 1M add-on card
    • Peripherals 
      • Printers - write to PDF file or directly to a printer
        • H14 Printer, accurate symbols
        • H25
      • Modems
        • WH13
        • WH23
        • WH33
        • Be able to connect to the host computer to transfer files.
        • Selectable baud rates.
      • Votrax Talk-n-Type
      • Sweet-P Plotter
  • Phase 6 - Graphic front-end
    • Option to make it look like you are sitting in front of a real H89 system.
    • Option for accurate screen - flicker, curved tube, tube persistence.. 
  • Phase x - anything that has been pushed out.
  • Phase y - Emulate an H8 computer
    • H9 Terminal
    • H10 Paper Tape
    • Cassette Tape storage
    • H19 Terminal (should be very little change from the H89 code)
    • H29 Terminal
    • H17 Floppy (should be very little change from the H89 code)

Additional Screen dumps of CP/M booting on the virtual H89. All CP/M versions are now correctly autodetecting the 3 (virtual) disk drives.

H89 Screen dump - CP/M 2.2.02

H89 Screen dump - CP/M 2.2.03

H89 Screen dump - CP/M 2.2.04

H89 Screen dump - CP/M Setup Disk

Last Modified: Sunday, 25-Feb-2024 22:36:36 PST

Contact Details

Mark Garlanger

Email: heathkit [at] garlanger [dot] com

If you email me, PLEASE check your spam filter for any responses.

Website: www.garlanger.com

Social

About

This site is dedicated to preserving the history of the original Heathkit computers. This includes the 8-bit H-8 and 16-bit H-11 systems, released in 1977, and the 8-bit H89 which was released in 1979.