User Tools

Site Tools


base:detect_pal_ntsc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revisionBoth sides next revision
base:detect_pal_ntsc [2015-04-17 04:31] – external edit 127.0.0.1base:detect_pal_ntsc [2016-09-27 17:49] sokrates
Line 62: Line 62:
 EDIT: This check assumes that the machine is not a Drean PAL-N, which has 312 lines and 65 cycles per line. EDIT: This check assumes that the machine is not a Drean PAL-N, which has 312 lines and 65 cycles per line.
  
 +===== Sokrates' variant =====
 +
 +Graham's variant with additional Drean PAL-N detection. First count rasterlines, then count cycles to differ between PAL and PAL-N:
 +
 +<code>
 +    LDX #$00
 +w0  LDA $D012
 +w1  CMP $D012
 +    BEQ w1
 +    BMI w0
 +    AND #$03
 +    CMP #$03
 +    BNE detectionDone ; done for NTSC
 +    TAY
 +countCycles
 +    INX
 +    LDA $D012
 +    BPL countCycles
 +    CPX #$5E  ; VICE values: PAL-N=$6C PAL=$50
 +       ; so choose middle value $5E for check 
 +    BCC isPAL
 +    INY ; is PAL-N
 +isPAL
 +    TYA
 +detectionDone
 +    ...
 +</code>
 +
 +Results in the accumulator:
 + 
 +<code>
 +#$01: 262 rasterlines and 64 cycles per line [NTSC: 6567R56A VIC] (OLD NTSC) 
 +#$02: 263 rasterlines and 65 cycles per line [NTSC: 6567R8 VIC]
 +#$03: 312 rasterlines and 63 cycles per line [PAL: 6569 VIC]
 +#$04: 312 rasterlines and 65 cycles per line [Drean PAL-N: 6572 VIC] 
 +</code>
  
 ===== TLR's more advanced variant ===== ===== TLR's more advanced variant =====
base/detect_pal_ntsc.txt · Last modified: 2020-11-11 01:49 by copyfault