Moved the machine RAM sanity check to machine_get_max_ram().

This commit is contained in:
OBattler
2021-12-16 13:18:09 +01:00
parent 1d5d304aaa
commit ff02073050
2 changed files with 6 additions and 7 deletions

View File

@@ -1009,7 +1009,11 @@ machine_get_min_ram(int m)
int int
machine_get_max_ram(int m) machine_get_max_ram(int m)
{ {
return(machines[m].max_ram); #if (!(defined __amd64__ || defined _M_X64 || defined __aarch64__ || defined _M_ARM64))
return MIN(((int) machines[m].max_ram), 2097152);
#else
return MIN(((int) machines[m].max_ram), 3145728);
#endif
} }

View File

@@ -802,12 +802,7 @@ win_settings_machine_recalc_machine(HWND hdlg)
} else { } else {
/* MB granularity */ /* MB granularity */
h = GetDlgItem(hdlg, IDC_MEMSPIN); h = GetDlgItem(hdlg, IDC_MEMSPIN);
#if (!(defined __amd64__ || defined _M_X64 || defined __aarch64__ || defined _M_ARM64)) SendMessage(h, UDM_SETRANGE, 0, (machine_get_min_ram(temp_machine) << 6) | (machine_get_max_ram(temp_machine) >> 10));
i = MIN(machine_get_max_ram(temp_machine), 2097152);
#else
i = MIN(machine_get_max_ram(temp_machine), 3145728);
#endif
SendMessage(h, UDM_SETRANGE, 0, (machine_get_min_ram(temp_machine) << 6) | (i >> 10));
accel.nSec = 0; accel.nSec = 0;
accel.nInc = machine_get_ram_granularity(temp_machine) >> 10; accel.nInc = machine_get_ram_granularity(temp_machine) >> 10;