1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 18:53:28 +01:00

Implement NetStartDialogLoadAsync, L10N additions

Also improved cellPadPeriphGetInfo
This commit is contained in:
Raul Tambre 2015-09-10 17:13:31 +03:00
parent f9731de777
commit cd7fbae583
15 changed files with 521 additions and 38 deletions

View File

@ -179,8 +179,8 @@ bool D3D12GSRender::LoadProgram()
if (m_set_blend_color)
{
// glBlendColor(m_blend_color_r, m_blend_color_g, m_blend_color_b, m_blend_color_a);
// checkForGlError("glBlendColor");
// glBlendColor(m_blend_color_r, m_blend_color_g, m_blend_color_b, m_blend_color_a);
// checkForGlError("glBlendColor");
}
switch (m_surface_depth_format)

View File

@ -44,16 +44,20 @@ u32 map_offset_pos = 0;
*/
u32 gcmGetLocalMemorySize(u32 sdk_version)
{
if (sdk_version >= 0x00220000) {
if (sdk_version >= 0x00220000)
{
return 0x0F900000; // 249MB
}
if (sdk_version >= 0x00200000) {
if (sdk_version >= 0x00200000)
{
return 0x0F200000; // 242MB
}
if (sdk_version >= 0x00190000) {
if (sdk_version >= 0x00190000)
{
return 0x0EA00000; // 234MB
}
if (sdk_version >= 0x00180000) {
if (sdk_version >= 0x00180000)
{
return 0x0E800000; // 232MB
}
return 0x0E000000; // 224MB

View File

@ -885,9 +885,17 @@ s32 UTF16toUTF32()
throw EXCEPTION("");
}
s32 l10n_convert_str()
s32 l10n_convert_str(s32 cd, vm::cptr<void> src, vm::ptr<u32> src_len, vm::ptr<void> dst, vm::ptr<u32> dst_len)
{
throw EXCEPTION("");
cellL10n.Warning("l10n_convert_str(cd=%d, src=*0x%x, src_len=*0x%x, dst=*0x%x, dst_len=*0x%x)", cd, src, src_len, dst, dst_len);
s32 src_code, dst_code;
auto element = converters.find(cd);
src_code = element->second.first;
dst_code = element->second.second;
return L10nConvertStr(src_code, src, src_len, dst_code, dst, dst_len);
}
s32 EUCJPstoJISs()
@ -990,9 +998,21 @@ s32 MSJISstoUCS2s()
throw EXCEPTION("");
}
s32 l10n_get_converter()
s32 l10n_get_converter(u32 src_code, u32 dst_code)
{
throw EXCEPTION("");
cellL10n.Warning("l10n_get_converter(src_code=%d, dst_code=%d)", src_code, dst_code);
auto it = converters.begin();
while (it != converters.end())
{
if (it->second.first == src_code && it->second.second == dst_code)
{
return it->first;
}
++it;
}
}
s32 GB18030stoUTF8s()
@ -1157,9 +1177,10 @@ s32 UTF8stoUCS2s()
throw EXCEPTION("");
}
Module cellL10n("cellL10n", []()
{
insertConverters();
REG_FUNC(cellL10n, UCS2toEUCJP);
REG_FUNC(cellL10n, l10n_convert);
REG_FUNC(cellL10n, UCS2toUTF32);

View File

@ -2,6 +2,8 @@
namespace vm { using namespace ps3; }
std::map<s32, std::pair<s32, s32>> converters;
// L10nResult
enum
{
@ -24,7 +26,7 @@ enum
L10N_STR_ERROR = (1 << 17),
};
//CodePages
// CodePages
enum {
L10N_UTF8 = 0,
L10N_UTF16,
@ -81,3 +83,208 @@ enum {
L10N_CODEPAGE_869,
_L10N_CODE_
};
static void insertConverters()
{
converters.clear();
converters[1] = std::make_pair(L10N_UTF8, L10N_UTF16);
converters[2] = std::make_pair(L10N_UTF8, L10N_UTF32);
converters[3] = std::make_pair(L10N_UTF8, L10N_UCS2);
converters[5] = std::make_pair(L10N_UTF8, L10N_ISO_8859_1);
converters[6] = std::make_pair(L10N_UTF8, L10N_ISO_8859_2);
converters[7] = std::make_pair(L10N_UTF8, L10N_ISO_8859_3);
converters[8] = std::make_pair(L10N_UTF8, L10N_ISO_8859_4);
converters[9] = std::make_pair(L10N_UTF8, L10N_ISO_8859_5);
converters[10] = std::make_pair(L10N_UTF8, L10N_ISO_8859_6);
converters[11] = std::make_pair(L10N_UTF8, L10N_ISO_8859_7);
converters[12] = std::make_pair(L10N_UTF8, L10N_ISO_8859_8);
converters[13] = std::make_pair(L10N_UTF8, L10N_ISO_8859_9);
converters[14] = std::make_pair(L10N_UTF8, L10N_ISO_8859_10);
converters[15] = std::make_pair(L10N_UTF8, L10N_ISO_8859_11);
converters[16] = std::make_pair(L10N_UTF8, L10N_ISO_8859_13);
converters[17] = std::make_pair(L10N_UTF8, L10N_ISO_8859_14);
converters[18] = std::make_pair(L10N_UTF8, L10N_ISO_8859_15);
converters[19] = std::make_pair(L10N_UTF8, L10N_ISO_8859_16);
converters[20] = std::make_pair(L10N_UTF8, L10N_CODEPAGE_437);
converters[21] = std::make_pair(L10N_UTF8, L10N_CODEPAGE_850);
converters[22] = std::make_pair(L10N_UTF8, L10N_CODEPAGE_863);
converters[23] = std::make_pair(L10N_UTF8, L10N_CODEPAGE_866);
converters[24] = std::make_pair(L10N_UTF8, L10N_CODEPAGE_932);
converters[25] = std::make_pair(L10N_UTF8, L10N_CODEPAGE_936);
converters[26] = std::make_pair(L10N_UTF8, L10N_CODEPAGE_949);
converters[27] = std::make_pair(L10N_UTF8, L10N_CODEPAGE_950);
converters[28] = std::make_pair(L10N_UTF8, L10N_CODEPAGE_1251);
converters[29] = std::make_pair(L10N_UTF8, L10N_CODEPAGE_1252);
converters[30] = std::make_pair(L10N_UTF8, L10N_EUC_CN);
converters[31] = std::make_pair(L10N_UTF8, L10N_EUC_JP);
converters[32] = std::make_pair(L10N_UTF8, L10N_EUC_KR);
converters[33] = std::make_pair(L10N_UTF8, L10N_ISO_2022_JP);
converters[34] = std::make_pair(L10N_UTF8, L10N_ARIB);
converters[35] = std::make_pair(L10N_UTF8, L10N_HZ);
converters[36] = std::make_pair(L10N_UTF8, L10N_GB18030);
converters[37] = std::make_pair(L10N_UTF8, L10N_RIS_506);
converters[38] = std::make_pair(L10N_UTF8, L10N_CODEPAGE_852);
converters[39] = std::make_pair(L10N_UTF8, L10N_CODEPAGE_1250);
converters[40] = std::make_pair(L10N_UTF8, L10N_CODEPAGE_737);
converters[41] = std::make_pair(L10N_UTF8, L10N_CODEPAGE_1253);
converters[42] = std::make_pair(L10N_UTF8, L10N_CODEPAGE_857);
converters[43] = std::make_pair(L10N_UTF8, L10N_CODEPAGE_1254);
converters[44] = std::make_pair(L10N_UTF8, L10N_CODEPAGE_775);
converters[45] = std::make_pair(L10N_UTF8, L10N_CODEPAGE_1257);
converters[46] = std::make_pair(L10N_UTF8, L10N_CODEPAGE_855);
converters[47] = std::make_pair(L10N_UTF8, L10N_CODEPAGE_858);
converters[48] = std::make_pair(L10N_UTF8, L10N_CODEPAGE_860);
converters[49] = std::make_pair(L10N_UTF8, L10N_CODEPAGE_861);
converters[50] = std::make_pair(L10N_UTF8, L10N_CODEPAGE_865);
converters[51] = std::make_pair(L10N_UTF8, L10N_CODEPAGE_869);
converters[65536] = std::make_pair(L10N_UTF16, L10N_UTF8);
converters[65538] = std::make_pair(L10N_UTF16, L10N_UTF32);
converters[65539] = std::make_pair(L10N_UTF16, L10N_UCS2);
converters[131072] = std::make_pair(L10N_UTF32, L10N_UTF8);
converters[131073] = std::make_pair(L10N_UTF32, L10N_UTF32);
converters[131075] = std::make_pair(L10N_UTF32, L10N_UCS2);
converters[196608] = std::make_pair(L10N_UCS2, L10N_UTF8);
converters[196609] = std::make_pair(L10N_UCS2, L10N_UTF16);
converters[196610] = std::make_pair(L10N_UCS2, L10N_UTF32);
converters[196613] = std::make_pair(L10N_UCS2, L10N_ISO_8859_1);
converters[196614] = std::make_pair(L10N_UCS2, L10N_ISO_8859_2);
converters[196615] = std::make_pair(L10N_UCS2, L10N_ISO_8859_3);
converters[196616] = std::make_pair(L10N_UCS2, L10N_ISO_8859_4);
converters[196617] = std::make_pair(L10N_UCS2, L10N_ISO_8859_5);
converters[196618] = std::make_pair(L10N_UCS2, L10N_ISO_8859_6);
converters[196619] = std::make_pair(L10N_UCS2, L10N_ISO_8859_7);
converters[196620] = std::make_pair(L10N_UCS2, L10N_ISO_8859_8);
converters[196621] = std::make_pair(L10N_UCS2, L10N_ISO_8859_9);
converters[196622] = std::make_pair(L10N_UCS2, L10N_ISO_8859_10);
converters[196623] = std::make_pair(L10N_UCS2, L10N_ISO_8859_11);
converters[196624] = std::make_pair(L10N_UCS2, L10N_ISO_8859_13);
converters[196625] = std::make_pair(L10N_UCS2, L10N_ISO_8859_14);
converters[196626] = std::make_pair(L10N_UCS2, L10N_ISO_8859_15);
converters[196627] = std::make_pair(L10N_UCS2, L10N_ISO_8859_16);
converters[196628] = std::make_pair(L10N_UCS2, L10N_CODEPAGE_437);
converters[196629] = std::make_pair(L10N_UCS2, L10N_CODEPAGE_850);
converters[196630] = std::make_pair(L10N_UCS2, L10N_CODEPAGE_863);
converters[196631] = std::make_pair(L10N_UCS2, L10N_CODEPAGE_866);
converters[196632] = std::make_pair(L10N_UCS2, L10N_CODEPAGE_932);
converters[196633] = std::make_pair(L10N_UCS2, L10N_CODEPAGE_936);
converters[196634] = std::make_pair(L10N_UCS2, L10N_CODEPAGE_949);
converters[196635] = std::make_pair(L10N_UCS2, L10N_CODEPAGE_950);
converters[196636] = std::make_pair(L10N_UCS2, L10N_CODEPAGE_1251);
converters[196637] = std::make_pair(L10N_UCS2, L10N_CODEPAGE_1252);
converters[196638] = std::make_pair(L10N_UCS2, L10N_EUC_CN);
converters[196639] = std::make_pair(L10N_UCS2, L10N_EUC_JP);
converters[196640] = std::make_pair(L10N_UCS2, L10N_EUC_KR);
converters[196641] = std::make_pair(L10N_UCS2, L10N_ISO_2022_JP);
converters[196642] = std::make_pair(L10N_UCS2, L10N_ARIB);
converters[196643] = std::make_pair(L10N_UCS2, L10N_HZ);
converters[196644] = std::make_pair(L10N_UCS2, L10N_GB18030);
converters[196645] = std::make_pair(L10N_UCS2, L10N_RIS_506);
converters[196646] = std::make_pair(L10N_UCS2, L10N_CODEPAGE_852);
converters[196647] = std::make_pair(L10N_UCS2, L10N_CODEPAGE_1250);
converters[196648] = std::make_pair(L10N_UCS2, L10N_CODEPAGE_737);
converters[196649] = std::make_pair(L10N_UCS2, L10N_CODEPAGE_1253);
converters[196650] = std::make_pair(L10N_UCS2, L10N_CODEPAGE_857);
converters[196651] = std::make_pair(L10N_UCS2, L10N_CODEPAGE_1254);
converters[196652] = std::make_pair(L10N_UCS2, L10N_CODEPAGE_775);
converters[196653] = std::make_pair(L10N_UCS2, L10N_CODEPAGE_1257);
converters[196654] = std::make_pair(L10N_UCS2, L10N_CODEPAGE_855);
converters[196655] = std::make_pair(L10N_UCS2, L10N_CODEPAGE_858);
converters[196656] = std::make_pair(L10N_UCS2, L10N_CODEPAGE_860);
converters[196657] = std::make_pair(L10N_UCS2, L10N_CODEPAGE_861);
converters[196658] = std::make_pair(L10N_UCS2, L10N_CODEPAGE_865);
converters[196659] = std::make_pair(L10N_UCS2, L10N_CODEPAGE_869);
converters[327680] = std::make_pair(L10N_ISO_8859_1, L10N_UTF8);
converters[327683] = std::make_pair(L10N_ISO_8859_1, L10N_UCS2);
converters[393216] = std::make_pair(L10N_ISO_8859_2, L10N_UTF8);
converters[393219] = std::make_pair(L10N_ISO_8859_2, L10N_UCS2);
converters[458752] = std::make_pair(L10N_ISO_8859_3, L10N_UTF8);
converters[458755] = std::make_pair(L10N_ISO_8859_3, L10N_UCS2);
converters[524288] = std::make_pair(L10N_ISO_8859_4, L10N_UTF8);
converters[524291] = std::make_pair(L10N_ISO_8859_4, L10N_UCS2);
converters[589824] = std::make_pair(L10N_ISO_8859_5, L10N_UTF8);
converters[589827] = std::make_pair(L10N_ISO_8859_5, L10N_UCS2);
converters[655360] = std::make_pair(L10N_ISO_8859_6, L10N_UTF8);
converters[655363] = std::make_pair(L10N_ISO_8859_6, L10N_UCS2);
converters[720896] = std::make_pair(L10N_ISO_8859_7, L10N_UTF8);
converters[720899] = std::make_pair(L10N_ISO_8859_7, L10N_UCS2);
converters[786432] = std::make_pair(L10N_ISO_8859_8, L10N_UTF8);
converters[786435] = std::make_pair(L10N_ISO_8859_8, L10N_UCS2);
converters[851968] = std::make_pair(L10N_ISO_8859_9, L10N_UTF8);
converters[851971] = std::make_pair(L10N_ISO_8859_9, L10N_UCS2);
converters[917504] = std::make_pair(L10N_ISO_8859_10, L10N_UTF8);
converters[917507] = std::make_pair(L10N_ISO_8859_10, L10N_UCS2);
converters[983040] = std::make_pair(L10N_ISO_8859_11, L10N_UTF8);
converters[983043] = std::make_pair(L10N_ISO_8859_11, L10N_UCS2);
converters[1048576] = std::make_pair(L10N_ISO_8859_13, L10N_UTF8);
converters[1048579] = std::make_pair(L10N_ISO_8859_13, L10N_UCS2);
converters[1114112] = std::make_pair(L10N_ISO_8859_14, L10N_UTF8);
converters[1114115] = std::make_pair(L10N_ISO_8859_14, L10N_UCS2);
converters[1179648] = std::make_pair(L10N_ISO_8859_15, L10N_UTF8);
converters[1179651] = std::make_pair(L10N_ISO_8859_15, L10N_UCS2);
converters[1245184] = std::make_pair(L10N_ISO_8859_16, L10N_UTF8);
converters[1245187] = std::make_pair(L10N_ISO_8859_16, L10N_UCS2);
converters[1310720] = std::make_pair(L10N_CODEPAGE_437, L10N_UTF8);
converters[1310723] = std::make_pair(L10N_CODEPAGE_437, L10N_UCS2);
converters[1376256] = std::make_pair(L10N_CODEPAGE_850, L10N_UTF8);
converters[1376259] = std::make_pair(L10N_CODEPAGE_850, L10N_UCS2);
converters[1441792] = std::make_pair(L10N_CODEPAGE_863, L10N_UTF8);
converters[1441795] = std::make_pair(L10N_CODEPAGE_863, L10N_UCS2);
converters[1507328] = std::make_pair(L10N_CODEPAGE_866, L10N_UTF8);
converters[1507331] = std::make_pair(L10N_CODEPAGE_866, L10N_UCS2);
converters[1572864] = std::make_pair(L10N_CODEPAGE_932, L10N_UTF8);
converters[1572867] = std::make_pair(L10N_CODEPAGE_932, L10N_UCS2);
converters[1638400] = std::make_pair(L10N_CODEPAGE_936, L10N_UTF8);
converters[1638403] = std::make_pair(L10N_CODEPAGE_936, L10N_UCS2);
converters[1703936] = std::make_pair(L10N_CODEPAGE_949, L10N_UTF8);
converters[1703939] = std::make_pair(L10N_CODEPAGE_949, L10N_UCS2);
converters[1769472] = std::make_pair(L10N_CODEPAGE_950, L10N_UTF8);
converters[1769475] = std::make_pair(L10N_CODEPAGE_950, L10N_UCS2);
converters[1835008] = std::make_pair(L10N_CODEPAGE_1251, L10N_UTF8);
converters[1835011] = std::make_pair(L10N_CODEPAGE_1251, L10N_UCS2);
converters[1900544] = std::make_pair(L10N_CODEPAGE_1252, L10N_UTF8);
converters[1900547] = std::make_pair(L10N_CODEPAGE_1252, L10N_UCS2);
converters[1966080] = std::make_pair(L10N_EUC_CN, L10N_UTF8);
converters[1966083] = std::make_pair(L10N_EUC_CN, L10N_UCS2);
converters[2031616] = std::make_pair(L10N_EUC_JP, L10N_UTF8);
converters[2031619] = std::make_pair(L10N_EUC_JP, L10N_UCS2);
converters[2097152] = std::make_pair(L10N_EUC_KR, L10N_UTF8);
converters[2097155] = std::make_pair(L10N_EUC_KR, L10N_UCS2);
converters[2162688] = std::make_pair(L10N_ISO_2022_JP, L10N_UTF8);
converters[2162691] = std::make_pair(L10N_ISO_2022_JP, L10N_UCS2);
converters[2228224] = std::make_pair(L10N_ARIB, L10N_UTF8);
converters[2228227] = std::make_pair(L10N_ARIB, L10N_UCS2);
converters[2293760] = std::make_pair(L10N_HZ, L10N_UTF8);
converters[2293763] = std::make_pair(L10N_HZ, L10N_UCS2);
converters[2359296] = std::make_pair(L10N_GB18030, L10N_UTF8);
converters[2359299] = std::make_pair(L10N_GB18030, L10N_UCS2);
converters[2424832] = std::make_pair(L10N_RIS_506, L10N_UTF8);
converters[2424835] = std::make_pair(L10N_RIS_506, L10N_UCS2);
converters[2490368] = std::make_pair(L10N_CODEPAGE_852, L10N_UTF8);
converters[2490371] = std::make_pair(L10N_CODEPAGE_852, L10N_UCS2);
converters[2555904] = std::make_pair(L10N_CODEPAGE_1250, L10N_UTF8);
converters[2555907] = std::make_pair(L10N_CODEPAGE_1250, L10N_UCS2);
converters[2621440] = std::make_pair(L10N_CODEPAGE_737, L10N_UTF8);
converters[2621443] = std::make_pair(L10N_CODEPAGE_737, L10N_UCS2);
converters[2686976] = std::make_pair(L10N_CODEPAGE_1253, L10N_UTF8);
converters[2686979] = std::make_pair(L10N_CODEPAGE_1253, L10N_UCS2);
converters[2752512] = std::make_pair(L10N_CODEPAGE_857, L10N_UTF8);
converters[2752515] = std::make_pair(L10N_CODEPAGE_857, L10N_UCS2);
converters[2818048] = std::make_pair(L10N_CODEPAGE_1254, L10N_UTF8);
converters[2818051] = std::make_pair(L10N_CODEPAGE_1254, L10N_UCS2);
converters[2883584] = std::make_pair(L10N_CODEPAGE_775, L10N_UTF8);
converters[2883587] = std::make_pair(L10N_CODEPAGE_775, L10N_UCS2);
converters[2949120] = std::make_pair(L10N_CODEPAGE_1257, L10N_UTF8);
converters[2949123] = std::make_pair(L10N_CODEPAGE_1257, L10N_UCS2);
converters[3014656] = std::make_pair(L10N_CODEPAGE_855, L10N_UTF8);
converters[3014659] = std::make_pair(L10N_CODEPAGE_855, L10N_UCS2);
converters[3080192] = std::make_pair(L10N_CODEPAGE_858, L10N_UTF8);
converters[3080195] = std::make_pair(L10N_CODEPAGE_858, L10N_UCS2);
converters[3145728] = std::make_pair(L10N_CODEPAGE_860, L10N_UTF8);
converters[3145731] = std::make_pair(L10N_CODEPAGE_860, L10N_UCS2);
converters[3211264] = std::make_pair(L10N_CODEPAGE_861, L10N_UTF8);
converters[3211267] = std::make_pair(L10N_CODEPAGE_861, L10N_UCS2);
converters[3276800] = std::make_pair(L10N_CODEPAGE_865, L10N_UTF8);
converters[3276803] = std::make_pair(L10N_CODEPAGE_865, L10N_UCS2);
converters[3342336] = std::make_pair(L10N_CODEPAGE_869, L10N_UTF8);
converters[3342339] = std::make_pair(L10N_CODEPAGE_869, L10N_UCS2);
}

View File

@ -30,6 +30,17 @@
extern Module cellNetCtl;
std::unique_ptr<SignInDialogInstance> g_sign_in_dialog;
SignInDialogInstance::SignInDialogInstance()
{
}
void SignInDialogInstance::Close()
{
state = signInDialogClose;
}
s32 cellNetCtlInit()
{
cellNetCtl.Warning("cellNetCtlInit()");
@ -334,12 +345,68 @@ s32 cellNetCtlGetInfo(s32 code, vm::ptr<CellNetCtlInfo> info)
return CELL_OK;
}
void dialogOpenCallback()
{
named_thread_t(WRAP_EXPR("SignInDialog Thread"), [=]()
{
while (g_sign_in_dialog->state == signInDialogOpen)
{
if (Emu.IsStopped())
{
g_sign_in_dialog->state = signInDialogAbort;
break;
}
std::this_thread::sleep_for(std::chrono::milliseconds(1)); // hack
}
CallAfter([]()
{
g_sign_in_dialog->Destroy();
g_sign_in_dialog->state = signInDialogNone;
});
}).detach();
}
s32 cellNetCtlNetStartDialogLoadAsync(vm::ptr<CellNetCtlNetStartDialogParam> param)
{
cellNetCtl.Warning("cellNetCtlNetStartDialogLoadAsync(param=*0x%x)", param);
// TODO: Actually sign into PSN or an emulated network similar to PSN
sysutilSendSystemCommand(CELL_SYSUTIL_NET_CTL_NETSTART_FINISHED, 0);
// TODO: Actually sign into PSN or an emulated network similar to PSN (ESN)
sysutilSendSystemCommand(CELL_SYSUTIL_NET_CTL_NETSTART_LOADED, 0);
// The way this is handled, is heavily inspired by the cellMsgDialogOpen2 implementation
if (param->type == CELL_NET_CTL_NETSTART_TYPE_NP)
{
cellNetCtl.Warning("cellNetCtlNetStartDialogLoadAsync(CELL_NET_CTL_NETSTART_TYPE_NP)", param);
// Make sure that the dialog is not already open.
SignInDialogState old = signInDialogNone;
if (!g_sign_in_dialog->state.compare_exchange_strong(old, signInDialogInit))
{
return CELL_SYSUTIL_ERROR_BUSY;
}
CallAfter([]()
{
if (Emu.IsStopped())
{
g_sign_in_dialog->state.exchange(signInDialogNone);
return;
}
g_sign_in_dialog->Create();
g_sign_in_dialog->state.exchange(signInDialogOpen);
dialogOpenCallback();
});
}
else
{
cellNetCtl.Warning("cellNetCtlNetStartDialogLoadAsync(CELL_NET_CTL_NETSTART_TYPE_NET)", param);
sysutilSendSystemCommand(CELL_SYSUTIL_NET_CTL_NETSTART_FINISHED, 0);
}
return CELL_OK;
}
@ -348,6 +415,15 @@ s32 cellNetCtlNetStartDialogAbortAsync()
{
cellNetCtl.Todo("cellNetCtlNetStartDialogAbortAsync()");
SignInDialogState old = signInDialogOpen;
if (!g_sign_in_dialog->state.compare_exchange_strong(old, signInDialogAbort))
{
cellNetCtl.Error("cellNetCtlNetStartDialogAbortAsync(): Aborting the dialog failed.");
}
g_sign_in_dialog->status = CELL_NET_CTL_ERROR_DIALOG_ABORTED;
return CELL_OK;
}
@ -355,6 +431,7 @@ s32 cellNetCtlNetStartDialogUnloadAsync(vm::ptr<CellNetCtlNetStartDialogResult>
{
cellNetCtl.Warning("cellNetCtlNetStartDialogUnloadAsync(result=*0x%x)", result);
result->result = g_sign_in_dialog->status;
sysutilSendSystemCommand(CELL_SYSUTIL_NET_CTL_NETSTART_UNLOADED, 0);
return CELL_OK;

View File

@ -261,6 +261,30 @@ struct CellNetCtlNatInfo
typedef void(cellNetCtlHandler)(s32 prev_state, s32 new_state, s32 event, s32 error_code, vm::ptr<u32> arg);
enum SignInDialogState
{
signInDialogNone,
signInDialogInit,
signInDialogOpen,
signInDialogClose,
signInDialogAbort,
};
struct SignInDialogInstance
{
std::atomic<SignInDialogState> state;
s32 status;
SignInDialogInstance();
virtual ~SignInDialogInstance() = default;
virtual void Close();
virtual void Create() = 0;
virtual void Destroy() = 0;
};
inline static const char* InfoCodeToName(s32 code)
{
switch (code)

View File

@ -72,12 +72,33 @@ s32 cellPadClearBuf(u32 port_no)
s32 cellPadPeriphGetInfo(vm::ptr<CellPadPeriphInfo> info)
{
sys_io.Warning("cellPadPeriphGetInfo(info=*0x%x)", info);
sys_io.Todo("cellPadPeriphGetInfo(info=*0x%x)", info);
if (!Emu.GetPadManager().IsInited())
{
return CELL_PAD_ERROR_UNINITIALIZED;
}
const PadInfo& rinfo = Emu.GetPadManager().GetInfo();
info->max_connect = rinfo.max_connect;
info->now_connect = rinfo.now_connect;
info->system_info = rinfo.system_info;
std::vector<Pad>& pads = Emu.GetPadManager().GetPads();
// TODO: Support other types of controllers
for (u32 i = 0; i < info->now_connect; i++)
for (u32 i = 0; i < CELL_PAD_MAX_PORT_NUM; ++i)
{
if (i >= pads.size())
break;
info->port_status[i] = pads[i].m_port_status;
info->port_setting[i] = pads[i].m_port_setting;
info->device_capability[i] = pads[i].m_device_capability;
info->device_type[i] = pads[i].m_device_type;
info->pclass_type[i] = CELL_PAD_PCLASS_TYPE_STANDARD;
info->pclass_profile[i] = 0x0;
}
return CELL_OK;

View File

@ -15,8 +15,8 @@ void playerBoot(vm::ptr<CellSailPlayer> pSelf, u64 userParam)
Emu.GetCallbackManager().Async([=](CPUThread& cpu)
{
CellSailEvent event;
event.u32x2.major = CELL_SAIL_EVENT_PLAYER_STATE_CHANGED;
event.u32x2.minor = 0;
event.major = CELL_SAIL_EVENT_PLAYER_STATE_CHANGED;
event.minor = 0;
pSelf->callback(static_cast<PPUThread&>(cpu), pSelf->callbackArg, event, CELL_SAIL_PLAYER_STATE_BOOT_TRANSITION, 0);
});
@ -26,8 +26,8 @@ void playerBoot(vm::ptr<CellSailPlayer> pSelf, u64 userParam)
Emu.GetCallbackManager().Async([=](CPUThread& cpu)
{
CellSailEvent event;
event.u32x2.major = CELL_SAIL_EVENT_PLAYER_CALL_COMPLETED;
event.u32x2.minor = CELL_SAIL_PLAYER_CALL_BOOT;
event.major = CELL_SAIL_EVENT_PLAYER_CALL_COMPLETED;
event.minor = CELL_SAIL_PLAYER_CALL_BOOT;
pSelf->callback(static_cast<PPUThread&>(cpu), pSelf->callbackArg, event, 0, 0);
});
}
@ -636,8 +636,8 @@ s32 cellSailPlayerInitialize2(
Emu.GetCallbackManager().Async([=](CPUThread& cpu)
{
CellSailEvent event;
event.u32x2.major = CELL_SAIL_EVENT_PLAYER_STATE_CHANGED;
event.u32x2.minor = 0;
event.major = CELL_SAIL_EVENT_PLAYER_STATE_CHANGED;
event.minor = 0;
pSelf->callback(static_cast<PPUThread&>(cpu), pSelf->callbackArg, event, CELL_SAIL_PLAYER_STATE_INITIALIZED, 0);
});
@ -725,11 +725,14 @@ s32 cellSailPlayerSetRendererVideo()
s32 cellSailPlayerSetParameter(vm::ptr<CellSailPlayer> pSelf, s32 parameterType, u64 param0, u64 param1)
{
cellSail.Todo("cellSailPlayerSetParameter(pSelf=*0x%x, parameterType=0x%x, param0=0x%llx, param1=0x%llx)", pSelf, parameterType, param0, param1);
cellSail.Warning("cellSailPlayerSetParameter(pSelf=*0x%x, parameterType=0x%x, param0=0x%llx, param1=0x%llx)", pSelf, parameterType, param0, param1);
switch (parameterType)
{
default: cellSail.Error("cellSailPlayerSetParameter(): unimplemented parameter %s", ParameterCodeToName(parameterType));
case CELL_SAIL_PARAMETER_GRAPHICS_ADAPTER_BUFFER_RELEASE_DELAY: pSelf->graphics_adapter_buffer_release_delay = param1; break; // TODO: Stream index
case CELL_SAIL_PARAMETER_CONTROL_PPU_THREAD_STACK_SIZE: pSelf->control_ppu_thread_stack_size = param0; break;
case CELL_SAIL_PARAMETER_ENABLE_APOST_SRC: pSelf->enable_apost_src = param1; break; // TODO: Stream index
default: cellSail.Todo("cellSailPlayerSetParameter(): unimplemented parameter %s", ParameterCodeToName(parameterType));
}
return CELL_OK;

View File

@ -1,5 +1,7 @@
#pragma once
#include "cellVpost.h"
namespace vm { using namespace ps3; }
// Error Codes
@ -662,13 +664,8 @@ struct CellSailSourceStreamingProfile
union CellSailEvent
{
struct
{
be_t<u32> major;
be_t<u32> minor;
}
u32x2;
be_t<u32> major;
be_t<u32> minor;
be_t<u64> value;
};
@ -1193,6 +1190,36 @@ struct CellSailPlayer
bool booted;
vm::ptr<CellSailSoundAdapter> sAdapter;
vm::ptr<CellSailGraphicsAdapter> gAdapter;
// Attributes
be_t<s32> control_ppu_thread_priority;
be_t<s32> control_ppu_thread_stack_size;
be_t<s32> spurs_num_of_spus;
be_t<s32> spurs_spu_thread_priority;
be_t<s32> spurs_ppu_thread_priority;
b8 spurs_exit_if_no_work;
be_t<s32> io_ppu_thread_priority;
be_t<s32> io_ppu_thread_stack_size;
be_t<s32> dmux_ppu_thread_priority;
be_t<s32> dmux_num_of_spus;
be_t<u64> dmux_spurs_task_priorities;
be_t<s32> adec_ppu_thread_priority;
be_t<s32> adec_num_of_spus;
be_t<u64> adec_spurs_task_priorities;
b8 enable_apost_src;
be_t<s32> vdec_ppu_thread_priority;
be_t<s32> vdec_m2v_num_of_spus;
be_t<s32> vdec_avc_num_of_spus;
be_t<u64> vdec_spurs_task_priorities;
vm::ptr<CellVpostCtrlParam> enable_vpost;
be_t<s32> vpost_ppu_thread_priority;
be_t<s32> vpost_num_of_spus;
be_t<u64> vpost_spurs_task_priorities;
be_t<s32> graphics_adapter_buffer_release_delay;
be_t<s32> video_performance_policy;
b8 av_sync_es_audio;
b8 av_sync_es_video;
CellSailFsRead fs;
};
CHECK_MAX_SIZE(CellSailPlayer, 0x100);

View File

@ -29,14 +29,14 @@ using PFuncDone = vm::ptr<CellSaveDataDoneCallback>;
enum : u32
{
SAVEDATA_OP_AUTO_SAVE = 0,
SAVEDATA_OP_AUTO_LOAD = 1,
SAVEDATA_OP_AUTO_SAVE = 0,
SAVEDATA_OP_AUTO_LOAD = 1,
SAVEDATA_OP_LIST_AUTO_SAVE = 2,
SAVEDATA_OP_LIST_AUTO_LOAD = 3,
SAVEDATA_OP_LIST_SAVE = 4,
SAVEDATA_OP_LIST_LOAD = 5,
SAVEDATA_OP_FIXED_SAVE = 6,
SAVEDATA_OP_FIXED_LOAD = 7,
SAVEDATA_OP_LIST_SAVE = 4,
SAVEDATA_OP_LIST_LOAD = 5,
SAVEDATA_OP_FIXED_SAVE = 6,
SAVEDATA_OP_FIXED_LOAD = 7,
SAVEDATA_OP_FIXED_DELETE = 14,
};

View File

@ -220,7 +220,7 @@ s32 sceNpTrophyRegisterContext(PPUThread& CPU, u32 context, u32 handle, vm::ptr<
s32 sceNpTrophyGetRequiredDiskSpace(u32 context, u32 handle, vm::ptr<u64> reqspace, u64 options)
{
sceNpTrophy.Todo("sceNpTrophyGetRequiredDiskSpace(context=0x%x, handle=0x%x, reqspace*=0x%x, options=0x%llx)", context, handle, reqspace, options);
sceNpTrophy.Todo("sceNpTrophyGetRequiredDiskSpace(context=0x%x, handle=0x%x, reqspace=*0x%x, options=0x%llx)", context, handle, reqspace, options);
const auto ctxt = idm::get<trophy_context_t>(context);

View File

@ -0,0 +1,79 @@
#include "stdafx_gui.h"
#include "Emu/SysCalls/Modules.h"
#include "Emu/Memory/Memory.h"
#include "Emu/SysCalls/Modules/cellSysutil.h"
#include "SignInDialog.h"
// TODO: Make this look and work more reasonably
void SignInDialogFrame::Create()
{
wxWindow* parent = nullptr; // TODO: align the window better
m_dialog = std::make_unique<wxDialog>(parent, wxID_ANY, "Sign in", wxDefaultPosition, wxDefaultSize);
static const u32 width = 300;
static const u32 height = 98;
wxNotebook* nb_config = new wxNotebook(m_dialog.get(), wxID_ANY, wxPoint(2, 2), wxSize(width, height));
wxPanel* p_esn = new wxPanel(nb_config, wxID_ANY);
wxPanel* p_psn = new wxPanel(nb_config, wxID_ANY);
wxButton* b_signin = new wxButton(p_esn, wxID_OK, "Fake sign in");
wxButton* b_cancel = new wxButton(p_esn, wxID_CANCEL, "Cancel");
nb_config->AddPage(p_esn, wxT("ESN"));
nb_config->AddPage(p_psn, wxT("PSN"));
wxBoxSizer* s_subpanel_esn = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* s_subpanel_psn = new wxBoxSizer(wxVERTICAL);
wxStaticText* esn_unimplemented = new wxStaticText(p_esn, wxID_ANY, "ESN support is not ready yet.");
wxStaticText* psn_unimplemented = new wxStaticText(p_psn, wxID_ANY, "PSN support is not yet implemented.");
// ESN
s_subpanel_esn->Add(esn_unimplemented, wxSizerFlags().Centre());
s_subpanel_esn->Add(b_signin, wxSizerFlags().Left().Border(5).Expand());
s_subpanel_esn->Add(b_cancel, wxSizerFlags().Right().Border(5).Expand());
// PSN
s_subpanel_psn->Add(psn_unimplemented, wxSizerFlags().Centre());
m_dialog->SetSizerAndFit(s_subpanel_esn, false);
m_dialog->SetSizerAndFit(s_subpanel_psn, false);
m_dialog->SetSize(width + 18, height + 42);
m_dialog->Centre(wxBOTH);
m_dialog->Show();
m_dialog->Enable();
//m_dialog->ShowModal();
b_signin->Bind(wxEVT_BUTTON, [&](wxCommandEvent& event)
{
this->status = CELL_OK;
this->m_dialog->Hide();
this->Close();
sysutilSendSystemCommand(CELL_SYSUTIL_NET_CTL_NETSTART_FINISHED, 0);
});
b_cancel->Bind(wxEVT_BUTTON, [&](wxCommandEvent& event)
{
this->status = CELL_NET_CTL_ERROR_DIALOG_CANCELED;
this->m_dialog->Hide();
this->Close();
sysutilSendSystemCommand(CELL_SYSUTIL_NET_CTL_NETSTART_FINISHED, 0);
});
m_dialog->Bind(wxEVT_CLOSE_WINDOW, [&](wxCloseEvent& event)
{
this->status = CELL_NET_CTL_ERROR_DIALOG_CANCELED;
this->m_dialog->Hide();
this->Close();
sysutilSendSystemCommand(CELL_SYSUTIL_NET_CTL_NETSTART_FINISHED, 0);
});
}
void SignInDialogFrame::Destroy()
{
m_dialog.reset();
}

12
rpcs3/Gui/SignInDialog.h Normal file
View File

@ -0,0 +1,12 @@
#pragma once
#include "Emu/SysCalls/Modules/cellNetCtl.h"
class SignInDialogFrame : public SignInDialogInstance
{
std::unique_ptr<wxDialog> m_dialog;
public:
virtual void Create() override;
virtual void Destroy() override;
};

View File

@ -529,6 +529,7 @@
<ClCompile Include="Gui\SaveDataDialog.cpp" />
<ClCompile Include="Gui\SaveDataUtility.cpp" />
<ClCompile Include="Gui\SettingsDialog.cpp" />
<ClCompile Include="Gui\SignInDialog.cpp" />
<ClCompile Include="Gui\TextInputDialog.cpp" />
<ClCompile Include="Gui\VFSManager.cpp" />
<ClCompile Include="Gui\VHDDManager.cpp" />
@ -579,6 +580,7 @@
<ClInclude Include="Gui\SaveDataDialog.h" />
<ClInclude Include="Gui\SaveDataUtility.h" />
<ClInclude Include="Gui\SettingsDialog.h" />
<ClInclude Include="Gui\SignInDialog.h" />
<ClInclude Include="Gui\TextInputDialog.h" />
<ClInclude Include="Gui\VFSManager.h" />
<ClInclude Include="Gui\VHDDManager.h" />

View File

@ -108,6 +108,9 @@
<ClCompile Include="Gui\SettingsDialog.cpp">
<Filter>Gui</Filter>
</ClCompile>
<ClCompile Include="Gui\SignInDialog.cpp">
<Filter>Gui</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="rpcs3.rc" />
@ -219,6 +222,9 @@
<ClInclude Include="Gui\SettingsDialog.h">
<Filter>Gui</Filter>
</ClInclude>
<ClInclude Include="Gui\SignInDialog.h">
<Filter>Gui</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Image Include="rpcs3.ico" />