[stella] Understanding the PIA

Stephen Anthony sa666666 at gmail.com
Thu Apr 3 11:17:12 CDT 2008


On Thursday 03 April 2008 13:38, bob.montgomery at thomson.com wrote:

> the Stella Programmer's Guide tells you what should happen when the
> timer underflows:
> >The PIA decrements the value or count loaded into it once each
> > interval until it reaches 0. It holds that 0 counts for one interval,
> > then the counter flips to FF(HEX) and decrements once each clock
> > cycle, rather than once per interval.
>
> As far as I know, this is what happens on a real 2600 and what happens
> in z26.  But!  Stella (the emulator) absolutely does NOT do this, it
> does (incorrectly) something else entirely; I've never bothered to
> figure out exactly what.  Based on your values and some of my own hazy
> recollections, I think that it does NOT hold the zero value for one
> interval but begins counting down immediately.  Or something.  Anyway,
> for timer stuff, use z26 or a real Atari.
>
> I just ran your test in z26 (with the -t flag) and, according to the
> log file, the values I got match up with your expected values:  0B, 04,
> FD, F6, EF, E8, etc.

Can you provide a test ROM illustrating this incorrect behaviour, as well 
as a brief description of what the output should be?  I'll take a look at 
this as soon as I get a chance (and you get me the info).

Thanks,
Steve



More information about the Stella mailing list