Rybags #1 Posted June 21, 2006 (edited) Well, not paddles really, but the POTx registers. On the 8-bit, the paddles are read by storing to POTGO ($D20B) then waiting for POKEY to generate the value. According to the HW manual, capacitor dump transistors charge, and return a value from 0 to 227. This is useful to us, since whilst generating a POTx value, the registers count up from 0 at the rate of 1 per scanline (exactly). In Fast Scan mode, the scan takes 2 scanlines - which equates to 228 machine cycles. So, instead of tight timing loops which are affected by DMA and Refresh we can set fast pot scan and just wait until POTx reaches the delay value required. Or, in standard mode, we can get delays by x scanlines - which is more precise than ANTIC's VCOUNT as it only has 2 line resolution. This method has distinct advantages over POKEY timers as they are more involved to setup and monitor, plus it costs you a sound channel. The other advantage is that you don't need wasteful delay loops - you just periodically check the counter value. The downside, though, is that you can't have a paddle plugged into that port because the POTn register might not count as high as you want it to. Although, on the XL/XE, POT4-7 are not connected so are free to use. On 400/800 you just have to trust the user not to have paddles plugged into Port 4. Downside #2 is that Atari800Win doesn't seem to emulate fast scan mode at all - the countup is instant. Here's an example using POT7 for speech timing. Binary load file - press START or SELECT once it loads. Note that it won't work properly on the emulator: potdemo.zip (warning - contains profanities) Below is a visual representation of POT7 value as the screen is drawn. The glitches towards the right are where the value changes. Note how it stops at value 227 (brownish colour). By storing into POTGO at a specific time, the counter can be reset. In this case, it is the OS VBI routine. But, it is quite fine to store again at a time of your own chosing, which starts the countup process again. Edited June 21, 2006 by Rybags Quote Share this post Link to post Share on other sites
Heaven/TQA #2 Posted June 21, 2006 might be interesting for Fox to update the Atari800-Core. Quote Share this post Link to post Share on other sites
Rybags #3 Posted June 21, 2006 Yes. Fast mode could be handy, all you need is LDA # <delay factor in cycles> STA $D20B WAIT CMP $D20B BCC WAIT Much more efficient than POKETs timers. I've played around with standard mode - not 100% sure but the change of value seems to take place around the same time each scanline regardless of when you do POTGO. Quote Share this post Link to post Share on other sites
deathtrappomegranate #4 Posted June 24, 2006 I'm surprised at the lack of response to this - it sounds very interesting. Quote Share this post Link to post Share on other sites
+Stephen #5 Posted June 25, 2006 That is seriously cool. What a versatile piece of hardware. Stephen Anderson Quote Share this post Link to post Share on other sites
a8isa1 #6 Posted June 26, 2006 (edited) Awesome demonstration, Rybags! Scared the crap out of me! BTW, your demo runs reasonably well using Atari++ ver 1.46 (Windows) emulator. Just a slight bit of static but it could be my less than state-of-the-art PC. - Steve Sheppard Edited June 26, 2006 by a8isa1 Quote Share this post Link to post Share on other sites
hawk #7 Posted June 28, 2006 I think it's a great discovery, but I'm a long way from needing to use it. Possibly it goes over the head of most members of the forum. Quote Share this post Link to post Share on other sites
tschak909 #8 Posted July 2, 2006 actually, any timing source I can get my hands on for game development makes perfect sense, and since this is perfectly timed to the horizontal colour clocks, it would be great for all sorts of things in a DLI. muaahahaha, why didn't I think of this? especially, since upon reading the entry for POTGO in the Atari 400/800 hardware manual, it seems so @#($#@$(#@$#@ OBVIOUS! -Thom Quote Share this post Link to post Share on other sites
Rybags #9 Posted July 2, 2006 Sadly none of the emulators seem to do fast mode at all. Although I tried it on Ver 1.45 (older) of Atari ++ The one big limitation other than that is the fact that if someone has a paddle plugged into the relevant port, then the technique is rendered useless - although that's only a problem on the 400/800. Quote Share this post Link to post Share on other sites