Run code through clang-modernize -loop-convert to create range-based for loops, and manually fix some stuff up.
This commit is contained in:
1 parent
00fe5057f1
commit
965b32be9c
90 files changed
+688
-739
No files matched your search
@@ -123,9 +123,8 @@ void LoadCodes(IniFile &globalIni, IniFile &localIni, bool forceLoad)
|
||||
std::vector<std::string> enabledLines;
|
||||
std::set<std::string> enabledNames;
|
||||
localIni.GetLines("ActionReplay_Enabled", enabledLines);
|
||||
for (auto iter = enabledLines.begin(); iter != enabledLines.end(); ++iter)
|
||||
for (auto& line : enabledLines)
|
||||
{
|
||||
const std::string& line = *iter;
|
||||
if (line.size() != 0 && line[0] == '$')
|
||||
{
|
||||
std::string name = line.substr(1, line.size() - 1);
|
||||
@@ -139,7 +138,7 @@ void LoadCodes(IniFile &globalIni, IniFile &localIni, bool forceLoad)
|
||||
std::vector<std::string> lines;
|
||||
std::vector<std::string> encryptedLines;
|
||||
ARCode currentCode;
|
||||
|
||||
|
||||
inis[i]->GetLines("ActionReplay", lines);
|
||||
|
||||
std::vector<std::string>::const_iterator
|
||||
@@ -148,7 +147,7 @@ void LoadCodes(IniFile &globalIni, IniFile &localIni, bool forceLoad)
|
||||
for (; it != lines_end; ++it)
|
||||
{
|
||||
const std::string line = *it;
|
||||
|
||||
|
||||
if (line.empty())
|
||||
continue;
|
||||
|
||||
@@ -258,11 +257,11 @@ void RunAllActive()
|
||||
{
|
||||
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableCheats)
|
||||
{
|
||||
for (std::vector<ARCode>::iterator i = activeCodes.begin(); i != activeCodes.end(); ++i)
|
||||
for (auto& activeCode : activeCodes)
|
||||
{
|
||||
if (i->active)
|
||||
if (activeCode.active)
|
||||
{
|
||||
i->active = RunCode(*i);
|
||||
activeCode.active = RunCode(activeCode);
|
||||
LogInfo("\n");
|
||||
}
|
||||
}
|
||||
@@ -320,7 +319,7 @@ bool RunCode(const ARCode &arcode)
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
LogInfo("--- Running Code: %08x %08x ---", addr.address, data);
|
||||
//LogInfo("Command: %08x", cmd);
|
||||
|
||||
@@ -420,7 +419,7 @@ bool RunCode(const ARCode &arcode)
|
||||
if (false == NormalCode(addr, data))
|
||||
return false;
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
LogInfo("This Normal Code is a Conditional Code");
|
||||
if (false == ConditionalCode(addr, data, &skip_count))
|
||||
@@ -467,10 +466,10 @@ void UpdateActiveList()
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableCheats = false;
|
||||
b_RanOnce = false;
|
||||
activeCodes.clear();
|
||||
for (size_t i = 0; i < arCodes.size(); i++)
|
||||
for (auto& arCode : arCodes)
|
||||
{
|
||||
if (arCodes[i].active)
|
||||
activeCodes.push_back(arCodes[i]);
|
||||
if (arCode.active)
|
||||
activeCodes.push_back(arCode);
|
||||
}
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableCheats = old_value;
|
||||
}
|
||||
@@ -688,7 +687,7 @@ bool ZeroCode_FillAndSlide(const u32 val_last, const ARAddr addr, const u32 data
|
||||
const s16 addr_incr = (s16)(data & 0xFFFF);
|
||||
const s8 val_incr = (s8)(data >> 24);
|
||||
const u8 write_num = (data & 0xFF0000) >> 16;
|
||||
|
||||
|
||||
u32 val = addr;
|
||||
u32 curr_addr = new_addr;
|
||||
|
||||
|
||||
@@ -30,16 +30,16 @@ CDolLoader::CDolLoader(const char* _szFilename)
|
||||
|
||||
CDolLoader::~CDolLoader()
|
||||
{
|
||||
for (int i = 0; i < DOL_NUM_TEXT; i++)
|
||||
for (auto& sect : text_section)
|
||||
{
|
||||
delete [] text_section[i];
|
||||
text_section[i] = NULL;
|
||||
delete [] sect;
|
||||
sect = NULL;
|
||||
}
|
||||
|
||||
for (int i = 0; i < DOL_NUM_DATA; i++)
|
||||
for (auto& sect : data_section)
|
||||
{
|
||||
delete [] data_section[i];
|
||||
data_section[i] = NULL;
|
||||
delete [] sect;
|
||||
sect = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,10 +52,10 @@ void CDolLoader::Initialize(u8* _pBuffer, u32 _Size)
|
||||
for (size_t i = 0; i < (sizeof(SDolHeader)/sizeof(u32)); i++)
|
||||
p[i] = Common::swap32(p[i]);
|
||||
|
||||
for (int i = 0; i < DOL_NUM_TEXT; i++)
|
||||
text_section[i] = NULL;
|
||||
for (int i = 0; i < DOL_NUM_DATA; i++)
|
||||
data_section[i] = NULL;
|
||||
for (auto& sect : text_section)
|
||||
sect = NULL;
|
||||
for (auto& sect : data_section)
|
||||
sect = NULL;
|
||||
|
||||
u32 HID4_pattern = 0x7c13fba6;
|
||||
u32 HID4_mask = 0xfc1fffff;
|
||||
|
||||
@@ -84,15 +84,15 @@ int RegisterEvent(const char *name, TimedCallback callback)
|
||||
|
||||
// check for existing type with same name.
|
||||
// we want event type names to remain unique so that we can use them for serialization.
|
||||
for (unsigned int i = 0; i < event_types.size(); ++i)
|
||||
for (auto& event_type : event_types)
|
||||
{
|
||||
if (!strcmp(name, event_types[i].name))
|
||||
if (!strcmp(name, event_type.name))
|
||||
{
|
||||
WARN_LOG(POWERPC, "Discarded old event type \"%s\" because a new type with the same name was registered.", name);
|
||||
// we don't know if someone might be holding on to the type index,
|
||||
// so we gut the old event type instead of actually removing it.
|
||||
event_types[i].name = "_discarded_event";
|
||||
event_types[i].callback = &EmptyTimedCallback;
|
||||
event_type.name = "_discarded_event";
|
||||
event_type.callback = &EmptyTimedCallback;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -49,8 +49,7 @@ public:
|
||||
|
||||
void Clear()
|
||||
{
|
||||
for (int i = 0; i < 65536; i++)
|
||||
b[i] = 0;
|
||||
memset(b, 0, sizeof(b));
|
||||
}
|
||||
|
||||
void DeleteByAddress(u32 addr)
|
||||
|
||||
@@ -489,10 +489,10 @@ const char* pdname(u16 val)
|
||||
{
|
||||
static char tmpstr[12]; // nasty
|
||||
|
||||
for (int i = 0; i < (int)(sizeof(pdlabels) / sizeof(pdlabel_t)); i++)
|
||||
for (auto& pdlabel : pdlabels)
|
||||
{
|
||||
if (pdlabels[i].addr == val)
|
||||
return pdlabels[i].name;
|
||||
if (pdlabel.addr == val)
|
||||
return pdlabel.name;
|
||||
}
|
||||
|
||||
sprintf(tmpstr, "0x%04x", val);
|
||||
@@ -521,23 +521,22 @@ void InitInstructionTable()
|
||||
{
|
||||
// ext op table
|
||||
for (int i = 0; i < EXT_OPTABLE_SIZE; i++)
|
||||
{
|
||||
extOpTable[i] = &cw;
|
||||
|
||||
for (int i = 0; i < EXT_OPTABLE_SIZE; i++)
|
||||
{
|
||||
for (int j = 0; j < opcodes_ext_size; j++)
|
||||
for (auto& ext : opcodes_ext)
|
||||
{
|
||||
u16 mask = opcodes_ext[j].opcode_mask;
|
||||
if ((mask & i) == opcodes_ext[j].opcode)
|
||||
u16 mask = ext.opcode_mask;
|
||||
if ((mask & i) == ext.opcode)
|
||||
{
|
||||
if (extOpTable[i] == &cw)
|
||||
extOpTable[i] = &opcodes_ext[j];
|
||||
extOpTable[i] = &ext;
|
||||
else
|
||||
{
|
||||
//if the entry already in the table
|
||||
//is a strict subset, allow it
|
||||
if ((extOpTable[i]->opcode_mask | opcodes_ext[j].opcode_mask) != extOpTable[i]->opcode_mask)
|
||||
ERROR_LOG(DSPLLE, "opcode ext table place %d already in use by %s when inserting %s", i, extOpTable[i]->name, opcodes_ext[j].name);
|
||||
if ((extOpTable[i]->opcode_mask | ext.opcode_mask) != extOpTable[i]->opcode_mask)
|
||||
ERROR_LOG(DSPLLE, "opcode ext table place %d already in use by %s when inserting %s", i, extOpTable[i]->name, ext.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -546,18 +545,18 @@ void InitInstructionTable()
|
||||
// op table
|
||||
for (int i = 0; i < OPTABLE_SIZE; i++)
|
||||
opTable[i] = &cw;
|
||||
|
||||
|
||||
for (int i = 0; i < OPTABLE_SIZE; i++)
|
||||
{
|
||||
for (int j = 0; j < opcodes_size; j++)
|
||||
for (auto& opcode : opcodes)
|
||||
{
|
||||
u16 mask = opcodes[j].opcode_mask;
|
||||
if ((mask & i) == opcodes[j].opcode)
|
||||
u16 mask = opcode.opcode_mask;
|
||||
if ((mask & i) == opcode.opcode)
|
||||
{
|
||||
if (opTable[i] == &cw)
|
||||
opTable[i] = &opcodes[j];
|
||||
opTable[i] = &opcode;
|
||||
else
|
||||
ERROR_LOG(DSPLLE, "opcode table place %d already in use for %s", i, opcodes[j].name);
|
||||
ERROR_LOG(DSPLLE, "opcode table place %d already in use for %s", i, opcode.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,10 +75,10 @@ static void *reg_ptr(int reg)
|
||||
DSPJitRegCache::DSPJitRegCache(DSPEmitter &_emitter)
|
||||
: emitter(_emitter), temporary(false), merged(false)
|
||||
{
|
||||
for(unsigned int i = 0; i < NUMXREGS; i++)
|
||||
for(auto& xreg : xregs)
|
||||
{
|
||||
xregs[i].guest_reg = DSP_REG_STATIC;
|
||||
xregs[i].pushed = false;
|
||||
xreg.guest_reg = DSP_REG_STATIC;
|
||||
xreg.pushed = false;
|
||||
}
|
||||
|
||||
xregs[RAX].guest_reg = DSP_REG_STATIC;// reserved for MUL/DIV
|
||||
@@ -449,9 +449,9 @@ void DSPJitRegCache::pushRegs()
|
||||
}
|
||||
|
||||
int push_count = 0;
|
||||
for(unsigned int i = 0; i < NUMXREGS; i++)
|
||||
for(auto& xreg : xregs)
|
||||
{
|
||||
if (xregs[i].guest_reg == DSP_REG_USED)
|
||||
if (xreg.guest_reg == DSP_REG_USED)
|
||||
push_count++;
|
||||
}
|
||||
|
||||
@@ -503,9 +503,9 @@ void DSPJitRegCache::popRegs() {
|
||||
emitter.MOV(32, M(&ebp_store), R(EBP));
|
||||
#endif
|
||||
int push_count = 0;
|
||||
for(unsigned int i = 0; i < NUMXREGS; i++)
|
||||
for(auto& xreg : xregs)
|
||||
{
|
||||
if (xregs[i].pushed)
|
||||
if (xreg.pushed)
|
||||
push_count++;
|
||||
}
|
||||
|
||||
@@ -1037,11 +1037,11 @@ void DSPJitRegCache::spillXReg(X64Reg reg)
|
||||
|
||||
X64Reg DSPJitRegCache::findFreeXReg()
|
||||
{
|
||||
for(unsigned int i = 0; i < sizeof(alloc_order)/sizeof(alloc_order[0]); i++)
|
||||
for(auto& x : alloc_order)
|
||||
{
|
||||
if (xregs[alloc_order[i]].guest_reg == DSP_REG_NONE)
|
||||
if (xregs[x].guest_reg == DSP_REG_NONE)
|
||||
{
|
||||
return alloc_order[i];
|
||||
return x;
|
||||
}
|
||||
}
|
||||
return INVALID_REG;
|
||||
|
||||
@@ -49,20 +49,20 @@ void LabelMap::DeleteLabel(const std::string &label)
|
||||
}
|
||||
}
|
||||
|
||||
bool LabelMap::GetLabelValue(const std::string &label, u16 *value, LabelType type) const
|
||||
bool LabelMap::GetLabelValue(const std::string &name, u16 *value, LabelType type) const
|
||||
{
|
||||
for (u32 i = 0; i < labels.size(); i++)
|
||||
for (auto& label : labels)
|
||||
{
|
||||
if (!label.compare(labels[i].name))
|
||||
if (!name.compare(label.name))
|
||||
{
|
||||
if (type & labels[i].type)
|
||||
if (type & label.type)
|
||||
{
|
||||
*value = labels[i].addr;
|
||||
*value = label.addr;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("WARNING: Wrong label type requested. %s\n", label.c_str());
|
||||
printf("WARNING: Wrong label type requested. %s\n", name.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,8 +128,8 @@ u32 CalculateVertexSize(int vatIndex, const CPMemory &cpMem)
|
||||
int sizes[21];
|
||||
CalculateVertexElementSizes(sizes, vatIndex, cpMem);
|
||||
|
||||
for (int i = 0; i < 21; ++i)
|
||||
vertexSize += sizes[i];
|
||||
for (auto& size : sizes)
|
||||
vertexSize += size;
|
||||
|
||||
return vertexSize;
|
||||
}
|
||||
|
||||
@@ -17,12 +17,10 @@ FifoDataFile::FifoDataFile() :
|
||||
|
||||
FifoDataFile::~FifoDataFile()
|
||||
{
|
||||
for (unsigned int frameIdx = 0; frameIdx < m_Frames.size(); ++frameIdx)
|
||||
for (auto& frame : m_Frames)
|
||||
{
|
||||
FifoFrameInfo &frame = m_Frames[frameIdx];
|
||||
|
||||
for (unsigned int i = 0; i < frame.memoryUpdates.size(); ++i)
|
||||
delete []frame.memoryUpdates[i].data;
|
||||
for (auto& update : frame.memoryUpdates)
|
||||
delete []update.data;
|
||||
|
||||
delete []frame.fifoData;
|
||||
}
|
||||
@@ -54,7 +52,7 @@ bool FifoDataFile::Save(const char *filename)
|
||||
|
||||
// Add space for frame list
|
||||
u64 frameListOffset = file.Tell();
|
||||
for (unsigned int i = 0; i < m_Frames.size(); ++i)
|
||||
for (size_t i = 0; i < m_Frames.size(); i++)
|
||||
PadFile(sizeof(FileFrameInfo), file);
|
||||
|
||||
u64 bpMemOffset = file.Tell();
|
||||
@@ -221,7 +219,7 @@ u64 FifoDataFile::WriteMemoryUpdates(const std::vector<MemoryUpdate> &memUpdates
|
||||
{
|
||||
// Add space for memory update list
|
||||
u64 updateListOffset = file.Tell();
|
||||
for (unsigned int i = 0; i < memUpdates.size(); ++i)
|
||||
for (size_t i = 0; i < memUpdates.size(); i++)
|
||||
PadFile(sizeof(FileMemoryUpdate), file);
|
||||
|
||||
for (unsigned int i = 0; i < memUpdates.size(); ++i)
|
||||
|
||||
@@ -115,10 +115,8 @@ void FifoPlaybackAnalyzer::AddMemoryUpdate(MemoryUpdate memUpdate, AnalyzedFrame
|
||||
u32 end = memUpdate.address + memUpdate.size;
|
||||
|
||||
// Remove portions of memUpdate that overlap with memory ranges that have been written by the GP
|
||||
for (unsigned int i = 0; i < m_WrittenMemory.size(); ++i)
|
||||
for (const auto& range : m_WrittenMemory)
|
||||
{
|
||||
const MemoryRange &range = m_WrittenMemory[i];
|
||||
|
||||
if (range.begin < end &&
|
||||
range.end > begin)
|
||||
{
|
||||
|
||||
@@ -259,9 +259,9 @@ void FifoPlayer::WriteAllMemoryUpdates()
|
||||
for (int frameNum = 0; frameNum < m_File->GetFrameCount(); ++frameNum)
|
||||
{
|
||||
const FifoFrameInfo &frame = m_File->GetFrame(frameNum);
|
||||
for (unsigned int i = 0; i < frame.memoryUpdates.size(); ++i)
|
||||
for (auto& update : frame.memoryUpdates)
|
||||
{
|
||||
WriteMemory(frame.memoryUpdates[i]);
|
||||
WriteMemory(update);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,14 +23,14 @@ void LoadCodes(const IniFile& globalIni, const IniFile& localIni, std::vector<Ge
|
||||
|
||||
GeckoCode gcode;
|
||||
|
||||
for (auto lines_iter = lines.begin(); lines_iter!=lines.end(); ++lines_iter)
|
||||
for (auto& line : lines)
|
||||
{
|
||||
if (lines_iter->empty())
|
||||
if (line.empty())
|
||||
continue;
|
||||
|
||||
std::istringstream ss(*lines_iter);
|
||||
std::istringstream ss(line);
|
||||
|
||||
switch ((*lines_iter)[0])
|
||||
switch ((line)[0])
|
||||
{
|
||||
|
||||
// enabled or disabled code
|
||||
@@ -52,7 +52,7 @@ void LoadCodes(const IniFile& globalIni, const IniFile& localIni, std::vector<Ge
|
||||
|
||||
// notes
|
||||
case '*':
|
||||
gcode.notes.push_back(std::string(++lines_iter->begin(), lines_iter->end()));
|
||||
gcode.notes.push_back(std::string(++line.begin(), line.end()));
|
||||
break;
|
||||
|
||||
// either part of the code, or an option choice
|
||||
@@ -60,7 +60,7 @@ void LoadCodes(const IniFile& globalIni, const IniFile& localIni, std::vector<Ge
|
||||
{
|
||||
GeckoCode::Code new_code;
|
||||
// TODO: support options
|
||||
new_code.original_line = *lines_iter;
|
||||
new_code.original_line = line;
|
||||
ss >> std::hex >> new_code.address >> new_code.data;
|
||||
gcode.codes.push_back(new_code);
|
||||
}
|
||||
@@ -75,16 +75,15 @@ void LoadCodes(const IniFile& globalIni, const IniFile& localIni, std::vector<Ge
|
||||
|
||||
inis[i]->GetLines("Gecko_Enabled", lines, false);
|
||||
|
||||
for (auto lines_iter = lines.begin(); lines_iter!=lines.end(); ++lines_iter)
|
||||
for (auto line : lines)
|
||||
{
|
||||
auto line = *lines_iter;
|
||||
if (line.size() == 0 || line[0] != '$')
|
||||
continue;
|
||||
std::string name = line.substr(1);
|
||||
for (auto gcodes_iter = gcodes.begin(); gcodes_iter != gcodes.end(); ++gcodes_iter)
|
||||
for (auto& ogcode : gcodes)
|
||||
{
|
||||
if ((*gcodes_iter).name == name)
|
||||
(*gcodes_iter).enabled = true;
|
||||
if (ogcode.name == name)
|
||||
ogcode.enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,8 +72,8 @@ void CUCode_AX::LoadResamplingCoefficients()
|
||||
File::IOFile fp(filename, "rb");
|
||||
fp.ReadBytes(m_coeffs, 0x1000);
|
||||
|
||||
for (u32 i = 0; i < 0x800; ++i)
|
||||
m_coeffs[i] = Common::swap16(m_coeffs[i]);
|
||||
for (auto& coef : m_coeffs)
|
||||
coef = Common::swap16(coef);
|
||||
|
||||
m_coeffs_available = true;
|
||||
}
|
||||
@@ -386,7 +386,7 @@ void CUCode_AX::SetupProcessing(u32 init_addr)
|
||||
};
|
||||
|
||||
u32 init_idx = 0;
|
||||
for (u32 i = 0; i < sizeof (buffers) / sizeof (buffers[0]); ++i)
|
||||
for (auto& buffer : buffers)
|
||||
{
|
||||
s32 init_val = (s32)((init_data[init_idx] << 16) | init_data[init_idx + 1]);
|
||||
s16 delta = (s16)init_data[init_idx + 2];
|
||||
@@ -395,13 +395,13 @@ void CUCode_AX::SetupProcessing(u32 init_addr)
|
||||
|
||||
if (!init_val)
|
||||
{
|
||||
memset(buffers[i], 0, 5 * 32 * sizeof (int));
|
||||
memset(buffer, 0, 5 * 32 * sizeof (int));
|
||||
}
|
||||
else
|
||||
{
|
||||
for (u32 j = 0; j < 32 * 5; ++j)
|
||||
{
|
||||
buffers[i][j] = init_val;
|
||||
buffer[j] = init_val;
|
||||
init_val += delta;
|
||||
}
|
||||
}
|
||||
@@ -501,20 +501,20 @@ void CUCode_AX::MixAUXSamples(int aux_id, u32 write_addr, u32 read_addr)
|
||||
if (write_addr)
|
||||
{
|
||||
int* ptr = (int*)HLEMemory_Get_Pointer(write_addr);
|
||||
for (u32 i = 0; i < 3; ++i)
|
||||
for (auto& buffer : buffers)
|
||||
for (u32 j = 0; j < 5 * 32; ++j)
|
||||
*ptr++ = Common::swap32(buffers[i][j]);
|
||||
*ptr++ = Common::swap32(buffer[j]);
|
||||
}
|
||||
|
||||
// Then, we read the new temp from the CPU and add to our current
|
||||
// temp.
|
||||
int* ptr = (int*)HLEMemory_Get_Pointer(read_addr);
|
||||
for (u32 i = 0; i < 5 * 32; ++i)
|
||||
m_samples_left[i] += (int)Common::swap32(*ptr++);
|
||||
for (u32 i = 0; i < 5 * 32; ++i)
|
||||
m_samples_right[i] += (int)Common::swap32(*ptr++);
|
||||
for (u32 i = 0; i < 5 * 32; ++i)
|
||||
m_samples_surround[i] += (int)Common::swap32(*ptr++);
|
||||
for (auto& sample : m_samples_left)
|
||||
sample += (int)Common::swap32(*ptr++);
|
||||
for (auto& sample : m_samples_right)
|
||||
sample += (int)Common::swap32(*ptr++);
|
||||
for (auto& sample : m_samples_surround)
|
||||
sample += (int)Common::swap32(*ptr++);
|
||||
}
|
||||
|
||||
void CUCode_AX::UploadLRS(u32 dst_addr)
|
||||
@@ -575,10 +575,10 @@ void CUCode_AX::MixAUXBLR(u32 ul_addr, u32 dl_addr)
|
||||
{
|
||||
// Upload AUXB L/R
|
||||
int* ptr = (int*)HLEMemory_Get_Pointer(ul_addr);
|
||||
for (u32 i = 0; i < 5 * 32; ++i)
|
||||
*ptr++ = Common::swap32(m_samples_auxB_left[i]);
|
||||
for (u32 i = 0; i < 5 * 32; ++i)
|
||||
*ptr++ = Common::swap32(m_samples_auxB_right[i]);
|
||||
for (auto& sample : m_samples_auxB_left)
|
||||
*ptr++ = Common::swap32(sample);
|
||||
for (auto& sample : m_samples_auxB_right)
|
||||
*ptr++ = Common::swap32(sample);
|
||||
|
||||
// Mix AUXB L/R to MAIN L/R, and replace AUXB L/R
|
||||
ptr = (int*)HLEMemory_Get_Pointer(dl_addr);
|
||||
@@ -620,14 +620,14 @@ void CUCode_AX::SendAUXAndMix(u32 main_auxa_up, u32 auxb_s_up, u32 main_l_dl,
|
||||
|
||||
// Upload AUXA LRS
|
||||
int* ptr = (int*)HLEMemory_Get_Pointer(main_auxa_up);
|
||||
for (u32 i = 0; i < sizeof (up_buffers) / sizeof (up_buffers[0]); ++i)
|
||||
for (auto& up_buffer : up_buffers)
|
||||
for (u32 j = 0; j < 32 * 5; ++j)
|
||||
*ptr++ = Common::swap32(up_buffers[i][j]);
|
||||
*ptr++ = Common::swap32(up_buffer[j]);
|
||||
|
||||
// Upload AUXB S
|
||||
ptr = (int*)HLEMemory_Get_Pointer(auxb_s_up);
|
||||
for (u32 i = 0; i < 32 * 5; ++i)
|
||||
*ptr++ = Common::swap32(m_samples_auxB_surround[i]);
|
||||
for (auto& sample : m_samples_auxB_surround)
|
||||
*ptr++ = Common::swap32(sample);
|
||||
|
||||
// Download buffers and addresses
|
||||
int* dl_buffers[] = {
|
||||
|
||||
@@ -21,6 +21,7 @@ CUCode_AXWii::CUCode_AXWii(DSPHLE *dsp_hle, u32 l_CRC)
|
||||
{
|
||||
for (int i = 0; i < 3; ++i)
|
||||
m_last_aux_volumes[i] = 0x8000;
|
||||
|
||||
WARN_LOG(DSPHLE, "Instantiating CUCode_AXWii");
|
||||
|
||||
m_old_axwii = (l_CRC == 0xfa450138);
|
||||
@@ -279,7 +280,7 @@ void CUCode_AXWii::SetupProcessing(u32 init_addr)
|
||||
};
|
||||
|
||||
u32 init_idx = 0;
|
||||
for (u32 i = 0; i < sizeof (buffers) / sizeof (buffers[0]); ++i)
|
||||
for (auto& buffer : buffers)
|
||||
{
|
||||
s32 init_val = (s32)((init_data[init_idx] << 16) | init_data[init_idx + 1]);
|
||||
s16 delta = (s16)init_data[init_idx + 2];
|
||||
@@ -288,13 +289,13 @@ void CUCode_AXWii::SetupProcessing(u32 init_addr)
|
||||
|
||||
if (!init_val)
|
||||
{
|
||||
memset(buffers[i].ptr, 0, 3 * buffers[i].samples * sizeof (int));
|
||||
memset(buffer.ptr, 0, 3 * buffer.samples * sizeof (int));
|
||||
}
|
||||
else
|
||||
{
|
||||
for (u32 j = 0; j < 3 * buffers[i].samples; ++j)
|
||||
for (u32 j = 0; j < 3 * buffer.samples; ++j)
|
||||
{
|
||||
buffers[i].ptr[j] = init_val;
|
||||
buffer.ptr[j] = init_val;
|
||||
init_val += delta;
|
||||
}
|
||||
}
|
||||
@@ -523,19 +524,19 @@ void CUCode_AXWii::MixAUXSamples(int aux_id, u32 write_addr, u32 read_addr, u16
|
||||
if (write_addr)
|
||||
{
|
||||
int* ptr = (int*)HLEMemory_Get_Pointer(write_addr);
|
||||
for (u32 i = 0; i < 3; ++i)
|
||||
for (auto& buffer : buffers)
|
||||
for (u32 j = 0; j < 3 * 32; ++j)
|
||||
*ptr++ = Common::swap32(buffers[i][j]);
|
||||
*ptr++ = Common::swap32(buffer[j]);
|
||||
}
|
||||
|
||||
// Then read the buffers from the CPU and add to our main buffers.
|
||||
int* ptr = (int*)HLEMemory_Get_Pointer(read_addr);
|
||||
for (u32 i = 0; i < 3; ++i)
|
||||
for (auto& main_buffer : main_buffers)
|
||||
for (u32 j = 0; j < 3 * 32; ++j)
|
||||
{
|
||||
s64 sample = (s64)(s32)Common::swap32(*ptr++);
|
||||
sample *= volume_ramp[j];
|
||||
main_buffers[i][j] += (s32)(sample >> 15);
|
||||
main_buffer[j] += (s32)(sample >> 15);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,10 +21,10 @@ void CUCode_Zelda::AFCdecodebuffer(const s16 *coef, const char *src, signed shor
|
||||
nibbles[i + 1] = *src & 15;
|
||||
src++;
|
||||
}
|
||||
for (int i = 0; i < 16; i++) {
|
||||
if (nibbles[i] >= 8)
|
||||
nibbles[i] = nibbles[i] - 16;
|
||||
nibbles[i] <<= 11;
|
||||
for (auto& nibble : nibbles) {
|
||||
if (nibble >= 8)
|
||||
nibble = nibble - 16;
|
||||
nibble <<= 11;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -41,11 +41,11 @@ void CUCode_Zelda::AFCdecodebuffer(const s16 *coef, const char *src, signed shor
|
||||
src++;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 16; i++)
|
||||
for (auto& nibble : nibbles)
|
||||
{
|
||||
if (nibbles[i] >= 2)
|
||||
nibbles[i] = nibbles[i] - 4;
|
||||
nibbles[i] <<= 13;
|
||||
if (nibble >= 2)
|
||||
nibble = nibble - 4;
|
||||
nibble <<= 13;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,10 +64,10 @@ Symbol *DSPSymbolDB::GetSymbolFromAddr(u32 addr)
|
||||
}
|
||||
else
|
||||
{
|
||||
for (XFuncMap::iterator iter = functions.begin(); iter != functions.end(); ++iter)
|
||||
for (auto& func : functions)
|
||||
{
|
||||
if (addr >= iter->second.address && addr < iter->second.address + iter->second.size)
|
||||
return &iter->second;
|
||||
if (addr >= func.second.address && addr < func.second.address + func.second.size)
|
||||
return &func.second;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -48,23 +48,23 @@ void Init()
|
||||
|
||||
void Shutdown()
|
||||
{
|
||||
for (u32 i = 0; i < NUM_CHANNELS; i++)
|
||||
for (auto& channel : g_Channels)
|
||||
{
|
||||
delete g_Channels[i];
|
||||
g_Channels[i] = NULL;
|
||||
delete channel;
|
||||
channel = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void DoState(PointerWrap &p)
|
||||
{
|
||||
for (int c = 0; c < NUM_CHANNELS; ++c)
|
||||
g_Channels[c]->DoState(p);
|
||||
for (auto& channel : g_Channels)
|
||||
channel->DoState(p);
|
||||
}
|
||||
|
||||
void PauseAndLock(bool doLock, bool unpauseOnUnlock)
|
||||
{
|
||||
for (int c = 0; c < NUM_CHANNELS; ++c)
|
||||
g_Channels[c]->PauseAndLock(doLock, unpauseOnUnlock);
|
||||
for (auto& channel : g_Channels)
|
||||
channel->PauseAndLock(doLock, unpauseOnUnlock);
|
||||
}
|
||||
|
||||
|
||||
@@ -87,9 +87,9 @@ void ChangeDevice(const u8 channel, const TEXIDevices device_type, const u8 devi
|
||||
|
||||
IEXIDevice* FindDevice(TEXIDevices device_type, int customIndex)
|
||||
{
|
||||
for (int i = 0; i < NUM_CHANNELS; ++i)
|
||||
for (auto& channel : g_Channels)
|
||||
{
|
||||
IEXIDevice* device = g_Channels[i]->FindDevice(device_type, customIndex);
|
||||
IEXIDevice* device = channel->FindDevice(device_type, customIndex);
|
||||
if (device)
|
||||
return device;
|
||||
}
|
||||
@@ -145,8 +145,8 @@ void UpdateInterrupts()
|
||||
g_Channels[2]->SetEXIINT(g_Channels[0]->GetDevice(4)->IsInterruptSet());
|
||||
|
||||
bool causeInt = false;
|
||||
for (int i = 0; i < NUM_CHANNELS; i++)
|
||||
causeInt |= g_Channels[i]->IsCausingInterrupt();
|
||||
for (auto& channel : g_Channels)
|
||||
causeInt |= channel->IsCausingInterrupt();
|
||||
|
||||
ProcessorInterface::SetInterrupt(ProcessorInterface::INT_CAUSE_EXI, causeInt);
|
||||
}
|
||||
|
||||
@@ -30,8 +30,8 @@ CEXIChannel::CEXIChannel(u32 ChannelId) :
|
||||
if (m_ChannelId == 1)
|
||||
m_Status.CHIP_SELECT = 1;
|
||||
|
||||
for (int i = 0; i < NUM_DEVICES; i++)
|
||||
m_pDevices[i] = EXIDevice_Create(EXIDEVICE_NONE, m_ChannelId);
|
||||
for (auto& device : m_pDevices)
|
||||
device.reset(EXIDevice_Create(EXIDEVICE_NONE, m_ChannelId));
|
||||
|
||||
updateInterrupts = CoreTiming::RegisterEvent("EXIInterrupt", UpdateInterrupts);
|
||||
}
|
||||
@@ -43,11 +43,8 @@ CEXIChannel::~CEXIChannel()
|
||||
|
||||
void CEXIChannel::RemoveDevices()
|
||||
{
|
||||
for (int i = 0; i < NUM_DEVICES; i++)
|
||||
{
|
||||
delete m_pDevices[i];
|
||||
m_pDevices[i] = NULL;
|
||||
}
|
||||
for (auto& device : m_pDevices)
|
||||
device.reset();
|
||||
}
|
||||
|
||||
void CEXIChannel::AddDevice(const TEXIDevices device_type, const int device_num)
|
||||
@@ -60,15 +57,8 @@ void CEXIChannel::AddDevice(IEXIDevice* pDevice, const int device_num, bool noti
|
||||
{
|
||||
_dbg_assert_(EXPANSIONINTERFACE, device_num < NUM_DEVICES);
|
||||
|
||||
// delete the old device
|
||||
if (m_pDevices[device_num] != NULL)
|
||||
{
|
||||
delete m_pDevices[device_num];
|
||||
m_pDevices[device_num] = NULL;
|
||||
}
|
||||
|
||||
// replace it with the new one
|
||||
m_pDevices[device_num] = pDevice;
|
||||
m_pDevices[device_num].reset(pDevice);
|
||||
|
||||
if(notifyPresenceChanged)
|
||||
{
|
||||
@@ -111,9 +101,9 @@ IEXIDevice* CEXIChannel::GetDevice(const u8 chip_select)
|
||||
{
|
||||
switch (chip_select)
|
||||
{
|
||||
case 1: return m_pDevices[0];
|
||||
case 2: return m_pDevices[1];
|
||||
case 4: return m_pDevices[2];
|
||||
case 1: return m_pDevices[0].get();
|
||||
case 2: return m_pDevices[1].get();
|
||||
case 4: return m_pDevices[2].get();
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -121,10 +111,8 @@ IEXIDevice* CEXIChannel::GetDevice(const u8 chip_select)
|
||||
void CEXIChannel::Update()
|
||||
{
|
||||
// start the transfer
|
||||
for (int i = 0; i < NUM_DEVICES; i++)
|
||||
{
|
||||
m_pDevices[i]->Update();
|
||||
}
|
||||
for (auto& device : m_pDevices)
|
||||
device->Update();
|
||||
}
|
||||
|
||||
void CEXIChannel::Read32(u32& _uReturnValue, const u32 _iRegister)
|
||||
@@ -283,7 +271,7 @@ void CEXIChannel::DoState(PointerWrap &p)
|
||||
|
||||
for (int d = 0; d < NUM_DEVICES; ++d)
|
||||
{
|
||||
IEXIDevice* pDevice = m_pDevices[d];
|
||||
IEXIDevice* pDevice = m_pDevices[d].get();
|
||||
TEXIDevices type = pDevice->m_deviceType;
|
||||
p.Do(type);
|
||||
IEXIDevice* pSaveDevice = (type == pDevice->m_deviceType) ? pDevice : EXIDevice_Create(type, m_ChannelId);
|
||||
@@ -308,15 +296,15 @@ void CEXIChannel::DoState(PointerWrap &p)
|
||||
|
||||
void CEXIChannel::PauseAndLock(bool doLock, bool unpauseOnUnlock)
|
||||
{
|
||||
for (int d = 0; d < NUM_DEVICES; ++d)
|
||||
m_pDevices[d]->PauseAndLock(doLock, unpauseOnUnlock);
|
||||
for (auto& device : m_pDevices)
|
||||
device->PauseAndLock(doLock, unpauseOnUnlock);
|
||||
}
|
||||
|
||||
IEXIDevice* CEXIChannel::FindDevice(TEXIDevices device_type, int customIndex)
|
||||
{
|
||||
for (int d = 0; d < NUM_DEVICES; ++d)
|
||||
for (auto& sup : m_pDevices)
|
||||
{
|
||||
IEXIDevice* device = m_pDevices[d]->FindDevice(device_type, customIndex);
|
||||
IEXIDevice* device = sup->FindDevice(device_type, customIndex);
|
||||
if (device)
|
||||
return device;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "CommonTypes.h"
|
||||
|
||||
#include "EXI_Device.h"
|
||||
#include <memory>
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma warning(disable:4201)
|
||||
@@ -92,7 +93,7 @@ private:
|
||||
NUM_DEVICES = 3
|
||||
};
|
||||
|
||||
IEXIDevice* m_pDevices[NUM_DEVICES];
|
||||
std::unique_ptr<IEXIDevice> m_pDevices[NUM_DEVICES];
|
||||
|
||||
// Since channels operate a bit differently from each other
|
||||
u32 m_ChannelId;
|
||||
|
||||
@@ -65,8 +65,8 @@ GCPad::GCPad(const unsigned int index) : m_index(index)
|
||||
|
||||
// triggers
|
||||
groups.push_back(m_triggers = new MixedTriggers(_trans("Triggers")));
|
||||
for (unsigned int i=0; i < sizeof(named_triggers)/sizeof(*named_triggers); ++i)
|
||||
m_triggers->controls.push_back(new ControlGroup::Input(named_triggers[i]));
|
||||
for (auto& named_trigger : named_triggers)
|
||||
m_triggers->controls.push_back(new ControlGroup::Input(named_trigger));
|
||||
|
||||
// rumble
|
||||
groups.push_back(m_rumble = new ControlGroup(_trans("Rumble")));
|
||||
@@ -74,8 +74,8 @@ GCPad::GCPad(const unsigned int index) : m_index(index)
|
||||
|
||||
// dpad
|
||||
groups.push_back(m_dpad = new Buttons(_trans("D-Pad")));
|
||||
for (unsigned int i=0; i < 4; ++i)
|
||||
m_dpad->controls.push_back(new ControlGroup::Input(named_directions[i]));
|
||||
for (auto& named_direction : named_directions)
|
||||
m_dpad->controls.push_back(new ControlGroup::Input(named_direction));
|
||||
|
||||
// options
|
||||
groups.push_back(m_options = new ControlGroup(_trans("Options")));
|
||||
|
||||
@@ -57,8 +57,8 @@ Classic::Classic(WiimoteEmu::ExtensionReg& _reg) : Attachment(_trans("Classic"),
|
||||
{
|
||||
// buttons
|
||||
groups.push_back(m_buttons = new Buttons("Buttons"));
|
||||
for (unsigned int i = 0; i < sizeof(classic_button_names)/sizeof(*classic_button_names); ++i)
|
||||
m_buttons->controls.push_back(new ControlGroup::Input(classic_button_names[i]));
|
||||
for (auto& classic_button_name : classic_button_names)
|
||||
m_buttons->controls.push_back(new ControlGroup::Input(classic_button_name));
|
||||
|
||||
// sticks
|
||||
groups.push_back(m_left_stick = new AnalogStick(_trans("Left Stick")));
|
||||
@@ -66,13 +66,13 @@ Classic::Classic(WiimoteEmu::ExtensionReg& _reg) : Attachment(_trans("Classic"),
|
||||
|
||||
// triggers
|
||||
groups.push_back(m_triggers = new MixedTriggers("Triggers"));
|
||||
for (unsigned int i=0; i < sizeof(classic_trigger_names)/sizeof(*classic_trigger_names); ++i)
|
||||
m_triggers->controls.push_back(new ControlGroup::Input(classic_trigger_names[i]));
|
||||
for (auto& classic_trigger_name : classic_trigger_names)
|
||||
m_triggers->controls.push_back(new ControlGroup::Input(classic_trigger_name));
|
||||
|
||||
// dpad
|
||||
groups.push_back(m_dpad = new Buttons("D-Pad"));
|
||||
for (unsigned int i=0; i < 4; ++i)
|
||||
m_dpad->controls.push_back(new ControlGroup::Input(named_directions[i]));
|
||||
for (auto& named_direction : named_directions)
|
||||
m_dpad->controls.push_back(new ControlGroup::Input(named_direction));
|
||||
|
||||
// set up register
|
||||
// calibration
|
||||
|
||||
@@ -36,8 +36,8 @@ Drums::Drums(WiimoteEmu::ExtensionReg& _reg) : Attachment(_trans("Drums"), _reg)
|
||||
{
|
||||
// pads
|
||||
groups.push_back(m_pads = new Buttons(_trans("Pads")));
|
||||
for (unsigned int i = 0; i < sizeof(drum_pad_names)/sizeof(*drum_pad_names); ++i)
|
||||
m_pads->controls.push_back(new ControlGroup::Input(drum_pad_names[i]));
|
||||
for (auto& drum_pad_name : drum_pad_names)
|
||||
m_pads->controls.push_back(new ControlGroup::Input(drum_pad_name));
|
||||
|
||||
// stick
|
||||
groups.push_back(m_stick = new AnalogStick("Stick"));
|
||||
|
||||
@@ -40,8 +40,8 @@ Guitar::Guitar(WiimoteEmu::ExtensionReg& _reg) : Attachment(_trans("Guitar"), _r
|
||||
{
|
||||
// frets
|
||||
groups.push_back(m_frets = new Buttons(_trans("Frets")));
|
||||
for (unsigned int i = 0; i < sizeof(guitar_fret_names)/sizeof(*guitar_fret_names); ++i)
|
||||
m_frets->controls.push_back(new ControlGroup::Input(guitar_fret_names[i]));
|
||||
for (auto& guitar_fret_name : guitar_fret_names)
|
||||
m_frets->controls.push_back(new ControlGroup::Input(guitar_fret_name));
|
||||
|
||||
// strum
|
||||
groups.push_back(m_strum = new Buttons(_trans("Strum")));
|
||||
|
||||
@@ -34,8 +34,8 @@ Turntable::Turntable(WiimoteEmu::ExtensionReg& _reg) : Attachment(_trans("Turnta
|
||||
{
|
||||
// buttons
|
||||
groups.push_back(m_buttons = new Buttons("Buttons"));
|
||||
for (unsigned int i = 0; i < sizeof(turntable_button_names)/sizeof(*turntable_button_names); ++i)
|
||||
m_buttons->controls.push_back(new ControlGroup::Input(turntable_button_names[i]));
|
||||
for (auto& turntable_button_name : turntable_button_names)
|
||||
m_buttons->controls.push_back(new ControlGroup::Input(turntable_button_name));
|
||||
|
||||
// turntables
|
||||
groups.push_back(m_left_table = new Slider(_trans("Table Left")));
|
||||
|
||||
@@ -264,8 +264,8 @@ Wiimote::Wiimote( const unsigned int index )
|
||||
|
||||
// buttons
|
||||
groups.push_back(m_buttons = new Buttons("Buttons"));
|
||||
for (unsigned int i=0; i < sizeof(named_buttons)/sizeof(*named_buttons); ++i)
|
||||
m_buttons->controls.push_back(new ControlGroup::Input( named_buttons[i]));
|
||||
for (auto& named_button : named_buttons)
|
||||
m_buttons->controls.push_back(new ControlGroup::Input( named_button));
|
||||
|
||||
// udp
|
||||
groups.push_back(m_udp = new UDPWrapper(m_index, _trans("UDP Wiimote")));
|
||||
@@ -302,8 +302,8 @@ Wiimote::Wiimote( const unsigned int index )
|
||||
|
||||
// dpad
|
||||
groups.push_back(m_dpad = new Buttons("D-Pad"));
|
||||
for (unsigned int i=0; i < 4; ++i)
|
||||
m_dpad->controls.push_back(new ControlGroup::Input(named_directions[i]));
|
||||
for (auto& named_direction : named_directions)
|
||||
m_dpad->controls.push_back(new ControlGroup::Input(named_direction));
|
||||
|
||||
// options
|
||||
groups.push_back( m_options = new ControlGroup(_trans("Options")));
|
||||
@@ -503,12 +503,12 @@ void Wiimote::GetIRData(u8* const data, bool use_accel)
|
||||
static const double dist1=100.f/camWidth; //this seems the optimal distance for zelda
|
||||
static const double dist2=1.2f*dist1;
|
||||
|
||||
for (int i=0; i<4; i++)
|
||||
for (auto& vtx : v)
|
||||
{
|
||||
v[i].x=xx*(bndright-bndleft)/2+(bndleft+bndright)/2;
|
||||
if (m_sensor_bar_on_top) v[i].y=yy*(bndup-bnddown)/2+(bndup+bnddown)/2;
|
||||
else v[i].y=yy*(bndup-bnddown)/2-(bndup+bnddown)/2;
|
||||
v[i].z=0;
|
||||
vtx.x=xx*(bndright-bndleft)/2+(bndleft+bndright)/2;
|
||||
if (m_sensor_bar_on_top) vtx.y=yy*(bndup-bnddown)/2+(bndup+bnddown)/2;
|
||||
else vtx.y=yy*(bndup-bnddown)/2-(bndup+bnddown)/2;
|
||||
vtx.z=0;
|
||||
}
|
||||
|
||||
v[0].x-=(zz*0.5+1)*dist1;
|
||||
|
||||
@@ -612,9 +612,9 @@ void Initialize(bool wait)
|
||||
// called on emulation shutdown
|
||||
void Stop(void)
|
||||
{
|
||||
for (unsigned int i = 0; i < MAX_BBMOTES; ++i)
|
||||
if (g_wiimotes[i] && g_wiimotes[i]->IsConnected())
|
||||
g_wiimotes[i]->EmuStop();
|
||||
for (auto& wiimote : g_wiimotes)
|
||||
if (wiimote && wiimote->IsConnected())
|
||||
wiimote->EmuStop();
|
||||
}
|
||||
|
||||
// called when the dolphin app exits
|
||||
@@ -637,16 +637,16 @@ void Shutdown(void)
|
||||
|
||||
void Resume()
|
||||
{
|
||||
for (unsigned int i = 0; i < MAX_BBMOTES; ++i)
|
||||
if (g_wiimotes[i] && g_wiimotes[i]->IsConnected())
|
||||
g_wiimotes[i]->EmuResume();
|
||||
for (auto& wiimote : g_wiimotes)
|
||||
if (wiimote && wiimote->IsConnected())
|
||||
wiimote->EmuResume();
|
||||
}
|
||||
|
||||
void Pause()
|
||||
{
|
||||
for (unsigned int i = 0; i < MAX_BBMOTES; ++i)
|
||||
if (g_wiimotes[i] && g_wiimotes[i]->IsConnected())
|
||||
g_wiimotes[i]->EmuPause();
|
||||
for (auto& wiimote : g_wiimotes)
|
||||
if (wiimote && wiimote->IsConnected())
|
||||
wiimote->EmuPause();
|
||||
}
|
||||
|
||||
void ChangeWiimoteSource(unsigned int index, int source)
|
||||
|
||||
@@ -21,10 +21,10 @@ std::string HLE_IPC_BuildFilename(std::string path_wii, int _size)
|
||||
std::string path_full = File::GetUserPath(D_WIIROOT_IDX);
|
||||
|
||||
// Replaces chars that FAT32 can't support with strings defined in /sys/replace
|
||||
for (auto i = replacements.begin(); i != replacements.end(); ++i)
|
||||
for (auto& replacement : replacements)
|
||||
{
|
||||
for (size_t j = 0; (j = path_wii.find(i->first, j)) != path_wii.npos; ++j)
|
||||
path_wii.replace(j, 1, i->second);
|
||||
for (size_t j = 0; (j = path_wii.find(replacement.first, j)) != path_wii.npos; ++j)
|
||||
path_wii.replace(j, 1, replacement.second);
|
||||
}
|
||||
|
||||
path_full += path_wii;
|
||||
|
||||
@@ -152,10 +152,10 @@ void CWII_IPC_HLE_Device_es::DoState(PointerWrap& p)
|
||||
}
|
||||
else
|
||||
{
|
||||
for (auto itr = m_ContentAccessMap.begin(); itr != m_ContentAccessMap.end(); ++itr)
|
||||
for (auto& pair : m_ContentAccessMap)
|
||||
{
|
||||
CFD = itr->first;
|
||||
SContentAccess& Access = itr->second;
|
||||
CFD = pair.first;
|
||||
SContentAccess& Access = pair.second;
|
||||
Position = Access.m_Position;
|
||||
TitleID = Access.m_TitleID;
|
||||
Index = Access.m_pContent->m_Index;
|
||||
@@ -182,9 +182,9 @@ bool CWII_IPC_HLE_Device_es::Close(u32 _CommandAddress, bool _bForce)
|
||||
{
|
||||
// Leave deletion of the INANDContentLoader objects to CNANDContentManager, don't do it here!
|
||||
m_NANDContent.clear();
|
||||
for (auto itr = m_ContentAccessMap.begin(); itr != m_ContentAccessMap.end(); ++itr)
|
||||
for (auto& pair : m_ContentAccessMap)
|
||||
{
|
||||
delete itr->second.m_pFile;
|
||||
delete pair.second.m_pFile;
|
||||
}
|
||||
m_ContentAccessMap.clear();
|
||||
m_pContentLoader = NULL;
|
||||
|
||||
@@ -60,9 +60,8 @@ static u64 ComputeTotalFileSize(const File::FSTEntry& parentEntry)
|
||||
{
|
||||
u64 sizeOfFiles = 0;
|
||||
const std::vector<File::FSTEntry>& children = parentEntry.children;
|
||||
for (std::vector<File::FSTEntry>::const_iterator it = children.begin(); it != children.end(); ++it)
|
||||
for (const auto& entry : children)
|
||||
{
|
||||
const File::FSTEntry& entry = *it;
|
||||
if (entry.isDirectory)
|
||||
sizeOfFiles += ComputeTotalFileSize(entry);
|
||||
else
|
||||
|
||||
@@ -734,13 +734,13 @@ bool CWII_IPC_HLE_Device_net_ip_top::IOCtl(u32 _CommandAddress)
|
||||
// Do the level/optname translation
|
||||
int nat_level = -1, nat_optname = -1;
|
||||
|
||||
for (unsigned int i = 0; i < sizeof (opt_level_mapping) / sizeof (opt_level_mapping[0]); ++i)
|
||||
if (level == opt_level_mapping[i][1])
|
||||
nat_level = opt_level_mapping[i][0];
|
||||
for (auto& map : opt_level_mapping)
|
||||
if (level == map[1])
|
||||
nat_level = map[0];
|
||||
|
||||
for (unsigned int i = 0; i < sizeof (opt_name_mapping) / sizeof (opt_name_mapping[0]); ++i)
|
||||
if (optname == opt_name_mapping[i][1])
|
||||
nat_optname = opt_name_mapping[i][0];
|
||||
for (auto& map : opt_name_mapping)
|
||||
if (optname == map[1])
|
||||
nat_optname = map[0];
|
||||
|
||||
u8 optval[20];
|
||||
u32 optlen = 4;
|
||||
@@ -785,13 +785,13 @@ bool CWII_IPC_HLE_Device_net_ip_top::IOCtl(u32 _CommandAddress)
|
||||
// Do the level/optname translation
|
||||
int nat_level = -1, nat_optname = -1;
|
||||
|
||||
for (unsigned int i = 0; i < sizeof (opt_level_mapping) / sizeof (opt_level_mapping[0]); ++i)
|
||||
if (level == opt_level_mapping[i][1])
|
||||
nat_level = opt_level_mapping[i][0];
|
||||
for (auto& map : opt_level_mapping)
|
||||
if (level == map[1])
|
||||
nat_level = map[0];
|
||||
|
||||
for (unsigned int i = 0; i < sizeof (opt_name_mapping) / sizeof (opt_name_mapping[0]); ++i)
|
||||
if (optname == opt_name_mapping[i][1])
|
||||
nat_optname = opt_name_mapping[i][0];
|
||||
for (auto& map : opt_name_mapping)
|
||||
if (optname == map[1])
|
||||
nat_optname = map[0];
|
||||
|
||||
if (nat_level == -1 || nat_optname == -1)
|
||||
{
|
||||
@@ -924,11 +924,11 @@ bool CWII_IPC_HLE_Device_net_ip_top::IOCtl(u32 _CommandAddress)
|
||||
// Translate Wii to native events
|
||||
int unhandled_events = events;
|
||||
ufds[i].events = 0;
|
||||
for (unsigned int j = 0; j < sizeof (mapping) / sizeof (mapping[0]); ++j)
|
||||
for (auto& map : mapping)
|
||||
{
|
||||
if (events & mapping[j][1])
|
||||
ufds[i].events |= mapping[j][0];
|
||||
unhandled_events &= ~mapping[j][1];
|
||||
if (events & map[1])
|
||||
ufds[i].events |= map[0];
|
||||
unhandled_events &= ~map[1];
|
||||
}
|
||||
|
||||
DEBUG_LOG(WII_IPC_NET, "IOCTL_SO_POLL(%d) "
|
||||
@@ -949,10 +949,10 @@ bool CWII_IPC_HLE_Device_net_ip_top::IOCtl(u32 _CommandAddress)
|
||||
|
||||
// Translate native to Wii events
|
||||
int revents = 0;
|
||||
for (unsigned int j = 0; j < sizeof (mapping) / sizeof (mapping[0]); ++j)
|
||||
for (auto& map : mapping)
|
||||
{
|
||||
if (ufds[i].revents & mapping[j][0])
|
||||
revents |= mapping[j][1];
|
||||
if (ufds[i].revents & map[0])
|
||||
revents |= map[1];
|
||||
}
|
||||
|
||||
// No need to change fd or events as they are input only.
|
||||
|
||||
@@ -436,12 +436,12 @@ u32 CWII_IPC_HLE_Device_usb_oh1_57e_305::Update()
|
||||
// Create ACL connection
|
||||
if (m_HCIEndpoint.IsValid() && (m_ScanEnable & HCI_PAGE_SCAN_ENABLE))
|
||||
{
|
||||
for (unsigned int i = 0; i < m_WiiMotes.size(); i++)
|
||||
for (auto& wiimote : m_WiiMotes)
|
||||
{
|
||||
if (m_WiiMotes[i].EventPagingChanged(m_ScanEnable))
|
||||
if (wiimote.EventPagingChanged(m_ScanEnable))
|
||||
{
|
||||
Host_SetWiiMoteConnectionState(1);
|
||||
SendEventRequestConnection(m_WiiMotes[i]);
|
||||
SendEventRequestConnection(wiimote);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -449,9 +449,9 @@ u32 CWII_IPC_HLE_Device_usb_oh1_57e_305::Update()
|
||||
// Link channels when connected
|
||||
if (m_ACLEndpoint.IsValid())
|
||||
{
|
||||
for (unsigned int i = 0; i < m_WiiMotes.size(); i++)
|
||||
for (auto& wiimote : m_WiiMotes)
|
||||
{
|
||||
if (m_WiiMotes[i].LinkChannel())
|
||||
if (wiimote.LinkChannel())
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1818,16 +1818,16 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandVendorSpecific_FC4C(u8* _Input,
|
||||
//
|
||||
CWII_IPC_HLE_WiiMote* CWII_IPC_HLE_Device_usb_oh1_57e_305::AccessWiiMote(const bdaddr_t& _rAddr)
|
||||
{
|
||||
for (size_t i=0; i<m_WiiMotes.size(); i++)
|
||||
for (auto& wiimote : m_WiiMotes)
|
||||
{
|
||||
const bdaddr_t& BD = m_WiiMotes[i].GetBD();
|
||||
const bdaddr_t& BD = wiimote.GetBD();
|
||||
if ((_rAddr.b[0] == BD.b[0]) &&
|
||||
(_rAddr.b[1] == BD.b[1]) &&
|
||||
(_rAddr.b[2] == BD.b[2]) &&
|
||||
(_rAddr.b[3] == BD.b[3]) &&
|
||||
(_rAddr.b[4] == BD.b[4]) &&
|
||||
(_rAddr.b[5] == BD.b[5]))
|
||||
return &m_WiiMotes[i];
|
||||
return &wiimote;
|
||||
}
|
||||
|
||||
ERROR_LOG(WII_IPC_WIIMOTE,"Can't find WiiMote by bd: %02x:%02x:%02x:%02x:%02x:%02x",
|
||||
@@ -1837,10 +1837,10 @@ CWII_IPC_HLE_WiiMote* CWII_IPC_HLE_Device_usb_oh1_57e_305::AccessWiiMote(const b
|
||||
|
||||
CWII_IPC_HLE_WiiMote* CWII_IPC_HLE_Device_usb_oh1_57e_305::AccessWiiMote(u16 _ConnectionHandle)
|
||||
{
|
||||
for (size_t i=0; i<m_WiiMotes.size(); i++)
|
||||
for (auto& wiimote : m_WiiMotes)
|
||||
{
|
||||
if (m_WiiMotes[i].GetConnectionHandle() == _ConnectionHandle)
|
||||
return &m_WiiMotes[i];
|
||||
if (wiimote.GetConnectionHandle() == _ConnectionHandle)
|
||||
return &wiimote;
|
||||
}
|
||||
|
||||
ERROR_LOG(WII_IPC_WIIMOTE, "Can't find WiiMote by connection handle %02x", _ConnectionHandle);
|
||||
|
||||
@@ -28,6 +28,7 @@ bool CWII_IPC_HLE_Device_usb_kbd::Open(u32 _CommandAddress, u32 _Mode)
|
||||
|
||||
for(int i = 0; i < 256; i++)
|
||||
m_OldKeyBuffer[i] = false;
|
||||
|
||||
m_OldModifiers = 0x00;
|
||||
|
||||
//m_MessageQueue.push(SMessageData(MSG_KBD_CONNECT, 0, NULL));
|
||||
|
||||
@@ -602,9 +602,9 @@ void WiiSockMan::Update()
|
||||
|
||||
if (ret >= 0)
|
||||
{
|
||||
for (auto it = WiiSockets.begin(); it != WiiSockets.end(); ++it)
|
||||
for (auto& pair : WiiSockets)
|
||||
{
|
||||
WiiSocket& sock = it->second;
|
||||
WiiSocket& sock = pair.second;
|
||||
sock.update(
|
||||
FD_ISSET(sock.fd, &read_fds) != 0,
|
||||
FD_ISSET(sock.fd, &write_fds) != 0,
|
||||
@@ -614,9 +614,9 @@ void WiiSockMan::Update()
|
||||
}
|
||||
else
|
||||
{
|
||||
for (auto it = WiiSockets.begin(); it != WiiSockets.end(); ++it)
|
||||
for (auto& elem : WiiSockets)
|
||||
{
|
||||
it->second.update(false, false, false);
|
||||
elem.second.update(false, false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,8 +176,8 @@ void Init()
|
||||
if (!tmpHeader.bFromSaveState || !IsPlayingInput())
|
||||
Core::SetStateFileName("");
|
||||
|
||||
for (int i = 0; i < 8; ++i)
|
||||
g_InputDisplay[i].clear();
|
||||
for (auto& disp : g_InputDisplay)
|
||||
disp.clear();
|
||||
|
||||
if (!IsPlayingInput() && !IsRecordingInput())
|
||||
{
|
||||
|
||||
@@ -54,9 +54,8 @@ void LoadPatchSection(const char *section, std::vector<Patch> &patches,
|
||||
std::vector<std::string> enabledLines;
|
||||
std::set<std::string> enabledNames;
|
||||
localIni.GetLines(enabledSectionName.c_str(), enabledLines);
|
||||
for (auto iter = enabledLines.begin(); iter != enabledLines.end(); ++iter)
|
||||
for (auto& line : enabledLines)
|
||||
{
|
||||
const std::string& line = *iter;
|
||||
if (line.size() != 0 && line[0] == '$')
|
||||
{
|
||||
std::string name = line.substr(1, line.size() - 1);
|
||||
@@ -72,10 +71,8 @@ void LoadPatchSection(const char *section, std::vector<Patch> &patches,
|
||||
Patch currentPatch;
|
||||
inis[i]->GetLines(section, lines);
|
||||
|
||||
for (auto iter = lines.begin(); iter != lines.end(); ++iter)
|
||||
for (auto line : lines)
|
||||
{
|
||||
std::string line = *iter;
|
||||
|
||||
if (line.size() == 0)
|
||||
continue;
|
||||
|
||||
@@ -187,11 +184,11 @@ void LoadPatches()
|
||||
|
||||
void ApplyPatches(const std::vector<Patch> &patches)
|
||||
{
|
||||
for (std::vector<Patch>::const_iterator iter = patches.begin(); iter != patches.end(); ++iter)
|
||||
for (const auto& patch : patches)
|
||||
{
|
||||
if (iter->active)
|
||||
if (patch.active)
|
||||
{
|
||||
for (std::vector<PatchEntry>::const_iterator iter2 = iter->entries.begin(); iter2 != iter->entries.end(); ++iter2)
|
||||
for (std::vector<PatchEntry>::const_iterator iter2 = patch.entries.begin(); iter2 != patch.entries.end(); ++iter2)
|
||||
{
|
||||
u32 addr = iter2->address;
|
||||
u32 value = iter2->value;
|
||||
|
||||
@@ -382,112 +382,112 @@ void InitTables()
|
||||
m_infoTable63[i] = 0;
|
||||
}
|
||||
|
||||
for (int i = 0; i < (int)(sizeof(primarytable) / sizeof(GekkoOPTemplate)); i++)
|
||||
for (auto& tpl : primarytable)
|
||||
{
|
||||
Interpreter::m_opTable[primarytable[i].opcode] = primarytable[i].Inst;
|
||||
m_infoTable[primarytable[i].opcode] = &primarytable[i].opinfo;
|
||||
Interpreter::m_opTable[tpl.opcode] = tpl.Inst;
|
||||
m_infoTable[tpl.opcode] = &tpl.opinfo;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 32; i++)
|
||||
{
|
||||
int fill = i << 5;
|
||||
for (int j = 0; j < (int)(sizeof(table4_2) / sizeof(GekkoOPTemplate)); j++)
|
||||
for (auto& tpl : table4_2)
|
||||
{
|
||||
int op = fill+table4_2[j].opcode;
|
||||
Interpreter::m_opTable4[op] = table4_2[j].Inst;
|
||||
m_infoTable4[op] = &table4_2[j].opinfo;
|
||||
int op = fill+tpl.opcode;
|
||||
Interpreter::m_opTable4[op] = tpl.Inst;
|
||||
m_infoTable4[op] = &tpl.opinfo;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 16; i++)
|
||||
{
|
||||
int fill = i << 6;
|
||||
for (int j = 0; j < (int)(sizeof(table4_3) / sizeof(GekkoOPTemplate)); j++)
|
||||
for (auto& tpl : table4_3)
|
||||
{
|
||||
int op = fill+table4_3[j].opcode;
|
||||
Interpreter::m_opTable4[op] = table4_3[j].Inst;
|
||||
m_infoTable4[op] = &table4_3[j].opinfo;
|
||||
int op = fill+tpl.opcode;
|
||||
Interpreter::m_opTable4[op] = tpl.Inst;
|
||||
m_infoTable4[op] = &tpl.opinfo;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < (int)(sizeof(table4) / sizeof(GekkoOPTemplate)); i++)
|
||||
for (auto& tpl : table4)
|
||||
{
|
||||
int op = table4[i].opcode;
|
||||
Interpreter::m_opTable4[op] = table4[i].Inst;
|
||||
m_infoTable4[op] = &table4[i].opinfo;
|
||||
int op = tpl.opcode;
|
||||
Interpreter::m_opTable4[op] = tpl.Inst;
|
||||
m_infoTable4[op] = &tpl.opinfo;
|
||||
}
|
||||
|
||||
for (int i = 0; i < (int)(sizeof(table31) / sizeof(GekkoOPTemplate)); i++)
|
||||
for (auto& tpl : table31)
|
||||
{
|
||||
int op = table31[i].opcode;
|
||||
Interpreter::m_opTable31[op] = table31[i].Inst;
|
||||
m_infoTable31[op] = &table31[i].opinfo;
|
||||
int op = tpl.opcode;
|
||||
Interpreter::m_opTable31[op] = tpl.Inst;
|
||||
m_infoTable31[op] = &tpl.opinfo;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 1; i++)
|
||||
{
|
||||
int fill = i << 9;
|
||||
for (int j = 0; j < (int)(sizeof(table31_2) / sizeof(GekkoOPTemplate)); j++)
|
||||
for (auto& tpl : table31_2)
|
||||
{
|
||||
int op = fill + table31_2[j].opcode;
|
||||
Interpreter::m_opTable31[op] = table31_2[j].Inst;
|
||||
m_infoTable31[op] = &table31_2[j].opinfo;
|
||||
int op = fill + tpl.opcode;
|
||||
Interpreter::m_opTable31[op] = tpl.Inst;
|
||||
m_infoTable31[op] = &tpl.opinfo;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < (int)(sizeof(table19) / sizeof(GekkoOPTemplate)); i++)
|
||||
for (auto& tpl : table19)
|
||||
{
|
||||
int op = table19[i].opcode;
|
||||
Interpreter::m_opTable19[op] = table19[i].Inst;
|
||||
m_infoTable19[op] = &table19[i].opinfo;
|
||||
int op = tpl.opcode;
|
||||
Interpreter::m_opTable19[op] = tpl.Inst;
|
||||
m_infoTable19[op] = &tpl.opinfo;
|
||||
}
|
||||
|
||||
for (int i = 0; i < (int)(sizeof(table59) / sizeof(GekkoOPTemplate)); i++)
|
||||
for (auto& tpl : table59)
|
||||
{
|
||||
int op = table59[i].opcode;
|
||||
Interpreter::m_opTable59[op] = table59[i].Inst;
|
||||
m_infoTable59[op] = &table59[i].opinfo;
|
||||
int op = tpl.opcode;
|
||||
Interpreter::m_opTable59[op] = tpl.Inst;
|
||||
m_infoTable59[op] = &tpl.opinfo;
|
||||
}
|
||||
|
||||
for (int i = 0; i < (int)(sizeof(table63) / sizeof(GekkoOPTemplate)); i++)
|
||||
for (auto& tpl : table63)
|
||||
{
|
||||
int op = table63[i].opcode;
|
||||
Interpreter::m_opTable63[op] = table63[i].Inst;
|
||||
m_infoTable63[op] = &table63[i].opinfo;
|
||||
int op = tpl.opcode;
|
||||
Interpreter::m_opTable63[op] = tpl.Inst;
|
||||
m_infoTable63[op] = &tpl.opinfo;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 32; i++)
|
||||
{
|
||||
int fill = i << 5;
|
||||
for (int j = 0; j < (int)(sizeof(table63_2) / sizeof(GekkoOPTemplate)); j++)
|
||||
for (auto& tpl : table63_2)
|
||||
{
|
||||
int op = fill + table63_2[j].opcode;
|
||||
Interpreter::m_opTable63[op] = table63_2[j].Inst;
|
||||
m_infoTable63[op] = &table63_2[j].opinfo;
|
||||
int op = fill + tpl.opcode;
|
||||
Interpreter::m_opTable63[op] = tpl.Inst;
|
||||
m_infoTable63[op] = &tpl.opinfo;
|
||||
}
|
||||
}
|
||||
|
||||
m_numInstructions = 0;
|
||||
for (int i = 0; i < (int)(sizeof(primarytable) / sizeof(GekkoOPTemplate)); i++)
|
||||
m_allInstructions[m_numInstructions++] = &primarytable[i].opinfo;
|
||||
for (int i = 0; i < (int)(sizeof(table4_2) / sizeof(GekkoOPTemplate)); i++)
|
||||
m_allInstructions[m_numInstructions++] = &table4_2[i].opinfo;
|
||||
for (int i = 0; i < (int)(sizeof(table4_3) / sizeof(GekkoOPTemplate)); i++)
|
||||
m_allInstructions[m_numInstructions++] = &table4_3[i].opinfo;
|
||||
for (int i = 0; i < (int)(sizeof(table4) / sizeof(GekkoOPTemplate)); i++)
|
||||
m_allInstructions[m_numInstructions++] = &table4[i].opinfo;
|
||||
for (int i = 0; i < (int)(sizeof(table31) / sizeof(GekkoOPTemplate)); i++)
|
||||
m_allInstructions[m_numInstructions++] = &table31[i].opinfo;
|
||||
for (int i = 0; i < (int)(sizeof(table31_2) / sizeof(GekkoOPTemplate)); i++)
|
||||
m_allInstructions[m_numInstructions++] = &table31_2[i].opinfo;
|
||||
for (int i = 0; i < (int)(sizeof(table19) / sizeof(GekkoOPTemplate)); i++)
|
||||
m_allInstructions[m_numInstructions++] = &table19[i].opinfo;
|
||||
for (int i = 0; i < (int)(sizeof(table59) / sizeof(GekkoOPTemplate)); i++)
|
||||
m_allInstructions[m_numInstructions++] = &table59[i].opinfo;
|
||||
for (int i = 0; i < (int)(sizeof(table63) / sizeof(GekkoOPTemplate)); i++)
|
||||
m_allInstructions[m_numInstructions++] = &table63[i].opinfo;
|
||||
for (int i = 0; i < (int)(sizeof(table63_2) / sizeof(GekkoOPTemplate)); i++)
|
||||
m_allInstructions[m_numInstructions++] = &table63_2[i].opinfo;
|
||||
for (auto& tpl : primarytable)
|
||||
m_allInstructions[m_numInstructions++] = &tpl.opinfo;
|
||||
for (auto& tpl : table4_2)
|
||||
m_allInstructions[m_numInstructions++] = &tpl.opinfo;
|
||||
for (auto& tpl : table4_3)
|
||||
m_allInstructions[m_numInstructions++] = &tpl.opinfo;
|
||||
for (auto& tpl : table4)
|
||||
m_allInstructions[m_numInstructions++] = &tpl.opinfo;
|
||||
for (auto& tpl : table31)
|
||||
m_allInstructions[m_numInstructions++] = &tpl.opinfo;
|
||||
for (auto& tpl : table31_2)
|
||||
m_allInstructions[m_numInstructions++] = &tpl.opinfo;
|
||||
for (auto& tpl : table19)
|
||||
m_allInstructions[m_numInstructions++] = &tpl.opinfo;
|
||||
for (auto& tpl : table59)
|
||||
m_allInstructions[m_numInstructions++] = &tpl.opinfo;
|
||||
for (auto& tpl : table63)
|
||||
m_allInstructions[m_numInstructions++] = &tpl.opinfo;
|
||||
for (auto& tpl : table63_2)
|
||||
m_allInstructions[m_numInstructions++] = &tpl.opinfo;
|
||||
if (m_numInstructions >= 512) {
|
||||
PanicAlert("m_allInstructions underdimensioned");
|
||||
}
|
||||
|
||||
@@ -394,9 +394,9 @@ void InitTables()
|
||||
return;
|
||||
|
||||
//clear
|
||||
for (int i = 0; i < 32; i++)
|
||||
for (auto& tpl : dynaOpTable59)
|
||||
{
|
||||
dynaOpTable59[i] = &Jit64::unknown_instruction;
|
||||
tpl = &Jit64::unknown_instruction;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 1024; i++)
|
||||
@@ -407,78 +407,78 @@ void InitTables()
|
||||
dynaOpTable63[i] = &Jit64::unknown_instruction;
|
||||
}
|
||||
|
||||
for (int i = 0; i < (int)(sizeof(primarytable) / sizeof(GekkoOPTemplate)); i++)
|
||||
for (auto& tpl : primarytable)
|
||||
{
|
||||
dynaOpTable[primarytable[i].opcode] = primarytable[i].Inst;
|
||||
dynaOpTable[tpl.opcode] = tpl.Inst;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 32; i++)
|
||||
{
|
||||
int fill = i << 5;
|
||||
for (int j = 0; j < (int)(sizeof(table4_2) / sizeof(GekkoOPTemplate)); j++)
|
||||
for (auto& tpl : table4_2)
|
||||
{
|
||||
int op = fill+table4_2[j].opcode;
|
||||
dynaOpTable4[op] = table4_2[j].Inst;
|
||||
int op = fill+tpl.opcode;
|
||||
dynaOpTable4[op] = tpl.Inst;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 16; i++)
|
||||
{
|
||||
int fill = i << 6;
|
||||
for (int j = 0; j < (int)(sizeof(table4_3) / sizeof(GekkoOPTemplate)); j++)
|
||||
for (auto& tpl : table4_3)
|
||||
{
|
||||
int op = fill+table4_3[j].opcode;
|
||||
dynaOpTable4[op] = table4_3[j].Inst;
|
||||
int op = fill+tpl.opcode;
|
||||
dynaOpTable4[op] = tpl.Inst;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < (int)(sizeof(table4) / sizeof(GekkoOPTemplate)); i++)
|
||||
for (auto& tpl : table4)
|
||||
{
|
||||
int op = table4[i].opcode;
|
||||
dynaOpTable4[op] = table4[i].Inst;
|
||||
int op = tpl.opcode;
|
||||
dynaOpTable4[op] = tpl.Inst;
|
||||
}
|
||||
|
||||
for (int i = 0; i < (int)(sizeof(table31) / sizeof(GekkoOPTemplate)); i++)
|
||||
for (auto& tpl : table31)
|
||||
{
|
||||
int op = table31[i].opcode;
|
||||
dynaOpTable31[op] = table31[i].Inst;
|
||||
int op = tpl.opcode;
|
||||
dynaOpTable31[op] = tpl.Inst;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 1; i++)
|
||||
{
|
||||
int fill = i << 9;
|
||||
for (int j = 0; j < (int)(sizeof(table31_2) / sizeof(GekkoOPTemplate)); j++)
|
||||
for (auto& tpl : table31_2)
|
||||
{
|
||||
int op = fill + table31_2[j].opcode;
|
||||
dynaOpTable31[op] = table31_2[j].Inst;
|
||||
int op = fill + tpl.opcode;
|
||||
dynaOpTable31[op] = tpl.Inst;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < (int)(sizeof(table19) / sizeof(GekkoOPTemplate)); i++)
|
||||
for (auto& tpl : table19)
|
||||
{
|
||||
int op = table19[i].opcode;
|
||||
dynaOpTable19[op] = table19[i].Inst;
|
||||
int op = tpl.opcode;
|
||||
dynaOpTable19[op] = tpl.Inst;
|
||||
}
|
||||
|
||||
for (int i = 0; i < (int)(sizeof(table59) / sizeof(GekkoOPTemplate)); i++)
|
||||
for (auto& tpl : table59)
|
||||
{
|
||||
int op = table59[i].opcode;
|
||||
dynaOpTable59[op] = table59[i].Inst;
|
||||
int op = tpl.opcode;
|
||||
dynaOpTable59[op] = tpl.Inst;
|
||||
}
|
||||
|
||||
for (int i = 0; i < (int)(sizeof(table63) / sizeof(GekkoOPTemplate)); i++)
|
||||
for (auto& tpl : table63)
|
||||
{
|
||||
int op = table63[i].opcode;
|
||||
dynaOpTable63[op] = table63[i].Inst;
|
||||
int op = tpl.opcode;
|
||||
dynaOpTable63[op] = tpl.Inst;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 32; i++)
|
||||
{
|
||||
int fill = i << 5;
|
||||
for (int j = 0; j < (int)(sizeof(table63_2) / sizeof(GekkoOPTemplate)); j++)
|
||||
for (auto& tpl : table63_2)
|
||||
{
|
||||
int op = fill + table63_2[j].opcode;
|
||||
dynaOpTable63[op] = table63_2[j].Inst;
|
||||
int op = fill + tpl.opcode;
|
||||
dynaOpTable63[op] = tpl.Inst;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -75,14 +75,14 @@ void RegCache::LockX(int x1, int x2, int x3, int x4)
|
||||
|
||||
void RegCache::UnlockAll()
|
||||
{
|
||||
for (int i = 0; i < 32; i++)
|
||||
locks[i] = false;
|
||||
for (auto& lock : locks)
|
||||
lock = false;
|
||||
}
|
||||
|
||||
void RegCache::UnlockAllX()
|
||||
{
|
||||
for (int i = 0; i < NUMXREGS; i++)
|
||||
xlocks[i] = false;
|
||||
for (auto& xlock : xlocks)
|
||||
xlock = false;
|
||||
}
|
||||
|
||||
X64Reg RegCache::GetFreeXReg()
|
||||
|
||||
@@ -163,9 +163,9 @@ static const int FRegAllocSize = sizeof(FRegAllocOrder) / sizeof(X64Reg);
|
||||
#endif
|
||||
|
||||
static X64Reg regFindFreeReg(RegInfo& RI) {
|
||||
for (int i = 0; i < RegAllocSize; i++)
|
||||
if (RI.regs[RegAllocOrder[i]] == 0)
|
||||
return RegAllocOrder[i];
|
||||
for (auto& reg : RegAllocOrder)
|
||||
if (RI.regs[reg] == 0)
|
||||
return reg;
|
||||
|
||||
int bestIndex = -1;
|
||||
InstLoc bestEnd = 0;
|
||||
@@ -184,9 +184,9 @@ static X64Reg regFindFreeReg(RegInfo& RI) {
|
||||
}
|
||||
|
||||
static X64Reg fregFindFreeReg(RegInfo& RI) {
|
||||
for (int i = 0; i < FRegAllocSize; i++)
|
||||
if (RI.fregs[FRegAllocOrder[i]] == 0)
|
||||
return FRegAllocOrder[i];
|
||||
for (auto& reg : FRegAllocOrder)
|
||||
if (RI.fregs[reg] == 0)
|
||||
return reg;
|
||||
|
||||
int bestIndex = -1;
|
||||
InstLoc bestEnd = 0;
|
||||
@@ -205,9 +205,9 @@ static X64Reg fregFindFreeReg(RegInfo& RI) {
|
||||
}
|
||||
|
||||
static OpArg regLocForInst(RegInfo& RI, InstLoc I) {
|
||||
for (int i = 0; i < RegAllocSize; i++)
|
||||
if (RI.regs[RegAllocOrder[i]] == I)
|
||||
return R(RegAllocOrder[i]);
|
||||
for (auto& reg : RegAllocOrder)
|
||||
if (RI.regs[reg] == I)
|
||||
return R(reg);
|
||||
|
||||
if (regGetSpill(RI, I) == 0)
|
||||
PanicAlert("Retrieving unknown spill slot?!");
|
||||
@@ -215,9 +215,9 @@ static OpArg regLocForInst(RegInfo& RI, InstLoc I) {
|
||||
}
|
||||
|
||||
static OpArg fregLocForInst(RegInfo& RI, InstLoc I) {
|
||||
for (int i = 0; i < FRegAllocSize; i++)
|
||||
if (RI.fregs[FRegAllocOrder[i]] == I)
|
||||
return R(FRegAllocOrder[i]);
|
||||
for (auto& reg : FRegAllocOrder)
|
||||
if (RI.fregs[reg] == I)
|
||||
return R(reg);
|
||||
|
||||
if (fregGetSpill(RI, I) == 0)
|
||||
PanicAlert("Retrieving unknown spill slot?!");
|
||||
@@ -225,15 +225,15 @@ static OpArg fregLocForInst(RegInfo& RI, InstLoc I) {
|
||||
}
|
||||
|
||||
static void regClearInst(RegInfo& RI, InstLoc I) {
|
||||
for (int i = 0; i < RegAllocSize; i++)
|
||||
if (RI.regs[RegAllocOrder[i]] == I)
|
||||
RI.regs[RegAllocOrder[i]] = 0;
|
||||
for (auto& reg : RegAllocOrder)
|
||||
if (RI.regs[reg] == I)
|
||||
RI.regs[reg] = 0;
|
||||
}
|
||||
|
||||
static void fregClearInst(RegInfo& RI, InstLoc I) {
|
||||
for (int i = 0; i < FRegAllocSize; i++)
|
||||
if (RI.fregs[FRegAllocOrder[i]] == I)
|
||||
RI.fregs[FRegAllocOrder[i]] = 0;
|
||||
for (auto& reg : FRegAllocOrder)
|
||||
if (RI.fregs[reg] == I)
|
||||
RI.fregs[reg] = 0;
|
||||
}
|
||||
|
||||
static X64Reg regEnsureInReg(RegInfo& RI, InstLoc I) {
|
||||
|
||||
@@ -211,11 +211,11 @@ namespace JitILProfiler
|
||||
File::IOFile file(buffer, "w");
|
||||
setvbuf(file.GetHandle(), NULL, _IOFBF, 1024 * 1024);
|
||||
fprintf(file.GetHandle(), "code hash,total elapsed,number of calls,elapsed per call\n");
|
||||
for (std::vector<Block>::iterator it = blocks.begin(), itEnd = blocks.end(); it != itEnd; ++it)
|
||||
for (auto& block : blocks)
|
||||
{
|
||||
const u64 codeHash = it->codeHash;
|
||||
const u64 totalElapsed = it->totalElapsed;
|
||||
const u64 numberOfCalls = it->numberOfCalls;
|
||||
const u64 codeHash = block.codeHash;
|
||||
const u64 totalElapsed = block.totalElapsed;
|
||||
const u64 numberOfCalls = block.numberOfCalls;
|
||||
const double elapsedPerCall = totalElapsed / (double)numberOfCalls;
|
||||
fprintf(file.GetHandle(), "%016llx,%lld,%lld,%f\n", codeHash, totalElapsed, numberOfCalls, elapsedPerCall);
|
||||
}
|
||||
|
||||
@@ -397,9 +397,9 @@ void InitTables()
|
||||
return;
|
||||
|
||||
//clear
|
||||
for (int i = 0; i < 32; i++)
|
||||
for (auto& tpl : dynaOpTable59)
|
||||
{
|
||||
dynaOpTable59[i] = &JitIL::unknown_instruction;
|
||||
tpl = &JitIL::unknown_instruction;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 1024; i++)
|
||||
@@ -410,78 +410,78 @@ void InitTables()
|
||||
dynaOpTable63[i] = &JitIL::unknown_instruction;
|
||||
}
|
||||
|
||||
for (int i = 0; i < (int)(sizeof(primarytable) / sizeof(GekkoOPTemplate)); i++)
|
||||
for (auto& tpl : primarytable)
|
||||
{
|
||||
dynaOpTable[primarytable[i].opcode] = primarytable[i].Inst;
|
||||
dynaOpTable[tpl.opcode] = tpl.Inst;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 32; i++)
|
||||
{
|
||||
int fill = i << 5;
|
||||
for (int j = 0; j < (int)(sizeof(table4_2) / sizeof(GekkoOPTemplate)); j++)
|
||||
for (auto& tpl : table4_2)
|
||||
{
|
||||
int op = fill+table4_2[j].opcode;
|
||||
dynaOpTable4[op] = table4_2[j].Inst;
|
||||
int op = fill+tpl.opcode;
|
||||
dynaOpTable4[op] = tpl.Inst;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 16; i++)
|
||||
{
|
||||
int fill = i << 6;
|
||||
for (int j = 0; j < (int)(sizeof(table4_3) / sizeof(GekkoOPTemplate)); j++)
|
||||
for (auto& tpl : table4_3)
|
||||
{
|
||||
int op = fill+table4_3[j].opcode;
|
||||
dynaOpTable4[op] = table4_3[j].Inst;
|
||||
int op = fill+tpl.opcode;
|
||||
dynaOpTable4[op] = tpl.Inst;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < (int)(sizeof(table4) / sizeof(GekkoOPTemplate)); i++)
|
||||
for (auto& tpl : table4)
|
||||
{
|
||||
int op = table4[i].opcode;
|
||||
dynaOpTable4[op] = table4[i].Inst;
|
||||
int op = tpl.opcode;
|
||||
dynaOpTable4[op] = tpl.Inst;
|
||||
}
|
||||
|
||||
for (int i = 0; i < (int)(sizeof(table31) / sizeof(GekkoOPTemplate)); i++)
|
||||
for (auto& tpl : table31)
|
||||
{
|
||||
int op = table31[i].opcode;
|
||||
dynaOpTable31[op] = table31[i].Inst;
|
||||
int op = tpl.opcode;
|
||||
dynaOpTable31[op] = tpl.Inst;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 1; i++)
|
||||
{
|
||||
int fill = i << 9;
|
||||
for (int j = 0; j < (int)(sizeof(table31_2) / sizeof(GekkoOPTemplate)); j++)
|
||||
for (auto& tpl : table31_2)
|
||||
{
|
||||
int op = fill + table31_2[j].opcode;
|
||||
dynaOpTable31[op] = table31_2[j].Inst;
|
||||
int op = fill + tpl.opcode;
|
||||
dynaOpTable31[op] = tpl.Inst;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < (int)(sizeof(table19) / sizeof(GekkoOPTemplate)); i++)
|
||||
for (auto& tpl : table19)
|
||||
{
|
||||
int op = table19[i].opcode;
|
||||
dynaOpTable19[op] = table19[i].Inst;
|
||||
int op = tpl.opcode;
|
||||
dynaOpTable19[op] = tpl.Inst;
|
||||
}
|
||||
|
||||
for (int i = 0; i < (int)(sizeof(table59) / sizeof(GekkoOPTemplate)); i++)
|
||||
for (auto& tpl : table59)
|
||||
{
|
||||
int op = table59[i].opcode;
|
||||
dynaOpTable59[op] = table59[i].Inst;
|
||||
int op = tpl.opcode;
|
||||
dynaOpTable59[op] = tpl.Inst;
|
||||
}
|
||||
|
||||
for (int i = 0; i < (int)(sizeof(table63) / sizeof(GekkoOPTemplate)); i++)
|
||||
for (auto& tpl : table63)
|
||||
{
|
||||
int op = table63[i].opcode;
|
||||
dynaOpTable63[op] = table63[i].Inst;
|
||||
int op = tpl.opcode;
|
||||
dynaOpTable63[op] = tpl.Inst;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 32; i++)
|
||||
{
|
||||
int fill = i << 5;
|
||||
for (int j = 0; j < (int)(sizeof(table63_2) / sizeof(GekkoOPTemplate)); j++)
|
||||
for (auto& tpl : table63_2)
|
||||
{
|
||||
int op = fill + table63_2[j].opcode;
|
||||
dynaOpTable63[op] = table63_2[j].Inst;
|
||||
int op = fill + tpl.opcode;
|
||||
dynaOpTable63[op] = tpl.Inst;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1124,14 +1124,14 @@ unsigned IRBuilder::getNumberOfOperands(InstLoc I) const {
|
||||
static unsigned ZeroOp[] = {LoadCR, LoadLink, LoadMSR, LoadGReg, LoadCTR, InterpreterBranch, LoadCarry, RFIExit, LoadFReg, LoadFRegDENToZero, LoadGQR, Int3, };
|
||||
static unsigned UOp[] = {StoreLink, BranchUncond, StoreCR, StoreMSR, StoreFPRF, StoreGReg, StoreCTR, Load8, Load16, Load32, SExt16, SExt8, Cntlzw, Not, StoreCarry, SystemCall, ShortIdleLoop, LoadSingle, LoadDouble, LoadPaired, StoreFReg, DupSingleToMReg, DupSingleToPacked, ExpandPackedToMReg, CompactMRegToPacked, FSNeg, FSRSqrt, FDNeg, FPDup0, FPDup1, FPNeg, DoubleToSingle, StoreGQR, StoreSRR, };
|
||||
static unsigned BiOp[] = {BranchCond, IdleBranch, And, Xor, Sub, Or, Add, Mul, Rol, Shl, Shrl, Sarl, ICmpEq, ICmpNe, ICmpUgt, ICmpUlt, ICmpSgt, ICmpSlt, ICmpSge, ICmpSle, Store8, Store16, Store32, ICmpCRSigned, ICmpCRUnsigned, InterpreterFallback, StoreSingle, StoreDouble, StorePaired, InsertDoubleInMReg, FSMul, FSAdd, FSSub, FDMul, FDAdd, FDSub, FPAdd, FPMul, FPSub, FPMerge00, FPMerge01, FPMerge10, FPMerge11, FDCmpCR, };
|
||||
for (size_t i = 0; i < sizeof(ZeroOp) / sizeof(ZeroOp[0]); ++i) {
|
||||
numberOfOperands[ZeroOp[i]] = 0;
|
||||
for (auto& op : ZeroOp) {
|
||||
numberOfOperands[op] = 0;
|
||||
}
|
||||
for (size_t i = 0; i < sizeof(UOp) / sizeof(UOp[0]); ++i) {
|
||||
numberOfOperands[UOp[i]] = 1;
|
||||
for (auto& op : UOp) {
|
||||
numberOfOperands[op] = 1;
|
||||
}
|
||||
for (size_t i = 0; i < sizeof(BiOp) / sizeof(BiOp[0]); ++i) {
|
||||
numberOfOperands[BiOp[i]] = 2;
|
||||
for (auto& op : BiOp) {
|
||||
numberOfOperands[op] = 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -162,22 +162,22 @@ namespace JitInterface
|
||||
return;
|
||||
}
|
||||
fprintf(f.GetHandle(), "origAddr\tblkName\tcost\ttimeCost\tpercent\ttimePercent\tOvAllinBlkTime(ms)\tblkCodeSize\n");
|
||||
for (unsigned int i = 0; i < stats.size(); i++)
|
||||
for (auto& stat : stats)
|
||||
{
|
||||
const JitBlock *block = jit->GetBlockCache()->GetBlock(stats[i].blockNum);
|
||||
const JitBlock *block = jit->GetBlockCache()->GetBlock(stat.blockNum);
|
||||
if (block)
|
||||
{
|
||||
std::string name = g_symbolDB.GetDescription(block->originalAddress);
|
||||
double percent = 100.0 * (double)stats[i].cost / (double)cost_sum;
|
||||
double percent = 100.0 * (double)stat.cost / (double)cost_sum;
|
||||
#ifdef _WIN32
|
||||
double timePercent = 100.0 * (double)block->ticCounter / (double)timecost_sum;
|
||||
fprintf(f.GetHandle(), "%08x\t%s\t%llu\t%llu\t%.2lf\t%llf\t%lf\t%i\n",
|
||||
block->originalAddress, name.c_str(), stats[i].cost,
|
||||
block->originalAddress, name.c_str(), stat.cost,
|
||||
block->ticCounter, percent, timePercent,
|
||||
(double)block->ticCounter*1000.0/(double)countsPerSec, block->codeSize);
|
||||
#else
|
||||
fprintf(f.GetHandle(), "%08x\t%s\t%llu\t???\t%.2lf\t???\t???\t%i\n",
|
||||
block->originalAddress, name.c_str(), stats[i].cost, percent, block->codeSize);
|
||||
block->originalAddress, name.c_str(), stat.cost, percent, block->codeSize);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,9 +196,8 @@ void AnalyzeFunction2(Symbol *func)
|
||||
u32 flags = func->flags;
|
||||
|
||||
bool nonleafcall = false;
|
||||
for (size_t i = 0; i < func->calls.size(); i++)
|
||||
for (auto c : func->calls)
|
||||
{
|
||||
SCall c = func->calls[i];
|
||||
Symbol *called_func = g_symbolDB.GetSymbolFromAddr(c.function);
|
||||
if (called_func && (called_func->flags & FFLAG_LEAF) == 0)
|
||||
{
|
||||
@@ -345,10 +344,9 @@ u32 Flatten(u32 address, int *realsize, BlockStats *st, BlockRegStats *gpa,
|
||||
if (it != inserted_asm_codes.end())
|
||||
{
|
||||
const std::vector<u32>& codes = it->second;
|
||||
for (std::vector<u32>::const_iterator itCur = codes.begin(),
|
||||
itEnd = codes.end(); itCur != itEnd; ++itCur)
|
||||
for (u32 c : codes)
|
||||
{
|
||||
cst1_instructions.push(*itCur);
|
||||
cst1_instructions.push(c);
|
||||
}
|
||||
inst = UGeckoInstruction(cst1_instructions.front());
|
||||
cst1_instructions.pop();
|
||||
@@ -648,9 +646,8 @@ void FindFunctionsAfterBLR(PPCSymbolDB *func_db)
|
||||
for (PPCSymbolDB::XFuncMap::iterator iter = func_db->GetIterator(); iter != func_db->End(); ++iter)
|
||||
funcAddrs.push_back(iter->second.address + iter->second.size);
|
||||
|
||||
for (vector<u32>::iterator iter = funcAddrs.begin(); iter != funcAddrs.end(); ++iter)
|
||||
for (auto location : funcAddrs)
|
||||
{
|
||||
u32 location = *iter;
|
||||
while (true)
|
||||
{
|
||||
if (PPCTables::IsValidInstruction(Memory::Read_Instruction(location)))
|
||||
|
||||
@@ -94,10 +94,10 @@ Symbol *PPCSymbolDB::GetSymbolFromAddr(u32 addr)
|
||||
}
|
||||
else
|
||||
{
|
||||
for (XFuncMap::iterator iter = functions.begin(); iter != functions.end(); ++iter)
|
||||
for (auto& p : functions)
|
||||
{
|
||||
if (addr >= iter->second.address && addr < iter->second.address + iter->second.size)
|
||||
return &iter->second;
|
||||
if (addr >= p.second.address && addr < p.second.address + p.second.size)
|
||||
return &p.second;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@@ -114,18 +114,18 @@ const char *PPCSymbolDB::GetDescription(u32 addr)
|
||||
|
||||
void PPCSymbolDB::FillInCallers()
|
||||
{
|
||||
for (XFuncMap::iterator iter = functions.begin(); iter != functions.end(); ++iter)
|
||||
for (auto& p : functions)
|
||||
{
|
||||
iter->second.callers.clear();
|
||||
p.second.callers.clear();
|
||||
}
|
||||
|
||||
for (XFuncMap::iterator iter = functions.begin(); iter != functions.end(); ++iter)
|
||||
{
|
||||
Symbol &f = iter->second;
|
||||
for (size_t i = 0; i < f.calls.size(); i++)
|
||||
for (auto& call : f.calls)
|
||||
{
|
||||
SCall NewCall(iter->first, f.calls[i].callAddress);
|
||||
u32 FunctionAddress = f.calls[i].function;
|
||||
SCall NewCall(iter->first, call.callAddress);
|
||||
u32 FunctionAddress = call.function;
|
||||
|
||||
XFuncMap::iterator FuncIterator = functions.find(FunctionAddress);
|
||||
if (FuncIterator != functions.end())
|
||||
|
||||
@@ -230,9 +230,9 @@ void LogCompiledInstructions()
|
||||
|
||||
#ifdef OPLOG
|
||||
f.Open(StringFromFormat("%s" OP_TO_LOG "_at.txt", File::GetUserPath(D_LOGS_IDX).c_str(), time), "w");
|
||||
for (size_t i = 0; i < rsplocations.size(); i++)
|
||||
for (auto& rsplocation : rsplocations)
|
||||
{
|
||||
fprintf(f.GetHandle(), OP_TO_LOG ": %08x\n", rsplocations[i]);
|
||||
fprintf(f.GetHandle(), OP_TO_LOG ": %08x\n", rsplocation);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -160,9 +160,9 @@ int GetEmptySlot(std::map<double, int> m)
|
||||
for (int i = 1; i <= (int)NUM_STATES; i++)
|
||||
{
|
||||
bool found = false;
|
||||
for (std::map<double, int>::iterator it = m.begin(); it != m.end(); it++)
|
||||
for (auto& p : m)
|
||||
{
|
||||
if (it->second == i)
|
||||
if (p.second == i)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user