uk.co.javagear
Class EmulateLoop

java.lang.Object
  extended by uk.co.javagear.EmulateLoop
All Implemented Interfaces:
java.lang.Runnable

public class EmulateLoop
extends java.lang.Object
implements java.lang.Runnable

Ties JavaGear's components together. It loops the emulation with the appropriate NTSC/PAL Timing.

Version:
18th January 2003
Author:
Copyright (C) 2002-2003 Chris White
See Also:
"JavaGear Final Project Report"

Field Summary
protected  int cyclesPerLine
          CPU Cycles Per Scanline.
protected  int fps
          Stores Desired FPS.
protected  Memory mem
          Pointer to Memory.
protected  int numberOfScanlines
          Number of Scanlines.
protected  boolean running
          Stores whether thread is running.
protected  Screen screenpanel
          Pointer to Java Screen Panel.
protected  Setup setup
          Pointer to global system settings.
protected  SN76496 sn76496
          Pointer to SN76496 PSG.
protected  java.lang.Thread thisThread
          Pointer to this thread.
protected  Vdp vdp
          Pointer to VDP.
protected  Z80 z80
          Pointer to Z80.
 
Constructor Summary
EmulateLoop(Z80 z, Memory m, Vdp v, SN76496 s, Screen sp, Setup setup)
          EmulateLoop Constructor.
 
Method Summary
 void reset()
          Quickly Reset the Z80, Memory, VDP and Sound.
 void resumeThread()
          Resume suspended Emulation.
 void run()
          Run Emulation.
 void setNTSC()
          Set NTSC Timing.
 void setPAL()
          Set PAL Timing.
 void startThread()
          Start Emulation.
 void stopThread()
          Stop Emulation.
 void suspendThread()
          Suspend Emulation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vdp

protected Vdp vdp
Pointer to VDP.


z80

protected Z80 z80
Pointer to Z80.


sn76496

protected SN76496 sn76496
Pointer to SN76496 PSG.


mem

protected Memory mem
Pointer to Memory.


screenpanel

protected Screen screenpanel
Pointer to Java Screen Panel.


setup

protected Setup setup
Pointer to global system settings.


thisThread

protected java.lang.Thread thisThread
Pointer to this thread.


running

protected boolean running
Stores whether thread is running.


fps

protected int fps
Stores Desired FPS.


numberOfScanlines

protected int numberOfScanlines
Number of Scanlines.


cyclesPerLine

protected int cyclesPerLine
CPU Cycles Per Scanline.

Constructor Detail

EmulateLoop

public EmulateLoop(Z80 z,
                   Memory m,
                   Vdp v,
                   SN76496 s,
                   Screen sp,
                   Setup setup)
EmulateLoop Constructor.

Parameters:
z - Z80
m - Memory
v - Vdp
s - SN76496
sp - Screen
setup - Setup
Method Detail

reset

public void reset()
Quickly Reset the Z80, Memory, VDP and Sound.


startThread

public void startThread()
Start Emulation.


stopThread

public void stopThread()
Stop Emulation.


suspendThread

public void suspendThread()
Suspend Emulation.


resumeThread

public void resumeThread()
Resume suspended Emulation.


setNTSC

public void setNTSC()
Set NTSC Timing.


setPAL

public void setPAL()
Set PAL Timing.


run

public void run()
Run Emulation. This method should not be called directly. Instead use startThread().

Specified by:
run in interface java.lang.Runnable


Copyright © 2007 JavaGear. All Rights Reserved.