Fix GBC cheevos using addresses in the Echo RAM

This commit is contained in:
Andre Leiradella 2017-07-09 18:32:53 +01:00
parent 3a590f126d
commit 2444d8b39c

View File

@ -1051,9 +1051,18 @@ void cheevos_parse_guest_addr(cheevos_var_t *var, unsigned value)
var->bank_id = -1;
var->value = value;
if ( cheevos_locals.console_id == CHEEVOS_CONSOLE_NINTENDO
&& var->value < 0x2000)
var->value &= 0x07ff;
switch (cheevos_locals.console_id)
{
case CHEEVOS_CONSOLE_NINTENDO:
if (var->value < 0x2000)
var->value &= 0x07ff;
break;
case CHEEVOS_CONSOLE_GAMEBOY_COLOR:
if (var->value >= 0xe000 && var->value <= 0xfdff)
var->value -= 0x2000;
break;
}
if (system->mmaps.num_descriptors != 0)
{