[Coco] Detect and Report Computer Type in Basic (MC-10, CoCo 2, CoCo 3)

Steve Batson steve at batsonphotography.com
Fri Feb 27 00:17:43 EST 2015


I don't know if anyone has done this before or if it's that big a deal to anyone, but I've been toying with the idea of writing BASIC Code that would run on the MC-10, CoCo 2 and 3. My idea was to detect the computer it's running on and then be able to adjust screen modes and output as appropriate based on which computer the code is running on. System specific commands can be put into subroutines and called with a GOSUB and only run if that system detected. One of the big advantages I saw there is being able to put the CoCo 3 into 80 Column mode for text where as on a CoCo 2 or MC-10, you'd leave it in 32 Column mode.

Anyway, this is pretty simple. I've tested it on all 3 in the emulators and the CoCo 3 and MC-10 real hardware. I don't have my CoCo 2 unboxed so I wasn't able to test it on that. Note that on the MC-10 emulator I have it configured for 16K and the MC-10 Hardware has a 16K expansion Module in it. The CoCo 3 has a disk controller in it. I don't think so, but I'm not sure if different system hardware configurations will affect the values in the location I'm checking or not. If someone can test this on a real CoCo 2 and let me know if it works properly, that would be great. Feedback is welcome.  Also, obviously, use the ,A option when saving to move from one computer to the other.

Anyway, I'll leave the rest up to others as to how they would use it. :)


Here's the code.

1 REM VCHK.BAS 
2 REM WRITTEN BY STEVE BATSON
3 REM RETURNS STRING CONTAINING COMPUTER TYPE
10 V=PEEK(65535)
30 IF V=39 THEN C$="COCO2"
40 IF V=46 THEN C$="MC-10"
45 IF V=27 THEN C$="COCO3"
50 PRINT "COMPUTER TYPE = " + C$


More information about the Coco mailing list