diff options
| author | Miquel Sabaté Solà <mssola@mssola.com> | 2026-08-27 07:00:05 +0200 |
|---|---|---|
| committer | Miquel Sabaté Solà <mssola@mssola.com> | 2026-08-27 07:09:07 +0200 |
| commit | f8f81929ddc5293de65003959f7f49bf7e208cc0 (patch) | |
| tree | d8a9bf3214f75024fdaab04fcfa6da74939451a0 | |
| parent | 1c4e8eff6849ce35c31f189f9a07519a89c48ef4 (diff) | |
| download | tools.nes-f8f81929ddc5293de65003959f7f49bf7e208cc0.tar.gz tools.nes-f8f81929ddc5293de65003959f7f49bf7e208cc0.zip | |
runrom: use Path instead of PathBuf as a parameter
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
| -rw-r--r-- | crates/runrom/src/main.rs | 6 |
1 files changed, 3 insertions, 3 deletions
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<u16, String> { // 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<HashMap<String, usize>, String> { +fn fetch_addresses(path: &Path) -> Result<HashMap<String, usize>, String> { let mut addresses: HashMap<String, usize> = 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(); |
