TRS-80 CoCo 2 Cartridge Project
Cartridge SuppliesCartridge PCBs
TL668CS EPROM Programmer (available from Amazon.com)
EPROM eraser (available from Amazon.com)
27C128 EPROMS (Note: I had multiple failures with AMD EPROMs - others were OK)
DocumentationProgramming the 6809, Zaks and Labiak.
CoCo Assembly Language Programming
Program Memory LocationI put my program in the BASIC user code space at 0x0E00
I put the system stack at 0x3FFF
I put the system stack at 0x7FFF
.CCC FILE (CARTRIDGE):
The cartridge occupies a 8K hole in memory starting at 0xC000
To get the cartridge to autostart, I needed to put the header DK on the image. This may be incorrect.
On the CoCo 2, variables need to moved to RAM from the EPROM. This requires two ORG directives, one for the start of the code, the other for the variable segment in RAM. You then need to a subroutine to move your variables from ROM to RAM.
The Preamble/PostambleCoCo disk files need a preamble and postamble. This information says how large the file is and where to load it in memory. Fortunately, lwasm will add this info for you if you set up the assembler directives properly
Note: If you forget the END START part, you'll get the preamble, but the post amble will be all zeros.
Making the .DSK File Version
Creating a .DSK file
In order to move the your file to the CoCo, you first need to attach it to a disk image. You can make the .DSK on your SD Card using the CoCoSDC when it's plugged into the CoCo.
Now you can take the SD and move it to the PC. Copy the .DSK file to your development folder on your PC.
Assembling the code
Attach it to a copy of your .DSK file
To attach the your binary file to the disk image, use the writecocofile command (part of lwtools) then copy the DSK file to the SD Card.
DebuggingI debugged the code using MAME. If you run MAME with the -debug option, it will launch with a debugger.
Building the cartridge version
The cartridge gets assembled using the raw option, which omits the preamble and postamble.
That's it. Once you have your .CCC file, transfer it to an EPROM and put it in a cartridge.