Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

MOS6502_1541 Class Reference

#include <CPU1541.h>

Collaboration diagram for MOS6502_1541:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MOS6502_1541 (C64 *c64, Job1541 *job, C64Display *disp, uint8 *Ram, uint8 *Rom)
 ~MOS6502_1541 ()
int EmulateLine (int cycles_left)
void Reset (void)
void AsyncReset (void)
void GetState (MOS6502State *s)
void SetState (MOS6502State *s)
uint8 ExtReadByte (uint16 adr)
void ExtWriteByte (uint16 adr, uint8 byte)
void CountVIATimers (int cycles)
void NewATNState (void)
void IECInterrupt (void)
void TriggerJobIRQ (void)
bool InterruptEnabled (void)

Public Attributes

MOS6526_2TheCIA2
uint8 IECLines
bool Idle

Private Member Functions

uint8 read_byte (uint16 adr)
uint8 read_byte_io (uint16 adr)
uint16 read_word (uint16 adr)
void write_byte (uint16 adr, uint8 byte)
void write_byte_io (uint16 adr, uint8 byte)
uint8 read_zp (uint16 adr)
uint16 read_zp_word (uint16 adr)
void write_zp (uint16 adr, uint8 byte)
void jump (uint16 adr)
void illegal_op (uint8 op, uint16 at)
void illegal_jump (uint16 at, uint16 to)
void do_adc (uint8 byte)
void do_sbc (uint8 byte)

Private Attributes

uint8ram
uint8rom
C64the_c64
C64Displaythe_display
Job1541the_job
union {
   uint8   intr [4]
   unsigned long   intr_any
interrupt
uint8 n_flag
uint8 z_flag
bool v_flag
bool d_flag
bool i_flag
bool c_flag
uint8 a
uint8 x
uint8 y
uint8 sp
uint8pc
uint8pc_base
int borrowed_cycles
uint8 via1_pra
uint8 via1_ddra
uint8 via1_prb
uint8 via1_ddrb
uint16 via1_t1c
uint16 via1_t1l
uint16 via1_t2c
uint16 via1_t2l
uint8 via1_sr
uint8 via1_acr
uint8 via1_pcr
uint8 via1_ifr
uint8 via1_ier
uint8 via2_pra
uint8 via2_ddra
uint8 via2_prb
uint8 via2_ddrb
uint16 via2_t1c
uint16 via2_t1l
uint16 via2_t2c
uint16 via2_t2l
uint8 via2_sr
uint8 via2_acr
uint8 via2_pcr
uint8 via2_ifr
uint8 via2_ier

Constructor & Destructor Documentation

MOS6502_1541::MOS6502_1541 C64 c64,
Job1541 job,
C64Display disp,
uint8 Ram,
uint8 Rom
 

Definition at line 82 of file CPU1541.cpp.

References __CHECK_NULL, a, borrowed_cycles, c_flag, CTOR, d_flag, i_flag, Idle, n_flag, sp, v_flag, via1_sr, via1_t1c, via1_t1l, via1_t2c, via1_t2l, via2_sr, via2_t1c, via2_t1l, via2_t2c, via2_t2l, x, y, and z_flag.

MOS6502_1541::~MOS6502_1541  ) 
 

Definition at line 114 of file CPU1541.cpp.

References DTOR.


Member Function Documentation

void MOS6502_1541::AsyncReset void   ) 
 

Definition at line 124 of file CPU1541.cpp.

References Idle, INT_RESET, and interrupt.

Referenced by C64::NewPrefs(), and C64::Reset().

void MOS6502_1541::CountVIATimers int  cycles  )  [inline]
 

Definition at line 214 of file CPU1541.h.

References TriggerJobIRQ(), via1_acr, via1_ifr, via1_t1c, via1_t1l, via1_t2c, via2_acr, via2_ier, via2_ifr, via2_t1c, via2_t1l, and via2_t2c.

Referenced by C64::thread_func().

void MOS6502_1541::do_adc uint8  byte  )  [inline, private]
 

Definition at line 480 of file CPU1541.cpp.

References a, c_flag, d_flag, n_flag, uint16, uint8, v_flag, and z_flag.

void MOS6502_1541::do_sbc uint8  byte  )  [inline, private]
 

Definition at line 517 of file CPU1541.cpp.

References a, c_flag, d_flag, n_flag, uint16, uint8, v_flag, and z_flag.

int MOS6502_1541::EmulateLine int  cycles_left  ) 
 

Definition at line 747 of file CPU1541.cpp.

References Job1541::FormatTrack(), i_flag, Idle, illegal_op(), INT_IECIRQ, INT_RESET, INT_VIA1IRQ, INT_VIA2IRQ, interrupt, jump(), pc, pc_base, push_byte, push_flags, ram, read_byte_imm, read_word(), Reset(), the_job, uint16, uint8, and Job1541::WriteSector().

Referenced by C64::thread_func().

uint8 MOS6502_1541::ExtReadByte uint16  adr  ) 
 

Definition at line 436 of file CPU1541.cpp.

References read_byte(), and uint8.

Referenced by SAMReadByte().

void MOS6502_1541::ExtWriteByte uint16  adr,
uint8  byte
 

Definition at line 446 of file CPU1541.cpp.

References write_byte().

Referenced by SAMWriteByte().

void MOS6502_1541::GetState MOS6502State s  ) 
 

Definition at line 555 of file CPU1541.cpp.

References a, MOS6502State::a, c_flag, d_flag, i_flag, Idle, MOS6502State::idle, MOS6502State::instruction_complete, INT_IECIRQ, INT_RESET, INT_VIA1IRQ, INT_VIA2IRQ, interrupt, MOS6502State::intr, n_flag, MOS6502State::p, pc, MOS6502State::pc, pc_base, sp, MOS6502State::sp, v_flag, via1_acr, MOS6502State::via1_acr, via1_ddra, MOS6502State::via1_ddra, via1_ddrb, MOS6502State::via1_ddrb, via1_ier, MOS6502State::via1_ier, via1_ifr, MOS6502State::via1_ifr, via1_pcr, MOS6502State::via1_pcr, via1_pra, MOS6502State::via1_pra, via1_prb, MOS6502State::via1_prb, via1_sr, MOS6502State::via1_sr, via1_t1c, MOS6502State::via1_t1c, via1_t1l, MOS6502State::via1_t1l, via1_t2c, MOS6502State::via1_t2c, via1_t2l, MOS6502State::via1_t2l, via2_acr, MOS6502State::via2_acr, via2_ddra, MOS6502State::via2_ddra, via2_ddrb, MOS6502State::via2_ddrb, via2_ier, MOS6502State::via2_ier, via2_ifr, MOS6502State::via2_ifr, via2_pcr, MOS6502State::via2_pcr, via2_pra, MOS6502State::via2_pra, via2_prb, MOS6502State::via2_prb, via2_sr, MOS6502State::via2_sr, via2_t1c, MOS6502State::via2_t1c, via2_t1l, MOS6502State::via2_t1l, via2_t2c, MOS6502State::via2_t2c, via2_t2l, MOS6502State::via2_t2l, x, MOS6502State::x, y, MOS6502State::y, and z_flag.

Referenced by SAM(), and C64::Save1541State().

void MOS6502_1541::IECInterrupt void   )  [inline]
 

Definition at line 264 of file CPU1541.h.

References Idle, and ram.

Referenced by MOS6526_2::WriteRegister().

void MOS6502_1541::illegal_jump uint16  at,
uint16  to
[private]
 

Definition at line 698 of file CPU1541.cpp.

References Reset(), C64::Reset(), ShowRequester(), sprintf, and the_c64.

Referenced by jump().

void MOS6502_1541::illegal_op uint8  op,
uint16  at
[private]
 

Definition at line 680 of file CPU1541.cpp.

References Reset(), C64::Reset(), ShowRequester(), sprintf, and the_c64.

Referenced by EmulateLine().

bool MOS6502_1541::InterruptEnabled void   )  [inline]
 

Definition at line 277 of file CPU1541.h.

References i_flag.

void MOS6502_1541::jump uint16  adr  )  [private]
 

Definition at line 457 of file CPU1541.cpp.

References illegal_jump(), pc, pc_base, ram, and rom.

Referenced by EmulateLine(), Reset(), and SetState().

void MOS6502_1541::NewATNState void   )  [inline]
 

Definition at line 252 of file CPU1541.h.

References MOS6526_2::IECLines, IECLines, TheCIA2, uint8, via1_ddrb, and via1_prb.

Referenced by MOS6526_2::WriteRegister().

uint8 MOS6502_1541::read_byte uint16  adr  )  [private]
 

Definition at line 237 of file CPU1541.cpp.

References ram, read_byte_io(), rom, and uint8.

Referenced by ExtReadByte(), and read_word().

uint8 MOS6502_1541::read_byte_io uint16  adr  )  [inline, private]
 

Definition at line 135 of file CPU1541.cpp.

References MOS6526_2::IECLines, IECLines, INT_VIA2IRQ, interrupt, Job1541::ReadGCRByte(), Job1541::SyncFound(), the_job, TheCIA2, uint8, via1_acr, via1_ddra, via1_ddrb, via1_ier, via1_ifr, via1_pcr, via1_prb, via1_sr, via1_t1c, via1_t1l, via1_t2c, via2_acr, via2_ddra, via2_ddrb, via2_ier, via2_ifr, via2_pcr, via2_prb, via2_sr, via2_t1c, via2_t1l, via2_t2c, and Job1541::WPState().

Referenced by read_byte().

uint16 MOS6502_1541::read_word uint16  adr  )  [inline, private]
 

Definition at line 252 of file CPU1541.cpp.

References read_byte(), and uint16.

Referenced by EmulateLine(), and Reset().

uint8 MOS6502_1541::read_zp uint16  adr  )  [inline, private]
 

Definition at line 406 of file CPU1541.cpp.

References ram, and uint8.

uint16 MOS6502_1541::read_zp_word uint16  adr  )  [inline, private]
 

Definition at line 416 of file CPU1541.cpp.

References ram, and uint16.

void MOS6502_1541::Reset void   ) 
 

Definition at line 651 of file CPU1541.cpp.

References ELOG1, Idle, IECLines, interrupt, jump(), read_word(), via1_acr, via1_ddra, via1_ddrb, via1_ier, via1_ifr, via1_pcr, via1_pra, via1_prb, via2_acr, via2_ddra, via2_ddrb, via2_ier, via2_ifr, via2_pcr, via2_pra, and via2_prb.

Referenced by EmulateLine(), illegal_jump(), illegal_op(), and C64::Run().

void MOS6502_1541::SetState MOS6502State s  ) 
 

Definition at line 604 of file CPU1541.cpp.

References MOS6502State::a, a, c_flag, d_flag, i_flag, MOS6502State::idle, Idle, INT_IECIRQ, INT_RESET, INT_VIA1IRQ, INT_VIA2IRQ, interrupt, MOS6502State::intr, jump(), n_flag, MOS6502State::p, MOS6502State::pc, MOS6502State::sp, sp, v_flag, MOS6502State::via1_acr, via1_acr, MOS6502State::via1_ddra, via1_ddra, MOS6502State::via1_ddrb, via1_ddrb, MOS6502State::via1_ier, via1_ier, MOS6502State::via1_ifr, via1_ifr, MOS6502State::via1_pcr, via1_pcr, MOS6502State::via1_pra, via1_pra, MOS6502State::via1_prb, via1_prb, MOS6502State::via1_sr, via1_sr, MOS6502State::via1_t1c, via1_t1c, MOS6502State::via1_t1l, via1_t1l, MOS6502State::via1_t2c, via1_t2c, MOS6502State::via1_t2l, via1_t2l, MOS6502State::via2_acr, via2_acr, MOS6502State::via2_ddra, via2_ddra, MOS6502State::via2_ddrb, via2_ddrb, MOS6502State::via2_ier, via2_ier, MOS6502State::via2_ifr, via2_ifr, MOS6502State::via2_pcr, via2_pcr, MOS6502State::via2_pra, via2_pra, MOS6502State::via2_prb, via2_prb, MOS6502State::via2_sr, via2_sr, MOS6502State::via2_t1c, via2_t1c, MOS6502State::via2_t1l, via2_t1l, MOS6502State::via2_t2c, via2_t2c, MOS6502State::via2_t2l, via2_t2l, MOS6502State::x, x, MOS6502State::y, y, and z_flag.

Referenced by C64::Load1541State(), and SAM().

void MOS6502_1541::TriggerJobIRQ void   )  [inline]
 

Definition at line 202 of file CPU1541.h.

References Idle, INT_VIA2IRQ, and interrupt.

Referenced by CountVIATimers().

void MOS6502_1541::write_byte uint16  adr,
uint8  byte
[inline, private]
 

Definition at line 393 of file CPU1541.cpp.

References ram, and write_byte_io().

Referenced by ExtWriteByte().

void MOS6502_1541::write_byte_io uint16  adr,
uint8  byte
[private]
 

Definition at line 262 of file CPU1541.cpp.

References MOS6526_2::IECLines, IECLines, Job1541::MoveHeadIn(), Job1541::MoveHeadOut(), the_display, the_job, TheCIA2, C64Display::UpdateLEDs(), via1_acr, via1_ddra, via1_ddrb, via1_ier, via1_ifr, via1_pcr, via1_pra, via1_prb, via1_sr, via1_t1c, via1_t1l, via1_t2c, via1_t2l, via2_acr, via2_ddra, via2_ddrb, via2_ier, via2_ifr, via2_pcr, via2_pra, via2_prb, via2_sr, via2_t1c, via2_t1l, via2_t2c, and via2_t2l.

Referenced by write_byte().

void MOS6502_1541::write_zp uint16  adr,
uint8  byte
[inline, private]
 

Definition at line 426 of file CPU1541.cpp.

References ram.


Member Data Documentation

uint8 MOS6502_1541::a [private]
 

Definition at line 101 of file CPU1541.h.

Referenced by do_adc(), do_sbc(), GetState(), MOS6502_1541(), and SetState().

int MOS6502_1541::borrowed_cycles [private]
 

Definition at line 116 of file CPU1541.h.

Referenced by MOS6502_1541().

bool MOS6502_1541::c_flag [private]
 

Definition at line 100 of file CPU1541.h.

Referenced by do_adc(), do_sbc(), GetState(), MOS6502_1541(), and SetState().

bool MOS6502_1541::d_flag [private]
 

Definition at line 100 of file CPU1541.h.

Referenced by do_adc(), do_sbc(), GetState(), MOS6502_1541(), and SetState().

bool MOS6502_1541::i_flag [private]
 

Definition at line 100 of file CPU1541.h.

Referenced by EmulateLine(), GetState(), InterruptEnabled(), MOS6502_1541(), and SetState().

bool MOS6502_1541::Idle
 

Definition at line 68 of file CPU1541.h.

Referenced by AsyncReset(), EmulateLine(), GetState(), IECInterrupt(), MOS6502_1541(), Reset(), SetState(), C64::thread_func(), and TriggerJobIRQ().

uint8 MOS6502_1541::IECLines
 

Definition at line 67 of file CPU1541.h.

Referenced by NewATNState(), read_byte_io(), MOS6526_2::ReadRegister(), Reset(), and write_byte_io().

union { ... } MOS6502_1541::interrupt [private]
 

Referenced by AsyncReset(), EmulateLine(), GetState(), read_byte_io(), Reset(), SetState(), and TriggerJobIRQ().

uint8 MOS6502_1541::intr[4] [private]
 

Definition at line 95 of file CPU1541.h.

unsigned long MOS6502_1541::intr_any [private]
 

Definition at line 96 of file CPU1541.h.

uint8 MOS6502_1541::n_flag [private]
 

Definition at line 99 of file CPU1541.h.

Referenced by do_adc(), do_sbc(), GetState(), MOS6502_1541(), and SetState().

uint8* MOS6502_1541::pc [private]
 

Definition at line 103 of file CPU1541.h.

Referenced by EmulateLine(), GetState(), and jump().

uint8 * MOS6502_1541::pc_base [private]
 

Definition at line 103 of file CPU1541.h.

Referenced by EmulateLine(), GetState(), and jump().

uint8* MOS6502_1541::ram [private]
 

Definition at line 88 of file CPU1541.h.

Referenced by EmulateLine(), IECInterrupt(), jump(), read_byte(), read_zp(), read_zp_word(), write_byte(), and write_zp().

uint8* MOS6502_1541::rom [private]
 

Definition at line 89 of file CPU1541.h.

Referenced by jump(), and read_byte().

uint8 MOS6502_1541::sp [private]
 

Definition at line 101 of file CPU1541.h.

Referenced by GetState(), MOS6502_1541(), and SetState().

C64* MOS6502_1541::the_c64 [private]
 

Definition at line 90 of file CPU1541.h.

Referenced by illegal_jump(), and illegal_op().

C64Display* MOS6502_1541::the_display [private]
 

Definition at line 91 of file CPU1541.h.

Referenced by write_byte_io().

Job1541* MOS6502_1541::the_job [private]
 

Definition at line 92 of file CPU1541.h.

Referenced by EmulateLine(), read_byte_io(), and write_byte_io().

MOS6526_2* MOS6502_1541::TheCIA2
 

Definition at line 65 of file CPU1541.h.

Referenced by C64::C64(), NewATNState(), read_byte_io(), and write_byte_io().

bool MOS6502_1541::v_flag [private]
 

Definition at line 100 of file CPU1541.h.

Referenced by do_adc(), do_sbc(), GetState(), MOS6502_1541(), and SetState().

uint8 MOS6502_1541::via1_acr [private]
 

Definition at line 128 of file CPU1541.h.

Referenced by CountVIATimers(), GetState(), read_byte_io(), Reset(), SetState(), and write_byte_io().

uint8 MOS6502_1541::via1_ddra [private]
 

Definition at line 120 of file CPU1541.h.

Referenced by GetState(), read_byte_io(), Reset(), SetState(), and write_byte_io().

uint8 MOS6502_1541::via1_ddrb [private]
 

Definition at line 122 of file CPU1541.h.

Referenced by GetState(), NewATNState(), read_byte_io(), Reset(), SetState(), and write_byte_io().

uint8 MOS6502_1541::via1_ier [private]
 

Definition at line 131 of file CPU1541.h.

Referenced by GetState(), read_byte_io(), Reset(), SetState(), and write_byte_io().

uint8 MOS6502_1541::via1_ifr [private]
 

Definition at line 130 of file CPU1541.h.

Referenced by CountVIATimers(), GetState(), read_byte_io(), Reset(), SetState(), and write_byte_io().

uint8 MOS6502_1541::via1_pcr [private]
 

Definition at line 129 of file CPU1541.h.

Referenced by GetState(), read_byte_io(), Reset(), SetState(), and write_byte_io().

uint8 MOS6502_1541::via1_pra [private]
 

Definition at line 119 of file CPU1541.h.

Referenced by GetState(), Reset(), SetState(), and write_byte_io().

uint8 MOS6502_1541::via1_prb [private]
 

Definition at line 121 of file CPU1541.h.

Referenced by GetState(), NewATNState(), read_byte_io(), Reset(), SetState(), and write_byte_io().

uint8 MOS6502_1541::via1_sr [private]
 

Definition at line 127 of file CPU1541.h.

Referenced by GetState(), MOS6502_1541(), read_byte_io(), SetState(), and write_byte_io().

uint16 MOS6502_1541::via1_t1c [private]
 

Definition at line 123 of file CPU1541.h.

Referenced by CountVIATimers(), GetState(), MOS6502_1541(), read_byte_io(), SetState(), and write_byte_io().

uint16 MOS6502_1541::via1_t1l [private]
 

Definition at line 124 of file CPU1541.h.

Referenced by CountVIATimers(), GetState(), MOS6502_1541(), read_byte_io(), SetState(), and write_byte_io().

uint16 MOS6502_1541::via1_t2c [private]
 

Definition at line 125 of file CPU1541.h.

Referenced by CountVIATimers(), GetState(), MOS6502_1541(), read_byte_io(), SetState(), and write_byte_io().

uint16 MOS6502_1541::via1_t2l [private]
 

Definition at line 126 of file CPU1541.h.

Referenced by GetState(), MOS6502_1541(), SetState(), and write_byte_io().

uint8 MOS6502_1541::via2_acr [private]
 

Definition at line 142 of file CPU1541.h.

Referenced by CountVIATimers(), GetState(), read_byte_io(), Reset(), SetState(), and write_byte_io().

uint8 MOS6502_1541::via2_ddra [private]
 

Definition at line 134 of file CPU1541.h.

Referenced by GetState(), read_byte_io(), Reset(), SetState(), and write_byte_io().

uint8 MOS6502_1541::via2_ddrb [private]
 

Definition at line 136 of file CPU1541.h.

Referenced by GetState(), read_byte_io(), Reset(), SetState(), and write_byte_io().

uint8 MOS6502_1541::via2_ier [private]
 

Definition at line 145 of file CPU1541.h.

Referenced by CountVIATimers(), GetState(), read_byte_io(), Reset(), SetState(), and write_byte_io().

uint8 MOS6502_1541::via2_ifr [private]
 

Definition at line 144 of file CPU1541.h.

Referenced by CountVIATimers(), GetState(), read_byte_io(), Reset(), SetState(), and write_byte_io().

uint8 MOS6502_1541::via2_pcr [private]
 

Definition at line 143 of file CPU1541.h.

Referenced by GetState(), read_byte_io(), Reset(), SetState(), and write_byte_io().

uint8 MOS6502_1541::via2_pra [private]
 

Definition at line 133 of file CPU1541.h.

Referenced by GetState(), Reset(), SetState(), and write_byte_io().

uint8 MOS6502_1541::via2_prb [private]
 

Definition at line 135 of file CPU1541.h.

Referenced by GetState(), read_byte_io(), Reset(), SetState(), and write_byte_io().

uint8 MOS6502_1541::via2_sr [private]
 

Definition at line 141 of file CPU1541.h.

Referenced by GetState(), MOS6502_1541(), read_byte_io(), SetState(), and write_byte_io().

uint16 MOS6502_1541::via2_t1c [private]
 

Definition at line 137 of file CPU1541.h.

Referenced by CountVIATimers(), GetState(), MOS6502_1541(), read_byte_io(), SetState(), and write_byte_io().

uint16 MOS6502_1541::via2_t1l [private]
 

Definition at line 138 of file CPU1541.h.

Referenced by CountVIATimers(), GetState(), MOS6502_1541(), read_byte_io(), SetState(), and write_byte_io().

uint16 MOS6502_1541::via2_t2c [private]
 

Definition at line 139 of file CPU1541.h.

Referenced by CountVIATimers(), GetState(), MOS6502_1541(), read_byte_io(), SetState(), and write_byte_io().

uint16 MOS6502_1541::via2_t2l [private]
 

Definition at line 140 of file CPU1541.h.

Referenced by GetState(), MOS6502_1541(), SetState(), and write_byte_io().

uint8 MOS6502_1541::x [private]
 

Definition at line 101 of file CPU1541.h.

Referenced by GetState(), MOS6502_1541(), and SetState().

uint8 MOS6502_1541::y [private]
 

Definition at line 101 of file CPU1541.h.

Referenced by GetState(), MOS6502_1541(), and SetState().

uint8 MOS6502_1541::z_flag [private]
 

Definition at line 99 of file CPU1541.h.

Referenced by do_adc(), do_sbc(), GetState(), MOS6502_1541(), and SetState().


The documentation for this class was generated from the following files:
Generated on Tue Feb 8 04:12:17 2005 for E32frodo by doxygen 1.3.3