Detecting video standard: Difference between revisions
From NESdev Wiki
Jump to navigationJump to search
(import) |
m (1 revision: Rest of pages not related to reference) |
(No difference)
|
Revision as of 04:22, 13 June 2009
Simple way to detect if program is running on PAL or NTSC system.
; ; Detects the video standard under which the program is running. ; Out: A = 0 for 60 Hz (NTSC or PAL/M) or 1 for 50 Hz (PAL) ; Trash:@vdh, @vdl (variables on zeropage) ; detectpalntsc: @vdl = $00 @vdh = $01 lda $2002 bpl detectpalntsc lda #$00 sta @vdh sta @vdl @vdc: lda @vdl clc adc #$01 sta @vdl lda @vdh adc #$00 sta @vdh lda $2002 bpl @vdc lda @vdh sbc #$03 rts