Skip to content

Commit

Permalink
move to libdmdutil
Browse files Browse the repository at this point in the history
  • Loading branch information
mkalkbrenner committed Feb 19, 2024
1 parent 2825d50 commit 7d69e9c
Show file tree
Hide file tree
Showing 12 changed files with 141 additions and 785 deletions.
8 changes: 1 addition & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_C_VISIBILITY_PRESET hidden)

add_executable(ppuc_pinmame
src/dmd/dmd.h
src/dmd/dmd.cpp
src/pin2dmd/pin2dmd.h
src/pin2dmd/pin2dmd.cpp
src/ppuc.cpp
)

Expand All @@ -60,9 +56,7 @@ target_link_directories(ppuc_pinmame PUBLIC
target_link_libraries(ppuc_pinmame LINK_PUBLIC
pinmame
ppuc
serum
zedmd
dmdutil
openal
usb-1.0
cargs
)
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,11 @@ under a compatible licence.

PPUC uses
* [libpinmame](https://github.com/vpinball/pinmame)
* [libusb](https://libusb.info/)
* [libserialport](https://github.com/sigrokproject/libserialport)
* [libdmdutil](https://github.com/vpinball/libdmdutil)
* [cargs](https://github.com/likle/cargs)
* [yaml-cpp](https://github.com/jbeder/yaml-cpp)
* [openal-soft](https://github.com/kcat/openal-soft/)
* [libppuc](https://github.com/PPUC/libppuc)
* [libzedmd](https://github.com/PPUC/libzedmd)
* [libserum](https://github.com/zesinger/libserum)

## Documentation

Expand Down
8 changes: 4 additions & 4 deletions examples/t2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -751,10 +751,10 @@ pwmOutput:
number: 3
board: 2
port: 21
power: 128
holdPower: 0
holdPowerActivationTime: 0
minPulseTime: 0
power: 255
holdPower: 128
holdPowerActivationTime: 2000
minPulseTime: 5000
maxPulseTime: 0
fastFlipSwitch: 0
-
Expand Down
74 changes: 18 additions & 56 deletions platforms/linux/aarch64/external.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,39 @@
set -e

LIBCARGS_SHA=5949a20a926e902931de4a32adaad9f19c76f251
LIBUSB_SHA=4239bc3a50014b8e6a5a2a59df1fff3b7469543b
LIBOPENAL_SHA=d3875f333fb6abe2f39d82caca329414871ae53b
LIBPINMAME_SHA=master
LIBPPUC_SHA=main
LIBZEDMD_SHA=main
LIBSERUM_SHA=main
LIBDMDUTIL_SHA=master

echo "Building libraries..."
echo " LIBCARGS_SHA: ${LIBCARGS_SHA}"
echo " LIBUSB_SHA: ${LIBUSB_SHA}"
echo " LIBOPENAL_SHA: ${LIBOPENAL_SHA}"
echo " LIBPINMAME_SHA: ${LIBPINMAME_SHA}"
echo " LIBPPUC_SHA: ${LIBPPUC_SHA}"
echo " LIBZEDMD_SHA: ${LIBZEDMD_SHA}"
echo " LIBSERUM_SHA: ${LIBSERUM_SHA}"
echo " LIBDMDUTIL_SHA: ${LIBDMDUTIL_SHA}"
echo ""

rm -rf external
mkdir external
cd external

#
# libdmdutil
#

curl -sL https://github.com/vpinball/libdmdutil/archive/${LIBDMDUTIL_SHA}.zip -o libdmdutil.zip
unzip libdmdutil.zip
cd libdmdutil-${LIBDMDUTIL_SHA}
cp -r include/DMDUtil ../../third-party/include/
platforms/linux/aarch64/external.sh
rsync -a third-party/ ../../third-party
cmake -DPLATFORM=linux -DARCH=aarch64 -DCMAKE_BUILD_TYPE=Release -B build
cmake --build build
cp build/*.a ../../third-party/build-libs/linux/aarch64/
cp -P build/*.so* ../../third-party/runtime-libs/linux/aarch64/
cd ..

#
# libcargs
#
Expand All @@ -42,24 +54,6 @@ make
cp -P libcargs.so* ../../../third-party/runtime-libs/linux/aarch64/
cd ../..

#
# libusb
#

curl -sL https://github.com/libusb/libusb/archive/${LIBUSB_SHA}.zip -o libusb.zip
unzip libusb.zip
cd libusb-$LIBUSB_SHA
cp libusb/libusb.h ../../third-party/include
./bootstrap.sh
mkdir build
cd build
../configure
make -j${NUM_PROCS}
cd ..
cp build/libusb/.libs/libusb*.a ../../third-party/build-libs/linux/aarch64/
cp -P build/libusb/.libs/libusb*.so* ../../third-party/runtime-libs/linux/aarch64/
cd ..

#
# libopenal
#
Expand Down Expand Up @@ -107,35 +101,3 @@ cmake --build build
cp build/libppuc.a ../../third-party/build-libs/linux/aarch64/
cp -P build/libppuc*.so* ../../third-party/runtime-libs/linux/aarch64/
cd ..

#
# libzedmd
#

curl -sL https://github.com/PPUC/libzedmd/archive/${LIBZEDMD_SHA}.zip -o libzedmd.zip
unzip libzedmd.zip
cd libzedmd-${LIBZEDMD_SHA}
cp src/ZeDMD.h ../../third-party/include/
platforms/linux/aarch64/external.sh
rsync -a third-party/ ../../third-party
cmake -DPLATFORM=linux -DARCH=aarch64 -DCMAKE_BUILD_TYPE=Release -B build
cmake --build build
cp build/libzedmd.a ../../third-party/build-libs/linux/aarch64/
cp -P build/libzedmd*.so* ../../third-party/runtime-libs/linux/aarch64/
cd ..

#
# libserum
#

curl -sL https://github.com/zesinger/libserum/archive/${LIBSERUM_SHA}.zip -o libserum.zip
unzip libserum.zip
cd libserum-${LIBSERUM_SHA}
cp src/serum-decode.h ../../third-party/include/
rsync -a third-party/ ../../third-party
cmake -DPLATFORM=linux -DARCH=aarch64 -DCMAKE_BUILD_TYPE=Release -B build
cmake --build build
cp build/libserum.a ../../third-party/build-libs/linux/aarch64/
cp -P build/libserum*.so* ../../third-party/runtime-libs/linux/aarch64/
cd ..

73 changes: 18 additions & 55 deletions platforms/linux/x64/external.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,39 @@
set -e

LIBCARGS_SHA=5949a20a926e902931de4a32adaad9f19c76f251
LIBUSB_SHA=4239bc3a50014b8e6a5a2a59df1fff3b7469543b
LIBOPENAL_SHA=d3875f333fb6abe2f39d82caca329414871ae53b
LIBPINMAME_SHA=master
LIBPPUC_SHA=main
LIBZEDMD_SHA=main
LIBSERUM_SHA=main
LIBDMDUTIL_SHA=master

echo "Building libraries..."
echo " LIBCARGS_SHA: ${LIBCARGS_SHA}"
echo " LIBUSB_SHA: ${LIBUSB_SHA}"
echo " LIBOPENAL_SHA: ${LIBOPENAL_SHA}"
echo " LIBPINMAME_SHA: ${LIBPINMAME_SHA}"
echo " LIBPPUC_SHA: ${LIBPPUC_SHA}"
echo " LIBZEDMD_SHA: ${LIBZEDMD_SHA}"
echo " LIBSERUM_SHA: ${LIBSERUM_SHA}"
echo " LIBDMDUTIL_SHA: ${LIBDMDUTIL_SHA}"
echo ""

rm -rf external
mkdir external
cd external

#
# libdmdutil
#

curl -sL https://github.com/vpinball/libdmdutil/archive/${LIBDMDUTIL_SHA}.zip -o libdmdutil.zip
unzip libdmdutil.zip
cd libdmdutil-${LIBDMDUTIL_SHA}
cp -r include/DMDUtil ../../third-party/include/
platforms/linux/x64/external.sh
rsync -a third-party/ ../../third-party
cmake -DPLATFORM=linux -DARCH=x64 -DCMAKE_BUILD_TYPE=Release -B build
cmake --build build
cp build/*.a ../../third-party/build-libs/linux/x64/
cp -P build/*.so* ../../third-party/runtime-libs/linux/x64/
cd ..

#
# libcargs
#
Expand All @@ -42,24 +54,6 @@ make
cp -P libcargs.so* ../../../third-party/runtime-libs/linux/x64/
cd ../..

#
# libusb
#

curl -sL https://github.com/libusb/libusb/archive/${LIBUSB_SHA}.zip -o libusb.zip
unzip libusb.zip
cd libusb-$LIBUSB_SHA
cp libusb/libusb.h ../../third-party/include
./bootstrap.sh
mkdir build
cd build
../configure
make -j${NUM_PROCS}
cd ..
cp build/libusb/.libs/libusb*.a ../../third-party/build-libs/linux/x64/
cp -P build/libusb/.libs/libusb*.so* ../../third-party/runtime-libs/linux/x64/
cd ..

#
# libopenal
#
Expand Down Expand Up @@ -108,34 +102,3 @@ cp build/libppuc.a ../../third-party/build-libs/linux/x64/
cp -P build/libppuc*.so* ../../third-party/runtime-libs/linux/x64/
cd ..

#
# libzedmd
#

curl -sL https://github.com/PPUC/libzedmd/archive/${LIBZEDMD_SHA}.zip -o libzedmd.zip
unzip libzedmd.zip
cd libzedmd-${LIBZEDMD_SHA}
cp src/ZeDMD.h ../../third-party/include/
platforms/linux/x64/external.sh
rsync -a third-party/ ../../third-party
cmake -DPLATFORM=linux -DARCH=x64 -DCMAKE_BUILD_TYPE=Release -B build
cmake --build build
cp build/libzedmd.a ../../third-party/build-libs/linux/x64/
cp -P build/libzedmd*.so* ../../third-party/runtime-libs/linux/x64/
cd ..

#
# libserum
#

curl -sL https://github.com/zesinger/libserum/archive/${LIBSERUM_SHA}.zip -o libserum.zip
unzip libserum.zip
cd libserum-${LIBSERUM_SHA}
cp src/serum-decode.h ../../third-party/include/
rsync -a third-party/ ../../third-party
cmake -DPLATFORM=linux -DARCH=x64 -DCMAKE_BUILD_TYPE=Release -B build
cmake --build build
cp build/libserum.a ../../third-party/build-libs/linux/x64/
cp -P build/libserum*.so* ../../third-party/runtime-libs/linux/x64/
cd ..

74 changes: 18 additions & 56 deletions platforms/macos/arm64/external.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,39 @@
set -e

LIBCARGS_SHA=5949a20a926e902931de4a32adaad9f19c76f251
LIBUSB_SHA=4239bc3a50014b8e6a5a2a59df1fff3b7469543b
LIBOPENAL_SHA=d3875f333fb6abe2f39d82caca329414871ae53b
LIBPINMAME_SHA=master
LIBPPUC_SHA=main
LIBZEDMD_SHA=main
LIBSERUM_SHA=main
LIBDMDUTIL_SHA=master

echo "Building libraries..."
echo " LIBCARGS_SHA: ${LIBCARGS_SHA}"
echo " LIBUSB_SHA: ${LIBUSB_SHA}"
echo " LIBOPENAL_SHA: ${LIBOPENAL_SHA}"
echo " LIBPINMAME_SHA: ${LIBPINMAME_SHA}"
echo " LIBPPUC_SHA: ${LIBPPUC_SHA}"
echo " LIBZEDMD_SHA: ${LIBZEDMD_SHA}"
echo " LIBSERUM_SHA: ${LIBSERUM_SHA}"
echo " LIBDMDUTIL_SHA: ${LIBDMDUTIL_SHA}"
echo ""

rm -rf external
mkdir external
cd external

#
# libdmdutil
#

curl -sL https://github.com/vpinball/libdmdutil/archive/${LIBDMDUTIL_SHA}.zip -o libdmdutil.zip
unzip libdmdutil.zip
cd libdmdutil-${LIBDMDUTIL_SHA}
cp -r include/DMDUtil ../../third-party/include/
platforms/macos/arm64/external.sh
rsync -a third-party/ ../../third-party
cmake -DPLATFORM=macos -DARCH=arm64 -DCMAKE_BUILD_TYPE=Release -B build
cmake --build build
cp build/*.a ../../third-party/build-libs/macos/arm64/
cp -P build/*.dylib ../../third-party/runtime-libs/macos/arm64/
cd ..

#
# libcargs
#
Expand All @@ -42,24 +54,6 @@ make
cp -P libcargs*.dylib ../../../third-party/runtime-libs/macos/arm64/
cd ../..

#
# libusb
#

curl -sL https://github.com/libusb/libusb/archive/${LIBUSB_SHA}.zip -o libusb.zip
unzip libusb.zip
cd libusb-$LIBUSB_SHA
cp libusb/libusb.h ../../third-party/include
./bootstrap.sh
mkdir build
cd build
../configure --build=arm64-apple-darwin --target=arm64-apple-darwin --disable-examples-build --disable-tests-build LDFLAGS="-Wl,-install_name,@rpath/libusb-1.0.0.dylib"
make -j${NUM_PROCS}
cd ..
cp build/libusb/.libs/libusb*.a ../../third-party/build-libs/macos/arm64/
cp -P build/libusb/.libs/libusb*.dylib ../../third-party/runtime-libs/macos/arm64/
cd ..

#
# libopenal
#
Expand Down Expand Up @@ -107,35 +101,3 @@ cmake --build build
cp build/libppuc.a ../../third-party/build-libs/macos/arm64/
cp -P build/libppuc*.dylib ../../third-party/runtime-libs/macos/arm64/
cd ..

#
# libzedmd
#

curl -sL https://github.com/PPUC/libzedmd/archive/${LIBZEDMD_SHA}.zip -o libzedmd.zip
unzip libzedmd.zip
cd libzedmd-${LIBZEDMD_SHA}
cp src/ZeDMD.h ../../third-party/include/
platforms/macos/arm64/external.sh
rsync -a third-party/ ../../third-party
cmake -DPLATFORM=macos -DARCH=arm64 -DCMAKE_BUILD_TYPE=Release -B build
cmake --build build
cp build/libzedmd.a ../../third-party/build-libs/macos/arm64/
cp -P build/libzedmd*.dylib ../../third-party/runtime-libs/macos/arm64/
cd ..

#
# libserum
#

curl -sL https://github.com/zesinger/libserum/archive/${LIBSERUM_SHA}.zip -o libserum.zip
unzip libserum.zip
cd libserum-${LIBSERUM_SHA}
cp src/serum-decode.h ../../third-party/include/
rsync -a third-party/ ../../third-party
cmake -DPLATFORM=macos -DARCH=arm64 -DCMAKE_BUILD_TYPE=Release -B build
cmake --build build
cp build/libserum.a ../../third-party/build-libs/macos/arm64/
cp -P build/libserum*.dylib ../../third-party/runtime-libs/macos/arm64/
cd ..

Loading

0 comments on commit 7d69e9c

Please sign in to comment.