[Coco] 3.58MHz mode for (SDL)MESS

Jeff Teunissen deek at d2dc.net
Tue Mar 3 07:39:44 EST 2009


I've been playing around with SDLMESS 0.129 on my laptop, and got sick of
having to hold the PgDn key to speed up things like ar extractions and
compiles (and likewise sick of having the real-time clock speed up too), so I
created a "combination POKE" for the emulated SAM.

With the current code, by poking $ffd9 or $ffd7 you get "2MHz" mode (MESS
doesn't emulate the CoCo1/2's fast-mode VDG failure). I figured I could get
away with using both bits set to get a "4MHz" mode.

If you have the MESS source, the line to change is found in
src/mess/machine/coco.c, around line 1879. I changed:

    cpu_set_clockscale(device->machine->cpu[0], val ? 2 : 1);
to:
    cpu_set_clockscale(device->machine->cpu[0], ((val&3)==3)?4:(val?2:1));

For the most part, the hack works remarkably well. NitrOS-9 doesn't even look
at $ffd7, so you have to POKE &HFFD7,0 before starting it up (unless you write
a program to do the pokes later), but if you do that everything runs twice as
fast. Unlike when turning throttling off, the interrupts should continue at
the same rate, so RT clocks should stay stable. The only bad thing I've
noticed is that the joystick routine goes a bit screwy, so Multi-Vue becomes
more irritating than usual.

I also hacked Boisy's "mode" utility to switch the CPU modes on the fly, but
that's just a couple of extra clr $ffd6/7 lines.

Just thought I'd share.



More information about the Coco mailing list