Page 1 of 2

Colour blue on NTSC VICs.

Posted: Wed Oct 25, 2023 3:05 am
by pixel
Hi there!

Is this really happening on real NTSC VICs? The blue bricks are black inside with VICE:
viclue.png

Re: Colour blue on NTSC VICs.

Posted: Wed Oct 25, 2023 3:28 am
by tokra
This is not happening in VICE for me. Both WinVICE 3.2 and the latest GTK VICE 3.7.1

Bricks are blue as they should be. You picture shows them as a blue outline with red stripes inside? Strange. I'd suggest deleting the vice.ini and starting fresh.

Re: Colour blue on NTSC VICs.

Posted: Wed Oct 25, 2023 3:45 am
by groepaz
Link to the PRG?

There might be a problem with limiting the values in the CRT emulation, so something overflows.

Re: Colour blue on NTSC VICs.

Posted: Wed Oct 25, 2023 4:05 am
by furroy
i had weird color issues in vice until i changed my palette to colodore. all other palettes had weird, yet different issues.

Re: Colour blue on NTSC VICs.

Posted: Wed Oct 25, 2023 4:41 am
by pixel
groepaz wrote: Wed Oct 25, 2023 3:45 am Link to the PRG?

There might be a problem with limiting the values in the CRT emulation, so something overflows.
Here you go:
arukanoido.zip
(20.91 KiB) Downloaded 41 times
Would be more comfy if one could upload PRGs here (for both uploaders and downloaders). 8)

Re: Colour blue on NTSC VICs.

Posted: Wed Oct 25, 2023 4:54 am
by pixel
tokra wrote: Wed Oct 25, 2023 3:28 am This is not happening in VICE for me. Both WinVICE 3.2 and the latest GTK VICE 3.7.1

Bricks are blue as they should be. You picture shows them as a blue outline with red stripes inside? Strange. I'd suggest deleting the vice.ini and starting fresh.
Thanks! (For Linux users: it's probably ~/.config/vice/vicerc)

That fixed blue but killed green:
vicoldrc.png
(Old config with VICExternalPalette=1. No idea which one that would be.)
vicnewrc.png
(With vicerc vanished.)

EDIT: BTW I'm using the latest code from the subversion repository.

Re: Colour blue on NTSC VICs.

Posted: Wed Oct 25, 2023 5:31 am
by groepaz
No problem at all here, with xvic -default

(No need to actually delete vice.ini, starting with -default does the same)

Edit: Just realized i was missing NTSC - i also see green turned into cyan now. No idea if that is just how it is?

Re: Colour blue on NTSC VICs.

Posted: Wed Oct 25, 2023 6:33 am
by tokra
Just checked. Green looks like Cyan on my VICE as well. That is only with the internal palette, however. If you choose "Mike (NTSC)" as external palette in Settings-Display-VIC-VIC palette it looks more like green, and this palette was derived my Mike from the results from my personal NTSC-machine using his colour-test-program and S-Video output:

viewtopic.php?p=118949#p118949

Re: Colour blue on NTSC VICs.

Posted: Wed Oct 25, 2023 6:47 am
by pixel
tokra wrote: Wed Oct 25, 2023 6:33 am … however. If you choose "Mike (NTSC)" as external palette in Settings-Display-VIC-VIC palette it looks more like green…
Turned out that I was using that palette as well. Looking more like a bug in VICE. Subtracted a bit from the blue value but that only made the blue borders wider at the sides.

Re: Colour blue on NTSC VICs.

Posted: Wed Oct 25, 2023 8:06 am
by groepaz
> Just checked. Green looks like Cyan on my VICE as well. That is only with the internal palette, however. If you choose "Mike (NTSC)" as external palette in Settings-Display-VIC-VIC palette it looks more like green, and this palette was derived my Mike from the results from my personal NTSC-machine using his colour-test-program and S-Video output:

And according the comments in the source, the internal palette was tweaked to look like this one - at some point. Some other change probably broke it again. I'll have a look

Re: Colour blue on NTSC VICs.

Posted: Wed Oct 25, 2023 11:08 am
by mathop
The NTSC VIC has two variations of cyan apparently.
I found this post that may be related https://www.lemon64.com/forum/viewtopic.php?p=979712
My NTSC VIC cyan looks distinctly blue so I guess this is an older variant - see images from capture card (NTSC contrast is a bit off but the color should be correct.)
vbars_pal.png
pal
vbars_ntsc.png
ntsc

[edit] never mind - the issue is apparently that green is looking rather like cyan. This appears to be the case on a real VIC also. The 'normal' colors (2-8) have a phase error on NTSC compared to their lighter variations (9-15) - this is due to how the color signal is generated on the chip.
PAL does not have this issue since there the phase errors cancel out more or less.

Re: Colour blue on NTSC VICs.

Posted: Wed Oct 25, 2023 11:30 am
by pixel
Are these bars correct? If I count from left to right green is at index 8 (when starting with 0).

Re: Colour blue on NTSC VICs.

Posted: Wed Oct 25, 2023 11:59 am
by mathop
The order from left to right is
black / white
red / light red
cyan / light cyan
purple / light purple
green / light green
blue / light blue
yellow / light yellow
orange / light orange
so then green would be at index 8 indeed.

I also notice that yellow is also very greenish (compared to light yellow.)
It could well be that newer NTSC VICs don't have this exaggerated phase difference.

(FWIW I attached the colorbar programs below - these are for the unexpanded VIC - i.e. they don't work if you have a memory expansion.)

Re: Colour blue on NTSC VICs.

Posted: Thu Oct 26, 2023 6:43 am
by groepaz
The 'normal' colors (2-8) have a phase error on NTSC compared to their lighter variations (9-15) - this is due to how the color signal is generated on the chip.
Can you quantify that phase error? I am experimenting a bit now... i added 30 degrees to colors 0-8, the result seems close to your capture, *except* the blueish cyan, which turns out noticeably less blueish (so perhaps there is more to it?)

Edit: BUT it does quite closely match (including cyan) the reference pictures tokra made a while ago. No idea where the strange (obviously broken) tweaks came from before. I will clean this up and commit.

Edit++: comitted in r44613, grab dev build here in half an our or so: https://github.com/VICE-Team/svn-mirror/releases

Re: Colour blue on NTSC VICs.

Posted: Thu Oct 26, 2023 10:48 am
by mathop
If needed I can do a new capture - in theory I could also measure the phase offset between light and dark colors with my oscilloscope, although how exactly I haven't yet found out. :)