Example #1
0
        public void LoadStateBinary(BinaryReader reader)
        {
            Musashi.LoadStateBinary(reader);
            //SoundCPU.LoadStateBinary(reader);
            //PSG.LoadStateBinary(reader);
            VDP.LoadStateBinary(reader);
            YM2612.LoadStateBinary(reader);

            Ram    = reader.ReadBytes(Ram.Length);
            Z80Ram = reader.ReadBytes(Z80Ram.Length);

            Frame           = reader.ReadInt32();
            M68000HasZ80Bus = reader.ReadBoolean();
            Z80Reset        = reader.ReadBoolean();
            BankRegion      = reader.ReadInt32();

            for (int i = 0; i < 3; i++)
            {
                IOPorts[i].Data   = reader.ReadByte();
                IOPorts[i].TxData = reader.ReadByte();
                IOPorts[i].RxData = reader.ReadByte();
                IOPorts[i].SCtrl  = reader.ReadByte();
            }

            if (SaveRAM.Length > 0)
            {
                SaveRAM = reader.ReadBytes(SaveRAM.Length);
            }
        }