Merge branch 'main' into metal

This commit is contained in:
Samuliak 2025-09-27 07:27:06 +02:00
commit 37ba5268f7
No known key found for this signature in database
3 changed files with 38 additions and 10 deletions

View file

@ -15,6 +15,33 @@
#include "util/helpers/helpers.h"
#ifdef __arm64__
#if defined(__clang__)
#include <arm_acle.h>
#elif defined(_MSC_VER)
#include <intrin.h>
#endif
#endif
namespace {
void enableFlushDenormalsToZero()
{
#if defined(ARCH_X86_64)
_mm_setcsr(_mm_getcsr() | 0x8000);
#elif defined(__arm64__)
#if defined(__clang__)
__arm_wsr64("fpcr", __arm_rsr64("fpcr") | (1 << 24));
#elif defined(__GNUC__)
__builtin_aarch64_set_fpcr(__builtin_aarch64_get_fpcr() | (1 << 24));
#elif defined(_MSC_VER)
_WriteStatusReg(ARM64_FPCR, _ReadStatusReg(ARM64_FPCR) | (1 << 24));
#endif
#endif
}
}
SlimRWLock srwlock_activeThreadList;
// public list of active threads
@ -1321,9 +1348,7 @@ namespace coreinit
#endif
OSHostThread* hostThread = (OSHostThread*)_thread;
#if defined(ARCH_X86_64)
_mm_setcsr(_mm_getcsr() | 0x8000); // flush denormals to zero
#endif
enableFlushDenormalsToZero();
PPCInterpreter_t* hCPU = &hostThread->ppcInstance;
__OSLoadThread(hostThread->m_thread, hCPU, hostThread->selectedCore);
@ -1369,9 +1394,8 @@ namespace coreinit
{
SetThreadName(fmt::format("OSSched[core={}]", (uintptr_t)_assignedCoreIndex).c_str());
t_assignedCoreIndex = (sint32)(uintptr_t)_assignedCoreIndex;
#if defined(ARCH_X86_64)
_mm_setcsr(_mm_getcsr() | 0x8000); // flush denormals to zero
#endif
enableFlushDenormalsToZero();
#if BOOST_OS_LINUX
if (g_gdbstub)

View file

@ -517,6 +517,9 @@ std::weak_ordering wxGameList::SortComparator(uint64 titleId1, uint64 titleId2,
return CafeTitleList::GetGameInfo(id).GetRegion();
};
if (!sortData->asc)
std::swap(titleId1, titleId2);
switch(sortData->column)
{
default:
@ -545,7 +548,7 @@ std::weak_ordering wxGameList::SortComparator(uint64 titleId1, uint64 titleId2,
int wxGameList::SortFunction(wxIntPtr item1, wxIntPtr item2, wxIntPtr sortData)
{
const auto sort_data = (SortData*)sortData;
return sort_data->dir * order_to_int(sort_data->thisptr->SortComparator((uint64)item1, (uint64)item2, sort_data));
return order_to_int(sort_data->thisptr->SortComparator((uint64)item1, (uint64)item2, sort_data));
}
void wxGameList::SortEntries(int column)
@ -569,7 +572,7 @@ void wxGameList::SortEntries(int column)
case ColumnRegion:
case ColumnTitleID:
{
SortData data{this, ItemColumns{column}, ascending ? 1 : -1};
SortData data{this, ItemColumns{column}, ascending};
SortItems(SortFunction, (wxIntPtr)&data);
ShowSortIndicator(column, ascending);
break;
@ -1680,7 +1683,8 @@ void wxGameList::CreateShortcut(GameInfo2& gameInfo)
hres = shellLinkFile->Save(outputPath.wc_str(), TRUE);
}
}
if (!SUCCEEDED(hres)) {
if (FAILED(hres))
{
auto errorMsg = formatWxString(_("Failed to save shortcut to {}"), outputPath);
wxMessageBox(errorMsg, _("Error"), wxOK | wxCENTRE | wxICON_ERROR);
}

View file

@ -89,7 +89,7 @@ private:
{
wxGameList* thisptr;
ItemColumns column;
int dir;
bool asc;
};
int FindInsertPosition(TitleId titleId);