isle/LEGO1/mxthread.h

56 lines
965 B
C
Raw Normal View History

#ifndef MXTHREAD_H
#define MXTHREAD_H
2023-07-12 17:12:03 -04:00
#include "compat.h"
#include "mxsemaphore.h"
2023-10-24 19:38:27 -04:00
#include "mxtypes.h"
class MxCore;
(Proposal) Adjustments to "decomp" language (#308) * Adjustments to "decomp" language * Fix a comment * Fix accidental clang-formatting * Fix order * Fix order * Remove junk * Fix OFFSET * Adjustments based on new suggestions * Annotate globals * Globals in ISLE * More globals * Merge from parser2 branch * Allow prepending space for exact marker match * To eliminate noise, require the 0x prefix on offset for marker match * fix test from previous * Count tab stops for indented functions to reduce MISSED_END_OF_FUNCTION noise * FUNCTION to SYNTHETIC where needed * Missed marker conversion on SetAtomId * pylint cleanup, remove unused code * Fix unexpected function end, add more unit tests * Be more strict about synthetic name syntax * Revert "Missed marker conversion on SetAtomId" This reverts commit d87d665127fae7dd6e5bd48d9af14a0a829bf9e2. * Revert "FUNCTION to SYNTHETIC where needed" This reverts commit 8c815418d261ba8c5f67a9a2cae349fe4ac92db8. * Implicit lookup by name for functions * Fix VTABLE SYNTHETIC and other decomp markers * Get vtable class name * Vtable marker should identify struct * No colon for SIZE comment * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update CONTRIBUTING.md * Fix destructor/annotation * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md --------- Co-authored-by: disinvite <disinvite@users.noreply.github.com>
2023-12-06 07:10:45 -05:00
// VTABLE: LEGO1 0x100dc860
// SIZE 0x1c
2023-10-24 19:38:27 -04:00
class MxThread {
public:
2023-10-24 19:38:27 -04:00
// Note: Comes before virtual destructor
virtual MxResult Run();
MxResult Start(MxS32 p_stack, MxS32 p_flag);
2023-10-24 19:38:27 -04:00
void Terminate();
void Sleep(MxS32 p_milliseconds);
2023-10-24 19:38:27 -04:00
inline MxBool IsRunning() { return m_running; }
protected:
2023-10-24 19:38:27 -04:00
MxThread();
public:
2023-10-24 19:38:27 -04:00
virtual ~MxThread();
private:
2023-10-24 19:38:27 -04:00
static unsigned ThreadProc(void* p_thread);
MxULong m_hThread; // 0x04
MxU32 m_threadId; // 0x08
MxBool m_running; // 0x0c
MxSemaphore m_semaphore; // 0x10
protected:
MxCore* m_target; // 0x18
};
(Proposal) Adjustments to "decomp" language (#308) * Adjustments to "decomp" language * Fix a comment * Fix accidental clang-formatting * Fix order * Fix order * Remove junk * Fix OFFSET * Adjustments based on new suggestions * Annotate globals * Globals in ISLE * More globals * Merge from parser2 branch * Allow prepending space for exact marker match * To eliminate noise, require the 0x prefix on offset for marker match * fix test from previous * Count tab stops for indented functions to reduce MISSED_END_OF_FUNCTION noise * FUNCTION to SYNTHETIC where needed * Missed marker conversion on SetAtomId * pylint cleanup, remove unused code * Fix unexpected function end, add more unit tests * Be more strict about synthetic name syntax * Revert "Missed marker conversion on SetAtomId" This reverts commit d87d665127fae7dd6e5bd48d9af14a0a829bf9e2. * Revert "FUNCTION to SYNTHETIC where needed" This reverts commit 8c815418d261ba8c5f67a9a2cae349fe4ac92db8. * Implicit lookup by name for functions * Fix VTABLE SYNTHETIC and other decomp markers * Get vtable class name * Vtable marker should identify struct * No colon for SIZE comment * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update CONTRIBUTING.md * Fix destructor/annotation * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md --------- Co-authored-by: disinvite <disinvite@users.noreply.github.com>
2023-12-06 07:10:45 -05:00
// VTABLE: LEGO1 0x100dc6d8
// SIZE 0x20
2023-10-24 19:38:27 -04:00
class MxTickleThread : public MxThread {
public:
MxTickleThread(MxCore* p_target, MxS32 p_frequencyMS);
2023-10-24 19:38:27 -04:00
virtual ~MxTickleThread() {}
2023-10-24 19:38:27 -04:00
MxResult Run() override;
private:
MxS32 m_frequencyMS; // 0x1c
};
2023-07-12 17:12:03 -04:00
#endif // MXTHREAD_H