N64: Software cheats (#882)

* N64: Implement cheats

* Remove unused function

* Corrected byte mask condition (skip if 0xffffffff)

* Meow

* Final changes to make the parser compatible with gamehacking.org's cheat files.

* Revert back to old pointer convention.
This commit is contained in:
Rikard Bengtsson
2024-03-07 12:39:20 +01:00
committed by GitHub
parent 9f7a883696
commit 6ab4f0036f
5 changed files with 1496 additions and 1255 deletions

View File

@@ -2351,6 +2351,7 @@ void HandleUI(void)
if (is_pce() && !bit) pcecd_reset();
if (is_saturn() && !bit) saturn_reset();
if (is_n64() && !bit) n64_reset();
user_io_status_set(opt, 1, ex);
user_io_status_set(opt, 0, ex);
@@ -2420,10 +2421,6 @@ void HandleUI(void)
neocd_set_en(0);
neogeo_romset_tx(selPath, 0);
}
else if (is_n64())
{
if (!n64_rom_tx(selPath, idx, load_addr)) Info("failed to load ROM");
}
else
{
if (is_pce())
@@ -2432,8 +2429,17 @@ void HandleUI(void)
pcecd_reset();
}
if (!store_name) user_io_store_filename(selPath);
user_io_file_tx(selPath, idx, opensave, 0, 0, load_addr);
if (user_io_use_cheats() && !store_name) cheats_init(selPath, user_io_get_file_crc());
if (is_n64())
{
uint32_t n64_crc;
if (!n64_rom_tx(selPath, idx, load_addr, n64_crc)) Info("failed to load ROM");
else if (user_io_use_cheats() && !store_name) cheats_init(selPath, n64_crc);
}
else
{
user_io_file_tx(selPath, idx, opensave, 0, 0, load_addr);
if (user_io_use_cheats() && !store_name) cheats_init(selPath, user_io_get_file_crc());
}
}
if (addon[0] == 'f' && addon[1] == '1') process_addon(addon, idx);