linux x64 compile fix and a small spelling correction
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1013 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
6568a0e8aa
commit
34d408b860
|
@ -339,9 +339,9 @@ void decryptcode(u32 *seeds, u32 *code)
|
|||
setcode(code,val,addr);
|
||||
}
|
||||
|
||||
u8 getbitstring(u32 *ctrl, u32 *out, u8 len)
|
||||
bool getbitstring(u32 *ctrl, u32 *out, u8 len)
|
||||
{
|
||||
u32 *ptr=(u32*)(ctrl[0]+(ctrl[1]<<2));
|
||||
u32 tmp=(ctrl[0]+(ctrl[1]<<2));
|
||||
|
||||
*out = 0;
|
||||
while (len--)
|
||||
|
@ -350,16 +350,16 @@ u8 getbitstring(u32 *ctrl, u32 *out, u8 len)
|
|||
{
|
||||
ctrl[2] = 0;
|
||||
ctrl[1]++;
|
||||
ptr = (u32*)(ctrl[0]+(ctrl[1]<<2));
|
||||
tmp = (ctrl[0]+(ctrl[1]<<2));
|
||||
}
|
||||
if (ctrl[1] >= ctrl[3]) return 0;
|
||||
*out = ((*out<<1) | ((*ptr >> (0x1F-ctrl[2])) & 1));
|
||||
if (ctrl[1] >= ctrl[3]) return false;
|
||||
*out = ((*out<<1) | ((tmp >> (0x1F-ctrl[2])) & 1));
|
||||
ctrl[2]++;
|
||||
}
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
u8 batchdecrypt(u32 *codes, u16 size)
|
||||
bool batchdecrypt(u32 *codes, u16 size)
|
||||
{
|
||||
u32 tmp,*ptr=codes;
|
||||
u32 tmparray[4] = { 0 },tmparray2[8] = { 0 };
|
||||
|
@ -375,7 +375,7 @@ u8 batchdecrypt(u32 *codes, u16 size)
|
|||
ptr+=2;
|
||||
}
|
||||
|
||||
tmparray[0] = (u32)codes;
|
||||
tmparray[0] = *codes;
|
||||
tmparray[1] = 0;
|
||||
tmparray[2] = 4; // Skip crc
|
||||
tmparray[3] = size;
|
||||
|
@ -392,9 +392,9 @@ u8 batchdecrypt(u32 *codes, u16 size)
|
|||
|
||||
tmp = codes[0];
|
||||
codes[0] &= 0x0FFFFFFF;
|
||||
if ((tmp>>28) != verifycode(codes,size)) return 0;
|
||||
if ((tmp>>28) != verifycode(codes,size)) return false;
|
||||
|
||||
return 1;
|
||||
return true;
|
||||
|
||||
// Unfinished (so says Parasyte :p )
|
||||
}
|
||||
|
@ -476,15 +476,16 @@ void DecryptARCode(std::vector<std::string> vCodes, std::vector<AREntry> &ops)
|
|||
//PanicAlert("Encrypted AR Code\n%s", vCodes[i].c_str());
|
||||
}
|
||||
|
||||
if ((ret=alphatobin(uCodes, vCodes, vCodes.size())))
|
||||
if ((ret=alphatobin(uCodes, vCodes, (int)vCodes.size())))
|
||||
{
|
||||
PanicAlert("Action Replay Code Decryption Error:\nParity Check Failed\n\nCulprit Code:\n%s", vCodes[ret].c_str());
|
||||
batchdecrypt(uCodes, vCodes.size()<<1);
|
||||
batchdecrypt(uCodes, (u16)vCodes.size()<<1);
|
||||
}
|
||||
else if (!batchdecrypt(uCodes, vCodes.size()<<1))
|
||||
else if (!batchdecrypt(uCodes, (u16)vCodes.size()<<1))
|
||||
{
|
||||
PanicAlert("Action Replay Code Decryption Error:\nCRC Check Failed\n\n"
|
||||
"First Code in Block(should be verification code):\n%s", vCodes[0].c_str());
|
||||
// Commented out since we just send the code anyways and hope for the best XD
|
||||
//PanicAlert("Action Replay Code Decryption Error:\nCRC Check Failed\n\n"
|
||||
// "First Code in Block(should be verification code):\n%s", vCodes[0].c_str());
|
||||
|
||||
for (i = 0; i < (vCodes.size()<<1); i+=2)
|
||||
{
|
||||
|
|
|
@ -297,7 +297,7 @@ writeFn32 GetHWWriteFun32(const u32 _Address)
|
|||
}
|
||||
|
||||
|
||||
#define ReadFromHardware2(_var, _type, _Address, EffictiveAddress, flag) \
|
||||
#define ReadFromHardware2(_var, _type, _Address, EffectiveAddress, flag) \
|
||||
{ \
|
||||
if ((_Address & 0xC8000000) == 0xC8000000) \
|
||||
if (_Address < 0xcc000000) \
|
||||
|
@ -341,7 +341,7 @@ writeFn32 GetHWWriteFun32(const u32 _Address)
|
|||
else {/* LOG(MEMMAP,"READ (unknown): %08x (PC: %08x)",_Address,PC);*/ \
|
||||
/*CCPU::EnableStepping(TRUE);*/ \
|
||||
/*PanicAlert("READ: Unknown Address", "1", MB_OK);*/ \
|
||||
u32 tmpAddress = CheckDTLB(EffictiveAddress, flag); \
|
||||
u32 tmpAddress = CheckDTLB(EffectiveAddress, flag); \
|
||||
tmpAddress =(tmpAddress & 0xFFFFFFF0) | (_Address & 0xF); \
|
||||
if (!(PowerPC::ppcState.Exceptions & EXCEPTION_DSI)) \
|
||||
_var = bswap((*(u##_type*)&m_pRAM[tmpAddress & RAM_MASK])); \
|
||||
|
@ -350,7 +350,7 @@ writeFn32 GetHWWriteFun32(const u32 _Address)
|
|||
}
|
||||
|
||||
|
||||
#define WriteToHardware2(_type, _Address, _Data, EffictiveAddress, flag) \
|
||||
#define WriteToHardware2(_type, _Address, _Data, EffectiveAddress, flag) \
|
||||
{ \
|
||||
if ((_Address & 0xC8000000) == 0xC8000000) \
|
||||
{ \
|
||||
|
@ -413,7 +413,7 @@ writeFn32 GetHWWriteFun32(const u32 _Address)
|
|||
/* LOG(MEMMAP,"WRITE: %08x (PC: %08x)",_Address,PC);*/ \
|
||||
/*MessageBox(NULL, "WRITE: unknown Address", "1", MB_OK);*/ \
|
||||
/*CCPU::EnableStepping(TRUE);*/ \
|
||||
u32 tmpAddress = CheckDTLB(EffictiveAddress, flag); \
|
||||
u32 tmpAddress = CheckDTLB(EffectiveAddress, flag); \
|
||||
tmpAddress = (tmpAddress & 0xFFFFFFF0) | (_Address & 0xF); \
|
||||
*(u##_type*)&m_pRAM[tmpAddress & RAM_MASK] = bswap(_Data); \
|
||||
} \
|
||||
|
|
Loading…
Reference in New Issue