aboutsummaryrefslogtreecommitdiff
path: root/crates/readrom/src
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-07-13 17:37:43 +0200
committerMiquel Sabaté Solà <mssola@mssola.com>2026-07-13 17:37:43 +0200
commitef226a7e10fe665f025a0c4eed6e7dc0c613da4e (patch)
treeac5806c2803cb0d6d2e7944b90d67480d145820f /crates/readrom/src
parent426aa0d30b9e708ccb4072a17ade49bf5a245d63 (diff)
downloadtools.nes-ef226a7e10fe665f025a0c4eed6e7dc0c613da4e.tar.gz
tools.nes-ef226a7e10fe665f025a0c4eed6e7dc0c613da4e.zip
readrom: print the usual PRG-RAM size if available
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à <mssola@mssola.com>
Diffstat (limited to 'crates/readrom/src')
-rw-r--r--crates/readrom/src/main.rs3
1 files changed, 3 insertions, 0 deletions
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); {}",