Re: [cc65] Machines with switchable clock

Date view Thread view Subject view

From: Ullrich von Bassewitz (uz_at_musoftware.de)
Date: 2003-02-20 22:35:00


Hi!

On Thu, Feb 20, 2003 at 02:48:17PM +0100, Tim Schürmann wrote:
> The Sinclair ZX80 and ZX81 (with a Z80 CPU) are working similar: with video
> turned off, the cpu runs faster (because the CPU has to do all the graphics).
> So, the ZX80 has two modes: fast and slow.

This is not exactly what I meant. I was talking about a user switchable clock.

Maybe I should have explained what I was thinking about: I've added slow() and
fast() functions for the C128. These functions mimic the BASIC counterparts
and switch between 1 and 2MHz CPU clock. Pure 2MHz clock can only be used in
80 column mode, because the VIC, which is responsible for the 40 column mode
as in the C64, needs half of the clock cycle (and in some cases even more) to
access the graphics data in main memory. Having 2MHz clock does not leave any
time slots for the VIC, so there is no 40 column graphics output in 2MHz mode.
However, it is possible to install an interrupt handler, that switches to 1MHz
when the VIC rasterline displays the visual parts of the screen, and to 2MHz
when the VIC drawd the invisible parts. While this needs some code, it will
give a speed increase of about 40% on a PAL machine - not perfect, but also
nothing to sniff at, especially if all you have to do is to call a library
function from your C program. The nice thing about the latter is that it does
also work for C64 programs when running in C64 mode on a C128 (provided that
they can detect a C128 at runtime, but this problem has been solved by the
nice guys on the CBM hackers mailing list).

Now, instead of the slow() and fast() functions, I was trying to find an API
that would allow all this to work with one function call. And, if there are
other machines with a switchable CPU clock, it would be nice if this function
would also cover any specifics of other machines. 

All this was the reason for my question about machines with switchable clocks.

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz_at_musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2003-02-20 22:35:07 CET