1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-02 18:06:48 +00:00
cc65/libsrc/vic20/get_tv.s
cuz 7b13d79bde Use get_tv.inc
git-svn-id: svn://svn.cc65.org/cc65/trunk@3259 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-10-26 19:05:19 +00:00

32 lines
583 B
ArmAsm

;
; Stefan Haubenthal, 2004-10-07
; Based on code from Pu-239
;
; unsigned char __fastcall__ get_tv (void);
; /* Return the video mode the machine is using */
;
.include "vic20.inc"
.include "get_tv.inc"
;--------------------------------------------------------------------------
; _get_tv
.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
lda #TV::PAL
@L2: rts ; system detected: 0 for NTSC, 1 for PAL
.endproc