apple2ix/src/timing.h
Aaron Culliney 96d083a2c3 WIP: changes to cpu throttling/timing
WARN: this is still a WIP and untested.  Instead of nanosleep() the cpu thread
now uses an adaptive spinloop.  This better emulates the actual apple //e speed
in preparation to do near-realtime audio.  The drawback is that the cpu thread
is pegged at 100% usage.
2013-07-21 17:20:03 -07:00

27 lines
505 B
C

/*
* Apple // emulator for Linux
*
* CPU Timing Support.
*
* Mostly this adds support for specifically throttling the emulator speed to
* match a 1.02MHz Apple //e.
*
* Added 2013 by Aaron Culliney
*
*/
#ifndef _TIMING_H_
#define _TIMING_H_
#define APPLE2_HZ 1020000
#define NANOSECONDS 1000000000
// 0 = run as fast as possible, 1 = approximate apple, X = 1/X rate
void timing_set_cpu_scale(unsigned int scale);
void timing_initialize();
void timing_throttle();
#endif // whole file