-
-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: RGB output mode support #167
base: master
Are you sure you want to change the base?
Conversation
Previously, the encoder was configured only once during VIDEO_Init(), and would not be re-configured when VIDEO_Configure(mode) was called. Since we can switch from a non-RGB to an RGB mode, we need to be able to reconfigure the encoder at configure-time. This commit extends the mode-switching mechanism to also allow scheduling for encoder setting changes at run-time. Moreover, since there are more RGB video modes than EURGB60, we extend the mode struct with a flag to indicate whether the mode is RGB or not or not for easy internal use. Adding it to the VI_TVMODE enumeration was also considered, but decided against since it would break the VIDEO_GetCurrentTvMode() ABI for EURGB60 modes.
This mode was used in the Wii arcade board (RVA-001). Detecting it for use with VIDEO_GetPreferredMode() would require some logic involving reading /title/00000001/00000002/data/RVA.txt since that is the main method used to detect the board instead of SC. Due to the relative clumsiness involved I decided to leave it out for now.
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. 👀 |
Hi @shizmob, 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 |
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 |
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? |
@shizmob : is this ready to be reviewed/merged? :) |
@@ -65,6 +65,7 @@ typedef struct _gx_rmodeobj { | |||
u16 viWidth; | |||
u16 viHeight; | |||
u32 xfbMode; | |||
u8 rgb; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we do without this extra field, and assume that VI_TVMODE_DEBUG_PROG
is always RGB?
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:
/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 byVIDEO_GetPreferredMode()
(yet).