Add AddTicks and GetTicksRemaining callbacks

This commit is contained in:
MerryMage
2017-12-03 02:42:22 +00:00
parent 80c56aa89d
commit 256749910f
10 changed files with 38 additions and 13 deletions

View File

@@ -51,6 +51,10 @@ struct UserCallbacks {
// This callback is called whenever a SVC instruction is executed.
void (*CallSVC)(std::uint32_t swi);
// Timing-related callbacks
void (*AddTicks)(std::uint64_t ticks);
std::uint64_t (*GetTicksRemaining)();
// Page Table
// The page table is used for faster memory access. If an entry in the table is nullptr,
// the JIT will fallback to calling the MemoryRead*/MemoryWrite* callbacks.

View File

@@ -28,9 +28,8 @@ public:
* Runs the emulated CPU for about cycle_count cycles.
* Cannot be recursively called.
* @param cycle_count Estimated number of cycles to run the CPU for.
* @returns Actual cycle count.
*/
std::size_t Run(std::size_t cycle_count);
void Run(std::size_t cycle_count);
/**
* Clears the code cache of all compiled code.