# coco-tools
This is a simple collection of tools to assist with developing software for
the [TRS-80 Color Computer](https://en.wikipedia.org/wiki/TRS-80_Color_Computer).
## Installation
```
# To install via pip
pip install coco-tools
# To install from source
git clone https://github.com/jamieleecho/coco-tools.git
cd coco-tools
python3 setup.py
```
## Tools
### [decb-to-b09](./README.decb-to-b09.md)
```
usage: decb-to-b09 [-h] [--version] [-l] [-z] [-s DEFAULT_STRING_STORAGE] [-D] [-w]
[-c CONFIG_FILE]
program.bas program.b09
Convert a Color BASIC program to a BASIC09 program
Copyright (c) 2023 by Jamie Cho
Version: 0.18
positional arguments:
program.bas input DECB text program file
program.b09 output BASIC09 text program file
optional arguments:
-h, --help show this help message and exit
--version show program's version number and exit
-l, --filter-unused-linenum
Filter out line numbers not referenced by the program
-z, --dont-initialize-vars
Don't pre-initialize all variables
-s DEFAULT_STRING_STORAGE, --default-string-storage DEFAULT_STRING_STORAGE
Bytes to allocate for each string
-D, --dont-output-dependencies
Don't output required dependencies
-w, --dont-run-width-32
if set don't run the default width 32
-c CONFIG_FILE, --config-file CONFIG_FILE
Optional compiler configuration file
```
### cm3toppm
```
usage: cm3toppm [-h] [--version] [image.cm3] [image.ppm]
Convert RS-DOS CM3 images to PPM
Copyright (c) 2017 by Mathieu Bouchard
Copyright (c) 2018-2020 by Jamie Cho
Version: 0.6
positional arguments:
image.cm3 input CM3 image file
image.ppm output PPM image file
options:
-h, --help show this help message and exit
--version show program's version number and exit
```
### hrstoppm
```
usage: hrstoppm [-h] [-w width] [-r height] [-s bytes] [--version]
[image.hrs] [image.ppm]
Convert RS-DOS HRS images to PPM
Copyright (c) 2018 by Mathieu Bouchard
Copyright (c) 2018-2020 by Jamie Cho
Version: 0.6
positional arguments:
image.hrs input HRS image file
image.ppm output PPM image file
options:
-h, --help show this help message and exit
-w width choose different width (this does not assume bigger pixels)
-r height choose height not computed from header divided by width
-s bytes skip some number of bytes
--version show program's version number and exit
```
### maxtoppm
```
usage: maxtoppm [-h] [--version]
[-br | -rb | -br2 | -rb2 | -br3 | -rb3 | -s10 | -s11] [-i]
[-w width] [-r height] [-s bytes] [-newsroom]
[image] [image.ppm]
Convert RS-DOS MAX and ART images to PPM
Copyright (c) 2018 by Mathieu Bouchard
Copyright (c) 2018-2020 by Mathieu Bouchard, Jamie Cho
Version: 0.6
positional arguments:
image input image file
image.ppm output PPM image file
options:
-h, --help show this help message and exit
--version show program's version number and exit
pixel mode:
Default pixel mode is no artifact (PMODE 4 on monitor). The 6 other modes:
-br PMODE 4 artifacts, cyan-blue first
-rb PMODE 4 artifacts, orange-red first
-br2 PMODE 3 Coco 3 cyan-blue first
-rb2 PMODE 3 Coco 3 orange-red first
-br3 PMODE 3 Coco 3 primary, blue first
-rb3 PMODE 3 Coco 3 primary, red first
-s10 PMODE 3 SCREEN 1,0
-s11 PMODE 3 SCREEN 1,1
Format and size options::
Default file format is CocoMax 1/2's .MAX, which is also Graphicom's
.PIC and SAVEM of 4 or 8 pages of PMODE 3/4.
Also works with any other height of SAVEM (including fractional pages).
-i ignore header errors (but read header anyway)
-w width choose different width (this does not assume bigger pixels)
-r height choose height not computed from header divided by width
-s bytes skip header and assume it has the specified length
-newsroom read Coco Newsroom / The Newspaper .ART header instead
```
### mgetoppm
```
usage: mgetoppm [-h] [--version] [image.mge] [image.ppm]
Convert RS-DOS MGE images to PPM
Copyright (c) 2017 by Mathieu Bouchard
Copyright (c) 2018-2020 by Jamie Cho
Version: 0.6
positional arguments:
image.mge input MGE image file
image.ppm output PPM image file
options:
-h, --help show this help message and exit
--version show program's version number and exit
```
### mge_viewer2
```
usage: mge_viewer2 [-h] [--version] [image.mge]
View ColorMax 3 MGE files
Copyright (c) 2022 by R. Allen Murphey
Version: 0.6
positional arguments:
image.mge input MGE image file
optional arguments:
-h, --help show this help message and exit
--version show program's version number and exit
```
### pixtopgm
```
usage: pixtopgm [-h] [--version] image.pix [image.pgm]
Convert RS-DOS PIX images to PGM
Copyright (c) 2018-2020 by Mathieu Bouchard, Jamie Cho
Version: 0.6
positional arguments:
image.pix input PIX image file
image.pgm output PGM image file
options:
-h, --help show this help message and exit
--version show program's version number and exit
```
### rattoppm
```
usage: rattoppm [-h] [--version] [image.rat] [image.ppm]
Convert RS-DOS RAT images to PPM
Copyright (c) 2018-2020 by Mathieu Bouchard, Jamie Cho
Version: 0.6
positional arguments:
image.rat input RAT image file
image.ppm output PPM image file
options:
-h, --help show this help message and exit
--version show program's version number and exit
```
### veftopng
```
usage: veftopng [-h] [--version] image.vef image.png
Convert OS-9 VEF images to PNG
Copyright (c) 2018-2020 Travis Poppe <tlp@lickwid.net>
Copyright (c) 2020 Jamie Cho
Version: 0.6
positional arguments:
image.vef input VEF image file
image.png output PNG image file
options:
-h, --help show this help message and exit
--version show program's version number and exit
```
## Developing and Testing
```
# Build the docker image
docker-compose build test
# Run tests using the source on the docker image
docker-compose run test
# Run tests using the source on the host computer
docker-compose run testv
# To make changes and develop locally
pip install -r requirements.txt
pre-commit install
```
## Credits
The programs in the examples/decb and examples/other-decb-examples-to-try directories are from the following sources:
* alien4k0.bas -- https://github.com/jggames/trs80mc10/blob/9df4c9578250009d68a03101d626faa3c22e7445/quicktype/Arcade/4K/Alien4K/ALIEN4K0.TXT#L4
* bach.bas -- https://colorcomputerarchive.com/repo/MC-10/Software/Books/TRS-80%20Color%20Computer%20%26%20MC-10%20Programs/bach.c10
* banner.bas -- https://colorcomputerarchive.com/repo/MC-10/Software/Books/TRS-80%20Color%20Computer%20%26%20MC-10%20Programs/banner.c10
* cadnza.bas -- https://colorcomputerarchive.com/repo/MC-10/Software/Books/TRS-80%20Color%20Computer%20%26%20MC-10%20Programs/cadnza.c10
* cflip.bas -- https://colorcomputerarchive.com/repo/MC-10/Software/Books/TRS-80%20Color%20Computer%20%26%20MC-10%20Programs/cflip.c10
* flip.bas -- https://github.com/daftspaniel/RetroCornerRedux/blob/main/Dragon/Originals/FlipBits/flip.bas
* loops.bas -- https://colorcomputerarchive.com/repo/Documents/Manuals/Hardware/Color%20Computer%203%20Extended%20Basic%20(Tandy).pdf
* f15eagle.bas -- https://colorcomputerarchive.com/repo/Disks/Magazines/Rainbow%20On%20Disk.zip
* mars.bas -- https://github.com/jggames/trs80mc10/tree/9df4c9578250009d68a03101d626faa3c22e7445/quicktype/Text%20Adventures/WorkInProgress/Mars
* saints.bas -- https://colorcomputerarchive.com/repo/Documents/Manuals/Hardware/Color%20Computer%203%20Extended%20Basic%20(Tandy).pdf
Raw data
{
"_id": null,
"home_page": "https://github.com/jamieleecho/coco-tools",
"name": "coco-tools",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9.19",
"maintainer_email": null,
"keywords": "coco image conversion trs-80 tandy",
"author": "Jamie Cho",
"author_email": "jamieleecho+coco_tools@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/40/8a/929b345005715fe50f1aee1bfc3fe24dffe7edd6db08a12a4383f28a7f8d/coco-tools-0.19.tar.gz",
"platform": null,
"description": "# coco-tools\n\nThis is a simple collection of tools to assist with developing software for\nthe [TRS-80 Color Computer](https://en.wikipedia.org/wiki/TRS-80_Color_Computer).\n\n## Installation\n\n```\n# To install via pip\npip install coco-tools\n\n# To install from source\ngit clone https://github.com/jamieleecho/coco-tools.git\ncd coco-tools\npython3 setup.py\n```\n\n## Tools\n\n### [decb-to-b09](./README.decb-to-b09.md)\n\n```\nusage: decb-to-b09 [-h] [--version] [-l] [-z] [-s DEFAULT_STRING_STORAGE] [-D] [-w]\n [-c CONFIG_FILE]\n program.bas program.b09\n\nConvert a Color BASIC program to a BASIC09 program\nCopyright (c) 2023 by Jamie Cho\nVersion: 0.18\n\npositional arguments:\n program.bas input DECB text program file\n program.b09 output BASIC09 text program file\n\noptional arguments:\n -h, --help show this help message and exit\n --version show program's version number and exit\n -l, --filter-unused-linenum\n Filter out line numbers not referenced by the program\n -z, --dont-initialize-vars\n Don't pre-initialize all variables\n -s DEFAULT_STRING_STORAGE, --default-string-storage DEFAULT_STRING_STORAGE\n Bytes to allocate for each string\n -D, --dont-output-dependencies\n Don't output required dependencies\n -w, --dont-run-width-32\n if set don't run the default width 32\n -c CONFIG_FILE, --config-file CONFIG_FILE\n Optional compiler configuration file\n```\n\n### cm3toppm\n\n```\nusage: cm3toppm [-h] [--version] [image.cm3] [image.ppm]\n\nConvert RS-DOS CM3 images to PPM\nCopyright (c) 2017 by Mathieu Bouchard\nCopyright (c) 2018-2020 by Jamie Cho\nVersion: 0.6\n\npositional arguments:\n image.cm3 input CM3 image file\n image.ppm output PPM image file\n\noptions:\n -h, --help show this help message and exit\n --version show program's version number and exit\n```\n\n### hrstoppm\n\n```\nusage: hrstoppm [-h] [-w width] [-r height] [-s bytes] [--version]\n [image.hrs] [image.ppm]\n\nConvert RS-DOS HRS images to PPM\nCopyright (c) 2018 by Mathieu Bouchard\nCopyright (c) 2018-2020 by Jamie Cho\nVersion: 0.6\n\npositional arguments:\n image.hrs input HRS image file\n image.ppm output PPM image file\n\noptions:\n -h, --help show this help message and exit\n -w width choose different width (this does not assume bigger pixels)\n -r height choose height not computed from header divided by width\n -s bytes skip some number of bytes\n --version show program's version number and exit\n```\n\n### maxtoppm\n\n```\nusage: maxtoppm [-h] [--version]\n [-br | -rb | -br2 | -rb2 | -br3 | -rb3 | -s10 | -s11] [-i]\n [-w width] [-r height] [-s bytes] [-newsroom]\n [image] [image.ppm]\n\nConvert RS-DOS MAX and ART images to PPM\nCopyright (c) 2018 by Mathieu Bouchard\nCopyright (c) 2018-2020 by Mathieu Bouchard, Jamie Cho\nVersion: 0.6\n\npositional arguments:\n image input image file\n image.ppm output PPM image file\n\noptions:\n -h, --help show this help message and exit\n --version show program's version number and exit\n\npixel mode:\n Default pixel mode is no artifact (PMODE 4 on monitor). The 6 other modes:\n\n -br PMODE 4 artifacts, cyan-blue first\n -rb PMODE 4 artifacts, orange-red first\n -br2 PMODE 3 Coco 3 cyan-blue first\n -rb2 PMODE 3 Coco 3 orange-red first\n -br3 PMODE 3 Coco 3 primary, blue first\n -rb3 PMODE 3 Coco 3 primary, red first\n -s10 PMODE 3 SCREEN 1,0\n -s11 PMODE 3 SCREEN 1,1\n\nFormat and size options::\n Default file format is CocoMax 1/2's .MAX, which is also Graphicom's\n .PIC and SAVEM of 4 or 8 pages of PMODE 3/4.\n Also works with any other height of SAVEM (including fractional pages).\n\n -i ignore header errors (but read header anyway)\n -w width choose different width (this does not assume bigger pixels)\n -r height choose height not computed from header divided by width\n -s bytes skip header and assume it has the specified length\n -newsroom read Coco Newsroom / The Newspaper .ART header instead\n```\n\n### mgetoppm\n\n```\nusage: mgetoppm [-h] [--version] [image.mge] [image.ppm]\n\nConvert RS-DOS MGE images to PPM\nCopyright (c) 2017 by Mathieu Bouchard\nCopyright (c) 2018-2020 by Jamie Cho\nVersion: 0.6\n\npositional arguments:\n image.mge input MGE image file\n image.ppm output PPM image file\n\noptions:\n -h, --help show this help message and exit\n --version show program's version number and exit\n```\n\n### mge_viewer2\n\n```\nusage: mge_viewer2 [-h] [--version] [image.mge]\n\nView ColorMax 3 MGE files\nCopyright (c) 2022 by R. Allen Murphey\nVersion: 0.6\n\npositional arguments:\n image.mge input MGE image file\n\noptional arguments:\n -h, --help show this help message and exit\n --version show program's version number and exit\n```\n\n### pixtopgm\n\n```\nusage: pixtopgm [-h] [--version] image.pix [image.pgm]\n\nConvert RS-DOS PIX images to PGM\nCopyright (c) 2018-2020 by Mathieu Bouchard, Jamie Cho\nVersion: 0.6\n\npositional arguments:\n image.pix input PIX image file\n image.pgm output PGM image file\n\noptions:\n -h, --help show this help message and exit\n --version show program's version number and exit\n```\n\n### rattoppm\n\n```\nusage: rattoppm [-h] [--version] [image.rat] [image.ppm]\n\nConvert RS-DOS RAT images to PPM\nCopyright (c) 2018-2020 by Mathieu Bouchard, Jamie Cho\nVersion: 0.6\n\npositional arguments:\n image.rat input RAT image file\n image.ppm output PPM image file\n\noptions:\n -h, --help show this help message and exit\n --version show program's version number and exit\n```\n\n### veftopng\n\n```\nusage: veftopng [-h] [--version] image.vef image.png\n\nConvert OS-9 VEF images to PNG\nCopyright (c) 2018-2020 Travis Poppe <tlp@lickwid.net>\nCopyright (c) 2020 Jamie Cho\nVersion: 0.6\n\npositional arguments:\n image.vef input VEF image file\n image.png output PNG image file\n\noptions:\n -h, --help show this help message and exit\n --version show program's version number and exit\n```\n\n## Developing and Testing\n\n```\n# Build the docker image\ndocker-compose build test\n\n# Run tests using the source on the docker image\ndocker-compose run test\n\n# Run tests using the source on the host computer\ndocker-compose run testv\n\n# To make changes and develop locally\npip install -r requirements.txt\npre-commit install\n```\n\n## Credits\nThe programs in the examples/decb and examples/other-decb-examples-to-try directories are from the following sources:\n* alien4k0.bas -- https://github.com/jggames/trs80mc10/blob/9df4c9578250009d68a03101d626faa3c22e7445/quicktype/Arcade/4K/Alien4K/ALIEN4K0.TXT#L4\n* bach.bas -- https://colorcomputerarchive.com/repo/MC-10/Software/Books/TRS-80%20Color%20Computer%20%26%20MC-10%20Programs/bach.c10\n* banner.bas -- https://colorcomputerarchive.com/repo/MC-10/Software/Books/TRS-80%20Color%20Computer%20%26%20MC-10%20Programs/banner.c10\n* cadnza.bas -- https://colorcomputerarchive.com/repo/MC-10/Software/Books/TRS-80%20Color%20Computer%20%26%20MC-10%20Programs/cadnza.c10\n* cflip.bas -- https://colorcomputerarchive.com/repo/MC-10/Software/Books/TRS-80%20Color%20Computer%20%26%20MC-10%20Programs/cflip.c10\n* flip.bas -- https://github.com/daftspaniel/RetroCornerRedux/blob/main/Dragon/Originals/FlipBits/flip.bas\n* loops.bas -- https://colorcomputerarchive.com/repo/Documents/Manuals/Hardware/Color%20Computer%203%20Extended%20Basic%20(Tandy).pdf\n* f15eagle.bas -- https://colorcomputerarchive.com/repo/Disks/Magazines/Rainbow%20On%20Disk.zip\n* mars.bas -- https://github.com/jggames/trs80mc10/tree/9df4c9578250009d68a03101d626faa3c22e7445/quicktype/Text%20Adventures/WorkInProgress/Mars\n* saints.bas -- https://colorcomputerarchive.com/repo/Documents/Manuals/Hardware/Color%20Computer%203%20Extended%20Basic%20(Tandy).pdf\n",
"bugtrack_url": null,
"license": "GPLv2",
"summary": "TRS-80 Color Computer Tools",
"version": "0.19",
"project_urls": {
"Homepage": "https://github.com/jamieleecho/coco-tools"
},
"split_keywords": [
"coco",
"image",
"conversion",
"trs-80",
"tandy"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "408a929b345005715fe50f1aee1bfc3fe24dffe7edd6db08a12a4383f28a7f8d",
"md5": "f307962a261b911e5db290cd68d47abd",
"sha256": "e860092d9a69fa8b96c9dc0e4b1376e05dcd5075c7f723d8bbe9fcc7d2475563"
},
"downloads": -1,
"filename": "coco-tools-0.19.tar.gz",
"has_sig": false,
"md5_digest": "f307962a261b911e5db290cd68d47abd",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9.19",
"size": 55594,
"upload_time": "2024-09-15T23:10:43",
"upload_time_iso_8601": "2024-09-15T23:10:43.332576Z",
"url": "https://files.pythonhosted.org/packages/40/8a/929b345005715fe50f1aee1bfc3fe24dffe7edd6db08a12a4383f28a7f8d/coco-tools-0.19.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-15 23:10:43",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "jamieleecho",
"github_project": "coco-tools",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "coco-tools"
}