Rewrite "d" replacement again but more like the previous algorithm

This commit is contained in:
YoshiRulz 2019-03-05 19:37:59 +10:00
parent 5412a74890
commit 0b5a61dcd3
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 5 additions and 1 deletions

View File

@ -17,7 +17,11 @@ namespace BizHawk.Emulation.Cores.Components.Z80A
if (format.IndexOf("n") != -1) format = format.Replace("n", $"{read(addr++):X2}h");
if (format.IndexOf("+d") != -1) format = format.Replace("+d", "d");
if (format.IndexOf("d") != -1) format = format.Replace("d", $"{(sbyte)read(addr++):+X2;-X2}h");
if (format.IndexOf("d") != -1)
{
var b = unchecked ((sbyte) read(addr++));
format = format.Replace("d", $"{(b < 0 ? '-' : '+')}{(b < 0 ? -b : b):X2}h");
}
return format;
}