Misc: clean up in preparation for merge
This commit is contained in:
		| @@ -19,6 +19,23 @@ use std::{ | ||||
| }; | ||||
| use ui::*; | ||||
|  | ||||
| pub fn main() -> Result<()> { | ||||
|     let options = Arguments::parse_args_default_or_exit(); | ||||
|     let state = State::new(options)?; | ||||
|     for result in state { | ||||
|         if let Err(e) = result { | ||||
|             eprintln!("{}", e.bold().red()); | ||||
|             break; | ||||
|         } | ||||
|     } | ||||
|     Ok(()) | ||||
| } | ||||
|  | ||||
| /// Parses a hexadecimal string into a u16 | ||||
| fn parse_hex(value: &str) -> std::result::Result<u16, std::num::ParseIntError> { | ||||
|     u16::from_str_radix(value, 16) | ||||
| } | ||||
|  | ||||
| #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Options, Hash)] | ||||
| struct Arguments { | ||||
|     #[options(help = "Load a ROM to run on Chirp.", required, free)] | ||||
| @@ -208,20 +225,3 @@ impl Iterator for State { | ||||
|         Some(Ok(())) | ||||
|     } | ||||
| } | ||||
|  | ||||
| pub fn main() -> Result<()> { | ||||
|     let options = Arguments::parse_args_default_or_exit(); | ||||
|     let state = State::new(options)?; | ||||
|     for result in state { | ||||
|         if let Err(e) = result { | ||||
|             eprintln!("{}", e.bold().red()); | ||||
|             break; | ||||
|         } | ||||
|     } | ||||
|     Ok(()) | ||||
| } | ||||
|  | ||||
| /// Parses a hexadecimal string into a u16 | ||||
| fn parse_hex(value: &str) -> std::result::Result<u16, std::num::ParseIntError> { | ||||
|     u16::from_str_radix(value, 16) | ||||
| } | ||||
|   | ||||
| @@ -154,7 +154,7 @@ impl Display for Insn { | ||||
|             Insn::call { A }       => write!(f, "call   {A:03x}"), | ||||
|             Insn::seb { B, x }     => write!(f, "se     #{B:02x}, v{x:X}"), | ||||
|             Insn::sneb { B, x }    => write!(f, "sne    #{B:02x}, v{x:X}"), | ||||
|             Insn::se { y, x }      => write!(f, "se     v{x:X}, v{y:X}"), | ||||
|             Insn::se { y, x }      => write!(f, "se     v{y:X}, v{x:X}"), | ||||
|             Insn::movb { B, x }    => write!(f, "mov    #{B:02x}, v{x:X}"), | ||||
|             Insn::addb { B, x }    => write!(f, "add    #{B:02x}, v{x:X}"), | ||||
|             Insn::mov { x, y }     => write!(f, "mov    v{y:X}, v{x:X}"), | ||||
| @@ -166,7 +166,7 @@ impl Display for Insn { | ||||
|             Insn::shr { y, x }     => write!(f, "shr    v{y:X}, v{x:X}"), | ||||
|             Insn::bsub { y, x }    => write!(f, "bsub   v{y:X}, v{x:X}"), | ||||
|             Insn::shl { y, x }     => write!(f, "shl    v{y:X}, v{x:X}"), | ||||
|             Insn::sne { y, x }     => write!(f, "sne    v{x:X}, v{y:X}"), | ||||
|             Insn::sne { y, x }     => write!(f, "sne    v{y:X}, v{x:X}"), | ||||
|             Insn::movI { A }       => write!(f, "mov    ${A:03x}, I"), | ||||
|             Insn::jmpr { A }       => write!(f, "jmp    ${A:03x}+v0"), | ||||
|             Insn::rand { B, x }    => write!(f, "rand   #{B:02x}, v{x:X}"), | ||||
|   | ||||
		Reference in New Issue
	
	Block a user