aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-10-06 17:07:57 +0200
committerMiquel Sabaté Solà <mssola@mssola.com>2026-10-06 17:07:57 +0200
commitffd5f8684cf3871250ab2f0007b0324d74c134bb (patch)
tree520fb6c5cf81e2614097f4ffa54ead4ba0a0a899
parentb2ec385bf83ad895208e7eb481f704cf8a12a6c6 (diff)
downloadtools.nes-ffd5f8684cf3871250ab2f0007b0324d74c134bb.tar.gz
tools.nes-ffd5f8684cf3871250ab2f0007b0324d74c134bb.zip
readrom: also print the raw bytes from the header
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
-rw-r--r--crates/readrom/src/main.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/crates/readrom/src/main.rs b/crates/readrom/src/main.rs
index 1b800fb..f7411e3 100644
--- a/crates/readrom/src/main.rs
+++ b/crates/readrom/src/main.rs
@@ -642,12 +642,12 @@ fn main() {
die(e.to_string());
}
- let buf = bytes.get(0..0x10).unwrap_or(&[]);
+ let buf = bytes.get(0..0x10).unwrap_or(&[]).to_vec();
if buf.is_empty() {
die("malformed ROM file".to_string());
}
- let header = match Header::try_from(buf) {
+ let header = match Header::try_from(buf.as_slice()) {
Ok(h) => h,
Err(e) => die(e.to_string()),
};
@@ -677,6 +677,11 @@ fn main() {
// Nope. Then let's just print information about it. First the header.
print_header(&header);
+ print!(" Raw:\t\t\t\t[");
+ for c in buf {
+ print!(" {:02X}", c);
+ }
+ println!(" ]");
if args.header {
std::process::exit(0);
}