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
4 changes: 4 additions & 0 deletions config/RSBE01_02/splits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ sora/ip/ip_network_producer.cpp:
sora/ef/ef_screen_handle.cpp:
.text start:0x8005E5C8 end:0x8005E5E8

sora/ec/ec_trace_mgr.cpp:
.text start:0x80065458 end:0x80065B60
.sdata2 start:0x805A1988 end:0x805A1990

sora/snd/snd_init_thread.cpp:
.text start:0x800797AC end:0x800798E8
.data start:0x80454550 end:0x80454580
Expand Down
46 changes: 23 additions & 23 deletions config/RSBE01_02/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3497,12 +3497,12 @@ fn_8005F79C = .text:0x8005F79C; // type:function size:0x8
setEffect__5ecMgrF4EfID = .text:0x8005F7A4; // type:function size:0x14
setEffect__5ecMgrF4EfIDP5Vec3f = .text:0x8005F7B8; // type:function size:0x14
fn_8005F7CC = .text:0x8005F7CC; // type:function size:0x14
setEffect__5ecMgrF4EfIDP5Vec3fP5Vec3fP5Vec3f = .text:0x8005F7E0; // type:function size:0x1C
setEffect__5ecMgrF4EfIDPC5Vec3fPC5Vec3fPC5Vec3f = .text:0x8005F7E0; // type:function size:0x1C
fn_8005F7FC = .text:0x8005F7FC; // type:function size:0x4
fn_8005F800 = .text:0x8005F800; // type:function size:0x14
fn_8005F814 = .text:0x8005F814; // type:function size:0x448
setParent__5ecMgrFUlPQ34nw4r3g3d6ScnMdlPCci = .text:0x8005FC5C; // type:function size:0x98
fn_8005FCF4 = .text:0x8005FCF4; // type:function size:0x98
setParent2__5ecMgrFUlPQ34nw4r3g3d6ScnMdlPCci = .text:0x8005FCF4; // type:function size:0x98
fn_8005FD8C = .text:0x8005FD8C; // type:function size:0x200
fn_8005FF8C = .text:0x8005FF8C; // type:function size:0x90
setGroundAttach__5ecMgrFUlP14soGroundModule = .text:0x8006001C; // type:function size:0xD0
Expand Down Expand Up @@ -3575,37 +3575,37 @@ fn_80065300 = .text:0x80065300; // type:function size:0x14C
fn_8006544C = .text:0x8006544C; // type:function size:0x4
fn_80065450 = .text:0x80065450; // type:function size:0x4
fn_80065454 = .text:0x80065454; // type:function size:0x4
fn_80065458 = .text:0x80065458; // type:function size:0x14
fn_8006546C = .text:0x8006546C; // type:function size:0x7C
fn_800654E8 = .text:0x800654E8; // type:function size:0xB4
fn_8006559C = .text:0x8006559C; // type:function size:0x50
fn_800655EC = .text:0x800655EC; // type:function size:0x40
fn_8006562C = .text:0x8006562C; // type:function size:0xB0
fn_800656DC = .text:0x800656DC; // type:function size:0xA8
fn_80065784 = .text:0x80065784; // type:function size:0x134
fn_800658B8 = .text:0x800658B8; // type:function size:0x6C
fn_80065924 = .text:0x80065924; // type:function size:0x88
fn_800659AC = .text:0x800659AC; // type:function size:0x84
fn_80065A30 = .text:0x80065A30; // type:function size:0x78
fn_80065AA8 = .text:0x80065AA8; // type:function size:0xB8
fn_80065B60 = .text:0x80065B60; // type:function size:0x98
__ct__10ecTraceMgrFv = .text:0x80065458; // type:function size:0x14
__dt__10ecTraceMgrFv = .text:0x8006546C; // type:function size:0x7C
update_just__10ecTraceMgrFv = .text:0x800654E8; // type:function size:0xB4
update_odd__10ecTraceMgrFf = .text:0x8006559C; // type:function size:0x50
renderXlu__10ecTraceMgrFv = .text:0x800655EC; // type:function size:0x40
start__10ecTraceMgrFUlUlUlUlUlUlUlUcUlf = .text:0x8006562C; // type:function size:0xB0
start__10ecTraceMgrFUlUlUlUlUlUlUcUlf = .text:0x800656DC; // type:function size:0xA8
regist__10ecTraceMgrFP7ecTraceUlUcf = .text:0x80065784; // type:function size:0x134
end__10ecTraceMgrFUlUlUl = .text:0x800658B8; // type:function size:0x6C
endGroup__10ecTraceMgrFUlUlUl = .text:0x80065924; // type:function size:0x88
pauseGroup__10ecTraceMgrFbUlUl = .text:0x800659AC; // type:function size:0x84
setOffset__10ecTraceMgrFUlRC5Vec3fRC5Vec3f = .text:0x80065A30; // type:function size:0x78
setAttachEffect__10ecTraceMgrFUl4EfIDPQ34nw4r3g3d6ScnMdlPCcPC5Vec3fPC5Vec3fPC5Vec3f = .text:0x80065AA8; // type:function size:0xB8
__ct__7ecTraceFUlUlUlUlUlUl = .text:0x80065B60; // type:function size:0x98
fn_80065BF8 = .text:0x80065BF8; // type:function size:0x4
fn_80065BFC = .text:0x80065BFC; // type:function size:0x9C
__ct__7ecTraceFUlUlUlUlUlUlUl = .text:0x80065BFC; // type:function size:0x9C
fn_80065C98 = .text:0x80065C98; // type:function size:0x1C8
fn_80065E60 = .text:0x80065E60; // type:function size:0x4
fn_80065E64 = .text:0x80065E64; // type:function size:0x9C
fn_80065F00 = .text:0x80065F00; // type:function size:0x26C
fn_8006616C = .text:0x8006616C; // type:function size:0x168
fn_800662D4 = .text:0x800662D4; // type:function size:0x13D0
__dt__7ecTraceFv = .text:0x80065E64; // type:function size:0x9C
update_just__7ecTraceFv = .text:0x80065F00; // type:function size:0x26C
update_odd__7ecTraceFf = .text:0x8006616C; // type:function size:0x168
renderXlu__7ecTraceFv = .text:0x800662D4; // type:function size:0x13D0
fn_800676A4 = .text:0x800676A4; // type:function size:0x480
fn_80067B24 = .text:0x80067B24; // type:function size:0x328
fn_80067E4C = .text:0x80067E4C; // type:function size:0x48C
fn_800682D8 = .text:0x800682D8; // type:function size:0x2CC
fn_800685A4 = .text:0x800685A4; // type:function size:0x468
fn_80068A0C = .text:0x80068A0C; // type:function size:0x4A4
fn_80068EB0 = .text:0x80068EB0; // type:function size:0x734
fn_800695E4 = .text:0x800695E4; // type:function size:0xA8
fn_8006968C = .text:0x8006968C; // type:function size:0x28
end__7ecTraceFUlUl = .text:0x800695E4; // type:function size:0xA8
pause__7ecTraceFb = .text:0x8006968C; // type:function size:0x28
__ct__7MessageFUlQ25Heaps8HeapType = .text:0x800696B4; // type:function size:0x16C
fn_80069820 = .text:0x80069820; // type:function size:0x40
__dt__7MessageFv = .text:0x80069860; // type:function size:0x110
Expand Down
1 change: 1 addition & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ def MatchingFor(*versions):
Object(Matching, "sora/ip/ip_human.cpp"),
Object(NonMatching, "sora/ip/ip_network_producer.cpp"),
Object(Matching, "sora/ef/ef_screen_handle.cpp"),
Object(Matching, "sora/ec/ec_trace_mgr.cpp"),
Object(Matching, "sora/snd/snd_init_thread.cpp"),
Object(Matching, "sora/mv/mv_THPAudioDecode.cpp"),
Object(Matching, "sora/cm/cm_controller_default.cpp", extra_cflags=["-RTTI off"]),
Expand Down
152 changes: 152 additions & 0 deletions src/sora/ec/ec_trace_mgr.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
#include <ec/ec_mgr.h>
#include <ec/ec_trace.h>
#include <ec/ec_trace_mgr.h>
#include <ef/ef_id.h>
#include <mt/mt_vector.h>
#include <sr/sr_common.h>
#include <types.h>

ecTraceMgr::ecTraceMgr() : m_head(nullptr), m_nextId(0), m_length(0) { }

ecTraceMgr::~ecTraceMgr() {
for (ecTrace* curr = m_head; curr; ) {
ecTrace* node = curr;
curr = curr->m_next;
if (node)
delete node;
}
}

void ecTraceMgr::update_just() {
ecTrace* curr = m_head;
while (curr) {
if (!curr->update_just()) {
ecTrace* node = curr;
curr = curr->m_next;
if (node->m_prev)
node->m_prev->m_next = node->m_next;
else
m_head = node->m_next;

if (node->m_next)
node->m_next->m_prev = node->m_prev;
else
m_tail = node->m_prev;

m_length--;
if (node)
delete node;
continue;
}
curr = curr->m_next;
}
}

void ecTraceMgr::update_odd(float p1) {
for (ecTrace* curr = m_head; curr; curr = curr->m_next)
curr->update_odd(p1);
}

void ecTraceMgr::renderXlu() {
for (ecTrace* curr = m_head; curr; curr = curr->m_next)
curr->renderXlu();
}

u32 ecTraceMgr::start(u32 p1, u32 p2, u32 p3, u32 p4, u32 p5, u32 p6, u32 p7,
u8 p8, u32 p9, float p10) {
return regist(new (Heaps::Effect) ecTrace(p1, p2, p3, p4, p5, p7, p9), p6, p8, p10);
}

u32 ecTraceMgr::start(u32 p1, u32 p2, u32 p3, u32 p4, u32 p5, u32 p6, u8 p7,
u32 p8, float p9) {
return regist(new (Heaps::Effect) ecTrace(p1, p2, p3, p4, p6, p8), p5, p7, p9);
}

u32 ecTraceMgr::regist(ecTrace* trace, u32 p2, u8 p3, float p4) {
if (!trace)
return 0;
if (g_ecMgr->unk90 != (p2 & g_ecMgr->unk94))
return 0;

if (++m_nextId == 0)
++m_nextId;
trace->m_id = m_nextId;
trace->unk28 = p2;

switch (p3) {
case 0:
trace->unk64 = Vec3f(1.0f, 0.0f, 0.0f);
break;
case 1:
trace->unk64 = Vec3f(0.0f, 1.0f, 0.0f);
break;
default:
trace->unk64 = Vec3f(0.0f, 0.0f, 1.0f);
break;
}
trace->unk74 = p4;
if (!m_head) {
m_tail = trace;
m_head = trace;
trace->m_next = nullptr;
trace->m_prev = nullptr;
} else {
m_tail->m_next = trace;
trace->m_prev = m_tail;
trace->m_next = nullptr;
m_tail = trace;
}
m_length++;
return m_nextId;
}

bool ecTraceMgr::end(u32 id, u32 p2, u32 p3) {
ecTrace* trace = getTraceById(id);
if (!trace)
return false;
trace->end(p2, p3);
return true;
}

void ecTraceMgr::endGroup(u32 p1, u32 p2, u32 p3) {
ecTrace* curr = m_head;
if (p1 & 0xFF000000)
p2 |= 0xFF000000;
p1 &= p2;
for ( ; curr; curr = curr->m_next)
if (p1 == (curr->unk28 & p2))
curr->end(p3, 0);
}

void ecTraceMgr::pauseGroup(bool p1, u32 p2, u32 p3) {
ecTrace* curr = m_head;
if (p2 & 0xFF000000)
p3 |= 0xFF000000;
p2 &= p3;
for ( ; curr; curr = curr->m_next)
if (p2 == (curr->unk28 & p3))
curr->pause(p1);
}

bool ecTraceMgr::setOffset(u32 id, const Vec3f& p2, const Vec3f& p3) {
ecTrace* trace = getTraceById(id);
if (!trace)
return false;
trace->unk4C = p2;
trace->unk58 = p3;
return true;
}

void ecTraceMgr::setAttachEffect(u32 id, EfID efId, nw4r::g3d::ScnMdl* scnMdl,
const char* name, const Vec3f* pos, const Vec3f* rot, const Vec3f* scale) {
ecTrace* trace = getTraceById(id);
if (trace)
switch (trace->unk2C) {
case 0:
trace->unk2C = g_ecMgr->setEffect(efId, pos, rot, scale);
g_ecMgr->setParent2(trace->unk2C, scnMdl, name, 0);
break;
default:
break;
}
}
Loading