mirror of
https://github.com/BluestormDNA/ProjectPSX.git
synced 2025-04-02 10:52:34 -04:00
Refactor
This commit is contained in:
parent
2cbb3b8a6b
commit
37297ce936
1 changed files with 11 additions and 14 deletions
|
@ -1,31 +1,28 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPSX {
|
||||
class ProjectPSX {
|
||||
private CPU cpu;
|
||||
private BUS mmu;
|
||||
private BUS bus;
|
||||
|
||||
public ProjectPSX(Window window) {
|
||||
cpu = new CPU();
|
||||
bus = new BUS();
|
||||
|
||||
public ProjectPSX() {
|
||||
POWER_ON();
|
||||
bus.loadBios();
|
||||
|
||||
bus.setWindow(window);
|
||||
}
|
||||
|
||||
public void POWER_ON() {
|
||||
cpu = new CPU();
|
||||
mmu = new BUS();
|
||||
|
||||
mmu.loadBios();
|
||||
|
||||
Task t = Task.Factory.StartNew(EXECUTE, TaskCreationOptions.LongRunning);
|
||||
}
|
||||
|
||||
public void EXECUTE() {
|
||||
while (true) {
|
||||
cpu.Run(mmu);
|
||||
cpu.Run(bus);
|
||||
bus.tick(2); //2 ticks per opcode
|
||||
cpu.handleInterrupts(bus);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue