Skip to content

Commit

Permalink
Merge branch 'master' into cmake_build
Browse files Browse the repository at this point in the history
  • Loading branch information
mywave82 authored Jan 7, 2024
2 parents 9f75afe + d8a7a68 commit bb61712
Show file tree
Hide file tree
Showing 43 changed files with 152,067 additions and 6,054 deletions.
71 changes: 59 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ jobs:
strategy:

matrix:
os:
- ubuntu-latest
- macos-latest

compiler:
- gcc
- clang
os: [ubuntu-latest, macos-latest]
compiler: [gcc, clang]
include:
- compiler: gcc-4.8 # To test compatibility with older systems
os: ubuntu-latest
- compiler: djgpp-2.0.5-gcc-12.2.0 # To test compatibility for Adplay - DOS
os: ubuntu-latest
- compiler: djgpp-2.0.5-gcc-4.8.5 # To test compatibility for Adplay - DOS
os: ubuntu-latest

fail-fast: false

Expand All @@ -28,12 +30,39 @@ jobs:
- name: Install packages (Linux)
if: ${{ runner.os == 'Linux' }}
run: |
sudo apt update
sudo apt install -y texlive-latex-base texinfo
if [[ ${{ matrix.compiler }} == "clang" ]]; then
sudo apt install -y libncurses5
fi
if [[ ${{ matrix.compiler }} == "gcc-4.8" ]]; then
wget http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-4.8/g++-4.8_4.8.5-4ubuntu8_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-4.8/libstdc++-4.8-dev_4.8.5-4ubuntu8_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-4.8/gcc-4.8-base_4.8.5-4ubuntu8_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-4.8/gcc-4.8_4.8.5-4ubuntu8_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-4.8/libgcc-4.8-dev_4.8.5-4ubuntu8_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-4.8/cpp-4.8_4.8.5-4ubuntu8_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-4.8/libasan0_4.8.5-4ubuntu8_amd64.deb
sudo apt install ./gcc-4.8_4.8.5-4ubuntu8_amd64.deb ./gcc-4.8-base_4.8.5-4ubuntu8_amd64.deb ./libstdc++-4.8-dev_4.8.5-4ubuntu8_amd64.deb ./cpp-4.8_4.8.5-4ubuntu8_amd64.deb ./libgcc-4.8-dev_4.8.5-4ubuntu8_amd64.deb ./libasan0_4.8.5-4ubuntu8_amd64.deb ./g++-4.8_4.8.5-4ubuntu8_amd64.deb
fi
if [[ ${{ matrix.compiler }} = djgpp* ]]; then
# Flex is required, but even though it's in the GitHub runner image, and marked as installed
# it's still missing some things, see https://github.com/orgs/community/discussions/45029
sudo apt install -y libfl2 libfl-dev
if [[ ${{ matrix.compiler }} == "djgpp-2.0.5-gcc-12.2.0" ]]; then
wget https://github.com/andrewwutw/build-djgpp/releases/download/v3.4/djgpp-linux64-gcc1220.tar.bz2
bzcat djgpp-linux64-gcc1220.tar.bz2 | sudo tar -x --directory /usr/local
fi
if [[ ${{ matrix.compiler }} == "djgpp-2.0.5-gcc-4.8.5" ]]; then
wget https://github.com/andrewwutw/build-djgpp/releases/download/v1.6/djgpp-linux64-gcc485.tar.bz2
bzcat djgpp-linux64-gcc485.tar.bz2 | sudo tar -x --directory /usr/local
fi
fi
- name: Install packages (macOS)
if: ${{ runner.os == 'macOS' }}
run: |
Expand All @@ -50,6 +79,10 @@ jobs:
with:
version: "10.0"

- name: Set GCC-4.8 environment
if: ${{ matrix.compiler == 'gcc-4.8' }}
run: echo 'compile_opts=CC=gcc-4.8 CXX=g++-4.8' >> $GITHUB_ENV

- name: Set GCC environment
if: ${{ matrix.compiler == 'gcc' && runner.os == 'macOS' }}
run: echo 'compile_opts=CC=gcc CXX=g++' >> $GITHUB_ENV
Expand All @@ -58,10 +91,16 @@ jobs:
if: ${{ matrix.compiler == 'clang' }}
run: echo 'compile_opts=CC=clang CXX=clang++' >> $GITHUB_ENV

- name: Set DJGPP environment
if: ${{ startsWith(matrix.compiler, 'djgpp') }}
run: |
echo 'compile_opts=--host=i586-pc-msdosdjgpp --prefix=/usr/local/djgpp CXXFLAGS=-Wno-deprecated CPPFLAGS=-Wno-deprecated PKG_CONFIG_PATH=/usr/local/djgpp/lib/pkgconfig' >> $GITHUB_ENV
echo 'usr/local//djgpp/bin/' >> $GITHUB_PATH
- name: Install libbinio
run: |
git clone http://github.com/adplug/libbinio.git
pushd libbinio && autoreconf -i && ./configure --enable-maintainer-mode ${{ env.compile_opts }} && make && sudo make install && popd
pushd libbinio && autoreconf -i && ./configure --enable-maintainer-mode ${{ env.compile_opts }} && make && sudo env PATH=$PATH make install && popd
- name: autoreconf
run: autoreconf -i
Expand All @@ -70,22 +109,30 @@ jobs:

- name: make
run: |
ulimit -c unlimited -S
if [[ ${{ runner.os }} == "macOS" ]]; then
# - macOS's /usr/bin/texi2dvi is broken
# - Furthermore, trying to get a working
# TeX installation on macOS is a futile
# endeavour, hence just run tests.
export TARGET=check
make check ${{ env.compile_opts }}
elif [[ ${{ matrix.compiler }} = djgpp* ]]; then
# Just verify it compiles and installs,
# we can't run tests because of binary incompatibility with host OS when cross compiling
# Note: compile_opts is not used here, since DJGPP requires stuff like --host for ./configure
# which will mess with make's command-line parsing
make all
elif [[ ${{ runner.os }} == "Linux" ]]; then
export TARGET=distcheck
make distcheck ${{ env.compile_opts }}
fi
ulimit -c unlimited -S && make "${TARGET}" ${{ env.compile_opts }}
- name: Prepare test results (Linux)
if: ${{ runner.os == 'Linux' }}
if: ${{ runner.os == 'Linux' && !startsWith(matrix.compiler, 'djgpp')}}
run: make check

- name: Show test results
if: ${{ !startsWith(matrix.compiler, 'djgpp')}}
run: |-
for I in test/*.log; do
[ -e "$I" ] || continue
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,7 @@ CMakeUserPresets.json
/out/
/.vs/
.vscode/

contrib/vs2015/adplug/v140/x64/Debug
contrib/vs2015/crctest/x64/Debug
contrib/vs2015/emutest/x64/Debug
contrib/vs2015/playertest/x64/Debug
13 changes: 13 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ src_libadplug_la_SOURCES = \
src/hyp.cpp \
src/imf.cpp \
src/jbm.cpp \
src/kemuopl.cpp \
src/ksm.cpp \
src/lds.cpp \
src/mad.cpp \
Expand All @@ -56,8 +57,10 @@ src_libadplug_la_SOURCES = \
src/mkj.cpp \
src/msc.cpp \
src/mtk.cpp \
src/mtr.cpp \
src/mus.cpp \
src/nemuopl.cpp \
src/pis.cpp \
src/player.cpp \
src/players.cpp \
src/protrack.cpp \
Expand Down Expand Up @@ -110,6 +113,7 @@ pkginclude_HEADERS = \
src/mid.h \
src/mkj.h \
src/mtk.h \
src/mtr.h \
src/protrack.h \
src/rad2.h \
src/raw.h \
Expand All @@ -124,6 +128,7 @@ pkginclude_HEADERS = \
src/bmf.h \
src/flash.h \
src/hyp.h \
src/pis.h \
src/psi.h \
src/rat.h \
src/hybrid.h \
Expand Down Expand Up @@ -258,10 +263,14 @@ EXTRA_DIST += \
test/testref/2001.ref \
test/testmus/2.CMF \
test/testref/2.ref \
test/testmus/ACTION.PIS \
test/testref/ACTION.ref \
test/testmus/ADAGIO.DFM \
test/testref/ADAGIO.ref \
test/testref/adlibsp.ref \
test/testmus/adlibsp.s3m \
test/testmus/AKMTEC.MTR \
test/testref/AKMTEC.ref \
test/testmus/ALLOYRUN.RAD \
test/testref/ALLOYRUN.ref \
test/testmus/ARAB.BAM \
Expand All @@ -284,6 +293,8 @@ EXTRA_DIST += \
test/testref/canonind.ref \
test/testref/CHILD1.ref \
test/testmus/CHILD1.XSM \
test/testmus/CHIP.MTR \
test/testref/CHIP.ref \
test/testmus/crusader.raw \
test/testref/crusader.ref \
test/testmus/DEMO4.JBM \
Expand Down Expand Up @@ -351,6 +362,8 @@ EXTRA_DIST += \
test/testref/MORNING.ref \
test/testmus/NECRONOM.CMF \
test/testref/NECRONOM.ref \
test/testmus/SNDTRACK.CMF \
test/testref/SNDTRACK.ref \
test/testmus/NEWPAGA.HA2 \
test/testref/NEWPAGA.ref \
test/testmus/NEWSAN.HSQ \
Expand Down
14 changes: 9 additions & 5 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,15 @@ platforms and compilers:

Platform Operating System Compiler
-------- ---------------- --------
IA32 - x86 Windows XP MinGW 3.4
MS-DOS 6.22 DJGPP 4.0
Linux 2.6 GCC 4.1
x86_64 Linux GCC 6.3.1
Linux GCC 8.2.1
IA32 - x86 Windows XP MinGW 3.4 # not tested at the moment
MS-DOS 6.22 DJGPP 2.0.5 / GCC 12.2.0
MS-DOS 6.22 DJGPP 2.0.5 / GCC 4.8.5
Linux 2.6 GCC 4.1 # not tested at the moment
x86_64 Linux GCC 4.8
Linux GCC 11.3.0
Linux CLANG 10.0.1
MACOS GCC 14.0.0
MACOS CLANG 14.0.0

This list only incorporates platforms on which this release of AdPlug has
been tested successfully. This and/or earlier versions of AdPlug may and did
Expand Down
4 changes: 0 additions & 4 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,3 @@ General to do items:
- Palladix file format, used in LOGICAL game [dynamite]

- Add possibility to mute/solo AdLib channels.

- Isolate Ken Silverman's synth (no global variables) so that multiple
instances can be created. Surround mode won't work with Ken's synth
until this is done.
3 changes: 2 additions & 1 deletion adplugdb/getopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@
GNU application programs can use a third alternative mode in which
they can distinguish the relative order of options and other arguments. */

#include "getopt.h"
/* If this file is compiled, it is because our target system is lacking getopt.h */
#include "mygetopt.h"

/* For communication from `getopt' to the caller.
When `getopt' finds an option that takes an argument,
Expand Down
20 changes: 16 additions & 4 deletions src/adl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,21 @@ static inline T CLIP(const T &value, const T &min, const T &max) {
}

#if !defined(nullptr) && __cplusplus < 201103L && _MSC_VER < 1600
static const struct {
template <class T> operator T*() const { return 0; }
} nullptr;
const class nullptr_t {
public:
template<class T> // convertible to any type of null non-member pointer...
operator T*() const {
return 0;
}

template<class C, class T> // or any type of null member pointer...
operator T C::*() const {
return 0;
}

private:
void operator&() const; // Can't take address of nullptr
} nullptr = {}; // and whose name is nullptr
#endif

#define override // AdLibDriver has no base class here, so no overrides
Expand Down Expand Up @@ -1723,7 +1735,7 @@ int AdLibDriver::update_setPriority(Channel &channel, const uint8 *values) {
// - _beatDivider is not further modified
//
// callback()
// - _beatDivCnt is a countdown, gets reinitialized to _beatDivider on zero
// - _beatDivCnt is a countdown, gets reinitialized to _beatDivider on zero
// - _beatCounter is incremented when _beatDivCnt is reset, i.e., it's a
// counter which updates with the global _tempo divided by _beatDivider.
//
Expand Down
Loading

0 comments on commit bb61712

Please sign in to comment.