• Please review our updated Terms and Rules here

Coco: LOADM, CCC files, and a CocoSDC

smbaker

Experienced Member
Joined
Oct 21, 2016
Messages
441
Location
Oregon, USA
Granted, it's been more than 30 years since I've used a coco, so I'm just a little bit rusty...

I'm trying to program a CCC file into the Flash of a CocoSDC. I did the followiung:

Code:
10 CLEAR 200,&H3FFF ' RESERVE A 16K RAM BUFFER AT $4000
100 PRINT "DIAGS82"
110 LOADM "DIAG82.CCC",&H4000
120 KILL MEM @2
130 WRITE MEM @2,&H4000,&HC000,2048

As far as I can tell, the LOADM either does nothing, or it puts the data somewhere other than 0x4000. Doing a peek before and after the LOADM shows 0x4000 unchanged. Can anyone tell me what I'm doing wrong?

Thanks,
Scott
 
Figured it out. Found the BIN format documented on the web and wrote a tiny python program:

It needs a 5-byte preamble (0x00, Len-Hi, Len-Lo, Addr-Hi, Addr-Lo) and a 5-byte postamble (0xFF, 0x00, 0x00, Exec-Hi, Exec-Lo)

Code:
#!/usr/bin/python
# Read Cartridge File from Stdin
# Write Bin file to stdout, loading at address 0x4000
# Scott Baker, http://www.smbaker.com/
import sys
data = sys.stdin.read()
l = len(data)
sys.stdout.write(chr(0))
sys.stdout.write(chr(l>>8))
sys.stdout.write(chr(l&0xFF))
sys.stdout.write(chr(0x40))
sys.stdout.write(chr(0x00))
sys.stdout.write(data)
sys.stdout.write(chr(0xFF))
sys.stdout.write(chr(0x00))
sys.stdout.write(chr(0x00))
sys.stdout.write(chr(0x40))
sys.stdout.write(chr(0x00))
 
Back
Top