Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions config/RSBE01_02/splits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ sora/gf/gf_keep_fb.cpp:
sora/gf/gf_memory_util.cpp:
.text start:0x80026474 end:0x80026478

sora/gf/gf_thread.cpp:
.text start:0x8002F5B8 end:0x8002F6F4

sora/gf/gf_system_callback.cpp:
.text start:0x80038684 end:0x800387AC
.ctors start:0x80406508 end:0x8040650C
Expand Down
6 changes: 3 additions & 3 deletions config/RSBE01_02/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2695,9 +2695,9 @@ fn_8002F048 = .text:0x8002F048; // type:function size:0xA4
fn_8002F0EC = .text:0x8002F0EC; // type:function size:0x9C
fn_8002F188 = .text:0x8002F188; // type:function size:0x32C
fn_8002F4B4 = .text:0x8002F4B4; // type:function size:0x104
fn_8002F5B8 = .text:0x8002F5B8; // type:function size:0x70
fn_8002F628 = .text:0x8002F628; // type:function size:0x98
fn_8002F6C0 = .text:0x8002F6C0; // type:function size:0x34
__dt__8gfThreadFv = .text:0x8002F5B8; // type:function size:0x70
createThread__8gfThreadFP10gfRunnableUlUlQ25Heaps8HeapType = .text:0x8002F628; // type:function size:0x98
startThread__8gfThreadFPv = .text:0x8002F6C0; // type:function size:0x34
fn_8002F6F4 = .text:0x8002F6F4; // type:function size:0x2F4
fn_8002F9E8 = .text:0x8002F9E8; // type:function size:0x40C
fn_8002FDF4 = .text:0x8002FDF4; // type:function size:0x54
Expand Down
1 change: 1 addition & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ def MatchingFor(*versions):
Object(Matching, "sora/gf/gf_gameframe_counter.cpp"),
Object(Matching, "sora/gf/gf_keep_fb.cpp"),
Object(Matching, "sora/gf/gf_memory_util.cpp"),
Object(Matching, "sora/gf/gf_thread.cpp"),
Object(Matching, "sora/mt/mt_prng.cpp", extra_cflags=["-RTTI off"]),
Object(Matching, "sora/st/module.cpp"),
Object(Matching, "sora/ef/ef_screen_handle.cpp"),
Expand Down
2 changes: 1 addition & 1 deletion include/lib/BrawlHeaders
33 changes: 33 additions & 0 deletions src/sora/gf/gf_thread.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#include <gf/gf_thread.h>
#include <gf/gf_heap_manager.h>
#include <revolution/OS/OSThread.h>
#include <sr/sr_common.h>
#include <types.h>

gfThread::~gfThread() {
u32 discard;
OSJoinThread(&m_thread, &discard);
gfHeapManager::free(m_stackLow);
}

void gfThread::createThread(gfRunnable* startRoutine, u32 priority, u32 stackSize, Heaps::HeapType heap) {
unk32C = 0;
m_stackSize = stackSize;
m_priority = priority;
m_stackHi = nullptr;
m_attach = 0;
if (startRoutine) {
m_startRoutine = startRoutine;
} else {
m_startRoutine = this;
}
void* stack = gfHeapManager::alloc(heap, stackSize);
m_stackLow = stack;
m_stackHi = static_cast<char*>(stack) + stackSize;
OSCreateThread(&m_thread, startThread, this, m_stackHi, m_stackSize, m_priority, m_attach);
}

void* gfThread::startThread(void* arg) {
static_cast<gfThread*>(arg)->m_startRoutine->run();
return nullptr;
}