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

Unify the way of setting game ID, title ID, revision #5045

Merged
merged 3 commits into from Mar 9, 2017

Conversation

JosJuice
Copy link
Member

@JosJuice JosJuice commented Mar 9, 2017

The existing code from ConfigManager, ES and MIOS is merged into a new set of functions called SetRunningGameMetadata.

@JosJuice
Copy link
Member Author

JosJuice commented Mar 9, 2017

There's an unfortunate thing with this: Some Wii disc games seem to have different revisions in the TMD than in the disc header. (Or am I just getting it the wrong way from the TMD?) I tried SSBB (RSBE01r1), and it had 1 in the disc header and 0 in the TMD.

When booting a Wii disc game, SetRunningGameMetadata ends up being called once with the TMD (which I assume is because of ES) after the boot process already has called it with the volume, so the disc header revision gets replaced. It doesn't really matter right now since we currently don't use the revision for anything after booting, but it will matter in the future if we get the ability to reload game INIs when changing game.

Just as a note: Before this PR, ES used to never update the revision. That doesn't seem like a good idea - we should either set it to a good value or to 0. (MIOS did the same with the title ID.)

@JosJuice JosJuice force-pushed the unify-setting-game-metadata branch from 786877d to 43a6832 Compare March 9, 2017 10:00

if (was_changed)
{
NOTICE_LOG(BOOT, "Game ID set to %s", game_id.c_str());

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@@ -414,9 +414,7 @@ void Stop()

void RestoreConfig()
{
SConfig::GetInstance().LoadSettingsFromSysconf();

This comment was marked as off-topic.

This comment was marked as off-topic.

@leoetlino
Copy link
Member

There's an unfortunate thing with this: Some Wii disc games seem to have different revisions in the TMD than in the disc header.

Yes, the revision does not always match, sadly. I'm not sure how this can be solved -- maybe we should just always use the revision from the disc header for disc titles. But then we would have to go out of the way to get the revision from the disc, since ES only gets a TMD…

The existing code from ConfigManager, ES and MIOS is merged
into a new set of functions called SetRunningGameMetadata.
@JosJuice JosJuice force-pushed the unify-setting-game-metadata branch from 43a6832 to ced1614 Compare March 9, 2017 14:34
@JosJuice
Copy link
Member Author

JosJuice commented Mar 9, 2017

What do you think about calling SetRunningGameMetadata(DVDInterface::GetVolume()) from void SetRunningGameMetadata(const TMDReader& tmd) when IsDiscTitle(title_id)? (Maybe with an extra check to ensure that the volume's title ID is identical to tmd.GetTitleId(), in case someone has installed a channel with a weird ID that passes IsDiscTitle? And I suppose we'd need a VolumeIsValid() check too...)

@leoetlino
Copy link
Member

Sounds good to me with that check. Actually -- if you have the tmd.GetTitleId() == volume.GetTitleId() check, it shouldn't be necessary to check IsDiscTitle.

@JosJuice
Copy link
Member Author

JosJuice commented Mar 9, 2017

Done.

Copy link
Member

@leoetlino leoetlino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Helios747 Helios747 merged commit cf848b7 into dolphin-emu:master Mar 9, 2017
@JosJuice JosJuice deleted the unify-setting-game-metadata branch March 9, 2017 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants