• Please review our updated Terms and Rules here

MCLZ8 - Zilog Z80 Emulator in TRS-80 Model III

MicroCoreLabs

Experienced Member
Joined
Feb 12, 2016
Messages
273
I wanted to share my latest project, the MCLZ8, which is a Zilog Z80 emulator which can be used as a drop-in replacement for the original Z80.

My Wordpress blog can be found here: MCLZ8 Link

For now, the MCLZ8 is running as a cycle-accurate Zilog Z80; however the next (fun) step will be to start integrating stuff like the TRS-80's RAM and ROMS and running/caching them at the full speed of the 800Mhz Teensy microcontroller to see just how fast we can make this TRS-80 Model III, and see how it compares to the the accelerators which were available back in those days!

Thanks,
-Ted
 
Looks fun and useful -- very nice. I take it the Z-80 core is implemented in C like your 6502 versions?

Besides the keyboard and display there is a third memory mapped device on the Model III. The printer port can be accessed at $37E8 and $37E9. Those memory locations near the end of the ROM are aliases for I/O port $F8 for compatibility with the Model 1. Bit of a special case if you are caching ROM data.
 
Yep, MCLZ8 also written in C.

I will look out for those addresses, thanks.

Preliminary results indicate that the MCLZ8 is more than 15 times faster than the stock Z80 in the TRS-80 Model III... I will make a video demo sometime soon.
 
How different is the model 4? I have two that I'd love to accelerate.
Is there any ability to switch on/off acceleration? I suspect some games would be unplayable accelerated.
Perhaps an otherwise unused op-code/instruction? (does anyone ever use HALT? ;-)
 
Hmm.. I think model 4 just runs at a faster clock speed, so the MCLZ8 should able to handle it, but I would need to give it a try.

Yes, Im exploring ideas for enabling/disabling the levels of acceleration... Maybe snoop writes to a particular memory/IO address to change the acceleration mode. But for now I am using USB/UART accesses to the Teensy to change the mode. Snooping keystrokes is another idea...
 
Yes, except for the BUSREQ/BUSACK signals the MCLZ8 is drop-in compatible to any Z80 socket. Probably up to 5Mhz...
 
Last edited:
Hmm.. I think model 4 just runs at a faster clock speed, so the MCLZ8 should able to handle it, but I would need to give it a try.

Yes, Im exploring ideas for enabling/disabling the levels of acceleration... Maybe snoop writes to a particular memory/IO address to change the acceleration mode. But for now I am using USB/UART accesses to the Teensy to change the mode. Snooping keystrokes is another idea...
At boot the Model 4 runs the same speed as the Model III. Setting bit 6 of port $EC will switch it to double-speed (a little over 4 MHz) mode. It can also change memory maps via port $84. Lower 2 bits of those port addresses are "don't care" so $EC, $ED, $EE, $EF are all valid for $EC. The different memory maps will swap out the ROM and swap out or move the keyboard and video RAM. One mode gives a full 64K RAM and a second 64K bank of memory can be accessed in 32K chunks.

Original speedup boards had various different I/O ports so emulating one of those could give some leverage. Check out the SDL2TRS source code. One that comes to mind is the Seatronics board which uses the top two bits of $EC in a compatible fashion - 00 for 2 MHz, 01 for 4 Mhz, 10 for 5 MHz and 11 for 8 MHz.

But for your purposes an I/O port in the lower end of the range should be fine. Say port 30 (hex $1E) which doesn't conflict with anything I know about including the modern TRS-IO expansion board which uses port 31.
 
Back
Top