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 programs 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.3 KB)
- A script to convert a file of numbers or DATA statements into a Color Computer disk binary file.
More Color Computer
- Read BASIC out loud
- Reading BASIC out loud is a great tool for verifying that what you’ve typed in from an old-school magazine or book is correct.
- 8 (bit) Days of Christmas: Day 0 (Go Tell It On the CoCo!)
- Day 0 of the 8 (bit) days of Christmas. Christmas Eve, and the cattle are lowing.
- 8 (bit) Days of Christmas: Day 1 (Do You Hear What I Hear?)
- For day 1 of the 8 (bit) days of Christmas, John Mosley’s “Do You Hear What I Hear?” from the December, 1987, Rainbow Magazine. Mosley coaxes four-voice music out of the CoCo 1 and 2 using a machine-language program.
- 8 (bit) Days of Christmas: Day 10 (Up on the Rooftop)
- In the December 1986 Rainbow, J. D. German presented us with this game, involving flying and landing Santa to deliver presents!
- 8 (bit) Days of Christmas: Day 11 (O Christmas Tree)
- Day 11 of the 8 (bit) days of Christmas is the graphic accompaniment to “O Tannenbaum” from Robert T. Rogers “Holly Jolly Holidays”, from December 1984.
- 13 more pages with the topic Color Computer, and other related pages