mirror of
https://github.com/zeldaret/tp
synced 2026-07-07 22:22:05 -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,19 +1,28 @@
|
||||
/* Z2SoundObjMgr.cpp autogenerated by split.py v0.3 at 2021-01-05 00:01:40.089663 */
|
||||
|
||||
#include "Z2AudioLib/Z2SoundObjMgr/Z2SoundObjMgr.h"
|
||||
#include "Z2AudioLib/Z2SeqMgr/Z2SeqMgr.h"
|
||||
#include "global.h"
|
||||
|
||||
extern "C" {
|
||||
// __ct__13Z2SoundObjMgrFv
|
||||
// Z2SoundObjMgr::Z2SoundObjMgr(void)
|
||||
asm void Z2SoundObjMgr_NS_ctor(void) {
|
||||
#ifdef NONMATCHING
|
||||
// order wrong because this needs to inherit from JASGlobalInstance<T>
|
||||
Z2SoundObjMgr::Z2SoundObjMgr() {
|
||||
lbl_80450B48 = this;
|
||||
field_0x19 = 0;
|
||||
this->mIsTwilightBattle = false;
|
||||
this->setBattleInit();
|
||||
this->setForceBattleArea(false, 700, 1100, 1500);
|
||||
}
|
||||
#else
|
||||
asm Z2SoundObjMgr::Z2SoundObjMgr() {
|
||||
nofralloc
|
||||
#include "Z2AudioLib/Z2SoundObjMgr/asm/func_802BF920.s"
|
||||
}
|
||||
#endif
|
||||
|
||||
extern "C" {
|
||||
// setForceBattleArea__13Z2SoundObjMgrFbUsUsUs
|
||||
// Z2SoundObjMgr::setForceBattleArea(bool, unsigned short, unsigned short, unsigned short)
|
||||
asm void Z2SoundObjMgr_NS_setForceBattleArea(void) {
|
||||
asm void Z2SoundObjMgr::setForceBattleArea(bool, u16, u16, u16) {
|
||||
nofralloc
|
||||
#include "Z2AudioLib/Z2SoundObjMgr/asm/func_802BF980.s"
|
||||
}
|
||||
@@ -25,11 +34,19 @@ asm void Z2SoundObjMgr_NS_searchEnemy(void) {
|
||||
#include "Z2AudioLib/Z2SoundObjMgr/asm/func_802BF994.s"
|
||||
}
|
||||
|
||||
// setGhostEnemyState__13Z2SoundObjMgrFUc
|
||||
// Z2SoundObjMgr::setGhostEnemyState(unsigned char)
|
||||
asm void Z2SoundObjMgr_NS_setGhostEnemyState(void) {
|
||||
nofralloc
|
||||
#include "Z2AudioLib/Z2SoundObjMgr/asm/func_802BFFEC.s"
|
||||
void Z2SoundObjMgr::setGhostEnemyState(u8 p1) {
|
||||
if (p1 == 0x20) {
|
||||
if (field_0x1a >= field_0x16) {
|
||||
lbl_80450B84->setBattleGhostMute(true);
|
||||
}
|
||||
} else {
|
||||
if (this->field_0x1a == false) {
|
||||
this->field_0x19 = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this->field_0x19 = p1 + (this->field_0x19 & 1);
|
||||
}
|
||||
|
||||
// getEnemyID__13Z2SoundObjMgrFPCcP26JSULink<15Z2CreatureEnemy>
|
||||
@@ -41,7 +58,7 @@ asm void Z2SoundObjMgr_NS_getEnemyID(void) {
|
||||
|
||||
// setBattleInit__13Z2SoundObjMgrFv
|
||||
// Z2SoundObjMgr::setBattleInit(void)
|
||||
asm void Z2SoundObjMgr_NS_setBattleInit(void) {
|
||||
asm void Z2SoundObjMgr::setBattleInit() {
|
||||
nofralloc
|
||||
#include "Z2AudioLib/Z2SoundObjMgr/asm/func_802C0100.s"
|
||||
}
|
||||
@@ -53,11 +70,21 @@ asm void Z2SoundObjMgr_NS_checkBattleFinish(void) {
|
||||
#include "Z2AudioLib/Z2SoundObjMgr/asm/func_802C0120.s"
|
||||
}
|
||||
|
||||
// deleteEnemyAll__13Z2SoundObjMgrFv
|
||||
// Z2SoundObjMgr::deleteEnemyAll(void)
|
||||
asm void Z2SoundObjMgr_NS_deleteEnemyAll(void) {
|
||||
nofralloc
|
||||
#include "Z2AudioLib/Z2SoundObjMgr/asm/func_802C013C.s"
|
||||
void Z2SoundObjMgr::deleteEnemyAll() {
|
||||
JSULink<Z2CreatureEnemy>* link;
|
||||
|
||||
// not moving the link pointer forward looks like a bug, but deleteObject() actually unlinks the
|
||||
// enemy from its owning list
|
||||
while (link = this->getFirst(), link != NULL) {
|
||||
Z2CreatureEnemy* enemy = link->getObject();
|
||||
if (enemy == NULL) {
|
||||
// setWarningMessage_f((JUTAssertion *)0x1,(ulong)"Z2SoundObjMgr.cpp",(char
|
||||
// *)0x16f,(int)&*fill*,
|
||||
// "[Z2SoundObjMgr::searchEnemy] remain remove enemy\n",in_r8);
|
||||
} else {
|
||||
enemy->deleteObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// removeEnemy__13Z2SoundObjMgrFP26JSULink<15Z2CreatureEnemy>
|
||||
@@ -66,14 +93,13 @@ asm void Z2SoundObjMgr_NS_removeEnemy(void) {
|
||||
nofralloc
|
||||
#include "Z2AudioLib/Z2SoundObjMgr/asm/func_802C0190.s"
|
||||
}
|
||||
};
|
||||
|
||||
// isTwilightBattle__13Z2SoundObjMgrFv
|
||||
// Z2SoundObjMgr::isTwilightBattle(void)
|
||||
asm void Z2SoundObjMgr_NS_isTwilightBattle(void) {
|
||||
nofralloc
|
||||
#include "Z2AudioLib/Z2SoundObjMgr/asm/func_802C01E4.s"
|
||||
bool Z2SoundObjMgr::isTwilightBattle() {
|
||||
return mTwilightBattle;
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
// __sinit_Z2SoundObjMgr_cpp
|
||||
//
|
||||
asm void func_802C01EC(void) {
|
||||
|
||||
Reference in New Issue
Block a user