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 Coding > Detect Pal/NTSC
2023-01-10 04:59
DanPhillips

Registered: Jan 2003
Posts: 22
Detect Pal/NTSC

Looking at https://codebase64.org/doku.php?id=base:detect_pal_ntsc

I've tried several of them, all failed at some point.
Booting from cart, waiting for line 0, call the id machine type, trying Pal/PalN/NTSC/NTSCOld in the latest version of Vice x64sc.exe.

A few will work if you soft reset, but that looks like it's relying on the state of the machine as setup by the kernal?

Cheers

Dan
2023-01-10 08:26
tlr

Registered: Sep 2003
Posts: 1628
Quote: Looking at https://codebase64.org/doku.php?id=base:detect_pal_ntsc

I've tried several of them, all failed at some point.
Booting from cart, waiting for line 0, call the id machine type, trying Pal/PalN/NTSC/NTSCOld in the latest version of Vice x64sc.exe.

A few will work if you soft reset, but that looks like it's relying on the state of the machine as setup by the kernal?

Cheers

Dan


Lots of variants and information there. Most of the variants doesn’t seem to rely on the kernal for the detection.

You’ll have to be more specific.
2023-01-10 08:37
TWW

Registered: Jul 2009
Posts: 514
My version does not care about KERNAL, it simply counts cycles based on raster position. I've tried it with variable time delay on startup and it hasn't failed yet.

Edit: "Make sure no interrupts occur during the runtime of the routine." - Did you make sure?

Can you as tlr ask, give more details?
2023-01-10 14:08
JackAsser

Registered: Jun 2002
Posts: 1938
You may use my detect code in Eye of the Beholder. I boots from cart and do not rely on kernel. It detects PAL/NTSC old/NTSC new/DREAN, C64/C128, VDC-chip and SID-chip: https://bitbucket.org/JackAsser/eye-of-the-beholder-c64/src/mas..
2023-01-10 14:19
Copyfault

Registered: Dec 2001
Posts: 453
Quoting JackAsser
You may use my detect code in Eye of the Beholder. I boots from cart and do not rely on kernel. It detects PAL/NTSC old/NTSC new/DREAN, C64/C128, VDC-chip and SID-chip: https://bitbucket.org/JackAsser/eye-of-the-beholder-c64/src/mas..


Oh, I remember you asked to use my approach, JA (the very last one on the codebase-page linked by Dan)... basically you did, but you used the timer regs more directly, so now I know ;)

This should work as long as no accelerated CPU is in play, so it'd be interesting to know how Dan's setup looks like in detail!

Cheers,

CF
2023-01-10 14:24
Copyfault

Registered: Dec 2001
Posts: 453
Quoting DanPhillips
Looking at https://codebase64.org/doku.php?id=base:detect_pal_ntsc

I've tried several of them, all failed at some point.


Could you share some details about which of the examples you tried and where exactly they fail?

Quoting DanPhillips
Booting from cart, waiting for line 0, call the id machine type, trying Pal/PalN/NTSC/NTSCOld in the latest version of Vice x64sc.exe.


What exactly does "call the id machine type" mean here?

Quoting DanPhillips
A few will work if you soft reset, but that looks like it's relying on the state of the machine as setup by the kernal?

Cheers

Dan


As stated in my former post, I did the last code snipplets on the codebase page, so if you want to use these, pm me in case somethings not working.

Generally, sharing the details would help everyone to either correct the errors that you might have found - otherwise, it'll speed up pointing to the actual reason why it didn't work ;)

Looking forward to what you're cooking up!

CF
2023-01-10 15:55
DanPhillips

Registered: Jan 2003
Posts: 22
Thanks guys,

I hadn't tried the last one on the page :)

tried the 1st 3 and got them all to fail...some took a lot of boots.


Thanks TWW/JackAsser, will try that one :)


Cheers

Dam
2023-01-11 00:01
Krill

Registered: Apr 2002
Posts: 2534
I dunno, this seems a bit odd to me.

Have you tested the routines that failed for you in a cart-less environment, and did they also fail there?

Also note that the first 2-3 routines do not support all 4 variants (lacking NTSC-old or PAL-N detection), as mentioned in the prose.
2023-01-11 00:36
hedning

Registered: Mar 2009
Posts: 4155
More reading:

$D019 to check for PAL/NTSC.

PAL/NTSC detect

detecting pal, drean, ntsc or old ntsc
2023-03-12 12:46
DanPhillips

Registered: Jan 2003
Posts: 22
Just to update this.

I found the problem, something to do with being an idiot.

I don't want to go into details, but figure I should :)

As part of the cart boot routine I was calling the detection code, which then proceeded to write the machine type to RAM.

And then I copied all the code necessary to RAM.
The byte used to store machine type was part of that code.

a .byte instead of a .fill :)

The copy to RAM overwrote the calculated machine type with a default.

FFS.

Cheers guys, all sorted a while back but forgot to update the thread.

Dan.
2023-03-12 18:07
TheRyk

Registered: Mar 2009
Posts: 1716
Hehe thanks for your confession, you're not the first coder who must admit the problem was sitting in front of the computer, and you won't be the last to make that experience :)
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
Bones99
TLF/Sonic Uproar
Zagon
Airwolf/F4CG
Nordischsound/Hokuto..
zbych
Menace/Spaceballs
d0c
Guests online: 105
Top Demos
1 Edge of Disgrace  (9.6)
2 Coma Light 13  (9.6)
3 Uncensored  (9.6)
4 Comaland 100%  (9.6)
5 Lunatico  (9.6)
6 Bromance  (9.5)
7 E2IRA  (9.5)
8 Unboxed  (9.5)
9 The World Is Not Eno..  (9.5)
10 Memento Mori  (9.5)
Top onefile Demos
1 Party Elk 2  (9.9)
2 Copper Booze  (9.6)
3 Barry Boomer - Trapp..  (9.5)
4 Dawnfall V1.1  (9.5)
5 Daah, Those Acid Pil..  (9.5)
6 Onscreen 5k  (9.5)
7 POKE 56576,1 for Unl..  (9.5)
8 No Mercy for the Tro..  (9.4)
9 Offering  (9.4)
10 Selbuvotter Latitudes  (9.4)
Top Groups
1 Booze Design  (9.4)
2 Censor Design  (9.3)
3 Crest  (9.3)
4 Oxyron  (9.2)
5 Maniacs of Noise  (9.2)
Top Graphicians
1 Talent  (9.9)
2 Mirage  (9.8)
3 Archmage  (9.8)
4 Electric  (9.7)
5 Mikael  (9.7)

Home - Disclaimer
Copyright © No Name 2001-2023
Page generated in: 0.056 sec.