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 93b0857 commit cc54d21
Show file tree
Hide file tree
Showing 8 changed files with 253 additions and 240 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
58 changes: 29 additions & 29 deletions config/implemented.csv
Original file line number Diff line number Diff line change
Expand Up @@ -126,43 +126,43 @@ 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::EnemyEclInstr::ExInsCirnoRainbowBallJank
th06::EnemyEclInstr::ExInsShootAtRandomArea
th06::EnemyEclInstr::ExInsShootStarPattern
th06::EnemyEclInstr::ExInsPatchouliShottypeSetVars
th06::EnemyEclInstr::ExInsStage56Func4
th06::EnemyEclInstr::ExInsStage5Func5
th06::EnemyEclInstr::ExInsStage6XFunc6
th06::EnemyEclInstr::ExInsStage6Func7
th06::EnemyEclInstr::ExInsStage6Func8
th06::EnemyEclInstr::ExInsStage6Func9
th06::EnemyEclInstr::ExInsStage6Func11
th06::EnemyEclInstr::ExInsStage6XFunc10
th06::EnemyEclInstr::ExInsStage4Func12
th06::EnemyEclInstr::ExInsStageXFunc13
th06::EnemyEclInstr::ExInsStageXFunc14
th06::EnemyEclInstr::ExInsStageXFunc15
th06::EnemyEclInstr::ExInsStageXFunc16
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
th06::Enemy::Despawn
th06::Enemy::ResetEffectArray
th06::Enemy::UpdateEffects
th06::Enemy::ExInsCirnoRainbowBallJank
th06::Enemy::ExInsShootAtRandomArea
th06::Enemy::ExInsShootStarPattern
th06::Enemy::ExInsPatchouliShottypeSetVars
th06::Enemy::ExInsStage56Func4
th06::Enemy::ExInsStage5Func5
th06::Enemy::ExInsStage6XFunc6
th06::Enemy::ExInsStage6Func7
th06::Enemy::ExInsStage6Func8
th06::Enemy::ExInsStage6Func9
th06::Enemy::ExInsStage6Func11
th06::Enemy::ExInsStage6XFunc10
th06::Enemy::ExInsStage4Func12
th06::Enemy::ExInsStageXFunc13
th06::Enemy::ExInsStageXFunc14
th06::Enemy::ExInsStageXFunc15
th06::Enemy::ExInsStageXFunc16
th06::GameErrorContext::Fatal
th06::GameErrorContext::Log
th06::GameErrorContext::Flush
Expand Down
6 changes: 3 additions & 3 deletions objdiff.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,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 cc54d21

Please sign in to comment.