Skip to content
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

xbox: Remove XVideoSetMode from XboxCRTEntry #3

Merged
merged 1 commit into from
Aug 1, 2019

Conversation

dracc
Copy link

@dracc dracc commented May 18, 2019

This should be done per application, not before the application has launched.

@dracc
Copy link
Author

dracc commented May 18, 2019

I believe most (if not all) major stake holders have been prepared for this change. Let's pull the plug soon:tm:

@JayFoxRox
Copy link
Member

Most of them didn't merge yet.

I believe they could merge regardless of this change - the only thing that happens is that the existing mode will be set twice (in quick succession).

This should be tested and then this can marinade for a while.

This change was also primarily motivated by myself, and other maintainers might have other / better ideas (although I consider this change unproblematic); they should get a chance to look at this - which might take a while.

@JayFoxRox
Copy link
Member

We'll wait with this one until #4 has completed; we want 2 separate submodule updates in nxdk (1. pdclib update / 2. XVideoSetMode removal).

@JayFoxRox
Copy link
Member

Important note for the follow-up nxdk PR (when updating submodule):

vmCurrent in lib/hal/video.c will be uninitialized until the first call of XVideoSetMode (the same happens if XVideoSetMode couldn't find a mode).

A temporary solution will be to initialize it to an unknown state, and to disallow certain APIs (including debugPrint) until XVideoSetMode was explicitly called.

A possible permanent solution would be to refactor all APIs, or to detect if the mode is unknown, and read the hardware state.

We should be able to recover the pVidMode->dwMode from XVideoInit, using:

ULONG mode;
AvSendTVEncoderOption(0xFD000000, 13, 0, &mode);

That should give us the width and height.

For the framebuffer format (bits per pixel) we'll probably have to query the CR[0x28] and RAMDAC registers.

@thrimbor
Copy link
Member

thrimbor commented Aug 1, 2019

I think enough time has passed to go ahead with this. Merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants