[stella] Understanding the PIA

André Wagner andre.nho at gmail.com
Fri Apr 4 06:04:39 CDT 2008


> OK, I had a chance to look at this, and I've found that there's actually 
> code in Stella that does #2.  That is, there's specific logic that 
> checks if a read has been done after passing zero, and if so the timer 
> results are changed.  When I remove that bit of logic, I get the 
> correct output as in your previous examples.  So it seems the base 
> timer code *is* working.
> 
> So I'm wondering why this logic was added in the first place.  Obviously 
> there was some reason, even if it was a misunderstanding of how the PIA 
> works.  I'll have to contact the person who added that bit of code ...

I got this from http://nocash.emubase.de/2k6specs.htm . Maybe is because of this?

"Once when the timer does underflow, it restarts at FFh, and is then decremented once per clock cycle, regardless of the selected  interval (this feature allows to calculate the exact underflow time at one clock cycle resolution even if a larger interval was used).

However, the interval is automatically re-actived when reading from the INTIM register, ie. the timer does then continue to decrement at interval speed (originated at the current value)."

André

-- 
André Wagner <andre.nho at gmail.com>
http://historiacomputacao.blogspot.com



More information about the Stella mailing list