Checkorder tool to keep functions in original binary order (#228)

* First commit of order tool

* More flexible match on module name. Bugfix on blank_or_comment

* Report inexact offset comments in verbose mode. Bugfix for exact regex

* Refactor checkorder into reusable isledecomp module

* Find bad comments in one pass, add awareness of TEMPLATE

* Refactor of state machine to prepare for reccmp integration

* Use isledecomp lib in reccmp

* Build isledecomp in GH actions, fix mypy complaint

* Ensure unit test cpp files will be ignored by reccmp

* Allow multiple offset markers, pep8 cleanup

* Remove unused variable

* Code style, remove unneeded module and TODO

* Final renaming and type hints

* Fix checkorder issues, add GH action and enforce (#2)

* Fix checkorder issues

* Add GH action

* Test error case

* Works

* Fixes

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
MS
2023-11-21 03:44:45 -05:00
committed by GitHub
parent 714d36b57d
commit 1ae3b07dc2
84 changed files with 4021 additions and 3209 deletions

View File

@@ -16,6 +16,97 @@
DECOMP_SIZE_ASSERT(MxPresenter, 0x40);
// OFFSET: LEGO1 0x1000be30
void MxPresenter::VTable0x14()
{
}
// OFFSET: LEGO1 0x1000be40
void MxPresenter::ReadyTickle()
{
ParseExtra();
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Starting;
}
// OFFSET: LEGO1 0x1000be60
void MxPresenter::StartingTickle()
{
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Streaming;
}
// OFFSET: LEGO1 0x1000be80
void MxPresenter::StreamingTickle()
{
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Repeating;
}
// OFFSET: LEGO1 0x1000bea0
void MxPresenter::RepeatingTickle()
{
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_unk5;
}
// OFFSET: LEGO1 0x1000bec0
void MxPresenter::Unk5Tickle()
{
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Done;
}
// OFFSET: LEGO1 0x1000bee0
void MxPresenter::DoneTickle()
{
m_previousTickleStates |= 1 << m_currentTickleState;
m_currentTickleState = TickleState_Idle;
}
// OFFSET: LEGO1 0x1000bf00
MxPresenter::~MxPresenter()
{
}
// OFFSET: LEGO1 0x1000bf70
MxResult MxPresenter::AddToManager()
{
return SUCCESS;
}
// OFFSET: LEGO1 0x1000bf80
void MxPresenter::Destroy()
{
Init();
}
// OFFSET: LEGO1 0x1000bf90
void MxPresenter::SetTickleState(TickleState p_tickleState)
{
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = p_tickleState;
}
// OFFSET: LEGO1 0x1000bfb0
MxBool MxPresenter::HasTickleStatePassed(TickleState p_tickleState)
{
return m_previousTickleStates & (1 << (unsigned char) p_tickleState);
}
// OFFSET: LEGO1 0x1000bfc0
undefined4 MxPresenter::PutData()
{
return 0;
}
// OFFSET: LEGO1 0x1000bfd0
MxBool MxPresenter::IsHit(MxS32 p_x, MxS32 p_y)
{
return FALSE;
}
// OFFSET: LEGO1 0x100b4d50
void MxPresenter::Init()
{
@@ -27,6 +118,44 @@ void MxPresenter::Init()
m_previousTickleStates = 0;
}
// OFFSET: LEGO1 0x100b4d80
MxResult MxPresenter::StartAction(MxStreamController*, MxDSAction* p_action)
{
MxAutoLocker lock(&this->m_criticalSection);
this->m_action = p_action;
const Vector3Data& location = this->m_action->GetLocation();
MxS32 previousTickleState = this->m_currentTickleState;
this->m_location = MxPoint32(this->m_action->GetLocation()[0], this->m_action->GetLocation()[1]);
this->m_displayZ = this->m_action->GetLocation()[2];
this->m_previousTickleStates |= 1 << (unsigned char) previousTickleState;
this->m_currentTickleState = TickleState_Ready;
return SUCCESS;
}
// OFFSET: LEGO1 0x100b4e40
void MxPresenter::EndAction()
{
if (this->m_action == FALSE)
return;
MxAutoLocker lock(&this->m_criticalSection);
if (!this->m_compositePresenter) {
MxOmni::GetInstance()->NotifyCurrentEntity(
&MxEndActionNotificationParam(c_notificationEndAction, NULL, this->m_action, TRUE)
);
}
this->m_action = FALSE;
MxS32 previousTickleState = 1 << m_currentTickleState;
this->m_previousTickleStates |= previousTickleState;
this->m_currentTickleState = TickleState_Idle;
}
// OFFSET: LEGO1 0x100b4fc0
void MxPresenter::ParseExtra()
{
@@ -71,11 +200,6 @@ void MxPresenter::SendToCompositePresenter(MxOmni* p_omni)
}
}
// OFFSET: LEGO1 0x1000bf00
MxPresenter::~MxPresenter()
{
}
// OFFSET: LEGO1 0x100b5200
MxResult MxPresenter::Tickle()
{
@@ -116,44 +240,6 @@ MxResult MxPresenter::Tickle()
return SUCCESS;
}
// OFFSET: LEGO1 0x100b4d80
MxResult MxPresenter::StartAction(MxStreamController*, MxDSAction* p_action)
{
MxAutoLocker lock(&this->m_criticalSection);
this->m_action = p_action;
const Vector3Data& location = this->m_action->GetLocation();
MxS32 previousTickleState = this->m_currentTickleState;
this->m_location = MxPoint32(this->m_action->GetLocation()[0], this->m_action->GetLocation()[1]);
this->m_displayZ = this->m_action->GetLocation()[2];
this->m_previousTickleStates |= 1 << (unsigned char) previousTickleState;
this->m_currentTickleState = TickleState_Ready;
return SUCCESS;
}
// OFFSET: LEGO1 0x100b4e40
void MxPresenter::EndAction()
{
if (this->m_action == FALSE)
return;
MxAutoLocker lock(&this->m_criticalSection);
if (!this->m_compositePresenter) {
MxOmni::GetInstance()->NotifyCurrentEntity(
&MxEndActionNotificationParam(c_notificationEndAction, NULL, this->m_action, TRUE)
);
}
this->m_action = FALSE;
MxS32 previousTickleState = 1 << m_currentTickleState;
this->m_previousTickleStates |= previousTickleState;
this->m_currentTickleState = TickleState_Idle;
}
// OFFSET: LEGO1 0x100b52d0
void MxPresenter::Enable(MxBool p_enable)
{
@@ -223,89 +309,3 @@ MxBool MxPresenter::IsEnabled()
{
return this->m_action && this->m_action->GetFlags() & MxDSAction::Flag_Enabled;
}
// OFFSET: LEGO1 0x1000be30
void MxPresenter::VTable0x14()
{
}
// OFFSET: LEGO1 0x1000be40
void MxPresenter::ReadyTickle()
{
ParseExtra();
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Starting;
}
// OFFSET: LEGO1 0x1000be60
void MxPresenter::StartingTickle()
{
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Streaming;
}
// OFFSET: LEGO1 0x1000be80
void MxPresenter::StreamingTickle()
{
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Repeating;
}
// OFFSET: LEGO1 0x1000bea0
void MxPresenter::RepeatingTickle()
{
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_unk5;
}
// OFFSET: LEGO1 0x1000bec0
void MxPresenter::Unk5Tickle()
{
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Done;
}
// OFFSET: LEGO1 0x1000bee0
void MxPresenter::DoneTickle()
{
m_previousTickleStates |= 1 << m_currentTickleState;
m_currentTickleState = TickleState_Idle;
}
// OFFSET: LEGO1 0x1000bf70
MxResult MxPresenter::AddToManager()
{
return SUCCESS;
}
// OFFSET: LEGO1 0x1000bf80
void MxPresenter::Destroy()
{
Init();
}
// OFFSET: LEGO1 0x1000bf90
void MxPresenter::SetTickleState(TickleState p_tickleState)
{
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = p_tickleState;
}
// OFFSET: LEGO1 0x1000bfb0
MxBool MxPresenter::HasTickleStatePassed(TickleState p_tickleState)
{
return m_previousTickleStates & (1 << (unsigned char) p_tickleState);
}
// OFFSET: LEGO1 0x1000bfc0
undefined4 MxPresenter::PutData()
{
return 0;
}
// OFFSET: LEGO1 0x1000bfd0
MxBool MxPresenter::IsHit(MxS32 p_x, MxS32 p_y)
{
return FALSE;
}