Dragon/CoCO emulator written in Python
DragonPy is a Open source (GPL v3 or later) emulator for the old (1981) homecomputer Dragon 32 and Tandy TRS-80 Color Computer (CoCo)...
The MC6809 project is used to emulate the 6809 CPU.
Dragon 32 with CPython 3 under Linux:
Tandy TRS-80 Color Computer 2b with CPython 2 under Windows:
(Note: Python 2 support was removed)
DragonPy is written in Python. It's platform independent and runs with Python and PyPy under Linux/Windows/OSX/... It's tested with Python 3.x, PyPy
DragonPy will not be a second XRoar written in Python. This project is primarily to lean and understand.
Future goals are:
- Implement a integrated development environment for BASIC programs
A full featured Dragon / CoCo emulator is XRoar.
Current state
The Dragon 32 / 64 and CoCo ROMs works in Text mode. Also the "single board computer" ROMs sbc09, Simple6809 and Multicomp6809 works well.
There is a rudimentary BASIC editor with save/load BASIC programm listings direct into RAM.
Looks like this:
Vectrex
The Vectrex (Wikipedia) is a vector display-based video game console. The Hardware are only the 6809 CPU, a 6522 Versatile Interface Adapter and the AY-3-8912 sound chip.
Current state is completely not usable. The 6522 is only a dummy implementation. It makes only sense to display some trace lines, e.g.:
.../DragonPy$ poetry run DragonPy --verbosity 0 --machine=Vectrex run --trace --max_ops=1
BASIC Editor
Use "BASIC editor / open" in the main menu to open the editor.
You can load/save ASCII .bas files from you local drive or just type a BASIC listing ;) With "inject into DragonPy" you send the current listing from the Editor to the Emulator and with "load from DragonPy" back from emulator to editor. Note: The is currently no "warning" that un-saved content will be "overwritten" and there is no "auto-backup" ;)
The "renumbering" tool can be found in the editor window under "tools"
You can also run the BASIC Editor without the Emulator:
.../DragonPy$ make editor
# or:
.../DragonPy$ poetry run DragonPy editor
A rudimentary BASIC source code highlighting is available and looks like this:
Special feature: The Line number that are used in GOTO, SOGUB etc. are extra marked on the left side.
installation
IMPORTANT: The PyPi package name is DragonPyEmulator and not only "DragonPy"!!!
pip install DragonPyEmulator
from source
~$ cd DragonPy/
~/DragonPy$ ./cli.py --help
The output of ./cli.py --help looks like:
usage: ./cli.py [-h] {download-roms,editor,gui,log-list,run,version}
+- options ----------------------------------------------------------------------+
| -h, --help show this help message and exit |
+--------------------------------------------------------------------------------+
+- subcommands ------------------------------------------------------------------+
| (required) |
| * download-roms Download/Test only ROM files |
| * editor Run only the BASIC editor |
| * gui <<< **start this** - Start the DragonPy tkinter starter GUI |
| * log-list List all exiting loggers and exit. |
| * run Run a machine emulation |
| * version Print version and exit |
+--------------------------------------------------------------------------------+
The output of ./cli.py run --help looks like:
Usage: ./cli.py run [OPTIONS]
Run a machine emulation
+- Options ----------------------------------------------------------------------------------------+
| --verbosity INTEGER RANGE [0<=x<=3] Verbosity level; Accepts integer |
| value e.g.: "--verbose 2" or can be |
| count e.g.: "-vv" |
| [default: 0; 0<=x<=3] |
| --trace/--no-trace Create trace lines |
| [default: no-trace] |
| --max-ops INTEGER If given: Stop CPU after given cycles |
| else: run forever |
| --machine [CoCo2b|Dragon32|Dragon64|Multicomp Used machine configuration |
| 6809|Simple6809|Vectrex|sbc09] [default: Dragon32] |
| --help Show this message and exit. |
+--------------------------------------------------------------------------------------------------+
Usage e.g.:
~/DragonPy$ ./cli.py editor
ROMs
All needed ROM files, will be downloaded automatically.
The files will be downloaded from:
| Machine | download url |
|---|---|
| Dragon 32 + 64 | http://archive.worldofdragon.org/archive/index.php?dir=Software/Dragon/Dragon%20Data%20Ltd/Dragon%20Firmware/ |
| CoCo 2b | http://www.roust-it.dk/coco/roms/ |
| Multicomp | http://searle.x10host.com/Multicomp/index.html |
| Simple6809 | http://searle.x10host.com/6809/Simple6809.html |
sbc09 and Vectrex ROMs are included.
All ROM files and download will be checked by SHA1 value, before use.
development
Please use dev-cli.py for development.
The output of ./dev-cli.py --help looks like:
usage: ./dev-cli.py [-h] {coverage,install,lint,mypy,nox,pip-audit,publish,test,update,update-readme-history,update-test-snapshot-files,version}
+- options ------------------------------------------------------------------------------------------------------------+
| -h, --help show this help message and exit |
+----------------------------------------------------------------------------------------------------------------------+
+- subcommands --------------------------------------------------------------------------------------------------------+
| (required) |
| * coverage Run tests and show coverage report. |
| * install Install requirements and 'dragonpy' via pip as editable. |
| * lint Check/fix code style by run: "ruff check --fix" |
| * mypy Run Mypy (configured in pyproject.toml) |
| * nox Run nox |
| * pip-audit |
| Run pip-audit check against current requirements files |
| * publish Build and upload this project to PyPi |
| * test Run unittests |
| * update Update dependencies (uv.lock) and git pre-commit hooks |
| * update-readme-history |
| Update project history base on git commits/tags in README.md Will be exited with 1 if the README.md |
| was updated otherwise with 0. |
| |
| Also, callable via e.g.: |
| python -m cli_base update-readme-history -v |
| * update-test-snapshot-files |
| Update all test snapshot files (by remove and recreate all snapshot files) |
| * version Print version and exit |
+----------------------------------------------------------------------------------------------------------------------+