aboutsummaryrefslogtreecommitdiff
path: root/src/ARCodeFile.cpp
diff options
context:
space:
mode:
authorStraDaMa <StraDaMa@users.noreply.github.com>2023-08-27 04:34:11 -0700
committerGitHub <noreply@github.com>2023-08-27 13:34:11 +0200
commitbc71618457a2759f0fa9eda4aaade9cb4a5e5695 (patch)
treea74e4133e6b3f8984e103876467af69f6245c3d2 /src/ARCodeFile.cpp
parent2bd12669b25f2ce6d9dae4c0964f500572775b5d (diff)
remove AR code size limit (#1802)
Co-authored-by: Arisotura <thetotalworm@gmail.com>
Diffstat (limited to 'src/ARCodeFile.cpp')
-rw-r--r--src/ARCodeFile.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/ARCodeFile.cpp b/src/ARCodeFile.cpp
index 79c582d..d1f34fb 100644
--- a/src/ARCodeFile.cpp
+++ b/src/ARCodeFile.cpp
@@ -120,7 +120,7 @@ bool ARCodeFile::Load()
curcode.Name = codename;
curcode.Enabled = enable!=0;
- curcode.CodeLen = 0;
+ curcode.Code.clear();
}
else
{
@@ -141,17 +141,8 @@ bool ARCodeFile::Load()
return false;
}
- if (curcode.CodeLen >= 2*64)
- {
- Log(LogLevel::Error, "AR: code too long!\n");
- CloseFile(f);
- return false;
- }
-
- u32 idx = curcode.CodeLen;
- curcode.Code[idx+0] = c0;
- curcode.Code[idx+1] = c1;
- curcode.CodeLen += 2;
+ curcode.Code.push_back(c0);
+ curcode.Code.push_back(c1);
}
}
@@ -179,7 +170,7 @@ bool ARCodeFile::Save()
ARCode& code = *jt;
FileWriteFormatted(f, "CODE %d %s\r\n", code.Enabled, code.Name.c_str());
- for (u32 i = 0; i < code.CodeLen; i+=2)
+ for (size_t i = 0; i < code.Code.size(); i+=2)
{
FileWriteFormatted(f, "%08X %08X\r\n", code.Code[i], code.Code[i + 1]);
}