Date : Mon, 19 Feb 1996 14:13:10 +0000 (GMT)
From : Tom Seddon <T.W.Seddon@...>
Subject: Re: Graphics speed hacks
On Mon, 19 Feb 1996, lamcw wrote:
>
> James Fiddell wrote:
>
> ;I believe that it should be 20000 ticks at 1MHz -- that is, 1/50th of
> ;a second.
>
> ;How did you come up with the 19990 figure ?
>
> I looked at the user T2 counter figures which Revs pokes into it and
> they add up to 19990 ticks. Revs doesn't tie these interrupts to
> the vsync one and therefore to keep sync the duration of one frame
> must exactly match 19990 ticks. Otherwise the colours scroll very slowly
> up/down the screen :)
>
> Elite is much simpler as it uses vsync to split the screen.
The VIA timer values always seem to be slightly off the real values,
presumably because on a genuine BBC there will be a one/two cycle gap
between the timer timing out and the interrupt going to the 6502 (plus
there's the 7-cycle IRQ delay as well). For example, the system VIA T1
counter is loaded with &270E (9998 I think), presumably to cater for this
delay. Perhaps those strange diagrams in the VIA section of the AUG might
explain.
This next bit is mostly guesswork:-
(Assuming the VIA *doesn't* have delays between timer time-outs and
interrupt requests...)
Since Revs has three timer interrupts going--one at the top to set Mode 4,
one a bit further down to change colours and mask the hidden code, and one
a bit further down again to change to mode 5--these multiple 7-cycle IRQ
delays could add up to 10 1MHz cycles (7*3 then /2=10... sort of...) which
would make 20,000 cycles--ie one 50hz screen update.
(I've no idea where the extra 1/2 cycle in the IRQ delays goes. I assume
that the VIA simply skips every other 2MHz signal (or it is only sent
every other 2MHz signal--hardware not my speciality) so this half cycle is
simply ignored.)
Unfortunately 20,000 1MHz cycles is the time for an *interlaced* screen
update (312.5 scanlines--non-interlaced is 312 scanlines and 19,968 1MHz
cycles). Coincidentally Revs always ran in interlaced mode--it used to
annoy me a lot--so is possibly the problem. Maybe more accurate emulation
of IRQ delays, and a screen which has an extra 1/2 scanline, is the
answer.
(Guesswork OFF)
Or maybe I'm missing something... it's only a theory :-)
--Tom
. ** Tom Seddon ** .
/ \ E-mail: T.W.Seddon@... / \
/(o)\ /(o)\
/=====\ Call out GANDHU and be happy /=====\
/ \ / \
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^