private 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); SetupMemoryDomains(hsc7800); }
private 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); }
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 = CoreComm.InputCallback.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; // reset memory domains if (_MemoryDomains == null) { _MemoryDomains = new List<MemoryDomain>(); if (theMachine is Machine7800) { _MemoryDomains.Add(new MemoryDomain( "RAM1", 0x800, MemoryDomain.Endian.Unknown, delegate(int addr) { if (addr < 0 || addr >= 0x800) throw new ArgumentOutOfRangeException(); return ((Machine7800)theMachine).RAM1[(ushort)addr]; }, delegate(int addr, byte val) { if (addr < 0 || addr >= 0x800) throw new ArgumentOutOfRangeException(); ((Machine7800)theMachine).RAM1[(ushort)addr] = val; })); _MemoryDomains.Add(new MemoryDomain( "RAM2", 0x800, MemoryDomain.Endian.Unknown, delegate(int addr) { if (addr < 0 || addr >= 0x800) throw new ArgumentOutOfRangeException(); return ((Machine7800)theMachine).RAM2[(ushort)addr]; }, delegate(int addr, byte val) { if (addr < 0 || addr >= 0x800) throw new ArgumentOutOfRangeException(); ((Machine7800)theMachine).RAM2[(ushort)addr] = val; })); _MemoryDomains.Add(new MemoryDomain( "BIOS ROM", bios.Length, MemoryDomain.Endian.Unknown, delegate(int addr) { return bios[addr]; }, delegate(int addr, byte val) { })); if (hsc7800 != null) { _MemoryDomains.Add(new MemoryDomain( "HSC ROM", hsbios.Length, MemoryDomain.Endian.Unknown, delegate(int addr) { return hsbios[addr]; }, delegate(int addr, byte val) { })); _MemoryDomains.Add(new MemoryDomain( "HSC RAM", hsram.Length, MemoryDomain.Endian.Unknown, delegate(int addr) { return hsram[addr]; }, delegate(int addr, byte val) { hsram[addr] = val; })); } _MemoryDomains.Add(new MemoryDomain( "System Bus", 65536, MemoryDomain.Endian.Unknown, delegate(int addr) { if (addr < 0 || addr >= 0x10000) throw new ArgumentOutOfRangeException(); return theMachine.Mem[(ushort)addr]; }, delegate(int addr, byte val) { if (addr < 0 || addr >= 0x10000) throw new ArgumentOutOfRangeException(); theMachine.Mem[(ushort)addr] = val; })); } else // todo 2600? { } MemoryDomains = new MemoryDomainList(_MemoryDomains); } }
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 = CoreComm.InputCallback.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; // reset memory domains if (_MemoryDomains == null) { _MemoryDomains = new List <MemoryDomain>(); if (theMachine is Machine7800) { _MemoryDomains.Add(new MemoryDomain( "RAM1", 0x800, MemoryDomain.Endian.Unknown, delegate(int addr) { if (addr < 0 || addr >= 0x800) { throw new ArgumentOutOfRangeException(); } return(((Machine7800)theMachine).RAM1[(ushort)addr]); }, delegate(int addr, byte val) { if (addr < 0 || addr >= 0x800) { throw new ArgumentOutOfRangeException(); } ((Machine7800)theMachine).RAM1[(ushort)addr] = val; })); _MemoryDomains.Add(new MemoryDomain( "RAM2", 0x800, MemoryDomain.Endian.Unknown, delegate(int addr) { if (addr < 0 || addr >= 0x800) { throw new ArgumentOutOfRangeException(); } return(((Machine7800)theMachine).RAM2[(ushort)addr]); }, delegate(int addr, byte val) { if (addr < 0 || addr >= 0x800) { throw new ArgumentOutOfRangeException(); } ((Machine7800)theMachine).RAM2[(ushort)addr] = val; })); _MemoryDomains.Add(new MemoryDomain( "BIOS ROM", bios.Length, MemoryDomain.Endian.Unknown, delegate(int addr) { return(bios[addr]); }, delegate(int addr, byte val) { })); if (hsc7800 != null) { _MemoryDomains.Add(new MemoryDomain( "HSC ROM", hsbios.Length, MemoryDomain.Endian.Unknown, delegate(int addr) { return(hsbios[addr]); }, delegate(int addr, byte val) { })); _MemoryDomains.Add(new MemoryDomain( "HSC RAM", hsram.Length, MemoryDomain.Endian.Unknown, delegate(int addr) { return(hsram[addr]); }, delegate(int addr, byte val) { hsram[addr] = val; })); } _MemoryDomains.Add(new MemoryDomain( "System Bus", 65536, MemoryDomain.Endian.Unknown, delegate(int addr) { if (addr < 0 || addr >= 0x10000) { throw new ArgumentOutOfRangeException(); } return(theMachine.Mem[(ushort)addr]); }, delegate(int addr, byte val) { if (addr < 0 || addr >= 0x10000) { throw new ArgumentOutOfRangeException(); } theMachine.Mem[(ushort)addr] = val; })); } else // todo 2600? { } MemoryDomains = new MemoryDomainList(_MemoryDomains); } }
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); }