COCOEMU1.0

A Tandy Color Computer 3 in the browser: the machine COCO TREK was tested on, MAME's, written again in JavaScript. Drop disk images, hard disks, programs or ROMs anywhere on the page.

Color Computer 3 · 512K Off Click the screen to type —
DRIVE 0Empty
DRIVE 1Empty
DRIVE 2Empty
DRIVE 3Empty
HARD DISK 0Empty
HARD DISK 1Empty

Machine—

Changing the memory, monitor or slot starts the machine again. Reset is the button on the back: memory is kept.

ROMs

NONESystem ROM: Super Extended Color BASIC (coco3.rom, 32K)
NONEDisk ROM: Disk Extended Color BASIC (disk11.rom, 8K)

The ROMs are not part of this page. Load your own (MAME's coco3.zip will do); they stay in this browser. Without them, COCO TREK and other programs that take the machine over start without BASIC.

Keyboard and joystick

the sample disk, in drive 0

Screen and sound

The GIME's 16 palette registers

Printer600 baud


        

Keyboard

Click the screen first. By character, what you type arrives as the same character, with the Color Computer's SHIFT added where its keyboard needs it (" is SHIFT and 2). By position, each key is the Color Computer key in its place, for programs that read the keyboard themselves.

Your keyColor Computer key
Esc, End, PauseBREAK
Home, DeleteCLEAR
ReturnENTER
Backspace← (the left arrow, which rubs out)
arrowsthe four arrow keys
Alt, Ctrl, F1, F2ALT, CTRL, F1, F2
ShiftSHIFT (with letters, SHIFT-0 for lower case)
InsertSHIFT-@ pause, as in BASIC listings

The joystick is the right one (the first port). With the mouse, the pointer on the screen is the stick and its button the fire button; a game controller's left stick and first two buttons work the same.

Disks and files

Drop files anywhere on the page, or on a drive to put them there. Floppies go in the first empty drive; drives 2 and 3 are fitted when a disk goes in.

FileGoes
.dsk .jvc .vdk .dmk .os9 .sdfA floppy drive. 35 and 40 tracks, one side or two; 80-track images fit a quad-density drive, made so when the disk goes in.
.vhd .hddA virtual hard disk at $FF80–$FF86 (MAME's), up to 4 GB. Large images are read in pieces as the program asks for them.
.binRun: with the ROMs, from a disk of its own by LOADM and EXEC; without them, at once.
.basPut on a disk of its own and RUN.
.rom .cccThe system or disk ROM, recognised by its contents; anything else is a ROM pack.
.zipOpened: the one file in it that fits, or a choice.

Saving

A changed floppy is marked CHANGED; Save gives you the image. A hard disk opened with Open to save… (in Chrome and Edge) is written back into the file itself; otherwise Save gives you a copy with the changes, assembled from the original file without reading it whole.

Embedding

Put the page in a frame and drive it with messages, or call it from a script on the page itself.

<iframe src="cocoemu/index.html?disk=disks/COCOTREK.DSK&type=RUN%22TREK%22|"
        width="800" height="700" allow="fullscreen; autoplay"></iframe>

frame.contentWindow.postMessage(
  { type: 'cocoemu', cmd: 'type', text: 'DIR\r' }, '*');

window.addEventListener('message', (e) => {
  if (e.data.type === 'cocoemu' && e.data.event === 'print')
    console.log(e.data.text);
});

Commands

load (url or data, name, drive), eject (drive), power, reset, pause, resume, type (text), key (name, down), set (name, value), state, text (the screen as text), peek (addr, n), screenshot. Each is answered with { type: 'cocoemu', reply, id, result }.

Events

ready, power, disk, started, halted (a program restarted the machine with no BASIC to go to), print (a line from the printer), paused, resumed.

About

COCO TREK was tested on MAME 0.264's Color Computer 3. This is that machine written again in JavaScript, and held to it. The 6809 makes the same bus cycles; the GIME, the 6821s, the cartridge slot's lines, the WD1773 with its digital PLL reading the flux of each track, and MAME's own scheduler keep the same time. Run side by side, the two agree instruction by instruction through millions of instructions, and COCO TREK's own tests print the same lines and take the same pictures on both.

The sample disk is COCO TREK 1.0, by Bill Martens, WPM Productions, published by A.P.P.L.E. Without the ROMs it starts as its loader would start it: TREK.BIN is loaded as LOADM loads it and run, with no BASIC behind it.