| |
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 |
|
| |
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. |
| |
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? |
| |
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.. |
| |
Copyfault
Registered: Dec 2001 Posts: 453 |
Quoting JackAsserYou 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 |
| |
Copyfault
Registered: Dec 2001 Posts: 453 |
Quoting DanPhillipsLooking 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 DanPhillipsBooting 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 DanPhillipsA 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 |
| |
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 |
| |
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. |
| |
hedning
Registered: Mar 2009 Posts: 4155 |
More reading:
$D019 to check for PAL/NTSC.
PAL/NTSC detect
detecting pal, drean, ntsc or old ntsc |
| |
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. |
| |
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 :) |