Atari ST wakestate nudger
Back in the day, those of us who did advanced video tricks on the Atari (opening borders, hardware scrolling on hw without hardware scroll) knew that there were differences between systems, and sometimes on the same system. After some trial and error you built in some compensation which made things work “always” on all systems.
Today we know that a lot of this comes from the fact that the GLUE and the CPU, while both running at 8MHz, can be offset from one another 0-3 cycles (since the master clock everything’s divided from is 32MHz). This is “randomly” (but not random, it depends on specific silicon manufacture timings, phase of the moon etc) selected at cold boot and stays the same throughout resets etc.
Modern code can detect which of these 4 offsets the machine is currently in, compensate for and exploit to do even more advanced tricks than was possible back then. However, testing your code on hardware (or, which I’m currently doing, lots of logic analyzer tracing to document all timings between ICs) means you have to power cycle, check wakestate, power cycle, check wakestate, etc - lots and lots of times. Additionally, most machines only really like two of the wakestates (when cold and warm) and the other two might only rarely be stumbled upon.
Recently Ijor at Atari-Forum, whose work on decapping Atari ICs and painstakingly recreating their inner workings has been absolutely invaluable, mentioned that GLUE had a TEST pin that should, if held HI during RESET, clear its internal clock divisor counter. Since that counter gives rise to the wakestates, this was intriguing. I got to work.
It works, perfectly. An activity that before could take sometimes hours of power cycling can now be done in just a few soft resets. Additionally, a pin that has been tied to ground in all Atari STs ever built finally has some end user purpose, after 30 years. Awesome.
(I expect the number of persons in the world who will build this circuit up to be around 1 - me. If for some reason I’m wrong, please feel free to ask me if there’s anything unclear in this writeup!)