Link CSfxHandle.cpp

This commit is contained in:
Phillip Stephens 2022-09-15 20:24:27 -07:00
parent 6e862cdef4
commit 79301314e9
7 changed files with 43 additions and 36 deletions

View File

@ -130,7 +130,7 @@ $(METROTRK_FILES): MWCC_VERSION := 1.2.5
$(METROTRK_FILES): CFLAGS := $(CFLAGS_BASE)
$(BASE_FILES): MWCC_VERSION := 1.2.5
$(BASE_FILES): CFLAGS := $(CFLAGS_BASE)
$(AI_FILES): MWCC_VERSION := 1.2.5
$(AI_FILES): MWCC_VERSION := 1.2.5e
$(AI_FILES): CFLAGS := $(CFLAGS_BASE)
$(OS_FILES): MWCC_VERSION := 1.2.5
$(OS_FILES): CFLAGS := $(CFLAGS_BASE)

View File

@ -10,8 +10,8 @@ AIVersion:
.section .sdata
.balign 8
.global lbl_805A8A68
lbl_805A8A68:
.global __AIVersion
__AIVersion:
.4byte AIVersion
.4byte 0
@ -405,7 +405,7 @@ AIInit:
/* 8036D3EC 0036A34C 80 0D AB 08 */ lwz r0, __AI_init_flag@sda21(r13)
/* 8036D3F0 0036A350 2C 00 00 01 */ cmpwi r0, 1
/* 8036D3F4 0036A354 41 82 01 34 */ beq lbl_8036D528
/* 8036D3F8 0036A358 80 6D 9E A8 */ lwz r3, lbl_805A8A68@sda21(r13)
/* 8036D3F8 0036A358 80 6D 9E A8 */ lwz r3, __AIVersion@sda21(r13)
/* 8036D3FC 0036A35C 48 01 0C 3D */ bl OSRegisterVersion
/* 8036D400 0036A360 3C 60 80 00 */ lis r3, 0x800000F8@ha
/* 8036D404 0036A364 80 03 00 F8 */ lwz r0, 0x800000F8@l(r3)

View File

@ -3,36 +3,19 @@
.section .sbss, "wa"
.balign 8
.global lbl_805A92B8
lbl_805A92B8:
.global mRefCount__10CSfxHandle
mRefCount__10CSfxHandle:
.skip 0x8
.section .text, "ax"
.global __ct__10CSfxHandleFUi
__ct__10CSfxHandleFUi:
/* 802E786C 002E47CC 80 AD A6 F8 */ lwz r5, lbl_805A92B8@sda21(r13)
/* 802E786C 002E47CC 80 AD A6 F8 */ lwz r5, mRefCount__10CSfxHandle@sda21(r13)
/* 802E7870 002E47D0 54 80 05 3E */ clrlwi r0, r4, 0x14
/* 802E7874 002E47D4 38 85 00 01 */ addi r4, r5, 1
/* 802E7878 002E47D8 90 8D A6 F8 */ stw r4, lbl_805A92B8@sda21(r13)
/* 802E7878 002E47D8 90 8D A6 F8 */ stw r4, mRefCount__10CSfxHandle@sda21(r13)
/* 802E787C 002E47DC 50 80 70 22 */ rlwimi r0, r4, 0xe, 0, 0x11
/* 802E7880 002E47E0 90 03 00 00 */ stw r0, 0(r3)
/* 802E7884 002E47E4 4E 80 00 20 */ blr
.section .sdata2, "a"
.balign 8
.global lbl_805AE318
lbl_805AE318:
# ROM: 0x3FABB8
.2byte 0x000000FF
.global lbl_805AE31A
lbl_805AE31A:
# ROM: 0x3FABBA
.2byte 0x0000007F
.global lbl_805AE31C
lbl_805AE31C:
# ROM: 0x3FABBC
.4byte 0xFFFF0000

View File

@ -4601,6 +4601,24 @@ __ct__Q211CSfxManager11CSfxChannelFv:
.section .sdata2, "a"
.balign 8
.section .sdata2, "a"
.balign 8
.global lbl_805AE318
lbl_805AE318:
# ROM: 0x3FABB8
.2byte 0x000000FF
.global lbl_805AE31A
lbl_805AE31A:
# ROM: 0x3FABBA
.2byte 0x0000007F
.global lbl_805AE31C
lbl_805AE31C:
# ROM: 0x3FABBC
.4byte 0xFFFF0000
.global lbl_805AE320
lbl_805AE320:
# ROM: 0x3FABC0

View File

@ -5,18 +5,19 @@
class CSfxHandle {
public:
CSfxHandle() : value(0) {}
CSfxHandle(uint value) : value(value) {}
CSfxHandle() : mID(~0) {}
CSfxHandle(uint value);
// GetIndex__10CSfxHandleCFv
// NullHandle__10CSfxHandleFv
// mRefCount__10CSfxHandle ??
bool operator==(const CSfxHandle& other) { return value == other.value; }
operator bool() const { return value != 0; }
uint GetIndex() const { return mID & 0xFFF; }
static NullHandle() { return CSfxHandle(); }
bool operator=(const CSfxHandle& other) { mID = other.mID; }
bool operator==(const CSfxHandle& other) { return mID == other.mID; }
bool operator!=(const CSfxHandle& other) { return mID != other.mID; }
operator bool() const { return mID != 0; }
private:
uint value;
uint mID;
static uint mRefCount;
};
CHECK_SIZEOF(CSfxHandle, 0x4)

View File

@ -455,7 +455,7 @@ KYOTO_1 :=\
$(BUILD_DIR)/asm/Kyoto/Animation/CTransitionManager.o\
$(BUILD_DIR)/asm/Kyoto/Animation/CTreeUtils.o\
$(BUILD_DIR)/asm/Kyoto/Animation/IMetaAnim.o\
$(BUILD_DIR)/asm/Kyoto/Audio/CSfxHandle.o\
$(BUILD_DIR)/src/Kyoto/Audio/CSfxHandle.o\
$(BUILD_DIR)/asm/Kyoto/Audio/CSfxManager.o\
$(BUILD_DIR)/asm/Kyoto/Animation/CAdvancementDeltas.o\
$(BUILD_DIR)/asm/Kyoto/Animation/CAnimMathUtils.o\

View File

@ -0,0 +1,5 @@
#include <Kyoto/Audio/CSfxHandle.hpp>
uint CSfxHandle::mRefCount = 0;
CSfxHandle::CSfxHandle(uint value) : mID((++mRefCount << 14) | (value & 0xFFF)) {
}