Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions config/S72E01/splits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1960,6 +1960,10 @@ donut/scn/step/GridPos.cpp:
donut/scn/step/boss/IState.cpp:
.text start:0x80230D3C end:0x80230D98

donut/scn/step/chara/Invincible.cpp:
.text start:0x8026EE48 end:0x8026EFA8
.rodata start:0x80417960 end:0x80417988

donut/scn/step/enemy/CustomBase.cpp:
.text start:0x80281E20 end:0x80281FBC
.data start:0x80471B80 end:0x80471BD8
Expand All @@ -1968,6 +1972,10 @@ donut/scn/step/enemy/CustomBase.cpp:
donut/scn/step/enemy/Desc.cpp:
.text start:0x802845E0 end:0x802846F0

donut/scn/step/enemy/Enemy.cpp:
.text start:0x80284898 end:0x80288214
.data start:0x80471E30 end:0x80471F00

donut/scn/step/enemy/IState.cpp:
.text start:0x80288D8C end:0x80288D8C

Expand All @@ -1979,6 +1987,10 @@ donut/scn/step/enemy/StateBase.cpp:
.text start:0x8028DDC4 end:0x8028DE48
.data start:0x80472C30 end:0x80472C50

donut/scn/step/enemy/SuperStop.cpp:
.text start:0x8028DF54 end:0x8028E0D4
.data start:0x80472C60 end:0x80472C78

donut/scn/step/enemy/damage/StateDeadInWater.cpp:
.text start:0x802AA9B4 end:0x802AAF74
.data start:0x80475D20 end:0x80475D40
Expand All @@ -2001,11 +2013,18 @@ donut/scn/step/enemy/waddledoo/ModelDesc.cpp:
donut/scn/step/block/BlockInfo.cpp:
.text start:0x80300700 end:0x80300760

donut/scn/step/hero/Guard.cpp:
.text start:0x803385F8 end:0x803386B4
.rodata start:0x80419D00 end:0x80419D50

donut/scn/step/hero/IndiviUtil.cpp:
.text start:0x803418A4 end:0x80341C74
.data start:0x80484CD0 end:0x80484D28
.sdata2 start:0x80562C10 end:0x80562C20

donut/scn/step/spstop/Manager.cpp:
.text start:0x803D0B9C end:0x803D0E90

donut/scn/vc/Loader.cpp:
.text start:0x803F2834 end:0x803F2894
.data start:0x80495548 end:0x804955F0
Expand Down
6 changes: 3 additions & 3 deletions config/S72E01/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28076,7 +28076,7 @@ lbl_804176C8 = .rodata:0x804176C8; // type:object size:0x18
lbl_804176E0 = .rodata:0x804176E0; // type:object size:0x20
lbl_80417700 = .rodata:0x80417700; // type:object size:0xA8
lbl_804177A8 = .rodata:0x804177A8; // type:object size:0x1B8
lbl_80417960 = .rodata:0x80417960; // type:object size:0x28
T_ALPHA_ANIM_TABLE__Q43scn4step5chara24@unnamed@Invincible_cpp@ = .rodata:0x80417960; // type:object size:0x28
lbl_80417988 = .rodata:0x80417988; // type:object size:0x10
lbl_80417998 = .rodata:0x80417998; // type:object size:0x10
lbl_804179A8 = .rodata:0x804179A8; // type:object size:0x18
Expand Down Expand Up @@ -28178,7 +28178,7 @@ lbl_80419C68 = .rodata:0x80419C68; // type:object size:0x10
lbl_80419C78 = .rodata:0x80419C78; // type:object size:0x18
lbl_80419C90 = .rodata:0x80419C90; // type:object size:0x58
lbl_80419CE8 = .rodata:0x80419CE8; // type:object size:0x18
lbl_80419D00 = .rodata:0x80419D00; // type:object size:0x50
T_ALPHA_TABLE__19@unnamed@Guard_cpp@ = .rodata:0x80419D00; // type:object size:0x50
lbl_80419D50 = .rodata:0x80419D50; // type:object size:0x50 data:4byte
lbl_80419DA0 = .rodata:0x80419DA0; // type:object size:0x240
lbl_80419FE0 = .rodata:0x80419FE0; // type:object size:0x30
Expand Down Expand Up @@ -31868,7 +31868,7 @@ lbl_804726D8 = .data:0x804726D8; // type:object size:0x540
lbl_80472C18 = .data:0x80472C18; // type:object size:0x18
__vt__Q43scn4step5enemy9StateBase = .data:0x80472C30; // type:object size:0x20
lbl_80472C50 = .data:0x80472C50; // type:object size:0x10
lbl_80472C60 = .data:0x80472C60; // type:object size:0x18
__vt__Q43scn4step5enemy9SuperStop = .data:0x80472C60; // type:object size:0x18
jumptable_80472C78 = .data:0x80472C78; // type:object size:0x28 scope:local
jumptable_80472CA0 = .data:0x80472CA0; // type:object size:0x28 scope:local
lbl_80472CC8 = .data:0x80472CC8; // type:object size:0x10
Expand Down
27 changes: 22 additions & 5 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1172,6 +1172,15 @@ def MatchingFor(*versions):
Object(Equivalent, "donut/scn/step/boss/IState.cpp", extra_cflags=["-O3,s"]),
],
},
{
"lib": "scn/step/chara",
"mw_version": config.linker_version,
"cflags": cflags_donut,
"progress_category": "donut",
"objects": [
Object(Equivalent, "donut/scn/step/chara/Invincible.cpp"),
],
},
{
"lib": "scn/step/enemy",
"mw_version": config.linker_version,
Expand All @@ -1180,9 +1189,11 @@ def MatchingFor(*versions):
"objects": [
Object(NonMatching, "donut/scn/step/enemy/CustomBase.cpp", extra_cflags=["-O3,s"]),
Object(Equivalent, "donut/scn/step/enemy/Desc.cpp", extra_cflags=["-O3,s"]),
Object(NonMatching, "donut/scn/step/enemy/Enemy.cpp"),
Object(Equivalent, "donut/scn/step/enemy/IState.cpp", extra_cflags=["-O3,s"]),
Object(NonMatching, "donut/scn/step/enemy/Param.cpp", extra_cflags=["-O3,s"]),
Object(Equivalent, "donut/scn/step/enemy/StateBase.cpp", extra_cflags=["-O3,s"]),
Object(NonMatching, "donut/scn/step/enemy/SuperStop.cpp"),
Object(NonMatching, "donut/scn/step/enemy/damage/StateDeadInWater.cpp", extra_cflags=["-O3,s"]),

Object(Equivalent, "donut/scn/step/enemy/waddledoo/Custom.cpp", extra_cflags=["-O3,s"]),
Expand All @@ -1195,11 +1206,17 @@ def MatchingFor(*versions):
"cflags": cflags_donut,
"progress_category": "donut",
"objects": [
Object(
NonMatching,
"donut/scn/step/hero/IndiviUtil.cpp",
extra_cflags=["-O3"],
),
Object(NonMatching, "donut/scn/step/hero/Guard.cpp"),
Object(NonMatching, "donut/scn/step/hero/IndiviUtil.cpp", extra_cflags=["-O3"]),
],
},
{
"lib": "scn/step/spstop",
"mw_version": config.linker_version,
"cflags": cflags_donut,
"progress_category": "donut",
"objects": [
Object(NonMatching, "donut/scn/step/spstop/Manager.cpp", extra_cflags=["-O3,s"]),
],
},
{
Expand Down
18 changes: 14 additions & 4 deletions src/donut/scn/step/Component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,26 @@
using namespace scn::step;
using mem::ExplicitScopedPtrUtil::CheckPointerIsValid;

Component::~Component() { }
Component::~Component()
{
}

core::SphereAccessor* Component::sphereAccessor() {
core::SphereAccessor *Component::sphereAccessor()
{
return mSphereAccessor.operator->();
}

debug::GeneralDrawer* Component::debugGeneralDrawer() {
spstop::Manager *Component::superStopManager()
{
return mSuperStopManager.operator->();
}

debug::GeneralDrawer *Component::debugGeneralDrawer()
{
return mDebugGeneralDrawer.operator->();
}

debug::ObjInfoRepos* Component::debugObjInfoRepos() {
debug::ObjInfoRepos *Component::debugObjInfoRepos()
{
return mDebugObjInfoRepos.operator->();
}
19 changes: 10 additions & 9 deletions src/donut/scn/step/Component.hpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
#ifndef DONUT_SCN_STEP_COMPONENT_HPP
#define DONUT_SCN_STEP_COMPONENT_HPP

#include <hel/common/ScopedPtr.hpp>
#include "g3d/ResFileRepository.hpp"
#include "scn/step/Context.hpp"
#include "scn/step/core/SphereAccessor.hpp"
#include "scn/step/debug/ShowGrid.hpp"
#include "scn/step/debug/ShowPegFrame.hpp"
#include "scn/step/debug/GeneralDrawer.hpp"
#include "scn/step/debug/ObjInfoRepos.hpp"
#include "scn/step/map/DataFile.hpp"
#include "scn/step/debug/ShowGrid.hpp"
#include "scn/step/debug/ShowPegFrame.hpp"
#include "scn/step/hero/Manager.hpp"
#include "g3d/ResFileRepository.hpp"
#include "scn/step/map/DataFile.hpp"
#include "scn/step/spstop/Manager.hpp"
#include <hel/common/ScopedPtr.hpp>

// clang-format off

namespace scn { namespace step {
namespace core {
Expand All @@ -36,10 +39,6 @@ namespace scn { namespace step {
class Manager { };
}

namespace spstop {
class Manager { };
}

namespace sfx {
class BGFade { };
class ScreenFade { };
Expand Down Expand Up @@ -209,4 +208,6 @@ class Component {

}}

// clang-format on

#endif
97 changes: 97 additions & 0 deletions src/donut/scn/step/chara/Invincible.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
#include "scn/step/chara/Invincible.hpp"

using namespace scn::step::chara;

Invincible::Invincible()
{
mInvincibleFrames = 0;
mFlashCycle = 0;
mUsingIntangibleMove = 0;
mIsCandyActive = 0;
}

void Invincible::update()
{
u32 nextFlash;
if (isInvincible())
{
updateFrame();
nextFlash = mFlashCycle + 1;
mFlashCycle = nextFlash;
if (nextFlash == 0x14)
{
mFlashCycle = 0x10;
}
}
}

bool Invincible::isInvincible() const
{
bool result = false;
if ((mUsingIntangibleMove != false) || (mIsCandyActive != false) || (mInvincibleFrames != 0))
{
result = true;
}

return result;
}

void Invincible::set(u32 frames)
{
if (mInvincibleFrames < frames)
{
mInvincibleFrames = frames;
}

mFlashCycle = 0;
return;
}

void Invincible::clear()
{
mInvincibleFrames = 0;
mUsingIntangibleMove = false;
}

void Invincible::setPerm()
{
mUsingIntangibleMove = true;
mFlashCycle = 0;
}

void Invincible::unsetMighty()
{
mIsCandyActive = false;
}

bool Invincible::isMighty() const
{
return mIsCandyActive;
}

#pragma peephole off
u32 Invincible::getFlashAlpha() const
{
bool result = isInvincible();
u32 alpha;

if (result)
{
alpha = T_ALPHA_ANIM_TABLE[mFlashCycle / 2];
}
else
{
alpha = 0;
}

return alpha;
}

void Invincible::updateFrame()
{
u32 currentFrames = mInvincibleFrames;
if (currentFrames != 0)
{
mInvincibleFrames = currentFrames - 1;
}
}
46 changes: 46 additions & 0 deletions src/donut/scn/step/chara/Invincible.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#ifndef DONUT_SCN_STEP_CHARA_INVINCIBLE_HPP
#define DONUT_SCN_STEP_CHARA_INVINCIBLE_HPP

#include <types.h>

/* clang-format off */
namespace scn { namespace step { namespace chara {

const u32 T_ALPHA_ANIM_TABLE[10] = {
0xF0,
0x50,
0xA0,
0x14,
0x8C,
0x0A,
0x78,
0x00,
0x64,
0x00
};

class Invincible
{
public:
Invincible();
void update();
bool isInvincible() const;
void set(u32 frames);
void clear();
void setPerm();
void unsetMighty();
bool isMighty() const;
u32 getFlashAlpha() const;
void updateFrame();
private:
/* 0x00 */ u32 mInvincibleFrames;
/* 0x04 */ u32 mFlashCycle;
/* 0x08 */ bool mUsingIntangibleMove;
/* 0x09 */ bool mIsCandyActive;
};

}}}

/* clang-format on */

#endif
1 change: 1 addition & 0 deletions src/donut/scn/step/enemy/Enemy.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "scn/step/enemy/Enemy.hpp"
9 changes: 6 additions & 3 deletions src/donut/scn/step/enemy/Enemy.hpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
#ifndef DONUT_SCN_STEP_ENEMY_ENEMY_HPP
#define DONUT_SCN_STEP_ENEMY_ENEMY_HPP

#include "scn/step/Component.hpp"
#include "scn/step/enemy/IState.hpp"
#include "util/StateChanger.hpp"

// clang-format off

namespace gobj {
class FootState;
}

namespace scn { namespace step {
class Component;

namespace chara {
class Model;
}
Expand All @@ -26,9 +27,11 @@ namespace scn { namespace step {
util::StateChanger<scn::step::enemy::IState, 256>* stateChanger();

public:
STRUCT_FILL(0x1B8);
Component *mComponent;
};

}}};

// clang-format on

#endif
Loading
Loading