1
0
mirror of https://github.com/mre/mos6502.git synced 2024-06-26 14:29:31 +00:00

Shuffle things around a little. For now a library called machine6502 will be the main code base. 6502-rs is inconvenient to use in a rust context since it starts with a number. The test_exe is no longer the main cargo build target

This commit is contained in:
Johannes Muenzel 2014-09-26 02:59:00 -04:00
parent b22b36bc2a
commit 0b2c805a96
6 changed files with 30 additions and 32 deletions

2
.gitignore vendored
View File

@ -56,7 +56,7 @@ Cargo.lock
/*-*-*/ /*-*-*/
/Makefile /Makefile
/doc /doc
/target/ target/
/test/ /test/
/tmp/ /tmp/
TAGS TAGS

View File

@ -27,14 +27,11 @@
[package] [package]
name = "6502-rs" name = "machine6502"
version = "0.0.1" version = "0.0.1"
authors = ["The 6502-rs Developers"] authors = ["The 6502-rs Developers"]
[[bin]] [lib]
name = "6502-rs" name = "machine6502"
path = "src/exe/main.rs" path = "src/machine6502/lib.rs"
[dependencies.defs6502]
path="src/defs6502"

View File

@ -25,15 +25,5 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE. // POSSIBILITY OF SUCH DAMAGE.
pub use machine::ProcessorStatus; pub mod machine;
pub use machine::Machine;
pub use machine::StackPointer;
pub use machine::STACK_POINTER_IN_MEMORY_LO;
pub use machine::STACK_POINTER_IN_MEMORY_HI;
pub use machine::MemoryAddr;
pub use machine::stack_pointer_to_addr;
pub use machine::Instruction;
pub use machine::AddressingMode;
mod machine;

View File

@ -50,18 +50,26 @@ pub bitflags! {
} }
} }
#[allow(non_snake_case)]
pub struct Machine { pub struct Machine {
A : u8, pub A : u8,
X : u8, pub X : u8,
Y : u8, pub Y : u8,
SP : u8, pub SP : u8,
P : ProcessorStatus, pub P : ProcessorStatus,
PC : u16, pub PC : u16,
} }
impl Machine { impl Machine {
pub fn new() -> Machine { pub fn new() -> Machine {
Machine { A: 0, X: 0, Y: 0, SP: 0, P: ProcessorStatus::empty(), PC: 0 } Machine {
A: 0,
X: 0,
Y: 0,
SP: 0,
P: ProcessorStatus::empty(),
PC: 0
}
} }
} }

View File

@ -26,11 +26,14 @@
# POSSIBILITY OF SUCH DAMAGE. # POSSIBILITY OF SUCH DAMAGE.
[package] [package]
name = "defs6502" name = "test_exe"
version = "0.0.1" version = "0.0.1"
authors = [ "The 6502-rs Developers" ] authors = [ "The 6502-rs Developers" ]
[lib] [[bin]]
name = "defs6502" name = "test_exe"
path = "lib.rs" path = "main.rs"
[dependencies.machine6502]
path="../../"

View File

@ -25,9 +25,9 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE. // POSSIBILITY OF SUCH DAMAGE.
extern crate defs6502; extern crate machine6502;
use defs6502::Machine; use machine6502::machine::Machine;
fn main() { fn main() {
let _q = Machine::new(); let _q = Machine::new();