Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
ieee802dot11ac committed Jun 8, 2024
1 parent 51c5558 commit c6e5922
Show file tree
Hide file tree
Showing 11 changed files with 79 additions and 36 deletions.
2 changes: 1 addition & 1 deletion config/SZBE69_B8/objects.json
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@
"system/meta/SongPreview.cpp": "NonMatching",
"system/meta/Sorting.cpp": "Matching",
"system/meta/StoreEnumeration.cpp": "NonMatching",
"system/meta/StreamPlayer.cpp": "NonMatching",
"system/meta/StreamPlayer.cpp": "Matching",

"system/midi/DataEventList.cpp": "NonMatching",
"system/midi/MidiParser.cpp": { "status": "NonMatching", "extra_cflags": [ "-fp_contract off" ] },
Expand Down
24 changes: 23 additions & 1 deletion src/band3/bandtrack/Gem.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#include "Gem.h"
#include "beatmatch/RGUtl.h"
#include "os/Debug.h"

Gem::Gem(const GameGem& gg, unsigned int ui, float f1, float f2, bool b1, int i1, int i2, bool b2) :
mGameGem(&gg), mStart(f1), mEnd(f2), mTailStart(0), mSlots(ui), mBeardTick(i1), unk_0x3C(0),
unk_0x40(0), unk_0x44(0), unk_0x48(0), unk_0x4C(""), mFirstFretString(-1), mFretPos(0), unk_0x65(-1) {
InitChordInfo(i2, b2);
}

Gem::~Gem() { }
Gem::~Gem() { unk_0x30.clear(); }

Gem& Gem::operator=(const Gem& g) {
(GameGem&)(*mGameGem) = *(g.mGameGem);
Expand All @@ -31,7 +32,24 @@ bool Gem::OnScreen(float) {

}

bool Gem::UseRGChordStyle() const {
bool r = false;
if (unk_0x4->IsRealGuitarChord() || unk_0x67_1 || unk_0x4->IsMuted()) r = true;
return r;
}

void Gem::AddStrumInstance(Symbol s1, Symbol s2) {
if (unk_0x0 == NULL || unk_0x0->unk_0x0 == 0) return;
int lowString = unk_0x4->GetLowestString();
int highString = unk_0x4->GetHighestString();
MILO_ASSERT(lowString != -1, 572);
MILO_ASSERT(highString != -1, 573);
Symbol t0;
if (!unk_0x0->GetChordWidgetName(s1, s2, t0)) {
MILO_WARN("could not find widget for %s for %s chord gem in %s", t0, s1, s2);
return;
}
}

void Gem::Miss() { }

Expand All @@ -47,6 +65,10 @@ void Gem::Release() {
mReleased = true;
}

void Gem::KillDuration() {
for (int i = 0; i < unk_0x30.size(); i++) unk_0x30[i]->Done();
}

void Gem::Reset() {
mHit = false;
mMissed = false;
Expand Down
5 changes: 3 additions & 2 deletions src/band3/bandtrack/Gem.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef BANDTRACK_GEM_H
#define BANDTRACK_GEM_H

#include "bandtrack/GemManager.h"
#include "bandtrack/Tail.h"
#include "beatmatch/GameGem.h"
#include "track/TrackWidget.h"
Expand Down Expand Up @@ -59,8 +60,8 @@ class Gem {
bool mHopo : 1;
bool mInvisible : 1;
bool mBeard : 1;
bool unk_0x66_6 : 1;
bool unk_0x67;
bool unk_0x66_6 : 1, unk_0x66_7 : 1;
bool unk_0x67_0 : 1, unk_0x67_1 : 1, unk_0x67_2 : 1, unk_0x67_3 : 1, unk_0x67_4 : 1, unk_0x67_5 : 1, unk_0x67_6 : 1, unk_0x67_7 : 1;
};

#endif // BANDTRACK_GEM_H
12 changes: 12 additions & 0 deletions src/band3/bandtrack/GemManager.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#ifndef BANDTRACK_GEMMANAGER_H
#define BANDTRACK_GEMMANAGER_H

#include "utl/Symbol.h"
class GemManager {
public:
bool GetChordWidgetName(class Symbol, class Symbol, class Symbol&);

int unk_0x0;
};

#endif // BANDTRACK_GEMMANAGER_H
1 change: 1 addition & 0 deletions src/band3/bandtrack/Tail.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class Tail {
public:
void Hit();
void Release();
void Done();
};

#endif // BANDTRACK_TAIL_H
31 changes: 22 additions & 9 deletions src/band3/meta_band/Asset.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
#include "Asset.h"

#include "system/os/Debug.h"

Asset::Asset(DataArray*, int) {

#include "utl/Symbol.h"
#include "utl/Symbols3.h"

Asset::Asset(DataArray* pConfig, int i) : mName(gNullStr), unk_0x8(0), unk_0xC(0), unk_0x10(0), unk_0x1C(0),
unk_0x1D(0), unk_0x20(i) {
MILO_ASSERT(pConfig, 21);
mName = pConfig->Sym(0);
Symbol s(gNullStr);
pConfig->FindData(gender, s, false);
{
MILO_WARN("(%s) should not have \"finishes\" in ui/customize/assets.dta");
}
}

Asset::~Asset() {
Expand All @@ -14,16 +23,20 @@ Symbol Asset::GetDescription() const {
return MakeString("%s_desc", mName);
}

void Asset::HasFinishes() {

bool Asset::HasFinishes() {
return mFinishes.size() != 0;
}

void Asset::GetFinishes(std::vector<Symbol>&) const {

void Asset::GetFinishes(std::vector<Symbol>& v) const {
for (int i = 0; i < mFinishes.size(); i++) {
Symbol s = mFinishes[i];
v.push_back(s);
}
}

void Asset::GetFinish(int) const {

Symbol Asset::GetFinish(int index) const {
MILO_ASSERT(( 0) <= (index) && (index) < ( mFinishes.size()), 100);
return mFinishes[index];
}

Symbol Asset::GetHint() const {
Expand Down
9 changes: 7 additions & 2 deletions src/band3/meta_band/Asset.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,22 @@
#define METABAND_ASSET_H

#include "system/obj/Data.h"
#include "types.h"

class Asset {
Asset(DataArray*, int);
virtual ~Asset();
Symbol GetDescription() const;
void HasFinishes();
bool HasFinishes();
void GetFinishes(std::vector<Symbol>&) const;
void GetFinish(int) const;
Symbol GetFinish(int) const;
Symbol GetHint() const;

Symbol mName; // 0x04
int unk_0x8, unk_0xC, unk_0x10;
std::vector<Symbol> mFinishes; // 0x14
u8 unk_0x1C, unk_0x1D;
int unk_0x20;
};

#endif // METABAND_ASSET_H
11 changes: 6 additions & 5 deletions src/system/meta/StreamPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#include "synth/Synth.h"
#include "utl/Symbols.h"

float StreamPlayer::kStreamEndMs = -1.1920929E-7f;
int StreamPlayer::kStreamEndSamples = -1;
// float StreamPlayer::kStreamEndMs = -1.1920929E-7f;
// int StreamPlayer::kStreamEndSamples = -1;

StreamPlayer::StreamPlayer() : mMasterVol(1.0f), mStreamVol(1.0f), mLoop(0), mStarted(0), mPaused(0), mStream(0), mSongBuf(0) {

Expand All @@ -20,7 +20,7 @@ void StreamPlayer::Delete(){
}
delete mStream;
mStream = 0;
if(mSongBuf){
if(mSongBuf && mSongBuf){
delete mSongBuf;
mSongBuf = 0;
}
Expand All @@ -36,7 +36,8 @@ void StreamPlayer::PlayFile(const char* cc, float f1, float f2, bool b){
}

void StreamPlayer::Poll(){
if(mStream && !mPaused && !mStream->IsPlaying()){
if(!mStream || mPaused) return; else
{if (!mStream->IsPlaying()){
if(mStream->IsReady()){
if(!mStarted){
Init();
Expand All @@ -50,7 +51,7 @@ void StreamPlayer::Poll(){
Delete();
}
}
}
}}
}

void StreamPlayer::Init(){
Expand Down
3 changes: 3 additions & 0 deletions src/system/meta/StreamPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@ class StreamPlayer : public Hmx::Object {
void* mSongBuf;
};

float StreamPlayer::kStreamEndMs = -1.1920929E-7f;
int StreamPlayer::kStreamEndSamples = -1;

#endif
16 changes: 1 addition & 15 deletions src/system/obj/DirItr.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,7 @@ template <class T> class ObjDirItr {
operator T*(){ return mObj; }
T* operator->() { return mObj; }

void Advance() {
while (mEntry) {
mObj = mEntry->obj;
if (mEntry->obj == NULL) return;
mEntry = mSubDir->mHashTable.FirstFrom(mEntry);
}
if (mDir != NULL) {
int x = ++mWhich;
mSubDir = mDir->NextSubDir(x);
if (mSubDir) {
mEntry = mSubDir->mHashTable.FirstFrom(mEntry);
}
}
mObj = NULL;
}
void Advance();

ObjectDir* mDir;
ObjectDir* mSubDir;
Expand Down
1 change: 0 additions & 1 deletion src/system/utl/KeylessHash.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ template <class T1, class T2> class KeylessHash {
}

void Resize(int, T2*);

T2* FirstFrom(T2* entry){
for(; entry < mEntries + mSize && (*entry == mEmpty || *entry == mRemoved); entry++);
if(entry == mEntries + mSize) return 0;
Expand Down

0 comments on commit c6e5922

Please sign in to comment.