mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-24 14:49:53 -06:00
move 'randomize MAC' setting to firmware settings, and add setting for changing the MAC.
make things overall betterer.
This commit is contained in:
@ -201,6 +201,43 @@ std::string GetConfigString(ConfigEntry entry)
|
||||
return "";
|
||||
}
|
||||
|
||||
bool GetConfigArray(ConfigEntry entry, void* data)
|
||||
{
|
||||
switch (entry)
|
||||
{
|
||||
case Firm_MAC:
|
||||
{
|
||||
char* mac_in = Config::FirmwareMAC;
|
||||
u8* mac_out = (u8*)data;
|
||||
|
||||
int o = 0;
|
||||
u8 tmp = 0;
|
||||
for (int i = 0; i < 18; i++)
|
||||
{
|
||||
char c = mac_in[i];
|
||||
if (c == '\0') break;
|
||||
|
||||
int n;
|
||||
if (c >= '0' && c <= '9') n = c - '0';
|
||||
else if (c >= 'a' && c <= 'f') n = c - 'a' + 10;
|
||||
else if (c >= 'A' && c <= 'F') n = c - 'A' + 10;
|
||||
else continue;
|
||||
|
||||
if (!(o & 1))
|
||||
tmp = n;
|
||||
else
|
||||
mac_out[o >> 1] = n | (tmp << 4);
|
||||
|
||||
o++;
|
||||
if (o >= 12) return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
FILE* OpenFile(std::string path, std::string mode, bool mustexist)
|
||||
{
|
||||
|
Reference in New Issue
Block a user