diff --git a/pcsx2/Dmac.cpp b/pcsx2/Dmac.cpp index a8cfb1596b..e5f5319191 100644 --- a/pcsx2/Dmac.cpp +++ b/pcsx2/Dmac.cpp @@ -305,7 +305,7 @@ __fi u32 dmacRead32( u32 mem ) if (++counter == 8) counter = 2; // Set OPH and APATH from counter, cycling paths and alternating OPH - return gifRegs.stat._u32 & ~(7 << 9) | (counter & 1 ? counter << 9 : 0); + return gifRegs.stat._u32 & (~(7 << 9) | (counter & 1 ? counter << 9 : 0)); } return psHu32(mem); diff --git a/pcsx2/Gif.cpp b/pcsx2/Gif.cpp index f354e3ce10..bf972abcdb 100644 --- a/pcsx2/Gif.cpp +++ b/pcsx2/Gif.cpp @@ -403,6 +403,8 @@ static __fi tDMA_TAG* ReadTag() return ptag; } +#if 0 +// Not used static __fi tDMA_TAG* ReadTag2() { tDMA_TAG* ptag = dmaGetAddr(gifch.tadr, false); // Set memory pointer to TADR @@ -413,6 +415,7 @@ static __fi tDMA_TAG* ReadTag2() gif.gspath3done = hwDmacSrcChainWithStack(gifch, ptag->ID); return ptag; } +#endif void GIFdma() { diff --git a/pcsx2/Interpreter.cpp b/pcsx2/Interpreter.cpp index 1f4183e7aa..1cb5dd7134 100644 --- a/pcsx2/Interpreter.cpp +++ b/pcsx2/Interpreter.cpp @@ -478,11 +478,6 @@ static void intReserve() // fixme : detect cpu for use the optimize asm code } -static void intAlloc() -{ - // Nothing to do! -} - static void intReset() { cpuRegs.branch = 0; diff --git a/pcsx2/IopCounters.cpp b/pcsx2/IopCounters.cpp index 4aba2606ed..3871200010 100644 --- a/pcsx2/IopCounters.cpp +++ b/pcsx2/IopCounters.cpp @@ -75,12 +75,15 @@ u8 psxvblankgate = 0; // which ensures they stay 100% in sync with the EE's hblank counters. #define PSXHBLANK 0x2001 +#if 0 +// Unused static void psxRcntReset(int index) { psxCounters[index].count = 0; psxCounters[index].mode &= ~0x18301C00; psxCounters[index].sCycleT = psxRegs.cycle; } +#endif static void _rcntSet(int cntidx) { diff --git a/pcsx2/MemoryCardProtocol.cpp b/pcsx2/MemoryCardProtocol.cpp index 9992310a5b..0dd7061d61 100644 --- a/pcsx2/MemoryCardProtocol.cpp +++ b/pcsx2/MemoryCardProtocol.cpp @@ -132,41 +132,41 @@ void MemoryCardProtocol::GetSpecs() { MC_LOG.WriteLn("%s", __FUNCTION__); PS1_FAIL(); - u8 checksum = 0x00; + //u8 checksum = 0x00; McdSizeInfo info; mcd->GetSizeInfo(info); fifoOut.push_back(0x2b); const u8 sectorSizeLSB = (info.SectorSize & 0xff); - checksum ^= sectorSizeLSB; + //checksum ^= sectorSizeLSB; fifoOut.push_back(sectorSizeLSB); const u8 sectorSizeMSB = (info.SectorSize >> 8); - checksum ^= sectorSizeMSB; + //checksum ^= sectorSizeMSB; fifoOut.push_back(sectorSizeMSB); const u8 eraseBlockSizeLSB = (info.EraseBlockSizeInSectors & 0xff); - checksum ^= eraseBlockSizeLSB; + //checksum ^= eraseBlockSizeLSB; fifoOut.push_back(eraseBlockSizeLSB); const u8 eraseBlockSizeMSB = (info.EraseBlockSizeInSectors >> 8); - checksum ^= eraseBlockSizeMSB; + //checksum ^= eraseBlockSizeMSB; fifoOut.push_back(eraseBlockSizeMSB); const u8 sectorCountLSB = (info.McdSizeInSectors & 0xff); - checksum ^= sectorCountLSB; + //checksum ^= sectorCountLSB; fifoOut.push_back(sectorCountLSB); const u8 sectorCount2nd = (info.McdSizeInSectors >> 8); - checksum ^= sectorCount2nd; + //checksum ^= sectorCount2nd; fifoOut.push_back(sectorCount2nd); const u8 sectorCount3rd = (info.McdSizeInSectors >> 16); - checksum ^= sectorCount3rd; + //checksum ^= sectorCount3rd; fifoOut.push_back(sectorCount3rd); const u8 sectorCountMSB = (info.McdSizeInSectors >> 24); - checksum ^= sectorCountMSB; + //checksum ^= sectorCountMSB; fifoOut.push_back(sectorCountMSB); fifoOut.push_back(info.Xor); diff --git a/pcsx2/Recording/InputRecording.cpp b/pcsx2/Recording/InputRecording.cpp index c5eb794647..e7cd05d6a8 100644 --- a/pcsx2/Recording/InputRecording.cpp +++ b/pcsx2/Recording/InputRecording.cpp @@ -251,7 +251,7 @@ void InputRecording::incFrameCounter() return; } - if (m_frame_counter >= std::numeric_limits::max()) + if (m_frame_counter == std::numeric_limits::max()) { // TODO - log the incredible achievment of playing for longer than 4 billion years, and end the recording stop(); diff --git a/pcsx2/Sio.cpp b/pcsx2/Sio.cpp index 2ebe687f11..0701519acc 100644 --- a/pcsx2/Sio.cpp +++ b/pcsx2/Sio.cpp @@ -44,14 +44,6 @@ Sio2 sio2; _mcd mcds[2][4]; _mcd *mcd; -// Currently only check if pad wants mtap to be active. -// Could lets PCSX2 have its own options, if anyone ever -// wants to add support for using the extra memcard slots. -static bool IsMtapPresent( uint port ) -{ - return EmuConfig.MultitapEnabled( port ); -} - // ============================================================================ // SIO0 // ============================================================================ @@ -177,7 +169,7 @@ void Sio0::SetTxData(u8 value) stat |= SIO0_STAT::TX_READY | SIO0_STAT::TX_EMPTY; stat |= (SIO0_STAT::RX_FIFO_NOT_EMPTY); - if (!ctrl & SIO0_CTRL::TX_ENABLE) + if (!(ctrl & SIO0_CTRL::TX_ENABLE)) { Console.Warning("%s(%02X) CTRL in illegal state, exiting instantly", __FUNCTION__, value); return; diff --git a/pcsx2/SourceLog.cpp b/pcsx2/SourceLog.cpp index 29bb15ba3d..e103e6340c 100644 --- a/pcsx2/SourceLog.cpp +++ b/pcsx2/SourceLog.cpp @@ -133,8 +133,8 @@ SysConsoleLogPack::SysConsoleLogPack() // -------------------------------------------------------------------------------------- static const SysTraceLogDescriptor TLD_SIF = { - "SIF", "SIF (EE <-> IOP)", - "", + {"SIF", "SIF (EE <-> IOP)", + ""}, "SIF"}; // ---------------------------- @@ -143,45 +143,45 @@ static const SysTraceLogDescriptor static const SysTraceLogDescriptor TLD_EE_Bios = { - "Bios", "Bios", - "SYSCALL and DECI2 activity.", + {"Bios", "Bios", + "SYSCALL and DECI2 activity."}, "EE"}, - TLD_EE_Memory = {"Memory", "Memory", "Direct memory accesses to unknown or unmapped EE memory space.", "eMem"}, + TLD_EE_Memory = {{"Memory", "Memory", "Direct memory accesses to unknown or unmapped EE memory space."}, "eMem"}, - TLD_EE_R5900 = {"R5900", "R5900 Core", "Disasm of executing core instructions (excluding COPs and CACHE).", "eDis"}, + TLD_EE_R5900 = {{"R5900", "R5900 Core", "Disasm of executing core instructions (excluding COPs and CACHE)."}, "eDis"}, - TLD_EE_COP0 = {"COP0", "COP0", "Disasm of COP0 instructions (MMU, cpu and dma status, etc).", "eDis"}, + TLD_EE_COP0 = {{"COP0", "COP0", "Disasm of COP0 instructions (MMU, cpu and dma status, etc)."}, "eDis"}, - TLD_EE_COP1 = {"FPU", "COP1/FPU", "Disasm of the EE's floating point unit (FPU) only.", "eDis"}, + TLD_EE_COP1 = {{"FPU", "COP1/FPU", "Disasm of the EE's floating point unit (FPU) only."}, "eDis"}, - TLD_EE_COP2 = {"VUmacro", "COP2/VUmacro", "Disasm of the EE's VU0macro co-processor instructions.", "eDis"}, + TLD_EE_COP2 = {{"VUmacro", "COP2/VUmacro", "Disasm of the EE's VU0macro co-processor instructions."}, "eDis"}, - TLD_EE_Cache = {"Cache", "Cache", "Execution of EE cache instructions.", "eDis"}, + TLD_EE_Cache = {{"Cache", "Cache", "Execution of EE cache instructions."}, "eDis"}, - TLD_EE_KnownHw = {"HwRegs", "Hardware Regs", "All known hardware register accesses (very slow!); not including sub filter options below.", "eReg"}, + TLD_EE_KnownHw = {{"HwRegs", "Hardware Regs", "All known hardware register accesses (very slow!); not including sub filter options below."}, "eReg"}, - TLD_EE_UnknownHw = {"UnknownRegs", "Unknown Regs", "Logs only unknown, unmapped, or unimplemented register accesses.", "eReg"}, + TLD_EE_UnknownHw = {{"UnknownRegs", "Unknown Regs", "Logs only unknown, unmapped, or unimplemented register accesses."}, "eReg"}, - TLD_EE_DMAhw = {"DmaRegs", "DMA Regs", "Logs only DMA-related registers.", "eReg"}, + TLD_EE_DMAhw = {{"DmaRegs", "DMA Regs", "Logs only DMA-related registers."}, "eReg"}, - TLD_EE_IPU = {"IPU", "IPU", "IPU activity: hardware registers, decoding operations, DMA status, etc.", "IPU"}, + TLD_EE_IPU = {{"IPU", "IPU", "IPU activity: hardware registers, decoding operations, DMA status, etc."}, "IPU"}, - TLD_EE_GIFtag = {"GIFtags", "GIFtags", "All GIFtag parse activity; path index, tag type, etc.", "GIF"}, + TLD_EE_GIFtag = {{"GIFtags", "GIFtags", "All GIFtag parse activity; path index, tag type, etc."}, "GIF"}, - TLD_EE_VIFcode = {"VIFcodes", "VIFcodes", "All VIFcode processing; command, tag style, interrupts.", "VIF"}, + TLD_EE_VIFcode = {{"VIFcodes", "VIFcodes", "All VIFcode processing; command, tag style, interrupts."}, "VIF"}, - TLD_EE_MSKPATH3 = {"MSKPATH3", "MSKPATH3", "All processing involved in Path3 Masking.", "MSKPATH3"}, + TLD_EE_MSKPATH3 = {{"MSKPATH3", "MSKPATH3", "All processing involved in Path3 Masking."}, "MSKPATH3"}, - TLD_EE_SPR = {"MFIFO", "Scratchpad MFIFO", "Scratchpad's MFIFO activity.", "SPR"}, + TLD_EE_SPR = {{"MFIFO", "Scratchpad MFIFO", "Scratchpad's MFIFO activity."}, "SPR"}, - TLD_EE_DMAC = {"DmaCtrl", "DMA Controller", "Actual data transfer logs, bus right arbitration, stalls, etc.", "eDmaC"}, + TLD_EE_DMAC = {{"DmaCtrl", "DMA Controller", "Actual data transfer logs, bus right arbitration, stalls, etc."}, "eDmaC"}, - TLD_EE_Counters = {"Counters", "Counters", "Tracks all EE counters events and some counter register activity.", "eCnt"}, + TLD_EE_Counters = {{"Counters", "Counters", "Tracks all EE counters events and some counter register activity."}, "eCnt"}, - TLD_EE_VIF = {"VIF", "VIF", "Dumps various VIF and VIFcode processing data.", "VIF"}, + TLD_EE_VIF = {{"VIF", "VIF", "Dumps various VIF and VIFcode processing data."}, "VIF"}, - TLD_EE_GIF = {"GIF", "GIF", "Dumps various GIF and GIFtag parsing data.", "GIF"}; + TLD_EE_GIF = {{"GIF", "GIF", "Dumps various GIF and GIFtag parsing data."}, "GIF"}; // ---------------------------------- // IOP - Input / Output Processor @@ -189,33 +189,33 @@ static const SysTraceLogDescriptor static const SysTraceLogDescriptor TLD_IOP_Bios = { - "Bios", "Bios", - "SYSCALL and IRX activity.", + {"Bios", "Bios", + "SYSCALL and IRX activity."}, "IOP"}, - TLD_IOP_Memory = {"Memory", "Memory", "Direct memory accesses to unknown or unmapped IOP memory space.", "iMem"}, + TLD_IOP_Memory = {{"Memory", "Memory", "Direct memory accesses to unknown or unmapped IOP memory space."}, "iMem"}, - TLD_IOP_R3000A = {"R3000A", "R3000A Core", "Disasm of executing core instructions (excluding COPs and CACHE).", "iDis"}, + TLD_IOP_R3000A = {{"R3000A", "R3000A Core", "Disasm of executing core instructions (excluding COPs and CACHE)."}, "iDis"}, - TLD_IOP_COP2 = {"COP2/GPU", "COP2", "Disasm of the IOP's GPU co-processor instructions.", "iDis"}, + TLD_IOP_COP2 = {{"COP2/GPU", "COP2", "Disasm of the IOP's GPU co-processor instructions."}, "iDis"}, - TLD_IOP_KnownHw = {"HwRegs", "Hardware Regs", "All known hardware register accesses, not including the sub-filters below.", "iReg"}, + TLD_IOP_KnownHw = {{"HwRegs", "Hardware Regs", "All known hardware register accesses, not including the sub-filters below."}, "iReg"}, - TLD_IOP_UnknownHw = {"UnknownRegs", "Unknown Regs", "Logs only unknown, unmapped, or unimplemented register accesses.", "iReg"}, + TLD_IOP_UnknownHw = {{"UnknownRegs", "Unknown Regs", "Logs only unknown, unmapped, or unimplemented register accesses."}, "iReg"}, - TLD_IOP_DMAhw = {"DmaRegs", "DMA Regs", "Logs only DMA-related registers.", "iReg"}, + TLD_IOP_DMAhw = {{"DmaRegs", "DMA Regs", "Logs only DMA-related registers."}, "iReg"}, - TLD_IOP_Memcards = {"Memorycards", "Memorycards", "Memorycard reads, writes, erases, terminators, and other processing.", "Mcd"}, + TLD_IOP_Memcards = {{"Memorycards", "Memorycards", "Memorycard reads, writes, erases, terminators, and other processing."}, "Mcd"}, - TLD_IOP_PAD = {"Pad", "Pad", "Gamepad activity on the SIO.", "Pad"}, + TLD_IOP_PAD = {{"Pad", "Pad", "Gamepad activity on the SIO."}, "Pad"}, - TLD_IOP_DMAC = {"DmaCrl", "DMA Controller", "Actual DMA event processing and data transfer logs.", "iDmaC"}, + TLD_IOP_DMAC = {{"DmaCrl", "DMA Controller", "Actual DMA event processing and data transfer logs."}, "iDmaC"}, - TLD_IOP_Counters = {"Counters", "Counters", "Tracks all IOP counters events and some counter register activity.", "iCnt"}, + TLD_IOP_Counters = {{"Counters", "Counters", "Tracks all IOP counters events and some counter register activity."}, "iCnt"}, - TLD_IOP_CDVD = {"CDVD", "CDVD", "Detailed logging of CDVD hardware.", "CDVD"}, + TLD_IOP_CDVD = {{"CDVD", "CDVD", "Detailed logging of CDVD hardware."}, "CDVD"}, - TLD_IOP_MDEC = {"MDEC", "MDEC", "Detailed logging of the Motion (FMV) Decoder hardware unit.", "MDEC"}; + TLD_IOP_MDEC = {{"MDEC", "MDEC", "Detailed logging of the Motion (FMV) Decoder hardware unit."}, "MDEC"}; SysTraceLogPack::SysTraceLogPack() : SIF(&TLD_SIF) diff --git a/pcsx2/VUops.cpp b/pcsx2/VUops.cpp index 23dc3a31c0..4cbb5d6507 100644 --- a/pcsx2/VUops.cpp +++ b/pcsx2/VUops.cpp @@ -2090,6 +2090,8 @@ As an example for setting the polynomial variable correctly, the 23-bit M-series would be specified as (1 << 14). */ +// Unused +#if 0 //The two-tap 23 stage M-series polynomials are x23+x18 and x23+x14 ((1 << 18) and (1 << 14), respectively). //The reverse sequences can be generated by x23+x(23-18) and x23+x(23-14) ((1 << 9) and (1 << 5), respectively) static u32 poly = 1 << 5; @@ -2098,6 +2100,7 @@ static __ri void SetPoly(u32 newPoly) { poly = poly & ~1; } +#endif static __ri void AdvanceLFSR(VURegs* VU) { diff --git a/pcsx2/Vif1_MFIFO.cpp b/pcsx2/Vif1_MFIFO.cpp index a33cbcd83e..8fb1300ae6 100644 --- a/pcsx2/Vif1_MFIFO.cpp +++ b/pcsx2/Vif1_MFIFO.cpp @@ -113,7 +113,7 @@ static __fi bool mfifoVIF1rbTransfer() static __fi void mfifo_VIF1chain() { /* Is QWC = 0? if so there is nothing to transfer */ - if ((vif1ch.qwc == 0)) + if (vif1ch.qwc == 0) { vif1.inprogress &= ~1; return; diff --git a/pcsx2/ps2/Iop/IopHwWrite.cpp b/pcsx2/ps2/Iop/IopHwWrite.cpp index a1e0378ef8..86ed6f03ef 100644 --- a/pcsx2/ps2/Iop/IopHwWrite.cpp +++ b/pcsx2/ps2/Iop/IopHwWrite.cpp @@ -342,7 +342,7 @@ static __fi void _HwWrite_16or32_Page1( u32 addr, T val ) mcase(HW_IREG): psxHu(addr) &= val; - if ((val == 0xffffffff) ) { + if (val == 0xffffffff) { psxHu32(addr) |= 1 << 2; psxHu32(addr) |= 1 << 3; } diff --git a/pcsx2/ps2/Iop/PsxBios.cpp b/pcsx2/ps2/Iop/PsxBios.cpp index 6a738316cc..6b60682fee 100644 --- a/pcsx2/ps2/Iop/PsxBios.cpp +++ b/pcsx2/ps2/Iop/PsxBios.cpp @@ -67,7 +67,7 @@ bool psxBiosCall() // TODO: Tracing // TODO (maybe, psx is hardly a priority): HLE framework - switch ((psxRegs.pc & 0x1FFFFFFFU) << 4 & 0xf00 | psxRegs.GPR.n.t1 & 0xff) { + switch (((psxRegs.pc << 4) & 0xf00) | (psxRegs.GPR.n.t1 & 0xff)) { case 0xa03: case 0xb35: // write(fd, data, size) diff --git a/pcsx2/vtlb.cpp b/pcsx2/vtlb.cpp index c466712b3d..f901a36732 100644 --- a/pcsx2/vtlb.cpp +++ b/pcsx2/vtlb.cpp @@ -1304,10 +1304,6 @@ void vtlb_Core_Free() s_fastmem_area.reset(); } -static std::string GetHostVmErrorMsg() -{ - return "Your system is too low on virtual resources for PCSX2 to run. This can be caused by having a small or disabled swapfile, or by other programs that are hogging resources."; -} // -------------------------------------------------------------------------------------- // VtlbMemoryReserve (implementations) // --------------------------------------------------------------------------------------