Merge pull request #10084 from Zopolis4/master

Identify Triforce games in gamelist
This commit is contained in:
JMC47
2025-04-21 13:57:57 -04:00
committed by GitHub
48 changed files with 298 additions and 100 deletions
-4
View File
@@ -932,10 +932,6 @@
"title": "Region Select",
"AD12237401ABE9FE4A545AADB5C5AE10355E2076": "RSAPatch"
},
"RELJAB": {
"title": "SegaBoot",
"130F3594CAB57B85616F95C7126F4748AAC5867D": "DI Seed Blanker"
},
"RGQE70": {
"title": "Ghostbusters",
"5F4CF8D4DA19A0FF74FF9EB925AC0236069BFD59": "crashfix"
+6 -1
View File
@@ -1,4 +1,5 @@
# GVSE8P, GVSP8P - Virtua Striker 3 ver. 2002
# GVSP8P, GVSE8P, GVSJ8P - Virtua Striker 2002 (GC)
# GVSJ8P - Virtua Striker 2002 (Triforce), Virtua Striker 4, Virtua Striker 4 ver. 2006
[Core]
# Values set here will override the main Dolphin settings.
@@ -10,3 +11,7 @@ FPRF = True
[ActionReplay]
# Add action replay cheats here.
[Video]
# Add memory patches to be applied every frame here.
[Video_Settings]
-18
View File
@@ -1,18 +0,0 @@
# GVS46E, GVS46J - Virtua Striker 4 ver. 2006
# Because Triforce games have weird IDs, properties are inherited from GVS.ini (Virtua Striker 3 ver. 2002)!
[Core]
# Values set here will override the main Dolphin settings.
FPRF = True
[OnFrame]
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.
[Video]
# Add memory patches to be applied every frame here.
[Video_Settings]
-18
View File
@@ -1,18 +0,0 @@
# GVS46E, GVS46J - Virtua Striker 4 ver. 2006
# Because Triforce games have weird IDs, properties are inherited from GVS.ini (Virtua Striker 3 ver. 2002)!
[Core]
# Values set here will override the main Dolphin settings.
FPRF = True
[OnFrame]
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.
[Video]
# Add memory patches to be applied every frame here.
[Video_Settings]
-18
View File
@@ -1,18 +0,0 @@
# RELJAB - SegaBoot
[Core]
# Values set here will override the main Dolphin settings.
[OnFrame]
# Add memory patches to be applied every frame here.
$DI Seed Blanker
0x80000000:dword:0x00000000
0x80000004:dword:0x00000000
0x80000008:dword:0x00000000
[Patches_RetroAchievements_Verified]
$DI Seed Blanker
[ActionReplay]
# Add action replay cheats here.
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

+10
View File
@@ -0,0 +1,10 @@
TITLES = (type: Triforce language: EN version: 20210908)
S000 = Triforce Firmware Update For Compact Flash Box (4.01)
SBEY = Virtua Striker 2002
SBFX = The Key Of Avalon
SBGG = F-Zero AX
SBHZ = Virtua Striker 4 (Asia)
SBJA = Virtua Striker 4 (Export)
SBJN = The Key Of Avalon 2.5: War of the Key
SBLK = Virtua Striker 4 Ver.2006 (Japan)
SBLL = Virtua Striker 4 Ver.2006 (Export)
@@ -30,8 +30,8 @@ import java.util.Set;
public final class FileBrowserHelper
{
public static final HashSet<String> GAME_EXTENSIONS = new HashSet<>(Arrays.asList(
"gcm", "tgc", "iso", "ciso", "gcz", "wbfs", "wia", "rvz", "nfs", "wad", "dol", "elf",
"json"));
"gcm", "tgc", "bin", "iso", "ciso", "gcz", "wbfs", "wia", "rvz", "nfs", "wad", "dol",
"elf", "json"));
public static final HashSet<String> GAME_LIKE_EXTENSIONS = new HashSet<>(GAME_EXTENSIONS);
+2 -2
View File
@@ -80,8 +80,8 @@ public:
static constexpr std::string_view BLUE = "#0B71C1";
static constexpr std::string_view APPROVED_LIST_FILENAME = "ApprovedInis.json";
static const inline Common::SHA1::Digest APPROVED_LIST_HASH = {
0x4F, 0x45, 0xB7, 0xA3, 0xC4, 0x6E, 0xAF, 0x80, 0x58, 0xA5,
0x53, 0x99, 0xF8, 0x05, 0xC3, 0x83, 0x22, 0xA4, 0x5F, 0x65};
0xE1, 0x29, 0xD1, 0x33, 0x4D, 0xF2, 0xF8, 0xA8, 0x4E, 0xCA,
0xF6, 0x87, 0xE6, 0xEC, 0xEC, 0xB3, 0x18, 0x69, 0x34, 0x45};
struct LeaderboardEntry
{
+7 -1
View File
@@ -236,7 +236,8 @@ std::unique_ptr<BootParameters> BootParameters::GenerateFromFile(std::vector<std
#endif
static const std::unordered_set<std::string> disc_image_extensions = {
{".gcm", ".iso", ".tgc", ".wbfs", ".ciso", ".gcz", ".wia", ".rvz", ".nfs", ".dol", ".elf"}};
{".gcm", ".bin", ".iso", ".tgc", ".wbfs", ".ciso", ".gcz", ".wia", ".rvz", ".nfs", ".dol",
".elf"}};
if (disc_image_extensions.contains(extension))
{
std::unique_ptr<DiscIO::VolumeDisc> disc = DiscIO::CreateDisc(path);
@@ -406,6 +407,7 @@ bool CBoot::Load_BS2(Core::System& system, const std::string& boot_rom_filename)
constexpr u32 PAL_v1_0 = 0x4F319F43;
// DOL-101(EUR) (PAL Revision 1.2)
constexpr u32 PAL_v1_2 = 0xAD1B7F16;
constexpr u32 Triforce = 0xD1883221; // The Triforce's special IPL
// Load the IPL ROM dump, limited to 2MiB which is the size of the official IPLs.
constexpr size_t max_ipl_size = 2 * 1024 * 1024;
@@ -423,6 +425,7 @@ bool CBoot::Load_BS2(Core::System& system, const std::string& boot_rom_filename)
const u32 ipl_hash = Common::ComputeCRC32(data.data(), data.size());
bool known_ipl = false;
bool pal_ipl = false;
bool triforce_ipl = false;
switch (ipl_hash)
{
case NTSC_v1_0:
@@ -437,6 +440,9 @@ bool CBoot::Load_BS2(Core::System& system, const std::string& boot_rom_filename)
pal_ipl = true;
known_ipl = true;
break;
case Triforce:
known_ipl = true;
triforce_ipl = true;
default:
PanicAlertFmtT("The IPL file is not a known good dump. (CRC32: {0:x})", ipl_hash);
break;
+7
View File
@@ -227,6 +227,13 @@ bool CBoot::RunApploader(Core::System& system, const Core::CPUThreadGuard& guard
ppc_state.pc = ppc_state.gpr[3];
branch_watch.SetRecordingActive(guard, resume_branch_watch);
// Blank out session key (https://debugmo.de/2008/05/part-2-dumping-the-media-board/)
if (volume.GetVolumeType() == DiscIO::Platform::Triforce)
{
auto& memory = system.GetMemory();
memory.Memset(0, 0, 12);
}
return true;
}
+2
View File
@@ -203,6 +203,8 @@ add_library(core
HW/EXI/EXI_DeviceAD16.h
HW/EXI/EXI_DeviceAGP.cpp
HW/EXI/EXI_DeviceAGP.h
HW/EXI/EXI_DeviceBaseboard.cpp
HW/EXI/EXI_DeviceBaseboard.h
HW/EXI/EXI_DeviceDummy.cpp
HW/EXI/EXI_DeviceDummy.h
HW/EXI/EXI_DeviceEthernet.cpp
+1
View File
@@ -437,6 +437,7 @@ const Info<bool> MAIN_GAMELIST_LIST_WAD{{System::Main, "GameList", "ListWad"}, t
const Info<bool> MAIN_GAMELIST_LIST_ELF_DOL{{System::Main, "GameList", "ListElfDol"}, true};
const Info<bool> MAIN_GAMELIST_LIST_WII{{System::Main, "GameList", "ListWii"}, true};
const Info<bool> MAIN_GAMELIST_LIST_GC{{System::Main, "GameList", "ListGC"}, true};
const Info<bool> MAIN_GAMELIST_LIST_TRI{{System::Main, "GameList", "ListTriforce"}, true};
const Info<bool> MAIN_GAMELIST_LIST_JPN{{System::Main, "GameList", "ListJap"}, true};
const Info<bool> MAIN_GAMELIST_LIST_PAL{{System::Main, "GameList", "ListPal"}, true};
const Info<bool> MAIN_GAMELIST_LIST_USA{{System::Main, "GameList", "ListUsa"}, true};
+1
View File
@@ -269,6 +269,7 @@ extern const Info<bool> MAIN_GAMELIST_LIST_WAD;
extern const Info<bool> MAIN_GAMELIST_LIST_ELF_DOL;
extern const Info<bool> MAIN_GAMELIST_LIST_WII;
extern const Info<bool> MAIN_GAMELIST_LIST_GC;
extern const Info<bool> MAIN_GAMELIST_LIST_TRI;
extern const Info<bool> MAIN_GAMELIST_LIST_JPN;
extern const Info<bool> MAIN_GAMELIST_LIST_PAL;
extern const Info<bool> MAIN_GAMELIST_LIST_USA;
+20 -9
View File
@@ -126,6 +126,12 @@ const std::string SConfig::GetTitleDescription() const
return m_title_description;
}
std::string SConfig::GetTriforceID() const
{
std::lock_guard<std::recursive_mutex> lock(m_metadata_lock);
return m_triforce_id;
}
u64 SConfig::GetTitleID() const
{
std::lock_guard<std::recursive_mutex> lock(m_metadata_lock);
@@ -141,7 +147,7 @@ u16 SConfig::GetRevision() const
void SConfig::ResetRunningGameMetadata()
{
std::lock_guard<std::recursive_mutex> lock(m_metadata_lock);
SetRunningGameMetadata("00000000", "", 0, 0, DiscIO::Region::Unknown);
SetRunningGameMetadata("00000000", "", "", 0, 0, DiscIO::Region::Unknown);
}
void SConfig::SetRunningGameMetadata(const DiscIO::Volume& volume,
@@ -150,14 +156,14 @@ void SConfig::SetRunningGameMetadata(const DiscIO::Volume& volume,
std::lock_guard<std::recursive_mutex> lock(m_metadata_lock);
if (partition == volume.GetGamePartition())
{
SetRunningGameMetadata(volume.GetGameID(), volume.GetGameTDBID(),
SetRunningGameMetadata(volume.GetGameID(), volume.GetGameTDBID(), volume.GetTriforceID(),
volume.GetTitleID().value_or(0), volume.GetRevision().value_or(0),
volume.GetRegion());
}
else
{
SetRunningGameMetadata(volume.GetGameID(partition), volume.GetGameTDBID(partition),
volume.GetTitleID(partition).value_or(0),
volume.GetTriforceID(), volume.GetTitleID(partition).value_or(0),
volume.GetRevision(partition).value_or(0), volume.GetRegion());
}
}
@@ -175,25 +181,28 @@ void SConfig::SetRunningGameMetadata(const IOS::ES::TMDReader& tmd, DiscIO::Plat
!Core::System::GetInstance().GetDVDInterface().UpdateRunningGameMetadata(tmd_title_id))
{
// If not launching a disc game, just read everything from the TMD.
SetRunningGameMetadata(tmd.GetGameID(), tmd.GetGameTDBID(), tmd_title_id, tmd.GetTitleVersion(),
tmd.GetRegion());
SetRunningGameMetadata(tmd.GetGameID(), tmd.GetGameTDBID(), "", tmd_title_id,
tmd.GetTitleVersion(), tmd.GetRegion());
}
}
void SConfig::SetRunningGameMetadata(const std::string& game_id)
{
std::lock_guard<std::recursive_mutex> lock(m_metadata_lock);
SetRunningGameMetadata(game_id, "", 0, 0, DiscIO::Region::Unknown);
SetRunningGameMetadata(game_id, "", "", 0, 0, DiscIO::Region::Unknown);
}
void SConfig::SetRunningGameMetadata(const std::string& game_id, const std::string& gametdb_id,
u64 title_id, u16 revision, DiscIO::Region region)
std::string triforce_id, u64 title_id, u16 revision,
DiscIO::Region region)
{
std::lock_guard<std::recursive_mutex> lock(m_metadata_lock);
const bool was_changed = m_game_id != game_id || m_gametdb_id != gametdb_id ||
m_title_id != title_id || m_revision != revision;
m_triforce_id != triforce_id || m_title_id != title_id ||
m_revision != revision;
m_game_id = game_id;
m_gametdb_id = gametdb_id;
m_triforce_id = triforce_id;
m_title_id = title_id;
m_revision = revision;
@@ -226,7 +235,7 @@ void SConfig::SetRunningGameMetadata(const std::string& game_id, const std::stri
const Core::TitleDatabase title_database;
auto& system = Core::System::GetInstance();
const DiscIO::Language language = GetLanguageAdjustedForRegion(system.IsWii(), region);
m_title_name = title_database.GetTitleName(m_gametdb_id, language);
m_title_name = title_database.GetTitleName(m_gametdb_id, m_triforce_id, language);
m_title_description = title_database.Describe(m_gametdb_id, language);
NOTICE_LOG_FMT(CORE, "Active title: {}", m_title_description);
Host_TitleChanged();
@@ -298,6 +307,7 @@ void SConfig::LoadDefaults()
auto& system = Core::System::GetInstance();
system.SetIsWii(false);
system.SetIsTriforce(false);
ResetRunningGameMetadata();
}
@@ -321,6 +331,7 @@ struct SetGameMetadata
{
*region = disc.volume->GetRegion();
system.SetIsWii(disc.volume->GetVolumeType() == DiscIO::Platform::WiiDisc);
system.SetIsTriforce(disc.volume->GetVolumeType() == DiscIO::Platform::Triforce);
config->m_disc_booted_from_game_list = true;
config->SetRunningGameMetadata(*disc.volume, disc.volume->GetGamePartition());
return true;
+4 -1
View File
@@ -67,6 +67,7 @@ struct SConfig
const std::string GetGameTDBID() const;
const std::string GetTitleName() const;
const std::string GetTitleDescription() const;
std::string GetTriforceID() const;
u64 GetTitleID() const;
u16 GetRevision() const;
void ResetRunningGameMetadata();
@@ -121,13 +122,15 @@ private:
static void ReloadTextures(Core::System& system);
void SetRunningGameMetadata(const std::string& game_id, const std::string& gametdb_id,
u64 title_id, u16 revision, DiscIO::Region region);
std::string triforce_id, u64 title_id, u16 revision,
DiscIO::Region region);
static SConfig* m_Instance;
mutable std::recursive_mutex m_metadata_lock;
std::string m_game_id;
std::string m_gametdb_id;
std::string m_triforce_id;
std::string m_title_name;
std::string m_title_description;
u64 m_title_id;
+9
View File
@@ -753,6 +753,15 @@ void DVDInterface::ExecuteCommand(ReplyType reply_type)
DIInterruptType interrupt_type = DIInterruptType::TCINT;
bool command_handled_by_thread = false;
// Swaps endian of Triforce DI commands, and zeroes out random bytes to prevent unknown read
// subcommand errors
auto& dvd_thread = m_system.GetDVDThread();
if (dvd_thread.GetDiscType() == DiscIO::Platform::Triforce)
{
// TODO(C++23): Use std::byteswap and a bitwise AND for increased clarity
m_DICMDBUF[0] <<= 24;
}
// DVDLowRequestError needs access to the error code set by the previous command
if (static_cast<DICommand>(m_DICMDBUF[0] >> 24) != DICommand::RequestError)
SetDriveError(DriveError::None);
+13
View File
@@ -66,6 +66,18 @@ void ExpansionInterfaceManager::AddMemoryCard(Slot slot)
m_channels[SlotToEXIChannel(slot)]->AddDevice(memorycard_device, SlotToEXIDevice(slot));
}
void ExpansionInterfaceManager::AddSP1Device()
{
EXIDeviceType sp1_device = EXIDeviceType::Baseboard;
auto& system = Core::System::GetInstance();
if (system.IsTriforce())
{
sp1_device = Config::Get(Config::MAIN_SERIAL_PORT_1);
}
m_channels[0]->AddDevice(sp1_device, SlotToEXIDevice(Slot::SP1));
}
u8 SlotToEXIChannel(Slot slot)
{
switch (slot)
@@ -145,6 +157,7 @@ void ExpansionInterfaceManager::Init(const Sram* override_sram)
AddMemoryCard(slot);
m_channels[0]->AddDevice(EXIDeviceType::MaskROM, 1);
AddSP1Device();
m_channels[SlotToEXIChannel(Slot::SP1)]->AddDevice(Config::Get(Config::MAIN_SERIAL_PORT_1),
SlotToEXIDevice(Slot::SP1));
m_channels[SlotToEXIChannel(Slot::SP2)]->AddDevice(Config::Get(Config::MAIN_SERIAL_PORT_2),

Some files were not shown because too many files have changed in this diff Show More