From 70bf93f33f8f253521971d819b50ecfbf1b5f722 Mon Sep 17 00:00:00 2001 From: Fabio Cavallo Date: Sat, 11 Nov 2023 10:14:37 +0100 Subject: [PATCH] Fixed the management of ROMs with less than 16KB of PRGROM (#190). --- src/core/database.h | 4 ++-- src/core/ines.c | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/core/database.h b/src/core/database.h index ede11e10b..b97a576fb 100644 --- a/src/core/database.h +++ b/src/core/database.h @@ -4122,9 +4122,9 @@ static const _dbelement dblist[] = { /* Stroke & Match Golf (VS) [!].nes */ {"8b0ea39aa9b3cfde4dcd376959dade1d79618c4d", 99, DEFAULT, DEFAULT, DEFAULT, RP2C03B, DEFAULT, NOEXTRA}, /* Tetris (VS) [a1].nes */ - {"83f26eb28474806561a3e5b7c1266c6f138f801b", 99, DEFAULT, DEFAULT, DEFAULT, RP2C03B, DEFAULT, NOEXTRA}, + {"83f26eb28474806561a3e5b7c1266c6f138f801b", 99, DEFAULT, DEFAULT, DEFAULT, RP2C04, DEFAULT, NOEXTRA}, /* Tetris (VS).nes */ - {"810442b860bcef2fd54f9c76f3b8058c9a769b15", 99, DEFAULT, DEFAULT, DEFAULT, RP2C03B, DEFAULT, NOEXTRA}, + {"810442b860bcef2fd54f9c76f3b8058c9a769b15", 99, DEFAULT, DEFAULT, DEFAULT, RP2C04, DEFAULT, NOEXTRA}, /* Vs. Battle Shitty by Jackass (Hack).nes */ {"6be8870249d8b1a80388352bbf8c7a46dccc40ff", 99, DEFAULT, DEFAULT, DEFAULT, RP2C04, DEFAULT, NOEXTRA}, /* VS. Blink (SMB1 VS Hack) [o1].nes */ diff --git a/src/core/ines.c b/src/core/ines.c index 74407f0d4..63e6f9ef4 100644 --- a/src/core/ines.c +++ b/src/core/ines.c @@ -384,7 +384,10 @@ BYTE ines_load_rom(void) { return (EXIT_ERROR); } - if (rom_mem_ctrl_memcpy_truncated(prgrom_pnt(), &rom, info.mapper.prgrom_size) == EXIT_ERROR) { + if (rom_mem_ctrl_memcpy_truncated( + // "Galaxian (J) (REV0) [!].nes" ha solo 8k di prgrom + prgrom_pnt() + (info.mapper.prgrom_size < S16K ? prgrom_size() - info.mapper.prgrom_size : 0), + &rom, info.mapper.prgrom_size) == EXIT_ERROR) { info.prg_truncated = TRUE; }