Example #1
0
        // only used for deserializing
        protected MOS6526(EventScheduler context, BinaryReader reader, EventList events)
        {
            event_context = context;

            LoadFromReader(reader);

            event_ta  = events.GetEventById(event_ta_id) as EventTa;
            event_tb  = events.GetEventById(event_tb_id) as EventTb;
            event_tod = events.GetEventById(event_tod_id) as EventTod;

#if DEBUG
            if (event_ta == null)
            {
                throw new Exception("MOS6526: EventTa not found");
            }
            if (event_tb == null)
            {
                throw new Exception("MOS6526: EventTb not found");
            }
            if (event_tod == null)
            {
                throw new Exception("MOS6526: EventTod not found");
            }
#endif

            event_ta.m_cia  = this;
            event_tb.m_cia  = this;
            event_tod.m_cia = this;
        }
Example #2
0
 protected MOS6526(EventScheduler context)
 {
     m_id          = id++;
     idr           = 0;
     event_context = context;
     m_phase       = event_phase_t.EVENT_CLOCK_PHI1;
     m_todPeriod   = ~0 & 0xffffffffL;
     event_ta      = new EventTa(this);
     event_tb      = new EventTb(this);
     event_tod     = new EventTod(this);
     reset();
 }