public void LoadState(BinaryReader stream) { FrameSequencer = stream.ReadInt32(); totalClocks = stream.ReadInt32(); TotalSamples = stream.ReadInt32(); int iLen = OutputSound.GetLength(0); int jLen = OutputSound.GetLength(1); for (int i = 0; i < iLen; i++) { for (int j = 0; j < jLen; j++) { OutputSound[i, j] = stream.ReadBoolean(); } } VolumeLeft = stream.ReadInt32(); VolumeRight = stream.ReadInt32(); OutputVinSO1 = stream.ReadBoolean(); OutputVinSO2 = stream.ReadBoolean(); On = stream.ReadBoolean(); squareChannel.LoadState(stream); squareChannel2.LoadState(stream); waveChannel.LoadState(stream); noiseChannel.LoadState(stream); }
public void SaveState(BinaryWriter stream) { stream.Write(FrameSequencer); stream.Write(totalClocks); stream.Write(TotalSamples); int iLen = OutputSound.GetLength(0); int jLen = OutputSound.GetLength(1); for (int i = 0; i < iLen; i++) { for (int j = 0; j < jLen; j++) { stream.Write(OutputSound[i, j]); } } stream.Write(VolumeLeft); stream.Write(VolumeRight); stream.Write(OutputVinSO1); stream.Write(OutputVinSO2); stream.Write(On); squareChannel.SaveState(stream); squareChannel2.SaveState(stream); waveChannel.SaveState(stream); noiseChannel.SaveState(stream); }