Пример #1
0
 public EventRTC(EventScheduler context)
     : base("RTC")
 {
     m_eventContext = context;
     m_seconds      = (0);
 }
Пример #2
0
 // only used for deserializing
 public EventRTC(EventScheduler context, BinaryReader reader, int newId)
     : base(context, reader, newId)
 {
     m_eventContext = context;
 }
Пример #3
0
 // only used for deserializing
 public SampleEvent(EventScheduler context, BinaryReader reader, int newId)
     : base(context, reader, newId)
 {
 }
Пример #4
0
 // only used for deserializing
 public EventTod(EventScheduler context, BinaryReader reader, int newId)
     : base(context, reader, newId)
 {
 }
Пример #5
0
        // deserializing
        protected void LoadFromReader(sidPlayer player, EventScheduler context, BinaryReader reader)
        {
            int count = reader.ReadInt32();

            for (int i = 0; i < count; i++)
            {
                int             id  = reader.ReadInt32();
                Event.EventType typ = (Event.EventType)reader.ReadInt16();
                switch (typ)
                {
                case Event.EventType.ciaEvt:
                    this.Add(new CiaEvent(context, reader, id));
                    break;

                case Event.EventType.cpuEvt:
                    this.Add(new CPUEvent(context, reader, id));
                    break;

                case Event.EventType.GalwayEvt:
                    this.Add(new GalwayEvent(context, reader, id));
                    break;

                case Event.EventType.mixerEvt:
                    this.Add(new EventMixer(player, context, reader, id));
                    break;

                case Event.EventType.RtcEvt:
                    this.Add(new EventRTC(context, reader, id));
                    break;

                case Event.EventType.SampleEvt:
                    this.Add(new SampleEvent(context, reader, id));
                    break;

                case Event.EventType.TaEvt:
                    this.Add(new EventTa(context, reader, id));
                    break;

                case Event.EventType.TbEvt:
                    this.Add(new EventTb(context, reader, id));
                    break;

                case Event.EventType.TimeWarpEvt:
                    this.Add(new EventTimeWarp(context, reader, id));
                    break;

                case Event.EventType.TodEvt:
                    this.Add(new EventTod(context, reader, id));
                    break;

                case Event.EventType.vicEvt:
                    this.Add(new C64VIC(context.m_player, reader, id));
                    break;

                case Event.EventType.xSidEvt:
                    this.Add(new xSIDEvent(context, reader, id));
                    break;

                default:
#if DEBUG
                    throw new Exception("EventList.LoadFromReader: unknown Event id");
#else
                    break;
#endif
                }
            }

            context.m_next = GetEventById(context.m_next_id);
            context.m_prev = GetEventById(context.m_prev_id);

            foreach (Event ev in this)
            {
                ev.m_next = GetEventById(ev.m_next_id, context);
                ev.m_prev = GetEventById(ev.m_prev_id, context);

#if DEBUG
                if (ev.m_next_id > -1 && ev.m_next == null)
                {
                    throw new Exception("EventList.LoadFromReader: next Event id not found: " + ev.m_next_id.ToString());
                }
                if (ev.m_prev_id > -1 && ev.m_prev == null)
                {
                    throw new Exception("EventList.LoadFromReader: prev Event id not found: " + ev.m_prev_id.ToString());
                }
#endif
            }
        }
Пример #6
0
 // only used for deserializing
 public EventList(sidPlayer player, EventScheduler context, BinaryReader reader)
     : base()
 {
     LoadFromReader(player, context, reader);
 }
Пример #7
0
 // only used for deserializing
 public EventMixer(sidPlayer player, EventScheduler context, BinaryReader reader, int newId)
     : base(context, reader, newId)
 {
     m_player = player;
 }
Пример #8
0
 // only used for deserializing
 public EventTimeWarp(EventScheduler context, BinaryReader reader, int newId)
     : base(context, reader, newId)
 {
     m_scheduler = context;
 }
Пример #9
0
 public EventTimeWarp(EventScheduler context)
     : base("Time Warp")
 {
     m_scheduler = context;
 }