Date : Wed, 03 Apr 1996 09:29:47 +0100 (BST)
From : James Fidell <james@...>
Subject: Re: More VIA queries
Tom Seddon wrote:
> On Mon, 1 Apr 1996, James Fidell wrote:
>
> > Tom Seddon wrote:
> >
> > The number of clock cycles varies depending on the type of instruction
> > and the instruction mode. The best discussion I've seen of this is
> > in the 64doc file which comes with one of the c64 emulators. It's also
> > in the doc directory in the Xbeeb sources.
>
> Hmm, I'll give this idea a miss then -- it seems rather complicated to me!
>
> > Remember that you not only have to handle the variable number of
> > cycles before the physical read, but also multiple reads due to
> > carry propagation in address calculations within the 6502 and also
> > clock-stretching whilst accessing the memory-mapped IO pages.
>
> I know about the multiple reads, but how does the clock stretching
> affect things? I still have problems with about 25% of the games in my
> collection, and I'd like to sort them out.
It depends on your method of implementation, but if you have a system
where the VIA clocks are decremented in step with the number of cycles
required for execution of each instruction, then since the VIA clocks
work at 1MHz and the CPU runs at 2MHz, you need to decrement the VIA
clocks for each 2 CPU cycles. When the clock-stretching takes place,
the CPU actually runs at 1Mhz, so the VIA clocks tick in step with the
CPU.
Excuse me if any of this is a load of rubbish. I'm *very* tired :-(
James.
--
"Yield to temptation -- | Work: james@...
it may not pass your way again" | Play: james@...
| http://www.OiT.co.uk/~james/
- Lazarus Long | James Fidell