N64ModernRuntime/ultramodern/include/ultramodern/rsp.hpp
Anghelo Carvajal 27282afa2b
Remove "permanent" and "temporary" threads tagging and add a way to name game threads (#45)
* System to specify thread types by the game

* Register threads callbacks

* Remove temporary and permanent threads

* Fix `pthread_setname_np` not liking names longer than 16 bytes

* Singular

* Rename events_callbacks arg

* Use `prctl` instead of `pthread_setname_np` for naming a thread

* Fix typo
2024-06-18 13:02:18 -04:00

31 lines
671 B
C++

#ifndef __RSP_HPP__
#define __RSP_HPP__
#include <cstdint>
#include "ultra64.h"
namespace ultramodern {
namespace rsp {
struct callbacks_t {
using init_t = void();
using run_microcode_t = bool(RDRAM_ARG const OSTask* task);
init_t* init;
/**
* Executes the given RSP task.
*
* Returns true if task was executed successfully.
*/
run_microcode_t* run_task;
};
void set_callbacks(const callbacks_t& callbacks);
void init();
bool run_task(RDRAM_ARG const OSTask* task);
};
} // namespace ultramodern
#endif