Line 113:
Line 113:
|<code>void OSYieldThread(void);</code>
|<code>void OSYieldThread(void);</code>
|Yield control of the CPU, allowing another thread to run
|Yield control of the CPU, allowing another thread to run
+
|-
+
|OSGetCurrentThread
+
|<code>OSThread *OSGetCurrentThread(void);</code>
+
|Get the OSThread structure ptr for the current thread.
+
|-
+
|OSSetThreadAffinity
+
|<code>uint32_t OSSetThreadAffinity(OSThread* thread, int16_t affinity);</code>
+
|Sets the affinity for the specified thread. Returns 0 for failure, 1 for success.
+
|-
+
|OSGetCoreId
+
|<code>uint32_t OSGetCoreId(void);</code>
+
|Returns the PowerPC coreid this code is running on(value of spr1007).
|}
|}
=== Screen ===
=== Screen ===
−
In all the functions below, bufferNum means: 0 = TV, 1 = Gamepad.
+
In all the functions below, bufferNum means: 0 = TV, 1 = Gamepad. "colour" in the form stored in memory is RGBA8. These functions can't be used without crashing, unless OSScreen was properly initialized. The below functions will immediately return if x/y is out-of-bounds.
+
{| class="wikitable"
{| class="wikitable"
!Name
!Name
Line 128:
Line 141:
|OSScreenFlipBuffersEx
|OSScreenFlipBuffersEx
|uint32_t OSScreenFlipBuffersEx(int bufferNum);
|uint32_t OSScreenFlipBuffersEx(int bufferNum);
−
|Draw the changes in the specified buffer
+
|Do a buffer-swap, which results in the buffer previously being drawn to being displayed. This flushes data-cache for the buffers and updates coreinit + hw-regs state.
|-
|-
|OSScreenClearBufferEx
|OSScreenClearBufferEx