From: Stefan Date: Tue, 10 Apr 2018 18:37:10 +0000 (+0000) Subject: Simpler get_tv X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=refs%2Fpull%2F624%2Fhead;p=cc65 Simpler get_tv You don't have to count the beam, just check the KERNAL. --- diff --git a/libsrc/vic20/get_tv.s b/libsrc/vic20/get_tv.s index 7182c0df7..9194a2c55 100644 --- a/libsrc/vic20/get_tv.s +++ b/libsrc/vic20/get_tv.s @@ -1,12 +1,11 @@ ; -; Stefan Haubenthal, 2004-10-07 -; Based on code from Pu-239 +; Stefan Haubenthal, 2018-04-10 +; Based on code by Mike ; ; unsigned char get_tv (void); ; /* Return the video mode the machine is using */ ; - .include "vic20.inc" .include "get_tv.inc" ;-------------------------------------------------------------------------- @@ -14,18 +13,13 @@ .proc _get_tv -NTSC_LINES = 261 ; detect the system lda #TV::NTSC tax -@L0: ldy VIC_HLINE - cpy #1 - bne @L0 ; wait for line 1 -@L1: ldy VIC_HLINE - beq @L2 ; line 0 reached -> NTSC - cpy #NTSC_LINES/2+2 - bne @L1 + ldy $EDE4 ; VIC init table + cpy #5 + beq @L0 lda #TV::PAL -@L2: rts ; system detected: 0 for NTSC, 1 for PAL +@L0: rts ; system detected: 0 for NTSC, 1 for PAL .endproc