| |
Flavioweb
Registered: Nov 2011 Posts: 463 |
$D019 to check for PAL/NTSC.
I saw the kernal check for bit 0 of $D019 to set video mode flag.
This fail with super cpu since the check is done too early to work.
So i want to know: what exactly set this bit to 1 for Pal and 0 for NTSC?
Is an internal vic operation, or there is something else that modify it?
And when exactly is modified during startup? |
|
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
The Kernal simply sets the raster comparator to $0137 which is the last rasterline of a PAL system and then checks if the IRQ flag is set after a while.
Anyway, the PAL/NTSC detection is broken anyway since the Kernal reset routine checks the PAL/NTSC flag at $02A6 to set PAL/NTSC timer values BEFORE $02A6 has been set by the $D019 check routine. |
| |
Flavioweb
Registered: Nov 2011 Posts: 463 |
Looking at kernal code, i noticed that $02A6 is changed before the $D019 check, but usually, both on emulated or rh stock machines, the value of the flag is correct...
So i thought that isn't "always" broken...
Thanks anyway for explanation... |
| |
Moloch
Registered: Jan 2002 Posts: 2928 |
I've heard its broken quite a few times, but I know most, if not all, fixers used it and it worked. |
| |
Flavioweb
Registered: Nov 2011 Posts: 463 |
I think i understand the meaning of "broken": the kernal implementation of checking $02A6 to identify PAL/NTSC is broken, but $02A6 "setup" works as well (on stock machines).
So: value in $02A6 is correct but is badly "used" by kernal. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
its also not always correct, there is a slight chance the value is wrong |
| |
Flavioweb
Registered: Nov 2011 Posts: 463 |
I'm sorry... but i can't understand how things works...
As Graham pointed out, kernal setup raster comparision to $0137, then check $D019 for irq.
But i can't find into kernal code the right point where $D012 is writed with some values for the comparision.
Accordingly with AAY:
Kernal-Reference: LDA $D012 : $FF5E
and no other references of $d012 exist...
So...
Where the comparision value is set? |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
look for d019, as pointed out kernal checks d019 if irq flag has been set. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
the initial values are set at e5a0 and come from the table at ecb9 |
| |
Flavioweb
Registered: Nov 2011 Posts: 463 |
Looking at the table seems that $D01A is set to 00...
How can irq start?
Maybe $D01A is update somewhere else...?
Ghosh... |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
d01a controls whether the VIC generates an external IRQ, the bit in d019 is always set, regardless of that. |