mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Merge branch 'master' into vertexcache
This commit is contained in:
commit
04860322f4
37 changed files with 460 additions and 331 deletions
|
@ -178,6 +178,15 @@ void XEmitter::ABI_CallFunctionA(void *func, const Gen::OpArg &arg1)
|
|||
ABI_RestoreStack(1 * 4);
|
||||
}
|
||||
|
||||
void XEmitter::ABI_CallFunctionAA(void *func, const Gen::OpArg &arg1, const Gen::OpArg &arg2)
|
||||
{
|
||||
ABI_AlignStack(2 * 4);
|
||||
PUSH(32, arg2);
|
||||
PUSH(32, arg1);
|
||||
CALL(func);
|
||||
ABI_RestoreStack(2 * 4);
|
||||
}
|
||||
|
||||
void XEmitter::ABI_PushAllCalleeSavedRegsAndAdjustStack() {
|
||||
// Note: 4 * 4 = 16 bytes, so alignment is preserved.
|
||||
PUSH(EBP);
|
||||
|
@ -445,6 +454,23 @@ void XEmitter::ABI_CallFunctionA(void *func, const Gen::OpArg &arg1)
|
|||
}
|
||||
}
|
||||
|
||||
void XEmitter::ABI_CallFunctionAA(void *func, const Gen::OpArg &arg1, const Gen::OpArg &arg2)
|
||||
{
|
||||
if (!arg1.IsSimpleReg(ABI_PARAM1))
|
||||
MOV(32, R(ABI_PARAM1), arg1);
|
||||
if (!arg2.IsSimpleReg(ABI_PARAM2))
|
||||
MOV(32, R(ABI_PARAM2), arg2);
|
||||
u64 distance = u64(func) - (u64(code) + 5);
|
||||
if (distance >= 0x0000000080000000ULL
|
||||
&& distance < 0xFFFFFFFF80000000ULL) {
|
||||
// Far call
|
||||
MOV(64, R(RAX), Imm64((u64)func));
|
||||
CALLptr(R(RAX));
|
||||
} else {
|
||||
CALL(func);
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int XEmitter::ABI_GetAlignedFrameSize(unsigned int frameSize) {
|
||||
return frameSize;
|
||||
}
|
||||
|
|
|
@ -479,7 +479,7 @@ public:
|
|||
u8 *compressed_buffer = new u8[comp_len];
|
||||
snappy_compress((const char *)buffer, sz, (char *)compressed_buffer, &comp_len);
|
||||
delete [] buffer;
|
||||
header.ExpectedSize = comp_len;
|
||||
header.ExpectedSize = (int)comp_len;
|
||||
if (!pFile.WriteArray(&header, 1))
|
||||
{
|
||||
ERROR_LOG(COMMON,"ChunkReader: Failed writing header");
|
||||
|
|
|
@ -250,8 +250,8 @@ std::string ReplaceAll(std::string result, const std::string& src, const std::st
|
|||
{
|
||||
while(1)
|
||||
{
|
||||
const int pos = result.find(src);
|
||||
if (pos == -1) break;
|
||||
const size_t pos = result.find(src);
|
||||
if (pos == result.npos) break;
|
||||
result.replace(pos, src.size(), dest);
|
||||
}
|
||||
return result;
|
||||
|
@ -297,7 +297,7 @@ std::string UriDecode(const std::string & sSrc)
|
|||
// for future extension"
|
||||
|
||||
const unsigned char * pSrc = (const unsigned char *)sSrc.c_str();
|
||||
const int SRC_LEN = sSrc.length();
|
||||
const size_t SRC_LEN = sSrc.length();
|
||||
const unsigned char * const SRC_END = pSrc + SRC_LEN;
|
||||
const unsigned char * const SRC_LAST_DEC = SRC_END - 2; // last decodable '%'
|
||||
|
||||
|
@ -359,7 +359,7 @@ std::string UriEncode(const std::string & sSrc)
|
|||
{
|
||||
const char DEC2HEX[16 + 1] = "0123456789ABCDEF";
|
||||
const unsigned char * pSrc = (const unsigned char *)sSrc.c_str();
|
||||
const int SRC_LEN = sSrc.length();
|
||||
const size_t SRC_LEN = sSrc.length();
|
||||
unsigned char * const pStart = new unsigned char[SRC_LEN * 3];
|
||||
unsigned char * pEnd = pStart;
|
||||
const unsigned char * const SRC_END = pSrc + SRC_LEN;
|
||||
|
|
|
@ -658,6 +658,7 @@ public:
|
|||
void ABI_CallFunctionAC(void *func, const Gen::OpArg &arg1, u32 param2);
|
||||
void ABI_CallFunctionACC(void *func, const Gen::OpArg &arg1, u32 param2, u32 param3);
|
||||
void ABI_CallFunctionA(void *func, const Gen::OpArg &arg1);
|
||||
void ABI_CallFunctionAA(void *func, const Gen::OpArg &arg1, const Gen::OpArg &arg2);
|
||||
|
||||
// Pass a register as a paremeter.
|
||||
void ABI_CallFunctionR(void *func, Gen::X64Reg reg1);
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
#include "Config.h"
|
||||
#include "IniFile.h"
|
||||
#include "HLE/sceUtility.h"
|
||||
|
||||
SState g_State;
|
||||
CConfig g_Config;
|
||||
|
@ -81,6 +82,9 @@ void CConfig::Load(const char *iniFileName)
|
|||
false);
|
||||
#endif
|
||||
|
||||
IniFile::Section *pspConfig = iniFile.GetOrCreateSection("SystemParam");
|
||||
pspConfig->Get("Language", &ilanguage, PSP_SYSTEMPARAM_LANGUAGE_ENGLISH);
|
||||
|
||||
// Ephemeral settings
|
||||
bDrawWireframe = false;
|
||||
}
|
||||
|
@ -124,6 +128,9 @@ void CConfig::Save()
|
|||
control->Set("ShowStick", bShowAnalogStick);
|
||||
control->Set("ShowTouchControls", bShowTouchControls);
|
||||
|
||||
IniFile::Section *pspConfig = iniFile.GetOrCreateSection("SystemParam");
|
||||
pspConfig->Set("Language", ilanguage);
|
||||
|
||||
if (!iniFile.Save(iniFilename_.c_str())) {
|
||||
ERROR_LOG(LOADER, "Error saving config - can't write ini %s", iniFilename_.c_str());
|
||||
return;
|
||||
|
|
|
@ -69,6 +69,9 @@ public:
|
|||
bool bShowFPSCounter;
|
||||
bool bShowDebugStats;
|
||||
|
||||
// SystemParam
|
||||
int ilanguage;
|
||||
|
||||
std::string currentDirectory;
|
||||
std::string memCardDirectory;
|
||||
std::string flashDirectory;
|
||||
|
|
|
@ -120,6 +120,7 @@ reswitch:
|
|||
|
||||
case CORE_POWERDOWN:
|
||||
case CORE_ERROR:
|
||||
case CORE_NEXTFRAME:
|
||||
//1: Exit loop!!
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -207,7 +207,7 @@ void SymbolMap::SaveSymbolMap(const char *filename)
|
|||
|
||||
int SymbolMap::GetSymbolNum(unsigned int address, SymbolType symmask)
|
||||
{
|
||||
int start=0;
|
||||
size_t start=0;
|
||||
|
||||
for (size_t i = 0; i < entries.size(); i++)
|
||||
{
|
||||
|
@ -216,8 +216,6 @@ int SymbolMap::GetSymbolNum(unsigned int address, SymbolType symmask)
|
|||
else
|
||||
break;
|
||||
}
|
||||
|
||||
if (start<0) start=0;
|
||||
|
||||
for (size_t i = 0; i < entries.size(); i++)
|
||||
{
|
||||
|
@ -227,7 +225,7 @@ int SymbolMap::GetSymbolNum(unsigned int address, SymbolType symmask)
|
|||
if (address < addr+entries[i].size)
|
||||
{
|
||||
if (entries[i].type & symmask)
|
||||
return i;
|
||||
return (int) i;
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
@ -358,7 +356,7 @@ int SymbolMap::FindSymbol(const char *name)
|
|||
{
|
||||
for (size_t i = 0; i < entries.size(); i++)
|
||||
if (strcmp(entries[i].name,name)==0)
|
||||
return i;
|
||||
return (int) i;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -450,27 +448,27 @@ void SymbolMap::UseFuncSignaturesFile(const char *filename, u32 maxAddress)
|
|||
else
|
||||
break;
|
||||
}
|
||||
int numSigs = sigs.size();
|
||||
size_t numSigs = sigs.size();
|
||||
fclose(f);
|
||||
std::sort(sigs.begin(), sigs.end());
|
||||
|
||||
f = fopen("C:\\mojs.txt", "w");
|
||||
fprintf(f,"00000000\n");
|
||||
for (int j=0; j<numSigs; j++)
|
||||
for (size_t j=0; j<numSigs; j++)
|
||||
fprintf(f, "%08x\t%08x\t%08x\t%s\n", sigs[j].inst, sigs[j].size, sigs[j].hash, sigs[j].name);
|
||||
fseek(f,0,SEEK_SET);
|
||||
fprintf(f,"%08x",numSigs);
|
||||
fprintf(f,"%08x", (unsigned int)numSigs);
|
||||
fclose(f);
|
||||
|
||||
u32 last = 0xc0d3babe;
|
||||
for (int i=0; i<numSigs; i++)
|
||||
{
|
||||
for (size_t i=0; i<numSigs; i++)
|
||||
{
|
||||
if (sigs[i].inst != last)
|
||||
{
|
||||
sigmap.insert(Sigmap::value_type(sigs[i].inst, &sigs[i]));
|
||||
last = sigs[i].inst;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//#2: Scan/hash the memory and locate functions
|
||||
char temp[256];
|
||||
|
|
|
@ -43,7 +43,7 @@ PSPDialog::DialogStatus PSPDialog::GetStatus()
|
|||
void PSPDialog::StartDraw()
|
||||
{
|
||||
PPGeBegin();
|
||||
PPGeDrawRect(0, 0, 480, 272, CalcFadedColor(0x90606060));
|
||||
PPGeDrawRect(0, 0, 480, 272, CalcFadedColor(0x70606060));
|
||||
}
|
||||
void PSPDialog::EndDraw()
|
||||
{
|
||||
|
@ -76,9 +76,9 @@ void PSPDialog::UpdateFade()
|
|||
if(fadeTimer < FADE_TIME)
|
||||
{
|
||||
if(fadeIn)
|
||||
fadeValue = fadeTimer / FADE_TIME * 255;
|
||||
fadeValue = (u32) (fadeTimer / FADE_TIME * 255);
|
||||
else
|
||||
fadeValue = 255 - fadeTimer / FADE_TIME * 255;
|
||||
fadeValue = 255 - (u32) (fadeTimer / FADE_TIME * 255);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -227,7 +227,7 @@ int PSPOskDialog::Update()
|
|||
Memory::Write_U16(value, oskData.outtextPtr + (2 * i));
|
||||
}
|
||||
|
||||
oskData.outtextlength = inputChars.size();
|
||||
oskData.outtextlength = (int) inputChars.size();
|
||||
oskParams.base.result= 0;
|
||||
oskData.result = PSP_UTILITY_OSK_RESULT_CHANGED;
|
||||
Memory::WriteStruct(oskParams.SceUtilityOskDataPtr, &oskData);
|
||||
|
|
|
@ -251,13 +251,21 @@ void PSPSaveDialog::DisplaySaveDataInfo1()
|
|||
char saveTitle[512];
|
||||
char saveDetail[512];
|
||||
|
||||
char am_pm[] = "AM";
|
||||
int hour = param.GetFileInfo(currentSelectedSave).modif_time.tm_hour ;
|
||||
if( hour > 12 ) {
|
||||
strcpy(am_pm, "PM");
|
||||
hour -= 12;
|
||||
}
|
||||
|
||||
snprintf(title,512,"%s", param.GetFileInfo(currentSelectedSave).title);
|
||||
snprintf(time,512,"%02d/%02d/%d %02d:%02d %lld KB"
|
||||
snprintf(time,512,"%02d/%02d/%d %02d:%02d %s %lld KB"
|
||||
, param.GetFileInfo(currentSelectedSave).modif_time.tm_mday
|
||||
, param.GetFileInfo(currentSelectedSave).modif_time.tm_mon + 1
|
||||
, param.GetFileInfo(currentSelectedSave).modif_time.tm_year + 1900
|
||||
, param.GetFileInfo(currentSelectedSave).modif_time.tm_hour
|
||||
, hour
|
||||
, param.GetFileInfo(currentSelectedSave).modif_time.tm_min
|
||||
, am_pm
|
||||
, param.GetFileInfo(currentSelectedSave).size / 1024
|
||||
);
|
||||
snprintf(saveTitle,512,"%s", param.GetFileInfo(currentSelectedSave).saveTitle);
|
||||
|
@ -284,13 +292,21 @@ void PSPSaveDialog::DisplaySaveDataInfo2()
|
|||
else
|
||||
{
|
||||
char txt[1024];
|
||||
snprintf(txt,1024,"%s\n%02d/%02d/%d %02d:%02d\n%lld KB"
|
||||
char am_pm[] = "AM";
|
||||
int hour = param.GetFileInfo(currentSelectedSave).modif_time.tm_hour ;
|
||||
if( hour > 12 ) {
|
||||
strcpy(am_pm, "PM");
|
||||
hour -= 12;
|
||||
}
|
||||
|
||||
snprintf(txt,1024,"%s\n%02d/%02d/%d %02d:%02d %s\n%lld KB"
|
||||
, param.GetFileInfo(currentSelectedSave).saveTitle
|
||||
, param.GetFileInfo(currentSelectedSave).modif_time.tm_mday
|
||||
, param.GetFileInfo(currentSelectedSave).modif_time.tm_mon + 1
|
||||
, param.GetFileInfo(currentSelectedSave).modif_time.tm_year + 1900
|
||||
, param.GetFileInfo(currentSelectedSave).modif_time.tm_hour
|
||||
, hour
|
||||
, param.GetFileInfo(currentSelectedSave).modif_time.tm_min
|
||||
, am_pm
|
||||
, param.GetFileInfo(currentSelectedSave).size / 1024
|
||||
);
|
||||
std::string saveinfoTxt = txt;
|
||||
|
@ -300,11 +316,11 @@ void PSPSaveDialog::DisplaySaveDataInfo2()
|
|||
|
||||
void PSPSaveDialog::DisplayConfirmationYesNo(std::string text)
|
||||
{
|
||||
PPGeDrawText(text.c_str(), 180, 100, PPGE_ALIGN_LEFT, 0.45f, 0xFFFFFFFF);
|
||||
|
||||
PPGeDrawText("Yes", 230, 140, PPGE_ALIGN_LEFT, 0.45f, CalcFadedColor(yesnoChoice == 1?0xFF0000FF:0xFFFFFFFF));
|
||||
PPGeDrawText("No", 330, 140, PPGE_ALIGN_LEFT, 0.45f, CalcFadedColor(yesnoChoice == 0?0xFF0000FF:0xFFFFFFFF));
|
||||
|
||||
PPGeDrawRect(180, 105, 460, 106, CalcFadedColor(0xFFFFFFFF));
|
||||
PPGeDrawText(text.c_str(), 220, 110, PPGE_ALIGN_LEFT, 0.45f, 0xFFFFFFFF);
|
||||
PPGeDrawText("Yes", 250, 140, PPGE_ALIGN_LEFT, 0.45f, CalcFadedColor(yesnoChoice == 1?0xFF0000FF:0xFFFFFFFF));
|
||||
PPGeDrawText("No", 350, 140, PPGE_ALIGN_LEFT, 0.45f, CalcFadedColor(yesnoChoice == 0?0xFF0000FF:0xFFFFFFFF));
|
||||
PPGeDrawRect(180, 160, 460, 161, CalcFadedColor(0xFFFFFFFF));
|
||||
if (IsButtonPressed(CTRL_LEFT) && yesnoChoice == 0)
|
||||
{
|
||||
yesnoChoice = 1;
|
||||
|
@ -579,7 +595,8 @@ int PSPSaveDialog::Update()
|
|||
DisplaySaveIcon();
|
||||
DisplaySaveDataInfo2();
|
||||
|
||||
DisplayConfirmationYesNo("The data will be deleted.\nAre you sure you want to continue?");
|
||||
DisplayConfirmationYesNo(" This save data will be deleted.\nAre you sure you want to continue?");
|
||||
|
||||
|
||||
DisplayEnterBack();
|
||||
if (IsButtonPressed(cancelButtonFlag))
|
||||
|
|
|
@ -51,7 +51,7 @@ namespace
|
|||
if (handle == 0)
|
||||
return false;
|
||||
|
||||
int result = pspFileSystem.ReadFile(handle, data, dataSize);
|
||||
size_t result = pspFileSystem.ReadFile(handle, data, dataSize);
|
||||
pspFileSystem.CloseFile(handle);
|
||||
if(readSize)
|
||||
*readSize = result;
|
||||
|
@ -59,13 +59,13 @@ namespace
|
|||
return result != 0;
|
||||
}
|
||||
|
||||
bool WritePSPFile(std::string filename, u8 *data, int dataSize)
|
||||
bool WritePSPFile(std::string filename, u8 *data, SceSize dataSize)
|
||||
{
|
||||
u32 handle = pspFileSystem.OpenFile(filename, (FileAccess)(FILEACCESS_WRITE | FILEACCESS_CREATE));
|
||||
if (handle == 0)
|
||||
return false;
|
||||
|
||||
int result = pspFileSystem.WriteFile(handle, data, dataSize);
|
||||
size_t result = pspFileSystem.WriteFile(handle, data, dataSize);
|
||||
pspFileSystem.CloseFile(handle);
|
||||
|
||||
return result != 0;
|
||||
|
@ -225,7 +225,7 @@ bool SavedataParam::Save(SceUtilitySavedataParam* param, int saveId)
|
|||
if(param->dataBuf != 0) // Can launch save without save data in mode 13
|
||||
{
|
||||
std::string filePath = dirPath+"/"+GetFileName(param);
|
||||
int saveSize = param->dataSize;
|
||||
SceSize saveSize = param->dataSize;
|
||||
if(saveSize == 0 || saveSize > param->dataBufSize)
|
||||
saveSize = param->dataBufSize; // fallback, should never use this
|
||||
INFO_LOG(HLE,"Saving file with size %u in %s",saveSize,filePath.c_str());
|
||||
|
@ -305,7 +305,7 @@ bool SavedataParam::Save(SceUtilitySavedataParam* param, int saveId)
|
|||
u8 *sfoData;
|
||||
size_t sfoSize;
|
||||
sfoFile.WriteSFO(&sfoData,&sfoSize);
|
||||
WritePSPFile(sfopath, sfoData, sfoSize);
|
||||
WritePSPFile(sfopath, sfoData, (SceSize)sfoSize);
|
||||
delete[] sfoData;
|
||||
|
||||
// SAVE ICON0
|
||||
|
@ -341,7 +341,7 @@ bool SavedataParam::Save(SceUtilitySavedataParam* param, int saveId)
|
|||
// Save Encryption Data
|
||||
{
|
||||
EncryptFileInfo encryptInfo;
|
||||
int dataSize = sizeof(encryptInfo); // version + key + sdkVersion
|
||||
SceSize dataSize = sizeof(encryptInfo); // version + key + sdkVersion
|
||||
memset(&encryptInfo,0,dataSize);
|
||||
|
||||
encryptInfo.fileVersion = 1;
|
||||
|
@ -380,7 +380,7 @@ bool SavedataParam::Load(SceUtilitySavedataParam *param, int saveId)
|
|||
ERROR_LOG(HLE,"Error reading file %s",filePath.c_str());
|
||||
return false;
|
||||
}
|
||||
param->dataSize = readSize;
|
||||
param->dataSize = (SceSize)readSize;
|
||||
|
||||
// copy back save name in request
|
||||
strncpy(param->saveName,GetSaveDirName(param, saveId).c_str(),20);
|
||||
|
@ -455,8 +455,8 @@ bool SavedataParam::GetSizes(SceUtilitySavedataParam *param)
|
|||
Memory::Write_U32((u32)(MemoryStick_FreeSpace() / MemoryStick_SectorSize()),param->msFree+4); // Free cluster
|
||||
Memory::Write_U32((u32)(MemoryStick_FreeSpace() / 0x400),param->msFree+8); // Free space (in KB)
|
||||
std::string spaceTxt = SavedataParam::GetSpaceText((int)MemoryStick_FreeSpace());
|
||||
Memory::Memset(param->msFree+12,0,spaceTxt.size()+1);
|
||||
Memory::Memcpy(param->msFree+12,spaceTxt.c_str(),spaceTxt.size()); // Text representing free space
|
||||
Memory::Memset(param->msFree+12,0,(u32)spaceTxt.size()+1);
|
||||
Memory::Memcpy(param->msFree+12,spaceTxt.c_str(),(u32)spaceTxt.size()); // Text representing free space
|
||||
}
|
||||
if (Memory::IsValidAddress(param->msData))
|
||||
{
|
||||
|
@ -495,12 +495,12 @@ bool SavedataParam::GetSizes(SceUtilitySavedataParam *param)
|
|||
Memory::Write_U32(total_size / (u32)MemoryStick_SectorSize(),param->utilityData); // num cluster
|
||||
Memory::Write_U32(total_size / 0x400,param->utilityData+4); // save size in KB
|
||||
std::string spaceTxt = SavedataParam::GetSpaceText(total_size);
|
||||
Memory::Memset(param->utilityData+8,0,spaceTxt.size()+1);
|
||||
Memory::Memcpy(param->utilityData+8,spaceTxt.c_str(),spaceTxt.size()); // save size in text
|
||||
Memory::Memset(param->utilityData+8,0,(u32)spaceTxt.size()+1);
|
||||
Memory::Memcpy(param->utilityData+8,spaceTxt.c_str(),(u32)spaceTxt.size()); // save size in text
|
||||
Memory::Write_U32(total_size / 0x400,param->utilityData+16); // save size in KB
|
||||
spaceTxt = SavedataParam::GetSpaceText(total_size);
|
||||
Memory::Memset(param->utilityData+20,0,spaceTxt.size()+1);
|
||||
Memory::Memcpy(param->utilityData+20,spaceTxt.c_str(),spaceTxt.size()); // save size in text
|
||||
Memory::Memset(param->utilityData+20,0,(u32)spaceTxt.size()+1);
|
||||
Memory::Memcpy(param->utilityData+20,spaceTxt.c_str(),(u32)spaceTxt.size()); // save size in text
|
||||
}
|
||||
return ret;
|
||||
|
||||
|
@ -532,7 +532,7 @@ bool SavedataParam::GetList(SceUtilitySavedataParam *param)
|
|||
}
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < validDir.size(); i++)
|
||||
for (u32 i = 0; i < (u32)validDir.size(); i++)
|
||||
{
|
||||
u32 baseAddr = outputBuffer + (i*72);
|
||||
Memory::Write_U32(0x11FF,baseAddr + 0); // mode
|
||||
|
@ -545,11 +545,11 @@ bool SavedataParam::GetList(SceUtilitySavedataParam *param)
|
|||
// folder name without gamename (max 20 u8)
|
||||
std::string outName = validDir[i].name.substr(GetGameName(param).size());
|
||||
Memory::Memset(baseAddr + 52,0,20);
|
||||
Memory::Memcpy(baseAddr + 52, outName.c_str(), outName.size());
|
||||
Memory::Memcpy(baseAddr + 52, outName.c_str(), (u32)outName.size());
|
||||
}
|
||||
}
|
||||
// Save num of folder found
|
||||
Memory::Write_U32(validDir.size(),param->idListAddr+4);
|
||||
Memory::Write_U32((u32)validDir.size(), param->idListAddr + 4);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -695,7 +695,7 @@ int SavedataParam::SetPspParam(SceUtilitySavedataParam *param)
|
|||
// We have a png to show
|
||||
PspUtilitySavedataFileData newData;
|
||||
Memory::ReadStruct(param->newData, &newData);
|
||||
CreatePNGIcon(Memory::GetPointer(newData.buf),newData.size,saveDataList[realCount]);
|
||||
CreatePNGIcon(Memory::GetPointer(newData.buf), (int)newData.size, saveDataList[realCount]);
|
||||
}
|
||||
DEBUG_LOG(HLE,"Don't Exist");
|
||||
realCount++;
|
||||
|
@ -739,7 +739,7 @@ int SavedataParam::SetPspParam(SceUtilitySavedataParam *param)
|
|||
// We have a png to show
|
||||
PspUtilitySavedataFileData newData;
|
||||
Memory::ReadStruct(param->newData, &newData);
|
||||
CreatePNGIcon(Memory::GetPointer(newData.buf),newData.size,saveDataList[0]);
|
||||
CreatePNGIcon(Memory::GetPointer(newData.buf), (int)newData.size, saveDataList[0]);
|
||||
}
|
||||
DEBUG_LOG(HLE,"Don't Exist");
|
||||
}
|
||||
|
@ -798,7 +798,7 @@ void SavedataParam::SetFileInfo(int idx, PSPFileInfo &info, std::string saveName
|
|||
{
|
||||
u8 *textureDataPNG = new u8[(size_t)info2.size];
|
||||
ReadPSPFile(fileDataPath2, textureDataPNG, info2.size, NULL);
|
||||
CreatePNGIcon(textureDataPNG, info2.size, saveDataList[idx]);
|
||||
CreatePNGIcon(textureDataPNG, (int)info2.size, saveDataList[idx]);
|
||||
delete[] textureDataPNG;
|
||||
}
|
||||
|
||||
|
|
|
@ -28,8 +28,8 @@ enum SceUtilitySavedataType
|
|||
SCE_UTILITY_SAVEDATA_TYPE_SAVE = 3,
|
||||
SCE_UTILITY_SAVEDATA_TYPE_LISTLOAD = 4,
|
||||
SCE_UTILITY_SAVEDATA_TYPE_LISTSAVE = 5,
|
||||
SCE_UTILITY_SAVEDATA_TYPE_LISTDELETE = 6,
|
||||
SCE_UTILITY_SAVEDATA_TYPE_DELETE = 7,
|
||||
SCE_UTILITY_SAVEDATA_TYPE_DELETE = 6,
|
||||
SCE_UTILITY_SAVEDATA_TYPE_LISTDELETE = 7,
|
||||
SCE_UTILITY_SAVEDATA_TYPE_SIZES = 8,
|
||||
SCE_UTILITY_SAVEDATA_TYPE_LIST = 11,
|
||||
SCE_UTILITY_SAVEDATA_TYPE_FILES = 12,
|
||||
|
|
|
@ -159,7 +159,7 @@ bool ParamSFOData::WriteSFO(u8 **paramsfo, size_t *size)
|
|||
while((key_size%4)) key_size++;
|
||||
|
||||
header.key_table_start = sizeof(Header) + header.index_table_entries * sizeof(IndexTable);
|
||||
header.data_table_start = header.key_table_start + key_size;
|
||||
header.data_table_start = header.key_table_start + (u32)key_size;
|
||||
|
||||
total_size += sizeof(IndexTable) * header.index_table_entries;
|
||||
total_size += key_size;
|
||||
|
@ -201,7 +201,7 @@ bool ParamSFOData::WriteSFO(u8 **paramsfo, size_t *size)
|
|||
else if (it->second.type == VT_UTF8)
|
||||
{
|
||||
index_ptr->param_fmt = 0x0204;
|
||||
index_ptr->param_len = it->second.s_value.size()+1;
|
||||
index_ptr->param_len = (u32)it->second.s_value.size()+1;
|
||||
|
||||
memcpy(data_ptr,it->second.s_value.c_str(),index_ptr->param_len);
|
||||
data_ptr[index_ptr->param_len] = 0;
|
||||
|
|
|
@ -105,10 +105,10 @@ CISOFileBlockDevice::CISOFileBlockDevice(std::string _filename)
|
|||
}
|
||||
indexShift = hdr.align;
|
||||
u64 totalSize = hdr.total_bytes;
|
||||
numBlocks = (int)(totalSize / blockSize);
|
||||
numBlocks = (u32)(totalSize / blockSize);
|
||||
DEBUG_LOG(LOADER, "hdrSize=%i numBlocks=%i align=%i", hdrSize, numBlocks, indexShift);
|
||||
|
||||
int indexSize = numBlocks + 1;
|
||||
u32 indexSize = numBlocks + 1;
|
||||
|
||||
index = new u32[indexSize];
|
||||
if(fread(index, sizeof(u32), indexSize, f) != indexSize)
|
||||
|
@ -137,7 +137,7 @@ bool CISOFileBlockDevice::ReadBlock(int blockNumber, u8 *outPtr)
|
|||
u32 compressedReadSize = idx2 - idx;
|
||||
|
||||
fseek(f, compressedReadPos, SEEK_SET);
|
||||
size_t readSize = fread(inbuffer, 1, compressedReadSize, f);
|
||||
u32 readSize = (u32)fread(inbuffer, 1, compressedReadSize, f);
|
||||
|
||||
if (plain)
|
||||
{
|
||||
|
|
|
@ -32,7 +32,7 @@ public:
|
|||
virtual ~BlockDevice() {}
|
||||
virtual bool ReadBlock(int blockNumber, u8 *outPtr) = 0;
|
||||
int GetBlockSize() const { return 2048;} // forced, it cannot be changed by subclasses
|
||||
virtual int GetNumBlocks() = 0;
|
||||
virtual u32 GetNumBlocks() = 0;
|
||||
};
|
||||
|
||||
|
||||
|
@ -42,7 +42,7 @@ public:
|
|||
CISOFileBlockDevice(std::string _filename);
|
||||
~CISOFileBlockDevice();
|
||||
bool ReadBlock(int blockNumber, u8 *outPtr);
|
||||
int GetNumBlocks() { return numBlocks;}
|
||||
u32 GetNumBlocks() { return numBlocks;}
|
||||
|
||||
private:
|
||||
std::string filename;
|
||||
|
@ -50,7 +50,7 @@ private:
|
|||
u32 *index;
|
||||
int indexShift;
|
||||
u32 blockSize;
|
||||
int numBlocks;
|
||||
u32 numBlocks;
|
||||
};
|
||||
|
||||
|
||||
|
@ -60,7 +60,7 @@ public:
|
|||
FileBlockDevice(std::string _filename);
|
||||
~FileBlockDevice();
|
||||
bool ReadBlock(int blockNumber, u8 *outPtr);
|
||||
int GetNumBlocks() {return (int)(filesize / GetBlockSize());}
|
||||
u32 GetNumBlocks() {return (u32)(filesize / GetBlockSize());}
|
||||
|
||||
private:
|
||||
std::string filename;
|
||||
|
|
|
@ -309,7 +309,7 @@ u32 sceAudioOutput2ChangeLength(u32 sampleCount)
|
|||
u32 sceAudioOutput2GetRestSample()
|
||||
{
|
||||
DEBUG_LOG(HLE,"UNTESTED sceAudioOutput2GetRestSample()");
|
||||
return chans[0].sampleQueue.size() * 2;
|
||||
return (u32) chans[0].sampleQueue.size() * 2;
|
||||
}
|
||||
|
||||
u32 sceAudioOutput2Release()
|
||||
|
|
|
@ -386,13 +386,14 @@ u32 sceIoWriteAsync(int id, void *data_ptr, int size)
|
|||
|
||||
u32 sceIoGetDevType(int id)
|
||||
{
|
||||
ERROR_LOG(HLE, "UNIMPL sceIoGetDevType(%d)", id);
|
||||
u32 error;
|
||||
FileNode *f = kernelObjects.Get < FileNode > (id, error);
|
||||
int result;
|
||||
if (f)
|
||||
result = PSP_DEV_TYPE_ALIAS;
|
||||
else {
|
||||
ERROR_LOG(HLE, "sceIoGetDevTyp: unknown id %s", id);
|
||||
ERROR_LOG(HLE, "sceIoGetDevType: unknown id %d", id);
|
||||
result = ERROR_KERNEL_BAD_FILE_DESCRIPTOR;
|
||||
}
|
||||
|
||||
|
@ -401,13 +402,14 @@ u32 sceIoGetDevType(int id)
|
|||
|
||||
u32 sceIoCancel(int id)
|
||||
{
|
||||
ERROR_LOG(HLE, "UNIMPL sceIoCancel(%d)", id);
|
||||
u32 error;
|
||||
FileNode *f = kernelObjects.Get < FileNode > (id, error);
|
||||
int result;
|
||||
if (f)
|
||||
f->closePending = true;
|
||||
else {
|
||||
ERROR_LOG(HLE, "sceIoCancel: unknown id %s", id);
|
||||
ERROR_LOG(HLE, "sceIoCancel: unknown id %d", id);
|
||||
result = ERROR_KERNEL_BAD_FILE_DESCRIPTOR;
|
||||
}
|
||||
|
||||
|
@ -795,6 +797,7 @@ int sceIoCloseAsync(int id)
|
|||
|
||||
u32 sceIoLseekAsync(int id, s64 offset, int whence)
|
||||
{
|
||||
DEBUG_LOG(HLE, "sceIoLseekAsync(%d) sorta implemented", id);
|
||||
sceIoLseek(id, offset, whence);
|
||||
__IoCompleteAsyncIO(id);
|
||||
return 0;
|
||||
|
@ -934,7 +937,7 @@ public:
|
|||
p.Do(index);
|
||||
|
||||
// TODO: Is this the right way for it to wake up?
|
||||
int count = listing.size();
|
||||
int count = (int) listing.size();
|
||||
p.Do(count);
|
||||
listing.resize(count);
|
||||
for (int i = 0; i < count; ++i) {
|
||||
|
|
|
@ -174,6 +174,7 @@ void __KernelDoState(PointerWrap &p)
|
|||
__MpegDoState(p);
|
||||
__PowerDoState(p);
|
||||
__PsmfDoState(p);
|
||||
__PsmfPlayerDoState(p);
|
||||
__SasDoState(p);
|
||||
__SslDoState(p);
|
||||
__UmdDoState(p);
|
||||
|
|
|
@ -517,7 +517,7 @@ int sceKernelCancelReceiveMbx(SceUID id, u32 numWaitingThreadsAddr)
|
|||
return error;
|
||||
}
|
||||
|
||||
u32 count = m->waitingThreads.size();
|
||||
u32 count = (u32) m->waitingThreads.size();
|
||||
DEBUG_LOG(HLE, "sceKernelCancelReceiveMbx(%i, %08x): cancelling %d threads", id, numWaitingThreadsAddr, count);
|
||||
|
||||
bool wokeThreads = false;
|
||||
|
@ -553,7 +553,7 @@ int sceKernelReferMbxStatus(SceUID id, u32 infoAddr)
|
|||
// For whatever reason, it won't write if the size (first member) is 0.
|
||||
if (Memory::Read_U32(infoAddr) != 0)
|
||||
{
|
||||
m->nmb.numWaitThreads = m->waitingThreads.size();
|
||||
m->nmb.numWaitThreads = (int) m->waitingThreads.size();
|
||||
Memory::WriteStruct<NativeMbx>(infoAddr, &m->nmb);
|
||||
}
|
||||
|
||||
|
|
|
@ -903,7 +903,7 @@ u32 sceKernelLoadModuleByID(u32 id, u32 flags, u32 lmoptionPtr)
|
|||
{
|
||||
u32 error;
|
||||
u32 handle = __IoGetFileHandleFromId(id, error);
|
||||
if (handle < 0) {
|
||||
if (handle == -1) {
|
||||
ERROR_LOG(HLE,"sceKernelLoadModuleByID(%08x, %08x, %08x): could not open file id",id,flags,lmoptionPtr);
|
||||
return error;
|
||||
}
|
||||
|
@ -911,8 +911,8 @@ u32 sceKernelLoadModuleByID(u32 id, u32 flags, u32 lmoptionPtr)
|
|||
if (lmoptionPtr) {
|
||||
lmoption = (SceKernelLMOption *)Memory::GetPointer(lmoptionPtr);
|
||||
}
|
||||
u32 pos = pspFileSystem.SeekFile(handle, 0, FILEMOVE_CURRENT);
|
||||
u32 size = pspFileSystem.SeekFile(handle, 0, FILEMOVE_END);
|
||||
u32 pos = (u32) pspFileSystem.SeekFile(handle, 0, FILEMOVE_CURRENT);
|
||||
size_t size = pspFileSystem.SeekFile(handle, 0, FILEMOVE_END);
|
||||
std::string error_string;
|
||||
pspFileSystem.SeekFile(handle, pos, FILEMOVE_BEGIN);
|
||||
Module *module = 0;
|
||||
|
|
|
@ -617,8 +617,8 @@ void sceKernelReferMsgPipeStatus()
|
|||
MsgPipe *m = kernelObjects.Get<MsgPipe>(uid, error);
|
||||
if (m)
|
||||
{
|
||||
m->nmp.numSendWaitThreads = m->sendWaitingThreads.size();
|
||||
m->nmp.numReceiveWaitThreads = m->receiveWaitingThreads.size();
|
||||
m->nmp.numSendWaitThreads = (int) m->sendWaitingThreads.size();
|
||||
m->nmp.numReceiveWaitThreads = (int) m->receiveWaitingThreads.size();
|
||||
Memory::WriteStruct(msgPipeStatusAddr, &m->nmp);
|
||||
RETURN(0);
|
||||
}
|
||||
|
|
|
@ -196,7 +196,7 @@ public:
|
|||
|
||||
int registerActionType(ActionCreator creator) {
|
||||
types_.push_back(creator);
|
||||
return types_.size() - 1;
|
||||
return (int) types_.size() - 1;
|
||||
}
|
||||
|
||||
void restoreActionType(int actionType, ActionCreator creator) {
|
||||
|
@ -897,9 +897,9 @@ u32 sceKernelGetThreadmanIdList(u32 type, u32 readBufPtr, u32 readBufSize, u32 i
|
|||
|
||||
for (size_t i = 0; i < std::min((size_t)readBufSize, threadqueue.size()); i++)
|
||||
{
|
||||
Memory::Write_U32(threadqueue[i], readBufPtr + i * 4);
|
||||
Memory::Write_U32(threadqueue[i], readBufPtr + (u32)i * 4);
|
||||
}
|
||||
Memory::Write_U32(threadqueue.size(), idCountPtr);
|
||||
Memory::Write_U32((u32)threadqueue.size(), idCountPtr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1874,7 +1874,7 @@ void sceKernelSleepThreadCB()
|
|||
|
||||
int sceKernelWaitThreadEnd(SceUID threadID, u32 timeoutPtr)
|
||||
{
|
||||
DEBUG_LOG(HLE, "sceKernelWaitThreadEnd(%i, %08x)", threadID);
|
||||
DEBUG_LOG(HLE, "sceKernelWaitThreadEnd(%i, %08x)", threadID, timeoutPtr);
|
||||
if (threadID == 0 || threadID == currentThread)
|
||||
return SCE_KERNEL_ERROR_ILLEGAL_THID;
|
||||
|
||||
|
@ -1900,7 +1900,7 @@ int sceKernelWaitThreadEnd(SceUID threadID, u32 timeoutPtr)
|
|||
|
||||
int sceKernelWaitThreadEndCB(SceUID threadID, u32 timeoutPtr)
|
||||
{
|
||||
DEBUG_LOG(HLE, "sceKernelWaitThreadEnd(%i)", threadID);
|
||||
DEBUG_LOG(HLE, "sceKernelWaitThreadEndCB(%i)", threadID, timeoutPtr);
|
||||
if (threadID == 0 || threadID == currentThread)
|
||||
return SCE_KERNEL_ERROR_ILLEGAL_THID;
|
||||
|
||||
|
@ -1920,7 +1920,7 @@ int sceKernelWaitThreadEndCB(SceUID threadID, u32 timeoutPtr)
|
|||
}
|
||||
else
|
||||
{
|
||||
ERROR_LOG(HLE, "sceKernelWaitThreadEnd - bad thread %i", threadID);
|
||||
ERROR_LOG(HLE, "sceKernelWaitThreadEndCB - bad thread %i", threadID);
|
||||
return error;
|
||||
}
|
||||
}
|
||||
|
@ -2283,7 +2283,7 @@ void __KernelCallAddress(Thread *thread, u32 entryPoint, Action *afterAction, bo
|
|||
for (size_t i = 0; i < args.size(); i++) {
|
||||
call->args[i] = args[i];
|
||||
}
|
||||
call->numArgs = args.size();
|
||||
call->numArgs = (int) args.size();
|
||||
call->doAfter = afterAction;
|
||||
call->tag = "callAddress";
|
||||
|
||||
|
|
|
@ -193,7 +193,7 @@ struct MpegContext {
|
|||
bool endOfVideoReached;
|
||||
int videoPixelMode;
|
||||
u32 mpegMagic;
|
||||
u32 mpegVersion;
|
||||
int mpegVersion;
|
||||
u32 mpegRawVersion;
|
||||
u32 mpegOffset;
|
||||
u32 mpegStreamSize;
|
||||
|
@ -1028,7 +1028,7 @@ int sceMpegGetAvcAu(u32 mpeg, u32 streamId, u32 auAddr, u32 attrAddr)
|
|||
}
|
||||
result = PSP_ERROR_MPEG_NO_DATA;
|
||||
}
|
||||
if (ctx->mpegLastTimestamp < 0 || sceAu.pts >= ctx->mpegLastTimestamp) {
|
||||
if (ctx->mpegLastTimestamp <= 0 || sceAu.pts >= ctx->mpegLastTimestamp) {
|
||||
NOTICE_LOG(HLE, "End of video reached");
|
||||
ctx->endOfVideoReached = true;
|
||||
} else {
|
||||
|
|
|
@ -141,6 +141,7 @@ public:
|
|||
class PsmfPlayer {
|
||||
public:
|
||||
PsmfPlayer(u32 data);
|
||||
void DoState(PointerWrap &p);
|
||||
|
||||
int videoCodec;
|
||||
int videoStreamNum;
|
||||
|
@ -295,6 +296,23 @@ void Psmf::DoState(PointerWrap &p) {
|
|||
p.DoMarker("Psmf");
|
||||
}
|
||||
|
||||
void PsmfPlayer::DoState(PointerWrap &p) {
|
||||
p.Do(videoCodec);
|
||||
p.Do(videoStreamNum);
|
||||
p.Do(audioCodec);
|
||||
p.Do(audioStreamNum);
|
||||
p.Do(playMode);
|
||||
p.Do(playSpeed);
|
||||
|
||||
p.Do(displayBuffer);
|
||||
p.Do(displayBufferSize);
|
||||
p.Do(playbackThreadPriority);
|
||||
p.Do(psmfMaxAheadTimestamp);
|
||||
p.Do(psmfPlayerLastTimestamp);
|
||||
|
||||
p.DoMarker("PsmfPlayer");
|
||||
}
|
||||
|
||||
static std::map<u32, Psmf *> psmfMap;
|
||||
static std::map<u32, PsmfPlayer *> psmfPlayerMap;
|
||||
// TODO: Should have a map.
|
||||
|
@ -355,6 +373,38 @@ void __PsmfDoState(PointerWrap &p)
|
|||
p.DoMarker("scePsmf");
|
||||
}
|
||||
|
||||
void __PsmfPlayerDoState(PointerWrap &p)
|
||||
{
|
||||
int n = (int) psmfPlayerMap.size();
|
||||
p.Do(n);
|
||||
if (p.mode == p.MODE_READ) {
|
||||
std::map<u32, PsmfPlayer *>::iterator it, end;
|
||||
for (it = psmfPlayerMap.begin(), end = psmfPlayerMap.end(); it != end; ++it) {
|
||||
delete it->second;
|
||||
}
|
||||
psmfMap.clear();
|
||||
|
||||
for (int i = 0; i < n; ++i) {
|
||||
u32 key;
|
||||
p.Do(key);
|
||||
PsmfPlayer *psmfplayer = new PsmfPlayer(0);
|
||||
psmfplayer->DoState(p);
|
||||
psmfPlayerMap[key] = psmfplayer;
|
||||
}
|
||||
} else {
|
||||
std::map<u32, PsmfPlayer *>::iterator it, end;
|
||||
for (it = psmfPlayerMap.begin(), end = psmfPlayerMap.end(); it != end; ++it) {
|
||||
p.Do(it->first);
|
||||
it->second->DoState(p);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Actually load this from a map.
|
||||
psmfPlayerStatus = PSMF_PLAYER_STATUS_NONE;
|
||||
|
||||
p.DoMarker("scePsmfPlayer");
|
||||
}
|
||||
|
||||
void __PsmfShutdown()
|
||||
{
|
||||
for (auto it = psmfMap.begin(), end = psmfMap.end(); it != end; ++it)
|
||||
|
|
|
@ -22,4 +22,5 @@ void Register_scePsmfPlayer();
|
|||
|
||||
void __PsmfInit();
|
||||
void __PsmfDoState(PointerWrap &p);
|
||||
void __PsmfPlayerDoState(PointerWrap &p);
|
||||
void __PsmfShutdown();
|
||||
|
|
|
@ -79,14 +79,14 @@ int sceUtilitySavedataUpdate(int animSpeed)
|
|||
return saveDialog.Update();
|
||||
}
|
||||
|
||||
#define PSP_AV_MODULE_AVCODEC 0
|
||||
#define PSP_AV_MODULE_SASCORE 1
|
||||
#define PSP_AV_MODULE_ATRAC3PLUS 2 // Requires PSP_AV_MODULE_AVCODEC loading first
|
||||
#define PSP_AV_MODULE_MPEGBASE 3 // Requires PSP_AV_MODULE_AVCODEC loading first
|
||||
#define PSP_AV_MODULE_MP3 4
|
||||
#define PSP_AV_MODULE_VAUDIO 5
|
||||
#define PSP_AV_MODULE_AAC 6
|
||||
#define PSP_AV_MODULE_G729 7
|
||||
#define PSP_AV_MODULE_AVCODEC 0
|
||||
#define PSP_AV_MODULE_SASCORE 1
|
||||
#define PSP_AV_MODULE_ATRAC3PLUS 2 // Requires PSP_AV_MODULE_AVCODEC loading first
|
||||
#define PSP_AV_MODULE_MPEGBASE 3 // Requires PSP_AV_MODULE_AVCODEC loading first
|
||||
#define PSP_AV_MODULE_MP3 4
|
||||
#define PSP_AV_MODULE_VAUDIO 5
|
||||
#define PSP_AV_MODULE_AAC 6
|
||||
#define PSP_AV_MODULE_G729 7
|
||||
|
||||
u32 sceUtilityLoadAvModule(u32 module)
|
||||
{
|
||||
|
@ -216,23 +216,16 @@ int sceUtilityGamedataInstallGetStatus()
|
|||
return retval;
|
||||
}
|
||||
|
||||
#define PSP_SYSTEMPARAM_ID_STRING_NICKNAME 1
|
||||
#define PSP_SYSTEMPARAM_ID_INT_ADHOC_CHANNEL 2
|
||||
#define PSP_SYSTEMPARAM_ID_INT_WLAN_POWERSAVE 3
|
||||
#define PSP_SYSTEMPARAM_ID_INT_DATE_FORMAT 4
|
||||
#define PSP_SYSTEMPARAM_ID_INT_TIME_FORMAT 5
|
||||
#define PSP_SYSTEMPARAM_ID_STRING_NICKNAME 1
|
||||
#define PSP_SYSTEMPARAM_ID_INT_ADHOC_CHANNEL 2
|
||||
#define PSP_SYSTEMPARAM_ID_INT_WLAN_POWERSAVE 3
|
||||
#define PSP_SYSTEMPARAM_ID_INT_DATE_FORMAT 4
|
||||
#define PSP_SYSTEMPARAM_ID_INT_TIME_FORMAT 5
|
||||
//Timezone offset from UTC in minutes, (EST = -300 = -5 * 60)
|
||||
#define PSP_SYSTEMPARAM_ID_INT_TIMEZONE 6
|
||||
#define PSP_SYSTEMPARAM_ID_INT_DAYLIGHTSAVINGS 7
|
||||
#define PSP_SYSTEMPARAM_ID_INT_LANGUAGE 8
|
||||
/**
|
||||
* #9 seems to be Region or maybe X/O button swap.
|
||||
* It doesn't exist on JAP v1.0
|
||||
* is 1 on NA v1.5s
|
||||
* is 0 on JAP v1.5s
|
||||
* is read-only
|
||||
*/
|
||||
#define PSP_SYSTEMPARAM_ID_INT_UNKNOWN 9
|
||||
#define PSP_SYSTEMPARAM_ID_INT_TIMEZONE 6
|
||||
#define PSP_SYSTEMPARAM_ID_INT_DAYLIGHTSAVINGS 7
|
||||
#define PSP_SYSTEMPARAM_ID_INT_LANGUAGE 8
|
||||
#define PSP_SYSTEMPARAM_ID_INT_BUTTON_PREFERENCE 9
|
||||
|
||||
/**
|
||||
* Return values for the SystemParam functions
|
||||
|
@ -240,13 +233,14 @@ int sceUtilityGamedataInstallGetStatus()
|
|||
#define PSP_SYSTEMPARAM_RETVAL_OK 0
|
||||
#define PSP_SYSTEMPARAM_RETVAL_FAIL 0x80110103
|
||||
|
||||
|
||||
/**
|
||||
* Valid values for PSP_SYSTEMPARAM_ID_INT_ADHOC_CHANNEL
|
||||
*/
|
||||
#define PSP_SYSTEMPARAM_ADHOC_CHANNEL_AUTOMATIC 0
|
||||
#define PSP_SYSTEMPARAM_ADHOC_CHANNEL_1 1
|
||||
#define PSP_SYSTEMPARAM_ADHOC_CHANNEL_6 6
|
||||
#define PSP_SYSTEMPARAM_ADHOC_CHANNEL_11 11
|
||||
#define PSP_SYSTEMPARAM_ADHOC_CHANNEL_AUTOMATIC 0
|
||||
#define PSP_SYSTEMPARAM_ADHOC_CHANNEL_1 1
|
||||
#define PSP_SYSTEMPARAM_ADHOC_CHANNEL_6 6
|
||||
#define PSP_SYSTEMPARAM_ADHOC_CHANNEL_11 11
|
||||
|
||||
/**
|
||||
* Valid values for PSP_SYSTEMPARAM_ID_INT_WLAN_POWERSAVE
|
||||
|
@ -274,18 +268,10 @@ int sceUtilityGamedataInstallGetStatus()
|
|||
#define PSP_SYSTEMPARAM_DAYLIGHTSAVINGS_SAVING 1
|
||||
|
||||
/**
|
||||
* Valid values for PSP_SYSTEMPARAM_ID_INT_LANGUAGE
|
||||
* Valid values for PSP_SYSTEMPARAM_ID_INT_BUTTON_PREFERENCE
|
||||
*/
|
||||
#define PSP_SYSTEMPARAM_LANGUAGE_JAPANESE 0
|
||||
#define PSP_SYSTEMPARAM_LANGUAGE_ENGLISH 1
|
||||
#define PSP_SYSTEMPARAM_LANGUAGE_FRENCH 2
|
||||
#define PSP_SYSTEMPARAM_LANGUAGE_SPANISH 3
|
||||
#define PSP_SYSTEMPARAM_LANGUAGE_GERMAN 4
|
||||
#define PSP_SYSTEMPARAM_LANGUAGE_ITALIAN 5
|
||||
#define PSP_SYSTEMPARAM_LANGUAGE_DUTCH 6
|
||||
#define PSP_SYSTEMPARAM_LANGUAGE_PORTUGUESE 7
|
||||
#define PSP_SYSTEMPARAM_LANGUAGE_KOREAN 8
|
||||
|
||||
#define PSP_SYSTEMPARAM_BUTTON_CIRCLE 0
|
||||
#define PSP_SYSTEMPARAM_BUTTON_CROSS 1
|
||||
|
||||
//TODO: should save to config file
|
||||
u32 sceUtilitySetSystemParamString(u32 id, u32 strPtr)
|
||||
|
@ -336,10 +322,10 @@ u32 sceUtilityGetSystemParamInt(u32 id, u32 destaddr)
|
|||
param = PSP_SYSTEMPARAM_TIME_FORMAT_24HR;
|
||||
break;
|
||||
case PSP_SYSTEMPARAM_ID_INT_LANGUAGE:
|
||||
param = PSP_SYSTEMPARAM_LANGUAGE_ENGLISH;
|
||||
param = g_Config.ilanguage;
|
||||
break;
|
||||
case PSP_SYSTEMPARAM_ID_INT_UNKNOWN:
|
||||
param = 1;
|
||||
case PSP_SYSTEMPARAM_ID_INT_BUTTON_PREFERENCE:
|
||||
param = PSP_SYSTEMPARAM_BUTTON_CROSS;
|
||||
break;
|
||||
default:
|
||||
return PSP_SYSTEMPARAM_RETVAL_FAIL;
|
||||
|
|
|
@ -17,6 +17,25 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "../../Common/ChunkFile.h"
|
||||
|
||||
/**
|
||||
* Valid values for PSP_SYSTEMPARAM_ID_INT_LANGUAGE
|
||||
*/
|
||||
#define PSP_SYSTEMPARAM_LANGUAGE_JAPANESE 0
|
||||
#define PSP_SYSTEMPARAM_LANGUAGE_ENGLISH 1
|
||||
#define PSP_SYSTEMPARAM_LANGUAGE_FRENCH 2
|
||||
#define PSP_SYSTEMPARAM_LANGUAGE_SPANISH 3
|
||||
#define PSP_SYSTEMPARAM_LANGUAGE_GERMAN 4
|
||||
#define PSP_SYSTEMPARAM_LANGUAGE_ITALIAN 5
|
||||
#define PSP_SYSTEMPARAM_LANGUAGE_DUTCH 6
|
||||
#define PSP_SYSTEMPARAM_LANGUAGE_PORTUGUESE 7
|
||||
#define PSP_SYSTEMPARAM_LANGUAGE_RUSSIAN 8
|
||||
#define PSP_SYSTEMPARAM_LANGUAGE_KOREAN 9
|
||||
#define PSP_SYSTEMPARAM_LANGUAGE_CHINESE_TRADITIONAL 10
|
||||
#define PSP_SYSTEMPARAM_LANGUAGE_CHINESE_SIMPLIFIED 11
|
||||
|
||||
|
||||
void __UtilityInit();
|
||||
void __UtilityDoState(PointerWrap &p);
|
||||
void __UtilityShutdown();
|
||||
|
|
|
@ -656,6 +656,10 @@ namespace MIPSInt
|
|||
d[2] = ExpandHalf(s[1] & 0xFFFF);
|
||||
d[3] = ExpandHalf(s[1] >> 16);
|
||||
break;
|
||||
case V_Triple:
|
||||
case V_Quad:
|
||||
_dbg_assert_msg_(CPU, 0, "Trying to interpret Int_Vh2f instruction that can't be interpreted");
|
||||
break;
|
||||
}
|
||||
ApplyPrefixD(d, sz); //TODO: and the mask to kill everything but mask
|
||||
WriteVector(d, sz, vd);
|
||||
|
|
|
@ -41,28 +41,148 @@
|
|||
|
||||
namespace MIPSComp
|
||||
{
|
||||
static void ReadMemSafe32(u32 addr, int preg, u32 offset)
|
||||
void Jit::CompITypeMemRead(u32 op, u32 bits, void (XEmitter::*mov)(int, int, X64Reg, OpArg), void *safeFunc)
|
||||
{
|
||||
currentMIPS->r[preg] = Memory::Read_U32(addr + offset);
|
||||
CONDITIONAL_DISABLE;
|
||||
int offset = (signed short)(op&0xFFFF);
|
||||
int rt = _RT;
|
||||
int rs = _RS;
|
||||
|
||||
gpr.Lock(rt, rs);
|
||||
gpr.BindToRegister(rt, rt == rs, true);
|
||||
|
||||
if (gpr.R(rs).IsImm())
|
||||
{
|
||||
void *data = Memory::GetPointer(gpr.R(rs).GetImmValue() + offset);
|
||||
if (data)
|
||||
{
|
||||
#ifdef _M_IX86
|
||||
(this->*mov)(32, bits, gpr.RX(rt), M(data));
|
||||
#else
|
||||
(this->*mov)(32, bits, gpr.RX(rt), MDisp(RBX, gpr.R(rs).GetImmValue() + offset));
|
||||
#endif
|
||||
}
|
||||
else
|
||||
MOV(32, gpr.R(rt), Imm32(0));
|
||||
}
|
||||
else if (!g_Config.bFastMemory)
|
||||
{
|
||||
MOV(32, R(EAX), gpr.R(rs));
|
||||
// Is it in physical ram?
|
||||
CMP(32, R(EAX), Imm32(0x08000000));
|
||||
FixupBranch tooLow = J_CC(CC_L);
|
||||
CMP(32, R(EAX), Imm32(0x0A000000));
|
||||
FixupBranch tooHigh = J_CC(CC_GE);
|
||||
|
||||
const u8* safe = GetCodePtr();
|
||||
#ifdef _M_IX86
|
||||
(this->*mov)(32, bits, gpr.RX(rt), MDisp(EAX, (u32)Memory::base + offset));
|
||||
#else
|
||||
(this->*mov)(32, bits, gpr.RX(rt), MComplex(RBX, EAX, SCALE_1, offset));
|
||||
#endif
|
||||
|
||||
FixupBranch skip = J();
|
||||
SetJumpTarget(tooLow);
|
||||
SetJumpTarget(tooHigh);
|
||||
|
||||
// Might also be the scratchpad.
|
||||
CMP(32, R(EAX), Imm32(0x00010000));
|
||||
FixupBranch tooLow2 = J_CC(CC_L);
|
||||
CMP(32, R(EAX), Imm32(0x00014000));
|
||||
J_CC(CC_L, safe);
|
||||
SetJumpTarget(tooLow2);
|
||||
|
||||
ADD(32, R(EAX), Imm32(offset));
|
||||
ABI_CallFunctionA(thunks.ProtectFunction(safeFunc, 1), R(EAX));
|
||||
(this->*mov)(32, bits, gpr.RX(rt), R(EAX));
|
||||
|
||||
SetJumpTarget(skip);
|
||||
}
|
||||
else
|
||||
{
|
||||
MOV(32, R(EAX), gpr.R(rs));
|
||||
#ifdef _M_IX86
|
||||
AND(32, R(EAX), Imm32(Memory::MEMVIEW32_MASK));
|
||||
(this->*mov)(32, bits, gpr.RX(rt), MDisp(EAX, (u32)Memory::base + offset));
|
||||
#else
|
||||
(this->*mov)(32, bits, gpr.RX(rt), MComplex(RBX, EAX, SCALE_1, offset));
|
||||
#endif
|
||||
}
|
||||
|
||||
gpr.UnlockAll();
|
||||
}
|
||||
|
||||
static void ReadMemSafe16(u32 addr, int preg, u32 offset)
|
||||
void Jit::CompITypeMemWrite(u32 op, u32 bits, void *safeFunc)
|
||||
{
|
||||
currentMIPS->r[preg] = Memory::Read_U16(addr + offset);
|
||||
}
|
||||
CONDITIONAL_DISABLE;
|
||||
int offset = (signed short)(op&0xFFFF);
|
||||
int rt = _RT;
|
||||
int rs = _RS;
|
||||
|
||||
static void WriteMemSafe32(u32 addr, int preg, u32 offset)
|
||||
{
|
||||
Memory::Write_U32(currentMIPS->r[preg], addr + offset);
|
||||
}
|
||||
gpr.Lock(rt, rs);
|
||||
gpr.BindToRegister(rt, true, false);
|
||||
|
||||
static void WriteMemSafe16(u32 addr, int preg, u32 offset)
|
||||
{
|
||||
Memory::Write_U16(currentMIPS->r[preg], addr + offset);
|
||||
if (gpr.R(rs).IsImm())
|
||||
{
|
||||
void *data = Memory::GetPointer(gpr.R(rs).GetImmValue() + offset);
|
||||
if (data)
|
||||
{
|
||||
#ifdef _M_IX86
|
||||
MOV(bits, M(data), gpr.R(rt));
|
||||
#else
|
||||
MOV(bits, MDisp(RBX, gpr.R(rs).GetImmValue() + offset), gpr.R(rt));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if (!g_Config.bFastMemory)
|
||||
{
|
||||
MOV(32, R(EAX), gpr.R(rs));
|
||||
// Is it in physical ram?
|
||||
CMP(32, R(EAX), Imm32(0x08000000));
|
||||
FixupBranch tooLow = J_CC(CC_L);
|
||||
CMP(32, R(EAX), Imm32(0x0A000000));
|
||||
FixupBranch tooHigh = J_CC(CC_GE);
|
||||
|
||||
const u8* safe = GetCodePtr();
|
||||
#ifdef _M_IX86
|
||||
MOV(bits, MDisp(EAX, (u32)Memory::base + offset), gpr.R(rt));
|
||||
#else
|
||||
MOV(bits, MComplex(RBX, EAX, SCALE_1, offset), gpr.R(rt));
|
||||
#endif
|
||||
|
||||
FixupBranch skip = J();
|
||||
SetJumpTarget(tooLow);
|
||||
SetJumpTarget(tooHigh);
|
||||
|
||||
// Might also be the scratchpad.
|
||||
CMP(32, R(EAX), Imm32(0x00010000));
|
||||
FixupBranch tooLow2 = J_CC(CC_L);
|
||||
CMP(32, R(EAX), Imm32(0x00014000));
|
||||
J_CC(CC_L, safe);
|
||||
SetJumpTarget(tooLow2);
|
||||
|
||||
ADD(32, R(EAX), Imm32(offset));
|
||||
ABI_CallFunctionAA(thunks.ProtectFunction(safeFunc, 2), gpr.R(rt), R(EAX));
|
||||
|
||||
SetJumpTarget(skip);
|
||||
}
|
||||
else
|
||||
{
|
||||
MOV(32, R(EAX), gpr.R(rs));
|
||||
#ifdef _M_IX86
|
||||
AND(32, R(EAX), Imm32(Memory::MEMVIEW32_MASK));
|
||||
MOV(bits, MDisp(EAX, (u32)Memory::base + offset), gpr.R(rt));
|
||||
#else
|
||||
MOV(bits, MComplex(RBX, EAX, SCALE_1, offset), gpr.R(rt));
|
||||
#endif
|
||||
}
|
||||
|
||||
gpr.UnlockAll();
|
||||
}
|
||||
|
||||
void Jit::Comp_ITypeMem(u32 op)
|
||||
{
|
||||
CONDITIONAL_DISABLE;
|
||||
int offset = (signed short)(op&0xFFFF);
|
||||
int rt = _RT;
|
||||
int rs = _RS;
|
||||
|
@ -75,186 +195,35 @@ namespace MIPSComp
|
|||
switch (o)
|
||||
{
|
||||
case 37: //R(rt) = ReadMem16(addr); break; //lhu
|
||||
if (!g_Config.bFastMemory)
|
||||
{
|
||||
FlushAll();
|
||||
|
||||
gpr.Lock(rt, rs);
|
||||
gpr.BindToRegister(rt, rt == rs, true);
|
||||
|
||||
MOV(32, R(EAX), gpr.R(rs));
|
||||
CMP(32, R(EAX), Imm32(0x08000000));
|
||||
FixupBranch tooLow = J_CC(CC_L);
|
||||
CMP(32, R(EAX), Imm32(0x0A000000));
|
||||
FixupBranch tooHigh = J_CC(CC_GE);
|
||||
#ifdef _M_IX86
|
||||
MOVZX(32, 16, gpr.RX(rt), MDisp(EAX, (u32)Memory::base + offset));
|
||||
#else
|
||||
MOVZX(32, 16, gpr.RX(rt), MComplex(RBX, EAX, SCALE_1, offset));
|
||||
#endif
|
||||
gpr.UnlockAll();
|
||||
FlushAll();
|
||||
|
||||
FixupBranch skip = J();
|
||||
SetJumpTarget(tooLow);
|
||||
SetJumpTarget(tooHigh);
|
||||
ABI_CallFunctionACC((void *) &ReadMemSafe16, gpr.R(rs), rt, offset);
|
||||
SetJumpTarget(skip);
|
||||
}
|
||||
else
|
||||
{
|
||||
gpr.Lock(rt, rs);
|
||||
gpr.BindToRegister(rt, rt == rs, true);
|
||||
#ifdef _M_IX86
|
||||
MOV(32, R(EAX), gpr.R(rs));
|
||||
AND(32, R(EAX), Imm32(Memory::MEMVIEW32_MASK));
|
||||
MOVZX(32, 16, gpr.RX(rt), MDisp(EAX, (u32)Memory::base + offset));
|
||||
#else
|
||||
MOV(32, R(EAX), gpr.R(rs));
|
||||
MOVZX(32, 16, gpr.RX(rt), MComplex(RBX, EAX, SCALE_1, offset));
|
||||
#endif
|
||||
gpr.UnlockAll();
|
||||
}
|
||||
CompITypeMemRead(op, 16, &XEmitter::MOVZX, (void *) &Memory::Read_U16);
|
||||
break;
|
||||
|
||||
case 36: //R(rt) = ReadMem8 (addr); break; //lbu
|
||||
Comp_Generic(op);
|
||||
return;
|
||||
|
||||
case 35: //R(rt) = ReadMem32(addr); break; //lw
|
||||
if (!g_Config.bFastMemory)
|
||||
{
|
||||
FlushAll();
|
||||
|
||||
gpr.Lock(rt, rs);
|
||||
gpr.BindToRegister(rt, rt == rs, true);
|
||||
|
||||
MOV(32, R(EAX), gpr.R(rs));
|
||||
CMP(32, R(EAX), Imm32(0x08000000));
|
||||
FixupBranch tooLow = J_CC(CC_L);
|
||||
CMP(32, R(EAX), Imm32(0x0A000000));
|
||||
FixupBranch tooHigh = J_CC(CC_GE);
|
||||
#ifdef _M_IX86
|
||||
MOV(32, gpr.R(rt), MDisp(EAX, (u32)Memory::base + offset));
|
||||
#else
|
||||
MOV(32, gpr.R(rt), MComplex(RBX, EAX, SCALE_1, offset));
|
||||
#endif
|
||||
gpr.UnlockAll();
|
||||
FlushAll();
|
||||
|
||||
FixupBranch skip = J();
|
||||
SetJumpTarget(tooLow);
|
||||
SetJumpTarget(tooHigh);
|
||||
ABI_CallFunctionACC((void *) &ReadMemSafe32, gpr.R(rs), rt, offset);
|
||||
SetJumpTarget(skip);
|
||||
}
|
||||
else
|
||||
{
|
||||
gpr.Lock(rt, rs);
|
||||
gpr.BindToRegister(rt, rt == rs, true);
|
||||
#ifdef _M_IX86
|
||||
MOV(32, R(EAX), gpr.R(rs));
|
||||
AND(32, R(EAX), Imm32(Memory::MEMVIEW32_MASK));
|
||||
MOV(32, gpr.R(rt), MDisp(EAX, (u32)Memory::base + offset));
|
||||
#else
|
||||
MOV(32, R(EAX), gpr.R(rs));
|
||||
MOV(32, gpr.R(rt), MComplex(RBX, EAX, SCALE_1, offset));
|
||||
#endif
|
||||
gpr.UnlockAll();
|
||||
}
|
||||
CompITypeMemRead(op, 8, &XEmitter::MOVZX, (void *) &Memory::Read_U8);
|
||||
break;
|
||||
|
||||
case 35: //R(rt) = ReadMem32(addr); break; //lw
|
||||
CompITypeMemRead(op, 32, &XEmitter::MOVZX, (void *) &Memory::Read_U16);
|
||||
break;
|
||||
|
||||
case 32: //R(rt) = (u32)(s32)(s8) ReadMem8 (addr); break; //lb
|
||||
CompITypeMemRead(op, 8, &XEmitter::MOVSX, (void *) &Memory::Read_U8);
|
||||
break;
|
||||
|
||||
case 33: //R(rt) = (u32)(s32)(s16)ReadMem16(addr); break; //lh
|
||||
CompITypeMemRead(op, 16, &XEmitter::MOVSX, (void *) &Memory::Read_U16);
|
||||
break;
|
||||
|
||||
case 132: //R(rt) = (u32)(s32)(s8) ReadMem8 (addr); break; //lb
|
||||
case 133: //R(rt) = (u32)(s32)(s16)ReadMem16(addr); break; //lh
|
||||
case 136: //R(rt) = ReadMem8 (addr); break; //lbu
|
||||
case 140: //WriteMem8 (addr, R(rt)); break; //sb
|
||||
Comp_Generic(op);
|
||||
return;
|
||||
|
||||
case 41: //WriteMem16(addr, R(rt)); break; //sh
|
||||
if (!g_Config.bFastMemory)
|
||||
{
|
||||
FlushAll();
|
||||
|
||||
gpr.Lock(rt, rs);
|
||||
gpr.BindToRegister(rt, true, true);
|
||||
|
||||
MOV(32, R(EAX), gpr.R(rs));
|
||||
CMP(32, R(EAX), Imm32(0x08000000));
|
||||
FixupBranch tooLow = J_CC(CC_L);
|
||||
CMP(32, R(EAX), Imm32(0x0A000000));
|
||||
FixupBranch tooHigh = J_CC(CC_GE);
|
||||
#ifdef _M_IX86
|
||||
MOV(16, MDisp(EAX, (u32)Memory::base + offset), gpr.R(rt));
|
||||
#else
|
||||
MOV(16, MComplex(RBX, EAX, SCALE_1, offset), gpr.R(rt));
|
||||
#endif
|
||||
gpr.UnlockAll();
|
||||
FlushAll();
|
||||
|
||||
FixupBranch skip = J();
|
||||
SetJumpTarget(tooLow);
|
||||
SetJumpTarget(tooHigh);
|
||||
ABI_CallFunctionACC((void *) &WriteMemSafe16, gpr.R(rs), rt, offset);
|
||||
SetJumpTarget(skip);
|
||||
}
|
||||
else
|
||||
{
|
||||
gpr.Lock(rt, rs);
|
||||
gpr.BindToRegister(rt, true, false);
|
||||
#ifdef _M_IX86
|
||||
MOV(32, R(EAX), gpr.R(rs));
|
||||
AND(32, R(EAX), Imm32(Memory::MEMVIEW32_MASK));
|
||||
MOV(16, MDisp(EAX, (u32)Memory::base + offset), gpr.R(rt));
|
||||
#else
|
||||
MOV(32, R(EAX), gpr.R(rs));
|
||||
MOV(16, MComplex(RBX, EAX, SCALE_1, offset), gpr.R(rt));
|
||||
#endif
|
||||
gpr.UnlockAll();
|
||||
}
|
||||
CompITypeMemWrite(op, 16, (void *) &Memory::Write_U16);
|
||||
break;
|
||||
|
||||
case 43: //WriteMem32(addr, R(rt)); break; //sw
|
||||
if (!g_Config.bFastMemory)
|
||||
{
|
||||
FlushAll();
|
||||
|
||||
gpr.Lock(rt, rs);
|
||||
gpr.BindToRegister(rt, true, true);
|
||||
|
||||
MOV(32, R(EAX), gpr.R(rs));
|
||||
CMP(32, R(EAX), Imm32(0x08000000));
|
||||
FixupBranch tooLow = J_CC(CC_L);
|
||||
CMP(32, R(EAX), Imm32(0x0A000000));
|
||||
FixupBranch tooHigh = J_CC(CC_GE);
|
||||
#ifdef _M_IX86
|
||||
MOV(32, MDisp(EAX, (u32)Memory::base + offset), gpr.R(rt));
|
||||
#else
|
||||
MOV(32, MComplex(RBX, EAX, SCALE_1, offset), gpr.R(rt));
|
||||
#endif
|
||||
gpr.UnlockAll();
|
||||
FlushAll();
|
||||
|
||||
FixupBranch skip = J();
|
||||
SetJumpTarget(tooLow);
|
||||
SetJumpTarget(tooHigh);
|
||||
ABI_CallFunctionACC((void *) &WriteMemSafe32, gpr.R(rs), rt, offset);
|
||||
SetJumpTarget(skip);
|
||||
}
|
||||
else
|
||||
{
|
||||
gpr.Lock(rt, rs);
|
||||
gpr.BindToRegister(rt, true, false);
|
||||
#ifdef _M_IX86
|
||||
MOV(32, R(EAX), gpr.R(rs));
|
||||
AND(32, R(EAX), Imm32(Memory::MEMVIEW32_MASK));
|
||||
MOV(32, MDisp(EAX, (u32)Memory::base + offset), gpr.R(rt));
|
||||
#else
|
||||
MOV(32, R(EAX), gpr.R(rs));
|
||||
MOV(32, MComplex(RBX, EAX, SCALE_1, offset), gpr.R(rt));
|
||||
#endif
|
||||
gpr.UnlockAll();
|
||||
}
|
||||
CompITypeMemWrite(op, 32, (void *) &Memory::Write_U32);
|
||||
break;
|
||||
|
||||
case 134: //lwl
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
// Official git repository and contact information can be found at
|
||||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
#include "../../Core.h"
|
||||
#include "../../CoreTiming.h"
|
||||
#include "../MIPS.h"
|
||||
|
@ -45,6 +47,15 @@ static u64 saved_flags;
|
|||
|
||||
#endif
|
||||
|
||||
const bool USE_JIT_MISSMAP = false;
|
||||
static std::map<std::string, u32> notJitOps;
|
||||
|
||||
template<typename A, typename B>
|
||||
std::pair<B,A> flip_pair(const std::pair<A,B> &p)
|
||||
{
|
||||
return std::pair<B, A>(p.second, p.first);
|
||||
}
|
||||
|
||||
void JitBreakpoint()
|
||||
{
|
||||
Core_EnableStepping(true);
|
||||
|
@ -52,6 +63,36 @@ void JitBreakpoint()
|
|||
|
||||
if (CBreakPoints::IsTempBreakPoint(currentMIPS->pc))
|
||||
CBreakPoints::RemoveBreakPoint(currentMIPS->pc);
|
||||
|
||||
// There's probably a better place for this.
|
||||
if (USE_JIT_MISSMAP)
|
||||
{
|
||||
std::map<u32, std::string> notJitSorted;
|
||||
std::transform(notJitOps.begin(), notJitOps.end(), std::inserter(notJitSorted, notJitSorted.begin()), flip_pair<std::string, u32>);
|
||||
|
||||
std::string message;
|
||||
char temp[256];
|
||||
int remaining = 15;
|
||||
for (auto it = notJitSorted.rbegin(), end = notJitSorted.rend(); it != end && --remaining >= 0; ++it)
|
||||
{
|
||||
snprintf(temp, 256, " (%d), ", it->first);
|
||||
message += it->second + temp;
|
||||
}
|
||||
|
||||
if (message.size() > 2)
|
||||
message.resize(message.size() - 2);
|
||||
|
||||
NOTICE_LOG(JIT, "Top ops compiled to interpreter: %s", message.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
static void JitLogMiss(u32 op)
|
||||
{
|
||||
if (USE_JIT_MISSMAP)
|
||||
notJitOps[MIPSGetName(op)]++;
|
||||
|
||||
MIPSInterpretFunc func = MIPSGetInterpretFunc(op);
|
||||
func(op);
|
||||
}
|
||||
|
||||
Jit::Jit(MIPSState *mips) : blocks(mips), mips_(mips)
|
||||
|
@ -183,8 +224,13 @@ void Jit::Comp_Generic(u32 op)
|
|||
if (func)
|
||||
{
|
||||
MOV(32, M(&mips_->pc), Imm32(js.compilerPC));
|
||||
ABI_CallFunctionC((void *)func, op);
|
||||
if (USE_JIT_MISSMAP)
|
||||
ABI_CallFunctionC((void *)&JitLogMiss, op);
|
||||
else
|
||||
ABI_CallFunctionC((void *)func, op);
|
||||
}
|
||||
else
|
||||
_dbg_assert_msg_(JIT, 0, "Trying to compile instruction that can't be interpreted");
|
||||
}
|
||||
|
||||
void Jit::WriteExit(u32 destination, int exit_num)
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "../../../Globals.h"
|
||||
#include "../../../Common/Thunk.h"
|
||||
#include "Asm.h"
|
||||
|
||||
#if defined(ARM)
|
||||
|
@ -120,6 +121,8 @@ private:
|
|||
void CompTriArith(u32 op, void (XEmitter::*arith)(int, const OpArg &, const OpArg &));
|
||||
void CompShiftImm(u32 op, void (XEmitter::*shift)(int, OpArg, OpArg));
|
||||
void CompShiftVar(u32 op, void (XEmitter::*shift)(int, OpArg, OpArg));
|
||||
void CompITypeMemRead(u32 op, u32 bits, void (XEmitter::*mov)(int, int, X64Reg, OpArg), void *safeFunc);
|
||||
void CompITypeMemWrite(u32 op, u32 bits, void *safeFunc);
|
||||
|
||||
void CompFPTriArith(u32 op, void (XEmitter::*arith)(X64Reg reg, OpArg), bool orderMatters);
|
||||
|
||||
|
@ -131,6 +134,7 @@ private:
|
|||
FPURegCache fpr;
|
||||
|
||||
AsmRoutineManager asm_;
|
||||
ThunkManager thunks;
|
||||
|
||||
MIPSState *mips_;
|
||||
};
|
||||
|
|
|
@ -1128,7 +1128,7 @@ void GLES_GPU::UpdateStats() {
|
|||
gpuStats.numFragmentShaders = shaderManager_->NumFragmentShaders();
|
||||
gpuStats.numShaders = shaderManager_->NumPrograms();
|
||||
gpuStats.numTextures = TextureCache_NumLoadedTextures();
|
||||
gpuStats.numFBOs = vfbs_.size();
|
||||
gpuStats.numFBOs = (int)vfbs_.size();
|
||||
}
|
||||
|
||||
void GLES_GPU::DoBlockTransfer() {
|
||||
|
|
|
@ -138,7 +138,7 @@ void TextureCache_InvalidateAll(bool force) {
|
|||
}
|
||||
|
||||
int TextureCache_NumLoadedTextures() {
|
||||
return cache.size();
|
||||
return (int)cache.size();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -483,9 +483,9 @@ void TransformDrawEngine::SoftwareTransformAndDraw(
|
|||
c1[j] = 0.0f;
|
||||
}
|
||||
} else {
|
||||
c0[0] = ((gstate.materialambient >> 8) & 0xFF) / 255.f;
|
||||
c0[1] = (gstate.materialambient & 0xFF) / 255.f;
|
||||
c0[2] = (gstate.materialambient & 0xFF) / 255.f;
|
||||
c0[0] = (gstate.materialambient & 0xFF) / 255.f;
|
||||
c0[1] = ((gstate.materialambient >> 8) & 0xFF) / 255.f;
|
||||
c0[2] = ((gstate.materialambient >> 16)& 0xFF) / 255.f;
|
||||
c0[3] = (gstate.materialalpha & 0xFF) / 255.f;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,12 +41,12 @@ void WindowsHost::SetWindowTitle(const char *message)
|
|||
std::string title = "PPSSPP v0.5 - ";
|
||||
title += message;
|
||||
|
||||
int size = MultiByteToWideChar(CP_UTF8, 0, message, title.size(), NULL, 0);
|
||||
int size = MultiByteToWideChar(CP_UTF8, 0, message, (int) title.size(), NULL, 0);
|
||||
if (size > 0)
|
||||
{
|
||||
wchar_t *utf16_title = new wchar_t[size + 1];
|
||||
if (utf16_title)
|
||||
size = MultiByteToWideChar(CP_UTF8, 0, message, title.size(), utf16_title, size);
|
||||
size = MultiByteToWideChar(CP_UTF8, 0, message, (int) title.size(), utf16_title, size);
|
||||
else
|
||||
size = 0;
|
||||
|
||||
|
@ -129,32 +129,25 @@ void WindowsHost::BootDone()
|
|||
SendMessage(MainWindow::GetHWND(), WM_USER+1, 0,0);
|
||||
}
|
||||
|
||||
static std::string SymbolMapFilename(const char *currentFilename)
|
||||
{
|
||||
std::string result = currentFilename;
|
||||
size_t dot = result.rfind('.');
|
||||
if (dot == result.npos)
|
||||
return result + ".map";
|
||||
|
||||
result.replace(dot, result.npos, ".map");
|
||||
return result;
|
||||
}
|
||||
|
||||
bool WindowsHost::AttemptLoadSymbolMap()
|
||||
{
|
||||
char filename[256];
|
||||
strcpy(filename, GetCurrentFilename());
|
||||
int len = strlen(filename);
|
||||
int ptpos = len-1;
|
||||
while (filename[ptpos]!='.' && ptpos>len-8)
|
||||
ptpos--;
|
||||
filename[ptpos+1] = 'm';
|
||||
filename[ptpos+2] = 'a';
|
||||
filename[ptpos+3] = 'p';
|
||||
return symbolMap.LoadSymbolMap(filename);
|
||||
return symbolMap.LoadSymbolMap(SymbolMapFilename(GetCurrentFilename()).c_str());
|
||||
}
|
||||
|
||||
void WindowsHost::PrepareShutdown()
|
||||
{
|
||||
char filename[256];
|
||||
strcpy(filename, GetCurrentFilename());
|
||||
int len = strlen(filename);
|
||||
int ptpos = len-1;
|
||||
while (filename[ptpos]!='.' && ptpos>len-8)
|
||||
ptpos--;
|
||||
filename[ptpos+1] = 'm';
|
||||
filename[ptpos+2] = 'a';
|
||||
filename[ptpos+3] = 'p';
|
||||
symbolMap.SaveSymbolMap(filename);
|
||||
symbolMap.SaveSymbolMap(SymbolMapFilename(GetCurrentFilename()).c_str());
|
||||
}
|
||||
|
||||
void WindowsHost::AddSymbol(std::string name, u32 addr, u32 size, int type=0)
|
||||
|
|
|
@ -757,7 +757,7 @@ lPling:
|
|||
}
|
||||
else {
|
||||
if (((int)imm8)<0 && ((int)imm8)>-100) {
|
||||
*op++='-'; imm8=-imm8;
|
||||
*op++='-'; imm8=-(int)imm8;
|
||||
}
|
||||
op = num(op, imm8);
|
||||
}
|
||||
|
@ -880,7 +880,7 @@ lPling:
|
|||
if (!(instr&Ubit)) {
|
||||
if (offset) *op++='-';
|
||||
else result.oddbits=1;
|
||||
result.offset = -offset;
|
||||
result.offset = -(int)offset;
|
||||
}
|
||||
else result.offset = offset;
|
||||
op = num(op, offset);
|
||||
|
|
Loading…
Add table
Reference in a new issue