[All] Fixed multiple issues during build on Linux

- Added some fixes introduced by RodoMa92 in PR198

- Lack of AVX2 extension (should be done differently in the future)
- Disable deprecated-volatile warning
- Added missing override in posix EventInfo, ImGui notification class and XContent class
- Removed not used XAudio2.h include in XMP
- Fixed missing switch-case in XObject
- Added fugly template in native_list.h
- Fixed multiple smaller issues
This commit is contained in:
Gliniak
2025-01-08 22:27:51 +01:00
committed by Radosław Gliński
parent cdd3f161fa
commit 09be7e874a
31 changed files with 117 additions and 76 deletions

View File

@@ -57,15 +57,15 @@ Memory* PPCFrontend::memory() const { return processor_->memory(); }
// Checks the state of the global lock and sets scratch to the current MSR
// value.
void CheckGlobalLock(PPCContext* ppc_context, void* arg0, void* arg1) {
auto global_mutex = reinterpret_cast<xe_global_mutex*>(arg0);
auto global_mutex = reinterpret_cast<global_mutex_type*>(arg0);
auto global_lock_count = reinterpret_cast<int32_t*>(arg1);
std::lock_guard<xe_global_mutex> lock(*global_mutex);
std::lock_guard<global_mutex_type> lock(*global_mutex);
ppc_context->scratch = *global_lock_count ? 0 : 0x8000;
}
// Enters the global lock. Safe to recursion.
void EnterGlobalLock(PPCContext* ppc_context, void* arg0, void* arg1) {
auto global_mutex = reinterpret_cast<xe_global_mutex*>(arg0);
auto global_mutex = reinterpret_cast<global_mutex_type*>(arg0);
auto global_lock_count = reinterpret_cast<int32_t*>(arg1);
global_mutex->lock();
xe::atomic_inc(global_lock_count);
@@ -73,7 +73,7 @@ void EnterGlobalLock(PPCContext* ppc_context, void* arg0, void* arg1) {
// Leaves the global lock. Safe to recursion.
void LeaveGlobalLock(PPCContext* ppc_context, void* arg0, void* arg1) {
auto global_mutex = reinterpret_cast<xe_global_mutex*>(arg0);
auto global_mutex = reinterpret_cast<global_mutex_type*>(arg0);
auto global_lock_count = reinterpret_cast<int32_t*>(arg1);
auto new_lock_count = xe::atomic_dec(global_lock_count);
assert_true(new_lock_count >= 0);

View File

@@ -151,7 +151,11 @@ void PPCTranslator::DumpHIR(GuestFunction* function, PPCHIRBuilder* builder) {
{
wchar_t tmpbuf[64];
#ifdef XE_PLATFORM_WIN32
_snwprintf(tmpbuf, 64, L"%X", function->address());
#else
swprintf(tmpbuf, 64, L"%X", function->address());
#endif
folder_path.append(&tmpbuf[0]);
}

View File

@@ -447,7 +447,7 @@ bool Processor::Restore(ByteStream* stream) {
std::vector<uint32_t> to_delete;
for (auto& it : thread_debug_infos_) {
if (it.second->state == ThreadDebugInfo::State::kZombie) {
it.second->thread_handle = NULL;
it.second->thread_handle = 0;
to_delete.push_back(it.first);
}
}
@@ -502,7 +502,7 @@ void Processor::OnThreadDestroyed(uint32_t thread_id) {
auto global_lock = global_critical_region_.Acquire();
auto it = thread_debug_infos_.find(thread_id);
assert_true(it != thread_debug_infos_.end());
it->second->thread_handle = NULL;
it->second->thread_handle = 0;
thread_debug_infos_.erase(it);
}

View File

@@ -1136,10 +1136,14 @@ void XexModule::Precompile() {
high_code);
final_image_sha_.finalize(image_sha_bytes_);
char fmtbuf[16];
char fmtbuf[20];
for (unsigned i = 0; i < 20; ++i) {
#ifdef XE_PLATFORM_WIN32
sprintf_s(fmtbuf, "%X", image_sha_bytes_[i]);
#else
snprintf(fmtbuf, sizeof(fmtbuf), "%X", image_sha_bytes_[i]);
#endif
image_sha_str_ += &fmtbuf[0];
}