diff options
| author | Miquel Sabaté Solà <mssola@mssola.com> | 2026-08-24 16:18:27 +0200 |
|---|---|---|
| committer | Miquel Sabaté Solà <mssola@mssola.com> | 2026-08-24 16:18:27 +0200 |
| commit | e6c41303c2da5afd230570cb5610905ade71fecf (patch) | |
| tree | 70a1bc3fa3b14e3b2ea042148a55c461fafc25df /lib/vnf | |
| parent | 86006af348be75412fdc3dfb5a037b89a01122e8 (diff) | |
| download | tools.nes-e6c41303c2da.tar.gz tools.nes-e6c41303c2da.zip | |
runrom: add the --until-address option
This allows the user to run execution until a given address is
reached. This can, like with the --start option, be coupled with the
--nasm option in order to be able to provide an identifier instead of a
regular hexadecimal value.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'lib/vnf')
| -rw-r--r-- | lib/vnf/src/lib.rs | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/lib/vnf/src/lib.rs b/lib/vnf/src/lib.rs index d118157..349548a 100644 --- a/lib/vnf/src/lib.rs +++ b/lib/vnf/src/lib.rs @@ -183,7 +183,7 @@ pub struct Machine { /// Whether the machine is supposed to be running just a function (while /// also going into inner calls). Hence, it will stop whenever an 'rts' or /// 'rti' instruction is found at the top level. - run_function_mode: bool, + pub run_function_mode: bool, /// The PRG ROM pool of bytes. pub prg_rom: Vec<u8>, @@ -554,20 +554,6 @@ impl Machine { Ok(()) } - /// Run a top-level function. That is, assume that the current 'start' - /// address is the start of a function, and keep on iterating the machine - /// until an 'rts'/'rti' instruction is found at the top-level (we still - /// allow inner calls). - pub fn run_function(&mut self) -> Result<(), String> { - self.run_function_mode = true; - - while self.active { - self.next_iteration()?; - } - - Ok(()) - } - /// Run until the program counter reaches the given 'address'. pub fn until_address(&mut self, address: u16) -> Result<(), String> { while self.pc != address as usize { |
