1
0
mirror of https://github.com/mre/mos6502.git synced 2024-12-01 11:51:51 +00:00

Integrate IRQ.

This commit is contained in:
Andrew Keeton 2014-09-28 21:06:12 -04:00
parent f7cf02fb9e
commit 203bfa6244
2 changed files with 31 additions and 28 deletions

View File

@ -30,9 +30,12 @@ use address::AddressDiff;
use registers::StackPointer;
pub static MEMORY_ADDRESS_BEGIN: Address = Address(0x0000);
pub static MEMORY_ADDRESS_END: Address = Address(0xffff);
pub static MEMORY_ADDRESS_END: Address = Address(0xFFFF);
pub static STACK_ADDRESS_BEGIN: Address = Address(0x0100);
pub static STACK_ADDRESS_END: Address = Address(0x01ff);
pub static STACK_ADDRESS_END: Address = Address(0x01FF);
pub static IRQ_INTERRUPT_VECTOR_LO: Address = Address(0xFFFE);
pub static IRQ_INTERRUPT_VECTOR_HI: Address = Address(0xFFFF);
// static MEMORY_SIZE: uint = MEMORY_ADDRESS_END - MEMORY_ADDRESS_BEGIN + 1;
pub struct Memory {

View File

@ -31,7 +31,7 @@ use util::{ BitFlag, Off, On };
pub struct Status {
pub carry: BitFlag,
pub zero: BitFlag,
pub interrupt: BitFlag,
pub disable_interrupts: BitFlag,
pub decimal_mode: BitFlag,
pub brk: BitFlag,
pub unused: BitFlag,
@ -43,7 +43,7 @@ impl Status {
pub fn to_byte(&self) -> u8 {
self.carry.to_bit() << 0
| self.zero.to_bit() << 1
| self.interrupt.to_bit() << 2
| self.disable_interrupts.to_bit() << 2
| self.decimal_mode.to_bit() << 3
| self.brk.to_bit() << 4
| self.unused.to_bit() << 5
@ -56,7 +56,7 @@ impl Status {
Status {
carry: Off,
zero: Off,
interrupt: Off,
disable_interrupts: On,
decimal_mode: Off,
brk: Off,
unused: On,