Cleaned up more warnings (on warning level 4)

This commit is contained in:
zilmar 2012-10-06 14:09:17 +10:00
parent ba27b5e423
commit 9dd62a9998
17 changed files with 105 additions and 97 deletions

View File

@ -493,9 +493,9 @@ void CLanguage::LoadCurrentStrings ( bool ShowSelectDialog )
if (file == NULL) { return; }
//String;
while(!feof(file)){
LANG_STR &String = GetNextLangString(file);
CurrentStrings.insert(String);
while(!feof(file))
{
CurrentStrings.insert(GetNextLangString(file));
}
fclose(file);
}
@ -866,8 +866,9 @@ stdstr CLanguage::GetLangString ( const char * FileName, LanguageStringID ID )
if (file == NULL) { return stdstr(""); }
//String;
while(!feof(file)){
LANG_STR &String = GetNextLangString(file);
while(!feof(file))
{
LANG_STR String = GetNextLangString(file);
if (String.first == ID) {
fclose(file);
return String.second;

View File

@ -63,7 +63,6 @@ void EnterLogOptions(HWND hwndOwner) {
void LoadLogOptions (LOG_OPTIONS * LogOptions, BOOL AlwaysFill) {
long lResult;
HKEY hKeyResults = 0;
DWORD Disposition = 0;
char String[200];
sprintf(String,"Software\\N64 Emulation\\%s\\Logging",_Settings->LoadString(Setting_ApplicationName));
@ -142,7 +141,7 @@ void LoadLogSetting (HKEY hKey,char * String, BOOL * Value) {
}
}
LRESULT CALLBACK LogGeneralProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) {
LRESULT CALLBACK LogGeneralProc (HWND hDlg, UINT uMsg, WPARAM /*wParam*/, LPARAM lParam) {
switch (uMsg) {
case WM_INITDIALOG:
if (TempOptions.LogCP0changes) { CheckDlgButton(hDlg,IDC_CP0_WRITE,BST_CHECKED); }
@ -574,7 +573,7 @@ void Log_SW (DWORD PC, DWORD VAddr, DWORD Value) {
LogMessage("%08X: Writing 0x%08X to %08X ????",PC, Value, VAddr );
}
LRESULT CALLBACK LogPifProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) {
LRESULT CALLBACK LogPifProc (HWND hDlg, UINT uMsg, WPARAM /*wParam*/, LPARAM lParam) {
switch (uMsg) {
case WM_INITDIALOG:
if (TempOptions.LogPRDMAOperations) { CheckDlgButton(hDlg,IDC_SI_DMA,BST_CHECKED); }
@ -599,7 +598,7 @@ LRESULT CALLBACK LogPifProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
return TRUE;
}
LRESULT CALLBACK LogRegProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) {
LRESULT CALLBACK LogRegProc (HWND hDlg, UINT uMsg, WPARAM /*wParam*/, LPARAM lParam) {
switch (uMsg) {
case WM_INITDIALOG:
if (TempOptions.LogRDRamRegisters) { CheckDlgButton(hDlg,IDC_RDRAM,BST_CHECKED); }

View File

@ -9,7 +9,7 @@ char CommandName[100];
void SetR4300iCommandToStepping ( void ) {
}
void SetR4300iCommandViewto ( UINT NewLocation ) {
void SetR4300iCommandViewto ( UINT /*NewLocation*/ ) {
}
void __cdecl Enter_R4300i_Commands_Window ( void ) {
@ -22,7 +22,7 @@ char * LabelName (DWORD Address) {
return strLabelName;
}
char * R4300iSpecialName ( DWORD OpCode, DWORD PC ) {
char * R4300iSpecialName ( DWORD OpCode, DWORD /*PC*/ ) {
OPCODE command;
command.Hex = OpCode;

View File

@ -320,7 +320,7 @@ int CCheats::ApplyCheatEntry (CMipsMemory * _MMU, const CODES & CodeEntry, int C
for (i=0; i<numrepeats; i++) {
_MMU->SB_VAddr(Address,(BYTE)wMemory);
Address += offset;
wMemory += incr;
wMemory += (WORD)incr;
}
return 2;
case 0x11000000: // Xplorer64
@ -330,7 +330,7 @@ int CCheats::ApplyCheatEntry (CMipsMemory * _MMU, const CODES & CodeEntry, int C
for (i=0; i<numrepeats; i++) {
_MMU->SH_VAddr(Address,wMemory);
Address += offset;
wMemory += incr;
wMemory += (WORD)incr;
}
return 2;
default: return 1;
@ -468,7 +468,7 @@ DWORD CCheats::AsciiToHex (const char * HexValue) {
return Value;
}
void CCheats::AddCodeLayers (int CheatNumber, stdstr &CheatName, WND_HANDLE hParent, bool CheatActive) {
void CCheats::AddCodeLayers (int CheatNumber, const stdstr &CheatName, WND_HANDLE hParent, bool CheatActive) {
TV_INSERTSTRUCT tv;
//Work out text to add
@ -568,8 +568,6 @@ bool CCheats::CheatUsesCodeExtensions (const stdstr &LineEntry) {
void CCheats::RefreshCheatManager(void)
{
if (m_Window == NULL) { return; }
int CurrentEdit = m_EditCheat;
m_DeleteingEntries = true;
TreeView_DeleteAllItems((HWND)m_hCheatTree);
@ -1283,7 +1281,7 @@ int CALLBACK CCheats::CheatsCodeQuantProc (WND_HANDLE hDlg,DWORD uMsg,DWORD wPar
sprintf(szTmp2,"$%X",Value);
if (strcmp(szTmp,szTmp2) != 0) {
SetDlgItemText((HWND)hDlg,IDC_VALUE,szTmp2);
if (SelStop == 0) { SelStop = strlen(szTmp2); SelStart = SelStop; }
if (SelStop == 0) { SelStop = (WORD)strlen(szTmp2); SelStart = SelStop; }
SendDlgItemMessage((HWND)hDlg,IDC_VALUE,EM_SETSEL,(WPARAM)SelStart,(LPARAM)SelStop);
} else {
WORD NewSelStart, NewSelStop;
@ -1358,7 +1356,7 @@ int CALLBACK CCheats::ManageCheatsProc (WND_HANDLE hDlg,DWORD uMsg,DWORD wParam,
RECT * rc = &WndPlac.rcNormalPosition;
if (_Settings->LoadDword(UserInterface_BasicMode))
{
RECT * rcAdd = (RECT *)_this->m_rcAdd, * rcList = (RECT *)_this->m_rcList;
RECT * rcList = (RECT *)_this->m_rcList;
GetWindowRect(GetDlgItem((HWND)_this->m_hSelectCheat, IDC_CHEATSFRAME), rcList);
_this->m_MinSizeDlg = rcList->right - rcList->left + 16;
_this->m_MaxSizeDlg = _this->m_MinSizeDlg;
@ -1741,16 +1739,12 @@ stdstr CCheats::ReadCodeString (WND_HANDLE hDlg, bool &validcodes, bool &validop
return codestring;
}
stdstr CCheats::ReadOptionsString(WND_HANDLE hDlg, bool &validcodes, bool &validoptions, bool &nooptions, int &codeformat)
stdstr CCheats::ReadOptionsString(WND_HANDLE hDlg, bool &/*validcodes*/, bool &validoptions, bool &/*nooptions*/, int &codeformat)
{
int numlines, linecount, len;
char str[128];
int i, j;
int leftorder = 0;
int rightorder = 0;
validoptions = true;
int numoptions = 0;
@ -1784,7 +1778,7 @@ stdstr CCheats::ReadOptionsString(WND_HANDLE hDlg, bool &validcodes, bool &valid
}
for (j=0; j<2; j++) {
str[j] = toupper(str[j]);
str[j] = (char)toupper(str[j]);
}
if (optionsstring[0] == 0)
@ -1817,7 +1811,7 @@ stdstr CCheats::ReadOptionsString(WND_HANDLE hDlg, bool &validcodes, bool &valid
}
for (j=0; j<4; j++) {
str[j] = toupper(str[j]);
str[j] = (char)toupper(str[j]);
}
strcat(optionsstring, ",$");

View File

@ -38,7 +38,7 @@ class CCheats {
void LoadPermCheats (void);
bool LoadCode ( int CheatNo, LPCSTR CheatString );
void AddCodeLayers ( int CheatNumber, stdstr &CheatName, WND_HANDLE hParent, bool CheatActive );
void AddCodeLayers ( int CheatNumber, const stdstr &CheatName, WND_HANDLE hParent, bool CheatActive );
//Reload the cheats from the ini file to the select gui
void RefreshCheatManager ( void );
void ChangeChildrenStatus ( WND_HANDLE hParent, bool Checked );

View File

@ -18,8 +18,8 @@ CDebugMemoryView::~CDebugMemoryView()
LRESULT CDebugMemoryView::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
m_DataStartLoc = -1;
m_CompareStartLoc = -1;
m_DataStartLoc = (DWORD)-1;
m_CompareStartLoc = (DWORD)-1;
memset(m_CompareData,0,sizeof(m_CompareData));
memset(m_CompareValid,0,sizeof(m_CompareValid));
@ -88,7 +88,7 @@ LRESULT CDebugMemoryView::OnDestroy ( void )
return 0;
}
LRESULT CDebugMemoryView::OnClicked (WORD wNotifyCode, WORD wID, HWND , BOOL& bHandled)
LRESULT CDebugMemoryView::OnClicked (WORD /*wNotifyCode*/, WORD wID, HWND , BOOL& /*bHandled*/)
{
switch(wID)
{
@ -280,7 +280,7 @@ void CDebugMemoryView::Insert_MemoryLineDump ( int LineNumber )
}
}
void CDebugMemoryView::OnAddrChanged( UINT Code, int id, HWND ctl )
void CDebugMemoryView::OnAddrChanged( UINT /*Code*/, int /*id*/, HWND /*ctl*/ )
{
RefreshMemory(false);
}

View File

@ -3,7 +3,7 @@
R4300iOp::Func * CInterpreterCPU::m_R4300i_Opcode = NULL;
DWORD CInterpreterCPU::m_CountPerOp = 2;
void ExecuteInterpreterOps (DWORD Cycles)
void ExecuteInterpreterOps (DWORD /*Cycles*/)
{
_Notify->BreakPoint(__FILE__,__LINE__);
}

View File

@ -74,13 +74,15 @@ void CAudio::TimerDone ( void )
m_SecondBuff = 0;
}
void CAudio::SetViIntr ( DWORD VI_INTR_TIME )
void CAudio::SetViIntr ( DWORD /*VI_INTR_TIME*/ )
{
/*
double CountsPerSecond = (DWORD)((double)VI_INTR_TIME * m_FramesPerSecond);
if (m_BytesPerSecond != 0)
{
//m_CountsPerByte = (double)CountsPerSecond / (double)m_BytesPerSecond;
}
*/
}

View File

@ -19,7 +19,7 @@ CEeprom::~CEeprom (void) {
unsigned char byte2bcd(int n)
{
n %= 100;
return ((n / 10) << 4) | (n % 10);
return (unsigned char)(((n / 10) << 4) | (n % 10));
}
void CEeprom::EepromCommand ( BYTE * Command) {

View File

@ -28,7 +28,7 @@ CMipsMemoryVM::~CMipsMemoryVM (void)
FreeMemory();
}
void CMipsMemoryVM::Reset( bool EraseMemory )
void CMipsMemoryVM::Reset( bool /*EraseMemory*/ )
{
if (m_TLB_ReadMap)
{
@ -735,8 +735,8 @@ void CMipsMemoryVM::Compile_SW_Const ( DWORD Value, DWORD VAddr ) {
AfterCallDirect(m_RegWorkingSet);
}
if ( ( Value & SP_CLR_INTR ) != 0) {
AndConstToVariable(~MI_INTR_SP,&_Reg->MI_INTR_REG,"MI_INTR_REG");
AndConstToVariable(~MI_INTR_SP,&_Reg->m_RspIntrReg,"m_RspIntrReg");
AndConstToVariable((DWORD)~MI_INTR_SP,&_Reg->MI_INTR_REG,"MI_INTR_REG");
AndConstToVariable((DWORD)~MI_INTR_SP,&_Reg->m_RspIntrReg,"m_RspIntrReg");
BeforeCallDirect(m_RegWorkingSet);
MoveConstToX86reg((DWORD)_System,x86_ECX);
Call_Direct(AddressOf(&CN64System::RunRSP),"CN64System::RunRSP");
@ -778,8 +778,8 @@ void CMipsMemoryVM::Compile_SW_Const ( DWORD Value, DWORD VAddr ) {
OrConstToVariable(ModValue,&_Reg->MI_MODE_REG,"MI_MODE_REG");
}
if ( ( Value & MI_CLR_DP_INTR ) != 0 ) {
AndConstToVariable(~MI_INTR_DP,&_Reg->MI_INTR_REG,"MI_INTR_REG");
AndConstToVariable(~MI_INTR_DP,&_Reg->m_GfxIntrReg,"m_GfxIntrReg");
AndConstToVariable((DWORD)~MI_INTR_DP,&_Reg->MI_INTR_REG,"MI_INTR_REG");
AndConstToVariable((DWORD)~MI_INTR_DP,&_Reg->m_GfxIntrReg,"m_GfxIntrReg");
}
}
break;
@ -846,7 +846,7 @@ void CMipsMemoryVM::Compile_SW_Const ( DWORD Value, DWORD VAddr ) {
break;
case 0x0440000C: MoveConstToVariable(Value,&_Reg->VI_INTR_REG,"VI_INTR_REG"); break;
case 0x04400010:
AndConstToVariable(~MI_INTR_VI,&_Reg->MI_INTR_REG,"MI_INTR_REG");
AndConstToVariable((DWORD)~MI_INTR_VI,&_Reg->MI_INTR_REG,"MI_INTR_REG");
BeforeCallDirect(m_RegWorkingSet);
MoveConstToX86reg((DWORD)_Reg,x86_ECX);
Call_Direct(AddressOf(&CRegisters::CheckInterrupts),"CRegisters::CheckInterrupts");
@ -884,10 +884,10 @@ void CMipsMemoryVM::Compile_SW_Const ( DWORD Value, DWORD VAddr ) {
case 0x04500008: MoveConstToVariable((Value & 1),&_Reg->AI_CONTROL_REG,"AI_CONTROL_REG"); break;
case 0x0450000C:
/* Clear Interrupt */;
AndConstToVariable(~MI_INTR_AI,&_Reg->MI_INTR_REG,"MI_INTR_REG");
AndConstToVariable((DWORD)~MI_INTR_AI,&_Reg->MI_INTR_REG,"MI_INTR_REG");
if (!bFixedAudio())
{
AndConstToVariable(~MI_INTR_AI,&_Reg->m_AudioIntrReg,"m_AudioIntrReg");
AndConstToVariable((DWORD)~MI_INTR_AI,&_Reg->m_AudioIntrReg,"m_AudioIntrReg");
}
BeforeCallDirect(m_RegWorkingSet);
MoveConstToX86reg((DWORD)_Reg,x86_ECX);
@ -925,7 +925,7 @@ void CMipsMemoryVM::Compile_SW_Const ( DWORD Value, DWORD VAddr ) {
break;
case 0x04600010:
if ((Value & PI_CLR_INTR) != 0 ) {
AndConstToVariable(~MI_INTR_PI,&_Reg->MI_INTR_REG,"MI_INTR_REG");
AndConstToVariable((DWORD)~MI_INTR_PI,&_Reg->MI_INTR_REG,"MI_INTR_REG");
BeforeCallDirect(m_RegWorkingSet);
MoveConstToX86reg((DWORD)_Reg,x86_ECX);
Call_Direct(AddressOf(&CRegisters::CheckInterrupts),"CRegisters::CheckInterrupts");
@ -974,8 +974,8 @@ void CMipsMemoryVM::Compile_SW_Const ( DWORD Value, DWORD VAddr ) {
AfterCallDirect(m_RegWorkingSet);
break;
case 0x04800018:
AndConstToVariable(~MI_INTR_SI,&_Reg->MI_INTR_REG,"MI_INTR_REG");
AndConstToVariable(~SI_STATUS_INTERRUPT,&_Reg->SI_STATUS_REG,"SI_STATUS_REG");
AndConstToVariable((DWORD)~MI_INTR_SI,&_Reg->MI_INTR_REG,"MI_INTR_REG");
AndConstToVariable((DWORD)~SI_STATUS_INTERRUPT,&_Reg->SI_STATUS_REG,"SI_STATUS_REG");
BeforeCallDirect(m_RegWorkingSet);
MoveConstToX86reg((DWORD)_Reg,x86_ECX);
Call_Direct(AddressOf(&CRegisters::CheckInterrupts),"CRegisters::CheckInterrupts");
@ -1116,7 +1116,7 @@ void CMipsMemoryVM::Compile_SW_Register (x86Reg Reg, DWORD VAddr )
break;
case 0x0440000C: MoveX86regToVariable(Reg,&_Reg->VI_INTR_REG,"VI_INTR_REG"); break;
case 0x04400010:
AndConstToVariable(~MI_INTR_VI,&_Reg->MI_INTR_REG,"MI_INTR_REG");
AndConstToVariable((DWORD)~MI_INTR_VI,&_Reg->MI_INTR_REG,"MI_INTR_REG");
BeforeCallDirect(m_RegWorkingSet);
MoveConstToX86reg((DWORD)_Reg,x86_ECX);
Call_Direct(AddressOf(&CRegisters::CheckInterrupts),"CRegisters::CheckInterrupts");
@ -1159,10 +1159,10 @@ void CMipsMemoryVM::Compile_SW_Register (x86Reg Reg, DWORD VAddr )
AndConstToVariable(1,&_Reg->AI_CONTROL_REG,"AI_CONTROL_REG");
case 0x0450000C:
/* Clear Interrupt */;
AndConstToVariable(~MI_INTR_AI,&_Reg->MI_INTR_REG,"MI_INTR_REG");
AndConstToVariable((DWORD)~MI_INTR_AI,&_Reg->MI_INTR_REG,"MI_INTR_REG");
if (!bFixedAudio())
{
AndConstToVariable(~MI_INTR_AI,&_Reg->m_AudioIntrReg,"m_AudioIntrReg");
AndConstToVariable((DWORD)~MI_INTR_AI,&_Reg->m_AudioIntrReg,"m_AudioIntrReg");
}
BeforeCallDirect(m_RegWorkingSet);
MoveConstToX86reg((DWORD)_Reg,x86_ECX);
@ -1199,7 +1199,7 @@ void CMipsMemoryVM::Compile_SW_Register (x86Reg Reg, DWORD VAddr )
break;
case 0x04600010:
if (_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { _Notify->DisplayError("Compile_SW_Register\ntrying to store at %X?",VAddr); }
AndConstToVariable(~MI_INTR_PI,&_Reg->MI_INTR_REG,"MI_INTR_REG");
AndConstToVariable((DWORD)~MI_INTR_PI,&_Reg->MI_INTR_REG,"MI_INTR_REG");
BeforeCallDirect(m_RegWorkingSet);
MoveConstToX86reg((DWORD)_Reg,x86_ECX);
Call_Direct(AddressOf(&CRegisters::CheckInterrupts),"CRegisters::CheckInterrupts");
@ -1253,8 +1253,8 @@ void CMipsMemoryVM::Compile_SW_Register (x86Reg Reg, DWORD VAddr )
AfterCallDirect(m_RegWorkingSet);
break;
case 0x04800018:
AndConstToVariable(~MI_INTR_SI,&_Reg->MI_INTR_REG,"MI_INTR_REG");
AndConstToVariable(~SI_STATUS_INTERRUPT,&_Reg->SI_STATUS_REG,"SI_STATUS_REG");
AndConstToVariable((DWORD)~MI_INTR_SI,&_Reg->MI_INTR_REG,"MI_INTR_REG");
AndConstToVariable((DWORD)~SI_STATUS_INTERRUPT,&_Reg->SI_STATUS_REG,"SI_STATUS_REG");
BeforeCallDirect(m_RegWorkingSet);
MoveConstToX86reg((DWORD)_Reg,x86_ECX);
Call_Direct(AddressOf(&CRegisters::CheckInterrupts),"CRegisters::CheckInterrupts");
@ -1326,7 +1326,7 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer )
return EXCEPTION_EXECUTE_HANDLER;
}
DWORD * Reg;
DWORD * Reg = NULL;
BYTE * TypePos = (unsigned char *)lpEP->ContextRecord->Eip;
EXCEPTION_RECORD exRec = *lpEP->ExceptionRecord;
@ -1433,6 +1433,12 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer )
return EXCEPTION_EXECUTE_HANDLER;
}
if (Reg == NULL)
{
if (bHaveDebugger()) { _Notify->BreakPoint(__FILE__,__LINE__); }
return EXCEPTION_EXECUTE_HANDLER;
}
switch(*TypePos) {
case 0x0F:
switch(*(TypePos + 1)) {
@ -1596,7 +1602,7 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer )
return EXCEPTION_EXECUTE_HANDLER;
}
int CMipsMemoryVM::LB_NonMemory ( DWORD PAddr, DWORD * Value, BOOL SignExtend ) {
int CMipsMemoryVM::LB_NonMemory ( DWORD /*PAddr*/, DWORD * Value, BOOL /*SignExtend*/ ) {
_Notify->BreakPoint(__FILE__,__LINE__);
#ifdef tofix
if (PAddr >= 0x10000000 && PAddr < 0x16000000) {
@ -1624,7 +1630,8 @@ int CMipsMemoryVM::LB_NonMemory ( DWORD PAddr, DWORD * Value, BOOL SignExtend )
// return TRUE;
}
int CMipsMemoryVM::LH_NonMemory ( DWORD PAddr, DWORD * Value, int SignExtend ) {
int CMipsMemoryVM::LH_NonMemory ( DWORD /*PAddr*/, DWORD * Value, int/* SignExtend*/ ) {
_Notify->BreakPoint(__FILE__,__LINE__);
// switch (PAddr & 0xFFF00000) {
// default:
* Value = 0;
@ -2711,7 +2718,7 @@ void CMipsMemoryVM::Compile_LWC1 (void)
void CMipsMemoryVM::Compile_LWL (void)
{
OPCODE & Opcode = CRecompilerOps::m_Opcode;
x86Reg TempReg1, TempReg2, OffsetReg, shift;
x86Reg TempReg1 = x86_Unknown, TempReg2 = x86_Unknown, OffsetReg = x86_Unknown, shift = x86_Unknown;
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(Opcode.Hex,m_CompilePC));
@ -2756,7 +2763,7 @@ void CMipsMemoryVM::Compile_LWL (void)
OffsetReg = Map_TempReg(x86_Any,-1,FALSE);
MoveX86RegToX86Reg(TempReg1, OffsetReg);
AndConstToX86Reg(OffsetReg,3);
AndConstToX86Reg(TempReg1,~3);
AndConstToX86Reg(TempReg1,(DWORD)~3);
Map_GPR_32bit(Opcode.rt,TRUE,Opcode.rt);
AndVariableDispToX86Reg((void *)LWL_MASK,"LWL_MASK",MipsRegMapLo(Opcode.rt),OffsetReg,Multip_x4);
@ -2774,7 +2781,7 @@ void CMipsMemoryVM::Compile_LWL (void)
void CMipsMemoryVM::Compile_LWR (void)
{
OPCODE & Opcode = CRecompilerOps::m_Opcode;
x86Reg TempReg1, TempReg2, OffsetReg, shift;
x86Reg TempReg1 = x86_Unknown, TempReg2 = x86_Unknown, OffsetReg = x86_Unknown, shift = x86_Unknown;
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(Opcode.Hex,m_CompilePC));
@ -2820,7 +2827,7 @@ void CMipsMemoryVM::Compile_LWR (void)
OffsetReg = Map_TempReg(x86_Any,-1,FALSE);
MoveX86RegToX86Reg(TempReg1, OffsetReg);
AndConstToX86Reg(OffsetReg,3);
AndConstToX86Reg(TempReg1,~3);
AndConstToX86Reg(TempReg1,(DWORD)~3);
Map_GPR_32bit(Opcode.rt,TRUE,Opcode.rt);
AndVariableDispToX86Reg((void *)LWR_MASK,"LWR_MASK",MipsRegMapLo(Opcode.rt),OffsetReg,Multip_x4);
@ -3336,7 +3343,8 @@ void CMipsMemoryVM::Compile_SWC1 (void)
void CMipsMemoryVM::Compile_SWL (void)
{
OPCODE & Opcode = CRecompilerOps::m_Opcode;
x86Reg TempReg1, TempReg2, Value, shift, OffsetReg;
x86Reg TempReg1 = x86_Unknown, TempReg2 = x86_Unknown, Value = x86_Unknown,
shift = x86_Unknown, OffsetReg = x86_Unknown;
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(Opcode.Hex,m_CompilePC));
@ -3383,7 +3391,7 @@ void CMipsMemoryVM::Compile_SWL (void)
OffsetReg = Map_TempReg(x86_Any,-1,FALSE);
MoveX86RegToX86Reg(TempReg1, OffsetReg);
AndConstToX86Reg(OffsetReg,3);
AndConstToX86Reg(TempReg1,~3);
AndConstToX86Reg(TempReg1,(DWORD)~3);
Value = Map_TempReg(x86_Any,-1,FALSE);
if (bUseTlb()) {
@ -3421,7 +3429,8 @@ void CMipsMemoryVM::Compile_SWL (void)
void CMipsMemoryVM::Compile_SWR (void)
{
OPCODE & Opcode = CRecompilerOps::m_Opcode;
x86Reg TempReg1, TempReg2, Value, OffsetReg, shift;
x86Reg TempReg1 = x86_Unknown, TempReg2 = x86_Unknown, Value = x86_Unknown,
OffsetReg = x86_Unknown, shift = x86_Unknown;
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(Opcode.Hex,m_CompilePC));
@ -3466,7 +3475,7 @@ void CMipsMemoryVM::Compile_SWR (void)
OffsetReg = Map_TempReg(x86_Any,-1,FALSE);
MoveX86RegToX86Reg(TempReg1, OffsetReg);
AndConstToX86Reg(OffsetReg,3);
AndConstToX86Reg(TempReg1,~3);
AndConstToX86Reg(TempReg1,(DWORD)~3);
Value = Map_TempReg(x86_Any,-1,FALSE);
if (bUseTlb()) {

View File

@ -78,7 +78,7 @@ void CCodeBlock::CompileExitCode ( void )
CPU_Message(" $Exit_%d",ExitIter->ID);
SetJump32(ExitIter->JumpLoc,(DWORD *)m_RecompPos);
m_NextInstruction = ExitIter->NextInstruction;
m_EnterSection.CompileExit(-1, ExitIter->TargetPC,ExitIter->ExitRegSet,ExitIter->reason,true,NULL);
m_EnterSection.CompileExit((DWORD)-1, ExitIter->TargetPC,ExitIter->ExitRegSet,ExitIter->reason,true,NULL);
}
}

View File

@ -338,7 +338,7 @@ void CCodeSection::GenerateSectionLinkage (void)
if (JumpInfo[i]->LinkLocation == NULL &&
JumpInfo[i]->FallThrough == false)
{
JumpInfo[i]->TargetPC = -1;
JumpInfo[i]->TargetPC = (DWORD)-1;
}
}
@ -412,7 +412,7 @@ void CCodeSection::GenerateSectionLinkage (void)
MoveConstToX86reg((DWORD)_SystemTimer,x86_ECX);
Call_Direct(AddressOf(&CSystemTimer::TimerDone),"CSystemTimer::TimerDone");
CPU_Message("CompileSystemCheck 3");
CompileSystemCheck(-1,m_Jump.RegSet);
CompileSystemCheck((DWORD)-1,m_Jump.RegSet);
}
}
if (TargetSection[0] != TargetSection[1] || TargetSection[0] == NULL) {
@ -491,7 +491,7 @@ void CCodeSection::GenerateSectionLinkage (void)
//JumpInfo[i]->RegSet.BlockCycleCount() += CountPerOp();
UpdateCounters(JumpInfo[i]->RegSet,true,true);
CPU_Message("CompileSystemCheck 4");
CompileSystemCheck(-1,JumpInfo[i]->RegSet);
CompileSystemCheck((DWORD)-1,JumpInfo[i]->RegSet);
} else {
UpdateCounters(JumpInfo[i]->RegSet,true,true);
CPU_Message("CompileSystemCheck 5");
@ -527,7 +527,7 @@ void CCodeSection::GenerateSectionLinkage (void)
Call_Direct(AddressOf(CInterpreterCPU::InPermLoop),"CInterpreterCPU::InPermLoop");
UpdateCounters(JumpInfo[i]->RegSet,true,true);
CPU_Message("CompileSystemCheck 6");
CompileSystemCheck(-1,JumpInfo[i]->RegSet);
CompileSystemCheck((DWORD)-1,JumpInfo[i]->RegSet);
}
if (JumpInfo[i]->FallThrough) {
JumpInfo[i]->FallThrough = false;
@ -594,7 +594,7 @@ void CCodeSection::GenerateSectionLinkage (void)
MoveConstToVariable(JumpInfo[i]->TargetPC,_PROGRAM_COUNTER,"PROGRAM_COUNTER");
Call_Direct(AddressOf(CInterpreterCPU::InPermLoop),"CInterpreterCPU::InPermLoop");
CPU_Message("CompileSystemCheck 8");
CompileSystemCheck(-1,JumpInfo[i]->RegSet);
CompileSystemCheck((DWORD)-1,JumpInfo[i]->RegSet);
} else {
CPU_Message("CompileSystemCheck 9");
CompileSystemCheck(JumpInfo[i]->TargetPC,JumpInfo[i]->RegSet);
@ -876,7 +876,7 @@ bool CCodeSection::CreateSectionLinkage ( void )
{
return false;
}
(*TargetSection[i])->m_Jump.TargetPC = -1;
(*TargetSection[i])->m_Jump.TargetPC = (DWORD)-1;
(*TargetSection[i])->m_Cont.TargetPC = JumpInfo[i]->TargetPC;
(*TargetSection[i])->m_Cont.FallThrough = true;
(*TargetSection[i])->m_Cont.RegSet = (*TargetSection[i])->m_RegWorkingSet;
@ -2105,7 +2105,7 @@ bool CCodeSection::FillSectionInfo(STEP_TYPE StartStepType)
}
if (Value1 == Value2)
{
m_Cont.TargetPC = -1;
m_Cont.TargetPC = (DWORD)-1;
}
}
break;
@ -2620,7 +2620,7 @@ bool CCodeSection::InheritParentInfo ( void )
ParentList.push_back(BlockParent);
}
}
int NoOfCompiledParents = ParentList.size();
size_t NoOfCompiledParents = ParentList.size();
if (NoOfCompiledParents == 0)
{
_Notify->DisplayError("No Parent has been compiled ????");
@ -2647,8 +2647,8 @@ bool CCodeSection::InheritParentInfo ( void )
ParentList.push_back(BlockParent);
}
}
int FirstParent = 0;
for (int i = 1;i < NoOfCompiledParents;i++) {
size_t FirstParent = 0;
for (size_t i = 1;i < NoOfCompiledParents;i++) {
if (ParentList[i].JumpInfo->FallThrough) {
FirstParent = i; break;
}
@ -2778,7 +2778,7 @@ bool CCodeSection::InheritParentInfo ( void )
stdstr_f Label("Section_%d",m_SectionID);
int CurrentParent = FirstParent;
bool NeedSync = false;
for (int i = 0; i < NoOfCompiledParents; i++)
for (size_t i = 0; i < NoOfCompiledParents; i++)
{
CRegInfo * RegSet;
int i2;
@ -2877,7 +2877,7 @@ bool CCodeSection::InheritParentInfo ( void )
m_RegEnter = m_RegWorkingSet;
}
for (int i = 0; i < NoOfCompiledParents;i++) {
for (size_t i = 0; i < NoOfCompiledParents;i++) {
Parent = ParentList[i].Parent;
JumpInfo = ParentList[i].JumpInfo;

View File

@ -851,7 +851,7 @@ CCompiledFunc * CRecompiler::CompilerCode ( void )
CheckRecompMem();
DWORD StartTime = timeGetTime();
//DWORD StartTime = timeGetTime();
WriteTraceF(TraceRecompiler,"Compile Block-Start: Program Counter: %X pAddr: %X",PROGRAM_COUNTER,pAddr);
CCodeBlock CodeBlock(PROGRAM_COUNTER, RecompPos());
@ -923,7 +923,6 @@ void CRecompiler::ClearRecompCode_Virt(DWORD Address, int length,REMOVE_REASON R
{
DWORD AddressIndex = Address >> 0xC;
DWORD WriteStart = (Address & 0xFFC);
bool bUnProtect = false;
length = ((length + 3) & ~0x3);
int DataInBlock = 0x1000 - WriteStart;

View File

@ -865,7 +865,7 @@ void CRecompilerOps::BGTZ_Compare (void) {
m_Section->m_Jump.LinkLocation = (DWORD *)(m_RecompPos - 4);
}
} else {
BYTE *Jump;
BYTE *Jump = NULL;
if (IsMapped(m_Opcode.rs)) {
CompConstToX86reg(MipsRegMapHi(m_Opcode.rs),0);
@ -957,7 +957,7 @@ void CRecompilerOps::BLEZ_Compare (void) {
m_Section->m_Jump.LinkLocation = (DWORD *)(m_RecompPos - 4);
}
} else {
BYTE *Jump;
BYTE *Jump = NULL;
if (IsMapped(m_Opcode.rs)) {
CompConstToX86reg(MipsRegMapHi(m_Opcode.rs),0);
@ -1448,14 +1448,10 @@ void CRecompilerOps::SLTI (void)
if (m_Opcode.rt == 0) { return; }
if (IsConst(m_Opcode.rs)) {
DWORD Result;
DWORD Result = Is64Bit(m_Opcode.rs) ?
((__int64)MipsReg(m_Opcode.rs) < (__int64)((short)m_Opcode.immediate) ? 1:0) :
( MipsRegLo_S(m_Opcode.rs) < (short)m_Opcode.immediate?1:0);
if (Is64Bit(m_Opcode.rs)) {
__int64 Immediate = (__int64)((short)m_Opcode.immediate);
Result = (__int64)MipsReg(m_Opcode.rs) < Immediate?1:0;
} else if (Is32Bit(m_Opcode.rs)) {
Result = MipsRegLo_S(m_Opcode.rs) < (short)m_Opcode.immediate?1:0;
}
UnMap_GPR(m_Opcode.rt, FALSE);
m_RegWorkingSet.SetMipsRegState(m_Opcode.rt,CRegInfo::STATE_CONST_32);
MipsRegLo(m_Opcode.rt) = Result;
@ -2031,7 +2027,7 @@ void CRecompilerOps::SPECIAL_JR (void) {
} else {
MoveX86regToVariable(Map_TempReg(x86_Any,m_Opcode.rs,FALSE),_PROGRAM_COUNTER, "PROGRAM_COUNTER");
}
m_Section->CompileExit(-1, (DWORD)-1,m_RegWorkingSet,CExitInfo::Normal,TRUE,NULL);
m_Section->CompileExit((DWORD)-1, (DWORD)-1,m_RegWorkingSet,CExitInfo::Normal,TRUE,NULL);
if (m_Section->m_JumpSection)
{
m_Section->GenerateSectionLinkage();
@ -2103,7 +2099,7 @@ void CRecompilerOps::SPECIAL_JALR (void)
void CRecompilerOps::SPECIAL_SYSCALL (void) {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
m_Section->CompileExit(m_CompilePC,-1,m_RegWorkingSet,CExitInfo::DoSysCall,TRUE,NULL);
m_Section->CompileExit(m_CompilePC,(DWORD)-1,m_RegWorkingSet,CExitInfo::DoSysCall,TRUE,NULL);
m_NextInstruction = END_BLOCK;
}
@ -2187,8 +2183,9 @@ void CRecompilerOps::SPECIAL_DSLLV (void) {
CPU_Message(" %X %s",m_CompilePC,R4300iOpcodeName(m_Opcode.Hex,m_CompilePC));
if (m_Opcode.rd == 0) { return; }
if (IsConst(m_Opcode.rs)) {
DWORD Shift = (cMipsRegLo(m_Opcode.rs) & 0x3F);
if (IsConst(m_Opcode.rs))
{
//DWORD Shift = (cMipsRegLo(m_Opcode.rs) & 0x3F);
CRecompilerOps::UnknownOpcode();
return;
}
@ -3539,7 +3536,7 @@ void CRecompilerOps::SPECIAL_SLTU (void) {
ProtectGPR(KnownReg);
if (b32BitCore())
{
int TestReg = IsConst(KnownReg)?m_Opcode.rs:m_Opcode.rt;
DWORD TestReg = IsConst(KnownReg)?m_Opcode.rs:m_Opcode.rt;
if (IsConst(KnownReg)) {
DWORD Value = MipsRegLo(KnownReg);
Map_GPR_32bit(m_Opcode.rd,TRUE,-1);
@ -3547,7 +3544,8 @@ void CRecompilerOps::SPECIAL_SLTU (void) {
} else {
CompX86regToVariable(MipsRegMapLo(KnownReg),&_GPR[UnknownReg].W[0],CRegName::GPR_Lo[UnknownReg]);
}
if (KnownReg == TestReg) {
if (KnownReg == TestReg)
{
SetaVariable(&m_BranchCompare,"m_BranchCompare");
} else {
SetbVariable(&m_BranchCompare,"m_BranchCompare");
@ -4036,7 +4034,7 @@ void CRecompilerOps::COP0_MT (void) {
} else {
MoveX86regToVariable(Map_TempReg(x86_Any,m_Opcode.rt,FALSE), &_CP0[m_Opcode.rd], CRegName::Cop0[m_Opcode.rd]);
}
AndConstToVariable(~CAUSE_IP7,&_Reg->FAKE_CAUSE_REGISTER,"FAKE_CAUSE_REGISTER");
AndConstToVariable((DWORD)~CAUSE_IP7,&_Reg->FAKE_CAUSE_REGISTER,"FAKE_CAUSE_REGISTER");
BeforeCallDirect(m_RegWorkingSet);
MoveConstToX86reg((DWORD)_SystemTimer,x86_ECX);
Call_Direct(AddressOf(&CSystemTimer::UpdateCompareTimer), "CSystemTimer::UpdateCompareTimer");
@ -4642,7 +4640,7 @@ void CRecompilerOps::COP1_S_CMP (void) {
MoveVariableToX86reg((BYTE *)&_FPR_S[Reg2],Name,TempReg);
fpuComDwordRegPointer(TempReg,FALSE);
}
AndConstToVariable(~FPCSR_C, &_FPCR[31], "_FPCR[31]");
AndConstToVariable((DWORD)~FPCSR_C, &_FPCR[31], "_FPCR[31]");
fpuStoreStatus();
x86Reg Reg = Map_TempReg(x86_Any8Bit, 0, FALSE);
TestConstToX86Reg(cmp,x86_EAX);
@ -4967,7 +4965,7 @@ void CRecompilerOps::COP1_D_CMP (void) {
Load_FPR_ToTop(Reg1,Reg1, CRegInfo::FPU_Double);
fpuComQwordRegPointer(TempReg,FALSE);
}
AndConstToVariable(~FPCSR_C, &_FPCR[31], "_FPCR[31]");
AndConstToVariable((DWORD)~FPCSR_C, &_FPCR[31], "_FPCR[31]");
fpuStoreStatus();
x86Reg Reg = Map_TempReg(x86_Any8Bit, 0, FALSE);
TestConstToX86Reg(cmp,x86_EAX);

View File

@ -3605,6 +3605,11 @@ void CX86Ops::SetJump32(DWORD * Loc, DWORD * JumpLoc)
void CX86Ops::SetJump8(BYTE * Loc, BYTE * JumpLoc)
{
if (Loc == NULL || JumpLoc == NULL)
{
_Notify->BreakPoint(__FILE__,__LINE__);
return;
}
DWORD diffrence = (DWORD)(((DWORD)JumpLoc) - (((DWORD)(Loc)) + 1));
if (diffrence > 255)
{

View File

@ -287,8 +287,8 @@ void CAudioPlugin::DacrateChanged (SystemType Type)
if (!Initilized()) { return; }
WriteTraceF(TraceAudio,__FUNCTION__ ": SystemType: %s", Type == SYSTEM_NTSC ? "SYSTEM_NTSC" : "SYSTEM_PAL");
DWORD Frequency = _Reg->AI_DACRATE_REG * 30;
DWORD CountsPerSecond = (_Reg->VI_V_SYNC_REG != 0 ? (_Reg->VI_V_SYNC_REG + 1) * _Settings->LoadDword(Game_ViRefreshRate) : 500000) * 60;
//DWORD Frequency = _Reg->AI_DACRATE_REG * 30;
//DWORD CountsPerSecond = (_Reg->VI_V_SYNC_REG != 0 ? (_Reg->VI_V_SYNC_REG + 1) * _Settings->LoadDword(Game_ViRefreshRate) : 500000) * 60;
m_DacrateChanged(Type);
}

View File

@ -207,6 +207,7 @@ public:
void RegisterClass()
{
T* pT = static_cast<T*>(this);
pT = pT;
pT->GetWndClassInfo().m_wc.lpfnWndProc = m_pfnSuperWindowProc;
pT->GetWndClassInfo().Register( &m_pfnSuperWindowProc );
}
@ -3547,7 +3548,7 @@ public:
listSubItem.m_rgbBackground = m_rgbBackground;
listSubItem.m_rgbText = m_rgbItemText;
listSubItem.m_rgbSelectedText = m_rgbSelectedText;
listSubItem.m_nMaxEditLen = -1;
listSubItem.m_nMaxEditLen = (UINT)-1;
CListItem< TData > listItem;
for ( int nSubItem = 0; nSubItem < GetColumnCount(); nSubItem++ )