Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 (_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`)

Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down
17 changes: 14 additions & 3 deletions andpluglib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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})

Expand Down
15 changes: 1 addition & 14 deletions andpluglib/src/main/cpp/adplug.patch
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion andpluglib/src/main/cpp/libbinio.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Empty file modified gradlew
100644 → 100755
Empty file.