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

@@ -5,6 +5,12 @@
#define SI_MAJOR_VERSION 2
#define SI_MINOR_VERSION 2
// OFFSET: LEGO1 0x100bfed0
MxDSFile::~MxDSFile()
{
Close();
}
// OFFSET: LEGO1 0x100cc4b0
MxDSFile::MxDSFile(const char* filename, MxULong skipReadingChunks)
{
@@ -12,12 +18,6 @@ MxDSFile::MxDSFile(const char* filename, MxULong skipReadingChunks)
m_skipReadingChunks = skipReadingChunks;
}
// OFFSET: LEGO1 0x100bfed0
MxDSFile::~MxDSFile()
{
Close();
}
// OFFSET: LEGO1 0x100cc590
MxLong MxDSFile::Open(MxULong uStyle)
{
@@ -46,16 +46,6 @@ MxLong MxDSFile::Open(MxULong uStyle)
return longResult;
}
// OFFSET: LEGO1 0x100cc780
MxResult MxDSFile::Read(unsigned char* p_buf, MxULong p_nbytes)
{
if (m_io.Read(p_buf, p_nbytes) != p_nbytes)
return FAILURE;
m_position += p_nbytes;
return SUCCESS;
}
// OFFSET: LEGO1 0x100cc620
MxLong MxDSFile::ReadChunks()
{
@@ -91,6 +81,30 @@ MxLong MxDSFile::ReadChunks()
}
}
// OFFSET: LEGO1 0x100cc740
MxLong MxDSFile::Close()
{
m_io.Close(0);
m_position = -1;
memset(&m_header, 0, sizeof(m_header));
if (m_lengthInDWords != 0) {
m_lengthInDWords = 0;
delete[] m_pBuffer;
m_pBuffer = NULL;
}
return 0;
}
// OFFSET: LEGO1 0x100cc780
MxResult MxDSFile::Read(unsigned char* p_buf, MxULong p_nbytes)
{
if (m_io.Read(p_buf, p_nbytes) != p_nbytes)
return FAILURE;
m_position += p_nbytes;
return SUCCESS;
}
// OFFSET: LEGO1 0x100cc7b0
MxLong MxDSFile::Seek(MxLong lOffset, int iOrigin)
{
@@ -108,17 +122,3 @@ MxULong MxDSFile::GetStreamBuffersNum()
{
return m_header.streamBuffersNum;
}
// OFFSET: LEGO1 0x100cc740
MxLong MxDSFile::Close()
{
m_io.Close(0);
m_position = -1;
memset(&m_header, 0, sizeof(m_header));
if (m_lengthInDWords != 0) {
m_lengthInDWords = 0;
delete[] m_pBuffer;
m_pBuffer = NULL;
}
return 0;
}