[Coco] Detecting CoCo 1 versus CoCo 2

Sean Conner sean at conman.org
Fri Oct 18 04:31:42 EDT 2024


It was thus said that the Great RETRO Innovations via Coco once stated:
> On 10/17/2024 2:23 PM, Sean Conner via Coco wrote:
> >It was thus said that the Great Juan Castro via Coco once stated:
> >>> From Darren Atkison:
> >>>The audio MUX on the CoCo 1 is bi-directional, but the integrated
> >>>DAC/MUX on the CoCo 2 is uni-directional. There is a test you can do
> >>>where you toggle the single-bit sound output and check to see if the
> >>>cassette input level changes to match. If it does change then it's a
> >>>CoCo 1.
> >>Oh man, if anybody here has that code I'd like to see it.
> >   If I understand the explanation right, then something like:
> >
> >	lda	$FF22
> >	ora	#2
> >	sta	$FF22		; enable single bit output
> >	lda	$FF20
> >	bita	#1		; check cassette data input
> >	beq	coco2		; if not 1, then CoCo2
> >
> >would work.  In BASIC, this would be:
> >
> >	10 A = PEEK&HFF22
> >	20 A = A OR 2
> >	30 POKE&HFF22,A
> >	40 A = PEEK&HFF20
> >	50 A = A AND 1
> >	60 IF A == 0 THEN PRINT "COCO2"
> >
> Don't you need to set the DDR and the port and make sure the state is
> different from the current cassette in state?

  The DDR doesn't need to be set as bit 0 of $FF20 is set for input, and bit
1 of $FF22 is set for output, and this is done early in the CB ROM
intialization routine.  You might be right about checking the cassette input
data, but from the initial description of the code, I would think that
$FF20 bit 0 reflects what $FF22 bit 1 is.  I don't have a Coco (of any
version) handy to test this on though.

  -spc



More information about the Coco mailing list