diff --git a/justfile b/justfile index ea37bb5..c44c6cb 100644 --- a/justfile +++ b/justfile @@ -1,3 +1,6 @@ +# (c) 2023 John A. Breaux +# This code is licensed under MIT license (see LICENSE for details) + # Some common commands for working on this stuff # Run All Tests diff --git a/src/bin/chirp-minifb/main.rs b/src/bin/chirp-minifb/main.rs index d2d9d45..7393284 100644 --- a/src/bin/chirp-minifb/main.rs +++ b/src/bin/chirp-minifb/main.rs @@ -1,5 +1,5 @@ // (c) 2023 John A. Breaux -// This code is licensed under MIT license (see LICENSE.txt for details) +// This code is licensed under MIT license (see LICENSE for details) //! Chirp: A chip-8 interpreter in Rust //! Hello, world! diff --git a/src/bin/chirp-minifb/ui.rs b/src/bin/chirp-minifb/ui.rs index 783bf03..ef56716 100644 --- a/src/bin/chirp-minifb/ui.rs +++ b/src/bin/chirp-minifb/ui.rs @@ -1,5 +1,5 @@ // (c) 2023 John A. Breaux -// This code is licensed under MIT license (see LICENSE.txt for details) +// This code is licensed under MIT license (see LICENSE for details) #![allow(missing_docs)] //! Platform-specific IO/UI code, and some debug functionality. //! TODO: Destroy this all. diff --git a/src/cpu.rs b/src/cpu.rs index c924ba0..4d9c450 100644 --- a/src/cpu.rs +++ b/src/cpu.rs @@ -1,5 +1,5 @@ // (c) 2023 John A. Breaux -// This code is licensed under MIT license (see LICENSE.txt for details) +// This code is licensed under MIT license (see LICENSE for details) //! Decodes and runs instructions diff --git a/src/cpu/bus.rs b/src/cpu/bus.rs index 4aae601..247e834 100644 --- a/src/cpu/bus.rs +++ b/src/cpu/bus.rs @@ -1,5 +1,5 @@ // (c) 2023 John A. Breaux -// This code is licensed under MIT license (see LICENSE.txt for details) +// This code is licensed under MIT license (see LICENSE for details) //! The Bus connects the CPU to Memory //! diff --git a/src/cpu/bus/read.rs b/src/cpu/bus/read.rs index ea20481..168e912 100644 --- a/src/cpu/bus/read.rs +++ b/src/cpu/bus/read.rs @@ -1,5 +1,5 @@ // (c) 2023 John A. Breaux -// This code is licensed under MIT license (see LICENSE.txt for details) +// This code is licensed under MIT license (see LICENSE for details) //! Trait for getting a generic integer for a structure. diff --git a/src/cpu/flags.rs b/src/cpu/flags.rs index b9c05b7..97e53a9 100644 --- a/src/cpu/flags.rs +++ b/src/cpu/flags.rs @@ -1,9 +1,13 @@ +// (c) 2023 John A. Breaux +// This code is licensed under MIT license (see LICENSE for details) + //! Represents [Flags] that aid in implementation but aren't a part of the Chip-8 spec use super::{Mode, Quirks}; /// Represents flags that aid in implementation but aren't a part of the Chip-8 spec #[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Flags { /// Set when debug (live disassembly) mode enabled pub debug: bool, diff --git a/src/cpu/mode.rs b/src/cpu/mode.rs index 27d34fe..f531a8c 100644 --- a/src/cpu/mode.rs +++ b/src/cpu/mode.rs @@ -1,3 +1,6 @@ +// (c) 2023 John A. Breaux +// This code is licensed under MIT license (see LICENSE for details) + //! Selects the memory behavior of the [super::CPU] //! //! Since [Quirks] implements [`From`], @@ -8,7 +11,8 @@ use crate::error::Error; use std::str::FromStr; /// Selects the memory behavior of the interpreter -#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum Mode { /// VIP emulation mode #[default] diff --git a/src/cpu/quirks.rs b/src/cpu/quirks.rs index 235fd03..d7703d8 100644 --- a/src/cpu/quirks.rs +++ b/src/cpu/quirks.rs @@ -1,9 +1,13 @@ +// (c) 2023 John A. Breaux +// This code is licensed under MIT license (see LICENSE for details) + //! Controls the [Quirks] behavior of the CPU on a granular level. /// Controls the quirk behavior of the CPU on a granular level. /// /// `false` is Cosmac-VIP-like behavior #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Quirks { /// Super Chip: Binary ops in `8xy`(`1`, `2`, `3`) shouldn't set vF to 0 pub bin_ops: bool, diff --git a/src/cpu/tests.rs b/src/cpu/tests.rs index d2573d4..72be40d 100644 --- a/src/cpu/tests.rs +++ b/src/cpu/tests.rs @@ -1,5 +1,5 @@ // (c) 2023 John A. Breaux -// This code is licensed under MIT license (see LICENSE.txt for details) +// This code is licensed under MIT license (see LICENSE for details) //! Unit tests for [super::CPU] //! diff --git a/src/error.rs b/src/error.rs index 51542e5..b6b3414 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,5 +1,5 @@ // (c) 2023 John A. Breaux -// This code is licensed under MIT license (see LICENSE.txt for details) +// This code is licensed under MIT license (see LICENSE for details) //! Error type for Chirp diff --git a/src/lib.rs b/src/lib.rs index c1daaea..36f359e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,6 @@ // (c) 2023 John A. Breaux -// This code is licensed under MIT license (see LICENSE.txt for details) -#![cfg_attr(feature = "unstable", feature(no_coverage))] +// This code is licensed under MIT license (see LICENSE for details) +#![cfg_attr(feature = "nightly", feature(no_coverage))] #![deny(missing_docs, clippy::all)] //! This crate implements a Chip-8 interpreter as if it were a real CPU architecture, //! to the best of my current knowledge. As it's the first emulator project I've diff --git a/tests/chip8_test_suite.rs b/tests/chip8_test_suite.rs index bd3c434..b023c08 100644 --- a/tests/chip8_test_suite.rs +++ b/tests/chip8_test_suite.rs @@ -1,3 +1,7 @@ +// (c) 2023 John A. Breaux +// This code is licensed under MIT license (see LICENSE for details) +// When compiled, the resulting binary is licensed under version 3 of the GNU General Public License (see chip8-test-suite/LICENSE for details) + //! These are a series of interpreter tests using Timendus's incredible test suite pub use chirp::*; diff --git a/tests/integration.rs b/tests/integration.rs index 445a627..2af03ae 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -3,6 +3,7 @@ use chirp::*; use std::{collections::hash_map::DefaultHasher, hash::Hash}; #[test] +#[allow(clippy::redundant_clone)] fn chip8() { let ch8 = Chip8::default(); // Default let ch82 = ch8.clone(); // Clone @@ -125,6 +126,7 @@ mod cpu { use super::*; //#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)] #[test] + #[allow(clippy::redundant_clone)] fn clone() { let cf1 = Flags { debug: false, @@ -259,6 +261,7 @@ mod quirks { dma_inc: true, stupid_jumps: false, }; + #[allow(clippy::clone_on_copy)] let q2 = q1.clone(); assert_eq!(q1, q2); }