mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-21 05:09:46 -06:00
Remove the last ConfigEntry
state (#1902)
* Get rid of `ConfigEntry::ExternalBIOSEnable` - Now the BIOS files themselves are checked - The frontend's `Config::ExternalBIOSEnable` is not affected * Add `JITArgs` * Pass the JIT status to the `ARM` constructors * Encapsulate `NDS::EnableJIT` * Pass `JITArgs` to `ARMJIT`'s constructor * Remove the `JIT_*` `ConfigEntry`s in favor of members - Allow all the JIT args to be set with `NDS::SetJITArgs` - Encapsulate the JIT-related parameters in `ARMJIT` so they can reset the block cache if changed - Update the active (or newly-created) console in the frontend with adjusted JIT args * Make audio bit depth and interpolation configurable in `NDSArgs` - Define enums for both - Give those settings default values in `NDSArgs` - Remove `ConfigEntry::AudioBitDepth` - Initialize these settings in the relevant SPU constructors * Move the last DSi-specific logic in `Reset` to its own subclass * Remove `ConfigEntry::DSi_FullBIOSBoot` - Add members to `DSi` instead for getting and setting this - Update the frontend to accommodate these changes * Oops, missed a spot * Remove `ConfigEntry::Firm_MAC` and `Platform::GetConfigArray` - Also move the MAC parsing code to `ROMManager` * Remove the last `ConfigEntry` state - Make GDB support configurable via members * Add some `#ifdef`s that I'd almost forgotten
This commit is contained in:
@ -1078,6 +1078,36 @@ pair<unique_ptr<Firmware>, string> GenerateDefaultFirmware()
|
||||
return std::make_pair(std::move(firmware), std::move(wfcsettingspath));
|
||||
}
|
||||
|
||||
bool ParseMacAddress(void* data)
|
||||
{
|
||||
const std::string& 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;
|
||||
}
|
||||
|
||||
void CustomizeFirmware(Firmware& firmware) noexcept
|
||||
{
|
||||
auto& currentData = firmware.GetEffectiveUserData();
|
||||
@ -1136,7 +1166,7 @@ void CustomizeFirmware(Firmware& firmware) noexcept
|
||||
|
||||
|
||||
MacAddress configuredMac;
|
||||
rep = Platform::GetConfigArray(Platform::Firm_MAC, &configuredMac);
|
||||
rep = ParseMacAddress(&configuredMac);
|
||||
rep &= (configuredMac != MacAddress());
|
||||
|
||||
if (rep)
|
||||
|
Reference in New Issue
Block a user