From 84e8d23425f5df6da36f0ea9ee11829ff56431ef Mon Sep 17 00:00:00 2001 From: Martin Griffin Date: Sat, 18 Apr 2026 09:30:12 +0100 Subject: [PATCH] Remove INCBIN_S* The signed INCBINs are unused, I assume they were once for audio data but that is handled in assembly now. --- tools/preproc/c_file.cpp | 13 ++++--------- tools/scaninc/c_file.cpp | 4 ++-- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/tools/preproc/c_file.cpp b/tools/preproc/c_file.cpp index 191ca4c152..d034b3f1f1 100644 --- a/tools/preproc/c_file.cpp +++ b/tools/preproc/c_file.cpp @@ -281,10 +281,10 @@ int ExtractData(const std::unique_ptr& buffer, int offset, int void CFile::TryConvertIncbin() { - std::string idents[6] = { "INCBIN_S8", "INCBIN_U8", "INCBIN_S16", "INCBIN_U16", "INCBIN_S32", "INCBIN_U32" }; + std::string idents[3] = { "INCBIN_U8", "INCBIN_U16", "INCBIN_U32" }; int incbinType = -1; - for (int i = 0; i < 6; i++) + for (int i = 0; i < 3; i++) { if (CheckIdentifier(idents[i])) { @@ -296,8 +296,7 @@ void CFile::TryConvertIncbin() if (incbinType == -1) return; - int size = 1 << (incbinType / 2); - bool isSigned = ((incbinType % 2) == 0); + int size = 1 << incbinType; long oldPos = m_pos; long oldLineNum = m_lineNum; @@ -364,11 +363,7 @@ void CFile::TryConvertIncbin() { int data = ExtractData(buffer, offset, size); offset += size; - - if (isSigned) - std::printf("%d,", data); - else - std::printf("%uu,", data); + std::printf("%uu,", data); } SkipWhitespace(); diff --git a/tools/scaninc/c_file.cpp b/tools/scaninc/c_file.cpp index c1fe10d374..f76976696d 100644 --- a/tools/scaninc/c_file.cpp +++ b/tools/scaninc/c_file.cpp @@ -218,10 +218,10 @@ void CFile::CheckIncbin() return; } - std::string idents[6] = { "INCBIN_S8", "INCBIN_U8", "INCBIN_S16", "INCBIN_U16", "INCBIN_S32", "INCBIN_U32" }; + std::string idents[3] = { "INCBIN_U8", "INCBIN_U16", "INCBIN_U32" }; int incbinType = -1; - for (int i = 0; i < 6; i++) + for (int i = 0; i < 3; i++) { if (CheckIdentifier(idents[i])) {