hoglet67 / RGBtoHDMI

Bare-metal Raspberry Pi project that provides pixel-perfect sampling of Retro Computer RGB/YUV video and conversion to HDMI
GNU General Public License v3.0
806 stars 112 forks source link

Flashing screen using NTSC C64 Lumacode #355

Open jc13git opened 7 months ago

jc13git commented 7 months ago

Hello - I have just installed the VIC-II Lumacode board in an NTSC C64 and am having trouble with the screen flashing once a second or so (unless the menu is on-screen). This seems to be similar to an Amiga issue from a couple of years ago. I'm a new user of the RGBtoHDMI, so it's likely that I'm doing something wrong, but when I select C64 Lumacode and the 60Hz sub profile it looks great - until I exit the RGBtoHDMI menu. That's when the flashing starts. Also, I'm not sure if the RGBtoHDMI should be autodetecting the profile, but it doesn't do that at reboot (the pictures show auto_switch is off - this was later on in the troubleshooting). It always defaults to the 50Hz sub-profile. Once other piece of information is that the Lumacode board has a "special" firmware on it due to my VIC chip being the earlier 6567R56A variant. Maybe there needs to be a special profile for that chip? Pictures are attached showing a little more information. Thanks for any suggestions and if any other info would help, let me know and I'll gather it.

Initial Power On InitialPoweron

After Setting SubProfile to 60Hz AfterSettingSubProfileto60

Source Summary SourceSummary

c0pperdragon commented 7 months ago

For this specific chip, the total sample resolution is 1024x261 instead of the 1040x262 for usual NTSC. So I guess this would really need a 3rd profile. Maybe then auto-selection would also work.

c0pperdragon commented 7 months ago

Hm, maybe I have mixed up the numbers, and it is in fact 1024x262 for the "special" NTSC and 1040x263 for "usual" NTSC.

IanSB commented 7 months ago

@jc13git

First wipe your SD card and install the latest beta from here: https://github.com/IanSB/RGBtoHDMI/releases Then download this file: C64LC_R56A_60Hz.txt

and put it in \Profiles\6-12_BIT_YUVAnalog\Commodore\Commodore_64Lumacode on the SD card and reboot the Pi

You will need to centre the image by adjusting the H and V offsets in the geometry menu, then save the configuration and post the completed profile for inclusion in the next release. Saved profiles will be in /Saved_Profiles on the SD card.

jc13git commented 7 months ago

@IanSB and @c0pperdragon

Initial testing looks good. I'll get the lumacode board wired in more permanently and do some more testing, but it seems to work. It also auto-detected the sub profile too. Thanks to both of you for your help and building these awesome pieces of hardware and software!

tyristori commented 7 months ago

Sorry for the non topic question but how do I edit the default Commodore 64 palette in RGBtoHDMI?

I can't find any palette related files in the software archive.

Default C64 palette is a bit too saturated for my taste and I would like to edit it.

IanSB commented 7 months ago

@tyristori

The palette files are generated programmatically during first boot up so will appear in the /Palettes folder on the SD card (The c64 uses the colodore algorithm). You can manually edit those files after that or create new ones and put them in that folder and they will also appear for selection after subsequent rebooting.

You can also change the overall palette by varying the settings like saturation in the palette menu

I haven't actually got around to documenting creating your own palette files but it is pretty straightforward: The palette table is 256 32 bit words plus an additional 32 bit word on the end containing the number of palette entries that are active (this will vary depending on the computer).

Each 32 bit palette value is 4 bytes (0-255) in the following order: red, green, blue, mono (the luminance value used in mono mode) So for the C64 the first 16 words would be the colours and the 257th word would be 0x00000010 (16) Generally you should repeat the palette data for the rest of the 256 entries.

There is a slight problem with the C64 lumacode as the order of the colours doesn't match the standard C64 colour order so you have to take that into account when creating the table. See the table at the bottom of this page: https://github.com/c0pperdragon/LumaCode/wiki/VIC-II-dizer-(for-the-C64-computer)

tyristori commented 7 months ago

@IanSB

I have c0pperdragon's C64 Video Enhancement mod and for analog YUV I used colodore with it. So if RGBtoHDMI uses colodore too then I don't need to edit it. I have RGBtoHDMI connected to LG OLED tv so I guess it was the punchy colors of OLED that tricked me to think that the palette was something else than colodore :)

I see that you released a beta version of the software that has a support for RPi 4. I have ordered RPi 4 to test it.