Re: visual 6502 simulation...

From: Rhialto <rhialto_at_falu.nl>
Date: Fri, 17 Sep 2010 12:24:35 +0200
Message-ID: <20100917102435.GA26110@falu.nl>
On Thu 16 Sep 2010 at 21:47:21 +0200, Wolfgang Moser wrote:
> Ethan Dicks schrieb:
> > On 9/16/10, Rhialto <rhialto@falu.nl> wrote:
> >> Speaking of shift register bugs: there is this one that I don't remember
> >> being explained. If you enable sound on a PET, then try to load anything
> >> from cassette, the PET hangs. The STOP key does not work, nor does
> >> anything actually load.
> 
> this is _the_ 6522 shift register bug that also was the main cause for
> the 1541 being throttled that much.
> 
> And it has been exaplined in depth. I cannot tell you the exact forum
> link at 6502.org, but I believe it was Garth Wilson who gave a thorough
> explanation how a decent state of the Phi clock affected sampling of the
> serial input, when external clocks were used. Have a search there.

I think we're not talking about the same thing. The VIA shift register
isn't used for tape operations. The timer is likely used, though.

I found this thread, where the poster basically asks the same questions
as I did, but his question doesn't seem to get answered. The discussion
digresses mostly to the same shift register bug you mentioned too.

http://forum.6502.org/viewtopic.php?t=1514&highlight=shift+register+bug

Garth Wilson has a post in that thread, and he says 

    I haven't looked at what the Commodore firmware was doing; but since
    you pretty much have to use interrupts to get the sample spacing
    consistent enough for audio, I suspect the problem was that leaving
    the audio running while you're trying to read data from tape left
    the two jobs competing for exact time slots. If the tape routine
    used software timing loops, it wouldn't stand a chance. This is
    separate from the SR's bug.

which doesn't seem to hit the nail on the head, because PET audio
doesn't use interrupts (just the shift register free-running, shifting
the same data out over and over again, a bit at each timer underflow).

Hmmm I suddenly realise: the VIA application notes
http://archive.6502.org/dataheets/synertek_sy6522.pdf stress that with
the free running shift register, only the low byte of the timer (T2) is
used for the shifting. Page 7 of the PDF. It doesn't seem to mention if
this is a general constraint on the timer for other uses, but if that is
the case (and it seems likely), then this would definitely affect tape
timing.

(Programming the PET/CBM, page 390, confirms that it is Timer 2 which is
used for the tape; that saves me looking it up in my ROM disassemly. I
have seen PDFs of this book online and I found a good second-hand copy
on Amazon.)

-Olaf.
-- 
___ Olaf 'Rhialto' Seibert  -- There's no point being grown-up if you 
\X/ rhialto/at/xs4all.nl    -- can't be childish sometimes. -The 4th Doctor

       Message was sent through the cbm-hackers mailing list
Received on 2010-09-17 11:00:10

Archive generated by hypermail 2.2.0.