MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / DEV9CheckChanges

Function DEV9CheckChanges

pcsx2/DEV9/DEV9.cpp:1130–1161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1128}
1129
1130void DEV9CheckChanges(const Pcsx2Config& old_config)
1131{
1132 if (!isRunning)
1133 return;
1134
1135 //Eth
1136 ReconfigureLiveNet(old_config);
1137
1138 //Hdd
1139 //Hdd Validate Path
1140 std::string hddPath(GetHDDPath());
1141
1142 //Hdd Compare with old config
1143 if (EmuConfig.DEV9.HddEnable)
1144 {
1145 if (old_config.DEV9.HddEnable)
1146 {
1147 //ATA::Open/Close dosn't set any regs
1148 //So we can close/open to apply settings
1149 if (EmuConfig.DEV9.HddFile != old_config.DEV9.HddFile)
1150 {
1151 dev9.ata->Close();
1152 if (dev9.ata->Open(hddPath) != 0)
1153 EmuConfig.DEV9.HddEnable = false;
1154 }
1155 }
1156 else if (dev9.ata->Open(hddPath) != 0)
1157 EmuConfig.DEV9.HddEnable = false;
1158 }
1159 else if (old_config.DEV9.HddEnable)
1160 dev9.ata->Close();
1161}

Callers 1

Calls 4

ReconfigureLiveNetFunction · 0.85
GetHDDPathFunction · 0.85
CloseMethod · 0.45
OpenMethod · 0.45

Tested by

no test coverage detected