Fix cheat search crashing on carts without RAM

This commit is contained in:
Lior Halphon 2025-06-10 01:19:29 +03:00
parent 282140822e
commit bfb1092cbb
1 changed files with 1 additions and 1 deletions

View File

@ -73,7 +73,7 @@ bool GB_cheat_search_filter(GB_gameboy_t *gb, const char *expression, GB_cheat_s
}
skip:;
old_data++;
if (new_data == gb->ram + gb->ram_size - 1) {
if (new_data == gb->ram + gb->ram_size - 1 && gb->mbc_ram_size) {
new_data = gb->mbc_ram;
}
else if (new_data == gb->mbc_ram + gb->mbc_ram_size - 1) {