- when the Console is first created, run the TIA for 60 frames
- each time a frame contains more than 285 scanlines, increment a counter
- at the end of 60 frames, if the count is at least 20 then the format is PAL, otherwise NTSC
- I don't like magic numbers; that is, why '60', '285', '20', etc? What if a ROM had 284 scanlines most of the time? Should it be PAL or NTSC??
- auto-running the TIA makes other parts of the code more complicated. Specifically, 'smart' controllers like AtariVox and SaveKey have to know that they're not really being run; it's a test.
- What about ROMs that start out with a low scanline count, then switch to a higher one once the game starts? Currently it's detected as NTSC when it should probably be PAL.
Overall, the problem is that the console determines display format. That's the way a real system works, and it's the way the current code works (after the auto-detect has run for a short time). I'm at a loss how to work around this fact.
EDIT: I should add that any approach I use must still be automatic. Editing the ROM properties database to specifically indicate a ROM is PAL is out of the question. This is the way older versions of Stella worked, and it's a maintenance nightmare (not to mention it completely breaks any new homebrew PAL ROMs that are developed).














