From da41cb8eca1bd48cc560134ef104b13bd4273f12 Mon Sep 17 00:00:00 2001 From: Filipe Rodrigues Date: Mon, 11 Jan 2021 14:44:44 +0000 Subject: [PATCH] `decompiler` now just goes instruction by instruction. --- dcb-tools/src/decompiler/main.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dcb-tools/src/decompiler/main.rs b/dcb-tools/src/decompiler/main.rs index 341d276..72bb3f2 100644 --- a/dcb-tools/src/decompiler/main.rs +++ b/dcb-tools/src/decompiler/main.rs @@ -76,7 +76,7 @@ mod logger; // Imports use anyhow::Context; -use dcb_exe::exe::{inst::InstFmt, iter::ExeItem}; +use dcb_exe::exe::inst::InstFmt; use dcb_io::GameFile; #[allow(clippy::cognitive_complexity, clippy::too_many_lines)] // TODO: Refactor @@ -97,6 +97,11 @@ fn main() -> Result<(), anyhow::Error> { println!("Header:\n{}", exe.header()); + for (pos, inst) in exe.parse_iter() { + println!("{}: {}", pos, inst.fmt_value(pos)); + } + + /* for item in exe.iter() { match item { // For each function or header, print a header and all it's instructions @@ -162,11 +167,8 @@ fn main() -> Result<(), anyhow::Error> { println!("{}: {}", pos, inst.fmt_value(pos)); }, } - - /* - - */ } + */ /* // Build the full instructions iterator