From f8f81929ddc5293de65003959f7f49bf7e208cc0 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Thu, 27 Aug 2026 07:00:05 +0200 Subject: runrom: use Path instead of PathBuf as a parameter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miquel Sabaté Solà --- crates/runrom/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/runrom') diff --git a/crates/runrom/src/main.rs b/crates/runrom/src/main.rs index 6d19a98..de11390 100644 --- a/crates/runrom/src/main.rs +++ b/crates/runrom/src/main.rs @@ -2,7 +2,7 @@ use header::Header; use std::collections::HashMap; use std::fs::File; use std::io::{BufRead, BufReader, ErrorKind, Read, Seek, SeekFrom}; -use std::path::PathBuf; +use std::path::{Path, PathBuf}; use vnf::{Machine, MemoryInitialValue, MemoryPolicy}; /// Version for this program. @@ -72,7 +72,7 @@ fn parse_hex_argument(given: &str) -> Result { // Fetch the address mapping from the .nasm/addresses.txt file. You need to pass // the full 'path' to the .nasm/ directory for the project (i.e. the '-n/--nasm' // option). -fn fetch_addresses(path: &PathBuf) -> Result, String> { +fn fetch_addresses(path: &Path) -> Result, String> { let mut addresses: HashMap = HashMap::default(); if let Ok(file) = File::open(path.join("addresses.txt")) { @@ -235,7 +235,7 @@ fn start_from_reset_vector(file: &String) -> u16 { // The two bytes of the reset address are located as follows: // 1. Skip the ROM header, guaranteed to be exactly 0x10 bytes long. // 2. Go to the end of PRG ROM. - // 3. -6: NMI addres; -4: reset addres; -2: IRQ address. + // 3. -6: NMI address; -4: reset address; -2: IRQ address. let offset: u64 = (0x10 + (header.prg_rom_size * 16 * 1024) - 4) .try_into() .unwrap(); -- cgit v1.2.3