set IRQ frequency depending on video system
This commit is contained in:
1 parent
c16b4cb4bc
commit
79c09d9793
7 files changed
+78
-51
No files matched your search
@@ -0,0 +1,31 @@
|
||||
|
||||
;;
|
||||
;; Detect video system (PAL/NTSC), use Graham's method, as it's short and reliable
|
||||
;; see here: https://codebase64.org/doku.php?id=base:detect_pal_ntsc
|
||||
;;
|
||||
|
||||
setup_pal_ntsc:
|
||||
|
||||
lda VIC_RASTER
|
||||
setup_pal_ntsc_w1:
|
||||
cmp VIC_RASTER
|
||||
beq setup_pal_ntsc_w1
|
||||
bmi setup_pal_ntsc
|
||||
|
||||
;; Result in A, if no interrupt happened during the test:
|
||||
;; #$37 -> 312 rasterlines, PAL, VIC 6569
|
||||
;; #$06 -> 263 rasterlines, NTSC, VIC 6567R8
|
||||
;; #$05 -> 262 rasterlines, NTSC, VIC 6567R56A
|
||||
|
||||
cmp #$07
|
||||
bcs setup_pal
|
||||
|
||||
setup_ntsc:
|
||||
lda #$00
|
||||
beq +
|
||||
|
||||
setup_pal:
|
||||
lda #$01
|
||||
*
|
||||
sta PALNTSC
|
||||
rts
|
||||
Reference in new issue
Block a user