mirror of
https://github.com/MoleskiCoder/EightBitNet.git
synced 2025-01-10 00:29:23 +00:00
2b3bc80f8a
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
36 lines
944 B
C#
36 lines
944 B
C#
// <copyright file="Computer.cs" company="Adrian Conlon">
|
|
// Copyright (c) Adrian Conlon. All rights reserved.
|
|
// </copyright>
|
|
|
|
namespace LR35902.BlarggTest
|
|
{
|
|
public class Computer
|
|
{
|
|
private readonly Board board;
|
|
|
|
public Computer(Configuration configuration) => this.board = new Board(configuration);
|
|
|
|
public void Run()
|
|
{
|
|
var cycles = 0;
|
|
var cpu = this.board.CPU;
|
|
while (cpu.Powered)
|
|
{
|
|
cycles += EightBit.GameBoy.Bus.CyclesPerFrame;
|
|
cycles -= this.board.RunRasterLines();
|
|
cycles -= this.board.RunVerticalBlankLines();
|
|
}
|
|
}
|
|
|
|
public void Plug(string path) => this.board.Plug(path);
|
|
|
|
public void RaisePOWER()
|
|
{
|
|
this.board.RaisePOWER();
|
|
this.board.Initialize();
|
|
}
|
|
|
|
public void LowerPOWER() => this.board.LowerPOWER();
|
|
}
|
|
}
|