Skip to content

Commit 48da113

Browse files
authored
[Feature] VMC Group Support (#1547)
* Test * Add VMC groups support * fix * modified structure * format * format
1 parent 0443c58 commit 48da113

File tree

4 files changed

+1414
-2
lines changed

4 files changed

+1414
-2
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ endif
7373

7474
FRONTEND_OBJS = pad.o xparam.o fntsys.o renderman.o menusys.o OSDHistory.o system.o lang.o lang_internal.o config.o hdd.o dialogs.o \
7575
dia.o ioman.o texcache.o themes.o supportbase.o bdmsupport.o ethsupport.o hddsupport.o zso.o lz4.o \
76-
appsupport.o gui.o guigame.o textures.o opl.o atlas.o nbns.o httpclient.o gsm.o cheatman.o sound.o ps2cnf.o
76+
appsupport.o gui.o guigame.o vmc_groups.o textures.o opl.o atlas.o nbns.o httpclient.o gsm.o cheatman.o sound.o ps2cnf.o
7777

7878
IOP_OBJS = iomanx.o filexio.o ps2fs.o usbd.o bdmevent.o \
7979
bdm.o bdmfs_fatfs.o usbmass_bd.o iLinkman.o IEEE1394_bd.o mx4sio_bd.o \

include/vmc_groups.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#ifndef VMC_GROUPS_H
2+
#define VMC_GROUPS_H
3+
4+
5+
/**
6+
* @brief Finds the Group ID associated with a given Title ID.
7+
*
8+
* This function iterates through all embedded memory card groups.
9+
* If the provided Title ID is found within any group's list of Title IDs,
10+
* the Group ID for that group is returned.
11+
* If the Title ID is not found in any group, the original Title ID
12+
* passed as a parameter is returned.
13+
*
14+
* @param titleId A null-terminated string representing the Title ID to search for.
15+
* @return A const char* pointer to the Group ID string if found,
16+
* otherwise, a const char* pointer to the original titleId parameter.
17+
*/
18+
const char *getGroupIdForTitleId(const char *titleId);
19+
#endif // VMC_GROUPS_H

src/guigame.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "include/system.h"
1616
#include "include/guigame.h"
1717
#include "include/ds34common.h"
18+
#include "include/vmc_groups.h"
1819

1920
#ifdef PADEMU
2021
#include <libds34bt.h>
@@ -213,7 +214,8 @@ static int guiGameShowVMCConfig(int id, item_list_t *support, char *VMCName, int
213214
return 1; // nothing to validate if no user input
214215

215216
char *startup = support->itemGetStartup(support, id);
216-
snprintf(vmc, sizeof(vmc), "%s_%d", startup, slot);
217+
const char *vmcTitle = getGroupIdForTitleId(startup);
218+
snprintf(vmc, sizeof(vmc), "%s_%d", vmcTitle, slot);
217219
}
218220

219221
vmc_refresh = 0;

0 commit comments

Comments
 (0)