Lisboa2k6 Posted December 26, 2022 Share Posted December 26, 2022 Hi, I am searching for a routine to auto detect PAL-50 vs NTSC-60 on Atari VCS 2600? Is it possible to read any registers or otherwise detect it from hardware? I was thinking maybe to use collision detection together with timers, but not sure if that is even possible, or if it will make any distinct difference for PAL vs NTSC. Anyone tried to solve this, or ready to take the challenge? Quote Link to comment Share on other sites More sharing options...
JetSetIlly Posted December 26, 2022 Share Posted December 26, 2022 27 minutes ago, Lisboa2k6 said: Hi, I am searching for a routine to auto detect PAL-50 vs NTSC-60 on Atari VCS 2600? Is it possible to read any registers or otherwise detect it from hardware? I was thinking maybe to use collision detection together with timers, but not sure if that is even possible, or if it will make any distinct difference for PAL vs NTSC. Anyone tried to solve this, or ready to take the challenge? Not possible without additional hardware I'm afraid. 1 Quote Link to comment Share on other sites More sharing options...
Dionoid Posted December 26, 2022 Share Posted December 26, 2022 (edited) The PAL 2600's clock runs around 1% slower than NTSC, but you can't measure the difference using the RIOT timers and TIA registers, because they both measure time in clocks, not the actual time. @SpiceWare has solved this using the additional ARM chip in the Harmony cartridge, see: He also shared the code here: Edited December 26, 2022 by Dionoid 2 Quote Link to comment Share on other sites More sharing options...
+Andrew Davie Posted December 26, 2022 Share Posted December 26, 2022 As noted, you can do it in ARM-based games. Here's my auto-detect code... #define DETECT_FRAME_COUNT 10 void detectConsoleType() { switch (frame) { case 0: T1TC = 0; T1TCR = 1; mm_tv_type = TV_TYPE = 0; // force NTSC frame break; case DETECT_FRAME_COUNT: { int detectedPeriod = T1TC; struct fmt { int frequency; unsigned char format; }; static const struct fmt mapTimeToFormat[] = { // Timings from Gopher, 20220827 #define NTSC_70MHZ (0xB25FCD * DETECT_FRAME_COUNT / 10) #define PAL_70MHZ (0xB3856E * DETECT_FRAME_COUNT / 10) #define SECAM_70MHZ (( (PAL_70MHZ - NTSC_70MHZ) / 2 + NTSC_70MHZ) * DETECT_FRAME_COUNT / 10) { NTSC_70MHZ, NTSC, }, { SECAM_70MHZ, SECAM, }, { PAL_70MHZ, PAL_60, }, #define NTSC_60MHZ (0x98EB2F * DETECT_FRAME_COUNT / 10) #define PAL_60MHZ (0x9A0EEF * DETECT_FRAME_COUNT / 10) #define SECAM_60MHZ (( (PAL_60MHZ - NTSC_60MHZ) / 2 + NTSC_60MHZ) * DETECT_FRAME_COUNT / 10) { NTSC_60MHZ, NTSC, }, { SECAM_60MHZ, SECAM, }, { PAL_60MHZ, PAL_60, }, }; int delta = INT_MAX; for (unsigned int i = 0; i < sizeof(mapTimeToFormat) / sizeof(struct fmt); i++) { int dist = detectedPeriod - mapTimeToFormat[i].frequency; if (dist < 0) dist = -dist; if (dist < delta) { delta = dist; mm_tv_type = mapTimeToFormat[i].format; } } menuLineTVType = TV_TYPE = mm_tv_type; break; } default: break; } frame++; } 2 Quote Link to comment Share on other sites More sharing options...
JetSetIlly Posted December 27, 2022 Share Posted December 27, 2022 Discounting the ARM chip for a moment, let's imagine that somebody wanted to build a cartridge that was adaptive to NTSC/PAL during the early '80s. What would have been the cheapest/easiest method of achieving it at that time? It would need a clock in order to measure the console against and it would also need a specific "bankswitching" protocol in order to get information from the clock. The protocol wouldn't need to be complex, just a binary response to the question, "has the clock elapsed since the last time [some address] was accessed?" Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted December 27, 2022 Share Posted December 27, 2022 I do not know what I'm talking about. That being said, I saw a diagram that the PAL TIA pin 12 is something besides AUD1. Could the difference in behavior be measured/detected? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.