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 @@ -41,6 +41,9 @@ sora/gf/gf_archive_load_thread.cpp:
sora/gf/gf_archive_file.cpp:
.text start:0x80016408 end:0x8001643C

sora/gf/gf_archive_db.cpp:
.text start:0x8001643C end:0x80016688

sora/gf/gf_camera_controller.cpp:
.text start:0x8001A3A4 end:0x8001A3AC
.data start:0x80420B88 end:0x80420BA0
Expand Down
8 changes: 4 additions & 4 deletions config/RSBE01_02/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2250,10 +2250,10 @@ fn_80015E34 = .text:0x80015E34; // type:function size:0x144
fn_80015F78 = .text:0x80015F78; // type:function size:0x1B8
fn_80016130 = .text:0x80016130; // type:function size:0x2D8
getDataChunk__19gfArchiveFileHeaderFv = .text:0x80016408; // type:function size:0x34
fn_8001643C = .text:0x8001643C; // type:function size:0x98
fn_800164D4 = .text:0x800164D4; // type:function size:0xFC
fn_800165D0 = .text:0x800165D0; // type:function size:0x94
fn_80016664 = .text:0x80016664; // type:function size:0x24
create__17gfArchiveDatabaseFUlQ25Heaps8HeapType = .text:0x8001643C; // type:function size:0x98
__dt__17gfArchiveDatabaseFv = .text:0x800164D4; // type:function size:0xFC
add__17gfArchiveDatabaseFP9gfArchiveb = .text:0x800165D0; // type:function size:0x94
get__17gfArchiveDatabaseCFl = .text:0x80016664; // type:function size:0x24
fn_80016688 = .text:0x80016688; // type:function size:0x68
fn_800166F0 = .text:0x800166F0; // type:function size:0x90
fn_80016780 = .text:0x80016780; // type:function size:0x30
Expand Down
1 change: 1 addition & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ def MatchingFor(*versions):
Object(Matching, "sora/gf/gf_3d_scene_light_resource.cpp"),
Object(Matching, "sora/gf/gf_archive_load_thread.cpp"),
Object(Matching, "sora/gf/gf_archive_file.cpp"),
Object(Matching, "sora/gf/gf_archive_db.cpp"),
Object(Matching, "sora/gf/gf_camera_controller.cpp"),
Object(Matching, "sora/gf/gf_callback.cpp"),
Object(Matching, "sora/gf/gf_decomp.cpp"),
Expand Down
2 changes: 1 addition & 1 deletion include/lib/BrawlHeaders
1 change: 1 addition & 0 deletions src/mo_scene/sora_scene/sc_adv_gameover.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <sr/sr_common.h>
#include <types.h>

// NONMATCHING: instruction ordering in the ctor
scAdvGameover* scAdvGameover::create() {
return new (Heaps::GlobalMode) scAdvGameover("scAdvGameover");
}
Expand Down
50 changes: 50 additions & 0 deletions src/sora/gf/gf_archive_db.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#include <gf/gf_archive.h>
#include <gf/gf_archive_db.h>
#include <sr/sr_common.h>
#include <types.h>

gfArchiveDatabase* gfArchiveDatabase::create(u32 count, Heaps::HeapType heap) {
return new (heap, count) gfArchiveDatabase(count);
}

gfArchiveDatabase::~gfArchiveDatabase() {
for (s32 i = 0; i < m_capacity; i++) {
gfArchiveDatabaseEntry* ep = &m_entries[i];
if (ep->m_isActive) {
if (!--ep->m_archive->m_refCount) {
if (ep->m_isOwner) {
delete ep->m_archive;
}
ep->m_archive = nullptr;
ep->m_isActive = false;
}
ep = &m_entries[i];
ep->m_archive = nullptr;
ep->unk4_b7 = ep->m_isActive = false;
ep->m_isOwner = true;
ep->m_next = nullptr;
}
}
m_entries = nullptr;
m_capacity = 0;
m_size = 0;
}

s32 gfArchiveDatabase::add(gfArchive* arc, bool makeOwner) {
s32 idx = findAvail();
arc->m_refCount++;
m_entries[idx].m_archive = arc;
m_entries[idx].m_isActive = true;
m_entries[idx].m_isOwner = makeOwner;
m_size++;
return idx;
}

gfArchive* gfArchiveDatabase::get(s32 i) const {
const gfArchiveDatabaseEntry* ep = &m_entries[i];
gfArchive* arc = nullptr;
if (ep->m_isActive) {
arc = ep->m_archive;
}
return arc;
}
Loading