Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Productions > PAL/NTSC detect
2003-01-29 18:35
Dr. Jay
Account closed

Registered: Jan 2003
Posts: 32
PAL/NTSC detect

Just wanted to share a quick routine that detects PAL/NTSC WITHOUT using interrupts or latches.

;pal/NTSC detect - 0 = PAL, non-zero = NTSC

palntsc
sei ; disable interrupts
wait
lda $d012
bne wait ; wait for rasterline 0 or 256
wait1
lda $d011 ; Is rasterbeam in the area
bpl wait1 ; 0-255? if yes, wait
wait2
ldy #$00
synch1 lda $d012
cmp #$37 ; top PAL rasterline
bne synch1
lda $d012 ; if next is 0, then PAL
synch2 cmp $d012
beq synch2
lda $d012
cli ; enable interrupts
rts ; return
 
... 67 posts hidden. Click here to view all posts....
 
2009-02-17 07:58
chatGPZ

Registered: Dec 2001
Posts: 11510
Quote:
PAL/NTSC register


hu? there is no such thing :) the kernal uses a similar (but buggy) routine to detect pal/ntsc =)
2009-04-27 19:53
Mix256
Account closed

Registered: Dec 2008
Posts: 26
But...but, there're two ntsc.
Any smart solution to this as well?

Or do I just wait for line 262, if the next is 263 strike old_ntsc. If the one after that one is 264, we got pal otherwise it's new_ntsc.
2009-04-27 20:18
chatGPZ

Registered: Dec 2001
Posts: 11510
dont bother about the 64 cycle vic. they are very rare, and nothing works right on them anyway. noone gives a damn really =)
2009-04-27 20:29
Mix256
Account closed

Registered: Dec 2008
Posts: 26
Great! Thanks a lot!
2009-04-28 13:16
Skate

Registered: Jul 2003
Posts: 505
Warning! This message contains just for fun material. Don't take my comments too seriously.

I always thought 64 cycles per line is the most suitable number of cycles for c64. It's a pity that only very rare NTSC machines used it in the past.

1) 64 cycles covers all 512 pixels. Some of them are not visible pixels maybe but no 8 pixels gap is the best alternative for me. Actually more than 64 cycles is ok too.

2) Second reason is simple. It's a Commodore "64" god dammit! Why would it have 63 or 65 cycles per line? :D

In PAL mode, I could live with loosing 5 raster lines or so. Just a thought...

Let's get back to the topic. A funny (just for fun) alternative way of detecting PAL/NTSC would be to show two different stabilized rasterbar blocks using 63 and 65 cycles per line. User could select the correct looking block before the demo starts ;) Showing raster splits would be even nicer.

Yeah yeah, complete comment is pointless I know :)
2009-04-28 13:42
enthusi

Registered: May 2004
Posts: 679
Quote: Warning! This message contains just for fun material. Don't take my comments too seriously.

I always thought 64 cycles per line is the most suitable number of cycles for c64. It's a pity that only very rare NTSC machines used it in the past.

1) 64 cycles covers all 512 pixels. Some of them are not visible pixels maybe but no 8 pixels gap is the best alternative for me. Actually more than 64 cycles is ok too.

2) Second reason is simple. It's a Commodore "64" god dammit! Why would it have 63 or 65 cycles per line? :D

In PAL mode, I could live with loosing 5 raster lines or so. Just a thought...

Let's get back to the topic. A funny (just for fun) alternative way of detecting PAL/NTSC would be to show two different stabilized rasterbar blocks using 63 and 65 cycles per line. User could select the correct looking block before the demo starts ;) Showing raster splits would be even nicer.

Yeah yeah, complete comment is pointless I know :)


hehe, nice "detection".
What about input"PAL? (YES/NO)";TV$
2009-04-28 15:17
Mix256
Account closed

Registered: Dec 2008
Posts: 26
Maybe a small game that is too hard on ntsc machines due to speed. So if the player completes the game it's a PAL one and if he dies it's a ntsc one.
2009-04-28 19:15
enthusi

Registered: May 2004
Posts: 679
or you could use drive composer to align the sound of the drive to a single speed tune.
If it matches its 60Hz, otherwise 50 :)
2009-04-28 19:59
Spinball

Registered: Sep 2002
Posts: 89
Quote: hehe, nice "detection".
What about input"PAL? (YES/NO)";TV$


just like this crack? Grand Prix Circuit +F
2010-10-01 02:04
The Shadow

Registered: Oct 2007
Posts: 304
Using this method, there should be a way to distinguish NTSC from Old NTSC-M.
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
MP Software/Hokuto F..
Exile/Anubis
iAN CooG/HVSC
E$G/HF ⭐ 7
Didi/Laxity
Alakran_64
JLD/Finnish Gold
Guests online: 416
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Codeboys & Endians  (9.7)
4 Mojo  (9.6)
5 Coma Light 13  (9.6)
6 Edge of Disgrace  (9.6)
7 Signal Carnival  (9.6)
8 Uncensored  (9.5)
9 Wonderland XIV  (9.5)
10 No Bounds  (9.5)
Top onefile Demos
1 Nine  (9.7)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.5)
6 Scan and Spin  (9.5)
7 Onscreen 5k  (9.5)
8 Grey  (9.5)
9 Dawnfall V1.1  (9.5)
10 Rainbow Connection  (9.5)
Top Groups
1 Artline Designs  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Performers  (9.3)
5 Censor Design  (9.3)
Top Organizers
1 Burglar  (9.9)
2 Sixx  (9.8)
3 Irata  (9.7)
4 hedning  (9.7)
5 MWS  (9.7)

Home - Disclaimer
Copyright © No Name 2001-2025
Page generated in: 0.045 sec.