mirror of
https://github.com/N64Recomp/N64Recomp.git
synced 2025-05-21 02:44:58 +00:00
Created solution for testing output
This commit is contained in:
parent
5d9ea96abc
commit
b94fe6f5fb
24 changed files with 9225 additions and 2 deletions
32
test/portultra/task_win32.cpp
Normal file
32
test/portultra/task_win32.cpp
Normal file
|
@ -0,0 +1,32 @@
|
|||
#include <Windows.h>
|
||||
|
||||
#include "ultra64.h"
|
||||
#include "multilibultra.hpp"
|
||||
|
||||
extern "C" unsigned int sleep(unsigned int seconds) {
|
||||
Sleep(seconds * 1000);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Multilibultra::native_init(void) {
|
||||
}
|
||||
|
||||
void Multilibultra::native_thread_init(OSThread *t) {
|
||||
debug_printf("[Native] Init thread %d\n", t->id);
|
||||
}
|
||||
|
||||
void Multilibultra::pause_thread_native_impl(OSThread *t) {
|
||||
debug_printf("[Native] Pause thread %d\n", t->id);
|
||||
// Pause the thread via the win32 API
|
||||
SuspendThread(t->context->host_thread.native_handle());
|
||||
// Perform a synchronous action to ensure that the thread is suspended
|
||||
// see: https://devblogs.microsoft.com/oldnewthing/20150205-00/?p=44743
|
||||
CONTEXT threadContext;
|
||||
GetThreadContext(t->context->host_thread.native_handle(), &threadContext);
|
||||
}
|
||||
|
||||
void Multilibultra::resume_thread_native_impl(UNUSED OSThread *t) {
|
||||
debug_printf("[Native] Resume thread %d\n", t->id);
|
||||
// Resume the thread
|
||||
ResumeThread(t->context->host_thread.native_handle());
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue