mirror of
https://github.com/BluestormDNA/ProjectPSX.git
synced 2025-04-02 10:52:34 -04:00
Project: Add RunFrame
This commit is contained in:
parent
89030dfc04
commit
4f5f276b2e
2 changed files with 20 additions and 5 deletions
|
@ -56,7 +56,7 @@ namespace ProjectPSX {
|
|||
string diskFilename = GetDiskFilename();
|
||||
psx = new ProjectPSX(this, diskFilename);
|
||||
psx.POWER_ON();
|
||||
|
||||
psx.RunUncapped();
|
||||
|
||||
this.getScreen().MouseDoubleClick += new MouseEventHandler(toggleDebug);
|
||||
|
||||
|
|
|
@ -45,17 +45,32 @@ namespace ProjectPSX {
|
|||
}
|
||||
|
||||
public void POWER_ON() {
|
||||
var timer = new System.Timers.Timer(1000);
|
||||
timer.Elapsed += OnTimedEvent;
|
||||
timer.Enabled = true;
|
||||
}
|
||||
|
||||
public void RunUncapped() {
|
||||
Task t = Task.Factory.StartNew(EXECUTE, TaskCreationOptions.LongRunning);
|
||||
}
|
||||
|
||||
public void RunFrame() {
|
||||
//33868800 / 60 = 564480 / 300 (Sync * underclock) = 1882~
|
||||
for(int i = 0; i < 1882; i++) {
|
||||
for (int j = 0; j < SYNC_CYCLES; j++) {
|
||||
cpu.Run();
|
||||
//cpu.handleInterrupts();
|
||||
counter++;
|
||||
}
|
||||
bus.tick(SYNC_CYCLES * MIPS_UNDERCLOCK);
|
||||
cpu.handleInterrupts();
|
||||
}
|
||||
}
|
||||
|
||||
private void EXECUTE() {
|
||||
Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.High;
|
||||
Thread.CurrentThread.Priority = ThreadPriority.Highest;
|
||||
|
||||
var timer = new System.Timers.Timer(1000);
|
||||
timer.Elapsed += OnTimedEvent;
|
||||
timer.Enabled = true;
|
||||
|
||||
try {
|
||||
while (true) {
|
||||
for (int j = 0; j < SYNC_CYCLES; j++) {
|
||||
|
|
Loading…
Add table
Reference in a new issue