Fixed dereferencing a non-banked address in the debugger
This commit is contained in:
parent
5cca2a4168
commit
9ca7540c69
@ -470,10 +470,14 @@ value_t debugger_evaluate(GB_gameboy_t *gb, const char *string,
|
||||
if (depth == 0) {
|
||||
value_t addr = debugger_evaluate(gb, string + 1, length - 2, error, watchpoint_address, watchpoint_new_value);
|
||||
banking_state_t state;
|
||||
if (addr.bank) {
|
||||
save_banking_state(gb, &state);
|
||||
switch_banking_state(gb, addr.bank);
|
||||
}
|
||||
value_t r = VALUE_16(GB_read_memory(gb, addr.value));
|
||||
if (addr.bank) {
|
||||
restore_banking_state(gb, &state);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user