YAZE-AG on macOS

YAZE-AG is a Z80 and CP/M emulator, as is z80pack. On another page I’ve described setting up and using z80pack on macOS. However, z80pack lacks good support for serial ports as far as I can tell. An alternative is to use YAZE-AG.

YAZE-AG has a similar aim to z80pack. They have their strengths and weaknesses – I recommend you try both of them to see which one suits you better. For example, z80pack has a command-line switch for the speed of the emulated machine, but YAZE-AG always runs “flat out” which feels a bit strange if you’re used to using a real Z80 system. However, YAZE-AG has much better support for serial ports.

To build YAZE-AG on macOS you’ll need to tweak the build files a little, but it’s not too complicated. This process works for me. Note that you’ll need to have the macOS command-line development tools already installed.

Start with www.mathematik.uni-ulm.de/users/ag/yaze/ and download the sources so that you have yaze-ag-2.40.5_with_keytrans.tar.gz

$ tar -xf Downloads/yaze-ag-2.40.5_with_keytrans.tar.gz 
$ cd yaze-ag-2.40.5_with_keytrans
$ cp Makefile_freebsd Makefile

Note that I prefer to install things into $HOME/local instead of /usr/local where possible, it makes it easier to manage the system and avoid using root access.

Edit Makefile and make these changes:

  • Replace all 3 instances of /usr/local to ${HOME}/local
  • In the OPTIMIZE variable, change pentium3 to core2 (or maybe something better depending on your target CPU, e.g. athlon64.  In my case I simply commented out line 48 and uncommented line 59. )
  • change md5sum -b to md5

Edit cdm.c and change:

  • At line 233, caddr_t cp becomes void *cp
  • At line 286, (caddr_t)-1 becomes MAP_FAILED

Edit yaze.sh and change:

  • /usr/local to $HOME/local (4 occurrences)
$ make
$ mkdir -p ${HOME}/local/bin
$ make install

The second line above shouldn’t really be needed, but without it the make install will fail.

To run:

$ export PATH=$PATH:$HOME/local/bin
$ cpm

The first time you run this, a new ‘cpm’ subdirectory is created and then a bunch of virtual disks (files with .ydsk extension) are unzipped into that directory, plus a large pile of documentation.

You’ll eventually get a CPM prompt (“A>”), and will have several virtual drives mounted. For example, M: is a bunch of Modula-2 stuff. YAZE-AG bundles some interesting CP/M software in the installed system, it’s worth exploring what is there.

Also, the startup sequence lets you know that to exit the emulator you should use the “e” command, plus some other useful hints.

Older versions of macOS and/or XCode

It has been pointed out to me that some older versions of macOS (or OSX) and/or Xcode will fail to compile Yaze with the above instructions. If this happens to you, edit file simz80.pl (the Perl script that generates simz80.c), and at line 1332 add the following line:

FASTREG tmp2;

Once that’s done, do the usual “make” etc.