some progress on ScenarioSelectStar.o

This commit is contained in:
Joshua Andrew 2023-09-12 23:30:04 -04:00
parent 7fe7153389
commit 19c47fdcb5
13 changed files with 248 additions and 24 deletions

View File

@ -64,7 +64,7 @@ def main(compile_non_matching, use_ninja, clean_ninja, link):
isNotWindows = os.name != "nt"
flags = "-c -Cpp_exceptions off -nodefaults -proc gekko -fp hard -lang=c++ -ipa file -inline auto -O4,s -rtti off -sdata 4 -sdata2 4 -align powerpc -enum int -msgstyle gcc "
flags = "-c -Cpp_exceptions off -nodefaults -proc gekko -fp hard -lang=c++ -ipa file -inline auto,level=2 -O4,s -rtti off -sdata 4 -sdata2 4 -align powerpc -enum int -msgstyle gcc "
includes = "-i . -I- -i include "
default_compiler_path = pathlib.Path("GC/3.0a3/")

View File

@ -1212,18 +1212,18 @@ getNearestParam__8RailPartCFRCQ29JGeometry8TVec3<f>f,RailPart.o,Map.a,true
set__14LinearRailPartFRCQ29JGeometry8TVec3<f>RCQ29JGeometry8TVec3<f>,RailPart.o,Map.a,true
getNearestParam__14LinearRailPartCFRCQ29JGeometry8TVec3<f>f,RailPart.o,Map.a,false
__dt__15MultiSceneActorFv,ScenarioSelectStar.o,Map.a,false
__ct__18ScenarioSelectStarFP12EffectSystem,ScenarioSelectStar.o,Map.a,false
__ct__18ScenarioSelectStarFP12EffectSystem,ScenarioSelectStar.o,Map.a,true
init__18ScenarioSelectStarFRC12JMapInfoIter,ScenarioSelectStar.o,Map.a,false
calcViewAndEntry__18ScenarioSelectStarFv,ScenarioSelectStar.o,Map.a,false
appear__18ScenarioSelectStarFv,ScenarioSelectStar.o,Map.a,false
calcViewAndEntry__18ScenarioSelectStarFv,ScenarioSelectStar.o,Map.a,true
appear__18ScenarioSelectStarFv,ScenarioSelectStar.o,Map.a,true
kill__18ScenarioSelectStarFv,ScenarioSelectStar.o,Map.a,false
tryPointing__18ScenarioSelectStarFv,ScenarioSelectStar.o,Map.a,false
tryPointing__18ScenarioSelectStarFv,ScenarioSelectStar.o,Map.a,true
select__18ScenarioSelectStarFv,ScenarioSelectStar.o,Map.a,false
notSelect__18ScenarioSelectStarFv,ScenarioSelectStar.o,Map.a,false
isAppearEnd__18ScenarioSelectStarCFv,ScenarioSelectStar.o,Map.a,false
setup__18ScenarioSelectStarFliRCQ29JGeometry8TVec3<f>l,ScenarioSelectStar.o,Map.a,false
control__18ScenarioSelectStarFv,ScenarioSelectStar.o,Map.a,false
tryEndPointing__18ScenarioSelectStarFv,ScenarioSelectStar.o,Map.a,false
isAppearEnd__18ScenarioSelectStarCFv,ScenarioSelectStar.o,Map.a,true
setup__18ScenarioSelectStarFliRCQ29JGeometry8TVec3<f>l,ScenarioSelectStar.o,Map.a,true
control__18ScenarioSelectStarFv,ScenarioSelectStar.o,Map.a,true
tryEndPointing__18ScenarioSelectStarFv,ScenarioSelectStar.o,Map.a,true
updatePos__18ScenarioSelectStarFv,ScenarioSelectStar.o,Map.a,false
exeAppear__18ScenarioSelectStarFv,ScenarioSelectStar.o,Map.a,false
exeNotPointing__18ScenarioSelectStarFv,ScenarioSelectStar.o,Map.a,false

1 Symbol Name Object File Library Archive Matching
1212 set__14LinearRailPartFRCQ29JGeometry8TVec3<f>RCQ29JGeometry8TVec3<f> RailPart.o Map.a true
1213 getNearestParam__14LinearRailPartCFRCQ29JGeometry8TVec3<f>f RailPart.o Map.a false
1214 __dt__15MultiSceneActorFv ScenarioSelectStar.o Map.a false
1215 __ct__18ScenarioSelectStarFP12EffectSystem ScenarioSelectStar.o Map.a false true
1216 init__18ScenarioSelectStarFRC12JMapInfoIter ScenarioSelectStar.o Map.a false
1217 calcViewAndEntry__18ScenarioSelectStarFv ScenarioSelectStar.o Map.a false true
1218 appear__18ScenarioSelectStarFv ScenarioSelectStar.o Map.a false true
1219 kill__18ScenarioSelectStarFv ScenarioSelectStar.o Map.a false
1220 tryPointing__18ScenarioSelectStarFv ScenarioSelectStar.o Map.a false true
1221 select__18ScenarioSelectStarFv ScenarioSelectStar.o Map.a false
1222 notSelect__18ScenarioSelectStarFv ScenarioSelectStar.o Map.a false
1223 isAppearEnd__18ScenarioSelectStarCFv ScenarioSelectStar.o Map.a false true
1224 setup__18ScenarioSelectStarFliRCQ29JGeometry8TVec3<f>l ScenarioSelectStar.o Map.a false true
1225 control__18ScenarioSelectStarFv ScenarioSelectStar.o Map.a false true
1226 tryEndPointing__18ScenarioSelectStarFv ScenarioSelectStar.o Map.a false true
1227 updatePos__18ScenarioSelectStarFv ScenarioSelectStar.o Map.a false
1228 exeAppear__18ScenarioSelectStarFv ScenarioSelectStar.o Map.a false
1229 exeNotPointing__18ScenarioSelectStarFv ScenarioSelectStar.o Map.a false

View File

@ -1,6 +1,6 @@
{
"schemaVersion": 1,
"label": "Game",
"message": "11.498%",
"message": "11.524%",
"color": "blue"
}

View File

@ -1,6 +1,6 @@
{
"schemaVersion": 1,
"label": "Map",
"message": "16.35%",
"message": "16.858%",
"color": "silver"
}

View File

@ -11,7 +11,7 @@
| [GameAudio](https://github.com/shibbo/Petari/blob/master/docs/lib/GameAudio.md) | 0.0% |
| [Gravity](https://github.com/shibbo/Petari/blob/master/docs/lib/Gravity.md) | 56.816792337477075% |
| [LiveActor](https://github.com/shibbo/Petari/blob/master/docs/lib/LiveActor.md) | 41.44767173812817% |
| [Map](https://github.com/shibbo/Petari/blob/master/docs/lib/Map.md) | 16.35006406328338% |
| [Map](https://github.com/shibbo/Petari/blob/master/docs/lib/Map.md) | 16.858856516814292% |
| [MapObj](https://github.com/shibbo/Petari/blob/master/docs/lib/MapObj.md) | 24.973738676429292% |
| [NameObj](https://github.com/shibbo/Petari/blob/master/docs/lib/NameObj.md) | 30.427688079697695% |
| [NPC](https://github.com/shibbo/Petari/blob/master/docs/lib/NPC.md) | 2.155878467635403% |

View File

@ -69,7 +69,7 @@
| [RailGraphIter.o](https://github.com/shibbo/Petari/blob/master/docs/lib/Map/RailGraphIter.md) | 100.0% | 15 / 15 | 100.0% | :white_check_mark:
| [RailGraphNode.o](https://github.com/shibbo/Petari/blob/master/docs/lib/Map/RailGraphNode.md) | 100.0% | 1 / 1 | 100.0% | :white_check_mark:
| [RailPart.o](https://github.com/shibbo/Petari/blob/master/docs/lib/Map/RailPart.md) | 81.33333333333333% | 11 / 12 | 91.66666666666666% | :eight_pointed_black_star:
| [ScenarioSelectStar.o](https://github.com/shibbo/Petari/blob/master/docs/lib/Map/ScenarioSelectStar.md) | 0.0% | 0 / 37 | 0.0% | :x:
| [ScenarioSelectStar.o](https://github.com/shibbo/Petari/blob/master/docs/lib/Map/ScenarioSelectStar.md) | 35.44631306597672% | 8 / 37 | 21.62162162162162% | :eight_pointed_black_star:
| [SeaGull.o](https://github.com/shibbo/Petari/blob/master/docs/lib/Map/SeaGull.md) | 54.52127659574468% | 17 / 20 | 85.0% | :eight_pointed_black_star:
| [Sky.o](https://github.com/shibbo/Petari/blob/master/docs/lib/Map/Sky.md) | 97.39696312364426% | 19 / 20 | 95.0% | :eight_pointed_black_star:
| [SleepController.o](https://github.com/shibbo/Petari/blob/master/docs/lib/Map/SleepController.md) | 0.0% | 0 / 3 | 0.0% | :x:

View File

@ -5,23 +5,23 @@
| :white_check_mark: | Function is completed.
# 0 / 37 Completed -- (0.0%)
# 8 / 37 Completed -- (21.62162162162162%)
# ScenarioSelectStar.o
| Symbol | Decompiled? |
| ------------- | ------------- |
| `__dt__15MultiSceneActorFv` | :x: |
| `__ct__18ScenarioSelectStarFP12EffectSystem` | :x: |
| `__ct__18ScenarioSelectStarFP12EffectSystem` | :white_check_mark: |
| `init__18ScenarioSelectStarFRC12JMapInfoIter` | :x: |
| `calcViewAndEntry__18ScenarioSelectStarFv` | :x: |
| `appear__18ScenarioSelectStarFv` | :x: |
| `calcViewAndEntry__18ScenarioSelectStarFv` | :white_check_mark: |
| `appear__18ScenarioSelectStarFv` | :white_check_mark: |
| `kill__18ScenarioSelectStarFv` | :x: |
| `tryPointing__18ScenarioSelectStarFv` | :x: |
| `tryPointing__18ScenarioSelectStarFv` | :white_check_mark: |
| `select__18ScenarioSelectStarFv` | :x: |
| `notSelect__18ScenarioSelectStarFv` | :x: |
| `isAppearEnd__18ScenarioSelectStarCFv` | :x: |
| `setup__18ScenarioSelectStarFliRCQ29JGeometry8TVec3<f>l` | :x: |
| `control__18ScenarioSelectStarFv` | :x: |
| `tryEndPointing__18ScenarioSelectStarFv` | :x: |
| `isAppearEnd__18ScenarioSelectStarCFv` | :white_check_mark: |
| `setup__18ScenarioSelectStarFliRCQ29JGeometry8TVec3<f>l` | :white_check_mark: |
| `control__18ScenarioSelectStarFv` | :white_check_mark: |
| `tryEndPointing__18ScenarioSelectStarFv` | :white_check_mark: |
| `updatePos__18ScenarioSelectStarFv` | :x: |
| `exeAppear__18ScenarioSelectStarFv` | :x: |
| `exeNotPointing__18ScenarioSelectStarFv` | :x: |

View File

@ -0,0 +1,52 @@
#pragma once
#include "Game/Scene/MultiSceneActor.h"
#include "Game/MapObj/PowerStar.h"
class ScenarioSelectStar : public MultiSceneActor {
public:
ScenarioSelectStar(EffectSystem *);
virtual ~ScenarioSelectStar();
virtual void init(const JMapInfoIter &);
virtual void calcViewAndEntry();
virtual void appear();
virtual void kill();
virtual void control();
void tryPointing();
void select();
void notSelect();
bool isAppearEnd() const;
void setup(s32, int, const TVec3f &, s32);
bool tryEndPointing();
void updatePos();
void exeAppear();
void exeNotPointing();
void exePointing();
void exeEndPointing();
void exeSelected();
void exeSelectedMove();
void exeNotSelected();
int _44;
s32 mFrame; // _48
s32 _4C;
u8 _50;
f32 _54;
s32 _58;
TVec3f _5C;
TVec3f _68;
int _74;
f32 _78;
};
namespace NrvScenarioSelectStar {
NERVE_DECL(ScenarioSelectStarNrvAppear, ScenarioSelectStar, ScenarioSelectStar::exeAppear);
NERVE_DECL(ScenarioSelectStarNrvNotPointing, ScenarioSelectStar, ScenarioSelectStar::exeNotPointing);
NERVE_DECL(ScenarioSelectStarNrvPointing, ScenarioSelectStar, ScenarioSelectStar::exePointing);
NERVE_DECL(ScenarioSelectStarNrvEndPointing, ScenarioSelectStar, ScenarioSelectStar::exeEndPointing);
NERVE_DECL(ScenarioSelectStarNrvSelected, ScenarioSelectStar, ScenarioSelectStar::exeSelected);
NERVE_DECL(ScenarioSelectStarNrvSelectedMove, ScenarioSelectStar, ScenarioSelectStar::exeSelectedMove);
NERVE_DECL(ScenarioSelectStarNrvNotSelected, ScenarioSelectStar, ScenarioSelectStar::exeNotSelected);
};

View File

@ -9,7 +9,10 @@ class MultiSceneActor : public NameObj {
public:
MultiSceneActor(const char *, const char *, bool);
virtual ~MultiSceneActor();
virtual ~MultiSceneActor() {
}
virtual void init(const JMapInfoIter &);
virtual void movement();
virtual void calcAnim();
@ -31,4 +34,30 @@ public:
EffectSystem* mEffectSystem; // _38
MultiSceneEffectKeeper* mEffectKeeper; // _3C
Spine* mNerve; // _40
};
class MultiScene {
public:
static void startBck(MultiSceneActor *, const char *);
static void startBtk(MultiSceneActor *, const char *);
static void startBtp(MultiSceneActor *, const char *);
static void startBva(MultiSceneActor *, const char *);
static void setBtpFrameAndStop(MultiSceneActor *, f32);
static void setBvaFrameAndStop(MultiSceneActor *, f32);
static bool isBckStopped(MultiSceneActor *);
static bool isStep(const MultiSceneActor *, s32);
static bool isFirstStep(const MultiSceneActor *);
static bool isGreaterStep(const MultiSceneActor *, s32);
static bool isLessStep(const MultiSceneActor *, s32);
static bool isLessEqualStep(const MultiSceneActor *, s32);
static void setNerveAtStep(MultiSceneActor *, const Nerve *, s32);
static void setNerveAtBckStopped(MultiSceneActor *, const Nerve *);
static f32 calcNerveRate(const MultiSceneActor *, s32);
static f32 calcNerveRate(const MultiSceneActor *, s32, s32);
static f32 calcNerveEaseOutRate(const MultiSceneActor *, s32);
static f32 calcNerveValue(const MultiSceneActor *, s32, f32, f32);
static void emitEffect(const MultiSceneActor *, const char *);
static void deleteEffectAll(const MultiSceneActor *);
static void forceDeleteEffectAll(const MultiSceneActor *);
static MtxPtr getJointMtx(const MultiSceneActor *, const char *);
};

View File

@ -3,6 +3,7 @@
#include <cmath>
#include <revolution.h>
#include "JSystem/JGeometry.h"
#include <JSystem/JMath/JMATrigonometric.h>
static f32 minDegree = 0.0f;
static f32 maxDegree = 360.0f;
@ -232,6 +233,11 @@ namespace MR {
return a1 + (f32)fmod(a3 + a2, a3);
}
inline f32 modAndSubtract(f32 a1, f32 a3, f32 a4) {
f32 mod = fmod((a3 + (a1 - a4)), a3);
return a4 + mod;
}
inline f32 add(f32 lhs, f32 rhs) {
return lhs + rhs;
}
@ -265,7 +271,24 @@ namespace MR {
}
f32 cos(f32);
f32 sin(f32);
f32 sin(f32 val) {
/*f32 res;
if (val < 0.0f) {
res = -JMath::sSinCosTable.sinShort(-2607.5945f * val);
}
else {
res = JMath::sSinCosTable.sinShort(2607.5945f * val);
}
return res;*/
return JMath::sSinCosTable.sinLap(val);
}
inline f32 sin_inline(f32 val) {
return JMath::sSinCosTable.sinLap(val);
}
};
f32 PSVECKillElement(const Vec *, const Vec *, const Vec *);

View File

@ -23,6 +23,17 @@ namespace JMath
f32 sinShort(s8 v) const { return table[static_cast<u8>(v) >> 3].a1; }
f32 cosShort(s8 v) const { return table[static_cast<u8>(v) >> 3].b1; }
inline f32 sinLap(f32 v) {
if (v < 0.0f) {
v *= -2607.5945f;
return -table[(u16)v & 0x3FFF].a1;
}
else {
v *= 2607.5945f;
return table[(u16)v & 0x3FFF].a1;
}
}
};
template<s32 Len, typename T>

BIN
prog.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

@ -0,0 +1,109 @@
#include "Game/Map/ScenarioSelectStar.h"
#include "Game/MapObj/PowerStar.h"
#include "Game/Util.h"
#include <JSystem/JMath/JMATrigonometric.h>
ScenarioSelectStar::ScenarioSelectStar(EffectSystem *pSystem) : MultiSceneActor("シナリオ選択のスター", "PowerStar", false),
_44(0), mFrame(1), _4C(0), _50(0), _54(0.0f), _5C(gZeroVec), _68(gZeroVec) {
_74 = 60;
_78 = 1.0f;
initEffect(pSystem, 0, "ScenarioStar");
}
void ScenarioSelectStar::init(const JMapInfoIter &rIter) {
initNerve(&NrvScenarioSelectStar::ScenarioSelectStarNrvNotPointing::sInstance);
}
void ScenarioSelectStar::calcViewAndEntry() {
if (isNerve(&NrvScenarioSelectStar::ScenarioSelectStarNrvAppear::sInstance) || !MultiScene::isLessEqualStep(this, _74 + 1)) {
MultiSceneActor::calcViewAndEntry();
}
}
void ScenarioSelectStar::appear() {
mScale.x = 0.89999998f;
mScale.y = 0.89999998f;
mScale.z = 0.89999998f;
_50 = 0;
_54 = 0.0f;
updatePos();
MultiScene::startBtp(this, "PowerStar");
MultiScene::startBva(this, "PowerStar");
MultiScene::setBtpFrameAndStop(this, PowerStar::getBtpFrameCurrentStage(mFrame));
MultiScene::setBvaFrameAndStop(this, _44 == 0 ? 1.0f : 0.0f);
MultiSceneActor::appear();
setNerve(&NrvScenarioSelectStar::ScenarioSelectStarNrvAppear::sInstance);
}
void ScenarioSelectStar::kill() {
MultiScene::forceDeleteEffectAll(this);
MultiSceneActor::kill();
}
void ScenarioSelectStar::tryPointing() {
_50 = 1;
if (isNerve(&NrvScenarioSelectStar::ScenarioSelectStarNrvNotPointing::sInstance) || isNerve(&NrvScenarioSelectStar::ScenarioSelectStarNrvEndPointing::sInstance)) {
setNerve(&NrvScenarioSelectStar::ScenarioSelectStarNrvPointing::sInstance);
}
}
void ScenarioSelectStar::select() {
setNerve(&NrvScenarioSelectStar::ScenarioSelectStarNrvSelected::sInstance);
}
void ScenarioSelectStar::notSelect() {
setNerve(&NrvScenarioSelectStar::ScenarioSelectStarNrvNotSelected::sInstance);
}
bool ScenarioSelectStar::isAppearEnd() const {
bool ret = false;
if (!_30 && !isNerve(&NrvScenarioSelectStar::ScenarioSelectStarNrvAppear::sInstance)) {
ret = true;
}
return ret;
}
void ScenarioSelectStar::setup(s32 a1, int a2, const TVec3f &a3, s32 a4) {
_44 = a2;
mFrame = a1;
_5C.set(a3);
_4C = a4;
mRotation.set(0.0f, 0.0f, (150.0f * a4));
int v7 = _4C;
_74 = 15 * v7 + 60;
_58 = 15 * v7 + ((v7 % 2) ? 0 : 0x5A);
}
void ScenarioSelectStar::control() {
_50 = 0;
mRotation.z = MR::modAndSubtract(mRotation.z + _54, 360.0f, 0.0f);
if (isNerve(&NrvScenarioSelectStar::ScenarioSelectStarNrvNotPointing::sInstance)
|| isNerve(&NrvScenarioSelectStar::ScenarioSelectStarNrvPointing::sInstance)
|| isNerve(&NrvScenarioSelectStar::ScenarioSelectStarNrvEndPointing::sInstance)) {
_58++;
updatePos();
}
}
bool ScenarioSelectStar::tryEndPointing() {
if (!_50) {
setNerve(&NrvScenarioSelectStar::ScenarioSelectStarNrvEndPointing::sInstance);
return true;
}
return false;
}
/*
void ScenarioSelectStar::updatePos() {
f32 mod = MR::modAndSubtract(360.0f * (_58 / 180.0f), 360.0f, 0.0f);
//f32 val = MR::sin_inline(mod);
_58 = mod;
}
*/