2024-12-02 08:14:18 +01:00
|
|
|
**NOTE:** This is a fork of [cburbridge's Z80 python emulator on GitHub](https://github.com/cburbridge/z80)
|
|
|
|
|
2014-08-29 23:48:33 +02:00
|
|
|
## Z80 CPU Emulator
|
|
|
|
|
|
|
|
This is a Zilog Z80 CPU emulator, written in Python.
|
2014-08-29 23:52:25 +02:00
|
|
|
It runs a 1978 Microsoft Basic 4.7 ROM taken from [Grant Searle's Z80 SBC project](http://searle.hostei.com/grant/z80/SimpleZ80.html)
|
2014-08-29 23:48:33 +02:00
|
|
|
|
|
|
|
### Why?
|
|
|
|
Just for fun. I like the Z80 CPU - it was in many devices I played with as a
|
|
|
|
kid.
|
|
|
|
|
|
|
|
### Is it useful?
|
|
|
|
No. It runs really slowly, and is a completely non-optimal software design for
|
|
|
|
an emulator, but (in my opinion) the code is readable. If you want a CPU emulator,
|
|
|
|
probably don't use Python. That said, an optimised python coded emulator could run
|
|
|
|
a lot faster than this :-)
|
|
|
|
|
|
|
|
### Running
|
2014-08-29 23:53:45 +02:00
|
|
|
BASIC:
|
2014-08-29 23:48:33 +02:00
|
|
|
```
|
|
|
|
cd src
|
|
|
|
python z80sbc.py
|
|
|
|
```
|
|
|
|
Unit tests:
|
|
|
|
```
|
|
|
|
cd src
|
|
|
|
PYTHONPATH=`pwd`:$PYTHONPATH python ../tests/test_z80.py
|
|
|
|
PYTHONPATH=`pwd`:$PYTHONPATH python ../tests/test_registers.py
|
|
|
|
```
|
|
|
|
|
|
|
|
Fuse tests:
|
|
|
|
```
|
|
|
|
cd src
|
|
|
|
PYTHONPATH=`pwd`:$PYTHONPATH python ../fuse_tests/tests.py
|
|
|
|
```
|
|
|
|
|
|
|
|
### Missing and todo
|
2014-08-29 23:53:45 +02:00
|
|
|
- Most undocumented opcodes
|
|
|
|
- Undocumented flags for `CPI` and `CPIR`.
|
2014-08-29 23:48:33 +02:00
|
|
|
|
|
|
|
### Credits
|
2014-08-29 23:53:45 +02:00
|
|
|
|
2014-08-29 23:52:25 +02:00
|
|
|
[Grant Searle's Z80 SBC project](http://searle.hostei.com/grant/z80/SimpleZ80.html)
|
2014-08-29 23:53:45 +02:00
|
|
|
|
2014-08-29 23:52:25 +02:00
|
|
|
[FUSE - Free Unix Spectrum Emulator](http://fuse-emulator.sourceforge.net/) for the instruction set tests
|
2014-08-29 23:48:33 +02:00
|
|
|
|
|
|
|
### License
|
2014-08-29 23:52:25 +02:00
|
|
|
Public domain; do what you like.
|