From 0e91b103ed121caa21b5aad465c1ba530165cf53 Mon Sep 17 00:00:00 2001 From: John Breaux Date: Mon, 27 Mar 2023 18:30:31 -0500 Subject: [PATCH] LICENSE: Add MIT Licence --- Cargo.toml | 2 ++ LICENSE | 21 +++++++++++++++++++++ src/bus.rs | 4 ++++ src/cpu.rs | 3 +++ src/cpu/disassemble.rs | 3 +++ src/cpu/instruction.rs | 3 +++ src/cpu/tests.rs | 3 +++ src/error.rs | 5 ++++- src/io.rs | 3 +++ src/lib.rs | 17 +++++++++-------- src/main.rs | 3 +++ 11 files changed, 58 insertions(+), 9 deletions(-) create mode 100644 LICENSE diff --git a/Cargo.toml b/Cargo.toml index 5ca75ba..7fb2923 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,8 @@ name = "chirp" version = "0.1.0" edition = "2021" +authors = ["John Breaux"] +license = "MIT" [features] default = [] diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..beaf0de --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 John A. Breaux + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/src/bus.rs b/src/bus.rs index a640b68..209d086 100644 --- a/src/bus.rs +++ b/src/bus.rs @@ -1,4 +1,8 @@ +// (c) 2023 John A. Breaux +// This code is licensed under MIT license (see LICENSE.txt for details) + //! The Bus connects the CPU to Memory +//! This is more of a memory management unit + some utils for reading/writing use crate::error::Result; use std::{ diff --git a/src/cpu.rs b/src/cpu.rs index fa994aa..5efa4d2 100644 --- a/src/cpu.rs +++ b/src/cpu.rs @@ -1,3 +1,6 @@ +// (c) 2023 John A. Breaux +// This code is licensed under MIT license (see LICENSE.txt for details) + //! Decodes and runs instructions #[cfg(test)] diff --git a/src/cpu/disassemble.rs b/src/cpu/disassemble.rs index 9a442df..ba147ff 100644 --- a/src/cpu/disassemble.rs +++ b/src/cpu/disassemble.rs @@ -1,3 +1,6 @@ +// (c) 2023 John A. Breaux +// This code is licensed under MIT license (see LICENSE.txt for details) + //! A disassembler for Chip-8 opcodes use super::{Adr, Nib, Reg}; diff --git a/src/cpu/instruction.rs b/src/cpu/instruction.rs index 07a4561..33b13b0 100644 --- a/src/cpu/instruction.rs +++ b/src/cpu/instruction.rs @@ -1,3 +1,6 @@ +// (c) 2023 John A. Breaux +// This code is licensed under MIT license (see LICENSE.txt for details) + //! Represents a chip-8 instruction as a Rust enum use super::{Adr, Nib, Reg}; diff --git a/src/cpu/tests.rs b/src/cpu/tests.rs index 3552264..8707ae9 100644 --- a/src/cpu/tests.rs +++ b/src/cpu/tests.rs @@ -1,3 +1,6 @@ +// (c) 2023 John A. Breaux +// This code is licensed under MIT license (see LICENSE.txt for details) + //! Tests for cpu.rs //! //! These run instructions, and ensure their output is consistent with previous builds diff --git a/src/error.rs b/src/error.rs index 3e405ae..76ba5ef 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,3 +1,6 @@ +// (c) 2023 John A. Breaux +// This code is licensed under MIT license (see LICENSE.txt for details) + //! Error type for chumpulator use thiserror::Error; @@ -14,5 +17,5 @@ pub enum Error { #[error(transparent)] IoError(#[from] std::io::Error), #[error(transparent)] - WindowError(#[from] minifb::Error) + WindowError(#[from] minifb::Error), } diff --git a/src/io.rs b/src/io.rs index bcba03a..dbf6344 100644 --- a/src/io.rs +++ b/src/io.rs @@ -1,3 +1,6 @@ +// (c) 2023 John A. Breaux +// This code is licensed under MIT license (see LICENSE.txt for details) + //! Platform-specific IO/UI code, and some debug functionality. //! TODO: Break this into its own crate. diff --git a/src/lib.rs b/src/lib.rs index 0d78d6d..39f802c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,11 +1,12 @@ -#![feature(stmt_expr_attributes)] -/*! -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 -embarked on, and I'm fairly new to Rust, it's going to be rough around the edges. +// (c) 2023 John A. Breaux +// This code is licensed under MIT license (see LICENSE.txt for details) -Hopefully, though, you'll find some use in it. - */ +#![feature(stmt_expr_attributes)] +//! 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 +//! embarked on, and I'm fairly new to Rust, it's going to be rough around the edges. +//! +//! Hopefully, though, you'll find some use in it. pub mod bus; pub mod cpu; @@ -20,8 +21,8 @@ pub struct Chip8 { /// Common imports for chumpulator pub mod prelude { - use super::*; pub use super::Chip8; + use super::*; pub use crate::bus; pub use bus::{Bus, Read, Region::*, Write}; pub use cpu::{disassemble::Disassemble, ControlFlags, CPU}; diff --git a/src/main.rs b/src/main.rs index 30ab28e..98a3b27 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,6 @@ +// (c) 2023 John A. Breaux +// This code is licensed under MIT license (see LICENSE.txt for details) + //! Chirp: A chip-8 interpreter in Rust //! Hello, world!