mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 22:11:26 +12:00
Compilation fix
This commit is contained in:
parent
f3b61f58ef
commit
2eeab1feb0
3 changed files with 23 additions and 15 deletions
|
@ -6,6 +6,14 @@
|
||||||
#define thread_local __thread
|
#define thread_local __thread
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
template<size_t size>
|
||||||
|
void strcpy_trunc(char (&dst)[size], const std::string& src)
|
||||||
|
{
|
||||||
|
const size_t count = (src.size() >= size) ? size - 1 /* truncation */ : src.size();
|
||||||
|
memcpy(dst, src.c_str(), count);
|
||||||
|
dst[count] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(__GNUG__)
|
#if defined(__GNUG__)
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
|
@ -24,7 +24,7 @@ int cellGameBootCheck(mem32_t type, mem32_t attributes, mem_ptr_t<CellGameConten
|
||||||
cellGame->Warning("cellGameBootCheck(type_addr=0x%x, attributes_addr=0x%x, size_addr=0x%x, dirName_addr=0x%x)",
|
cellGame->Warning("cellGameBootCheck(type_addr=0x%x, attributes_addr=0x%x, size_addr=0x%x, dirName_addr=0x%x)",
|
||||||
type.GetAddr(), attributes.GetAddr(), size.GetAddr(), dirName.GetAddr());
|
type.GetAddr(), attributes.GetAddr(), size.GetAddr(), dirName.GetAddr());
|
||||||
|
|
||||||
if (!type.IsGood() || !attributes.IsGood() || !size.IsGood() || !dirName.IsGood())
|
if (!type.IsGood() || !attributes.IsGood() || !size.IsGood() || (dirName.GetAddr() && !dirName.IsGood()))
|
||||||
{
|
{
|
||||||
cellGame->Error("cellGameBootCheck(): CELL_GAME_ERROR_PARAM");
|
cellGame->Error("cellGameBootCheck(): CELL_GAME_ERROR_PARAM");
|
||||||
return CELL_GAME_ERROR_PARAM;
|
return CELL_GAME_ERROR_PARAM;
|
||||||
|
@ -56,7 +56,7 @@ int cellGameBootCheck(mem32_t type, mem32_t attributes, mem_ptr_t<CellGameConten
|
||||||
{
|
{
|
||||||
type = CELL_GAME_GAMETYPE_DISC;
|
type = CELL_GAME_GAMETYPE_DISC;
|
||||||
attributes = 0; // TODO
|
attributes = 0; // TODO
|
||||||
Memory.WriteString(dirName.GetAddr(), ""); // ???
|
if (dirName.GetAddr()) Memory.WriteString(dirName.GetAddr(), ""); // ???
|
||||||
contentInfo = "/dev_bdvd/PS3_GAME";
|
contentInfo = "/dev_bdvd/PS3_GAME";
|
||||||
usrdir = "/dev_bdvd/PS3_GAME/USRDIR";
|
usrdir = "/dev_bdvd/PS3_GAME/USRDIR";
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ int cellGameBootCheck(mem32_t type, mem32_t attributes, mem_ptr_t<CellGameConten
|
||||||
std::string titleId = psf.GetString("TITLE_ID");
|
std::string titleId = psf.GetString("TITLE_ID");
|
||||||
type = CELL_GAME_GAMETYPE_HDD;
|
type = CELL_GAME_GAMETYPE_HDD;
|
||||||
attributes = 0; // TODO
|
attributes = 0; // TODO
|
||||||
Memory.WriteString(dirName.GetAddr(), titleId);
|
if (dirName.GetAddr()) Memory.WriteString(dirName.GetAddr(), titleId);
|
||||||
contentInfo = "/dev_hdd0/game/" + titleId;
|
contentInfo = "/dev_hdd0/game/" + titleId;
|
||||||
usrdir = "/dev_hdd0/game/" + titleId + "/USRDIR";
|
usrdir = "/dev_hdd0/game/" + titleId + "/USRDIR";
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ int cellGameBootCheck(mem32_t type, mem32_t attributes, mem_ptr_t<CellGameConten
|
||||||
std::string titleId = psf.GetString("TITLE_ID");
|
std::string titleId = psf.GetString("TITLE_ID");
|
||||||
type = CELL_GAME_GAMETYPE_DISC;
|
type = CELL_GAME_GAMETYPE_DISC;
|
||||||
attributes = CELL_GAME_ATTRIBUTE_PATCH; // TODO
|
attributes = CELL_GAME_ATTRIBUTE_PATCH; // TODO
|
||||||
Memory.WriteString(dirName.GetAddr(), titleId); // ???
|
if (dirName.GetAddr()) Memory.WriteString(dirName.GetAddr(), titleId); // ???
|
||||||
contentInfo = "/dev_bdvd/PS3_GAME";
|
contentInfo = "/dev_bdvd/PS3_GAME";
|
||||||
usrdir = "/dev_bdvd/PS3_GAME/USRDIR";
|
usrdir = "/dev_bdvd/PS3_GAME/USRDIR";
|
||||||
}
|
}
|
||||||
|
@ -252,13 +252,13 @@ int cellGameDataCheckCreate2(u32 version, const mem_list_ptr_t<u8> dirName, u32
|
||||||
cbGet->hddFreeSizeKB = 40000000; //40 GB
|
cbGet->hddFreeSizeKB = 40000000; //40 GB
|
||||||
|
|
||||||
cbGet->isNewData = CELL_GAMEDATA_ISNEWDATA_NO;
|
cbGet->isNewData = CELL_GAMEDATA_ISNEWDATA_NO;
|
||||||
strncpy_s(cbGet->contentInfoPath, dir.c_str(), _TRUNCATE);
|
strcpy_trunc(cbGet->contentInfoPath, dir);
|
||||||
strncpy_s(cbGet->gameDataPath, (dir + "/USRDIR").c_str(), _TRUNCATE);
|
strcpy_trunc(cbGet->gameDataPath, dir + "/USRDIR");
|
||||||
|
|
||||||
// TODO: set correct time
|
// TODO: set correct time
|
||||||
cbGet->st_atime = 0;
|
cbGet->st_atime_ = 0;
|
||||||
cbGet->st_ctime = 0;
|
cbGet->st_ctime_ = 0;
|
||||||
cbGet->st_mtime = 0;
|
cbGet->st_mtime_ = 0;
|
||||||
|
|
||||||
// TODO: calculate data size, if necessary
|
// TODO: calculate data size, if necessary
|
||||||
cbGet->sizeKB = CELL_GAMEDATA_SIZEKB_NOTCALC;
|
cbGet->sizeKB = CELL_GAMEDATA_SIZEKB_NOTCALC;
|
||||||
|
@ -266,9 +266,9 @@ int cellGameDataCheckCreate2(u32 version, const mem_list_ptr_t<u8> dirName, u32
|
||||||
|
|
||||||
cbGet->getParam.attribute = CELL_GAMEDATA_ATTR_NORMAL;
|
cbGet->getParam.attribute = CELL_GAMEDATA_ATTR_NORMAL;
|
||||||
cbGet->getParam.parentalLevel = psf.GetInteger("PARENTAL_LEVEL");
|
cbGet->getParam.parentalLevel = psf.GetInteger("PARENTAL_LEVEL");
|
||||||
strncpy_s(cbGet->getParam.dataVersion, psf.GetString("APP_VER").c_str(), _TRUNCATE);
|
strcpy_trunc(cbGet->getParam.dataVersion, psf.GetString("APP_VER"));
|
||||||
strncpy_s(cbGet->getParam.titleId, psf.GetString("TITLE_ID").c_str(), _TRUNCATE);
|
strcpy_trunc(cbGet->getParam.titleId, psf.GetString("TITLE_ID"));
|
||||||
strncpy_s(cbGet->getParam.title, psf.GetString("TITLE").c_str(), _TRUNCATE);
|
strcpy_trunc(cbGet->getParam.title, psf.GetString("TITLE"));
|
||||||
// TODO: write lang titles
|
// TODO: write lang titles
|
||||||
|
|
||||||
funcStat(cbResult.GetAddr(), cbGet.GetAddr(), cbSet.GetAddr());
|
funcStat(cbResult.GetAddr(), cbGet.GetAddr(), cbSet.GetAddr());
|
||||||
|
|
|
@ -186,9 +186,9 @@ struct CellGameDataStatGet
|
||||||
char contentInfoPath[CELL_GAMEDATA_PATH_MAX];
|
char contentInfoPath[CELL_GAMEDATA_PATH_MAX];
|
||||||
char gameDataPath[CELL_GAMEDATA_PATH_MAX];
|
char gameDataPath[CELL_GAMEDATA_PATH_MAX];
|
||||||
char reserved0[2];
|
char reserved0[2];
|
||||||
be_t<s64> st_atime;
|
be_t<s64> st_atime_;
|
||||||
be_t<s64> st_mtime;
|
be_t<s64> st_mtime_;
|
||||||
be_t<s64> st_ctime;
|
be_t<s64> st_ctime_;
|
||||||
CellGameDataSystemFileParam getParam;
|
CellGameDataSystemFileParam getParam;
|
||||||
be_t<s32> sizeKB;
|
be_t<s32> sizeKB;
|
||||||
be_t<s32> sysSizeKB;
|
be_t<s32> sysSizeKB;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue