Skip to content

Commit

Permalink
Move Enemy ECL instructions to EnemyEclInstr.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
roblabla committed Nov 19, 2024
1 parent 9ad4857 commit 5459d95
Show file tree
Hide file tree
Showing 8 changed files with 236 additions and 223 deletions.
2 changes: 1 addition & 1 deletion config/ghidra_ns_to_obj.csv
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Chain,th06::Chain,th06::ChainElem
EclManager,th06::EclManager
EffectManager,th06::EffectManager
Ending,th06::Ending
Enemy,th06::Enemy
EnemyEclInstr,th06::EnemyEclInstr
EnemyManager,th06::EnemyManager,th06::Enemy
FileAbstraction,th06::FileAbstraction
FileSystem,th06::FileSystem
Expand Down
24 changes: 12 additions & 12 deletions config/implemented.csv
Original file line number Diff line number Diff line change
Expand Up @@ -126,20 +126,20 @@ th06::EnemyManager::OnUpdate
th06::EnemyManager::OnDraw
th06::EnemyManager::RunEclTimeline
th06::EnemyManager::SpawnEnemy
th06::EnemyEclInstr::GetVar
th06::EnemyEclInstr::GetVarFloat
th06::EnemyEclInstr::SetVar
th06::EnemyEclInstr::MathAdd
th06::EnemyEclInstr::MathSub
th06::EnemyEclInstr::MathMul
th06::EnemyEclInstr::MathDiv
th06::EnemyEclInstr::MathMod
th06::EnemyEclInstr::MathAtan2
th06::EnemyEclInstr::MoveTime
th06::EnemyEclInstr::MoveDirTime
th06::EnemyEclInstr::MovePosTime
th06::Enemy::Enemy
th06::Enemy::GetVar
th06::Enemy::GetVarFloat
th06::Enemy::SetVar
th06::Enemy::MathAdd
th06::Enemy::MathSub
th06::Enemy::MathMul
th06::Enemy::MathDiv
th06::Enemy::MathMod
th06::Enemy::MathAtan2
th06::Enemy::Move
th06::Enemy::MoveTime
th06::Enemy::MoveDirTime
th06::Enemy::MovePosTime
th06::Enemy::ClampPos
th06::Enemy::HandleLifeCallback
th06::Enemy::HandleTimerCallback
Expand Down
6 changes: 3 additions & 3 deletions objdiff.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@
"reverse_fn_order": false
},
{
"name": "Enemy",
"name": "EnemyEclInstr",

"target_path": "build/objdiff/orig/Enemy.obj",
"base_path": "build/objdiff/reimpl/Enemy.obj",
"target_path": "build/objdiff/orig/EnemyEclInstr.obj",
"base_path": "build/objdiff/reimpl/EnemyEclInstr.obj",

"reverse_fn_order": false
},
Expand Down
2 changes: 1 addition & 1 deletion scripts/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def configure(build_type):
"Stage",
"BombData",
"EclManager",
"Enemy", # ECL instructions.
"EnemyEclInstr",
"EffectManager",
"Ending",
"EnemyManager",
Expand Down
205 changes: 103 additions & 102 deletions src/EclManager.cpp

Large diffs are not rendered by default.

33 changes: 0 additions & 33 deletions src/Enemy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,39 +145,6 @@ struct Enemy
static void ResetEffectArray(Enemy *enemy);
static void UpdateEffects(Enemy *enemy);

static i32 *GetVar(Enemy *enemy, EclVarId *varId, EclValueType *valueType);
static f32 *GetVarFloat(Enemy *enemy, f32 *varId, EclValueType *valueType);
static void SetVar(Enemy *enemy, EclVarId lhs, void *rhs);

static void MathAdd(Enemy *enemy, EclVarId out, EclVarId *lhs, EclVarId *rhs);
static void MathSub(Enemy *enemy, EclVarId out, EclVarId *lhs, EclVarId *rhs);
static void MathMul(Enemy *enemy, EclVarId out, EclVarId *lhs, EclVarId *rhs);
static void MathDiv(Enemy *enemy, EclVarId out, EclVarId *lhs, EclVarId *rhs);
static void MathMod(Enemy *enemy, EclVarId out, EclVarId *lhs, EclVarId *rhs);
static void MathAtan2(Enemy *enemy, EclVarId out, f32 *a1, f32 *a2, f32 *b1, f32 *b2);

static void MoveDirTime(Enemy *enemy, EclRawInstr *instr);
static void MovePosTime(Enemy *enemy, EclRawInstr *instr);
static void MoveTime(Enemy *enemy, EclRawInstr *instr);

static void ExInsCirnoRainbowBallJank(Enemy *enemy, EclRawInstr *instr);
static void ExInsShootAtRandomArea(Enemy *enemy, EclRawInstr *instr);
static void ExInsShootStarPattern(Enemy *enemy, EclRawInstr *instr);
static void ExInsPatchouliShottypeSetVars(Enemy *enemy, EclRawInstr *instr);
static void ExInsStage56Func4(Enemy *enemy, EclRawInstr *instr);
static void ExInsStage5Func5(Enemy *enemy, EclRawInstr *instr);
static void ExInsStage6XFunc6(Enemy *enemy, EclRawInstr *instr);
static void ExInsStage6Func7(Enemy *enemy, EclRawInstr *instr);
static void ExInsStage6Func8(Enemy *enemy, EclRawInstr *instr);
static void ExInsStage6Func9(Enemy *enemy, EclRawInstr *instr);
static void ExInsStage6Func11(Enemy *enemy, EclRawInstr *instr);
static void ExInsStage6XFunc10(Enemy *enemy, EclRawInstr *instr);
static void ExInsStage4Func12(Enemy *enemy, EclRawInstr *instr);
static void ExInsStageXFunc13(Enemy *enemy, EclRawInstr *instr);
static void ExInsStageXFunc14(Enemy *enemy, EclRawInstr *instr);
static void ExInsStageXFunc15(Enemy *enemy, EclRawInstr *instr);
static void ExInsStageXFunc16(Enemy *enemy, EclRawInstr *instr);

f32 LifePercent()
{
return (f32)this->life / (f32)this->maxLife;
Expand Down
Loading

0 comments on commit 5459d95

Please sign in to comment.