From ef226a7e10fe665f025a0c4eed6e7dc0c613da4e Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Mon, 13 Jul 2026 17:37:43 +0200 Subject: readrom: print the usual PRG-RAM size if available MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If 'has_persistent_memory' has been set on the ROM header, then we must print it even if bytes 8/10 was never set by the header. In fact, the vast majority of ROM files don't have these bytes set but they report a true value for 'has_persistent_memory'. Hence, assume the usual PRG-RAM size in these cases, which is (I hope) the correct one in all cases. Signed-off-by: Miquel Sabaté Solà --- crates/readrom/src/main.rs | 3 +++ lib/header/src/lib.rs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/readrom/src/main.rs b/crates/readrom/src/main.rs index 07ca349..3c87417 100644 --- a/crates/readrom/src/main.rs +++ b/crates/readrom/src/main.rs @@ -97,7 +97,10 @@ fn print_header(header: &Header) { def.size / 1024, def.kind ); + } else if header.has_persistent_memory { + println!(" PRG-RAM size:\t\t8192 bytes (8KB)"); } + if let Some(def) = &header.chr_ram_definition { println!( " CHR-RAM size:\t\t{} bytes ({}KB); {}", diff --git a/lib/header/src/lib.rs b/lib/header/src/lib.rs index bd1edaa..7f561a1 100644 --- a/lib/header/src/lib.rs +++ b/lib/header/src/lib.rs @@ -221,7 +221,7 @@ fn parse_ram_definition( ) -> Option { // If the bit for persistent memory was not set, then we don't even // bother. If there was something relevant here, then the ROM does not have - // a proper format.\ + // a proper format. // // Moreover, if this is not NES 2.0 format, then we don't even bother as // defining this on iNES v1 is not recommended. -- cgit v1.2.3