diff --git a/src/core/bus.cpp b/src/core/bus.cpp index 9686ba82d..c36d8f39d 100644 --- a/src/core/bus.cpp +++ b/src/core/bus.cpp @@ -1638,8 +1638,7 @@ template u32 Bus::SIO2ReadHandler(PhysicalMemoryAddress address) { // Stub for using PS2 BIOS. - if (const BIOS::ImageInfo* ii = System::GetBIOSImageInfo(); - !ii || ii->fastboot_patch != BIOS::ImageInfo::FastBootPatch::Type2) [[unlikely]] + if (!System::IsUsingPS2BIOS()) [[unlikely]] { // Throw exception when not using PS2 BIOS. return UnmappedReadHandler(address); @@ -1653,8 +1652,7 @@ template void Bus::SIO2WriteHandler(PhysicalMemoryAddress address, u32 value) { // Stub for using PS2 BIOS. - if (const BIOS::ImageInfo* ii = System::GetBIOSImageInfo(); - !ii || ii->fastboot_patch != BIOS::ImageInfo::FastBootPatch::Type2) [[unlikely]] + if (!System::IsUsingPS2BIOS()) [[unlikely]] { // Throw exception when not using PS2 BIOS. UnmappedWriteHandler(address, value); diff --git a/src/core/system.cpp b/src/core/system.cpp index 30eb72334..bcc8e453b 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -775,9 +775,9 @@ System::BootMode System::GetBootMode() return s_state.boot_mode; } -const BIOS::ImageInfo* System::GetBIOSImageInfo() +bool System::IsUsingPS2BIOS() { - return s_state.bios_image_info; + return (s_state.bios_image_info && s_state.bios_image_info->fastboot_patch == BIOS::ImageInfo::FastBootPatch::Type2); } bool System::IsExePath(std::string_view path) diff --git a/src/core/system.h b/src/core/system.h index e41a78f82..33d7b02a5 100644 --- a/src/core/system.h +++ b/src/core/system.h @@ -31,10 +31,6 @@ class GPUTexture; class INISettingsInterface; class MediaCapture; -namespace BIOS { -struct ImageInfo; -} // namespace BIOS - namespace GameDatabase { struct Entry; } @@ -225,13 +221,12 @@ const std::string& GetExeOverride(); const GameDatabase::Entry* GetGameDatabaseEntry(); GameHash GetGameHash(); bool IsRunningUnknownGame(); +bool IsUsingPS2BIOS(); BootMode GetBootMode(); /// Returns the time elapsed in the current play session. u64 GetSessionPlayedTime(); -const BIOS::ImageInfo* GetBIOSImageInfo(); - void FormatLatencyStats(SmallStringBase& str); /// Loads global settings (i.e. EmuConfig).