Update units of memory from decimal to binary prefixes (#3716)

`MB` and `GB` can either be interpreted as having base-10 units, or
base-2. `MiB` and `GiB` removes this discrepancy so that units of memory
are always interpreted using base-2 units.
This commit is contained in:
Wunk 2022-11-16 14:27:42 -08:00 committed by GitHub
parent d751da84f9
commit d536cc8ae6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 165 additions and 165 deletions

View file

@ -81,22 +81,22 @@ namespace Ryujinx.Ui.Helper
string aValue = model.GetValue(a, 8).ToString();
string bValue = model.GetValue(b, 8).ToString();
if (aValue[^2..] == "GB")
if (aValue[^3..] == "GiB")
{
aValue = (float.Parse(aValue[0..^2]) * 1024).ToString();
aValue = (float.Parse(aValue[0..^3]) * 1024).ToString();
}
else
{
aValue = aValue[0..^2];
aValue = aValue[0..^3];
}
if (bValue[^2..] == "GB")
if (bValue[^3..] == "GiB")
{
bValue = (float.Parse(bValue[0..^2]) * 1024).ToString();
bValue = (float.Parse(bValue[0..^3]) * 1024).ToString();
}
else
{
bValue = bValue[0..^2];
bValue = bValue[0..^3];
}
if (float.Parse(aValue) > float.Parse(bValue))

View file

@ -549,8 +549,8 @@ namespace Ryujinx.Ui
}
var memoryConfiguration = ConfigurationState.Instance.System.ExpandRam.Value
? HLE.MemoryConfiguration.MemoryConfiguration6GB
: HLE.MemoryConfiguration.MemoryConfiguration4GB;
? HLE.MemoryConfiguration.MemoryConfiguration6GiB
: HLE.MemoryConfiguration.MemoryConfiguration4GiB;
IntegrityCheckLevel fsIntegrityCheckLevel = ConfigurationState.Instance.System.EnableFsIntegrityChecks ? IntegrityCheckLevel.ErrorOnInvalid : IntegrityCheckLevel.None;

View file

@ -1749,11 +1749,11 @@
<property name="orientation">vertical</property>
<child>
<object class="GtkCheckButton" id="_expandRamToggle">
<property name="label" translatable="yes">Expand DRAM Size to 6GB</property>
<property name="label" translatable="yes">Expand DRAM Size to 6GiB</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="tooltip-text" translatable="yes">Increases the amount of memory on the emulated system from 4GB to 6GB.&#13;This is only useful for higher-resolution texture packs or 4k resolution mods. Does NOT improve performance.&#13;Leave OFF if unsure.</property>
<property name="tooltip-text" translatable="yes">Increases the amount of memory on the emulated system from 4GiB to 6GiB.&#13;This is only useful for higher-resolution texture packs or 4k resolution mods. Does NOT improve performance.&#13;Leave OFF if unsure.</property>
<property name="halign">start</property>
<property name="margin-top">5</property>
<property name="margin-bottom">5</property>