Skip to content

Commit

Permalink
Re-do network status and add it to settings
Browse files Browse the repository at this point in the history
  • Loading branch information
tambry committed Jul 9, 2015
1 parent 909b512 commit f272171
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 14 deletions.
19 changes: 13 additions & 6 deletions rpcs3/Emu/SysCalls/Modules/cellNetCtl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cellNetCtlInternal cellNetCtlInstance;

int cellNetCtlInit()
{
cellNetCtl.Warning("cellNetCtlInit()");
cellNetCtl.Log("cellNetCtlInit()");

if (cellNetCtlInstance.m_bInitialized)
return CELL_NET_CTL_ERROR_NOT_TERMINATED;
Expand All @@ -35,7 +35,7 @@ int cellNetCtlInit()

int cellNetCtlTerm()
{
cellNetCtl.Warning("cellNetCtlTerm()");
cellNetCtl.Log("cellNetCtlTerm()");

if (!cellNetCtlInstance.m_bInitialized)
return CELL_NET_CTL_ERROR_NOT_INITIALIZED;
Expand All @@ -47,13 +47,20 @@ int cellNetCtlTerm()

int cellNetCtlGetState(vm::ptr<u32> state)
{
cellNetCtl.Warning("cellNetCtlGetState(state_addr=0x%x)", state.addr());
cellNetCtl.Log("cellNetCtlGetState(state_addr=0x%x)", state.addr());

// Do we need to allow any other connection states?
if (Ini.Connected.GetValue())
if (Ini.NETStatus.GetValue() == 0)
{
*state = CELL_NET_CTL_STATE_IPObtained;
}
else if (Ini.NETStatus.GetValue() == 1)
{
*state = CELL_NET_CTL_STATE_IPObtaining;
}
else if (Ini.NETStatus.GetValue() == 2)
{
*state = CELL_NET_CTL_STATE_Connecting;
}
else
{
*state = CELL_NET_CTL_STATE_Disconnected;
Expand Down Expand Up @@ -92,7 +99,7 @@ int cellNetCtlNetStartDialogLoadAsync(vm::ptr<CellNetCtlNetStartDialogParam> par
{
cellNetCtl.Warning("cellNetCtlNetStartDialogLoadAsync(param_addr=0x%x)", param.addr());

// TODO: Actually sign into PSN
// TODO: Actually sign into PSN or an emulated network similar to PSN
sysutilSendSystemCommand(CELL_SYSUTIL_NET_CTL_NETSTART_FINISHED, 0);

return CELL_OK;
Expand Down
19 changes: 15 additions & 4 deletions rpcs3/Gui/MainFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))

// HLE / Misc.
wxStaticBoxSizer* s_round_hle_log_lvl = new wxStaticBoxSizer(wxVERTICAL, p_hle, _("Log Level"));
wxStaticBoxSizer* s_round_net_status = new wxStaticBoxSizer(wxVERTICAL, p_hle, _("Connection status"));

// System
wxStaticBoxSizer* s_round_sys_lang = new wxStaticBoxSizer(wxVERTICAL, p_system, _("Language"));
Expand All @@ -412,6 +413,7 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
wxComboBox* cbox_camera = new wxComboBox(p_camera, wxID_ANY);
wxComboBox* cbox_camera_type = new wxComboBox(p_camera, wxID_ANY);
wxComboBox* cbox_hle_loglvl = new wxComboBox(p_hle, wxID_ANY);
wxComboBox* cbox_net_status = new wxComboBox(p_hle, wxID_ANY);
wxComboBox* cbox_sys_lang = new wxComboBox(p_system, wxID_ANY);

wxCheckBox* chbox_gs_log_prog = new wxCheckBox(p_graphics, wxID_ANY, "Log vertex/fragment programs");
Expand Down Expand Up @@ -495,6 +497,11 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
cbox_hle_loglvl->Append("Errors");
cbox_hle_loglvl->Append("Nothing");

cbox_net_status->Append("IP Obtained");
cbox_net_status->Append("Obtaining IP");
cbox_net_status->Append("Connecting");
cbox_net_status->Append("Disconnected");

cbox_sys_lang->Append("Japanese");
cbox_sys_lang->Append("English (US)");
cbox_sys_lang->Append("French");
Expand Down Expand Up @@ -551,6 +558,7 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
cbox_camera ->SetSelection(Ini.Camera.GetValue());
cbox_camera_type ->SetSelection(Ini.CameraType.GetValue());
cbox_hle_loglvl ->SetSelection(Ini.HLELogLvl.GetValue());
cbox_net_status ->SetSelection(Ini.NETStatus.GetValue());
cbox_sys_lang ->SetSelection(Ini.SysLanguage.GetValue());

s_round_cpu_decoder->Add(cbox_cpu_decoder, wxSizerFlags().Border(wxALL, 5).Expand());
Expand All @@ -571,6 +579,7 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
s_round_camera_type->Add(cbox_camera_type, wxSizerFlags().Border(wxALL, 5).Expand());

s_round_hle_log_lvl->Add(cbox_hle_loglvl, wxSizerFlags().Border(wxALL, 5).Expand());
s_round_net_status->Add(cbox_net_status, wxSizerFlags().Border(wxALL, 5).Expand());

s_round_sys_lang->Add(cbox_sys_lang, wxSizerFlags().Border(wxALL, 5).Expand());

Expand Down Expand Up @@ -606,6 +615,7 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))

// HLE / Misc.
s_subpanel_hle->Add(s_round_hle_log_lvl, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_hle->Add(s_round_net_status, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_hle->Add(chbox_hle_logging, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_hle->Add(chbox_rsx_logging, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_hle->Add(chbox_hle_hook_stfunc, wxSizerFlags().Border(wxALL, 5).Expand());
Expand Down Expand Up @@ -669,6 +679,7 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
Ini.HLESaveTTY.SetValue(chbox_hle_savetty->GetValue());
Ini.HLEExitOnStop.SetValue(chbox_hle_exitonstop->GetValue());
Ini.HLELogLvl.SetValue(cbox_hle_loglvl->GetSelection());
Ini.NETStatus.SetValue(cbox_net_status->GetSelection());
Ini.SysLanguage.SetValue(cbox_sys_lang->GetSelection());
Ini.HLEAlwaysStart.SetValue(chbox_hle_always_start->GetValue());

Expand Down Expand Up @@ -825,15 +836,15 @@ void MainFrame::UpdateUI(wxCommandEvent& event)
wxMenuBar& menubar( *GetMenuBar() );

// Emulation
wxMenuItem& pause = *menubar.FindItem( id_sys_pause );
wxMenuItem& stop = *menubar.FindItem( id_sys_stop );
wxMenuItem& pause = *menubar.FindItem(id_sys_pause);
wxMenuItem& stop = *menubar.FindItem(id_sys_stop);
pause.SetItemLabel(is_running ? "&Pause\tCtrl + P" : is_ready ? "&Start\tCtrl + E" : "&Resume\tCtrl + E");
pause.Enable(!is_stopped);
stop.Enable(!is_stopped);

// PS3 Commands
wxMenuItem& send_exit = *menubar.FindItem( id_sys_send_exit );
wxMenuItem& send_open_menu = *menubar.FindItem( id_sys_send_open_menu );
wxMenuItem& send_exit = *menubar.FindItem(id_sys_send_exit);
wxMenuItem& send_open_menu = *menubar.FindItem(id_sys_send_open_menu);
bool enable_commands = !is_stopped;
send_open_menu.SetItemLabel(wxString::Format("Send &%s system menu cmd", (m_sys_menu_opened ? "close" : "open")));
send_open_menu.Enable(enable_commands);
Expand Down
8 changes: 4 additions & 4 deletions rpcs3/Ini.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class Inis

// HLE/Miscs
IniEntry<u8> HLELogLvl;
IniEntry<bool> Connected;
IniEntry<u8> NETStatus;
IniEntry<bool> HLELogging;
IniEntry<bool> RSXLogging;
IniEntry<bool> HLEHookStFunc;
Expand Down Expand Up @@ -229,7 +229,7 @@ class Inis
// HLE/Misc
HLELogging.Init("HLE_HLELogging", path);
RSXLogging.Init("RSX_Logging", path);
Connected.Init("NET_Connected", path);
NETStatus.Init("NET_Status", path);
HLEHookStFunc.Init("HLE_HLEHookStFunc", path);
HLESaveTTY.Init("HLE_HLESaveTTY", path);
HLEExitOnStop.Init("HLE_HLEExitOnStop", path);
Expand Down Expand Up @@ -307,7 +307,7 @@ class Inis
// HLE/Miscs
HLELogging.Load(false);
RSXLogging.Load(false);
Connected.Load(true);
NETStatus.Load(0);
HLEHookStFunc.Load(false);
HLESaveTTY.Load(false);
HLEExitOnStop.Load(false);
Expand Down Expand Up @@ -385,7 +385,7 @@ class Inis
// HLE/Miscs
HLELogging.Save();
RSXLogging.Save();
Connected.Save();
NETStatus.Save();
HLEHookStFunc.Save();
HLESaveTTY.Save();
HLEExitOnStop.Save();
Expand Down

0 comments on commit f272171

Please sign in to comment.