Skip to content

Commit 32f4bfc

Browse files
committed
Fix DLC enumeration
Hook by Rei-san
1 parent 4121829 commit 32f4bfc

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

MarathonRecomp/install/installer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ static const std::string DLCDirectory = "dlc";
2020
static const std::string EpisodeSonicDirectory = DLCDirectory + "/Episode Sonic Boss Attack";
2121
static const std::string EpisodeShadowDirectory = DLCDirectory + "/Episode Shadow Boss Attack";
2222
static const std::string EpisodeSilverDirectory = DLCDirectory + "/Episode Silver Boss Attack";
23-
static const std::string EpisodeAmigoDirectory = DLCDirectory + "/Episode Team Attack Amigo";
23+
static const std::string EpisodeAmigoDirectory = DLCDirectory + "/Team Attack Amigo";
2424
static const std::string MissionSonicDirectory = DLCDirectory + "/Mission Pack Sonic Very Hard";
2525
static const std::string MissionShadowDirectory = DLCDirectory + "/Mission Pack Shadow Very Hard";
2626
static const std::string MissionSilverDirectory = DLCDirectory + "/Mission Pack Silver Very Hard";

MarathonRecomp/kernel/xam.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,23 @@ uint32_t XamEnumerate(uint32_t hEnum, uint32_t dwFlags, void* pvBuffer, uint32_t
293293
return ERROR_SUCCESS;
294294
}
295295

296+
// Patch DLC enumeration format string to allow for whitespace
297+
PPC_FUNC_IMPL(__imp__sub_825B14B8);
298+
PPC_FUNC(sub_825B14B8) {
299+
const char* _str = (const char*)g_memory.Translate(ctx.r3.u32);
300+
uint32_t _1;
301+
char _str_end[255];
302+
sscanf(_str, "download:\\%08x\\%255[^\n\r]", &_1, _str_end);
303+
304+
XCONTENT_DATA _data;
305+
_data.dwContentType = 2;
306+
_data.DeviceID = _1;
307+
308+
memcpy(&_data.szFileName, &_str_end, strlen(_str_end) + 1);
309+
310+
XamContentCreateEx(0, "download", &_data, 3, 0, 0, 0, 0, 0);
311+
}
312+
296313
uint32_t XamContentCreateEx(uint32_t dwUserIndex, const char* szRootName, const XCONTENT_DATA* pContentData,
297314
uint32_t dwContentFlags, be<uint32_t>* pdwDisposition, be<uint32_t>* pdwLicenseMask,
298315
uint32_t dwFileCacheSize, uint64_t uliContentSize, PXXOVERLAPPED pOverlapped)

0 commit comments

Comments
 (0)