many warning fixes

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@422 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
nakeee 2008-09-01 12:11:08 +00:00
parent cad45aea72
commit 4bbfff3cac
29 changed files with 100 additions and 112 deletions

View File

@ -13,6 +13,7 @@ warnings = [
'pointer-arith', 'pointer-arith',
'packed', 'packed',
'no-conversion', 'no-conversion',
# 'error',
#'unreachable-code', #'unreachable-code',
] ]
compileFlags = [ compileFlags = [

View File

@ -80,5 +80,6 @@ bool File::CreateDir(const std::string &path)
return false; return false;
#else #else
// TODO: Insert POSIX code here. // TODO: Insert POSIX code here.
return true;
#endif #endif
} }

View File

@ -158,7 +158,7 @@ void CMappedFile::Close()
} }
u8* CMappedFile::Lock(u64 offset, u64 size) u8* CMappedFile::Lock(u64 offset, u64 _size)
{ {
#ifdef _WIN32 #ifdef _WIN32
if (hFile != INVALID_HANDLE_VALUE) if (hFile != INVALID_HANDLE_VALUE)
@ -168,9 +168,9 @@ u8* CMappedFile::Lock(u64 offset, u64 size)
{ {
u64 realOffset = offset & ~(granularity - 1); u64 realOffset = offset & ~(granularity - 1);
s64 difference = offset - realOffset; s64 difference = offset - realOffset;
u64 fake_size = (difference + size + granularity - 1) & ~(granularity - 1); u64 fake_size = (difference + _size + granularity - 1) & ~(granularity - 1);
#ifdef _WIN32 #ifdef _WIN32
u8* realPtr = (u8*)MapViewOfFile(hFileMapping, FILE_MAP_READ, (DWORD)(realOffset >> 32), (DWORD)realOffset, (SIZE_T)(size)); u8* realPtr = (u8*)MapViewOfFile(hFileMapping, FILE_MAP_READ, (DWORD)(realOffset >> 32), (DWORD)realOffset, (SIZE_T)(_size));
if (realPtr == NULL) if (realPtr == NULL)
{ {
@ -192,7 +192,7 @@ u8* CMappedFile::Lock(u64 offset, u64 size)
//add to map //add to map
lockMap[fakePtr] = realPtr; lockMap[fakePtr] = realPtr;
#ifndef _WIN32 #ifndef _WIN32
sizeMap[fakePtr] = size + difference; sizeMap[fakePtr] = _size + difference;
#endif #endif
return(fakePtr); return(fakePtr);
} }

View File

@ -309,7 +309,7 @@ THREAD_RETURN EmuThread(void *pArg)
g_pUpdateFPSDisplay("Loading..."); g_pUpdateFPSDisplay("Loading...");
// setup our core, but can't use dynarec if we are compare server // setup our core, but can't use dynarec if we are compare server
if (_CoreParameter.bUseJIT && !_CoreParameter.bRunCompareServer || _CoreParameter.bRunCompareClient) if (_CoreParameter.bUseJIT && (!_CoreParameter.bRunCompareServer || _CoreParameter.bRunCompareClient))
PowerPC::SetMode(PowerPC::MODE_JIT); PowerPC::SetMode(PowerPC::MODE_JIT);
else else
PowerPC::SetMode(PowerPC::MODE_INTERPRETER); PowerPC::SetMode(PowerPC::MODE_INTERPRETER);

View File

@ -367,7 +367,7 @@ std::string GetScheduledEventsSummary()
text.reserve(1000); text.reserve(1000);
while (ptr) while (ptr)
{ {
int t = ptr->type; unsigned int t = ptr->type;
if (t < 0 || t >= event_types.size()) if (t < 0 || t >= event_types.size())
PanicAlert("Invalid event type %i", t); PanicAlert("Invalid event type %i", t);
const char *name = event_types[ptr->type].name; const char *name = event_types[ptr->type].name;

View File

@ -39,11 +39,11 @@ void CEXIMemoryCard::FlushCallback(u64 userdata, int cyclesLate)
ptr->Flush(); ptr->Flush();
} }
CEXIMemoryCard::CEXIMemoryCard(const std::string& _rName, const std::string& _rFilename, int card_index) : CEXIMemoryCard::CEXIMemoryCard(const std::string& _rName, const std::string& _rFilename, int _card_index) :
m_strFilename(_rFilename) m_strFilename(_rFilename)
{ {
this->card_index = card_index; this->card_index = _card_index;
cards[card_index] = this; cards[_card_index] = this;
et_this_card = CoreTiming::RegisterEvent(_rName.c_str(), FlushCallback); et_this_card = CoreTiming::RegisterEvent(_rName.c_str(), FlushCallback);
nintendo_card_id = 0x00000010; // 16MBit nintendo card nintendo_card_id = 0x00000010; // 16MBit nintendo card

View File

@ -209,7 +209,7 @@ void ExecuteCommand(u32 _Address)
// HLE - Create a new HLE device // HLE - Create a new HLE device
std::string DeviceName; std::string DeviceName;
Memory::GetString(DeviceName, Memory::Read_U32(_Address + 0xC)); Memory::GetString(DeviceName, Memory::Read_U32(_Address + 0xC));
u32 Mode = Memory::Read_U32(_Address+0x10); // u32 Mode = Memory::Read_U32(_Address+0x10);
u32 DeviceID = GetDeviceIDByName(DeviceName); u32 DeviceID = GetDeviceIDByName(DeviceName);
if (DeviceID == 0) if (DeviceID == 0)
@ -227,7 +227,7 @@ void ExecuteCommand(u32 _Address)
} }
else else
{ {
IWII_IPC_HLE_Device* pDevice = AccessDeviceByID(DeviceID); // IWII_IPC_HLE_Device* pDevice = AccessDeviceByID(DeviceID);
// we have already opened this device // we have already opened this device
Memory::Write_U32(-6, _Address + 4); Memory::Write_U32(-6, _Address + 4);

View File

@ -129,8 +129,8 @@ protected:
for (u32 i=0; i<NumberOutBuffer; i++) for (u32 i=0; i<NumberOutBuffer; i++)
{ {
u32 OutBuffer = Memory::Read_U32(BufferOffset); BufferOffset += 4; // u32 OutBuffer = Memory::Read_U32(BufferOffset); BufferOffset += 4;
u32 OutBufferSize = Memory::Read_U32(BufferOffset); BufferOffset += 4; // u32 OutBufferSize = Memory::Read_U32(BufferOffset); BufferOffset += 4;
Memory::Write_U32(1, _CommandAddress + 0x4); Memory::Write_U32(1, _CommandAddress + 0x4);

View File

@ -135,15 +135,16 @@ CWII_IPC_HLE_Device_FileIO::IOCtl(u32 _CommandAddress)
u32 Parameter = Memory::Read_U32(_CommandAddress + 0xC); u32 Parameter = Memory::Read_U32(_CommandAddress + 0xC);
u32 BufferIn = Memory::Read_U32(_CommandAddress + 0x10); // u32 BufferIn = Memory::Read_U32(_CommandAddress + 0x10);
u32 BufferInSize = Memory::Read_U32(_CommandAddress + 0x14); // u32 BufferInSize = Memory::Read_U32(_CommandAddress + 0x14);
u32 BufferOut = Memory::Read_U32(_CommandAddress + 0x18); // u32 BufferOut = Memory::Read_U32(_CommandAddress + 0x18);
u32 BufferOutSize = Memory::Read_U32(_CommandAddress + 0x1C); // u32 BufferOutSize = Memory::Read_U32(_CommandAddress + 0x1C);
switch(Parameter) switch(Parameter)
{ {
case ISFS_IOCTL_GETFILESTATS: case ISFS_IOCTL_GETFILESTATS:
{ {
u32 BufferOut = Memory::Read_U32(_CommandAddress + 0x18);
LOG(WII_IPC_HLE, "FileIO: ISFS_IOCTL_GETFILESTATS"); LOG(WII_IPC_HLE, "FileIO: ISFS_IOCTL_GETFILESTATS");
LOG(WII_IPC_HLE, "Length: %i Seek: %i", m_FileLength, m_Seek); LOG(WII_IPC_HLE, "Length: %i Seek: %i", m_FileLength, m_Seek);

View File

@ -57,11 +57,11 @@ public:
virtual bool IOCtl(u32 _CommandAddress) virtual bool IOCtl(u32 _CommandAddress)
{ {
u32 Parameter = Memory::Read_U32(_CommandAddress +0x0C); // u32 Parameter = Memory::Read_U32(_CommandAddress +0x0C);
u32 Buffer1 = Memory::Read_U32(_CommandAddress +0x10); // u32 Buffer1 = Memory::Read_U32(_CommandAddress +0x10);
u32 BufferSize1 = Memory::Read_U32(_CommandAddress +0x14); // u32 BufferSize1 = Memory::Read_U32(_CommandAddress +0x14);
u32 Buffer2 = Memory::Read_U32(_CommandAddress +0x18); // u32 Buffer2 = Memory::Read_U32(_CommandAddress +0x18);
u32 BufferSize2 = Memory::Read_U32(_CommandAddress +0x1C); // u32 BufferSize2 = Memory::Read_U32(_CommandAddress +0x1C);
// write return value // write return value
Memory::Write_U32(0, _CommandAddress + 0x4); Memory::Write_U32(0, _CommandAddress + 0x4);

View File

@ -57,10 +57,10 @@ public:
virtual bool IOCtl(u32 _CommandAddress) virtual bool IOCtl(u32 _CommandAddress)
{ {
u32 Parameter = Memory::Read_U32(_CommandAddress +0x0C); u32 Parameter = Memory::Read_U32(_CommandAddress +0x0C);
u32 Buffer1 = Memory::Read_U32(_CommandAddress +0x10); // u32 Buffer1 = Memory::Read_U32(_CommandAddress +0x10);
u32 BufferSize1 = Memory::Read_U32(_CommandAddress +0x14); // u32 BufferSize1 = Memory::Read_U32(_CommandAddress +0x14);
u32 Buffer2 = Memory::Read_U32(_CommandAddress +0x18); // u32 Buffer2 = Memory::Read_U32(_CommandAddress +0x18);
u32 BufferSize2 = Memory::Read_U32(_CommandAddress +0x1C); // u32 BufferSize2 = Memory::Read_U32(_CommandAddress +0x1C);
// write return value // write return value
Memory::Write_U32(1, _CommandAddress + 0x4); Memory::Write_U32(1, _CommandAddress + 0x4);
@ -121,8 +121,8 @@ public:
u32 Parameter = Memory::Read_U32(_CommandAddress +0x0C); u32 Parameter = Memory::Read_U32(_CommandAddress +0x0C);
u32 Buffer1 = Memory::Read_U32(_CommandAddress +0x10); u32 Buffer1 = Memory::Read_U32(_CommandAddress +0x10);
u32 BufferSize1 = Memory::Read_U32(_CommandAddress +0x14); u32 BufferSize1 = Memory::Read_U32(_CommandAddress +0x14);
u32 Buffer2 = Memory::Read_U32(_CommandAddress +0x18); // u32 Buffer2 = Memory::Read_U32(_CommandAddress +0x18);
u32 BufferSize2 = Memory::Read_U32(_CommandAddress +0x1C); // u32 BufferSize2 = Memory::Read_U32(_CommandAddress +0x1C);
// write return value // write return value
switch (Parameter) switch (Parameter)

View File

@ -76,7 +76,7 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::IOCtlV(u32 _CommandAddress)
CtrlSetup.wValue = *(u16*)Memory::GetPointer(CommandBuffer.InBuffer[2].m_Address); CtrlSetup.wValue = *(u16*)Memory::GetPointer(CommandBuffer.InBuffer[2].m_Address);
CtrlSetup.wIndex = *(u16*)Memory::GetPointer(CommandBuffer.InBuffer[3].m_Address); CtrlSetup.wIndex = *(u16*)Memory::GetPointer(CommandBuffer.InBuffer[3].m_Address);
CtrlSetup.wLength = *(u16*)Memory::GetPointer(CommandBuffer.InBuffer[4].m_Address); CtrlSetup.wLength = *(u16*)Memory::GetPointer(CommandBuffer.InBuffer[4].m_Address);
u8 Termination =*(u8*)Memory::GetPointer(CommandBuffer.InBuffer[5].m_Address); // u8 Termination =*(u8*)Memory::GetPointer(CommandBuffer.InBuffer[5].m_Address);
CtrlSetup.m_PayLoadAddr = CommandBuffer.PayloadBuffer[0].m_Address; CtrlSetup.m_PayLoadAddr = CommandBuffer.PayloadBuffer[0].m_Address;
CtrlSetup.m_PayLoadSize = CommandBuffer.PayloadBuffer[0].m_Size; CtrlSetup.m_PayLoadSize = CommandBuffer.PayloadBuffer[0].m_Size;
@ -714,8 +714,8 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::ExecuteHCICommandMessage(const SHCICom
// //
default: default:
{ {
u16 ocf = HCI_OCF(pMsg->Opcode); // u16 ocf = HCI_OCF(pMsg->Opcode);
u16 ogf = HCI_OGF(pMsg->Opcode); // u16 ogf = HCI_OGF(pMsg->Opcode);
_dbg_assert_msg_(USB_HLE_LOG, 0, "Unknown USB_IOCTL_CTRLMSG: 0x%04X (ocf: 0x%x ogf 0x%x)", pMsg->Opcode, ocf, ogf); _dbg_assert_msg_(USB_HLE_LOG, 0, "Unknown USB_IOCTL_CTRLMSG: 0x%04X (ocf: 0x%x ogf 0x%x)", pMsg->Opcode, ocf, ogf);
@ -821,9 +821,6 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandReadLocalFeatures(u8* _Input)
void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandReadStoredLinkKey(u8* _Input) void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandReadStoredLinkKey(u8* _Input)
{ {
// command parameters
hci_read_stored_link_key_cp* ReadStoredLinkKey = (hci_read_stored_link_key_cp*)_Input;
// reply // reply
hci_read_stored_link_key_rp Reply; hci_read_stored_link_key_rp Reply;
Reply.status = 0x00; Reply.status = 0x00;
@ -920,9 +917,6 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandHostBufferSize(u8* _Input)
void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWritePageTimeOut(u8* _Input) void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWritePageTimeOut(u8* _Input)
{ {
// command parameters
hci_write_page_timeout_cp* pWritePageTimeOut = (hci_write_page_timeout_cp*)_Input;
// reply // reply
hci_host_buffer_size_rp Reply; hci_host_buffer_size_rp Reply;
Reply.status = 0x00; Reply.status = 0x00;
@ -946,6 +940,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteScanEnable(u8* _Input)
SendEventCommandComplete(HCI_CMD_WRITE_SCAN_ENABLE, &Reply, sizeof(hci_write_scan_enable_rp)); SendEventCommandComplete(HCI_CMD_WRITE_SCAN_ENABLE, &Reply, sizeof(hci_write_scan_enable_rp));
/*
static char Scanning[][128] = static char Scanning[][128] =
{ {
{ "HCI_NO_SCAN_ENABLE"}, { "HCI_NO_SCAN_ENABLE"},
@ -953,7 +948,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteScanEnable(u8* _Input)
{ "HCI_PAGE_SCAN_ENABLE"}, { "HCI_PAGE_SCAN_ENABLE"},
{ "HCI_INQUIRY_AND_PAGE_SCAN_ENABLE"}, { "HCI_INQUIRY_AND_PAGE_SCAN_ENABLE"},
}; };
*/
LOG(USB_HLE_LOG, "Command: HCI_CMD_WRITE_SCAN_ENABLE:"); LOG(USB_HLE_LOG, "Command: HCI_CMD_WRITE_SCAN_ENABLE:");
LOG(USB_HLE_LOG, "write:"); LOG(USB_HLE_LOG, "write:");
LOG(USB_HLE_LOG, " scan_enable: %s", Scanning[pWriteScanEnable->scan_enable]); LOG(USB_HLE_LOG, " scan_enable: %s", Scanning[pWriteScanEnable->scan_enable]);
@ -961,22 +956,20 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteScanEnable(u8* _Input)
void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteInquiryMode(u8* _Input) void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteInquiryMode(u8* _Input)
{ {
// command parameters
hci_write_inquiry_mode_cp* pInquiryMode = (hci_write_inquiry_mode_cp*)_Input;
// reply // reply
hci_write_inquiry_mode_rp Reply; hci_write_inquiry_mode_rp Reply;
Reply.status = 0x00; Reply.status = 0x00;
SendEventCommandComplete(HCI_CMD_WRITE_INQUIRY_MODE, &Reply, sizeof(hci_write_inquiry_mode_rp)); SendEventCommandComplete(HCI_CMD_WRITE_INQUIRY_MODE, &Reply, sizeof(hci_write_inquiry_mode_rp));
/*
static char InquiryMode[][128] = static char InquiryMode[][128] =
{ {
{ "Standard Inquiry Result event format (default)" }, { "Standard Inquiry Result event format (default)" },
{ "Inquiry Result format with RSSI" }, { "Inquiry Result format with RSSI" },
{ "Inquiry Result with RSSI format or Extended Inquiry Result format" } { "Inquiry Result with RSSI format or Extended Inquiry Result format" }
}; };
*/
LOG(USB_HLE_LOG, "Command: HCI_CMD_WRITE_INQUIRY_MODE:"); LOG(USB_HLE_LOG, "Command: HCI_CMD_WRITE_INQUIRY_MODE:");
LOG(USB_HLE_LOG, "write:"); LOG(USB_HLE_LOG, "write:");
LOG(USB_HLE_LOG, " mode: %s", InquiryMode[pInquiryMode->mode]); LOG(USB_HLE_LOG, " mode: %s", InquiryMode[pInquiryMode->mode]);
@ -984,20 +977,19 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteInquiryMode(u8* _Input)
void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWritePageScanType(u8* _Input) void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWritePageScanType(u8* _Input)
{ {
// command parameters
hci_write_page_scan_type_cp* pWritePageScanType = (hci_write_page_scan_type_cp*)_Input;
// reply // reply
hci_write_page_scan_type_rp Reply; hci_write_page_scan_type_rp Reply;
Reply.status = 0x00; Reply.status = 0x00;
SendEventCommandComplete(HCI_CMD_WRITE_PAGE_SCAN_TYPE, &Reply, sizeof(hci_write_page_scan_type_rp)); SendEventCommandComplete(HCI_CMD_WRITE_PAGE_SCAN_TYPE, &Reply, sizeof(hci_write_page_scan_type_rp));
/*
static char PageScanType[][128] = static char PageScanType[][128] =
{ {
{ "Mandatory: Standard Scan (default)" }, { "Mandatory: Standard Scan (default)" },
{ "Optional: Interlaced Scan" } { "Optional: Interlaced Scan" }
}; };
*/
LOG(USB_HLE_LOG, "Command: HCI_CMD_WRITE_PAGE_SCAN_TYPE:"); LOG(USB_HLE_LOG, "Command: HCI_CMD_WRITE_PAGE_SCAN_TYPE:");
LOG(USB_HLE_LOG, "write:"); LOG(USB_HLE_LOG, "write:");
@ -1030,8 +1022,6 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandInquiry(u8* _Input)
u8 lap[HCI_LAP_SIZE]; u8 lap[HCI_LAP_SIZE];
memcpy(lap, pInquiry->lap, HCI_LAP_SIZE); memcpy(lap, pInquiry->lap, HCI_LAP_SIZE);
u8 inquiry_length = pInquiry->inquiry_length;
u8 num_responses = pInquiry->num_responses;
_dbg_assert_msg_(USB_HLE_LOG, m_State == STATE_NONE, "m_State != NONE"); _dbg_assert_msg_(USB_HLE_LOG, m_State == STATE_NONE, "m_State != NONE");
m_State = STATE_INQUIRY_RESPONSE; m_State = STATE_INQUIRY_RESPONSE;
@ -1048,9 +1038,6 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandInquiry(u8* _Input)
void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteInquiryScanType(u8* _Input) void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteInquiryScanType(u8* _Input)
{ {
// command parameters
hci_write_inquiry_scan_type_cp* pSetEventFilter = (hci_write_inquiry_scan_type_cp*)_Input;
// reply // reply
hci_write_inquiry_scan_type_rp Reply; hci_write_inquiry_scan_type_rp Reply;
Reply.status = 0x00; Reply.status = 0x00;
@ -1157,9 +1144,6 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandCreateCon(u8* _Input)
void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandAcceptCon(u8* _Input) void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandAcceptCon(u8* _Input)
{ {
// command parameters
hci_accept_con_cp* pAcceptCon = (hci_accept_con_cp*)_Input;
LOG(USB_HLE_LOG, "Command: HCI_CMD_ACCEPT_CON"); LOG(USB_HLE_LOG, "Command: HCI_CMD_ACCEPT_CON");
LOG(USB_HLE_LOG, "Input:"); LOG(USB_HLE_LOG, "Input:");
LOG(USB_HLE_LOG, " bd: %02x:%02x:%02x:%02x:%02x:%02x", LOG(USB_HLE_LOG, " bd: %02x:%02x:%02x:%02x:%02x:%02x",

View File

@ -96,7 +96,7 @@ void UpdateFPRF(double value)
return; return;
} }
u64 mantissa = ivalue & 0x000FFFFFFFFFFFFFULL; u64 mantissa = ivalue & 0x000FFFFFFFFFFFFFULL;
int mantissa_top = (int)(mantissa >> 51); // int mantissa_top = (int)(mantissa >> 51);
if (exp == 0 && mantissa) { if (exp == 0 && mantissa) {
// Denormalized number. // Denormalized number.
if (sign) { if (sign) {
@ -192,8 +192,8 @@ void fctiwx(UGeckoInstruction _inst)
else else
{ {
value = (u32)(s32)_mm_cvtsd_si32(_mm_set_sd(b)); // obey current rounding mode value = (u32)(s32)_mm_cvtsd_si32(_mm_set_sd(b)); // obey current rounding mode
double d_value = (double)value; // double d_value = (double)value;
bool inexact = (d_value != b); // bool inexact = (d_value != b);
// FPSCR.FI = inexact ? 1 : 0; // FPSCR.FI = inexact ? 1 : 0;
// FPSCR.XX |= FPSCR.FI; // FPSCR.XX |= FPSCR.FI;
// FPSCR.FR = fabs(d_value) > fabs(b); // FPSCR.FR = fabs(d_value) > fabs(b);
@ -231,8 +231,8 @@ void fctiwzx(UGeckoInstruction _inst)
else else
{ {
value = (u32)(s32)_mm_cvttsd_si32(_mm_set_sd(b)); // truncate value = (u32)(s32)_mm_cvttsd_si32(_mm_set_sd(b)); // truncate
double d_value = (double)value; // double d_value = (double)value;
bool inexact = (d_value != b); // bool inexact = (d_value != b);
// FPSCR.FI = inexact ? 1 : 0; // FPSCR.FI = inexact ? 1 : 0;
// FPSCR.XX |= FPSCR.FI; // FPSCR.XX |= FPSCR.FI;
// FPSCR.FR = 1; //fabs(d_value) > fabs(b); // FPSCR.FR = 1; //fabs(d_value) > fabs(b);

View File

@ -234,9 +234,10 @@ void cmp(UGeckoInstruction _inst)
{ {
s32 a = (s32)m_GPR[_inst.RA]; s32 a = (s32)m_GPR[_inst.RA];
s32 b = (s32)m_GPR[_inst.RB]; s32 b = (s32)m_GPR[_inst.RB];
int fTemp; int fTemp = 0x8; // a < b
if (a < b) fTemp = 0x8;
else if (a > b) fTemp = 0x4; // if (a < b) fTemp = 0x8; else
if (a > b) fTemp = 0x4;
else if (a == b) fTemp = 0x2; else if (a == b) fTemp = 0x2;
if (XER.SO) PanicAlert("cmp getting overflow flag"); // fTemp |= 0x1 if (XER.SO) PanicAlert("cmp getting overflow flag"); // fTemp |= 0x1
SetCRField(_inst.CRFD, fTemp); SetCRField(_inst.CRFD, fTemp);
@ -246,9 +247,10 @@ void cmpl(UGeckoInstruction _inst)
{ {
u32 a = m_GPR[_inst.RA]; u32 a = m_GPR[_inst.RA];
u32 b = m_GPR[_inst.RB]; u32 b = m_GPR[_inst.RB];
u32 fTemp; u32 fTemp = 0x8; // a < b
if (a < b) fTemp = 0x8;
else if (a > b) fTemp = 0x4; // if (a < b) fTemp = 0x8;else
if (a > b) fTemp = 0x4;
else if (a == b) fTemp = 0x2; else if (a == b) fTemp = 0x2;
if (XER.SO) PanicAlert("cmpl getting overflow flag"); // fTemp |= 0x1; if (XER.SO) PanicAlert("cmpl getting overflow flag"); // fTemp |= 0x1;
SetCRField(_inst.CRFD, fTemp); SetCRField(_inst.CRFD, fTemp);

View File

@ -631,7 +631,7 @@ void tlbia(UGeckoInstruction _inst)
void tlbie(UGeckoInstruction _inst) void tlbie(UGeckoInstruction _inst)
{ {
// invalid entry // invalid entry
int entry = _inst.RB; // int entry = _inst.RB;
//MessageBox(0,"TLBIE","TLBIE",0); //MessageBox(0,"TLBIE","TLBIE",0);
} }

View File

@ -354,11 +354,11 @@ void mtspr(UGeckoInstruction _inst)
if (HID2.PSE == 0) if (HID2.PSE == 0)
PanicAlert("WARNING: PSE in HID2 isnt set"); PanicAlert("WARNING: PSE in HID2 isnt set");
bool WriteGatherPipeEnable = (bool)HID2.WPE; //TODO? // bool WriteGatherPipeEnable = (bool)HID2.WPE; //TODO?
bool LockedCacheEnable = (bool)HID2.LCE; // bool LockedCacheEnable = (bool)HID2.LCE;
int DMAQueueLength = HID2.DMAQL; // Ignore - our DMA:s are instantaneous // int DMAQueueLength = HID2.DMAQL; // Ignore - our DMA:s are instantaneous
bool PairedSingleEnable = HID2.PSE; // bool PairedSingleEnable = HID2.PSE;
bool QuantizeEnable = HID2.LSQE; // bool QuantizeEnable = HID2.LSQE;
//TODO(ector): Protect LC memory if LCE is false. //TODO(ector): Protect LC memory if LCE is false.
//TODO(ector): Honor PSE. //TODO(ector): Honor PSE.

View File

@ -49,8 +49,8 @@
namespace Jit64 namespace Jit64
{ {
namespace { namespace {
u64 GC_ALIGNED16(temp64); // u64 GC_ALIGNED16(temp64);
u32 GC_ALIGNED16(temp32); // u32 GC_ALIGNED16(temp32);
} }
void lbzx(UGeckoInstruction inst) void lbzx(UGeckoInstruction inst)
{ {

View File

@ -85,10 +85,10 @@ namespace PowerPC
#ifdef _WIN32 #ifdef _WIN32
_control87(_PC_53, MCW_PC); _control87(_PC_53, MCW_PC);
#else #else
unsigned short mode; unsigned short _mode;
asm ("fstcw %0" : : "m" (mode)); asm ("fstcw %0" : : "m" (_mode));
mode = (mode & ~FPU_PREC_MASK) | FPU_PREC_53; _mode = (_mode & ~FPU_PREC_MASK) | FPU_PREC_53;
asm ("fldcw %0" : : "m" (mode)); asm ("fldcw %0" : : "m" (_mode));
#endif #endif
#else #else
//x64 doesn't need this - fpu is done with SSE //x64 doesn't need this - fpu is done with SSE
@ -102,7 +102,7 @@ namespace PowerPC
Interpreter::Init(); Interpreter::Init();
Jit64::Core::Init(); Jit64::Core::Init();
// ... but start as interpreter by default. // ... but start as interpreter by default.
mode = MODE_INTERPRETER; _mode = MODE_INTERPRETER;
state = CPU_STEPPING; state = CPU_STEPPING;
} }

View File

@ -60,7 +60,7 @@ void WriteProfileResults(const char *filename) {
return; return;
} }
fprintf(f, "Profile\n"); fprintf(f, "Profile\n");
for (int i = 0; i < stats.size(); i++) for (unsigned int i = 0; i < stats.size(); i++)
{ {
const Jit64::JitBlock *block = Jit64::GetBlock(stats[i].blockNum); const Jit64::JitBlock *block = Jit64::GetBlock(stats[i].blockNum);
if (block) { if (block) {

View File

@ -47,10 +47,10 @@ bool SignatureDB::Load(const char *filename)
memset(&temp, 0, sizeof(temp)); memset(&temp, 0, sizeof(temp));
fread(&temp, sizeof(temp), 1, f); fread(&temp, sizeof(temp), 1, f);
DBFunc f; DBFunc dbf;
f.name = temp.name; dbf.name = temp.name;
f.size = temp.size; dbf.size = temp.size;
database[temp.checkSum] = f; database[temp.checkSum] = dbf;
} }
fclose(f); fclose(f);
return true; return true;

View File

@ -104,9 +104,9 @@ void SymbolDB::AddKnownSymbol(u32 startAddr, u32 size, const char *name, int typ
Symbol *SymbolDB::GetSymbolFromAddr(u32 addr) Symbol *SymbolDB::GetSymbolFromAddr(u32 addr)
{ {
XFuncMap::iterator iter = functions.find(addr); XFuncMap::iterator it = functions.find(addr);
if (iter != functions.end()) if (it != functions.end())
return &iter->second; return &it->second;
else else
{ {
for (XFuncMap::iterator iter = functions.begin(); iter != functions.end(); iter++) for (XFuncMap::iterator iter = functions.begin(); iter != functions.end(); iter++)

View File

@ -191,7 +191,7 @@ void LoadStateCallback(u64 userdata, int cyclesLate)
buffer = new u8[sz]; buffer = new u8[sz];
int x; int x;
if (x=fread(buffer, 1, sz, f) != sz) if ((x = fread(buffer, 1, sz, f)) != sz)
PanicAlert("wtf? %d %d", x, sz); PanicAlert("wtf? %d %d", x, sz);
} }

View File

@ -395,13 +395,13 @@ void CCodeView::OnPaint(wxPaintEvent& event)
if (mojs) if (mojs)
{ {
for (int i = 0; i < 8; i++) for (int k = 0; k < 8; k++)
{ {
bool found = false; bool found = false;
for (int j = 0; j < 22; j++) for (int j = 0; j < 22; j++)
{ {
if (mojs[i + 2] == "0123456789ABCDEFabcdef"[j]) if (mojs[k + 2] == "0123456789ABCDEFabcdef"[j])
{ {
found = true; found = true;
} }

View File

@ -645,7 +645,6 @@ void CCodeWindow::OnSymbolListChange(wxCommandEvent& event)
void CCodeWindow::OnSymbolListContextMenu(wxContextMenuEvent& event) void CCodeWindow::OnSymbolListContextMenu(wxContextMenuEvent& event)
{ {
int index = symbols->GetSelection();
} }

View File

@ -311,13 +311,13 @@ void CMemoryView::OnPaint(wxPaintEvent& event)
if (mojs) if (mojs)
{ {
for (int i = 0; i < 8; i++) for (int k = 0; k < 8; k++)
{ {
bool found = false; bool found = false;
for (int j = 0; j < 22; j++) for (int j = 0; j < 22; j++)
{ {
if (mojs[i + 2] == "0123456789ABCDEFabcdef"[j]) if (mojs[k + 2] == "0123456789ABCDEFabcdef"[j])
{ {
found = true; found = true;
} }

View File

@ -126,47 +126,47 @@ void Video_SendFifoData(u8* _uData)
// See Core.cpp for threading idea // See Core.cpp for threading idea
void Fifo_EnterLoop(const SVideoInitialize &video_initialize) void Fifo_EnterLoop(const SVideoInitialize &video_initialize)
{ {
SCPFifoStruct &fifo = *video_initialize.pCPFifo; SCPFifoStruct &_fifo = *video_initialize.pCPFifo;
// TODO(ector): Don't peek so often! // TODO(ector): Don't peek so often!
while (video_initialize.pPeekMessages()) while (video_initialize.pPeekMessages())
{ {
if (fifo.CPReadWriteDistance < 1) //fifo.CPLoWatermark) if (_fifo.CPReadWriteDistance < 1) //fifo.CPLoWatermark)
Common::SleepCurrentThread(1); Common::SleepCurrentThread(1);
//etc... //etc...
// check if we are able to run this buffer // check if we are able to run this buffer
if ((fifo.bFF_GPReadEnable) && !(fifo.bFF_BPEnable && fifo.bFF_Breakpoint)) if ((_fifo.bFF_GPReadEnable) && !(_fifo.bFF_BPEnable && _fifo.bFF_Breakpoint))
{ {
int count = 200; int count = 200;
while(fifo.CPReadWriteDistance > 0 && count) while(_fifo.CPReadWriteDistance > 0 && count)
{ {
// check if we are on a breakpoint // check if we are on a breakpoint
if (fifo.bFF_BPEnable) if (_fifo.bFF_BPEnable)
{ {
if (fifo.CPReadPointer == fifo.CPBreakpoint) if (_fifo.CPReadPointer == _fifo.CPBreakpoint)
{ {
fifo.bFF_Breakpoint = 1; _fifo.bFF_Breakpoint = 1;
video_initialize.pUpdateInterrupts(); video_initialize.pUpdateInterrupts();
break; break;
} }
} }
// read the data and send it to the VideoPlugin // read the data and send it to the VideoPlugin
u8 *uData = video_initialize.pGetMemoryPointer(fifo.CPReadPointer); u8 *uData = video_initialize.pGetMemoryPointer(_fifo.CPReadPointer);
#ifdef _WIN32 #ifdef _WIN32
EnterCriticalSection(&fifo.sync); EnterCriticalSection(&fifo.sync);
#endif #endif
fifo.CPReadPointer += 32; _fifo.CPReadPointer += 32;
Video_SendFifoData(uData); Video_SendFifoData(uData);
#ifdef _WIN32 #ifdef _WIN32
InterlockedExchangeAdd((LONG*)&fifo.CPReadWriteDistance, -32); InterlockedExchangeAdd((LONG*)&_fifo.CPReadWriteDistance, -32);
LeaveCriticalSection(&fifo.sync); LeaveCriticalSection(&fifo.sync);
#endif #endif
// increase the ReadPtr // increase the ReadPtr
if (fifo.CPReadPointer >= fifo.CPEnd) if (_fifo.CPReadPointer >= _fifo.CPEnd)
{ {
fifo.CPReadPointer = fifo.CPBase; _fifo.CPReadPointer = _fifo.CPBase;
//LOG(COMMANDPROCESSOR, "BUFFER LOOP"); //LOG(COMMANDPROCESSOR, "BUFFER LOOP");
} }
count--; count--;

View File

@ -247,15 +247,15 @@ void DVProfWrite(const char* pfilename, u32 frames)
} }
{ {
map<string, DVTIMEINFO>::iterator it; map<string, DVTIMEINFO>::iterator iter;
fprintf(f, "\n\n-------------------------------------------------------------------\n\n"); fprintf(f, "\n\n-------------------------------------------------------------------\n\n");
u64 uTotal[2] = {0}; u64 uTotal[2] = {0};
double fiTotalTime[2]; double fiTotalTime[2];
for(it = mapAggregateTimes.begin(); it != mapAggregateTimes.end(); ++it) { for(iter = mapAggregateTimes.begin(); iter != mapAggregateTimes.end(); ++iter) {
uTotal[0] += it->second.uExclusive; uTotal[0] += iter->second.uExclusive;
uTotal[1] += it->second.uInclusive; uTotal[1] += iter->second.uInclusive;
} }
fprintf(f, "total times (%d): ex: %Lu ", frames, 1000000*uTotal[0]/(luPerfFreq*(u64)frames)); fprintf(f, "total times (%d): ex: %Lu ", frames, 1000000*uTotal[0]/(luPerfFreq*(u64)frames));
@ -265,9 +265,9 @@ void DVProfWrite(const char* pfilename, u32 frames)
fiTotalTime[1] = 1.0 / (double)uTotal[1]; fiTotalTime[1] = 1.0 / (double)uTotal[1];
// output the combined times // output the combined times
for(it = mapAggregateTimes.begin(); it != mapAggregateTimes.end(); ++it) { for(iter = mapAggregateTimes.begin(); iter != mapAggregateTimes.end(); ++iter) {
fprintf(f, "%s - ex: %f inc: %f\n", it->first.c_str(), (float)((double)it->second.uExclusive * fiTotalTime[0]), fprintf(f, "%s - ex: %f inc: %f\n", iter->first.c_str(), (float)((double)iter->second.uExclusive * fiTotalTime[0]),
(float)((double)it->second.uInclusive * fiTotalTime[1])); (float)((double)iter->second.uInclusive * fiTotalTime[1]));
} }
} }

View File

@ -61,7 +61,7 @@ class DVProfileFunc
public: public:
u32 dwUserData; u32 dwUserData;
__forceinline DVProfileFunc(const char* pname) {} __forceinline DVProfileFunc(const char* pname) {}
__forceinline DVProfileFunc(const char* pname, u32 dwUserData) { } __forceinline DVProfileFunc(const char* pname, u32 _dwUserData) { }
~DVProfileFunc() {} ~DVProfileFunc() {}
}; };

View File

@ -480,7 +480,7 @@ PC_TexFormat TexDecoder_Decode(u8 *dst, const u8 *src, int width, int height, in
while(*fmt) while(*fmt)
{ {
int xcnt = 0; int xcnt = 0;
int nchar = sfont_map[*fmt]; int nchar = sfont_map[(int)*fmt];
const unsigned char *ptr = sfont_raw[nchar]; // each char is up to 9x10 const unsigned char *ptr = sfont_raw[nchar]; // each char is up to 9x10