flycast/core/hw/sh4/sh4_sched.h

56 lines
1.2 KiB
C
Raw Normal View History

#ifndef SH4_SCHED_H
#define SH4_SCHED_H
2013-12-19 17:10:14 +00:00
#include "types.h"
2015-01-06 12:10:48 +00:00
/*
tag, as passed on sh4_sched_register
sch_cycles, the cycle duration that the callback requested (sh4_sched_request)
jitter, the number of cycles that the callback was delayed, [0... 448]
*/
2013-12-19 17:10:14 +00:00
typedef int sh4_sched_callback(int tag, int sch_cycl, int jitter);
2015-01-06 12:10:48 +00:00
/*
Register a callback to the scheduler. The returned id
is used for sh4_sched_request and sh4_sched_unregister calls
2015-01-06 12:10:48 +00:00
*/
2013-12-19 17:10:14 +00:00
int sh4_sched_register(int tag, sh4_sched_callback* ssc);
2015-01-06 12:10:48 +00:00
/***
* Unregister a callback from the scheduler.
*/
void sh4_sched_unregister(int id);
2015-01-06 12:10:48 +00:00
/*
current time, in SH4 cycles, referenced to boot.
Does not wrap, 64 bits.
*/
2013-12-19 17:10:14 +00:00
u64 sh4_sched_now64();
2015-01-06 12:10:48 +00:00
/*
Schedule a callback to be called sh4 *cycles* after the
invocation of this function. *Cycles* range is (0, 200M].
Passing a value of 0 disables the callback.
If called multiple times, only the last call is in effect
*/
void sh4_sched_request(int id, int cycles);
2015-01-06 12:10:48 +00:00
/*
Tick for *cycles*
*/
2013-12-19 17:10:14 +00:00
void sh4_sched_tick(int cycles);
2018-10-29 14:11:34 +00:00
void sh4_sched_ffts();
void sh4_sched_reset(bool hard);
2018-10-29 14:11:34 +00:00
2018-09-02 13:49:23 +00:00
struct sched_list
{
sh4_sched_callback* cb;
int tag;
int start;
int end;
};
#endif //SH4_SCHED_H