[Coco] The CM17A "FireCracker" does work on the Coco - Another code sample

K. Pruitt pruittk at roadrunner.com
Thu Jan 22 07:05:33 EST 2015


Okay, my first example (bottom of message) was sufficient as a proof of 
concept program, but if followed out to its logical conclusion I would end 
up with a data table of slightly over 8K in size.  I have reduced the 
gigantic data table down to 53 bytes long.  This example uses only 32 of 
them  From over 8K to 53 bytes.  Not a bad reduction in size.

So here is the program with some changes.  This will allow you to turn on 
and off  devices 1-8 on housecodes A-P.  Not the full range of command codes 
yet, but we're half way.


100 CLS
110 DIM LB(16):DIM O(8):DIM F(8)
120 FOR D=1 TO 16:READ LB(D):NEXT D
130 FOR D=1 TO 8:READ O(D):NEXT D
140 FOR D=1 TO 8:READ F(D):NEXT D
150 '* GET USER INPUT
160 INPUT "HOUSE   (A-P)        :";H$
170 INPUT "UNIT    (1-8)        :";U:IF U>8 THEN 150
180 INPUT "COMMAND (O)N OR OF(F):";C$
190 '* PROCESS HOUSECODE
200 H=ASC(H$)-64:H=LB(H)
210 '* PROCESS COMMAND
220 IF C$="O" THEN C=O(U)
230 IF C$="F" THEN C=F(U)
240 '* SEND HEADER
250 X=&HD5:GOSUB 330:X=&HAA:GOSUB 330
260 '* SEND HOUSECODE W/UNIT CODE, AND COMMAND CODE
270 X=H:GOSUB 330
280 X=C:GOSUB 330
290 '* SEND FOOTER
300 X=&HAD:GOSUB 330
310 END
320 '* CONVERT TO BINARY AND PROCESSES IT TO CM17A AS 8'S AND 1'S
330 FOR L=7 TO 0 STEP-1
340 P=2^L:P=INT(P)
350 IF X>=P THEN X=X-P:POKE &HFF6A,8 ELSE POKE &HFF6A,1
360 POKE &HFF6A,&H0D
370 NEXT L
380 RETURN
390 '*
400 '* HOUSE CODES - LOWER BANK A-P 1-8
410 DATA &H60,&H70,&H40,&H50,&H80,&H90,&HA0,&HB0
420 DATA &HE0,&HF0,&HC0,&HD4,&H00,&H10,&H20,&H30
430 '* COMMAND CODES - ON AND OFF
440 DATA &H00,&H10,&H08,&H18,&H40,&H50,&H48,&H58
450 DATA &H20,&H30,&H28,&H38,&H60,&H70,&H68,&H78


----- Original Message ----- 
From: "K. Pruitt"
To: "CoCoList for Color Computer Enthusiasts" <coco at maltedmedia.com>
Sent: Friday, January 16, 2015 1:42 PM
Subject: Re: [Coco] The CM17A "FireCracker" does work on the Coco


> It works very well and is really simple to use on the coco.
>
> No hardware mods required.  Just plug a DB25 to DB9 serial adapter in to 
> the RS232 pack and plug the firecracker in to the adapter and it just 
> works.
>
> This will turn Unit 1, House A, On.
>
> 10 DIM C(40)
> 20 FOR D=1 TO 40
> 30 READ C(D)
> 40 POKE &HFF6A,C(D)
> 50 POKE &HFF6A,&H0D
> 60 NEXT D
> 70 DATA 8,8,1,8,1,8,1,8,8,1,8,1,8,1,8,1
> 80 DATA 1,8,8,1,1,1,1,1,1,1,1,1,1,1,1,1
> 90 DATA 8,1,8,1,8,8,1,8
>
> It doesn't get much easier than that.
>



More information about the Coco mailing list