ddrcode / c64rust

MOS6502 and C64 Emulators written in Rust
MIT License
1 stars 0 forks source link

Support for PAL / NTSC version of C64 #27

Open ddrcode opened 1 year ago

ddrcode commented 1 year ago

C64 stores PAL/NTSC flag under $02A6 According to Pagetable:

This test is accomplished by setting a raster interrupt for scan line 311, and testing if the interrupt occurs. Since NTSC monitors have only 262 raster scan lines per screen, the interrupt will occur only if a PAL monitor is used. The results of that test are stored here, with a 0 indicating an NTSC system in use, and one signifying a PAL system.

This information is used by the routines which set the prescaler values for the system IRQ timer, so that the IRQ occurs every 1/60 second. Since the PAL system 02 clock runs a bit slower than the NTSC version, this prescaler value must be adjusted accordingly.