Giter Site home page Giter Site logo

z80-mbc2-emu's Introduction

z80-mbc2-emu -- Z80-MBC2 emulator

What is this?

This is an emulator to run the ROM and disk images prepared for the Just4Fun's Z80-MBC2. The Z80-MBC2 is an easy to build Z80 single board computer with just 4 ICs. See Z80-MBC2: a 4 ICs homebrew Z80 computer. This emulator can be used to test the SD content on a Linux, MacOS or Windows computer.

What it does?

The emulator is based on the S220718-R240620 version of the Z80-MBC2 firmware. It can run Forth, CP/M 2.2, QP/M 2.71, CP/M 3.0, UCSD Pascal and Collapse OS.

Installation

Extract the latest zip for Linux, MacOS or Windows.

The Z80-MBC2 SD contents must be extraced to a directory named sd. You can run download.sh or download.bat to automatically download and extract the files from https://cdn.hackaday.io/files/1599736844284832/SD-S220718-R290823-v2.zip .

Usage

To list the boot options available, execute z80-mbc2-emu without parameters:

$ ./z80-mbc2-emu 
Usage: z80-mbc2-emu IMAGE
  IMAGE can be:

    basic for Basic using sd/basic47.bin
    forth for Forth using sd/forth13.bin
    autoboot for Autoboot using sd/autoboot.bin
    cpm22 for CP/M 2.2 using sd/cpm22.bin
    qpm for QP/M 2.71 using sd/QPMLDR.BIN
    cpm3 for CP/M 3.0 using sd/CPMLDR.COM
    pascal for UCSD Pascal using sd/ucsdldr.bin
    collapse for Collapse OS using sd/cos.bin
    fuzix for Fuzix OS using sd/fuzix.bin

Download the images from https://cdn.hackaday.io/files/1599736844284832/S220718-R240620_IOS-Z80-MBC2.zip into the 'sd' directory.

To boot any of the available environments, execute z80_mbc2_emu with the code of the environment. For example:

$ ./z80-mbc2-emu cpm22
z80-mbc2-emu https://github.com/ivanizag/iz-cpm
Emulation of the Z80-MBC2, https://hackaday.io/project/159973

Press ctrl-c to return to host


Z80-MBC2 CP/M 2.2 BIOS - S030818-R140319
CP/M 2.2 Copyright 1979 (c) by Digital Research

A>DIR
A: ASCIART  BAS : ASM      COM : AUTOEXEC SUB : AUTOEXEC TXT
A: D        COM : DDT      COM : DUMP     COM : ED       COM
A: GENHEX   COM : GPELED   BAS : GPIO     BAS : HELLO    ASM
A: HELLO    COM : LOAD     COM : MAC      COM : MBASIC   COM
A: MBASIC85 COM : PEG      COM : PIP      COM : RTC      BAS
A: STARTREK BAS : STAT     COM : SUBMIT   COM : TREKINST BAS
A: USERLED  BAS : XMODEM   CFG : XMODEM   COM : XSUB     COM
A: ZDE16    COM : ZDENST16 COM
A>

Press control-c to exit the emulation.

How does it work?

The Z80-MBC2 has a clever design based on a Z80 and a memory IC, both controlled by an Atmega microcontroller. The Atmega is able to put bytes on the data bus and can inject content to the RAM IC by generating code on the fly. It can also respond to IN and OUT ports with 1 bit adressing. It uses that as the interface with the Z80 programs. Via this interface it provides services related with the serial port, the SD card storage, the real time clock, the user led and button, and the GPIO.

This emulator emulates the Z80 and provides the same services given by the Atmega using the same IN and OUT ports. Instead of the serial port, it uses the terminal. Instead of the SD, it uses a directory named sd with the same contents.

TODO

  • Change the way to exit to host to allow control-c to be used on the emulation.
  • User led, button and GPIO are not connected to anything
  • Save the printer output to a file
  • Tick based interrupts

z80-mbc2-emu's People

Contributors

ivanizag avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

z80-mbc2-emu's Issues

Not really a bug

I was quite happy to see this project, as it helped me to confirm a problem on the MBC2 distribution. The version of mbasic.com distributed has long been suspect - and when I ran it on your emulator, it trapped out immediately with "not implemented" instructions. This is due to what appears to be a modified mbasic.com, vs the version on http://www.retroarchive.org/cpm/lang/lang.htm (version 5.21, that is).

Thank you for making a faithful reproduction, and it came up easily. Much appreciated!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.