From a28a92167e12e2fbbdaf9f9b0fa1a2c4f5a1d360 Mon Sep 17 00:00:00 2001 From: Matthias Endler Date: Tue, 30 Oct 2018 01:16:02 +0100 Subject: [PATCH] Add no_std flag --- README.md | 3 +++ src/bin/mos6502.rs | 51 ++++++++++------------------------------------ 2 files changed, 14 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index 6287505..f86acb7 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,9 @@ An emulator for the MOS 6502 CPU written in Rust. ## Usage example ```rust + +#![no_std] + extern crate mos6502; use mos6502::cpu; diff --git a/src/bin/mos6502.rs b/src/bin/mos6502.rs index 22e0586..ecb1e81 100644 --- a/src/bin/mos6502.rs +++ b/src/bin/mos6502.rs @@ -25,6 +25,8 @@ // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. +#![no_std] + extern crate mos6502; #[cfg(not(test))] @@ -44,22 +46,11 @@ fn main() { let zero_page_data: [u8; 17] = [ // ZeroPage data start - 0x00, - 0x02, // ADC ZeroPage target - 0x00, - 0x04, // ADC ZeroPageX target - 0x00, - 0x00, - 0x00, - 0x00, - 0x10, // ADC IndexedIndirectX address + 0x00, 0x02, // ADC ZeroPage target + 0x00, 0x04, // ADC ZeroPageX target + 0x00, 0x00, 0x00, 0x00, 0x10, // ADC IndexedIndirectX address 0x80, // ADC IndexedIndirectX address - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x08, // ADC IndirectIndexedY address + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, // ADC IndirectIndexedY address 0x80, // ADC IndirectIndexedY address ]; @@ -101,31 +92,11 @@ fn main() { ]; let data: [u8; 25] = [ - 0x00, - 0x09, // ADC Absolute target - 0x00, - 0x00, - 0x40, // ADC AbsoluteY target - 0x00, - 0x00, - 0x00, - 0x11, // ADC AbsoluteX target - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x12, // ADC IndexedIndirectX target - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x06, // ADC IndirectIndexedY target + 0x00, 0x09, // ADC Absolute target + 0x00, 0x00, 0x40, // ADC AbsoluteY target + 0x00, 0x00, 0x00, 0x11, // ADC AbsoluteX target + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, // ADC IndexedIndirectX target + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, // ADC IndirectIndexedY target ]; cpu.memory.set_bytes(Address(0x0000), &zero_page_data);