Exemplo n.º 1
0
        // serializing
        public override void SaveToWriter(BinaryWriter writer)
        {
            EventList.SaveEvent2Writer(xsidEvent, writer);

            writer.Write(Channel.id);
            ch4.SaveToWriter(writer);
            ch5.SaveToWriter(writer);
            writer.Write(muted);
            writer.Write(suppressed);
            writer.Write(sidData0x18);
            writer.Write(_sidSamples);
            writer.Write(sampleOffset);
            writer.Write(wasRunning);

            writer.Write(m_gain);
            m_sid.SaveToWriter(writer);
        }
Exemplo n.º 2
0
        // only used for deserializing
        public SID6526(InternalPlayer player, BinaryReader reader, EventList events)
        {
            m_player       = player;
            m_eventContext = m_player.m_scheduler;

            LoadFromReader(reader);

            m_taEvent       = events.GetEventById(m_taEvent_id) as CiaEvent;
            m_taEvent.m_cia = this;

#if DEBUG
            if (m_taEvent == null)
            {
                throw new Exception("SID6526: CiaEvent not found");
            }
#endif
        }
Exemplo n.º 3
0
        // serializing
        public void SaveToWriter(BinaryWriter writer)
        {
            EventList.SaveEvent2Writer(m_taEvent, writer);

            writer.Write(m_accessClk);
            writer.Write((short)m_phase);
            for (int i = 0; i < 0x10; i++)
            {
                writer.Write(regs[i]);
            }
            writer.Write(cra);
            writer.Write(ta_latch);
            writer.Write(ta);
            writer.Write(rnd);
            writer.Write(m_count);
            writer.Write(locked);
        }
Exemplo n.º 4
0
        // serializing
        public virtual void SaveToWriter(BinaryWriter writer)
        {
            EventList.SaveEvent2Writer(event_ta, writer);
            EventList.SaveEvent2Writer(event_tb, writer);
            EventList.SaveEvent2Writer(event_tod, writer);

            for (int i = 0; i < 0x10; i++)
            {
                writer.Write(regs[i]);
            }
            writer.Write(cnt_high);
            writer.Write(cra);
            writer.Write(cra_latch);
            writer.Write(dpa);
            writer.Write(ta);
            writer.Write(ta_latch);
            writer.Write(ta_underflow);
            writer.Write(crb);
            writer.Write(tb);
            writer.Write(tb_latch);
            writer.Write(tb_underflow);
            writer.Write(sdr_out);
            writer.Write(sdr_buffered);
            writer.Write(sdr_count);
            writer.Write(icr);
            writer.Write(idr);
            writer.Write(m_accessClk);
            writer.Write((short)m_phase);
            writer.Write(m_todlatched);
            writer.Write(m_todstopped);
            for (int i = 0; i < 4; i++)
            {
                writer.Write(m_todclock[i]);
                writer.Write(m_todalarm[i]);
                writer.Write(m_todlatch[i]);
            }
            writer.Write(m_todCycles);
            writer.Write(m_todPeriod);
        }
Exemplo n.º 5
0
        // only used for deserializing
        internal Channel(EventScheduler context, XSID xsid, BinaryReader reader, EventList events)
        {
            m_context = context;
            m_xsid    = xsid;
            LoadFromReader(reader);

            sampleEvent = events.GetEventById(sampleEvent_id) as SampleEvent;
            galwayEvent = events.GetEventById(galwayEvent_id) as GalwayEvent;

#if DEBUG
            if (sampleEvent_id > -1 && sampleEvent == null)
            {
                throw new Exception("Channel: sampleEvent not found: " + sampleEvent_id.ToString());
            }
            if (galwayEvent_id > -1 && galwayEvent == null)
            {
                throw new Exception("Channel: galwayEvent not found: " + galwayEvent_id.ToString());
            }
#endif

            sampleEvent.m_ch = this;
            galwayEvent.m_ch = this;
        }
Exemplo n.º 6
0
        // serializing
        public void SaveToWriter(BinaryWriter writer)
        {
            writer.Write(m_id);
            writer.Write(m_name);

            EventList.SaveEvent2Writer(sampleEvent, writer);
            EventList.SaveEvent2Writer(galwayEvent, writer);

            writer.Write((short)m_phase);
            for (int i = 0; i < 0x10; i++)
            {
                writer.Write(reg[i]);
            }
            writer.Write(mode);
            writer.Write(active);
            writer.Write(address);
            writer.Write(cycleCount);
            writer.Write(volShift);
            writer.Write(sampleLimit);
            writer.Write(sample);
            writer.Write(samRepeat);
            writer.Write(samScale);
            writer.Write(samOrder);
            writer.Write(samNibble);
            writer.Write(samEndAddr);
            writer.Write(samRepeatAddr);
            writer.Write(samPeriod);
            writer.Write(galTones);
            writer.Write(galInitLength);
            writer.Write(galLength);
            writer.Write(galVolume);
            writer.Write(galLoopWait);
            writer.Write(galNullWait);
            writer.Write(cycles);
            writer.Write(outputs);
        }
Exemplo n.º 7
0
        public SID6510(EventScheduler context, InternalPlayer owner, BinaryReader reader, EventList events)
            : base(context, owner, reader, events)
        {
            delayCycle.func = new ProcessorCycle.FunctionDelegate(sid_delay);

            if (procCycle_id == 2)
            {
                procCycle = new ProcessorCycle[] { delayCycle };
            }
        }
Exemplo n.º 8
0
 // only used for deserializing
 public C64cia1(InternalPlayer player, BinaryReader reader, EventList events)
     : base(player.m_scheduler, reader, events)
 {
     m_player = player;
 }