mirror of
https://github.com/mre/mos6502.git
synced 2025-01-18 04:30:07 +00:00
Compile tests.
This commit is contained in:
parent
71d15f9d08
commit
d70915ad0f
@ -37,6 +37,8 @@ pub struct Address(pub u16);
|
|||||||
impl Add<AddressDiff, Address> for Address {
|
impl Add<AddressDiff, Address> for Address {
|
||||||
fn add(&self, &AddressDiff(rhs): &AddressDiff) -> Address {
|
fn add(&self, &AddressDiff(rhs): &AddressDiff) -> Address {
|
||||||
let &Address(lhs) = self;
|
let &Address(lhs) = self;
|
||||||
|
|
||||||
|
// TODO akeeton: Do a checked cast.
|
||||||
Address(((lhs as i32) + rhs) as u16)
|
Address(((lhs as i32) + rhs) as u16)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,6 +54,7 @@ impl StatusArgs {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub bitflags! {
|
pub bitflags! {
|
||||||
|
#[deriving(Show)]
|
||||||
flags Status: u8 {
|
flags Status: u8 {
|
||||||
const PS_NEGATIVE = 0b10000000,
|
const PS_NEGATIVE = 0b10000000,
|
||||||
const PS_OVERFLOW = 0b01000000,
|
const PS_OVERFLOW = 0b01000000,
|
||||||
@ -112,7 +113,7 @@ impl Status {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[deriving(PartialEq, Eq, PartialOrd, Ord)]
|
#[deriving(PartialEq, Eq, PartialOrd, Ord, Show)]
|
||||||
pub struct StackPointer(pub u8);
|
pub struct StackPointer(pub u8);
|
||||||
|
|
||||||
impl StackPointer {
|
impl StackPointer {
|
||||||
@ -122,6 +123,7 @@ impl StackPointer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[deriving(PartialEq, Eq, Show)]
|
||||||
pub struct Registers {
|
pub struct Registers {
|
||||||
pub accumulator: i8,
|
pub accumulator: i8,
|
||||||
pub index_x: i8,
|
pub index_x: i8,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user