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: 30
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: 1714
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: 541
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: 1989
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: 466
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: 466
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: 30
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: 2839
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: 4595
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: 30
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: 2070
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
Thunder.Bird/HF/MYD!..
V-12/Tropyx
Guests online: 125
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Bromance  (9.6)
10 Memento Mori  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Onscreen 5k  (9.5)
8 Wafer Demo  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Musicians
1 Rob Hubbard  (9.7)
2 Jeroen Tel  (9.6)
3 Stinsen  (9.6)
4 Mutetus  (9.6)
5 Linus  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.063 sec.