libogc icon indicating copy to clipboard operation
libogc copied to clipboard

WIP: RGB output mode support

Open shizmob opened this issue 2 years ago • 5 comments

The Wii arcade console (RVA-001) only has a VGA connector, no composite. This PR adds support to libogc for video output over that connector. It has the following caveats:

  • The RVA seems to be detected by the stock NAND boot programs by checking for the existence of /title/00000001/00000002/data/RVA.txt as opposed to some SC console type setting. As I was not quite sure how to factor this (there seems to be generally no console type detection in libogc), I left this out for now and the mode needs to be manually set using e.g.VIDEO_Configure(&TVRgb480Prog), and it is not returned by VIDEO_GetPreferredMode() (yet).
  • As the video encoder needs to be reconfigured when switching modes from and to RGB-capable modes, some internals were refactored to allow doing this. This likely also fixes issues stemming from switching to and from EURGB60 at runtime, if any.
  • I have tested this on an RVA, but not yet exhaustively with stock consoles from various regions, or e.g. an NDEV. I'm marking the PR WIP until this has been done.

shizmob avatar Jan 28 '24 14:01 shizmob

Testing from other people who have access to Wiis is highly welcome by the way, as well as general review and comments on the PR. 👀

shizmob avatar Jan 29 '24 11:01 shizmob

Hi @shizmob, thanks for making this PR!

we are currently busy with other stuff related to gamecube/wii and will look at this later. so far, i would like to add support for the arcade hardware!

i do have a question. if you say nand boot programs check for that file, do you mean the piece of code that every title has that is loaded and started when the PPC is bootstrapped by IOS? (aka, run on 0x00003400). thats good to know if thats the case, though i wonder how it checks that. through IOS calls? i always thought that code only setup the PPC which is why it was so small

DacoTaco avatar Jan 29 '24 17:01 DacoTaco

Hi, thanks for the response! Yes, according to WiiBrew it is the NAND boot program, the stub that's included with every title, that checks it. I just analyzed one to confirm, it seems to just call into IOS.

Of note is that while it sets some internal flag that later presumably gets used by OSGetConsoleType() or the like, all the software on the RVA-001 seems custom-built for it, and manually initialises the video to RGB mode using a separate function that is presumably in the VI library. I think we can do better though. :-)

shizmob avatar Jan 30 '24 13:01 shizmob

hopefully we can do better, but checking the file might be a good idea if the VI wasn't init before. that said, i didn't see that file check in nandbootprogram yet. but then again, i never looked deep into it haha.

this kinda means that nand boot programs are not something they slapped on any dol, but build into them. cool!

is any testing still needed?

DacoTaco avatar Jan 30 '24 17:01 DacoTaco

@shizmob : is this ready to be reviewed/merged? :)

DacoTaco avatar Aug 02 '24 16:08 DacoTaco