Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set a unique System Name #15454

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions rpcs3/Emu/Cell/Modules/cellSysutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ error_code cellSysutilGetSystemParamString(CellSysutilParamId id, vm::ptr<char>
case CELL_SYSUTIL_SYSTEMPARAM_ID_NICKNAME:
{
copy_size = CELL_SYSUTIL_SYSTEMPARAM_NICKNAME_SIZE;
param_str = g_cfg.sys.system_name.to_string();
break;
}

Expand Down
6 changes: 6 additions & 0 deletions rpcs3/Emu/system_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ bool cfg_root::node_core::enable_tsx_by_default()
{
return utils::has_rtm() && utils::has_mpx() && !utils::has_tsx_force_abort();
}

std::string cfg_root::node_sys::get_random_system_name()
{
std::srand(std::time(nullptr));
return "RPCS3-" + std::to_string(100 + std::rand() % 899);
}
3 changes: 3 additions & 0 deletions rpcs3/Emu/system_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,16 @@ struct cfg_root : cfg::node

struct node_sys : cfg::node
{
static std::string get_random_system_name();

node_sys(cfg::node* _this) : cfg::node(_this, "System") {}

cfg::_enum<CellSysutilLicenseArea> license_area{ this, "License Area", CellSysutilLicenseArea{1} }; // CELL_SYSUTIL_LICENSE_AREA_A
cfg::_enum<CellSysutilLang> language{ this, "Language", CellSysutilLang{1} }; // CELL_SYSUTIL_LANG_ENGLISH_US
cfg::_enum<CellKbMappingType> keyboard_type{ this, "Keyboard Type", CellKbMappingType{0} }; // CELL_KB_MAPPING_101 = US
cfg::_enum<enter_button_assign> enter_button_assignment{ this, "Enter button assignment", enter_button_assign::cross };
cfg::_int<-60*60*24*365*100LL, 60*60*24*365*100LL> console_time_offset{ this, "Console time offset (s)", 0 }; // console time offset, limited to +/-100years
cfg::string system_name{this, "System Name", get_random_system_name()};
cfg::uint<0, umax> console_psid_high{this, "PSID high"};
cfg::uint<0, umax> console_psid_low{this, "PSID low"};
cfg::string hdd_model{this, "HDD Model Name", ""};
Expand Down