mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
Clean up gcc/g++ compiler warnings that have accumulated.
This commit is contained in:
parent
43d673b576
commit
e85438cba0
@ -123,7 +123,6 @@ void OpenALStream::SoundLoop()
|
||||
{
|
||||
Common::SetCurrentThreadName("Audio thread - openal");
|
||||
|
||||
ALenum err;
|
||||
u32 ulFrequency = m_mixer->GetSampleRate();
|
||||
|
||||
memset(uiBuffers, 0, OAL_NUM_BUFFERS * sizeof(ALuint));
|
||||
@ -144,8 +143,8 @@ void OpenALStream::SoundLoop()
|
||||
// Set the default sound volume as saved in the config file.
|
||||
alSourcef(uiSource, AL_GAIN, fVolume);
|
||||
|
||||
err = alGetError();
|
||||
// TODO: Error handling
|
||||
//ALenum err = alGetError();
|
||||
|
||||
ALint iBuffersFilled = 0;
|
||||
ALint iBuffersProcessed = 0;
|
||||
|
@ -173,9 +173,7 @@ void CPUInfo::Detect()
|
||||
if (max_ex_fn >= 0x80000001) {
|
||||
// Check for more features.
|
||||
__cpuid(cpu_id, 0x80000001);
|
||||
bool cmp_legacy = false;
|
||||
if (cpu_id[2] & 1) bLAHFSAHF64 = true;
|
||||
if (cpu_id[2] & 2) cmp_legacy = true; //wtf is this?
|
||||
if ((cpu_id[3] >> 29) & 1) bLongMode = true;
|
||||
}
|
||||
|
||||
|
@ -31,12 +31,9 @@ bool DisassembleMov(const unsigned char *codePtr, InstructionInfo &info, int acc
|
||||
info.hasImmediate = false;
|
||||
info.isMemoryWrite = false;
|
||||
|
||||
int addressSize = 8;
|
||||
u8 modRMbyte = 0;
|
||||
u8 sibByte = 0;
|
||||
bool hasModRM = false;
|
||||
bool hasSIBbyte = false;
|
||||
bool hasDisplacement = false;
|
||||
|
||||
int displacementSize = 0;
|
||||
|
||||
@ -47,7 +44,6 @@ bool DisassembleMov(const unsigned char *codePtr, InstructionInfo &info, int acc
|
||||
}
|
||||
else if (*codePtr == 0x67)
|
||||
{
|
||||
addressSize = 4;
|
||||
codePtr++;
|
||||
}
|
||||
|
||||
@ -113,7 +109,6 @@ bool DisassembleMov(const unsigned char *codePtr, InstructionInfo &info, int acc
|
||||
info.otherReg = (sibByte & 7);
|
||||
if (rex & 2) info.scaledReg += 8;
|
||||
if (rex & 1) info.otherReg += 8;
|
||||
hasSIBbyte = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -122,7 +117,6 @@ bool DisassembleMov(const unsigned char *codePtr, InstructionInfo &info, int acc
|
||||
}
|
||||
if (mrm.mod == 1 || mrm.mod == 2)
|
||||
{
|
||||
hasDisplacement = true;
|
||||
if (mrm.mod == 1)
|
||||
displacementSize = 1;
|
||||
else
|
||||
|
@ -870,7 +870,6 @@ void XEmitter::BTC(int bits, OpArg dest, OpArg index) {WriteBitTest(bits, dest,
|
||||
//shift can be either imm8 or cl
|
||||
void XEmitter::SHRD(int bits, OpArg dest, OpArg src, OpArg shift)
|
||||
{
|
||||
bool writeImm = false;
|
||||
if (dest.IsImm())
|
||||
{
|
||||
_assert_msg_(DYNA_REC, 0, "SHRD - can't use imms as destination");
|
||||
@ -901,7 +900,6 @@ void XEmitter::SHRD(int bits, OpArg dest, OpArg src, OpArg shift)
|
||||
|
||||
void XEmitter::SHLD(int bits, OpArg dest, OpArg src, OpArg shift)
|
||||
{
|
||||
bool writeImm = false;
|
||||
if (dest.IsImm())
|
||||
{
|
||||
_assert_msg_(DYNA_REC, 0, "SHLD - can't use imms as destination");
|
||||
|
@ -285,7 +285,6 @@ bool RunCode(const ARCode &arcode)
|
||||
// used for conditional codes
|
||||
int skip_count = 0;
|
||||
|
||||
u32 addr_last = 0;
|
||||
u32 val_last = 0;
|
||||
|
||||
current_code = &arcode;
|
||||
@ -394,7 +393,6 @@ bool RunCode(const ARCode &arcode)
|
||||
{
|
||||
LogInfo("ZCode: Memory Copy");
|
||||
doMemoryCopy = true;
|
||||
addr_last = addr;
|
||||
val_last = data;
|
||||
}
|
||||
else
|
||||
|
@ -119,7 +119,7 @@ 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 (int i = 0; i < event_types.size(); ++i)
|
||||
for (unsigned int i = 0; i < event_types.size(); ++i)
|
||||
{
|
||||
if (!strcmp(name, event_types[i].name))
|
||||
{
|
||||
@ -188,7 +188,7 @@ void EventDoState(PointerWrap &p, BaseEvent* ev)
|
||||
if (p.GetMode() == PointerWrap::MODE_READ)
|
||||
{
|
||||
bool foundMatch = false;
|
||||
for (int i = 0; i < event_types.size(); ++i)
|
||||
for (unsigned int i = 0; i < event_types.size(); ++i)
|
||||
{
|
||||
if (!strcmp(name.c_str(), event_types[i].name))
|
||||
{
|
||||
|
@ -220,8 +220,8 @@ void DSPJitRegCache::flushRegs(DSPJitRegCache &cache, bool emit)
|
||||
for(i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++) {
|
||||
if (cache.regs[i].loc.GetSimpleReg() !=
|
||||
regs[i].loc.GetSimpleReg() &&
|
||||
xregs[cache.regs[i].loc.GetSimpleReg()].guest_reg ==
|
||||
DSP_REG_NONE) {
|
||||
xregs[cache.regs[i].loc.GetSimpleReg()].guest_reg == DSP_REG_NONE)
|
||||
{
|
||||
movToHostReg(i,
|
||||
cache.regs[i].loc.GetSimpleReg(),
|
||||
true);
|
||||
|
@ -171,7 +171,7 @@ bool InstallCodeHandler()
|
||||
Memory::Write_U8(1, 0x80001807);
|
||||
|
||||
// Invalidate the icache
|
||||
for (int i = 0; i < data.length(); i += 32)
|
||||
for (unsigned int i = 0; i < data.length(); i += 32)
|
||||
{
|
||||
PowerPC::ppcState.iCache.Invalidate(0x80001800 + i);
|
||||
}
|
||||
|
@ -42,8 +42,6 @@ void LoadCodes(const IniFile& inifile, std::vector<GeckoCode>& gcodes)
|
||||
|
||||
std::istringstream ss(*lines_iter);
|
||||
|
||||
int read_state = 0;
|
||||
|
||||
switch ((*lines_iter)[0])
|
||||
{
|
||||
|
||||
@ -61,7 +59,6 @@ void LoadCodes(const IniFile& inifile, std::vector<GeckoCode>& gcodes)
|
||||
gcode.name = StripSpaces(gcode.name);
|
||||
// read the code creator name
|
||||
std::getline(ss, gcode.creator, ']');
|
||||
read_state = 0;
|
||||
break;
|
||||
|
||||
// notes
|
||||
|
@ -354,9 +354,6 @@ unsigned int Callback_GetStreaming(short* _pDestBuffer, unsigned int _numSamples
|
||||
|
||||
static s16 l1 = 0;
|
||||
static s16 l2 = 0;
|
||||
static s16 r1 = 0;
|
||||
static s16 r2 = 0;
|
||||
|
||||
|
||||
if ( frac >= 0x10000 || frac == 0)
|
||||
{
|
||||
@ -364,9 +361,6 @@ unsigned int Callback_GetStreaming(short* _pDestBuffer, unsigned int _numSamples
|
||||
|
||||
l1 = l2; //current
|
||||
l2 = pcm[pos * 2]; //next
|
||||
|
||||
r1 = r2; //current
|
||||
r2 = pcm[pos * 2 + 1]; //next
|
||||
}
|
||||
|
||||
pcm_l = ((l1 << 16) + (l2 - l1) * (u16)frac) >> 16;
|
||||
|
@ -281,7 +281,7 @@ bool CUCode_AX::AXTask(u32& _uMail)
|
||||
u32 Addr__AXOutSBuffer_1;
|
||||
u32 Addr__AXOutSBuffer_2;
|
||||
u32 Addr__A;
|
||||
u32 Addr__12;
|
||||
//u32 Addr__12;
|
||||
u32 Addr__4_1;
|
||||
u32 Addr__4_2;
|
||||
//u32 Addr__4_3;
|
||||
@ -429,7 +429,7 @@ bool CUCode_AX::AXTask(u32& _uMail)
|
||||
break;
|
||||
|
||||
case 0x0012:
|
||||
Addr__12 = HLEMemory_Read_U16(uAddress);
|
||||
//Addr__12 = HLEMemory_Read_U16(uAddress);
|
||||
uAddress += 2;
|
||||
break;
|
||||
|
||||
|
@ -159,8 +159,8 @@ void CUCode_AXWii::Update(int cycles)
|
||||
bool CUCode_AXWii::AXTask(u32& _uMail)
|
||||
{
|
||||
u32 uAddress = _uMail;
|
||||
u32 Addr__AXStudio;
|
||||
u32 Addr__AXOutSBuffer;
|
||||
//u32 Addr__AXStudio;
|
||||
//u32 Addr__AXOutSBuffer;
|
||||
bool bExecuteList = true;
|
||||
|
||||
/*
|
||||
@ -178,7 +178,7 @@ bool CUCode_AXWii::AXTask(u32& _uMail)
|
||||
switch (iCommand)
|
||||
{
|
||||
case 0x0000:
|
||||
Addr__AXStudio = HLEMemory_Read_U32(uAddress);
|
||||
//Addr__AXStudio = HLEMemory_Read_U32(uAddress);
|
||||
uAddress += 4;
|
||||
break;
|
||||
|
||||
@ -209,7 +209,7 @@ bool CUCode_AXWii::AXTask(u32& _uMail)
|
||||
break;
|
||||
|
||||
case 0x0007: // AXLIST_SBUFFER
|
||||
Addr__AXOutSBuffer = HLEMemory_Read_U32(uAddress);
|
||||
//Addr__AXOutSBuffer = HLEMemory_Read_U32(uAddress);
|
||||
uAddress += 10;
|
||||
break;
|
||||
|
||||
|
@ -265,7 +265,7 @@ bool GCMemcard::Save()
|
||||
mcdFile.WriteBytes(&dir_backup, BLOCK_SIZE);
|
||||
mcdFile.WriteBytes(&bat, BLOCK_SIZE);
|
||||
mcdFile.WriteBytes(&bat_backup, BLOCK_SIZE);
|
||||
for (int i = 0; i < maxBlock - MC_FST_BLOCKS; ++i)
|
||||
for (unsigned int i = 0; i < maxBlock - MC_FST_BLOCKS; ++i)
|
||||
{
|
||||
mcdFile.WriteBytes(mc_data_blocks[i].block, BLOCK_SIZE);
|
||||
}
|
||||
@ -587,7 +587,7 @@ u16 GCMemcard::BlockAlloc::NextFreeBlock(u16 StartingBlock) const
|
||||
for (u16 i = StartingBlock; i < BAT_SIZE; ++i)
|
||||
if (Map[i-MC_FST_BLOCKS] == 0)
|
||||
return i;
|
||||
for (u16 i = 0; i < StartingBlock; ++i)
|
||||
for (u16 i = MC_FST_BLOCKS; i < StartingBlock; ++i)
|
||||
if (Map[i-MC_FST_BLOCKS] == 0)
|
||||
return i;
|
||||
}
|
||||
@ -609,7 +609,7 @@ bool GCMemcard::BlockAlloc::ClearBlocks(u16 FirstBlock, u16 BlockCount)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
for (int i = 0; i < length; ++i)
|
||||
for (unsigned int i = 0; i < length; ++i)
|
||||
Map[blocks.at(i)-MC_FST_BLOCKS] = 0;
|
||||
FreeBlocks = BE16(BE16(FreeBlocks) + BlockCount);
|
||||
|
||||
@ -625,7 +625,7 @@ u32 GCMemcard::GetSaveData(u8 index, std::vector<GCMBlock> & Blocks) const
|
||||
|
||||
u16 block = DEntry_FirstBlock(index);
|
||||
u16 BlockCount = DEntry_BlockCount(index);
|
||||
u16 memcardSize = BE16(hdr.SizeMb) * MBIT_TO_BLOCKS;
|
||||
//u16 memcardSize = BE16(hdr.SizeMb) * MBIT_TO_BLOCKS;
|
||||
|
||||
if ((block == 0xFFFF) || (BlockCount == 0xFFFF))
|
||||
{
|
||||
@ -669,12 +669,10 @@ u32 GCMemcard::ImportFile(DEntry& direntry, std::vector<GCMBlock> &saveBlocks)
|
||||
Directory UpdatedDir = *CurrentDir;
|
||||
|
||||
// find first free dir entry
|
||||
int index = -1;
|
||||
for (int i=0; i < DIRLEN; i++)
|
||||
{
|
||||
if (BE32(UpdatedDir.Dir[i].Gamecode) == 0xFFFFFFFF)
|
||||
{
|
||||
index = i;
|
||||
UpdatedDir.Dir[i] = direntry;
|
||||
*(u16*)&UpdatedDir.Dir[i].FirstBlock = BE16(firstBlock);
|
||||
UpdatedDir.Dir[i].CopyCounter = UpdatedDir.Dir[i].CopyCounter+1;
|
||||
@ -887,7 +885,7 @@ u32 GCMemcard::ImportGciInternal(FILE* gcih, const char *inputFile, const std::s
|
||||
std::vector<GCMBlock> saveData;
|
||||
saveData.reserve(size);
|
||||
|
||||
for (int i = 0; i < size; ++i)
|
||||
for (unsigned int i = 0; i < size; ++i)
|
||||
{
|
||||
GCMBlock b;
|
||||
gci.ReadBytes(b.block, BLOCK_SIZE);
|
||||
@ -1000,7 +998,7 @@ u32 GCMemcard::ExportGci(u8 index, const char *fileName, const std::string &dire
|
||||
return NOMEMCARD;
|
||||
}
|
||||
gci.Seek(DENTRY_SIZE + offset, SEEK_SET);
|
||||
for (int i = 0; i < size; ++i)
|
||||
for (unsigned int i = 0; i < size; ++i)
|
||||
{
|
||||
gci.WriteBytes(saveData[i].block, BLOCK_SIZE);
|
||||
}
|
||||
|
@ -656,8 +656,10 @@ u8 *GetPointer(const u32 _Address)
|
||||
case 0x9:
|
||||
case 0xd:
|
||||
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii)
|
||||
{
|
||||
if ((_Address & 0xfffffff) < EXRAM_SIZE)
|
||||
return m_pPhysicalEXRAM + (_Address & EXRAM_MASK);
|
||||
}
|
||||
else
|
||||
break;
|
||||
|
||||
|
@ -262,7 +262,6 @@ int CSIDevice_AMBaseboard::RunBuffer(u8* _pBuffer, int _iLength)
|
||||
{
|
||||
|
||||
int cmd = *jvs_io++;
|
||||
int unknown = 0;
|
||||
DEBUG_LOG(AMBASEBOARDDEBUG, "JVS IO, node=%d, cmd=%02x", node, cmd);
|
||||
|
||||
switch (cmd)
|
||||
@ -362,10 +361,7 @@ int CSIDevice_AMBaseboard::RunBuffer(u8* _pBuffer, int _iLength)
|
||||
}
|
||||
case 0xf0:
|
||||
if (*jvs_io++ == 0xD9)
|
||||
{
|
||||
ERROR_LOG(AMBASEBOARDDEBUG, "JVS RESET");
|
||||
} else
|
||||
unknown = 1;
|
||||
msg.addData(1);
|
||||
|
||||
d10_1 |= 1;
|
||||
|
@ -621,7 +621,7 @@ void Wiimote::DoState(PointerWrap& p)
|
||||
|
||||
//Do 'm_read_requests' queue
|
||||
{
|
||||
u32 size;
|
||||
u32 size = 0;
|
||||
if (p.mode == PointerWrap::MODE_READ)
|
||||
{
|
||||
//clear
|
||||
|
@ -512,8 +512,6 @@ void StateChange(EMUSTATE_CHANGE newState)
|
||||
// TODO: disable/enable auto reporting, maybe
|
||||
}
|
||||
|
||||
#define ARRAYSIZE(_arr) (sizeof(_arr)/(sizeof(_arr[0])))
|
||||
|
||||
bool IsValidBluetoothName(const char* name) {
|
||||
static const char* kValidWiiRemoteBluetoothNames[] = {
|
||||
"Nintendo RVL-CNT-01",
|
||||
|
@ -321,7 +321,7 @@ void ExecuteCommand(u32 _Address)
|
||||
bool CmdSuccess = false;
|
||||
|
||||
ECommandType Command = static_cast<ECommandType>(Memory::Read_U32(_Address));
|
||||
volatile int DeviceID = Memory::Read_U32(_Address + 8);
|
||||
volatile u32 DeviceID = Memory::Read_U32(_Address + 8);
|
||||
|
||||
IWII_IPC_HLE_Device* pDevice = (DeviceID >= 0 && DeviceID < IPC_MAX_FDS) ? g_FdMap[DeviceID] : NULL;
|
||||
|
||||
|
@ -183,8 +183,8 @@ void CWII_IPC_HLE_Device_FileIO::CloseFile()
|
||||
bool CWII_IPC_HLE_Device_FileIO::Seek(u32 _CommandAddress)
|
||||
{
|
||||
u32 ReturnValue = FS_RESULT_FATAL;
|
||||
const s32 SeekPosition = Memory::Read_U32(_CommandAddress + 0xC);
|
||||
const s32 Mode = Memory::Read_U32(_CommandAddress + 0x10);
|
||||
const u32 SeekPosition = Memory::Read_U32(_CommandAddress + 0xC);
|
||||
const u32 Mode = Memory::Read_U32(_CommandAddress + 0x10);
|
||||
|
||||
|
||||
if (OpenFile())
|
||||
@ -205,7 +205,7 @@ bool CWII_IPC_HLE_Device_FileIO::Seek(u32 _CommandAddress)
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
s32 wantedPos = SeekPosition+m_SeekPos;
|
||||
u32 wantedPos = SeekPosition+m_SeekPos;
|
||||
if (wantedPos >=0 && wantedPos <= fileSize)
|
||||
{
|
||||
m_SeekPos = wantedPos;
|
||||
@ -215,7 +215,7 @@ bool CWII_IPC_HLE_Device_FileIO::Seek(u32 _CommandAddress)
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
s32 wantedPos = fileSize+m_SeekPos;
|
||||
u64 wantedPos = fileSize+m_SeekPos;
|
||||
if (wantedPos >=0 && wantedPos <= fileSize)
|
||||
{
|
||||
m_SeekPos = wantedPos;
|
||||
|
@ -789,7 +789,8 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress)
|
||||
{
|
||||
static CWII_IPC_HLE_Device_usb_oh1_57e_305* s_Usb = GetUsbPointer();
|
||||
bool* wiiMoteConnected = new bool[s_Usb->m_WiiMotes.size()];
|
||||
for(int i = 0; i < s_Usb->m_WiiMotes.size(); i++) wiiMoteConnected[i] = s_Usb->m_WiiMotes[i].IsConnected();
|
||||
for(unsigned int i = 0; i < s_Usb->m_WiiMotes.size();
|
||||
i++) wiiMoteConnected[i] = s_Usb->m_WiiMotes[i].IsConnected();
|
||||
|
||||
std::string tContentFile(m_ContentFile.c_str());
|
||||
WII_IPC_HLE_Interface::Reset(true);
|
||||
|
@ -285,7 +285,7 @@ bool CWII_IPC_HLE_Device_net_ncd_manage::IOCtlV(u32 _CommandAddress)
|
||||
{
|
||||
int x = 0;
|
||||
int tmpaddress[6];
|
||||
for (int i = 0; i < SConfig::GetInstance().m_WirelessMac.length() && x < 6; i++)
|
||||
for (unsigned int i = 0; i < SConfig::GetInstance().m_WirelessMac.length() && x < 6; i++)
|
||||
{
|
||||
if (SConfig::GetInstance().m_WirelessMac[i] == ':' || SConfig::GetInstance().m_WirelessMac[i] == '-')
|
||||
continue;
|
||||
|
@ -1467,9 +1467,9 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteLinkPolicy(u8* _Input)
|
||||
DEBUG_LOG(WII_IPC_WIIMOTE, " ConnectionHandle: 0x%04x", pLinkPolicy->con_handle);
|
||||
DEBUG_LOG(WII_IPC_WIIMOTE, " Policy: 0x%04x", pLinkPolicy->settings);
|
||||
|
||||
hci_write_link_policy_settings_rp Reply;
|
||||
Reply.status = 0x00;
|
||||
Reply.con_handle = pLinkPolicy->con_handle;
|
||||
//hci_write_link_policy_settings_rp Reply;
|
||||
//Reply.status = 0x00;
|
||||
//Reply.con_handle = pLinkPolicy->con_handle;
|
||||
|
||||
SendEventCommandStatus(HCI_CMD_WRITE_LINK_POLICY_SETTINGS);
|
||||
|
||||
@ -1878,4 +1878,4 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::LOG_LinkKey(const u8* _pLinkKey)
|
||||
, _pLinkKey[0], _pLinkKey[1], _pLinkKey[2], _pLinkKey[3], _pLinkKey[4], _pLinkKey[5], _pLinkKey[6], _pLinkKey[7]
|
||||
, _pLinkKey[8], _pLinkKey[9], _pLinkKey[10], _pLinkKey[11], _pLinkKey[12], _pLinkKey[13], _pLinkKey[14], _pLinkKey[15]);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -663,19 +663,19 @@ void ReadHeader()
|
||||
}
|
||||
|
||||
videoBackend.resize(ARRAYSIZE(tmpHeader.videoBackend));
|
||||
for (int i = 0; i < ARRAYSIZE(tmpHeader.videoBackend);i++)
|
||||
for (unsigned int i = 0; i < ARRAYSIZE(tmpHeader.videoBackend);i++)
|
||||
{
|
||||
videoBackend[i] = tmpHeader.videoBackend[i];
|
||||
}
|
||||
|
||||
g_discChange.resize(ARRAYSIZE(tmpHeader.discChange));
|
||||
for (int i = 0; i < ARRAYSIZE(tmpHeader.discChange);i++)
|
||||
for (unsigned int i = 0; i < ARRAYSIZE(tmpHeader.discChange);i++)
|
||||
{
|
||||
g_discChange[i] = tmpHeader.discChange[i];
|
||||
}
|
||||
|
||||
author.resize(ARRAYSIZE(tmpHeader.author));
|
||||
for (int i = 0; i < ARRAYSIZE(tmpHeader.author);i++)
|
||||
for (unsigned int i = 0; i < ARRAYSIZE(tmpHeader.author);i++)
|
||||
{
|
||||
author[i] = tmpHeader.author[i];
|
||||
}
|
||||
|
@ -1097,7 +1097,7 @@ void Jit64::mulli(UGeckoInstruction inst)
|
||||
gpr.BindToRegister(d, (d == a), true);
|
||||
if (imm == 0)
|
||||
XOR(32, gpr.R(d), gpr.R(d));
|
||||
else if(imm == -1)
|
||||
else if(imm == (u32)-1)
|
||||
{
|
||||
if (d != a)
|
||||
MOV(32, gpr.R(d), gpr.R(a));
|
||||
@ -1147,7 +1147,7 @@ void Jit64::mullwx(UGeckoInstruction inst)
|
||||
int src = gpr.R(a).IsImm() ? b : a;
|
||||
if (imm == 0)
|
||||
XOR(32, gpr.R(d), gpr.R(d));
|
||||
else if(imm == -1)
|
||||
else if(imm == (u32)-1)
|
||||
{
|
||||
if (d != src)
|
||||
MOV(32, gpr.R(d), gpr.R(src));
|
||||
@ -1263,7 +1263,7 @@ void Jit64::divwux(UGeckoInstruction inst)
|
||||
while(!(divisor & (1 << shift)))
|
||||
shift--;
|
||||
|
||||
if (divisor == (1 << shift))
|
||||
if (divisor == (u32)(1 << shift))
|
||||
{
|
||||
gpr.Lock(a, b, d);
|
||||
gpr.BindToRegister(d, d == a, true);
|
||||
@ -1387,7 +1387,7 @@ void Jit64::divwx(UGeckoInstruction inst)
|
||||
if (gpr.R(a).IsImm() && gpr.R(b).IsImm())
|
||||
{
|
||||
s32 i = (s32)gpr.R(a).offset, j = (s32)gpr.R(b).offset;
|
||||
if( j == 0 || i == 0x80000000 && j == -1)
|
||||
if( j == 0 || (i == (s32)0x80000000 && j == -1))
|
||||
{
|
||||
gpr.SetImmediate32(d, (i >> 31) ^ j);
|
||||
if (inst.OE)
|
||||
|
@ -472,10 +472,10 @@ static OpArg regBuildMemAddress(RegInfo& RI, InstLoc I, InstLoc AI,
|
||||
#else
|
||||
// 64-bit
|
||||
if (Profiled) {
|
||||
RI.Jit->LEA(32, EAX, M((void*)addr));
|
||||
RI.Jit->LEA(32, EAX, M((void*)(u64)addr));
|
||||
return MComplex(RBX, EAX, SCALE_1, 0);
|
||||
}
|
||||
return M((void*)addr);
|
||||
return M((void*)(u64)addr);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ static Common::Event g_compressAndDumpStateSyncEvent;
|
||||
static std::thread g_save_thread;
|
||||
|
||||
// Don't forget to increase this after doing changes on the savestate system
|
||||
static const int STATE_VERSION = 10;
|
||||
static const u32 STATE_VERSION = 10;
|
||||
|
||||
struct StateHeader
|
||||
{
|
||||
|
@ -319,7 +319,7 @@ void CCodeWindow::UpdateLists()
|
||||
{
|
||||
int idx = callers->Append(wxString::FromAscii(StringFromFormat
|
||||
("< %s (%08x)", caller_symbol->name.c_str(), caller_addr).c_str()));
|
||||
callers->SetClientData(idx, (void*)caller_addr);
|
||||
callers->SetClientData(idx, (void*)(u64)caller_addr);
|
||||
}
|
||||
}
|
||||
|
||||
@ -332,7 +332,7 @@ void CCodeWindow::UpdateLists()
|
||||
{
|
||||
int idx = calls->Append(wxString::FromAscii(StringFromFormat
|
||||
("> %s (%08x)", call_symbol->name.c_str(), call_addr).c_str()));
|
||||
calls->SetClientData(idx, (void*)call_addr);
|
||||
calls->SetClientData(idx, (void*)(u64)call_addr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -624,7 +624,6 @@ void FifoPlayerDlg::OnObjectListSelectionChanged(wxCommandEvent& event)
|
||||
int cmd = *objectdata++;
|
||||
int stream_size = Common::swap16(objectdata);
|
||||
objectdata += 2;
|
||||
int vertex_size = (objectdata_end - objectdata) / stream_size;
|
||||
wxString newLabel = wxString::Format(wxT("%08X: %02X %04X "), obj_offset, cmd, stream_size);
|
||||
if ((objectdata_end - objectdata) % stream_size) newLabel += _("NOTE: Stream size doesn't match actual data length\n");
|
||||
while (objectdata < objectdata_end)
|
||||
|
@ -1320,9 +1320,8 @@ void CFrame::StatusBarMessage(const char * Text, ...)
|
||||
const int MAX_BYTES = 1024*10;
|
||||
char Str[MAX_BYTES];
|
||||
va_list ArgPtr;
|
||||
int Cnt;
|
||||
va_start(ArgPtr, Text);
|
||||
Cnt = vsnprintf(Str, MAX_BYTES, Text, ArgPtr);
|
||||
vsnprintf(Str, MAX_BYTES, Text, ArgPtr);
|
||||
va_end(ArgPtr);
|
||||
|
||||
if (this->GetStatusBar()->IsEnabled()) this->GetStatusBar()->SetStatusText(wxString::FromAscii(Str),0);
|
||||
|
@ -652,7 +652,7 @@ void CGameListCtrl::ScanForISOs()
|
||||
|
||||
for (std::vector<std::string>::const_iterator iter = drives.begin(); iter != drives.end(); ++iter)
|
||||
{
|
||||
std::auto_ptr<GameListItem> gli(new GameListItem(*iter));
|
||||
std::unique_ptr<GameListItem> gli(new GameListItem(*iter));
|
||||
|
||||
if (gli->IsValid())
|
||||
m_ISOFiles.push_back(gli.release());
|
||||
|
@ -285,7 +285,7 @@ bool GameListItem::GetName(std::wstring& wName, int index) const
|
||||
index++;
|
||||
if ((index >=0) && (index < 10))
|
||||
{
|
||||
if (m_wNames.size() > index)
|
||||
if (m_wNames.size() > (size_t)index)
|
||||
{
|
||||
wName = m_wNames[index];
|
||||
return true;
|
||||
|
@ -687,14 +687,13 @@ void CISOProperties::OnExtractFile(wxCommandEvent& WXUNUSED (event))
|
||||
void CISOProperties::ExportDir(const char* _rFullPath, const char* _rExportFolder, const int partitionNum)
|
||||
{
|
||||
char exportName[512];
|
||||
u32 index[2] = {0, 0}, offsetShift = 0;
|
||||
u32 index[2] = {0, 0};
|
||||
std::vector<const DiscIO::SFileInfo *> fst;
|
||||
DiscIO::IFileSystem *FS = 0;
|
||||
|
||||
if (DiscIO::IsVolumeWiiDisc(OpenISO))
|
||||
{
|
||||
FS = WiiDisc.at(partitionNum).FileSystem;
|
||||
offsetShift = 2;
|
||||
}
|
||||
else
|
||||
FS = pFileSystem;
|
||||
|
@ -105,7 +105,7 @@ bool DolphinApp::OnInit()
|
||||
bool UseDebugger = false;
|
||||
bool UseLogger = false;
|
||||
bool selectVideoBackend = false;
|
||||
bool selectAudioEmulation = false;
|
||||
//bool selectAudioEmulation = false;
|
||||
|
||||
wxString videoBackendName;
|
||||
wxString audioEmulationName;
|
||||
@ -167,8 +167,8 @@ bool DolphinApp::OnInit()
|
||||
selectVideoBackend = parser.Found(wxT("video_backend"),
|
||||
&videoBackendName);
|
||||
// TODO: This currently has no effect. Implement or delete.
|
||||
selectAudioEmulation = parser.Found(wxT("audio_emulation"),
|
||||
&audioEmulationName);
|
||||
//selectAudioEmulation = parser.Found(wxT("audio_emulation"),
|
||||
// &audioEmulationName);
|
||||
#endif // wxUSE_CMDLINE_PARSER
|
||||
|
||||
#if defined _DEBUG && defined _WIN32
|
||||
|
@ -225,7 +225,7 @@ void XRRConfiguration::Update()
|
||||
}
|
||||
else
|
||||
sscanf(SConfig::GetInstance().m_LocalCoreStartupParameter.strFullscreenResolution.c_str(),
|
||||
"%a[^:]: %ux%u", &output_name, &fullWidth, &fullHeight);
|
||||
"%m[^:]: %ux%u", &output_name, &fullWidth, &fullHeight);
|
||||
|
||||
for (int i = 0; i < screenResources->noutput; i++)
|
||||
{
|
||||
|
@ -1,5 +1,7 @@
|
||||
#include "Xlib.h"
|
||||
|
||||
#include <X11/XKBlib.h>
|
||||
|
||||
namespace ciface
|
||||
{
|
||||
namespace Xlib
|
||||
@ -93,7 +95,7 @@ KeyboardMouse::Key::Key(Display* const display, KeyCode keycode, const char* key
|
||||
KeySym keysym = 0;
|
||||
do
|
||||
{
|
||||
keysym = XKeycodeToKeysym(m_display, keycode, i);
|
||||
keysym = XkbKeycodeToKeysym(m_display, keycode, i, 0);
|
||||
i++;
|
||||
}
|
||||
while (keysym == NoSymbol && i < 8);
|
||||
|
@ -361,9 +361,9 @@ u32 AnalyzeAndRunDisplayList(u32 address, u32 size, CachedDisplayList *dl)
|
||||
(cmd_byte & GX_PRIMITIVE_MASK) >> GX_PRIMITIVE_SHIFT,
|
||||
numVertices);
|
||||
num_draw_call++;
|
||||
const int tc[12] = {
|
||||
const u32 tc[12] = {
|
||||
g_VtxDesc.Position, g_VtxDesc.Normal, g_VtxDesc.Color0, g_VtxDesc.Color1, g_VtxDesc.Tex0Coord, g_VtxDesc.Tex1Coord,
|
||||
g_VtxDesc.Tex2Coord, g_VtxDesc.Tex3Coord, g_VtxDesc.Tex4Coord, g_VtxDesc.Tex5Coord, g_VtxDesc.Tex6Coord, (const int)((g_VtxDesc.Hex >> 31) & 3)
|
||||
g_VtxDesc.Tex2Coord, g_VtxDesc.Tex3Coord, g_VtxDesc.Tex4Coord, g_VtxDesc.Tex5Coord, g_VtxDesc.Tex6Coord, (const u32)((g_VtxDesc.Hex >> 31) & 3)
|
||||
};
|
||||
for(int i = 0; i < 12; i++)
|
||||
{
|
||||
@ -563,9 +563,9 @@ void CompileAndRunDisplayList(u32 address, u32 size, CachedDisplayList *dl)
|
||||
dl->InsertRegion(NewRegion);
|
||||
memcpy(NewRegion->start_address, StartAddress, Vdatasize);
|
||||
emitter.ABI_CallFunctionCCCP((void *)&VertexLoaderManager::RunCompiledVertices, cmd_byte & GX_VAT_MASK, (cmd_byte & GX_PRIMITIVE_MASK) >> GX_PRIMITIVE_SHIFT, numVertices, NewRegion->start_address);
|
||||
const int tc[12] = {
|
||||
const u32 tc[12] = {
|
||||
g_VtxDesc.Position, g_VtxDesc.Normal, g_VtxDesc.Color0, g_VtxDesc.Color1, g_VtxDesc.Tex0Coord, g_VtxDesc.Tex1Coord,
|
||||
g_VtxDesc.Tex2Coord, g_VtxDesc.Tex3Coord, g_VtxDesc.Tex4Coord, g_VtxDesc.Tex5Coord, g_VtxDesc.Tex6Coord, (const int)((g_VtxDesc.Hex >> 31) & 3)
|
||||
g_VtxDesc.Tex2Coord, g_VtxDesc.Tex3Coord, g_VtxDesc.Tex4Coord, g_VtxDesc.Tex5Coord, g_VtxDesc.Tex6Coord, (const u32)((g_VtxDesc.Hex >> 31) & 3)
|
||||
};
|
||||
for(int i = 0; i < 12; i++)
|
||||
{
|
||||
|
@ -131,6 +131,8 @@ void GetPixelShaderId(PIXELSHADERUID *uid, DSTALPHA_MODE dstAlphaMode, u32 compo
|
||||
|
||||
for (unsigned int i = 0; i < bpmem.genMode.numtexgens; ++i)
|
||||
{
|
||||
// TODO: This is all wrong. i in the else clause will always be out of range as a
|
||||
// subscript for xfregs.texMtxInfo. NeoBrain??
|
||||
if (18+i < 32)
|
||||
uid->values[0] |= xfregs.texMtxInfo[i].projection << (18+i); // 1
|
||||
else
|
||||
@ -158,7 +160,7 @@ void GetPixelShaderId(PIXELSHADERUID *uid, DSTALPHA_MODE dstAlphaMode, u32 compo
|
||||
}
|
||||
|
||||
u32* ptr = &uid->values[2];
|
||||
for (unsigned int i = 0; i < bpmem.genMode.numtevstages+1; ++i)
|
||||
for (int i = 0; i < bpmem.genMode.numtevstages+1; ++i)
|
||||
{
|
||||
StageHash(i, ptr);
|
||||
ptr += 4; // max: ptr = &uid->values[66]
|
||||
@ -626,7 +628,6 @@ const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType
|
||||
}
|
||||
WRITE(p, " ) {\n");
|
||||
|
||||
char* pmainstart = p;
|
||||
int Pretest = AlphaPreTest();
|
||||
if(Pretest >= 0 && !DepthTextureEnable)
|
||||
{
|
||||
|
@ -302,6 +302,7 @@ void PixelShaderManager::SetConstants()
|
||||
float GC_ALIGNED16(material[4]);
|
||||
float NormalizationCoef = 1 / 255.0f;
|
||||
|
||||
// TODO: This code is wrong. i goes out of range for xfregs.ambColor.
|
||||
for (int i = 0; i < 4; ++i)
|
||||
{
|
||||
if (nMaterialsChanged & (1 << i))
|
||||
|
@ -224,14 +224,14 @@ void VertexLoader::CompileVertexTranslator()
|
||||
#endif
|
||||
|
||||
// Colors
|
||||
const int col[2] = {m_VtxDesc.Color0, m_VtxDesc.Color1};
|
||||
const u32 col[2] = {m_VtxDesc.Color0, m_VtxDesc.Color1};
|
||||
// TextureCoord
|
||||
// Since m_VtxDesc.Text7Coord is broken across a 32 bit word boundary, retrieve its value manually.
|
||||
// If we didn't do this, the vertex format would be read as one bit offset from where it should be, making
|
||||
// 01 become 00, and 10/11 become 01
|
||||
const int tc[8] = {
|
||||
const u32 tc[8] = {
|
||||
m_VtxDesc.Tex0Coord, m_VtxDesc.Tex1Coord, m_VtxDesc.Tex2Coord, m_VtxDesc.Tex3Coord,
|
||||
m_VtxDesc.Tex4Coord, m_VtxDesc.Tex5Coord, m_VtxDesc.Tex6Coord, (const int)((m_VtxDesc.Hex >> 31) & 3)
|
||||
m_VtxDesc.Tex4Coord, m_VtxDesc.Tex5Coord, m_VtxDesc.Tex6Coord, (const u32)((m_VtxDesc.Hex >> 31) & 3)
|
||||
};
|
||||
|
||||
// Reset pipeline
|
||||
@ -770,7 +770,7 @@ void VertexLoader::AppendToString(std::string *dest) const
|
||||
dest->append(StringFromFormat("Nrm: %i %s-%s ",
|
||||
m_VtxAttr.NormalElements, posMode[m_VtxDesc.Normal], posFormats[m_VtxAttr.NormalFormat]));
|
||||
}
|
||||
int color_mode[2] = {m_VtxDesc.Color0, m_VtxDesc.Color1};
|
||||
u32 color_mode[2] = {m_VtxDesc.Color0, m_VtxDesc.Color1};
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
if (color_mode[i])
|
||||
@ -778,7 +778,7 @@ void VertexLoader::AppendToString(std::string *dest) const
|
||||
dest->append(StringFromFormat("C%i: %i %s-%s ", i, m_VtxAttr.color[i].Elements, posMode[color_mode[i]], colorFormat[m_VtxAttr.color[i].Comp]));
|
||||
}
|
||||
}
|
||||
int tex_mode[8] = {
|
||||
u32 tex_mode[8] = {
|
||||
m_VtxDesc.Tex0Coord, m_VtxDesc.Tex1Coord, m_VtxDesc.Tex2Coord, m_VtxDesc.Tex3Coord,
|
||||
m_VtxDesc.Tex4Coord, m_VtxDesc.Tex5Coord, m_VtxDesc.Tex6Coord, m_VtxDesc.Tex7Coord
|
||||
};
|
||||
|
@ -20,8 +20,8 @@
|
||||
#include <hash_map>
|
||||
using stdext::hash_map;
|
||||
#else
|
||||
#include <ext/hash_map>
|
||||
using __gnu_cxx::hash_map;
|
||||
#include <unordered_map>
|
||||
using std::unordered_map;
|
||||
#endif
|
||||
#include <map>
|
||||
#include <vector>
|
||||
@ -44,20 +44,21 @@ namespace stdext {
|
||||
return uid.GetHash();
|
||||
}
|
||||
}
|
||||
typedef hash_map<VertexLoaderUID, VertexLoader*> VertexLoaderMap;
|
||||
#else
|
||||
namespace __gnu_cxx {
|
||||
namespace std {
|
||||
template<> struct hash<VertexLoaderUID> {
|
||||
size_t operator()(const VertexLoaderUID& uid) const {
|
||||
return uid.GetHash();
|
||||
}
|
||||
};
|
||||
}
|
||||
typedef unordered_map<VertexLoaderUID, VertexLoader*> VertexLoaderMap;
|
||||
#endif
|
||||
|
||||
namespace VertexLoaderManager
|
||||
{
|
||||
|
||||
typedef hash_map<VertexLoaderUID, VertexLoader*> VertexLoaderMap;
|
||||
static VertexLoaderMap g_VertexLoaderMap;
|
||||
// TODO - change into array of pointers. Keep a map of all seen so far.
|
||||
|
||||
|
@ -251,6 +251,7 @@ void VertexShaderManager::SetConstants()
|
||||
float GC_ALIGNED16(material[4]);
|
||||
float NormalizationCoef = 1 / 255.0f;
|
||||
|
||||
// TODO: This code is wrong. i goes out of range for xfregs.ambColor.
|
||||
for (int i = 0; i < 4; ++i)
|
||||
{
|
||||
if (nMaterialsChanged & (1 << i))
|
||||
|
@ -72,27 +72,27 @@ void SWVertexLoader::SetFormat(u8 attributeIndex, u8 primitiveType)
|
||||
tcScale[7] = 1.0f / float(1 << m_CurrentVat->g2.Tex7Frac);
|
||||
|
||||
//TexMtx
|
||||
const int tmDesc[8] = {
|
||||
const u32 tmDesc[8] = {
|
||||
g_VtxDesc.Tex0MatIdx, g_VtxDesc.Tex1MatIdx, g_VtxDesc.Tex2MatIdx, g_VtxDesc.Tex3MatIdx,
|
||||
g_VtxDesc.Tex4MatIdx, g_VtxDesc.Tex5MatIdx, g_VtxDesc.Tex6MatIdx, g_VtxDesc.Tex7MatIdx
|
||||
};
|
||||
// Colors
|
||||
const int colDesc[2] = {g_VtxDesc.Color0, g_VtxDesc.Color1};
|
||||
const u32 colDesc[2] = {g_VtxDesc.Color0, g_VtxDesc.Color1};
|
||||
colElements[0] = m_CurrentVat->g0.Color0Elements;
|
||||
colElements[1] = m_CurrentVat->g0.Color1Elements;
|
||||
const int colComp[2] = {m_CurrentVat->g0.Color0Comp, m_CurrentVat->g0.Color1Comp};
|
||||
const u32 colComp[2] = {m_CurrentVat->g0.Color0Comp, m_CurrentVat->g0.Color1Comp};
|
||||
// TextureCoord
|
||||
const int tcDesc[8] = {
|
||||
const u32 tcDesc[8] = {
|
||||
g_VtxDesc.Tex0Coord, g_VtxDesc.Tex1Coord, g_VtxDesc.Tex2Coord, g_VtxDesc.Tex3Coord,
|
||||
g_VtxDesc.Tex4Coord, g_VtxDesc.Tex5Coord, g_VtxDesc.Tex6Coord, (const int)((g_VtxDesc.Hex >> 31) & 3)
|
||||
g_VtxDesc.Tex4Coord, g_VtxDesc.Tex5Coord, g_VtxDesc.Tex6Coord, (const u32)((g_VtxDesc.Hex >> 31) & 3)
|
||||
};
|
||||
const int tcElements[8] = {
|
||||
const u32 tcElements[8] = {
|
||||
m_CurrentVat->g0.Tex0CoordElements, m_CurrentVat->g1.Tex1CoordElements, m_CurrentVat->g1.Tex2CoordElements,
|
||||
m_CurrentVat->g1.Tex3CoordElements, m_CurrentVat->g1.Tex4CoordElements, m_CurrentVat->g2.Tex5CoordElements,
|
||||
m_CurrentVat->g2.Tex6CoordElements, m_CurrentVat->g2.Tex7CoordElements
|
||||
};
|
||||
|
||||
const int tcFormat[8] = {
|
||||
const u32 tcFormat[8] = {
|
||||
m_CurrentVat->g0.Tex0CoordFormat, m_CurrentVat->g1.Tex1CoordFormat, m_CurrentVat->g1.Tex2CoordFormat,
|
||||
m_CurrentVat->g1.Tex3CoordFormat, m_CurrentVat->g1.Tex4CoordFormat, m_CurrentVat->g2.Tex5CoordFormat,
|
||||
m_CurrentVat->g2.Tex6CoordFormat, m_CurrentVat->g2.Tex7CoordFormat
|
||||
|
Loading…
Reference in New Issue
Block a user