Improve error message when core does not implement mem callbacks

This commit is contained in:
YoshiRulz 2023-04-08 02:16:29 +10:00
parent fbe1f9b53e
commit 6e77c7348f
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 11 additions and 15 deletions

View File

@ -29,15 +29,11 @@ namespace BizHawk.Client.Common
public override string Name => "event";
private void LogMemoryCallbacksNotImplemented()
{
Log($"{Emulator.Attributes().CoreName} does not implement memory callbacks");
}
private void LogMemoryCallbacksNotImplemented(bool isWildcard)
=> Log($"{Emulator.Attributes().CoreName} does not implement {(isWildcard ? "wildcard " : string.Empty)}memory callbacks");
private void LogMemoryExecuteCallbacksNotImplemented()
{
Log($"{Emulator.Attributes().CoreName} does not implement memory execute callbacks");
}
private void LogMemoryExecuteCallbacksNotImplemented(bool isWildcard)
=> Log($"{Emulator.Attributes().CoreName} does not implement {(isWildcard ? "wildcard " : string.Empty)}memory execute callbacks");
private void LogScopeNotAvailable(string scope)
{
@ -136,11 +132,11 @@ namespace BizHawk.Client.Common
}
catch (NotImplementedException)
{
LogMemoryExecuteCallbacksNotImplemented();
LogMemoryExecuteCallbacksNotImplemented(isWildcard: false);
return Guid.Empty.ToString();
}
LogMemoryExecuteCallbacksNotImplemented();
LogMemoryExecuteCallbacksNotImplemented(isWildcard: false);
return Guid.Empty.ToString();
}
@ -190,7 +186,7 @@ namespace BizHawk.Client.Common
{
// fall through
}
LogMemoryExecuteCallbacksNotImplemented();
LogMemoryExecuteCallbacksNotImplemented(isWildcard: true);
return Guid.Empty.ToString();
}
@ -232,11 +228,11 @@ namespace BizHawk.Client.Common
}
catch (NotImplementedException)
{
LogMemoryCallbacksNotImplemented();
LogMemoryCallbacksNotImplemented(isWildcard: address is null);
return Guid.Empty.ToString();
}
LogMemoryCallbacksNotImplemented();
LogMemoryCallbacksNotImplemented(isWildcard: address is null);
return Guid.Empty.ToString();
}
@ -278,11 +274,11 @@ namespace BizHawk.Client.Common
}
catch (NotImplementedException)
{
LogMemoryCallbacksNotImplemented();
LogMemoryCallbacksNotImplemented(isWildcard: address is null);
return Guid.Empty.ToString();
}
LogMemoryCallbacksNotImplemented();
LogMemoryCallbacksNotImplemented(isWildcard: address is null);
return Guid.Empty.ToString();
}