2008-04-10 20:12:20 +00:00
|
|
|
;
|
|
|
|
; Stefan Haubenthal, 2007-01-21
|
|
|
|
;
|
2012-03-04 13:08:54 +00:00
|
|
|
; unsigned char get_tv (void);
|
2008-04-10 20:12:20 +00:00
|
|
|
; /* Return the video mode the machine is using */
|
|
|
|
;
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.include "nes.inc"
|
|
|
|
.include "get_tv.inc"
|
|
|
|
.importzp tmp1, tmp2
|
2008-04-10 20:12:20 +00:00
|
|
|
|
|
|
|
;--------------------------------------------------------------------------
|
|
|
|
; _get_tv
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.proc _get_tv
|
2008-04-10 20:12:20 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
lda #TV::NTSC ; assume NTSC
|
|
|
|
tax ; clear
|
|
|
|
sta tmp1
|
|
|
|
sta tmp2
|
|
|
|
ldy tickcount
|
|
|
|
wait: cpy tickcount
|
|
|
|
beq wait
|
|
|
|
iny ; next tick
|
|
|
|
loop: cpy tickcount
|
|
|
|
bne over
|
|
|
|
inc tmp1
|
|
|
|
bne loop
|
|
|
|
inc tmp2
|
|
|
|
bne loop
|
|
|
|
over: ldy tmp2
|
|
|
|
cpy #9
|
|
|
|
bcc nopal
|
|
|
|
lda #TV::PAL ; choose PAL
|
|
|
|
nopal: rts
|
2008-04-10 20:12:20 +00:00
|
|
|
|
|
|
|
.endproc
|