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:
Erin Moon
2021-01-21 23:16:51 -05:00
committed by GitHub
co-authored by Pheenoh notyourav
parent afb426c60c
commit a072e71c33
595 changed files with 1228 additions and 9009 deletions
@@ -0,0 +1,6 @@
#ifndef JAIAUDIENCE_H_
#define JAIAUDIENCE_H_
struct JAIAudience {};
#endif // JAIAUDIENCE_H_
-5
View File
@@ -3,9 +3,4 @@
#include "global.h"
struct JAISoundID {
u32 soundId;
JAISoundID(JAISoundID const& soundIdToSet);
};
#endif
+147
View File
@@ -0,0 +1,147 @@
#ifndef __JAISOUND_H__
#define __JAISOUND_H__
#include "global.h"
class JAISoundID {
public:
operator u32() const { return this->mId; }
JAISoundID(u32 pId) : mId(pId) {}
JAISoundID(JAISoundID const& other);
private:
u32 mId;
};
struct JAISoundParams {
float field_0x0;
float field_0x4;
float field_0x8;
float field_0xc;
float field_0x10;
float field_0x14;
float field_0x18;
float field_0x1c;
};
class JAISoundHandle;
class JAIAudible;
class JAIAudience;
class JAISound {
public:
JAISoundID getID() const { return JAISoundID((u32)this->sound_id); }
void stop(u32 fadeout);
void stop();
u32 getUserData() const { return user_data; }
// TODO: do proper struct later
void* __vt;
struct JAISoundHandle* handle;
struct JAIAudible* audible;
struct JAIAudience* audience;
s32 field_0xc;
s32 num_prepare_steps;
struct JAISoundID sound_id;
u8 field_0x18;
u8 field_0x19;
u8 field_0x1a;
u8 field_0x1b;
u32 user_data;
float field_0x20;
float field_0x24;
float field_0x28;
s32 field_0x2c;
s32 audience_priority;
s32 field_0x34;
struct JAISoundParams params;
u8 field_0x58;
u8 field_0x59;
u8 field_0x5a;
u8 field_0x5b;
u8 field_0x5c;
u8 field_0x5d;
u8 field_0x5e;
u8 field_0x5f;
u8 field_0x60;
u8 field_0x61;
u8 field_0x62;
u8 field_0x63;
u8 field_0x64;
u8 field_0x65;
u8 field_0x66;
u8 field_0x67;
u8 field_0x68;
u8 field_0x69;
u8 field_0x6a;
u8 field_0x6b;
u8 field_0x6c;
u8 field_0x6d;
u8 field_0x6e;
u8 field_0x6f;
u8 field_0x70;
u8 field_0x71;
u8 field_0x72;
u8 field_0x73;
u8 field_0x74;
u8 field_0x75;
u8 field_0x76;
u8 field_0x77;
u8 field_0x78;
u8 field_0x79;
u8 field_0x7a;
u8 field_0x7b;
u8 field_0x7c;
u8 field_0x7d;
u8 field_0x7e;
u8 field_0x7f;
u8 field_0x80;
u8 field_0x81;
u8 field_0x82;
u8 field_0x83;
u8 field_0x84;
u8 field_0x85;
u8 field_0x86;
u8 field_0x87;
u8 field_0x88;
u8 field_0x89;
u8 field_0x8a;
u8 field_0x8b;
u8 field_0x8c;
u8 field_0x8d;
u8 field_0x8e;
u8 field_0x8f;
u8 field_0x90;
u8 field_0x91;
u8 field_0x92;
u8 field_0x93;
};
extern "C" {
void stop__8JAISoundFUl(JAISound*, u32 fadeout);
void stop__8JAISoundFv(JAISound*);
}
class JAISoundHandle {
public:
JAISoundHandle(); // noninline in JAUClusterSound.cpp
bool isSoundAttached() const { return mSound != NULL; }
JAISound* operator->() const {
JUT_ASSERT(mSound != NULL);
return mSound;
}
operator bool() const { return isSoundAttached(); }
void releaseSound();
private:
JAISound* mSound;
};
#endif
@@ -0,0 +1,11 @@
#ifndef JAISOUNDHANDLES_H_
#define JAISOUNDHANDLES_H_
#include "JSystem/JAudio2/JAISound/JAISound.h"
class JAISoundHandles {
public:
JAISoundHandle mHandles[24];
};
#endif // JAISOUNDHANDLES_H_
@@ -0,0 +1,22 @@
#ifndef __JASGADGET_H__
#define __JASGADGET_H__
//! @todo figure out *GlobalInstance singleton handlers once we can properly place statics.
/*
template <typename T>
class JASGlobalInstance {
public:
JASGlobalInstance(bool p1) {
JASGlobalInstance<T> pJVar1;
if ((p1 == true) && (sInstance != NULL)) {
// assert
pJVar1 = this;
}
sInstance = pJVar1;
}
private:
static T sInstance;
}; */
#endif
@@ -0,0 +1,6 @@
#ifndef JAUAUDIOARCLOADER_H_
#define JAUAUDIOARCLOADER_H_
struct JAUSection; // goes in JAudio2.a JAUAudioArcLoader.o
#endif // JAUAUDIOARCLOADER_H_
@@ -3,10 +3,4 @@
#include "dolphin/types.h"
struct JAISoundHandle {
void* unk; // probably JAISound*
JAISoundHandle();
};
#endif