예제 #1
0
        private static void LaunchEmulator()
        {
            Chip8 chip8 = new Chip8();
            chip8.Reset();
            chip8.LoadRomFromFile(romPath);
            chip8.Start();

            MainWindow mainWindow = new MainWindow(chip8);
            mainWindow.SoundEnabled = soundEnabled;
            mainWindow.Run();
        }
예제 #2
0
        public DisassemblerWindow(Chip8 chip8)
        {
            InitializeComponent();

            _chip8 = chip8;

            SharpChip8.Core.Disassembler dasm = new SharpChip8.Core.Disassembler(_chip8);
            asmWithLineNumber = dasm.AsmWithLineNumber;
            asmWithoutLineNumber = dasm.AsmWithoutLineNumber;

            richTextBoxASM.Text = asmWithLineNumber;
        }
예제 #3
0
        public InputController(Chip8 chip8)
        {
            InitializeComponent();

            _chip8 = chip8;

            foreach (Button b in flowLayoutPanel1.Controls)
            {
                b.Click += new EventHandler(b_Click);
                b.MouseUp += new MouseEventHandler(b_MouseUp);
            }
        }
예제 #4
0
        public WinformOTKRenderer(Chip8 chip8)
        {
            InitializeComponent();

            this.Text = String.Format("{0} {1} Codename {2}", Chip8.emulator, Chip8.version, Chip8.codename);

            _chip8 = chip8;
            _chip8.Reset();

            SetBlackAndWhiteColorPixel();

            _chip8.Cpu.PlaySound += new EventHandler<EventArgs>(Chip8PlaySound_Event);
        }
예제 #5
0
        public DebugWindow(Chip8 chip8)
        {
            InitializeComponent();
            _chip8 = chip8;

            UpdateInfo();

            chip8.Cpu.CpuRunning += new EventHandler<EventArgs>(Cpu_CpuRunning);

            // Mémoire
            UpdateMemoryView();

            // Désassembleur
            SharpChip8.Core.Disassembler dasm = new SharpChip8.Core.Disassembler(_chip8);
            richTextBoxDasm.Text = dasm.AsmWithLineNumber;
        }
예제 #6
0
        public MainWindow(Chip8 chip8)
        {
            this.Title = String.Format("{0} {1} Codename {2}", Chip8.emulator, Chip8.version, Chip8.codename);
            this.WindowBorder = WindowBorder.Fixed;
            this.ClientSize = new Size(Screen.InternalWidth * Pixel.PixelDim, Screen.InternalHeight * Pixel.PixelDim);

            _chip8 = chip8;
            _chip8.Cpu.PlaySound += Handle_chip8CpuPlaySound;

            this.Resize += OnResize;
            this.Keyboard.KeyUp += OnKeyUp;
            this.Keyboard.KeyDown += OnKeyDown;

            _blackPixelColor = 0x000000;
            _whitePixelColor = 0xFFFFFF;
        }
예제 #7
0
        public static void Main(string [] args)
        {
            if (args.Length > 0)
            {
                if (File.Exists(args[0]))
                {
                    Chip8 chip8 = new Chip8();
                    chip8.Reset();
                    chip8.LoadRomFromFile(args[0]);
                    chip8.Start();

                    OtkWindow emu = new OtkWindow(chip8);
                    emu.Run();
                }
                else
                    Console.WriteLine("Le Fichier n'existe pas");
            }
            else
                Console.WriteLine("Usage: SharpChip8.exe nomRom.ch8");
        }
예제 #8
0
 static void Main()
 {
     Chip8 chip8 = new Chip8();
     Application.Run(new WinformOTKRenderer(chip8));
 }