Skip to content

Commit

Permalink
Fix compilation with latest rustc
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Endler committed Aug 3, 2017
1 parent 82e2cac commit 034b8b1
Show file tree
Hide file tree
Showing 9 changed files with 1,296 additions and 1,060 deletions.
1 change: 1 addition & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
Alex Weisberger <[email protected]>
Andrew Keeton <[email protected]>
Johannes Muenzel <[email protected]>
Matthias Endler <[email protected]>
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@ name = "emu6502"
name = "emu6502"

[dependencies]
log = "0.2.3"

bitflags = "0.9.1"
log = "0.3.8"
num = "0.1"
10 changes: 4 additions & 6 deletions src/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,15 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

use std::num::Int;
use std::ops::Add;

// The idea here is that it doesn't make sense to add two addresses, but it
// does make sense to add an address and an "address-difference". (If this
// is too annoying to work with we should let it go.)
#[derive(Copy, PartialEq, Eq, PartialOrd, Ord, Debug)]
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug)]
pub struct AddressDiff(pub i32);

#[derive(Copy, PartialEq, Eq, PartialOrd, Ord, Debug)]
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug)]
pub struct Address(pub u16);

impl Add<AddressDiff> for Address {
Expand All @@ -57,7 +56,7 @@ impl Add for AddressDiff {
}
}

#[derive(Copy, PartialEq, Eq, PartialOrd, Ord)]
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord)]
pub struct CheckedAddressDiff(u16);

impl Add<CheckedAddressDiff> for Address {
Expand All @@ -77,7 +76,7 @@ impl Add<CheckedAddressDiff> for Address {
impl Address {
pub fn to_u16(&self) -> u16 {
match *self {
Address(address_) => address_
Address(address_) => address_,
}
}

Expand All @@ -93,4 +92,3 @@ impl Address {
(self.to_u16() & 0x00ff) as u8
}
}

978 changes: 615 additions & 363 deletions src/instruction.rs

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,17 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

#![feature(core)]
#![feature(hash)]
#![feature(rustc_private)]

// Needed for debug! / log! macros
#[macro_use]
extern crate log;

extern crate num;

#[macro_use]
extern crate rustc_bitflags;
extern crate bitflags;

pub mod address;
pub mod instruction;
pub mod machine;
pub mod memory;
pub mod range_incl;
pub mod registers;
Loading

0 comments on commit 034b8b1

Please sign in to comment.