diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index dc9e3c236..bccc00e71 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -427,13 +427,6 @@ extern "C" void InitOTR() { SaveManager::Instance = new SaveManager(); CustomMessageManager::Instance = new CustomMessageManager(); ItemTableManager::Instance = new ItemTableManager(); - auto t = OTRGlobals::Instance->context->GetResourceManager()->LoadFile("version"); - - if (!t->HasLoadError) - { - uint32_t gameVersion = OTRGlobals::Instance->context->GetResourceManager()->GetGameVersion(); - OTRGlobals::Instance->context->GetResourceManager()->SetGameVersion(gameVersion); - } clearMtx = (uintptr_t)&gMtxClear; OTRMessage_Init(); @@ -638,9 +631,12 @@ extern "C" uint16_t OTRGetPixelDepth(float x, float y) { return OTRGlobals::Instance->context->GetPixelDepth(x, y); } -extern "C" uint32_t ResourceMgr_GetGameVersion() -{ - return OTRGlobals::Instance->context->GetResourceManager()->GetGameVersion(); +extern "C" uint32_t ResourceMgr_GetNumGameVersions() { + return OTRGlobals::Instance->context->GetResourceManager()->GetGameVersions().size(); +} + +extern "C" uint32_t ResourceMgr_GetGameVersion(int index) { + return OTRGlobals::Instance->context->GetResourceManager()->GetGameVersions()[index]; } uint32_t IsSceneMasterQuest(s16 sceneNum) { diff --git a/soh/soh/OTRGlobals.h b/soh/soh/OTRGlobals.h index 22a168377..549332785 100644 --- a/soh/soh/OTRGlobals.h +++ b/soh/soh/OTRGlobals.h @@ -53,7 +53,8 @@ int32_t OTRGetLastScancode(); uint32_t ResourceMgr_IsGameMasterQuest(); uint32_t ResourceMgr_GameHasMasterQuest(); uint32_t ResourceMgr_GameHasOriginal(); -uint32_t ResourceMgr_GetGameVersion(); +uint32_t ResourceMgr_GetNumGameVersions(); +uint32_t ResourceMgr_GetGameVersion(int index); void ResourceMgr_CacheDirectory(const char* resName); char** ResourceMgr_ListFiles(const char* searchMask, int* resultSize); void ResourceMgr_LoadFile(const char* resName); diff --git a/soh/soh/SaveManager.cpp b/soh/soh/SaveManager.cpp index 1a825fd99..0fcc78122 100644 --- a/soh/soh/SaveManager.cpp +++ b/soh/soh/SaveManager.cpp @@ -15,8 +15,6 @@ #include extern "C" SaveContext gSaveContext; -extern "C" uint32_t ResourceMgr_GetGameVersion(); -extern "C" uint32_t ResourceMgr_IsGameMasterQuest(); std::filesystem::path SaveManager::GetFileName(int fileNum) { const std::filesystem::path sSavePath(Ship::Window::GetPathRelativeToAppDirectory("Save")); diff --git a/soh/src/overlays/gamestates/ovl_title/z_title.c b/soh/src/overlays/gamestates/ovl_title/z_title.c index 8a0f1111e..a0a8fdc59 100644 --- a/soh/src/overlays/gamestates/ovl_title/z_title.c +++ b/soh/src/overlays/gamestates/ovl_title/z_title.c @@ -15,7 +15,7 @@ #include "time.h" -const char* GetGameVersionString(); +const char* GetGameVersionString(s32 index); char* quote; void Title_PrintBuildInfo(Gfx** gfxp) { @@ -23,8 +23,6 @@ void Title_PrintBuildInfo(Gfx** gfxp) { //GfxPrint* printer; GfxPrint printer; - const char* gameVersionStr = GetGameVersionString(); - g = *gfxp; g = func_8009411C(g); //printer = alloca(sizeof(GfxPrint)); @@ -41,9 +39,22 @@ void Title_PrintBuildInfo(Gfx** gfxp) { GfxPrint_Printf(&printer, "GCC SHIP"); #endif - GfxPrint_SetPos(&printer, 1, 4); - GfxPrint_Printf(&printer, "Game Version: %s", gameVersionStr); - GfxPrint_SetPos(&printer, 1, 5); + s32 pos = 4; + GfxPrint_SetPos(&printer, 1, pos); + GfxPrint_Printf(&printer, "Game Versions:"); + + u32 numVersions = ResourceMgr_GetNumGameVersions(); + if (!numVersions) { + GfxPrint_SetPos(&printer, 16, pos++); + GfxPrint_Printf(&printer, "Unknown"); + } else { + for (u32 i = 0; i < numVersions; i++) { + GfxPrint_SetPos(&printer, 16, pos++); + GfxPrint_Printf(&printer, "%s", GetGameVersionString(i)); + } + } + + GfxPrint_SetPos(&printer, 1, pos); GfxPrint_Printf(&printer, "Release Version: %s", gBuildVersion); GfxPrint_SetColor(&printer, 255, 255, 255, 255); @@ -78,8 +89,8 @@ const char* SetQuote() { return quotes[randomQuote]; } -const char* GetGameVersionString() { - uint32_t gameVersion = ResourceMgr_GetGameVersion(); +const char* GetGameVersionString(s32 index) { + uint32_t gameVersion = ResourceMgr_GetGameVersion(index); switch (gameVersion) { case OOT_NTSC_10: return "N64 NTSC 1.0";