Skip to content

Commit

Permalink
Set a unique System Name
Browse files Browse the repository at this point in the history
  • Loading branch information
Florin9doi authored and elad335 committed Apr 15, 2024
1 parent e48ec75 commit e0d6f8a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
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

0 comments on commit e0d6f8a

Please sign in to comment.