public PokeySound(DeserializationContext input, MachineBase m) : this(m) { if (input == null) { throw new ArgumentNullException("input"); } input.CheckVersion(1); _lastUpdateCpuClock = input.ReadUInt64(); _bufferIndex = input.ReadInt32(); _audf = input.ReadBytes(); _audc = input.ReadBytes(); _audctl = input.ReadByte(); _skctl = input.ReadByte(); _output = input.ReadBytes(); _outvol = input.ReadBytes(); _divideMax = input.ReadIntegers(4); _divideCount = input.ReadIntegers(4); _pokeyTicks = input.ReadInt32(); _pokeyTicksPerSample = input.ReadInt32(); _baseMultiplier = input.ReadInt32(); _poly04Counter = input.ReadInt32(); _poly05Counter = input.ReadInt32(); _poly17Counter = input.ReadInt32(); _poly17Size = input.ReadInt32(); }
public NullDevice(MachineBase m) { if (m == null) { throw new ArgumentNullException("m"); } M = m; }
public virtual void Attach(MachineBase m) { if (m == null) throw new ArgumentNullException("m"); if (M != null && M != m) throw new InvalidOperationException("Cart already attached to a different machine."); M = m; }
public TIA(MachineBase m) : this() { if (m == null) { throw new ArgumentNullException("m"); } M = m; TIASound = new TIASound(M, CPU_TICKS_PER_AUDIO_SAMPLE); }
public AddressSpace(DeserializationContext input, MachineBase m, int addrSpaceShift, int pageShift) : this(m, addrSpaceShift, pageShift) { if (input == null) { throw new ArgumentNullException("input"); } input.CheckVersion(1); DataBusState = input.ReadByte(); }
public PokeySound(MachineBase m) : this() { if (m == null) { throw new ArgumentNullException("m"); } M = m; // Add 8-bits of fractional representation to reduce distortion on output _pokeyTicksPerSample = (POKEY_FREQ << 8) / M.SoundSampleFrequency; }
public virtual void Attach(MachineBase m) { if (m == null) { throw new ArgumentNullException("m"); } if (M != null && M != m) { throw new InvalidOperationException("Cart already attached to a different machine."); } M = m; }
public TIASound(MachineBase m, int cpuClocksPerSample) : this() { if (m == null) { throw new ArgumentNullException("m"); } if (cpuClocksPerSample <= 0) { throw new ArgumentException("cpuClocksPerSample must be positive."); } M = m; _cpuClocksPerSample = cpuClocksPerSample; }
public M6502(MachineBase m, int runClocksMultiple) : this() { if (m == null) { throw new ArgumentNullException("m"); } if (runClocksMultiple <= 0) { throw new ArgumentException("runClocksMultiple must be greater than zero."); } M = m; RunClocksMultiple = runClocksMultiple; }
public AddressSpace(MachineBase m, int addrSpaceShift, int pageShift) { M = m; AddrSpaceShift = addrSpaceShift; AddrSpaceSize = 1 << AddrSpaceShift; AddrSpaceMask = AddrSpaceSize - 1; PageShift = pageShift; PageSize = 1 << PageShift; MemoryMap = new IDevice[1 << addrSpaceShift >> PageShift]; for (var pageno = 0; pageno < MemoryMap.Length; pageno++) { MemoryMap[pageno] = NullDevice.Default; } }
public Cart ReadCart(MachineBase m) { var typeName = _binaryReader.ReadString(); if (string.IsNullOrWhiteSpace(typeName)) { throw new Emu7800SerializationException("Invalid type name."); } var type = Type.GetType(typeName); if (type == null) { throw new Emu7800SerializationException("Unable to resolve type name: " + typeName); } return((Cart)Activator.CreateInstance(type, new object[] { this, m })); }
public TIASound(DeserializationContext input, MachineBase m, int cpuClocksPerSample) : this(m, cpuClocksPerSample) { if (input == null) { throw new ArgumentNullException("input"); } input.CheckVersion(1); Bit9 = input.ReadExpectedBytes(511); P4 = input.ReadIntegers(2); P5 = input.ReadIntegers(2); P9 = input.ReadIntegers(2); DivByNCounter = input.ReadIntegers(2); DivByNMaximum = input.ReadIntegers(2); AUDC = input.ReadExpectedBytes(2); AUDF = input.ReadExpectedBytes(2); AUDV = input.ReadExpectedBytes(2); OutputVol = input.ReadExpectedBytes(2); LastUpdateCPUClock = input.ReadUInt64(); BufferIndex = input.ReadInt32(); }
public PIA(DeserializationContext input, MachineBase m) : this(m) { if (input == null) { throw new ArgumentNullException("input"); } var version = input.CheckVersion(1, 2); RAM = input.ReadExpectedBytes(0x80); TimerTarget = input.ReadUInt64(); TimerShift = input.ReadInt32(); IRQEnabled = input.ReadBoolean(); IRQTriggered = input.ReadBoolean(); DDRA = input.ReadByte(); WrittenPortA = input.ReadByte(); if (version > 1) { DDRB = input.ReadByte(); WrittenPortB = input.ReadByte(); } }
public M6502(DeserializationContext input, MachineBase m, int runClocksMultiple) : this(m, runClocksMultiple) { if (input == null) { throw new ArgumentNullException("input"); } input.CheckVersion(1); Clock = input.ReadUInt64(); RunClocks = input.ReadInt32(); RunClocksMultiple = input.ReadInt32(); EmulatorPreemptRequest = input.ReadBoolean(); Jammed = input.ReadBoolean(); IRQInterruptRequest = input.ReadBoolean(); NMIInterruptRequest = input.ReadBoolean(); PC = input.ReadUInt16(); A = input.ReadByte(); X = input.ReadByte(); Y = input.ReadByte(); S = input.ReadByte(); P = input.ReadByte(); }
public AddressSpace(MachineBase m, int addrSpaceShift, int pageShift) { if (m == null) { throw new ArgumentNullException("m"); } M = m; AddrSpaceShift = addrSpaceShift; AddrSpaceSize = 1 << AddrSpaceShift; AddrSpaceMask = AddrSpaceSize - 1; PageShift = pageShift; PageSize = 1 << PageShift; MemoryMap = new IDevice[1 << addrSpaceShift >> PageShift]; IDevice nullDev = new NullDevice(M); for (var pageno = 0; pageno < MemoryMap.Length; pageno++) { MemoryMap[pageno] = nullDev; } }
public TIA(DeserializationContext input, MachineBase m) : this() { if (input == null) throw new ArgumentNullException("input"); if (m == null) throw new ArgumentNullException("m"); M = m; TIASound = input.ReadTIASound(M, CPU_TICKS_PER_AUDIO_SAMPLE); input.CheckVersion(2); RegW = input.ReadExpectedBytes(0x40); HSync = input.ReadInt32(); HMoveCounter = input.ReadInt32(); ScanLine = input.ReadInt32(); FrameBufferIndex = input.ReadInt32(); //FrameBufferElement = input.ReadBufferElement(); StartHMOVEClock = input.ReadUInt64(); HMoveLatch = input.ReadBoolean(); StartClock = input.ReadUInt64(); P0 = input.ReadInt32(); P0mmr = input.ReadBoolean(); EffGRP0 = input.ReadByte(); OldGRP0 = input.ReadByte(); P0type = input.ReadInt32(); P0suppress = input.ReadInt32(); P1 = input.ReadInt32(); P1mmr = input.ReadBoolean(); EffGRP1 = input.ReadByte(); OldGRP1 = input.ReadByte(); P1type = input.ReadInt32(); P1suppress = input.ReadInt32(); M0 = input.ReadInt32(); M0mmr = input.ReadBoolean(); M0type = input.ReadInt32(); M0size = input.ReadInt32(); m0on = input.ReadBoolean(); M1 = input.ReadInt32(); M1mmr = input.ReadBoolean(); M1type = input.ReadInt32(); M1size = input.ReadInt32(); m1on = input.ReadBoolean(); BL = input.ReadInt32(); BLmmr = input.ReadBoolean(); OldENABL = input.ReadBoolean(); BLsize = input.ReadInt32(); blon = input.ReadBoolean(); PF210 = input.ReadUInt32(); PFReflectionState = input.ReadInt32(); colubk = input.ReadByte(); colupf = input.ReadByte(); colup0 = input.ReadByte(); colup1 = input.ReadByte(); vblankon = input.ReadBoolean(); scoreon = input.ReadBoolean(); pfpriority = input.ReadBoolean(); DumpEnabled = input.ReadBoolean(); DumpDisabledCycle = input.ReadUInt64(); Collisions = (TIACxPairFlags)input.ReadInt32(); WSYNCDelayClocks = input.ReadInt32(); EndOfFrame = input.ReadBoolean(); }
public Cart ReadCart(MachineBase m) { var typeName = _binaryReader.ReadString(); if (string.IsNullOrWhiteSpace(typeName)) throw new Emu7800SerializationException("Invalid type name."); var type = Type.GetType(typeName); if (type == null) throw new Emu7800SerializationException("Unable to resolve type name: " + typeName); return (Cart)Activator.CreateInstance(type, new object[] { this, m }); }
public TIASound ReadTIASound(MachineBase m, int cpuClocksPerSample) { var tiaSound = new TIASound(this, m, cpuClocksPerSample); return tiaSound; }
public PIA ReadPIA(MachineBase m) { var pia = new PIA(this, m); return pia; }
public AddressSpace ReadAddressSpace(MachineBase m, int addrSpaceShift, int pageShift) { var addressSpace = new AddressSpace(this, m, addrSpaceShift, pageShift); return addressSpace; }
public AddressSpace(MachineBase m, int addrSpaceShift, int pageShift) { if (m == null) throw new ArgumentNullException("m"); M = m; AddrSpaceShift = addrSpaceShift; AddrSpaceSize = 1 << AddrSpaceShift; AddrSpaceMask = AddrSpaceSize - 1; PageShift = pageShift; PageSize = 1 << PageShift; MemoryMap = new IDevice[1 << addrSpaceShift >> PageShift]; IDevice nullDev = new NullDevice(M); for (var pageno=0; pageno < MemoryMap.Length; pageno++) { MemoryMap[pageno] = nullDev; } }
public AddressSpace(DeserializationContext input, MachineBase m, int addrSpaceShift, int pageShift) : this(m, addrSpaceShift, pageShift) { input.CheckVersion(1); DataBusState = input.ReadByte(); }
public M6502(DeserializationContext input, MachineBase m, int runClocksMultiple) : this(m, runClocksMultiple) { if (input == null) throw new ArgumentNullException("input"); input.CheckVersion(1); Clock = input.ReadUInt64(); RunClocks = input.ReadInt32(); RunClocksMultiple = input.ReadInt32(); EmulatorPreemptRequest = input.ReadBoolean(); Jammed = input.ReadBoolean(); IRQInterruptRequest = input.ReadBoolean(); NMIInterruptRequest = input.ReadBoolean(); PC = input.ReadUInt16(); A = input.ReadByte(); X = input.ReadByte(); Y = input.ReadByte(); S = input.ReadByte(); P = input.ReadByte(); }
void HardReset() { cart = Cart.Create(rom, GameInfo.CartType); ILogger logger = new ConsoleLogger(); HSC7800 hsc7800 = null; if (hsbios != null) { hsc7800 = new HSC7800(hsbios, hsram); } Bios7800 bios7800 = new Bios7800(bios); theMachine = MachineBase.Create (GameInfo.MachineType, cart, bios7800, hsc7800, GameInfo.LController, GameInfo.RController, logger); theMachine.Reset(); theMachine.InputState.InputPollCallback = InputCallbacks.Call; ControlAdapter = new Atari7800Control(theMachine); ControllerDefinition = ControlAdapter.ControlType; avProvider.ConnectToMachine(theMachine, GameInfo); // to sync exactly with audio as this emulator creates and times it, the frame rate should be exactly 60:1 or 50:1 CoreComm.VsyncNum = theMachine.FrameHZ; CoreComm.VsyncDen = 1; SetupMemoryDomains(hsc7800); }
public TIASound(MachineBase m, int cpuClocksPerSample) : this() { if (m == null) throw new ArgumentNullException("m"); if (cpuClocksPerSample <= 0) throw new ArgumentException("cpuClocksPerSample must be positive."); M = m; _cpuClocksPerSample = cpuClocksPerSample; }
public TIA(DeserializationContext input, MachineBase m) : this() { if (input == null) { throw new ArgumentNullException("input"); } if (m == null) { throw new ArgumentNullException("m"); } M = m; TIASound = input.ReadTIASound(M, CPU_TICKS_PER_AUDIO_SAMPLE); input.CheckVersion(2); RegW = input.ReadExpectedBytes(0x40); HSync = input.ReadInt32(); HMoveCounter = input.ReadInt32(); ScanLine = input.ReadInt32(); FrameBufferIndex = input.ReadInt32(); //FrameBufferElement = input.ReadBufferElement(); StartHMOVEClock = input.ReadUInt64(); HMoveLatch = input.ReadBoolean(); StartClock = input.ReadUInt64(); P0 = input.ReadInt32(); P0mmr = input.ReadBoolean(); EffGRP0 = input.ReadByte(); OldGRP0 = input.ReadByte(); P0type = input.ReadInt32(); P0suppress = input.ReadInt32(); P1 = input.ReadInt32(); P1mmr = input.ReadBoolean(); EffGRP1 = input.ReadByte(); OldGRP1 = input.ReadByte(); P1type = input.ReadInt32(); P1suppress = input.ReadInt32(); M0 = input.ReadInt32(); M0mmr = input.ReadBoolean(); M0type = input.ReadInt32(); M0size = input.ReadInt32(); m0on = input.ReadBoolean(); M1 = input.ReadInt32(); M1mmr = input.ReadBoolean(); M1type = input.ReadInt32(); M1size = input.ReadInt32(); m1on = input.ReadBoolean(); BL = input.ReadInt32(); BLmmr = input.ReadBoolean(); OldENABL = input.ReadBoolean(); BLsize = input.ReadInt32(); blon = input.ReadBoolean(); PF210 = input.ReadUInt32(); PFReflectionState = input.ReadInt32(); colubk = input.ReadByte(); colupf = input.ReadByte(); colup0 = input.ReadByte(); colup1 = input.ReadByte(); vblankon = input.ReadBoolean(); scoreon = input.ReadBoolean(); pfpriority = input.ReadBoolean(); DumpEnabled = input.ReadBoolean(); DumpDisabledCycle = input.ReadUInt64(); Collisions = (TIACxPairFlags)input.ReadInt32(); WSYNCDelayClocks = input.ReadInt32(); EndOfFrame = input.ReadBoolean(); }
public PIA(MachineBase m) { if (m == null) throw new ArgumentNullException("m"); M = m; }
public PIA(DeserializationContext input, MachineBase m) : this(m) { if (input == null) throw new ArgumentNullException("input"); var version = input.CheckVersion(1, 2); RAM = input.ReadExpectedBytes(0x80); TimerTarget = input.ReadUInt64(); TimerShift = input.ReadInt32(); IRQEnabled = input.ReadBoolean(); IRQTriggered = input.ReadBoolean(); DDRA = input.ReadByte(); WrittenPortA = input.ReadByte(); if (version > 1) { DDRB = input.ReadByte(); WrittenPortB = input.ReadByte(); } }
public virtual void Attach(MachineBase m) { M = m; }
public void Write(MachineBase m) { WriteTypeName(m); m.GetObjectData(this); }
public M6502(MachineBase m, int runClocksMultiple) : this() { if (m == null) throw new ArgumentNullException("m"); if (runClocksMultiple <= 0) throw new ArgumentException("runClocksMultiple must be greater than zero."); M = m; RunClocksMultiple = runClocksMultiple; }
public AddressSpace(DeserializationContext input, MachineBase m, int addrSpaceShift, int pageShift) : this(m, addrSpaceShift, pageShift) { if (input == null) throw new ArgumentNullException("input"); input.CheckVersion(1); DataBusState = input.ReadByte(); }
public void Write(MachineBase m) { _binaryWriter.Write(m.ToString() ?? string.Empty); m.GetObjectData(this); }
public void ConnectToMachine(MachineBase m, EMU7800.Win.GameProgram g) { framebuffer = m.CreateFrameBuffer(); BufferWidth = framebuffer.VisiblePitch; BufferHeight = framebuffer.Scanlines; vidbuffer = new int[BufferWidth * BufferHeight]; uint newsamplerate = (uint)m.SoundSampleFrequency; if (newsamplerate != samplerate) { // really shouldn't happen (after init), but if it does, we're ready if (resampler != null) resampler.Dispose(); resampler = new SpeexResampler(3, newsamplerate, 44100, newsamplerate, 44100, null, null); samplerate = newsamplerate; dcfilter = DCFilter.DetatchedMode(256); } if (g.MachineType == MachineType.A7800PAL || g.MachineType == MachineType.A2600PAL) palette = TIATables.PALPalette; else palette = TIATables.NTSCPalette; }
public AddressSpace ReadAddressSpace(MachineBase m, int addrSpaceShift, int pageShift) { var addressSpace = new AddressSpace(this, m, addrSpaceShift, pageShift); return(addressSpace); }
public M6502 ReadM6502(MachineBase m, int runClocksMultiple) { var cpu = new M6502(this, m, runClocksMultiple); return cpu; }
public M6502 ReadM6502(MachineBase m, int runClocksMultiple) { var cpu = new M6502(this, m, runClocksMultiple); return(cpu); }
public TIA ReadTIA(MachineBase m) { var tia = new TIA(this, m); return tia; }
public PIA ReadPIA(MachineBase m) { var pia = new PIA(this, m); return(pia); }
public PokeySound ReadOptionalPokeySound(MachineBase m) { var exist = ReadBoolean(); return exist ? new PokeySound(this, m) : null; }
public TIA ReadTIA(MachineBase m) { var tia = new TIA(this, m); return(tia); }
public TIASound ReadTIASound(MachineBase m, int cpuClocksPerSample) { var tiaSound = new TIASound(this, m, cpuClocksPerSample); return(tiaSound); }
public TIA(MachineBase m) : this() { if (m == null) throw new ArgumentNullException("m"); M = m; TIASound = new TIASound(M, CPU_TICKS_PER_AUDIO_SAMPLE); }
public PokeySound ReadOptionalPokeySound(MachineBase m) { var exist = ReadBoolean(); return(exist ? new PokeySound(this, m) : null); }
public PokeySound(MachineBase m) : this() { if (m == null) throw new ArgumentNullException("m"); M = m; // Add 8-bits of fractional representation to reduce distortion on output _pokeyTicksPerSample = (POKEY_FREQ << 8) / M.SoundSampleFrequency; }
public TIASound(DeserializationContext input, MachineBase m, int cpuClocksPerSample) : this(m, cpuClocksPerSample) { if (input == null) throw new ArgumentNullException("input"); input.CheckVersion(1); Bit9 = input.ReadExpectedBytes(511); P4 = input.ReadIntegers(2); P5 = input.ReadIntegers(2); P9 = input.ReadIntegers(2); DivByNCounter = input.ReadIntegers(2); DivByNMaximum = input.ReadIntegers(2); AUDC = input.ReadExpectedBytes(2); AUDF = input.ReadExpectedBytes(2); AUDV = input.ReadExpectedBytes(2); OutputVol = input.ReadExpectedBytes(2); LastUpdateCPUClock = input.ReadUInt64(); BufferIndex = input.ReadInt32(); }
public Atari7800Control(MachineBase mac) { var l = mac.InputState.LeftControllerJack; var r = mac.InputState.RightControllerJack; foreach (var a in Adapters) { if (a.Left == l && a.Right == r) { Convert = a.Convert; ControlType = a.Type; return; } } throw new Exception(string.Format("Couldn't connect Atari 7800 controls \"{0}\" and \"{1}\"", l.ToString(), r.ToString())); }
public PokeySound(DeserializationContext input, MachineBase m) : this(m) { if (input == null) throw new ArgumentNullException("input"); input.CheckVersion(1); _lastUpdateCpuClock = input.ReadUInt64(); _bufferIndex = input.ReadInt32(); _audf = input.ReadBytes(); _audc = input.ReadBytes(); _audctl = input.ReadByte(); _skctl = input.ReadByte(); _output = input.ReadBytes(); _outvol = input.ReadBytes(); _divideMax = input.ReadIntegers(4); _divideCount = input.ReadIntegers(4); _pokeyTicks = input.ReadInt32(); _pokeyTicksPerSample = input.ReadInt32(); _baseMultiplier = input.ReadInt32(); _poly04Counter = input.ReadInt32(); _poly05Counter = input.ReadInt32(); _poly17Counter = input.ReadInt32(); _poly17Size = input.ReadInt32(); }