Fix a few compiler/valgrind warnings, kill check for 17th texenv registers,

and one problem reading a truncated sram file.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5474 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
pierre 2010-05-24 14:53:27 +00:00
parent 4b1909ea98
commit 2e12bd5e34
7 changed files with 35 additions and 17 deletions

View File

@ -144,6 +144,8 @@ CEXIIPL::CEXIIPL() :
m_count(0),
m_FontsLoaded(false)
{
memset(m_szBuffer,0,sizeof(m_szBuffer));
// Determine region
m_bNTSC = SConfig::GetInstance().m_LocalCoreStartupParameter.bNTSC;
@ -175,7 +177,10 @@ CEXIIPL::CEXIIPL() :
FILE *file = fopen(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strSRAM.c_str(), "rb");
if (file != NULL)
{
fread(&m_SRAM, 1, 64, file);
if (fread(&m_SRAM, 1, 64, file) < 64) {
ERROR_LOG(EXPANSIONINTERFACE, "EXI IPL-DEV: Could not read all of SRAM");
m_SRAM = sram_dump;
}
fclose(file);
}
else

View File

@ -174,6 +174,11 @@ void Jit64::cmpXX(UGeckoInstruction inst)
less_than = CC_L;
greater_than = CC_G;
comparand = Imm32((s32)(s16)inst.UIMM);
} else {
PanicAlert("cmpXX");
less_than = CC_O;
greater_than = CC_O;
comparand = Imm32(0);
}
}

View File

@ -452,6 +452,8 @@ void Jit64::stXx(UGeckoInstruction inst)
case 151: accessSize = 32; break;
case 407: accessSize = 16; break;
case 215: accessSize = 8; break;
default: PanicAlert("stXx: invalid access size");
accessSize = 0; break;
}
MOV(32, R(ECX), gpr.R(s));

View File

@ -1551,6 +1551,7 @@ static void DoWriteCode(IRBuilder* ibuild, JitIL* Jit, bool UseProfile, bool Mak
case ICmpSlt: flag = CC_GE; break;
case ICmpSge: flag = CC_L; break;
case ICmpSle: flag = CC_G; break;
default: PanicAlert("cmpXX"); flag = CC_O; break;
}
FixupBranch cont = Jit->J_CC(flag);
regWriteExit(RI, getOp2(I));

View File

@ -62,7 +62,7 @@ void JitIL::lXz(UGeckoInstruction inst)
case 32: val = ibuild.EmitLoad32(addr); break; //lwz
case 40: val = ibuild.EmitLoad16(addr); break; //lhz
case 34: val = ibuild.EmitLoad8(addr); break; //lbz - lbzu crashes GFZP01 @ 0x8008575C
default: PanicAlert("lXz: invalid access size");
default: PanicAlert("lXz: invalid access size"); val = 0; break;
}
ibuild.EmitStoreGReg(val, inst.RD);
}

View File

@ -274,6 +274,11 @@ void BPWritten(const BPCmd& bp)
break;
}
case BPMEM_FOGRANGE: // Fog Settings Control
case BPMEM_FOGRANGE+1:
case BPMEM_FOGRANGE+2:
case BPMEM_FOGRANGE+3:
case BPMEM_FOGRANGE+4:
case BPMEM_FOGRANGE+5:
case BPMEM_FOGPARAM0:
case BPMEM_FOGBMAGNITUDE:
case BPMEM_FOGBEXPONENT:
@ -547,32 +552,32 @@ void BPWritten(const BPCmd& bp)
case BPMEM_TEV_ALPHA_ENV+2:
case BPMEM_TEV_COLOR_ENV+4: // Texture Environment 3
case BPMEM_TEV_ALPHA_ENV+4:
case BPMEM_TEV_COLOR_ENV+8: // Texture Environment 4
case BPMEM_TEV_COLOR_ENV+6: // Texture Environment 4
case BPMEM_TEV_ALPHA_ENV+6:
case BPMEM_TEV_COLOR_ENV+8: // Texture Environment 5
case BPMEM_TEV_ALPHA_ENV+8:
case BPMEM_TEV_COLOR_ENV+10: // Texture Environment 5
case BPMEM_TEV_COLOR_ENV+10: // Texture Environment 6
case BPMEM_TEV_ALPHA_ENV+10:
case BPMEM_TEV_COLOR_ENV+12: // Texture Environment 6
case BPMEM_TEV_COLOR_ENV+12: // Texture Environment 7
case BPMEM_TEV_ALPHA_ENV+12:
case BPMEM_TEV_COLOR_ENV+14: // Texture Environment 7
case BPMEM_TEV_COLOR_ENV+14: // Texture Environment 8
case BPMEM_TEV_ALPHA_ENV+14:
case BPMEM_TEV_COLOR_ENV+16: // Texture Environment 8
case BPMEM_TEV_COLOR_ENV+16: // Texture Environment 9
case BPMEM_TEV_ALPHA_ENV+16:
case BPMEM_TEV_COLOR_ENV+18: // Texture Environment 9
case BPMEM_TEV_COLOR_ENV+18: // Texture Environment 10
case BPMEM_TEV_ALPHA_ENV+18:
case BPMEM_TEV_COLOR_ENV+20: // Texture Environment 10
case BPMEM_TEV_COLOR_ENV+20: // Texture Environment 11
case BPMEM_TEV_ALPHA_ENV+20:
case BPMEM_TEV_COLOR_ENV+22: // Texture Environment 11
case BPMEM_TEV_COLOR_ENV+22: // Texture Environment 12
case BPMEM_TEV_ALPHA_ENV+22:
case BPMEM_TEV_COLOR_ENV+24: // Texture Environment 12
case BPMEM_TEV_COLOR_ENV+24: // Texture Environment 13
case BPMEM_TEV_ALPHA_ENV+24:
case BPMEM_TEV_COLOR_ENV+26: // Texture Environment 13
case BPMEM_TEV_COLOR_ENV+26: // Texture Environment 14
case BPMEM_TEV_ALPHA_ENV+26:
case BPMEM_TEV_COLOR_ENV+28: // Texture Environment 14
case BPMEM_TEV_COLOR_ENV+28: // Texture Environment 15
case BPMEM_TEV_ALPHA_ENV+28:
case BPMEM_TEV_COLOR_ENV+30: // Texture Environment 15
case BPMEM_TEV_COLOR_ENV+30: // Texture Environment 16
case BPMEM_TEV_ALPHA_ENV+30:
case BPMEM_TEV_COLOR_ENV+32: // Texture Environment 16
case BPMEM_TEV_ALPHA_ENV+32:
break;
default:
WARN_LOG(VIDEO, "Unknown BP opcode: address = 0x%08x value = 0x%08x", bp.address, bp.newvalue);

View File

@ -204,7 +204,7 @@ void ConfigDialog::UpdateBitmaps(wxTimerEvent& WXUNUSED(event))
dc.DrawRectangle(n*12, 0, 14, 12);
}
delete bitmasks;
delete[] bitmasks;
}
break;