mirror of
https://github.com/zeldaret/tp
synced 2026-05-28 00:16:11 -04:00
Z2AudioLib misc decomp (#75)
* Z2SoundHandles: decomp portions
* start decomping: Z2SpeechMgr2, Z2SoundHandles
* Z2SoundHandles::stopAllSounds(): ok
* Z2SoundHandles::getHandleUserData(): ok
* Z2SoundInfo: header
* Z2SoundObjBase::framework(): ok
* Z2SoundObjBase::Z2SoundObjBase(), Z2SoundObjBase::init(): ok
* Z2SoundObjBase::~Z2SoundObjBase(): ok
* Z2SoundObjBase::stopOK(): ok
* Z2SoundObjBase::stopOK, incomplete Z2SoundObjBase::dispose()
* clang-format
* Z2SoundObjBase::dispose(): ok
* JAISound::operator->(): null assert
* JAIAudience: stub
* Z2SoundObject::{init, deleteObject, isAlive}: ok
* Z2SeMgr: elaborate struct (and decl JAISoundHandles to support this)
* start subclassing Z2SoundObjBase; nonmatching Z2SoundObjSimple::init()
* Z2SeMGr::{incrCrowdSize, decrCrowdSize}: ok
* Z2MultiSeMgr::resetMultiSePos(): ok
* Z2WolfHowlMgr.h: decls
* Z2SoundStarter: move to decls and fix postprocess.py symbol pass
* Z2AudioArcLoader: decls
* Z2SoundObjMgr: ok some fns
- deleteEnemyAll()
- isTwilightBattle()
- setGhostEnemyState()
additionally elaborates parts of the Z2Creature hierarchy
* delete unused .s files and add tool to find them (only runs on linux)
* run clang-format
* postprocess.py: comment out debugging
* add python step to ok-check workflow
* address review comments
* address review comments
Co-authored-by: notyourav <65437533+notyourav@users.noreply.github.com>
Co-authored-by: Pheenoh <pheenoh@gmail.com>
Co-authored-by: notyourav <65437533+notyourav@users.noreply.github.com>
This commit is contained in:
@@ -1,58 +1,65 @@
|
||||
/* Z2SoundObject.cpp autogenerated by split.py v0.3 at 2021-01-04 23:48:52.467160 */
|
||||
|
||||
#include "Z2AudioLib/Z2SoundObject/Z2SoundObject.h"
|
||||
#include "Z2AudioLib/Z2SeMgr/Z2SeMgr.h"
|
||||
#include "global.h"
|
||||
#include "Z2AudioLib/Z2SoundInfo/Z2SoundInfo.h"
|
||||
|
||||
Z2SoundObjBase::Z2SoundObjBase() {
|
||||
//! @note initializer list doesn't work since fields were initialized out of
|
||||
//! structure layout order, indicating original code didn't use initializer list.
|
||||
mSoundPos = NULL;
|
||||
mIsInitialized = false;
|
||||
mSoundStarter = lbl_80450B74;
|
||||
field_0x1c = 0;
|
||||
field_0x1e = 0;
|
||||
}
|
||||
|
||||
Z2SoundObjBase::~Z2SoundObjBase() {
|
||||
deleteObject();
|
||||
}
|
||||
|
||||
void Z2SoundObjBase::init(Vec* pSoundPos, u8 pNumHandles) {
|
||||
initHandlesPool(pNumHandles);
|
||||
mSoundPos = pSoundPos;
|
||||
mIsInitialized = true;
|
||||
}
|
||||
|
||||
void Z2SoundObjBase::deleteObject() {
|
||||
this->dispose();
|
||||
this->deleteHandlesPool();
|
||||
}
|
||||
|
||||
void Z2SoundObjBase::framework(u32 p1, s8 p2) {
|
||||
if (mIsInitialized) {
|
||||
this->field_0x1c = p1;
|
||||
this->field_0x1e = p2;
|
||||
this->setPos(*(JGeometry::TVec3<f32>*)this->mSoundPos);
|
||||
}
|
||||
}
|
||||
|
||||
void Z2SoundObjBase::dispose() {
|
||||
JAISoundHandle* handle;
|
||||
JSULink<Z2SoundHandlePool>* link;
|
||||
for (link = this->getFirst(); link != NULL; link = link->getNext()) {
|
||||
handle = link->getObject();
|
||||
if (handle != NULL && (bool)*handle) {
|
||||
u32 swBit = lbl_80450B4C->getSwBit((*handle)->getID());
|
||||
if ((swBit & 0x8000) != 0) {
|
||||
handle->releaseSound();
|
||||
} else {
|
||||
(*handle)->stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this->mIsInitialized = false;
|
||||
}
|
||||
|
||||
bool Z2SoundObjBase::stopOK(Z2SoundHandlePool& pSoundHandlePool) {
|
||||
return !(lbl_80450B4C->getSwBit(pSoundHandlePool->getID()) & 0x8000);
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
// __ct__14Z2SoundObjBaseFv
|
||||
// Z2SoundObjBase::Z2SoundObjBase(void)
|
||||
asm void Z2SoundObjBase_NS_ctor(void) {
|
||||
nofralloc
|
||||
#include "Z2AudioLib/Z2SoundObject/asm/func_802BDEF0.s"
|
||||
}
|
||||
|
||||
// __dt__14Z2SoundObjBaseFv
|
||||
// Z2SoundObjBase::~Z2SoundObjBase(void)
|
||||
asm void Z2SoundObjBase_NS_dtor(void) {
|
||||
nofralloc
|
||||
#include "Z2AudioLib/Z2SoundObject/asm/func_802BDF48.s"
|
||||
}
|
||||
|
||||
// init__14Z2SoundObjBaseFP3VecUc
|
||||
// Z2SoundObjBase::init(Vec*, unsigned char)
|
||||
asm void Z2SoundObjBase_NS_init(void) {
|
||||
nofralloc
|
||||
#include "Z2AudioLib/Z2SoundObject/asm/func_802BDFB0.s"
|
||||
}
|
||||
|
||||
// deleteObject__14Z2SoundObjBaseFv
|
||||
// Z2SoundObjBase::deleteObject(void)
|
||||
asm void Z2SoundObjBase_NS_deleteObject(void) {
|
||||
nofralloc
|
||||
#include "Z2AudioLib/Z2SoundObject/asm/func_802BDFF8.s"
|
||||
}
|
||||
|
||||
// framework__14Z2SoundObjBaseFUlSc
|
||||
// Z2SoundObjBase::framework(unsigned long, char)
|
||||
asm void Z2SoundObjBase_NS_framework(void) {
|
||||
nofralloc
|
||||
#include "Z2AudioLib/Z2SoundObject/asm/func_802BE038.s"
|
||||
}
|
||||
|
||||
// dispose__14Z2SoundObjBaseFv
|
||||
// Z2SoundObjBase::dispose(void)
|
||||
asm void func_802BE070(void) {
|
||||
nofralloc
|
||||
#include "Z2AudioLib/Z2SoundObject/asm/func_802BE070.s"
|
||||
}
|
||||
|
||||
// stopOK__14Z2SoundObjBaseFR17Z2SoundHandlePool
|
||||
// Z2SoundObjBase::stopOK(Z2SoundHandlePool&)
|
||||
asm void func_802BE104(void) {
|
||||
nofralloc
|
||||
#include "Z2AudioLib/Z2SoundObject/asm/func_802BE104.s"
|
||||
}
|
||||
|
||||
// startSound__14Z2SoundObjBaseF10JAISoundIDUlSc
|
||||
// Z2SoundObjBase::startSound(JAISoundID, unsigned long, char)
|
||||
asm void Z2SoundObjBase_NS_startSound(void) {
|
||||
@@ -90,7 +97,7 @@ asm void func_802BE5FC(void) {
|
||||
|
||||
// init__21Z2DopplerSoundObjBaseFP3VecUc
|
||||
// Z2DopplerSoundObjBase::init(Vec*, unsigned char)
|
||||
asm void func_802BE65C(void) {
|
||||
asm void init__21Z2DopplerSoundObjBaseFP3VecUc(Vec* pSoundPos, u8 pNumHandles) {
|
||||
nofralloc
|
||||
#include "Z2AudioLib/Z2SoundObject/asm/func_802BE65C.s"
|
||||
}
|
||||
@@ -123,12 +130,24 @@ asm void Z2SoundObjSimple(void) {
|
||||
#include "Z2AudioLib/Z2SoundObject/asm/func_802BE844.s"
|
||||
}
|
||||
|
||||
#ifdef NONMATCHING
|
||||
// init__16Z2SoundObjSimpleFP3VecUc
|
||||
// Z2SoundObjSimple::init(Vec*, unsigned char)
|
||||
asm void func_802BE880(void) {
|
||||
void Z2SoundObjSimple::init(Vec* pSoundPos, u8 pNumHandles) {
|
||||
// i would write
|
||||
// Z2SoundObjBase::init(pSoundPos, pNumHandles);
|
||||
// but MWCC says "illegal use of non-static member"
|
||||
// was calling like this not in C++98?
|
||||
|
||||
// and this doesn't match
|
||||
((Z2SoundObjBase*)this)->init(pSoundPos, pNumHandles);
|
||||
}
|
||||
#else
|
||||
asm void Z2SoundObjSimple::init(Vec* pSoundPos, u8 pNumHandles) {
|
||||
nofralloc
|
||||
#include "Z2AudioLib/Z2SoundObject/asm/func_802BE880.s"
|
||||
}
|
||||
#endif
|
||||
|
||||
// startSound__16Z2SoundObjSimpleF10JAISoundIDUlSc
|
||||
// Z2SoundObjSimple::startSound(JAISoundID, unsigned long, char)
|
||||
|
||||
Reference in New Issue
Block a user