public ClassicPlayer( GenieNanoCamera genieNanoCamera, MockCamera mockCamera, MotorController motorController, IWriteable <ClassicPlayerSettings> settings, IWriteable <ClassicImageProcessorSettings> imgProcSettings, ILogger <ClassicPlayer> logger, ILoggerFactory loggerFactory) { _settings = settings; _logger = logger; _imgProcessor = new ClassicImageProcessor(imgProcSettings); _motorController = motorController; var channels = new VideoChannel[] { new VideoChannel("Image", "Raw Image"), new VideoChannel("EdgeDetection", "Image after EdgeDetection"), }; _videoInterface = new VideoInterface(channels, loggerFactory, nameof(ClassicPlayer)); if (genieNanoCamera.PeripheralState == PeripheralState.Ready) { _camera = genieNanoCamera; } else { _camera = mockCamera; } }
public Chip8XMachine() : base() { m_VideoInterface = new VideoInterface(this); m_AudioInterface = new AudioInterface(); m_CodeEngine = new Interpreter(this); m_HybridDynarec = new ILDynarec <ILEmitter1802>(); m_ResManager = new ChipResources(this); m_PatchEngine = new CodePatchEngine(); }
protected void OnPixelSet(ChipInstruction inst) { m_VRegs[0xF] = 0; byte x = m_VRegs[inst.X]; byte y = m_VRegs[inst.Y]; byte read = 0; if (inst.N > 0) { // Loop through the sprite bytes by N for (byte i = 0; i < inst.N; i++) { // Get the next byte of the sprite data read = Memory.ReadByte((int)(m_IReg + i)); // Sprite is always 8 in width, loop through each bit for (byte j = 0; j < 8; j++) { // If we hit an on bit then Set a pixel at X, Y if ((read & (0x80 >> j)) != 0) { // If we colliude, set VF if (VideoInterface.SetPixel((x + j), (y + i))) { m_VRegs[0xF] = 1; } } } } } else { for (int k = 0; k < 0x10; k++) { ushort data = Tools.Create16(Memory.ReadByte((int)(m_IReg + (k << 1))), Memory.ReadByte((int)(m_IReg + (k << 1) + 1))); for (int m = 0; m < 0x10; m++) { if ((data & (((int)0x8000) >> m)) != 0) { if (VideoInterface.SetPixel((x + m), (y + k))) { m_VRegs[0xF] = 1; } } } } } if (m_VRegs[0xF] == 1 && m_AntiFlickerHack) { return; } VideoInterface.RenderWait(); }
private void video_call_btn_Click(object sender, EventArgs e) { callService = m_User.CallService; call = callService.CreateCall(); CameraVideoSource cameraVideoSource = new CameraVideoSource(); CameraDevice selectedCamera = cameraVideoSource.Cameras[0]; VideoInterface videoInterface = client.MediaServices.getVideoInterface(); call.SetVideoMode(VideoMode.SendReceive, (error) => { if (error != null) { Console.Write("Set video mode error : " + error.Message); } else { Console.Write("Set video mode success"); cameraVideoSource.Start(selectedCamera, new VideoCaptureFormat(700, 400, 0, 30), (result) => { if (result == CameraVideoSourceResult.Success) { Console.WriteLine("CameraCaptureStart Success"); } else { Console.WriteLine("Error :" + result.ToString()); } }); } }); //pictureBox2.ImageLocation = VideoRenderer2; }
public RealityCoprocessor(Nintendo64 nintendo64) { this.nintendo64 = nintendo64; SP = new SignalProcessor(this); DP = new DisplayProcessor(this); PI = new ParallelInterface(this); SI = new SerialInterface(this); AI = new AudioInterface(this); VI = new VideoInterface(this); MI = new MIPSInterface(this); RI = new RDRAMInterface(this); MemoryMaps = new[] { new MappingEntry(0x00000000, 0x03FFFFFF, false) { Read = nintendo64.RAM.MemoryMaps.ReadWord, Write = nintendo64.RAM.MemoryMaps.WriteWord }, new MappingEntry(0x04000000, 0x040FFFFF, false) { Read = SP.MemoryMaps.ReadWord, Write = SP.MemoryMaps.WriteWord }, new MappingEntry(0x04100000, 0x041FFFFF, false) { Read = DP.MemoryMaps.ReadWord, Write = DP.MemoryMaps.WriteWord }, new MappingEntry(0x04300000, 0x043FFFFF, false) { Read = MI.MemoryMaps.ReadWord, Write = MI.MemoryMaps.WriteWord }, new MappingEntry(0x04400000, 0x044FFFFF, false) { Read = VI.MemoryMaps.ReadWord, Write = VI.MemoryMaps.WriteWord }, new MappingEntry(0x04500000, 0x045FFFFF, false) { Read = AI.MemoryMaps.ReadWord, Write = AI.MemoryMaps.WriteWord }, new MappingEntry(0x04600000, 0x046FFFFF, false) { Read = PI.MemoryMaps.ReadWord, Write = PI.MemoryMaps.WriteWord }, new MappingEntry(0x04700000, 0x047FFFFF, false) { Read = RI.MemoryMaps.ReadWord, Write = RI.MemoryMaps.WriteWord }, new MappingEntry(0x04800000, 0x048FFFFF, false) { Read = SI.MemoryMaps.ReadWord, Write = SI.MemoryMaps.WriteWord }, new MappingEntry(0x10000000, 0x1FBFFFFF, false) { Read = PI.MemoryMaps.ReadWord }, new MappingEntry(0x1FC00000, 0x1FC007FF, false) { Read = SI.MemoryMaps.ReadWord, Write = SI.MemoryMaps.WriteWord } }; }
public VideoFrame(VideoInterface vi) { Width = (ushort)((vi.HorizontalVideo.ActiveVideoEnd - vi.HorizontalVideo.ActiveVideoStart) * (float)vi.HorizontalScale.ScaleUpFactor / (1 << 10)); Height = (ushort)(((vi.VerticalVideo.ActiveVideoEnd - vi.VerticalVideo.ActiveVideoStart) >> 1) * (float)vi.VerticalScale.ScaleUpFactor / (1 << 10)); Size = vi.Control.Type; }
public void AttachToVideoInterface(VideoInterface currentInterface) { m_VideoInterface = currentInterface; m_VideoInterface.DisplayRefresh += new Core.Systems.Chip8X.Interfaces.DisplayRefresh(this.DisplayRefresh); }
public virtual void Shutdown() { m_VideoInterface = null; }
void ExtOff(ChipInstruction inst) { VideoInterface.Initialize(ChipMode.Chip8); }
void ExtOn(ChipInstruction inst) { VideoInterface.Initialize(ChipMode.SuperChip); }
public VideoPage(VideoInterface videoInterface) : base(0) { m_VideoInterface = videoInterface; }
protected void OnPixelScroll(int dir, int length) { VideoInterface.ScrollPixels(length, dir); }
protected void OnScreenClear() { VideoInterface.ClearPixels(); }