@@ -800,6 +800,15 @@ bool System::IsUsingPS2BIOS()
800800 return (s_state.bios_image_info && s_state.bios_image_info ->fastboot_patch == BIOS::ImageInfo::FastBootPatch::Type2);
801801}
802802
803+ bool System::IsDiscPath (std::string_view path)
804+ {
805+ return (StringUtil::EndsWithNoCase (path, " .bin" ) || StringUtil::EndsWithNoCase (path, " .cue" ) ||
806+ StringUtil::EndsWithNoCase (path, " .img" ) || StringUtil::EndsWithNoCase (path, " .iso" ) ||
807+ StringUtil::EndsWithNoCase (path, " .chd" ) || StringUtil::EndsWithNoCase (path, " .ecm" ) ||
808+ StringUtil::EndsWithNoCase (path, " .mds" ) || StringUtil::EndsWithNoCase (path, " .pbp" ) ||
809+ StringUtil::EndsWithNoCase (path, " .m3u" ));
810+ }
811+
803812bool System::IsExePath (std::string_view path)
804813{
805814 return (StringUtil::EndsWithNoCase (path, " .exe" ) || StringUtil::EndsWithNoCase (path, " .psexe" ) ||
@@ -820,22 +829,7 @@ bool System::IsGPUDumpPath(std::string_view path)
820829
821830bool System::IsLoadablePath (std::string_view path)
822831{
823- static constexpr const std::array extensions = {
824- " .bin" , " .cue" , " .img" , " .iso" , " .chd" , " .ecm" , " .mds" , // discs
825- " .exe" , " .psexe" , " .ps-exe" , " .psx" , " .cpe" , " .elf" , // exes
826- " .psf" , " .minipsf" , // psf
827- " .psxgpu" , " .psxgpu.zst" , " .psxgpu.xz" , // gpu dump
828- " .m3u" , // playlists
829- " .pbp" ,
830- };
831-
832- for (const char * test_extension : extensions)
833- {
834- if (StringUtil::EndsWithNoCase (path, test_extension))
835- return true ;
836- }
837-
838- return false ;
832+ return (IsDiscPath (path) || IsExePath (path) || IsPsfPath (path) || IsGPUDumpPath (path));
839833}
840834
841835bool System::IsSaveStatePath (std::string_view path)
0 commit comments