From 86fb13f52852a251c4ef48721dbdebeb6e357c81 Mon Sep 17 00:00:00 2001 From: Aran Vink Date: Wed, 17 Jun 2026 00:38:44 +0200 Subject: [PATCH 1/5] Mark gradle as executeable --- gradlew | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 gradlew diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 From 9a60d4516be8636ebf9b120523325ff0a87fef76 Mon Sep 17 00:00:00 2001 From: Aran Vink Date: Wed, 17 Jun 2026 00:39:04 +0200 Subject: [PATCH 2/5] Bump versions in readme --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 8a46aa2..507c94d 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ AndPlugLib is used in [AndPlug](https://play.google.com/store/apps/details?id=co - [Android 4.0.3](https://developer.android.com/about/versions/android-4.0.3) (API Level: 15) or later (`ICE_CREAM_SANDWICH_MR1`) - [CMake](https://cmake.org/) Release 3.4.1 or later - [Android Gradle Plugin](https://developer.android.com/studio/releases/gradle-plugin) 8.11.1) or later (`gradle:8.11.1`) -- [AdPlug](https://github.com/adplug/adplug) Version 2.3.3 (_branch/tag:_ `release-2.3.3`) +- [AdPlug](https://github.com/adplug/adplug) Version 2.4 (_branch/tag:_ `release-2.4`) - [libbinio](https://github.com/adplug/libbinio) Version 1.5 (_tag:_ `libbionio-1.5`) - [Oboe](https://github.com/google/oboe) Version 1.7.0 (_branch:_ `1.7-stable`) @@ -37,10 +37,10 @@ Setup steps: 3. Apply patches to AdPlug and libbinio 4. Build library with Gradle, using Android Studio or directly from the command line -``` +```bash $ git clone https://github.com/omicronapps/AndPlugLib.git $ cd AndPlugLib/andpluglib/src/main/cpp/ -$ git clone --branch release-2.3.3 https://github.com/adplug/adplug.git +$ git clone --branch adplug-2.4 https://github.com/adplug/adplug.git $ patch adplug/src/version.h -i adplug.patch $ git clone https://github.com/adplug/libbinio.git $ patch libbinio/src/binio.h -i libbinio.patch @@ -55,10 +55,10 @@ AndPlugLib includes both instrumented unit tests and a simple test application. Located under `andpluglib/src/androidTest`. -These tests are run on a hardware device or emulator, and verifies correct operation of the `PlayerService` implementation and its usage of the native AdPlug library. A set of songs need to be downloaded and installed in order to run the instrumented tests. +These tests are run on a hardware device or emulator, and verifies correct operation of the `PlayerService` implementation and its usage of the native AdPlug library. A set of songs need to be downloaded and installed in order to run the instrumented tests. Setup steps: -``` +```bash cd AndPlugLib/andpluglib/src/androidTest/res/raw/ wget http://modland.com/pub/modules/Ad%20Lib/EdLib%20D00/MSK/en%20lille%20test.d00 en_lille_test_d00 wget http://modland.com/pub/modules/Ad%20Lib/EdLib%20D00/MSK/fresh.d00 fresh_d00 @@ -74,7 +74,7 @@ Located under `app/src/main`. Uses hardcoded path to EdLib songs for playback testing (can be replaced by any other AdPlug compatible songs). Setup steps: -``` +```bash cd AndPlugLib/app/src/main/assets/ wget http://modland.com/pub/modules/Ad%20Lib/EdLib%20D00/MSK/en%20lille%20test.d00 wget http://modland.com/pub/modules/Ad%20Lib/EdLib%20D00/MSK/fresh.d00 @@ -429,6 +429,7 @@ Copyright (C) 2019-2025 [Fredrik Claesson](https://www.omicronapplications.com/) - 2.5.0 Additional player crash fixes - 2.6.0 Updated to Oboe v1.7.0, minor bugfixes, change to Apache License Version 2.0 - 2.7.0 Fix for audio focus issue, use 16 KB ELF alignment, target Android 15 (API level 35) +- 2.8.0 Update Adplug to 2.3.3 -> 2.4 ## License From 964dd9275d42214ac48743820626d9dbddc4d1e6 Mon Sep 17 00:00:00 2001 From: Aran Vink Date: Wed, 17 Jun 2026 00:39:21 +0200 Subject: [PATCH 3/5] Update used C/CPP files from adplug 2.4 --- andpluglib/CMakeLists.txt | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/andpluglib/CMakeLists.txt b/andpluglib/CMakeLists.txt index 620cbe2..5ab9a13 100644 --- a/andpluglib/CMakeLists.txt +++ b/andpluglib/CMakeLists.txt @@ -33,15 +33,18 @@ set(BINIO_FILES ${BINIO}/binstr.cpp ) -# adplug-2.3.3 +# adplug-2.4.0 set(ADPLUG_FILES ${ADPLUG}/adlibemu.c ${ADPLUG}/debug.c ${ADPLUG}/fmopl.c ${ADPLUG}/nukedopl.c + ${ADPLUG}/unlzh.c + ${ADPLUG}/unlzss.c + ${ADPLUG}/unlzw.c ${ADPLUG}/a2m.cpp + ${ADPLUG}/a2m-v2.cpp ${ADPLUG}/adl.cpp - ${ADPLUG}/adlib.cpp ${ADPLUG}/adplug.cpp ${ADPLUG}/adtrack.cpp ${ADPLUG}/amd.cpp @@ -51,8 +54,11 @@ set(ADPLUG_FILES ${ADPLUG}/cff.cpp ${ADPLUG}/cmf.cpp ${ADPLUG}/cmfmcsop.cpp + ${ADPLUG}/coktel.cpp + ${ADPLUG}/composer.cpp ${ADPLUG}/d00.cpp ${ADPLUG}/database.cpp + ${ADPLUG}/depack.c ${ADPLUG}/dfm.cpp ${ADPLUG}/diskopl.cpp ${ADPLUG}/dmo.cpp @@ -71,6 +77,7 @@ set(ADPLUG_FILES ${ADPLUG}/hyp.cpp ${ADPLUG}/imf.cpp ${ADPLUG}/jbm.cpp + ${ADPLUG}/kemuopl.cpp ${ADPLUG}/ksm.cpp ${ADPLUG}/lds.cpp ${ADPLUG}/mad.cpp @@ -79,10 +86,13 @@ set(ADPLUG_FILES ${ADPLUG}/mkj.cpp ${ADPLUG}/msc.cpp ${ADPLUG}/mtk.cpp + ${ADPLUG}/mtr.cpp ${ADPLUG}/mus.cpp ${ADPLUG}/nemuopl.cpp ${ADPLUG}/player.cpp ${ADPLUG}/players.cpp + ${ADPLUG}/plx.cpp + ${ADPLUG}/pis.cpp ${ADPLUG}/protrack.cpp ${ADPLUG}/psi.cpp ${ADPLUG}/rad2.cpp @@ -93,6 +103,7 @@ set(ADPLUG_FILES ${ADPLUG}/rol.cpp ${ADPLUG}/s3m.cpp ${ADPLUG}/sa2.cpp + ${ADPLUG}/sixdepack.cpp ${ADPLUG}/sng.cpp ${ADPLUG}/sop.cpp ${ADPLUG}/surroundopl.cpp @@ -116,7 +127,7 @@ set(FLAGS "-O2") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS}") set(BINIO_FLAGS "PACKAGE_NAME=\"binio\";PACKAGE_TARNAME=\"libbinio\";PACKAGE_VERSION=\"1.5\";PACKAGE_STRING=\"binio 1.5\";PACKAGE_BUGREPORT=\"dn.tlp@gmx.net\";PACKAGE_URL=\"\";PACKAGE=\"libbinio\";VERSION=\"1.5\";STDC_HEADERS=1;HAVE_SYS_TYPES_H=1;HAVE_SYS_STAT_H=1;HAVE_STDLIB_H=1;HAVE_STRING_H=1;HAVE_MEMORY_H=1;HAVE_STRINGS_H=1;HAVE_INTTYPES_H=1;HAVE_STDINT_H=1;HAVE_UNISTD_H=1;HAVE_DLFCN_H=1") -set(ADPLUG_FLAGS "PACKAGE_NAME=\"adplug\";PACKAGE_TARNAME=\"adplug\";PACKAGE_VERSION=\"2.3.3\";PACKAGE_STRING=\"adplug 2.3.3\";PACKAGE_BUGREPORT=\"\";PACKAGE_URL=\"\";NDEBUG=/**/;PACKAGE=\"adplug\";VERSION=\"2.3.3\";STDC_HEADERS=1;HAVE_SYS_TYPES_H=1;HAVE_SYS_STAT_H=1;HAVE_STDLIB_H=1;HAVE_STRING_H=1;HAVE_MEMORY_H=1;HAVE_STRINGS_H=1;HAVE_INTTYPES_H=1;HAVE_STDINT_H=1;HAVE_UNISTD_H=1;HAVE_DLFCN_H=1;HAVE_GETOPT_H=1;stricmp=strcasecmp") +set(ADPLUG_FLAGS "PACKAGE_NAME=\"adplug\";PACKAGE_TARNAME=\"adplug\";PACKAGE_VERSION=\"2.4\";PACKAGE_STRING=\"adplug 2.4\";PACKAGE_BUGREPORT=\"\";PACKAGE_URL=\"\";NDEBUG=/**/;PACKAGE=\"adplug\";VERSION=\"2.4\";STDC_HEADERS=1;HAVE_SYS_TYPES_H=1;HAVE_SYS_STAT_H=1;HAVE_STDLIB_H=1;HAVE_STRING_H=1;HAVE_MEMORY_H=1;HAVE_STRINGS_H=1;HAVE_INTTYPES_H=1;HAVE_STDINT_H=1;HAVE_UNISTD_H=1;HAVE_DLFCN_H=1;HAVE_GETOPT_H=1;stricmp=strcasecmp") set_property(SOURCE ${BINIO_FILES} APPEND PROPERTY COMPILE_DEFINITIONS ${BINIO_FLAGS}) set_property(SOURCE ${ADPLUG_FILES} APPEND PROPERTY COMPILE_DEFINITIONS ${ADPLUG_FLAGS}) From 1a4025536a733972640ead6bf4dacf3884bd61d5 Mon Sep 17 00:00:00 2001 From: Aran Vink Date: Wed, 17 Jun 2026 00:39:33 +0200 Subject: [PATCH 4/5] Update/fix patches --- andpluglib/src/main/cpp/adplug.patch | 15 +-------------- andpluglib/src/main/cpp/libbinio.patch | 2 +- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/andpluglib/src/main/cpp/adplug.patch b/andpluglib/src/main/cpp/adplug.patch index ea90d54..79b7c7a 100644 --- a/andpluglib/src/main/cpp/adplug.patch +++ b/andpluglib/src/main/cpp/adplug.patch @@ -1,20 +1,7 @@ -diff --git a/src/imf.cpp b/src/imf.cpp -index 4971bda..5ecfd81 100644 ---- a/src/imf.cpp -+++ b/src/imf.cpp -@@ -89,7 +89,7 @@ bool CimfPlayer::load(const std::string &filename, const CFileProvider &fp) - else - fsize = f->readInt(2); - flsize = fp.filesize(f); -- if (mfsize + 4 > flsize || fsize >= flsize - 2 - mfsize || fsize & 3) { -+ if (mfsize + 4 > flsize || fsize > flsize - 2 - mfsize || fsize & 3) { - fp.close(f); // truncated file or bad size record - return false; - } diff --git a/src/version.h b/src/version.h new file mode 100644 index 0000000..86ec36f --- /dev/null +++ b/src/version.h @@ -0,0 +1 @@ -+#define ADPLUG_VERSION "2.3.3" ++#define ADPLUG_VERSION "2.4" diff --git a/andpluglib/src/main/cpp/libbinio.patch b/andpluglib/src/main/cpp/libbinio.patch index 701aaeb..fd3095c 100644 --- a/andpluglib/src/main/cpp/libbinio.patch +++ b/andpluglib/src/main/cpp/libbinio.patch @@ -119,7 +119,7 @@ index 0000000..6b8c272 +#endif + +private: -+ static const Flags detect_system_flags(); ++ static Flags detect_system_flags(); +}; + +class binistream: virtual public binio From 4436ec4f2cbaf119ef63b874ae2c9d7ef4bc26fb Mon Sep 17 00:00:00 2001 From: Aran Vink Date: Wed, 17 Jun 2026 18:05:47 +0200 Subject: [PATCH 5/5] Use correct tag in prereq --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 507c94d..0e56977 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ AndPlugLib is used in [AndPlug](https://play.google.com/store/apps/details?id=co - [Android 4.0.3](https://developer.android.com/about/versions/android-4.0.3) (API Level: 15) or later (`ICE_CREAM_SANDWICH_MR1`) - [CMake](https://cmake.org/) Release 3.4.1 or later - [Android Gradle Plugin](https://developer.android.com/studio/releases/gradle-plugin) 8.11.1) or later (`gradle:8.11.1`) -- [AdPlug](https://github.com/adplug/adplug) Version 2.4 (_branch/tag:_ `release-2.4`) +- [AdPlug](https://github.com/adplug/adplug) Version 2.4 (_tag:_ `adplug-2.4`) - [libbinio](https://github.com/adplug/libbinio) Version 1.5 (_tag:_ `libbionio-1.5`) - [Oboe](https://github.com/google/oboe) Version 1.7.0 (_branch:_ `1.7-stable`)