diff --git a/Utilities/rFile.cpp b/Utilities/rFile.cpp index 0973fae502..04a3da0b25 100644 --- a/Utilities/rFile.cpp +++ b/Utilities/rFile.cpp @@ -154,7 +154,7 @@ bool rFile::Open(const std::string &filename, rFile::OpenMode mode, int access) bool rFile::Exists(const std::string &file) { #ifdef _WIN32 - std::wstring wstr = ConvertUTF8ToWString(filename); + std::wstring wstr = ConvertUTF8ToWString(file); return GetFileAttributes(wstr.c_str()) != 0xFFFFFFFF; #else struct stat buffer; @@ -206,8 +206,10 @@ bool rRmdir(const std::string &dir) { #ifdef _WIN32 if (!RemoveDirectory(ConvertUTF8ToWString(dir).c_str())) { - ELOG("Error deleting directory %s: %i", dir, GetLastError()); + LOG_ERROR(GENERAL, "Error deleting directory %s: %i", dir, GetLastError()); + return false; } + return true; #else rmdir(dir.c_str()); #endif diff --git a/rpcs3/Emu/Cell/PPUInterpreter.h b/rpcs3/Emu/Cell/PPUInterpreter.h index 74a4ec9f61..2f793db9c9 100644 --- a/rpcs3/Emu/Cell/PPUInterpreter.h +++ b/rpcs3/Emu/Cell/PPUInterpreter.h @@ -168,7 +168,7 @@ private: } } - void MFVSCR(u32 vd) + void MFVSCR(u32 vd) //nf { CPU.VPR[vd].Clear(); CPU.VPR[vd]._u32[0] = CPU.VSCR.VSCR; diff --git a/rpcs3/Emu/Cell/PPUThread.h b/rpcs3/Emu/Cell/PPUThread.h index 6a183fb0dc..1fe6fffd01 100644 --- a/rpcs3/Emu/Cell/PPUThread.h +++ b/rpcs3/Emu/Cell/PPUThread.h @@ -75,15 +75,15 @@ union FPSCRhdr u32 RN :2; //Floating-point rounding control u32 NI :1; //Floating-point non-IEEE mode u32 XE :1; //Floating-point inexact exception enable - u32 ZE :1; //IEEE floating-point zero divide exception enable - u32 UE :1; //IEEE floating-point underflow exception enable - u32 OE :1; //IEEE floating-point overflow exception enable + u32 ZE :1; //IEEE floating-point zero divide exception enable + u32 UE :1; //IEEE floating-point underflow exception enable + u32 OE :1; //IEEE floating-point overflow exception enable u32 VE :1; //Floating-point invalid operation exception enable u32 VXCVI :1; //Floating-point invalid operation exception for invalid integer convert u32 VXSQRT :1; //Floating-point invalid operation exception for invalid square root u32 VXSOFT :1; //Floating-point invalid operation exception for software request u32 :1; //Reserved - u32 FPRF :5; //Floating-point result flags + u32 FPRF :5; //Floating-point result flags u32 FI :1; //Floating-point fraction inexact u32 FR :1; //Floating-point fraction rounded u32 VXVC :1; //Floating-point invalid operation exception for invalid compare @@ -94,8 +94,8 @@ union FPSCRhdr u32 VXSNAN :1; //Floating-point invalid operation exception for SNaN u32 XX :1; //Floating-point inexact exception u32 ZX :1; //Floating-point zero divide exception - u32 UX :1; //Floating-point underflow exception - u32 OX :1; //Floating-point overflow exception + u32 UX :1; //Floating-point underflow exception + u32 OX :1; //Floating-point overflow exception u32 VX :1; //Floating-point invalid operation exception summary u32 FEX :1; //Floating-point enabled exception summary u32 FX :1; //Floating-point exception summary @@ -131,7 +131,7 @@ union MSRhdr //1 Instruction address translation is enabled. u64 IR : 1; - //Exception prefix. The setting of this bit specifies whether an exception vector offset + //Exception prefix. The setting of this bit specifies whether an exception vector offset //is prepended with Fs or 0s. In the following description, nnnnn is the offset of the //exception. //0 Exceptions are vectored to the physical address 0x0000_0000_000n_nnnn in 64-bit implementations. @@ -168,9 +168,9 @@ union MSRhdr u64 ME : 1; //Floating-point available - //0 The processor prevents dispatch of floating-point instructions, including - //floating-point loads, stores, and moves. - //1 The processor can execute floating-point instructions. + //0 The processor prevents dispatch of floating-point instructions, including + //floating-point loads, stores, and moves. + //1 The processor can execute floating-point instructions. u64 FP : 1; //Privilege level @@ -261,7 +261,7 @@ union VSCRhdr { /* Saturation. A sticky status bit indicating that some field in a saturating instruction saturated since the last - time SAT was cleared. In other words when SAT = ‘1’ it remains set to ‘1’ until it is cleared to ‘0’ by an + time SAT was cleared. In other words when SAT = '1' it remains set to '1' until it is cleared to '0' by an mtvscr instruction. 1 The vector saturate instruction implicitly sets when saturation has occurred on the results one of the vector instructions having saturate in its name: @@ -283,12 +283,12 @@ union VSCRhdr /* Non-Java. A mode control bit that determines whether vector floating-point operations will be performed - in a Java-IEEE-C9X–compliant mode or a possibly faster non-Java/non-IEEE mode. - 0 The Java-IEEE-C9X–compliant mode is selected. Denormalized values are handled as specified + in a Java-IEEE-C9X-compliant mode or a possibly faster non-Java/non-IEEE mode. + 0 The Java-IEEE-C9X-compliant mode is selected. Denormalized values are handled as specified by Java, IEEE, and C9X standard. - 1 The non-Java/non-IEEE–compliant mode is selected. If an element in a source vector register - contains a denormalized value, the value ‘0’ is used instead. If an instruction causes an underflow - exception, the corresponding element in the target VR is cleared to ‘0’. In both cases, the ‘0’ + 1 The non-Java/non-IEEE-compliant mode is selected. If an element in a source vector register + contains a denormalized value, the value '0' is used instead. If an instruction causes an underflow + exception, the corresponding element in the target VR is cleared to '0'. In both cases, the '0' has the same sign as the denormalized or underflowing value. */ u32 NJ : 1; diff --git a/rpcs3/Emu/Memory/DynamicMemoryBlockBase.h b/rpcs3/Emu/Memory/DynamicMemoryBlockBase.h index 10ada356ad..0c7467ea18 100644 --- a/rpcs3/Emu/Memory/DynamicMemoryBlockBase.h +++ b/rpcs3/Emu/Memory/DynamicMemoryBlockBase.h @@ -2,8 +2,8 @@ //DynamicMemoryBlockBase template DynamicMemoryBlockBase::DynamicMemoryBlockBase() -: PT() -, m_max_size(0) + : PT() + , m_max_size(0) { } @@ -37,11 +37,7 @@ bool DynamicMemoryBlockBase::IsInMyRange(const u64 addr, const u32 size) template bool DynamicMemoryBlockBase::IsMyAddress(const u64 addr) { - if (!IsInMyRange(addr)) return false; - - const u32 index = MemoryBlock::FixAddr(addr) >> 12; - - return m_pages[index] != nullptr; + return IsInMyRange(addr); } template @@ -50,11 +46,11 @@ MemoryBlock* DynamicMemoryBlockBase::SetRange(const u64 start, const u32 siz std::lock_guard lock(m_lock); m_max_size = PAGE_4K(size); - MemoryBlock::SetRange(start, 0); - - const u32 page_count = m_max_size >> 12; - m_pages.resize(page_count); - memset(m_pages.data(), 0, sizeof(u8*) * page_count); + if (!MemoryBlock::SetRange(start, 0)) + { + assert(0); + return nullptr; + } return this; } @@ -67,8 +63,6 @@ void DynamicMemoryBlockBase::Delete() m_allocated.clear(); m_max_size = 0; - m_pages.clear(); - MemoryBlock::Delete(); } @@ -107,17 +101,6 @@ template void DynamicMemoryBlockBase::AppendMem(u64 addr, u32 size) /* private */ { m_allocated.emplace_back(addr, size); - u8* pointer = (u8*) m_allocated.back().mem; - - const u32 first = MemoryBlock::FixAddr(addr) >> 12; - - const u32 last = first + ((size - 1) >> 12); - - for (u32 i = first; i <= last; i++) - { - m_pages[i] = pointer; - pointer += 4096; - } } template @@ -186,24 +169,6 @@ bool DynamicMemoryBlockBase::Free(u64 addr) { if (addr == m_allocated[num].addr) { - /* if(IsLocked(m_allocated[num].addr)) return false; */ - - const u32 first = MemoryBlock::FixAddr(addr) >> 12; - - const u32 last = first + ((m_allocated[num].size - 1) >> 12); - - // check if locked: - //for (u32 i = first; i <= last; i++) - //{ - // if (!m_pages[i]) return false; - //} - - // clear pointers: - for (u32 i = first; i <= last; i++) - { - m_pages[i] = nullptr; - } - //LOG_NOTICE(MEMORY, "Free(0x%llx)", addr); m_allocated.erase(m_allocated.begin() + num); @@ -221,21 +186,9 @@ bool DynamicMemoryBlockBase::Free(u64 addr) } template -u8* DynamicMemoryBlockBase::GetMem(u64 addr) const // lock-free, addr is fixed +u8* DynamicMemoryBlockBase::GetMem(u64 addr) const { - const u32 index = addr >> 12; - - if (index < m_pages.size()) - { - if (u8* res = m_pages[index]) - { - return res + (addr & 4095); - } - } - - LOG_ERROR(MEMORY, "GetMem(0x%llx) from not allocated address.", addr); - assert(0); - return nullptr; + return MemoryBlock::GetMem(addr); } template diff --git a/rpcs3/Emu/Memory/Memory.cpp b/rpcs3/Emu/Memory/Memory.cpp index cf1b8a8f9a..00afc33ede 100644 --- a/rpcs3/Emu/Memory/Memory.cpp +++ b/rpcs3/Emu/Memory/Memory.cpp @@ -69,16 +69,21 @@ void MemoryBlock::Init() range_start = 0; range_size = 0; - mem = nullptr; + mem = Memory.GetMemFromAddr(0); } void MemoryBlock::InitMemory() { - if (!range_size) return; - - Free(); - mem_inf = new MemBlockInfo(range_start, range_size); - mem = (u8*)mem_inf->mem; + if (!range_size) + { + mem = Memory.GetMemFromAddr(range_start); + } + else + { + Free(); + mem_inf = new MemBlockInfo(range_start, range_size); + mem = (u8*)mem_inf->mem; + } } void MemoryBlock::Free() @@ -88,13 +93,11 @@ void MemoryBlock::Free() delete mem_inf; mem_inf = nullptr; } - mem = nullptr; } void MemoryBlock::Delete() { Free(); - safe_free(mem); Init(); } @@ -135,6 +138,8 @@ u8* MemoryBlock::GetMemFromAddr(const u64 addr) MemoryBlock* MemoryBlock::SetRange(const u64 start, const u32 size) { + if (start + size > 0x100000000) return nullptr; + range_start = start; range_size = size; diff --git a/rpcs3/Emu/Memory/Memory.h b/rpcs3/Emu/Memory/Memory.h index 7d781a7a18..1642e36770 100644 --- a/rpcs3/Emu/Memory/Memory.h +++ b/rpcs3/Emu/Memory/Memory.h @@ -286,6 +286,8 @@ public: block->Delete(); } + RSXIOMem.Delete(); + MemoryBlocks.clear(); #ifdef _WIN32 diff --git a/rpcs3/Emu/Memory/MemoryBlock.h b/rpcs3/Emu/Memory/MemoryBlock.h index 7d8e1e9657..c4a3d70632 100644 --- a/rpcs3/Emu/Memory/MemoryBlock.h +++ b/rpcs3/Emu/Memory/MemoryBlock.h @@ -390,8 +390,6 @@ class DynamicMemoryBlockBase : public PT { mutable std::mutex m_lock; std::vector m_allocated; // allocation info - std::vector m_pages; // real addresses of every 4096 byte pages (array size should be fixed) - u32 m_max_size; public: diff --git a/rpcs3/Emu/SysCalls/Modules/cellBgdl.cpp b/rpcs3/Emu/SysCalls/Modules/cellBgdl.cpp index 1b0850cdd6..72879e8d3b 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellBgdl.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellBgdl.cpp @@ -1,5 +1,5 @@ -#if 0 #include "stdafx.h" +#if 0 #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SC_FUNC.h" diff --git a/rpcs3/Emu/SysCalls/Modules/cellCamera.cpp b/rpcs3/Emu/SysCalls/Modules/cellCamera.cpp index 3d2feac52c..ee00c683fa 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellCamera.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellCamera.cpp @@ -1,5 +1,5 @@ -#if 0 #include "stdafx.h" +#if 0 #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SC_FUNC.h" diff --git a/rpcs3/Emu/SysCalls/Modules/cellCelp8Enc.cpp b/rpcs3/Emu/SysCalls/Modules/cellCelp8Enc.cpp index 28ee197457..70109e224a 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellCelp8Enc.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellCelp8Enc.cpp @@ -1,5 +1,5 @@ -#if 0 #include "stdafx.h" +#if 0 #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SC_FUNC.h" diff --git a/rpcs3/Emu/SysCalls/Modules/cellCelpEnc.cpp b/rpcs3/Emu/SysCalls/Modules/cellCelpEnc.cpp index 92b2c9acc9..6541f6ae76 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellCelpEnc.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellCelpEnc.cpp @@ -1,5 +1,6 @@ -#if 0 + #include "stdafx.h" +#if 0 #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SC_FUNC.h" diff --git a/rpcs3/Emu/SysCalls/Modules/cellFiber.cpp b/rpcs3/Emu/SysCalls/Modules/cellFiber.cpp index b192d56231..a64a9a914f 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellFiber.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellFiber.cpp @@ -1,5 +1,5 @@ -#if 0 #include "stdafx.h" +#if 0 #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SC_FUNC.h" diff --git a/rpcs3/Emu/SysCalls/Modules/cellGem.cpp b/rpcs3/Emu/SysCalls/Modules/cellGem.cpp index bb93900168..5133ce51c4 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellGem.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellGem.cpp @@ -1,5 +1,5 @@ -#if 0 #include "stdafx.h" +#if 0 #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SC_FUNC.h" diff --git a/rpcs3/Emu/SysCalls/Modules/cellHttpUtil.cpp b/rpcs3/Emu/SysCalls/Modules/cellHttpUtil.cpp index e5ef30832f..97f94de794 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellHttpUtil.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellHttpUtil.cpp @@ -1,5 +1,5 @@ -#if 0 #include "stdafx.h" +#if 0 #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SC_FUNC.h" diff --git a/rpcs3/Emu/SysCalls/Modules/cellImejp.cpp b/rpcs3/Emu/SysCalls/Modules/cellImejp.cpp index fea418acb9..b3dc1bd5da 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellImejp.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellImejp.cpp @@ -1,5 +1,5 @@ -#if 0 #include "stdafx.h" +#if 0 #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SC_FUNC.h" diff --git a/rpcs3/Emu/SysCalls/Modules/cellJpgEnc.cpp b/rpcs3/Emu/SysCalls/Modules/cellJpgEnc.cpp index 3bfebc50e6..e8aa461f29 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellJpgEnc.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellJpgEnc.cpp @@ -1,5 +1,5 @@ -#if 0 #include "stdafx.h" +#if 0 #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SC_FUNC.h" diff --git a/rpcs3/Emu/SysCalls/Modules/cellKey2char.cpp b/rpcs3/Emu/SysCalls/Modules/cellKey2char.cpp index 3a635b569b..eef9eb72f7 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellKey2char.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellKey2char.cpp @@ -1,5 +1,5 @@ -#if 0 #include "stdafx.h" +#if 0 #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SC_FUNC.h" diff --git a/rpcs3/Emu/SysCalls/Modules/cellLv2dbg.cpp b/rpcs3/Emu/SysCalls/Modules/cellLv2dbg.cpp index 13126bd402..01dd518bba 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellLv2dbg.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellLv2dbg.cpp @@ -1,5 +1,5 @@ -#if 0 #include "stdafx.h" +#if 0 #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SC_FUNC.h" diff --git a/rpcs3/Emu/SysCalls/Modules/cellMic.cpp b/rpcs3/Emu/SysCalls/Modules/cellMic.cpp index a8d0d74168..23b2a9f61a 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellMic.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellMic.cpp @@ -1,5 +1,5 @@ -#if 0 #include "stdafx.h" +#if 0 #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SC_FUNC.h" diff --git a/rpcs3/Emu/SysCalls/Modules/cellMusicDecode.cpp b/rpcs3/Emu/SysCalls/Modules/cellMusicDecode.cpp index 24785dfa77..14c64aefd0 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellMusicDecode.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellMusicDecode.cpp @@ -1,5 +1,5 @@ -#if 0 #include "stdafx.h" +#if 0 #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SC_FUNC.h" diff --git a/rpcs3/Emu/SysCalls/Modules/cellMusicExport.cpp b/rpcs3/Emu/SysCalls/Modules/cellMusicExport.cpp index 268677caa5..7ded73fc72 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellMusicExport.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellMusicExport.cpp @@ -1,5 +1,5 @@ -#if 0 #include "stdafx.h" +#if 0 #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SC_FUNC.h" diff --git a/rpcs3/Emu/SysCalls/Modules/cellOvis.cpp b/rpcs3/Emu/SysCalls/Modules/cellOvis.cpp index f47f403140..25907207e1 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellOvis.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellOvis.cpp @@ -1,5 +1,5 @@ -#if 0 #include "stdafx.h" +#if 0 #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SC_FUNC.h" diff --git a/rpcs3/Emu/SysCalls/Modules/cellPhotoDecode.cpp b/rpcs3/Emu/SysCalls/Modules/cellPhotoDecode.cpp index 34d893e1f9..9281f3c17b 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellPhotoDecode.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellPhotoDecode.cpp @@ -1,5 +1,5 @@ -#if 0 #include "stdafx.h" +#if 0 #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SC_FUNC.h" diff --git a/rpcs3/Emu/SysCalls/Modules/cellPhotoExport.cpp b/rpcs3/Emu/SysCalls/Modules/cellPhotoExport.cpp index 3268783bee..71dd6f5bc9 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellPhotoExport.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellPhotoExport.cpp @@ -1,5 +1,5 @@ -#if 0 #include "stdafx.h" +#if 0 #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SC_FUNC.h" diff --git a/rpcs3/Emu/SysCalls/Modules/cellPhotoImport.cpp b/rpcs3/Emu/SysCalls/Modules/cellPhotoImport.cpp index ed24bfb5a0..c5815b9f5b 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellPhotoImport.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellPhotoImport.cpp @@ -1,5 +1,5 @@ -#if 0 #include "stdafx.h" +#if 0 #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SC_FUNC.h" diff --git a/rpcs3/Emu/SysCalls/Modules/cellPngEnc.cpp b/rpcs3/Emu/SysCalls/Modules/cellPngEnc.cpp index 5d10680730..4b59e80a26 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellPngEnc.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellPngEnc.cpp @@ -1,5 +1,5 @@ -#if 0 #include "stdafx.h" +#if 0 #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SC_FUNC.h" diff --git a/rpcs3/Emu/SysCalls/Modules/cellPrint.cpp b/rpcs3/Emu/SysCalls/Modules/cellPrint.cpp index 62b1d312ad..191c53c1d8 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellPrint.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellPrint.cpp @@ -1,5 +1,5 @@ -#if 0 #include "stdafx.h" +#if 0 #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SC_FUNC.h" diff --git a/rpcs3/Emu/SysCalls/Modules/cellRudp.cpp b/rpcs3/Emu/SysCalls/Modules/cellRudp.cpp index e8c1261ec2..6cef6bbf08 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellRudp.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellRudp.cpp @@ -1,5 +1,5 @@ -#if 0 #include "stdafx.h" +#if 0 #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SC_FUNC.h" diff --git a/rpcs3/Emu/SysCalls/Modules/cellSail.cpp b/rpcs3/Emu/SysCalls/Modules/cellSail.cpp index e590376216..b301af90b0 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSail.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSail.cpp @@ -1,5 +1,5 @@ -#if 0 #include "stdafx.h" +#if 0 #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SC_FUNC.h" diff --git a/rpcs3/Emu/SysCalls/Modules/cellSailRec.cpp b/rpcs3/Emu/SysCalls/Modules/cellSailRec.cpp index c3ff0bbe4f..dce0b36acb 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSailRec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSailRec.cpp @@ -1,5 +1,5 @@ -#if 0 #include "stdafx.h" +#if 0 #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SC_FUNC.h" diff --git a/rpcs3/Emu/SysCalls/Modules/cellScreenshot.cpp b/rpcs3/Emu/SysCalls/Modules/cellScreenshot.cpp index 6972ae06d4..bcc77d5466 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellScreenshot.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellScreenshot.cpp @@ -1,5 +1,5 @@ -#if 0 #include "stdafx.h" +#if 0 #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SC_FUNC.h" diff --git a/rpcs3/Emu/SysCalls/Modules/cellSearch.cpp b/rpcs3/Emu/SysCalls/Modules/cellSearch.cpp index 4da6818439..8ba73eba86 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSearch.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSearch.cpp @@ -1,5 +1,5 @@ -#if 0 #include "stdafx.h" +#if 0 #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SC_FUNC.h" diff --git a/rpcs3/Emu/SysCalls/Modules/cellSheap.cpp b/rpcs3/Emu/SysCalls/Modules/cellSheap.cpp index feee6c5245..ea15f3819f 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSheap.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSheap.cpp @@ -1,5 +1,5 @@ -#if 0 #include "stdafx.h" +#if 0 #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SC_FUNC.h" diff --git a/rpcs3/Emu/SysCalls/Modules/cellSsl.cpp b/rpcs3/Emu/SysCalls/Modules/cellSsl.cpp index 3bf12e87ce..c0a30dc9f7 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSsl.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSsl.cpp @@ -1,5 +1,5 @@ -#if 0 #include "stdafx.h" +#if 0 #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SC_FUNC.h" diff --git a/rpcs3/Emu/SysCalls/Modules/cellSubdisplay.cpp b/rpcs3/Emu/SysCalls/Modules/cellSubdisplay.cpp index 0f4c7ad87f..467f82d29d 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSubdisplay.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSubdisplay.cpp @@ -1,5 +1,5 @@ -#if 0 #include "stdafx.h" +#if 0 #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SC_FUNC.h" diff --git a/rpcs3/Emu/SysCalls/Modules/cellSync2.cpp b/rpcs3/Emu/SysCalls/Modules/cellSync2.cpp index ecaa713f80..1817f3c1b6 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSync2.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSync2.cpp @@ -1,5 +1,5 @@ -#if 0 #include "stdafx.h" +#if 0 #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SC_FUNC.h" diff --git a/rpcs3/Emu/SysCalls/Modules/cellUsbd.cpp b/rpcs3/Emu/SysCalls/Modules/cellUsbd.cpp index eb8d7dc369..fa4323a05e 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellUsbd.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellUsbd.cpp @@ -1,5 +1,5 @@ -#if 0 #include "stdafx.h" +#if 0 #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SC_FUNC.h" diff --git a/rpcs3/Emu/SysCalls/Modules/cellUsbpspcm.cpp b/rpcs3/Emu/SysCalls/Modules/cellUsbpspcm.cpp index 005c2741ca..9ce3671f2d 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellUsbpspcm.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellUsbpspcm.cpp @@ -1,5 +1,5 @@ -#if 0 #include "stdafx.h" +#if 0 #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SC_FUNC.h" diff --git a/rpcs3/Emu/SysCalls/Modules/cellVoice.cpp b/rpcs3/Emu/SysCalls/Modules/cellVoice.cpp index 2330a2773e..63dc1763d3 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellVoice.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellVoice.cpp @@ -1,5 +1,5 @@ -#if 0 #include "stdafx.h" +#if 0 #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SC_FUNC.h" diff --git a/rpcs3/Emu/SysCalls/Modules/libmixer.cpp b/rpcs3/Emu/SysCalls/Modules/libmixer.cpp index b3a2c194eb..0685b0e90c 100644 --- a/rpcs3/Emu/SysCalls/Modules/libmixer.cpp +++ b/rpcs3/Emu/SysCalls/Modules/libmixer.cpp @@ -14,11 +14,11 @@ Module *libmixer = nullptr; CellSurMixerConfig surMixer; #define SUR_PORT (7) -u32 surMixerCb = 0; -u32 surMixerCbArg = 0; +u32 surMixerCb; +u32 surMixerCbArg; std::mutex mixer_mutex; float mixdata[8*256]; -u64 mixcount = 0; +u64 mixcount; std::vector ssp; @@ -342,6 +342,9 @@ int cellSurMixerCreate(const mem_ptr_t config) libmixer->Warning("*** surMixer created (ch1=%d, ch2=%d, ch6=%d, ch8=%d)", (u32)surMixer.chStrips1, (u32)surMixer.chStrips2, (u32)surMixer.chStrips6, (u32)surMixer.chStrips8); + mixcount = 0; + surMixerCb = 0; + thread t("Surmixer Thread", []() { AudioPortConfig& port = m_config.m_ports[SUR_PORT]; @@ -350,8 +353,6 @@ int cellSurMixerCreate(const mem_ptr_t config) mixerCb->SetName("Surmixer Callback"); - mixcount = 0; - while (port.m_is_audio_port_opened) { if (Emu.IsStopped()) diff --git a/rpcs3/Emu/SysCalls/Static.h b/rpcs3/Emu/SysCalls/Static.h index 9050ed8b80..4fd9a6142a 100644 --- a/rpcs3/Emu/SysCalls/Static.h +++ b/rpcs3/Emu/SysCalls/Static.h @@ -1,6 +1,6 @@ #pragma once -class SFunc; +struct SFunc; class StaticFuncManager {