1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-08 15:29:37 +00:00

Undo my previous commit.

This commit is contained in:
Marco van den Heuvel 2018-03-09 10:46:02 -08:00
parent 22d4b0d497
commit 0eb1eb625f
3 changed files with 3 additions and 46 deletions

View File

@ -11,8 +11,6 @@
.enum TV
NTSC
PAL
NTSC_OLD
PAL_N
OTHER
.endenum

View File

@ -150,9 +150,7 @@ struct cbm_dirent {
#define TV_NTSC 0
#define TV_PAL 1
#define TV_NTSC_OLD 2
#define TV_PAL_N 3
#define TV_OTHER 4
#define TV_OTHER 2
unsigned char get_tv (void);
/* Return the video mode the machine is using. */

View File

@ -3,11 +3,6 @@
;
; unsigned char get_tv (void);
; /* Return the video mode the machine is using */
;
; Changed to actually detect the mode instead of using a flag
; Marco van den Heuvel, 2018-03-08
;
; The detection goes wrong on accelerated machines for now.
;
.include "c64.inc"
@ -18,42 +13,8 @@
.proc _get_tv
php
sei
timing_loop_0:
lda VIC_HLINE
timing_loop_1:
cmp VIC_HLINE
beq timing_loop_1
bmi timing_loop_0
and #$03
cmp #$01
bne check_ntsc
lda #TV::NTSC_OLD ; NTSC OLD constant
bne detected
check_ntsc:
cmp #$03
bcc ntsc
; check for PAL and PAL-N
ldx #$00
lda #$10
timing_loop_2:
inx
cmp VIC_HLINE
bne timing_loop_2
lda #TV::PAL ; PAL constant
cpx #$70
bcc detected
lda #TV::PAL_N ; PAL-N constant
detected:
ldx #$00
plp
lda PALFLAG
ldx #0
rts
ntsc:
lda #TV::NTSC ; NTSC constant
beq detected
.endproc