]> git.sur5r.net Git - cc65/blobdiff - libsrc/atari/tvtype.s
Some small first changes for the 'atarixl' target.
[cc65] / libsrc / atari / tvtype.s
index ff09d857390e718464725aba8cd1d7f59a83d5d6..76661bf7261ba29e7709502967330276928c55cd 100644 (file)
@@ -1,19 +1,26 @@
 ;
-; Christian Groessler, December 2000
+; Christian Groessler, July 2004
 ;
 ; unsigned char get_tv(void)
 ;
 ; returns the TV system the machine is using
+; 0 - NTSC
+; 1 - PAL
 ;
 
 
-       .include        "atari.inc"
-       .export         _get_tv
+        .include        "atari.inc"
+        .include        "get_tv.inc"
 
-.proc  _get_tv
+.proc   _get_tv
 
-       lda     PALNTS
-       ldx     #0
-       rts
+        ldx     #TV::NTSC       ; Assume NTSC
+        lda     PAL             ; use hw register, PALNTS is only supported on XL/XE ROM
+        and     #$0e
+        bne     @NTSC
+        inx                     ; = TV::PAL
+@NTSC:  txa
+        ldx     #0              ; Expand to int
+        rts
 
 .endproc