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

fix multi-game disc support for /app_home #1075

Merged
merged 1 commit into from
May 12, 2024

Conversation

bibarub
Copy link
Contributor

@bibarub bibarub commented May 12, 2024

set_bdvd_as_app_home() was removed because it's redundant (check line 1748)

@aldostools aldostools merged commit 5849b09 into aldostools:master May 12, 2024
@aldostools
Copy link
Owner

I think line 929 should be changed back to static u8 gm = 01;

So PS3_GM01 will be always the first folder mounted and PS3_GAME will be the last.

Your current code will mount PS3_GAME only for the first game. After that all games will follow the behavior described above.

@aldostools
Copy link
Owner

aldostools commented May 12, 2024

Or maybe this code:

void map_app_home(const char *path)
{
	unmap_app_home();

	// remap app_home for multi-game discs
	char *mpath = (char *)malloc(strlen(path) + sizeof("/PS3_GAME") + 1);
	if(mpath)
	{
		sprintf(mpath, "%s/PS3_GM%02i", path, gm);
		if(not_exists(mpath))
		{
			sys_map_path("/app_home", path);

			sprintf(mpath, "%s/PS3_GM01", path);
			gm = isDir(mpath) ? 01 : 00; // reset gm to 00 if the game is not a multi-game disc
		}
		else
		{
			sys_map_path(APP_HOME_DIR, mpath); gm++;
		}

		free(mpath);
	}
}

@bibarub
Copy link
Contributor Author

bibarub commented May 12, 2024

I think line 929 should be changed back to static u8 gm = 01;

So PS3_GM01 will be always the first folder mounted and PS3_GAME will be the last.

Your current code will mount PS3_GAME only for the first game. After that all games will follow the behavior described above.

PS3_GAME -> PS3_GM01 -> PS3_GM.. is the order the XMB uses for multi-game discs, so i don't think it should be changed
my code does exactly that - it mounts PS3_GAME first, then cycles through GM folders, until it runs out of them, and then mounts PS3_GAME again

(correct me if i'm wrong, i'm new to C)

@aldostools
Copy link
Owner

Yes your code does it right for the first game. After that the variable gm never return to 00.
So when a new game is mounted, the variable gm return to 01 (for non multi-game discs or mounts the next folder in the cycle if the new game is also a multi-game disc).

The code above fixes this behavior, except when the new game is also a multi-game disc.

@bibarub
Copy link
Contributor Author

bibarub commented May 12, 2024

why should it return to 0? if GMXX doesn't exist, it will simply follow the "if(not_exists(mpath))" condition and mount /app_home to /dev_bdvd. adding another check just creates redundancy imo

@bibarub
Copy link
Contributor Author

bibarub commented May 12, 2024

oh, i think i finally understand what you mean

bibarub added a commit to bibarub/webMAN-MOD that referenced this pull request May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants