Fix a bunch of warnings.

This commit is contained in:
Jean-Philip Desjardins 2023-05-02 08:56:25 -04:00
parent 9ed731ac75
commit aee69ac97c
58 changed files with 165 additions and 254 deletions

View file

@ -7,6 +7,7 @@
#include "ElfDefs.h"
#include "PtrStream.h"
#include "EndianUtils.h"
#include "maybe_unused.h"
struct ELFTRAITS32
{
@ -189,7 +190,7 @@ private:
stream.Seek(m_header.nSectHeaderStart, Framework::STREAM_SEEK_SET);
for(auto& section : m_sections)
{
auto readAmount = stream.Read(&section, sizeof(section));
FRAMEWORK_MAYBE_UNUSED auto readAmount = stream.Read(&section, sizeof(section));
assert(readAmount == sizeof(section));
if(m_header.nId[ELF::EI_DATA] == ELF::ELFDATA2MSB)
{

View file

@ -94,7 +94,7 @@ void CFrameDump::Read(Framework::CStream& input)
if(fileHeader.first.find(STATE_PACKET_METADATA_PREFIX) == 0)
{
unsigned int packetIdx = 0;
int scanCount = sscanf(fileHeader.first.c_str(), STATE_PACKET_METADATA_PREFIX "%d", &packetIdx);
FRAMEWORK_MAYBE_UNUSED int scanCount = sscanf(fileHeader.first.c_str(), STATE_PACKET_METADATA_PREFIX "%d", &packetIdx);
assert(scanCount == 1);
packetFiles[packetIdx] = fileHeader.first;
}

View file

@ -51,19 +51,7 @@
#define PREF_PS2_ARCADEROMS_DIRECTORY_DEFAULT ("arcaderoms")
CPS2VM::CPS2VM()
: m_nStatus(PAUSED)
, m_nEnd(false)
, m_pad(NULL)
, m_singleStepEe(false)
, m_singleStepIop(false)
, m_singleStepVu0(false)
, m_singleStepVu1(false)
, m_vblankTicks(0)
, m_inVblank(false)
, m_eeExecutionTicks(0)
, m_iopExecutionTicks(0)
, m_spuUpdateTicks(SPU_UPDATE_TICKS)
, m_eeProfilerZone(CProfiler::GetInstance().RegisterZone("EE"))
: m_eeProfilerZone(CProfiler::GetInstance().RegisterZone("EE"))
, m_iopProfilerZone(CProfiler::GetInstance().RegisterZone("IOP"))
, m_spuProfilerZone(CProfiler::GetInstance().RegisterZone("SPU"))
, m_gsSyncProfilerZone(CProfiler::GetInstance().RegisterZone("GSSYNC"))

View file

@ -141,24 +141,24 @@ private:
void EmuThread();
std::thread m_thread;
STATUS m_nStatus;
bool m_nEnd;
STATUS m_nStatus = PAUSED;
bool m_nEnd = false;
uint32 m_onScreenTicksTotal = 0;
uint32 m_vblankTicksTotal = 0;
int m_vblankTicks = 0;
bool m_inVblank = 0;
int m_spuUpdateTicks = 0;
bool m_inVblank = false;
int m_spuUpdateTicks = SPU_UPDATE_TICKS;
int m_eeExecutionTicks = 0;
int m_iopExecutionTicks = 0;
CFrameLimiter m_frameLimiter;
CPU_UTILISATION_INFO m_cpuUtilisation;
bool m_singleStepEe;
bool m_singleStepIop;
bool m_singleStepVu0;
bool m_singleStepVu1;
bool m_singleStepEe = false;
bool m_singleStepIop = false;
bool m_singleStepVu0 = false;
bool m_singleStepVu1 = false;
#ifdef DEBUGGER_INCLUDED
CFrameDump m_frameDump;

View file

@ -184,6 +184,13 @@ private:
void UpdateCpCond();
uint8* m_ram = nullptr;
uint8* m_spr = nullptr;
uint8* m_vuMem0 = nullptr;
uint8* m_vuMem1 = nullptr;
CMIPS& m_ee;
D_CTRL_REG m_D_CTRL;
uint32 m_D_STAT;
uint32 m_D_ENABLE;
@ -219,13 +226,6 @@ private:
Dmac::CChannel m_D9;
uint32 m_D9_SADR;
uint8* m_ram;
uint8* m_spr;
uint8* m_vuMem0;
uint8* m_vuMem1;
CMIPS& m_ee;
Dmac::DmaReceiveHandler m_receiveDma5;
Dmac::DmaReceiveHandler m_receiveDma6;
};

View file

@ -96,9 +96,9 @@ namespace Dmac
void ExecuteSourceChainTransfer(bool);
void ClearSTR();
unsigned int m_number = 0;
uint32 m_nSCCTRL;
DmaReceiveHandler m_receive;
CDMAC& m_dmac;
unsigned int m_number = 0;
DmaReceiveHandler m_receive;
uint32 m_nSCCTRL;
};
};

View file

@ -1,4 +1,5 @@
#include "EeBasicBlock.h"
#include "offsetof_def.h"
void CEeBasicBlock::CompileEpilog(CMipsJitter* jitter, bool loopsOnItself)
{
@ -123,8 +124,8 @@ bool CEeBasicBlock::IsIdleLoopBlock() const
}
//Just make sure that we've at least defined our comparision register
bool compareRsDefined = defState & (1 << compareRs);
bool compareRtDefined = defState & (1 << compareRt);
FRAMEWORK_MAYBE_UNUSED bool compareRsDefined = defState & (1 << compareRs);
FRAMEWORK_MAYBE_UNUSED bool compareRtDefined = defState & (1 << compareRt);
assert(compareRsDefined || compareRtDefined);

View file

@ -57,6 +57,8 @@ void CIdleEvaluator::STRATEGY_SEMACHECKER::NotifyEvent(EVENT eventType, uint32 a
m_lastWaitSema = -1;
m_isIdle = false;
break;
default:
break;
}
}
@ -99,6 +101,8 @@ void CIdleEvaluator::STRATEGY_SELFTHREADROTATE::NotifyEvent(EVENT eventType, uin
m_selfRotateThreadCount = 0;
m_isIdle = false;
break;
default:
break;
}
}
@ -139,6 +143,8 @@ void CIdleEvaluator::STRATEGY_THREADROTATEBOUNCE::NotifyEvent(EVENT eventType, u
case EVENT_INTERRUPT:
m_bounceCount = 0;
break;
default:
break;
}
m_isIdle = (m_bounceCount > 1000);
}

View file

@ -43,12 +43,12 @@ CSubSystem::CSubSystem(uint8* iopRam, CIopBios& iopBios)
, m_sif(m_dmac, m_ram, iopRam)
, m_ipu(m_intc)
, m_timer(m_intc, m_gs)
, m_iopBios(iopBios)
, m_MAVU0(PS2::VUMEM0SIZE - 1)
, m_MAVU1(PS2::VUMEM1SIZE - 1)
, m_COP_SCU(MIPS_REGSIZE_64)
, m_COP_FPU(MIPS_REGSIZE_64)
, m_COP_VU(MIPS_REGSIZE_64)
, m_iopBios(iopBios)
{
//Some alignment checks, this is needed because of SIMD instructions used in generated code
assert((reinterpret_cast<size_t>(&m_EE.m_State) & 0x0F) == 0);

View file

@ -52,6 +52,10 @@ namespace Ee
uint8* m_vuMem1 = nullptr;
uint8* m_microMem1 = nullptr;
CMIPS m_EE;
CMIPS m_VU0;
CMIPS m_VU1;
CGSHandler* m_gs = nullptr;
CDMAC m_dmac;
CGIF m_gif;
@ -61,13 +65,9 @@ namespace Ee
CINTC m_intc;
CIPU m_ipu;
CTimer m_timer;
CPS2OS* m_os;
CPS2OS* m_os = nullptr;
CIopBios& m_iopBios;
CMIPS m_EE;
CMIPS m_VU0;
CMIPS m_VU1;
void* operator new(size_t allocSize)
{
return framework_aligned_alloc(allocSize, 0x10);

View file

@ -434,7 +434,7 @@ void CGIF::ProcessFifoWrite(uint32 address, uint32 value)
m_fifoIndex += 4;
if(m_fifoIndex == FIFO_SIZE)
{
uint32 processed = ProcessMultiplePackets(m_fifoBuffer, FIFO_SIZE, 0, FIFO_SIZE, CGsPacketMetadata(3));
FRAMEWORK_MAYBE_UNUSED uint32 processed = ProcessMultiplePackets(m_fifoBuffer, FIFO_SIZE, 0, FIFO_SIZE, CGsPacketMetadata(3));
assert(processed == FIFO_SIZE);
m_fifoIndex = 0;
}

View file

@ -1,9 +1,10 @@
#include "IPU.h"
#include <cassert>
#include <cstring>
#include <stdio.h>
#include <exception>
#include <functional>
#include "IPU.h"
#include "maybe_unused.h"
#include "IPU_MacroblockAddressIncrementTable.h"
#include "IPU_MacroblockTypeITable.h"
#include "IPU_MacroblockTypePTable.h"
@ -742,13 +743,6 @@ void CIPU::DisassembleCommand(uint32 nValue)
//OUT FIFO class implementation
/////////////////////////////////////////////
CIPU::COUTFIFO::COUTFIFO()
: m_buffer(nullptr)
, m_alloc(0)
, m_size(0)
{
}
CIPU::COUTFIFO::~COUTFIFO()
{
free(m_buffer);
@ -1100,7 +1094,7 @@ bool CIPU::CIDECCommand::Execute()
if(m_CSCCommand->Execute())
{
//All data should have been consumed by CSC, so nothing should remain
uint32 remainLength = m_temp_IN_FIFO.GetAvailableBits() + (m_blockStream.GetRemainingLength() * 8);
FRAMEWORK_MAYBE_UNUSED uint32 remainLength = m_temp_IN_FIFO.GetAvailableBits() + (m_blockStream.GetRemainingLength() * 8);
assert(remainLength == 0);
m_state = STATE_CHECKSTARTCODE;
break;
@ -1399,21 +1393,6 @@ bool CIPU::CBDECCommand::Execute()
//BDEC ReadDct subcommand implementation
/////////////////////////////////////////////
CIPU::CBDECCommand_ReadDct::CBDECCommand_ReadDct()
: m_state(STATE_INIT)
, m_IN_FIFO(NULL)
, m_coeffTable(NULL)
, m_block(NULL)
, m_dcPredictor(NULL)
, m_dcDiff(0)
, m_channelId(0)
, m_mbi(false)
, m_isMpeg1CoeffVLCTable(false)
, m_isMpeg2(true)
, m_blockIndex(0)
{
}
void CIPU::CBDECCommand_ReadDct::Initialize(CINFIFO* fifo, int16* block, unsigned int channelId, int16* dcPredictor, bool mbi, bool isMpeg1CoeffVLCTable, bool isMpeg2)
{
m_state = STATE_INIT;
@ -1546,14 +1525,6 @@ bool CIPU::CBDECCommand_ReadDct::Execute()
/////////////////////////////////////////////
//BDEC ReadDcDiff subcommand implementation
/////////////////////////////////////////////
CIPU::CBDECCommand_ReadDcDiff::CBDECCommand_ReadDcDiff()
: m_state(STATE_READSIZE)
, m_result(NULL)
, m_IN_FIFO(NULL)
, m_channelId(0)
, m_dcSize(0)
{
}
void CIPU::CBDECCommand_ReadDcDiff::Initialize(CINFIFO* fifo, unsigned int channelId, int16* result)
{
@ -1631,15 +1602,6 @@ bool CIPU::CBDECCommand_ReadDcDiff::Execute()
//VDEC command implementation
/////////////////////////////////////////////
CIPU::CVDECCommand::CVDECCommand()
: m_IN_FIFO(NULL)
, m_state(STATE_ADVANCE)
, m_commandCode(0)
, m_result(NULL)
, m_table(NULL)
{
}
void CIPU::CVDECCommand::Initialize(CINFIFO* fifo, uint32 commandCode, uint32 pictureType, uint32* result)
{
m_IN_FIFO = fifo;
@ -1743,14 +1705,6 @@ bool CIPU::CVDECCommand::Execute()
//FDEC command implementation
/////////////////////////////////////////////
CIPU::CFDECCommand::CFDECCommand()
: m_IN_FIFO(NULL)
, m_state(STATE_ADVANCE)
, m_commandCode(0)
, m_result(NULL)
{
}
void CIPU::CFDECCommand::Initialize(CINFIFO* fifo, uint32 commandCode, uint32* result)
{
m_IN_FIFO = fifo;

View file

@ -123,7 +123,6 @@ private:
class COUTFIFO
{
public:
COUTFIFO();
virtual ~COUTFIFO();
uint32 GetSize() const;
@ -141,9 +140,9 @@ private:
GROWSIZE = 0x200,
};
unsigned int m_size;
unsigned int m_alloc;
uint8* m_buffer;
unsigned int m_size = 0;
unsigned int m_alloc = 0;
uint8* m_buffer = nullptr;
Dma3ReceiveHandler m_receiveHandler;
};
@ -277,8 +276,6 @@ private:
class CBDECCommand_ReadDcDiff : public CCommand
{
public:
CBDECCommand_ReadDcDiff();
void Initialize(CINFIFO*, unsigned int, int16*);
bool Execute() override;
@ -290,18 +287,16 @@ private:
STATE_DONE
};
STATE m_state;
CINFIFO* m_IN_FIFO;
unsigned int m_channelId;
uint8 m_dcSize;
int16* m_result;
STATE m_state = STATE_READSIZE;
CINFIFO* m_IN_FIFO = nullptr;
unsigned int m_channelId = 0;
uint8 m_dcSize = 0;
int16* m_result = nullptr;
};
class CBDECCommand_ReadDct : public CCommand
{
public:
CBDECCommand_ReadDct();
void Initialize(CINFIFO*, int16* block, unsigned int channelId, int16* dcPredictor, bool mbi, bool isMpeg1CoeffVLCTable, bool isMpeg2);
bool Execute() override;
@ -315,17 +310,17 @@ private:
STATE_SKIPEOB
};
CINFIFO* m_IN_FIFO;
STATE m_state;
int16* m_block;
unsigned int m_channelId;
bool m_mbi;
bool m_isMpeg1CoeffVLCTable;
bool m_isMpeg2;
unsigned int m_blockIndex;
MPEG2::CDctCoefficientTable* m_coeffTable;
int16* m_dcPredictor;
int16 m_dcDiff;
CINFIFO* m_IN_FIFO = nullptr;
STATE m_state = STATE_INIT;
int16* m_block = nullptr;
unsigned int m_channelId = 0;
bool m_mbi = false;
bool m_isMpeg1CoeffVLCTable = false;
bool m_isMpeg2 = true;
unsigned int m_blockIndex = 0;
MPEG2::CDctCoefficientTable* m_coeffTable = nullptr;
int16* m_dcPredictor = nullptr;
int16 m_dcDiff = 0;
CBDECCommand_ReadDcDiff m_readDcDiffCommand;
};
@ -380,8 +375,6 @@ private:
class CVDECCommand : public CCommand
{
public:
CVDECCommand();
void Initialize(CINFIFO*, uint32, uint32, uint32*);
bool Execute() override;
@ -393,19 +386,17 @@ private:
STATE_DONE
};
uint32 m_commandCode;
uint32* m_result;
CINFIFO* m_IN_FIFO;
STATE m_state;
MPEG2::CVLCTable* m_table;
uint32 m_commandCode = 0;
uint32* m_result = nullptr;
CINFIFO* m_IN_FIFO = nullptr;
STATE m_state = STATE_ADVANCE;
MPEG2::CVLCTable* m_table = nullptr;
};
//0x04 ------------------------------------------------------------
class CFDECCommand : public CCommand
{
public:
CFDECCommand();
void Initialize(CINFIFO*, uint32, uint32*);
bool Execute() override;
@ -417,10 +408,10 @@ private:
STATE_DONE
};
uint32 m_commandCode;
uint32* m_result;
CINFIFO* m_IN_FIFO;
STATE m_state;
uint32 m_commandCode = 0;
uint32* m_result = nullptr;
CINFIFO* m_IN_FIFO = nullptr;
STATE m_state = STATE_ADVANCE;
};
//0x05 ------------------------------------------------------------

View file

@ -3,6 +3,7 @@
#include "../MIPS.h"
#include "VUShared.h"
#include "Vif.h"
#include "offsetof_def.h"
#undef MAX
#define LOG_NAME ("ma_vu")

View file

@ -1497,7 +1497,7 @@ void CPS2OS::HandleInterrupt(int32 cpuIntLine)
break;
}
bool interrupted = m_ee.GenerateInterrupt(BIOS_ADDRESS_INTERRUPTHANDLER);
FRAMEWORK_MAYBE_UNUSED bool interrupted = m_ee.GenerateInterrupt(BIOS_ADDRESS_INTERRUPTHANDLER);
assert(interrupted);
}
@ -2541,7 +2541,7 @@ void CPS2OS::sc_WakeupThread()
void CPS2OS::sc_CancelWakeupThread()
{
uint32 id = m_ee.m_State.nGPR[SC_PARAM0].nV[0];
bool isInt = m_ee.m_State.nGPR[3].nV[0] == 0x36;
FRAMEWORK_MAYBE_UNUSED bool isInt = m_ee.m_State.nGPR[3].nV[0] == 0x36;
auto thread = m_threads[id];
if(!thread)
@ -2920,7 +2920,7 @@ void CPS2OS::sc_PollSema()
//48
void CPS2OS::sc_ReferSemaStatus()
{
bool isInt = m_ee.m_State.nGPR[3].nV[0] != 0x47;
FRAMEWORK_MAYBE_UNUSED bool isInt = m_ee.m_State.nGPR[3].nV[0] != 0x47;
uint32 id = m_ee.m_State.nGPR[SC_PARAM0].nV[0];
auto semaParam = reinterpret_cast<SEMAPHOREPARAM*>(GetStructPtr(m_ee.m_State.nGPR[SC_PARAM1].nV0));
@ -2958,7 +2958,7 @@ void CPS2OS::sc_GetOsdConfigParam()
//64
void CPS2OS::sc_FlushCache()
{
uint32 operationType = m_ee.m_State.nGPR[SC_PARAM0].nV[0];
FRAMEWORK_MAYBE_UNUSED uint32 operationType = m_ee.m_State.nGPR[SC_PARAM0].nV[0];
}
//70

View file

@ -395,12 +395,18 @@ private:
void sc_GetMemorySize();
void sc_Unhandled();
CMIPS& m_ee;
CGSHandler*& m_gs;
uint8* m_ram = nullptr;
uint8* m_bios = nullptr;
uint8* m_spr = nullptr;
CSIF& m_sif;
Ee::CLibMc2 m_libMc2;
CIopBios& m_iopBios;
std::unique_ptr<CELF32> m_elf;
CMIPS& m_ee;
ThreadList m_threads;
SemaphoreList m_semaphores;
IntcHandlerList m_intcHandlers;
@ -425,10 +431,6 @@ private:
//For display purposes only
std::string m_executableName;
CGSHandler*& m_gs;
CSIF& m_sif;
Ee::CLibMc2 m_libMc2;
CIopBios& m_iopBios;
Ee::CIdleEvaluator m_idleEvaluator;
#ifdef DEBUGGER_INCLUDED

View file

@ -90,13 +90,13 @@ private:
void Cmd_Call(const SIFCMDHEADER*);
void Cmd_GetOtherData(const SIFCMDHEADER*);
CDMAC& m_dmac;
uint8* m_eeRam;
uint8* m_iopRam;
uint32 m_dmaBufferAddress = 0;
uint32 m_dmaBufferSize = 0;
uint32 m_cmdBufferAddress = 0;
uint32 m_cmdBufferSize = 0;
CDMAC& m_dmac;
uint32 m_nMAINADDR = 0;
uint32 m_nSUBADDR = 0;

View file

@ -45,11 +45,11 @@
CVif::CVif(unsigned int number, CVpu& vpu, CINTC& intc, uint8* ram, uint8* spr)
: m_number(number)
, m_vpu(vpu)
, m_intc(intc)
, m_ram(ram)
, m_spr(spr)
, m_intc(intc)
, m_stream(ram, spr)
, m_vpu(vpu)
, m_vifProfilerZone(CProfiler::GetInstance().RegisterZone(string_format("VIF%d", number).c_str()))
{
static_loop<int, MAX_UNPACKERS>(

View file

@ -176,7 +176,8 @@ void CVif1::Cmd_DIRECT(StreamType& stream, CODE nCommand)
if(m_directQwordBufferIndex == QWORD_SIZE)
{
assert(m_CODE.nIMM != 0);
uint32 processed = m_gif.ProcessMultiplePackets(m_directQwordBuffer, QWORD_SIZE, 0, QWORD_SIZE, CGsPacketMetadata(2));
FRAMEWORK_MAYBE_UNUSED uint32 processed = m_gif.ProcessMultiplePackets(m_directQwordBuffer,
QWORD_SIZE, 0, QWORD_SIZE, CGsPacketMetadata(2));
assert(processed == QWORD_SIZE);
m_CODE.nIMM--;
m_directQwordBufferIndex = 0;

View file

@ -79,13 +79,14 @@ public:
protected:
typedef std::unique_ptr<CVif> VifPtr;
unsigned int m_number = 0;
VifPtr m_vif;
uint8* m_microMem = nullptr;
uint32 m_microMemSize = 0;
uint8* m_vuMem = nullptr;
uint32 m_vuMemSize = 0;
CMIPS* m_ctx = nullptr;
CGIF& m_gif;
VifPtr m_vif;
#ifdef DEBUGGER_INCLUDED
MIPSSTATE m_vuMiniState;
@ -95,7 +96,6 @@ protected:
uint32 m_itopMiniState;
#endif
unsigned int m_number = 0;
bool m_running = false;
CProfiler::ZoneHandle m_vuProfilerZone = 0;

View file

@ -99,7 +99,6 @@ void CVuAnalysis::Analyse(CMIPS* ctx, uint32 begin, uint32 end)
if(ctx->m_analysis->FindSubroutine(address)) continue;
uint32 lowerInstruction = ctx->m_pMemoryMap->GetInstruction(address + 0);
uint32 upperInstruction = ctx->m_pMemoryMap->GetInstruction(address + 4);
auto branchType = ctx->m_pArch->IsInstructionBranch(ctx, address, lowerInstruction);
if(branchType == MIPS_BRANCH_NORMAL)

View file

@ -60,13 +60,7 @@
#define LOG_NAME ("gs")
CGSHandler::CGSHandler(bool gsThreaded)
: m_threadDone(false)
, m_drawCallCount(0)
, m_pCLUT(nullptr)
, m_pRAM(nullptr)
, m_frameDump(nullptr)
, m_loggingEnabled(true)
, m_gsThreaded(gsThreaded)
: m_gsThreaded(gsThreaded)
{
RegisterPreferences();
@ -761,8 +755,6 @@ void CGSHandler::FeedImageDataImpl(const uint8* imageData, uint32 length)
if(m_trxCtx.nSize == 0)
{
auto trxReg = make_convertible<TRXREG>(m_nReg[GS_REG_TRXREG]);
//assert(m_trxCtx.nRRY == trxReg.nRRH);
ProcessHostToLocalTransfer();
#ifdef _DEBUG
@ -781,7 +773,7 @@ void CGSHandler::ReadImageDataImpl(void* ptr, uint32 size)
assert(m_trxCtx.nSize != 0);
assert(m_trxCtx.nSize == size);
auto bltBuf = make_convertible<BITBLTBUF>(m_nReg[GS_REG_BITBLTBUF]);
auto trxPos = make_convertible<TRXPOS>(m_nReg[GS_REG_TRXPOS]);
FRAMEWORK_MAYBE_UNUSED auto trxPos = make_convertible<TRXPOS>(m_nReg[GS_REG_TRXPOS]);
assert(trxPos.nDIR == 0);
((this)->*(m_transferReadHandlers[bltBuf.nSrcPsm]))(ptr, size);
@ -1693,8 +1685,6 @@ void CGSHandler::MakeLinearCLUT(const TEX0& tex0, std::array<uint32, 256>& clut)
return ((color & 0x8000) ? 0xFF000000 : 0) | ((color & 0x7C00) << 9) | ((color & 0x03E0) << 6) | ((color & 0x001F) << 3);
};
unsigned int entryCount = CGsPixelFormats::IsPsmIDTEX4(tex0.nPsm) ? 16 : 256;
if(CGsPixelFormats::IsPsmIDTEX4(tex0.nPsm))
{
if(tex0.nCPSM == PSMCT32 || tex0.nCPSM == PSMCT24)

View file

@ -1053,7 +1053,7 @@ protected:
PRESENTATION_VIEWPORT GetPresentationViewport() const;
bool m_loggingEnabled;
bool m_loggingEnabled = true;
uint64 m_nPMODE; //0x12000000
uint64 m_nSMODE2; //0x12000020
@ -1072,13 +1072,13 @@ protected:
uint64 m_nReg[REGISTER_MAX];
uint8* m_pRAM;
uint8* m_pRAM = nullptr;
uint16* m_pCLUT;
uint16* m_pCLUT = nullptr;
uint32 m_nCBP0;
uint32 m_nCBP1;
uint32 m_drawCallCount;
uint32 m_drawCallCount = 0;
//Rename to register write buffer?
RegisterWrite* m_writeBuffer;
@ -1090,8 +1090,8 @@ protected:
std::thread m_thread;
std::recursive_mutex m_registerMutex;
std::atomic<int> m_transferCount;
bool m_threadDone;
CFrameDump* m_frameDump;
bool m_threadDone = false;
CFrameDump* m_frameDump = nullptr;
bool m_drawEnabled = true;
CINTC* m_intc = nullptr;
bool m_gsThreaded = true;

View file

@ -83,7 +83,7 @@ static BINDINGTARGET LoadBindingTargetPreference(Framework::CConfig& config, con
BINDINGTARGET result;
result.providerId = config.GetPreferenceInteger(Framework::CConfig::MakePreferenceName(base, CONFIG_BINDINGTARGET_PROVIDERID).c_str());
auto deviceIdString = config.GetPreferenceString(Framework::CConfig::MakePreferenceName(base, CONFIG_BINDINGTARGET_DEVICEID).c_str());
bool parseResult = TryParseDeviceId(deviceIdString, result.deviceId);
FRAMEWORK_MAYBE_UNUSED bool parseResult = TryParseDeviceId(deviceIdString, result.deviceId);
assert(parseResult);
result.keyId = config.GetPreferenceInteger(Framework::CConfig::MakePreferenceName(base, CONFIG_BINDINGTARGET_KEYID).c_str());
result.keyType = static_cast<BINDINGTARGET::KEYTYPE>(config.GetPreferenceInteger(Framework::CConfig::MakePreferenceName(base, CONFIG_BINDINGTARGET_KEYTYPE).c_str()));

View file

@ -381,7 +381,7 @@ void CIopBios::LoadState(Framework::CZipArchiveReader& archive)
const CStructFile& structFile(structIterator->second);
uint32 importTableAddress = structFile.GetRegister32(STATE_MODULE_IMPORT_TABLE_ADDRESS);
auto module = std::make_shared<Iop::CDynamic>(reinterpret_cast<uint32*>(m_ram + importTableAddress));
bool result = RegisterModule(module);
FRAMEWORK_MAYBE_UNUSED bool result = RegisterModule(module);
assert(result);
}
}
@ -702,7 +702,7 @@ int32 CIopBios::LoadModule(CELF32& elf, const char* path, uint32 loadAddress, bo
if(iopMod != nullptr)
{
//Clear BSS section
uint32 dataSectPos = iopMod->textSectionSize;
FRAMEWORK_MAYBE_UNUSED uint32 dataSectPos = iopMod->textSectionSize;
uint32 bssSectPos = iopMod->textSectionSize + iopMod->dataSectionSize;
uint32 bssSectSize = iopMod->bssSectionSize;
uint32 moduleSize = moduleRange.second - moduleRange.first;
@ -716,7 +716,7 @@ int32 CIopBios::LoadModule(CELF32& elf, const char* path, uint32 loadAddress, bo
else
{
//Just make sure that everything checks out
uint32 totalSize = bssSectPos + bssSectSize;
FRAMEWORK_MAYBE_UNUSED uint32 totalSize = bssSectPos + bssSectSize;
assert(totalSize == moduleSize);
}
memset(m_ram + moduleRange.first + bssSectPos, 0, bssSectSize);
@ -3185,7 +3185,7 @@ void CIopBios::HandleException()
instruction = m_cpu.m_pMemoryMap->GetWord(searchAddress);
}
uint32 functionId = callInstruction & 0xFFFF;
uint32 version = m_cpu.m_pMemoryMap->GetWord(searchAddress + 8);
FRAMEWORK_MAYBE_UNUSED uint32 version = m_cpu.m_pMemoryMap->GetWord(searchAddress + 8);
std::string moduleName = ReadModuleName(searchAddress + 0x0C);
#ifdef _DEBUG

View file

@ -660,7 +660,6 @@ private:
uint32 m_defaultImageVersion = DEFAULT_IMAGE_VERSION;
bool m_rescheduleNeeded = false;
LoadedModuleList m_loadedModules;
ThreadList m_threads;
MemoryBlockList m_memoryBlocks;
SemaphoreList m_semaphores;
@ -670,6 +669,7 @@ private:
MessageBoxList m_messageBoxes;
FplList m_fpls;
VplList m_vpls;
LoadedModuleList m_loadedModules;
MODULESTARTREQUEST m_moduleStartRequests[MAX_MODULESTARTREQUEST] = {};

View file

@ -454,7 +454,7 @@ uint32 CCdvdman::CdRead(uint32 startSector, uint32 sectorCount, uint32 bufferPtr
}
if(modePtr != 0)
{
uint8* mode = &m_ram[modePtr];
FRAMEWORK_MAYBE_UNUSED uint8* mode = &m_ram[modePtr];
//Does that make sure it's 2048 byte mode?
assert(mode[2] == 0);
}

View file

@ -77,6 +77,9 @@ namespace Iop
void LogRead(uint32);
void LogWrite(uint32, uint32);
uint8* m_ram = nullptr;
CIntc& m_intc;
Dmac::CChannel m_channelSpu0;
Dmac::CChannel m_channelSpu1;
Dmac::CChannel m_channelDev9;
@ -89,7 +92,5 @@ namespace Iop
uint32 m_DPCR3;
uint32 m_DICR;
uint8* m_ram;
CIntc& m_intc;
};
}

View file

@ -63,13 +63,13 @@ namespace Iop
private:
ReceiveFunctionType m_receiveFunction;
CDmac& m_dmac;
unsigned int m_number;
unsigned int m_intrLine;
uint32 m_baseAddress;
uint32 m_MADR;
BCR m_BCR;
CHCR m_CHCR;
CDmac& m_dmac;
};
}
}

View file

@ -35,7 +35,6 @@ using namespace Iop;
static uint32 GetChannelBase(uint32 channel)
{
uint32 channelBase = 0;
switch(channel)
{
case CDmac::CHANNEL_SIO2in:

View file

@ -60,7 +60,7 @@ void CFileIoHandler1000::AllocateMemory()
void CFileIoHandler1000::ReleaseMemory()
{
auto sysmem = m_bios.GetSysmem();
uint32 result = sysmem->FreeMemory(m_moduleDataAddr);
FRAMEWORK_MAYBE_UNUSED uint32 result = sysmem->FreeMemory(m_moduleDataAddr);
assert(result == 0);
}
@ -319,8 +319,8 @@ void CFileIoHandler1000::BuildExportTable()
assembler.ADDIU(CMIPS::SP, CMIPS::SP, stackAlloc);
}
auto nextAddress = exportTable + assembler.GetProgramSize();
auto finalAddress = reinterpret_cast<uint32*>(m_iopRam + m_moduleDataAddr + TRAMPOLINE_SIZE);
FRAMEWORK_MAYBE_UNUSED auto nextAddress = exportTable + assembler.GetProgramSize();
FRAMEWORK_MAYBE_UNUSED auto finalAddress = reinterpret_cast<uint32*>(m_iopRam + m_moduleDataAddr + TRAMPOLINE_SIZE);
assert(nextAddress <= finalAddress);
}
}

View file

@ -160,7 +160,7 @@ uint32 CFileIoHandler2200::InvokeClose(uint32* args, uint32 argsSize, uint32* re
{
assert(retSize == 4);
auto command = reinterpret_cast<CLOSECOMMAND*>(args);
auto fileMode = m_ioman->GetFileMode(command->fd);
FRAMEWORK_MAYBE_UNUSED auto fileMode = m_ioman->GetFileMode(command->fd);
auto result = m_ioman->Close(command->fd);
CLOSEREPLY reply;

View file

@ -2,6 +2,7 @@
#include "Iop_Intc.h"
#include "Log.h"
#include "../states/RegisterStateFile.h"
#include "maybe_unused.h"
#define LOG_NAME ("iop_ilink")
@ -118,7 +119,7 @@ void CIlink::WriteRegister(uint32 address, uint32 value)
case REG_PHY_ACCESS:
{
uint32 phyReg = (value >> 24) & 0x3F;
uint32 phyData = (value >> 16) & 0xFF;
FRAMEWORK_MAYBE_UNUSED uint32 phyData = (value >> 16) & 0xFF;
m_phyResult = (phyReg << 8);
m_intr0 |= INTR0_PHYRRX;

View file

@ -7,12 +7,6 @@
using namespace Iop;
CIntc::CIntc()
: m_mask(0)
, m_status(0)
{
}
void CIntc::Reset()
{
m_status.f = 0;

View file

@ -54,7 +54,6 @@ namespace Iop
MASK1 = 0x1F80107C,
};
CIntc();
virtual ~CIntc() = default;
void Reset();
@ -72,7 +71,7 @@ namespace Iop
bool HasPendingInterrupt();
private:
UNION64_32 m_status;
UNION64_32 m_mask;
UNION64_32 m_status = 0;
UNION64_32 m_mask = 0;
};
}

View file

@ -26,7 +26,7 @@ namespace Iop
uint32 SuspendInterrupts(CMIPS&, uint32);
uint32 ResumeInterrupts(CMIPS&, uint32);
uint32 QueryIntrContext(CMIPS&);
uint8* m_ram = nullptr;
CIopBios& m_bios;
uint8* m_ram = nullptr;
};
}

View file

@ -499,7 +499,7 @@ int32 CIoman::AddDrv(CMIPS& context)
auto device = reinterpret_cast<const Ioman::DEVICE*>(m_ram + devicePtr);
auto deviceName = device->namePtr ? reinterpret_cast<const char*>(m_ram + device->namePtr) : nullptr;
auto deviceDesc = device->descPtr ? reinterpret_cast<const char*>(m_ram + device->descPtr) : nullptr;
FRAMEWORK_MAYBE_UNUSED auto deviceDesc = device->descPtr ? reinterpret_cast<const char*>(m_ram + device->descPtr) : nullptr;
CLog::GetInstance().Print(LOG_NAME, "Requested registration of device '%s'.\r\n", deviceName);
//We only support "cdfs" & "dev9x" for now
if(!deviceName || (strcmp(deviceName, "cdfs") && strcmp(deviceName, "dev9x")))

View file

@ -114,7 +114,7 @@ std::string CMcServ::DecodeMcName(const std::string& inputName)
if(inputChar == '%')
{
int decodedChar = 0;
int scanCount = sscanf(inputName.c_str() + i, "%%%02X", &decodedChar);
FRAMEWORK_MAYBE_UNUSED int scanCount = sscanf(inputName.c_str() + i, "%%%02X", &decodedChar);
assert(scanCount == 1);
result += decodedChar;
i += 2;
@ -1053,7 +1053,7 @@ void CMcServ::ProceedReadFast(CMIPS& context)
uint32 readSize = std::min<uint32>(moduleData->readFastSize, CLUSTER_SIZE);
uint8 cluster[CLUSTER_SIZE];
uint32 amountRead = file->Read(cluster, readSize);
FRAMEWORK_MAYBE_UNUSED uint32 amountRead = file->Read(cluster, readSize);
assert(amountRead == readSize);
moduleData->readFastSize -= readSize;

View file

@ -239,7 +239,7 @@ int32 CModload::LoadModuleWithOption(uint32 pathPtr, uint32 optionPtr)
int32 CModload::StopModule(uint32 moduleId, uint32 argsLength, uint32 argsPtr, uint32 resultPtr)
{
const char* args = reinterpret_cast<const char*>(m_ram + argsPtr);
FRAMEWORK_MAYBE_UNUSED const char* args = reinterpret_cast<const char*>(m_ram + argsPtr);
CLog::GetInstance().Print(LOG_NAME, FUNCTION_STOPMODULE "(moduleId = %d, argsLength = %d, argsPtr = 0x%08X, resultPtr = 0x%08X);\r\n",
moduleId, argsLength, argsPtr, resultPtr);
return m_bios.StopModule(CIopBios::MODULESTARTREQUEST_SOURCE::LOCAL, moduleId);

View file

@ -11,5 +11,5 @@ std::string CModule::PrintStringParameter(const uint8* ram, uint32 stringPtr)
auto string = reinterpret_cast<const char*>(ram + stringPtr);
result += string_format(" ('%s')", string);
}
return std::move(result);
return result;
}

View file

@ -109,8 +109,8 @@ namespace Iop
static unsigned int GetCounterIdByAddress(uint32);
COUNTER m_counter[MAX_COUNTERS];
Iop::CIntc& m_intc;
unsigned int m_hsyncClocks;
unsigned int m_pixelClocks;
Iop::CIntc& m_intc;
};
}

View file

@ -512,7 +512,7 @@ void CSifCmd::BuildExportTable()
assembler.ADDIU(CMIPS::SP, CMIPS::SP, stackAlloc);
}
uint32 totalSize = (assembler.GetProgramSize() * 4);
FRAMEWORK_MAYBE_UNUSED uint32 totalSize = (assembler.GetProgramSize() * 4);
assert(totalSize <= TRAMPOLINE_SIZE);
}
}
@ -539,7 +539,7 @@ void CSifCmd::ProcessInvocation(uint32 serverDataAddr, uint32 methodId, uint32*
assert(queueData->serverDataStart == serverDataAddr);
queueData->serverDataLink = serverDataAddr;
auto thread = m_bios.GetThread(queueData->threadId);
FRAMEWORK_MAYBE_UNUSED auto thread = m_bios.GetThread(queueData->threadId);
assert(thread->status == CIopBios::THREAD_STATUS_SLEEPING);
m_bios.WakeupThread(queueData->threadId, true);
m_bios.Reschedule();
@ -579,7 +579,7 @@ void CSifCmd::FinishBindRpc(uint32 clientDataAddr, uint32 serverId)
clientData->serverDataAddr = serverId;
clientData->header.semaId = m_bios.CreateSemaphore(0, 1, 0, 0);
int32 result = CIopBios::KERNEL_RESULT_OK;
FRAMEWORK_MAYBE_UNUSED int32 result = CIopBios::KERNEL_RESULT_OK;
result = m_bios.WaitSemaphore(clientData->header.semaId);
assert(result == CIopBios::KERNEL_RESULT_OK);
@ -650,7 +650,7 @@ void CSifCmd::ProcessRpcRequestEnd(uint32 commandHeaderAddr)
//Unlock/delete semaphore
{
assert(clientData->header.semaId != 0);
int32 result = CIopBios::KERNEL_RESULT_OK;
FRAMEWORK_MAYBE_UNUSED int32 result = CIopBios::KERNEL_RESULT_OK;
result = m_bios.SignalSemaphore(clientData->header.semaId, true);
assert(result == CIopBios::KERNEL_RESULT_OK);
result = m_bios.DeleteSemaphore(clientData->header.semaId);
@ -855,7 +855,7 @@ void CSifCmd::SifCallRpc(CMIPS& context)
clientData->endFctPtr = endFctAddr;
clientData->endParam = endParam;
clientData->header.semaId = m_bios.CreateSemaphore(0, 1, 0, 0);
int32 result = CIopBios::KERNEL_RESULT_OK;
FRAMEWORK_MAYBE_UNUSED int32 result = CIopBios::KERNEL_RESULT_OK;
result = m_bios.WaitSemaphore(clientData->header.semaId);
assert(result == CIopBios::KERNEL_RESULT_OK);

View file

@ -90,14 +90,14 @@ uint16 CCore::GetAddressHi(uint32 address)
uint32 CCore::SetAddressLo(uint32 address, uint16 value)
{
address &= 0xFFFF << (1 + 16);
address &= 0xFFFE0000;
address |= value << 1;
return address;
}
uint32 CCore::SetAddressHi(uint32 address, uint16 value)
{
address &= 0xFFFF << 1;
address &= 0x0001FFFE;
address |= value << (1 + 16);
return address;
}

View file

@ -217,7 +217,7 @@ void CSpuBase::LoadState(Framework::CZipArchiveReader& archive)
m_reverbWorkAddrEnd = registerFile.GetRegister32(STATE_REGS_REVERBWORKADDREND);
m_reverbCurrAddr = registerFile.GetRegister32(STATE_REGS_REVERBCURRADDR);
static const uint32 reverbRegisterCount = sizeof(m_reverb) / sizeof(uint128);
static const uint32 reverbRegisterCount = sizeof(m_reverb) / (sizeof(uint128));
for(uint32 i = 0; i < reverbRegisterCount; i++)
{
auto reverbRegisterName = string_format(STATE_REGS_REVERB_FORMAT, i);
@ -261,7 +261,7 @@ void CSpuBase::SaveState(Framework::CZipArchiveWriter& archive)
registerFile->SetRegister32(STATE_REGS_REVERBWORKADDREND, m_reverbWorkAddrEnd);
registerFile->SetRegister32(STATE_REGS_REVERBCURRADDR, m_reverbCurrAddr);
static const uint32 reverbRegisterCount = sizeof(m_reverb) / sizeof(uint128);
static const uint32 reverbRegisterCount = sizeof(m_reverb) / (sizeof(uint128));
for(uint32 i = 0; i < reverbRegisterCount; i++)
{
auto reverbRegisterName = string_format(STATE_REGS_REVERB_FORMAT, i);
@ -1077,7 +1077,7 @@ void CSpuBase::CSampleReader::LoadState(const CRegisterStateFile& registerFile,
m_irqPending = registerFile.GetRegister32((channelPrefix + STATE_SAMPLEREADER_REGS_IRQPENDING).c_str()) != 0;
m_didChangeRepeat = registerFile.GetRegister32((channelPrefix + STATE_SAMPLEREADER_REGS_DIDCHANGEREPEAT).c_str()) != 0;
static const uint32 bufferRegisterCount = sizeof(m_buffer) / sizeof(uint128);
static const uint32 bufferRegisterCount = sizeof(m_buffer) / (sizeof(uint128));
for(uint32 i = 0; i < bufferRegisterCount; i++)
{
auto bufferRegisterName = string_format(STATE_SAMPLEREADER_REGS_BUFFER_FORMAT, channelPrefix.c_str(), i);
@ -1101,7 +1101,7 @@ void CSpuBase::CSampleReader::SaveState(CRegisterStateFile* registerFile, const
registerFile->SetRegister32((channelPrefix + STATE_SAMPLEREADER_REGS_IRQPENDING).c_str(), m_irqPending);
registerFile->SetRegister32((channelPrefix + STATE_SAMPLEREADER_REGS_DIDCHANGEREPEAT).c_str(), m_didChangeRepeat);
static const uint32 bufferRegisterCount = sizeof(m_buffer) / sizeof(uint128);
static const uint32 bufferRegisterCount = sizeof(m_buffer) / (sizeof(uint128));
for(uint32 i = 0; i < bufferRegisterCount; i++)
{
auto bufferRegisterName = string_format(STATE_SAMPLEREADER_REGS_BUFFER_FORMAT, channelPrefix.c_str(), i);
@ -1347,7 +1347,6 @@ void CSpuBase::CBlockSampleReader::FillBlock(const uint8* block)
void CSpuBase::CBlockSampleReader::GetSamples(int16& sampleL, int16& sampleR, unsigned int dstSamplingRate)
{
uint32 srcSampleIdx = m_srcSampleIdx / TIME_SCALE;
int32 srcSampleAlpha = m_srcSampleIdx % TIME_SCALE;
assert(srcSampleIdx < SOUND_INPUT_DATA_SAMPLES);
auto inputSamples = reinterpret_cast<const int16*>(m_blockBuffer);

View file

@ -19,6 +19,8 @@ using namespace PS2;
CSubSystem::CSubSystem(bool ps2Mode)
: m_cpu(MEMORYMAP_ENDIAN_LSBF, true)
, m_cpuArch(MIPS_REGSIZE_32)
, m_copScu(MIPS_REGSIZE_32)
, m_ram(new uint8[IOP_RAM_SIZE])
, m_scratchPad(new uint8[IOP_SCRATCH_SIZE])
, m_spuRam(new uint8[SPU_RAM_SIZE])
@ -33,8 +35,6 @@ CSubSystem::CSubSystem(bool ps2Mode)
#endif
, m_speed(m_intc)
, m_ilink(m_intc)
, m_cpuArch(MIPS_REGSIZE_32)
, m_copScu(MIPS_REGSIZE_32)
{
if(ps2Mode)
{

View file

@ -36,25 +36,25 @@ namespace Iop
void SaveState(Framework::CZipArchiveWriter&);
void LoadState(Framework::CZipArchiveReader&);
CMIPS m_cpu;
CMA_MIPSIV m_cpuArch;
CCOP_SCU m_copScu;
uint8* m_ram;
uint8* m_scratchPad;
uint8* m_spuRam;
CIntc m_intc;
CRootCounters m_counters;
CDmac m_dmac;
CRootCounters m_counters;
CSpuBase m_spuCore0;
CSpuBase m_spuCore1;
CSpu m_spu;
CSpu2 m_spu2;
CDev9 m_dev9;
CSpeed m_speed;
CIlink m_ilink;
#ifdef _IOP_EMULATE_MODULES
CSio2 m_sio2;
#endif
CMIPS m_cpu;
CMA_MIPSIV m_cpuArch;
CCOP_SCU m_copScu;
CSpeed m_speed;
CIlink m_ilink;
BiosBasePtr m_bios;
private:

View file

@ -17,12 +17,12 @@ using namespace Iop;
CSysmem::CSysmem(uint8* ram, uint32 memoryBegin, uint32 memoryEnd, BlockListType& blocks, CStdio& stdio, CIoman& ioman, CSifMan& sifMan)
: m_iopRam(ram)
, m_memoryBegin(memoryBegin)
, m_memoryEnd(memoryEnd)
, m_stdio(stdio)
, m_ioman(ioman)
, m_memorySize(memoryEnd - memoryBegin)
, m_blocks(blocks)
, m_memoryBegin(memoryBegin)
, m_memoryEnd(memoryEnd)
, m_memorySize(memoryEnd - memoryBegin)
{
//Initialize block map
m_headBlockId = m_blocks.Allocate();

View file

@ -44,13 +44,13 @@ namespace Iop
void DumpAllocList();
uint8* m_iopRam = nullptr;
CStdio& m_stdio;
CIoman& m_ioman;
BlockListType& m_blocks;
uint32 m_memoryBegin;
uint32 m_memoryEnd;
uint32 m_memorySize;
uint32 m_headBlockId;
CStdio& m_stdio;
CIoman& m_ioman;
};
typedef std::shared_ptr<CSysmem> SysmemPtr;

View file

@ -33,7 +33,7 @@ namespace Iop
uint32 PollEventFlag(uint32, uint32, uint32, uint32);
uint32 ReferEventFlagStatus(uint32, uint32);
uint8* m_ram = nullptr;
CIopBios& m_bios;
uint8* m_ram = nullptr;
};
}

View file

@ -30,7 +30,7 @@ namespace Iop
uint32 PollMbx(uint32, uint32);
uint32 ReferMbxStatus(uint32, uint32);
uint8* m_ram = nullptr;
CIopBios& m_bios;
uint8* m_ram = nullptr;
};
}

View file

@ -32,7 +32,7 @@ namespace Iop
uint32 iSignalSemaphore(uint32);
uint32 ReferSemaphoreStatus(uint32, uint32);
uint8* m_ram;
CIopBios& m_bios;
uint8* m_ram;
};
}

View file

@ -422,7 +422,6 @@ int32 CTimrman::StartHardTimer(CMIPS& context, uint32 timerId)
uint32 timerInterruptLine = CRootCounters::g_counterInterruptLines[hardTimerIndex];
if(m_bios.FindIntrHandler(timerInterruptLine) != -1)
{
uint32 status = context.m_pMemoryMap->GetWord(CIntc::STATUS0);
uint32 mask = context.m_pMemoryMap->GetWord(CIntc::MASK0);
mask |= (1 << timerInterruptLine);
context.m_pMemoryMap->SetWord(CIntc::MASK0, mask);

View file

@ -177,7 +177,7 @@ void CS3ObjectStream::SyncBuffer()
if(fs::exists(readCacheFilePath))
{
auto readCacheFileStream = Framework::CreateInputStdStream(readCacheFilePath.native());
auto cacheRead = readCacheFileStream.Read(m_buffer.data(), size);
FRAMEWORK_MAYBE_UNUSED auto cacheRead = readCacheFileStream.Read(m_buffer.data(), size);
assert(cacheRead == size);
return true;
}

View file

@ -27,14 +27,6 @@ struct FILEVERTEXATTRIB
#pragma pack(pop)
CIcon::CIcon(Framework::CStream& stream)
: m_pTexture(NULL)
, m_pTexCoords(NULL)
, m_pFrames(NULL)
, m_pShapes(NULL)
, m_nShapeCount(0)
, m_nVertexCount(0)
, m_nTextureType(0)
, m_nFrameCount(0)
{
ReadHeader(stream);
ReadVertices(stream);

View file

@ -55,15 +55,15 @@ private:
void ReadTexture(Framework::CStream&);
void UncompressTexture(Framework::CStream&);
VERTEX** m_pShapes;
TEXCOORD* m_pTexCoords;
FRAME* m_pFrames;
VERTEX** m_pShapes = nullptr;
TEXCOORD* m_pTexCoords = nullptr;
FRAME* m_pFrames = nullptr;
uint32 m_nShapeCount;
uint32 m_nVertexCount;
uint32 m_nFrameCount;
uint32 m_nTextureType;
uint16* m_pTexture;
uint32 m_nShapeCount = 0;
uint32 m_nVertexCount = 0;
uint32 m_nFrameCount = 0;
uint32 m_nTextureType = 0;
uint16* m_pTexture = nullptr;
};
typedef std::shared_ptr<CIcon> IconPtr;

View file

@ -4,14 +4,7 @@
#include "LzAri.h"
#include "MemStream.h"
#include "StdStreamUtils.h"
CMaxSaveImporter::CMaxSaveImporter()
{
}
CMaxSaveImporter::~CMaxSaveImporter()
{
}
#include "maybe_unused.h"
void CMaxSaveImporter::Import(Framework::CStream& inputStream, const fs::path& basePath)
{
@ -22,7 +15,7 @@ void CMaxSaveImporter::Import(Framework::CStream& inputStream, const fs::path& b
throw std::runtime_error("Invalid MAX save file.");
}
uint32 checksum = inputStream.Read32();
FRAMEWORK_MAYBE_UNUSED uint32 checksum = inputStream.Read32();
char directoryName[0x21];
inputStream.Read(directoryName, 0x20);
@ -32,7 +25,7 @@ void CMaxSaveImporter::Import(Framework::CStream& inputStream, const fs::path& b
inputStream.Read(iconName, 0x20);
iconName[0x20] = 0;
uint32 compressedSize = inputStream.Read32();
FRAMEWORK_MAYBE_UNUSED uint32 compressedSize = inputStream.Read32();
uint32 fileCount = inputStream.Read32();
Framework::CMemStream directoryDataStream;

View file

@ -6,8 +6,7 @@
class CMaxSaveImporter : public CSaveImporterBase
{
public:
CMaxSaveImporter();
virtual ~CMaxSaveImporter();
virtual ~CMaxSaveImporter() = default;
void Import(Framework::CStream&, const fs::path&) override;
};

View file

@ -2,6 +2,7 @@
#include <cstring>
#include <cassert>
#include <stdexcept>
#include "maybe_unused.h"
//Source:
//http://www.csclub.uwaterloo.ca:11068/mymc/ps2mcfs.html
@ -50,7 +51,7 @@ CMcDumpReader::Directory CMcDumpReader::ReadDirectory(uint32 dirCluster)
std::vector<DIRENTRY> result;
CFatReader reader(*this, dirCluster);
DIRENTRY baseDirEntry = {};
uint32 readAmount = reader.Read(&baseDirEntry, sizeof(DIRENTRY));
FRAMEWORK_MAYBE_UNUSED uint32 readAmount = reader.Read(&baseDirEntry, sizeof(DIRENTRY));
assert(readAmount == sizeof(DIRENTRY));
result.push_back(baseDirEntry);
assert(baseDirEntry.length >= 2);
@ -77,7 +78,7 @@ std::vector<uint8> CMcDumpReader::ReadFile(uint32 fileCluster, uint32 fileSize)
std::vector<uint8> result;
CFatReader reader(*this, fileCluster);
result.resize(fileSize);
uint32 readAmount = reader.Read(result.data(), fileSize);
FRAMEWORK_MAYBE_UNUSED uint32 readAmount = reader.Read(result.data(), fileSize);
assert(readAmount == fileSize);
return result;
}