Color Computer binaries from decimal values
At the end of my post on the first version of cocobin, I wrote:
It’s also likely that some binaries were provided as decimal instead of hexadecimal numbers.
And only a few weeks later, here I am. I found a really nice Galaxian/Space Invaders-style game by Rodger Smith in the February 1985 Hot CoCo.1
He used decimal numbers for his DATA statements, so I added that feature to cocobin. If a file or BASIC program contains decimal rather than hexadecimal numbers, add the option --decimal to the cocobin command line.
Also as expected, adding this feature also highlighted another common custom of the era: the DATA items often included a marker to denote the end of the data. Most commonly, as I recall, this was the word “END”, or (for machine code) a negative 1. Smith used the number 999. So I’ve added the ability to recognize “END”, “999”, or “-1” at the end of a line of DATA in a BASIC program. If the program sees any of those key words at the end of a DATA line, it assumes that that is the end of the data to be read.
Either of those keywords not at the end of a DATA line will still be seen as an error, since none of them represent valid POKEable numbers.
The script now accepts the following arguments:
| load address | decimal or hex address for location of binary data in CoCo RAM |
|---|---|
| exec address | decimal or hex address for starting execution; defaults to load address |
| filenames | file[s] to pull data from; data can also be piped |
| --basic | the text is a BASIC file; pull hex values from DATA lines |
| --columns <column count> | verify that each line contains a specific column count |
| --decimal | the numbers are decimal numbers, not hexadecimal |
| --help | print this text |
| --quiet | do not output bin data |
| --verbose | provide information about the binary program |
Also, while this is not a change, I did finally verify that the script works when used with multiple files. Charles Husak’s “The Little Runner” from the March 1984 Rainbow uses three BASIC programs to POKE the binary into memory. This command line worked to create a working binary from those three files:
- cocobin --basic 13000 RUNNER*.BAS > RUNNER.BIN
Interesting little game!
In response to Create Color Computer binaries from hex values: Take a text file filled with hexadecimal numbers and create a TRS-80 Color Computer BIN file.
Note, if you attempt to do this yourself, there is an update in the April 1985 issue of Hot CoCo, page 13; there was a typo in line 640. It should read:
640 DATA 183,89,25,247,89,27,236 ,196,132,0,196,0,138,0,202,0,237 ,196,190,89,98,51,200,32,122,89, 106,38,194,182,89,100,183,89,106 ,254,89,101,51,65
Without that fix, cocobin will see an error: there will be no comma between the end of subline 2 and the beginning of subline 4—because subline 3 will be missing.
↑
- Color Computer binary generator (Zip file, 2.2 KB)
- A script to convert a file of numbers or DATA statements into a Color Computer disk binary file.
More Color Computer
- Duplicating repetitive BASIC lines
- Two scripts to make repetitive BASIC lines easier to type from books and magazines, like The Rainbow.
- Thoughts on typing 8-bit code
- Using a modern computer to type retro code from old books and magazines opens up several possibilities for preflighting the code. This is a summary of what I do, along with two utilities to help when typing duplicative code.
- Simple game menu for the Color Computer 2 with CoCoSDC
- This simple menu provides one screen for cartridges saved in the CoCoSDC’s flash ROM, and any number of screens for your favorite games for your friends to play.
- Rainbow Magazine preflight tool enhanced
- I’ve added several features to the Rainbow Magazine preflight tool, including a check for references to line numbers that don’t exist.
- CoCoFest! 2021
- Forty years later, I finally make it to CoCoFest!
- 21 more pages with the topic Color Computer, and other related pages
