Skip to content

Commit

Permalink
fixed Serum colorization
Browse files Browse the repository at this point in the history
  • Loading branch information
mkalkbrenner committed Mar 28, 2024
1 parent 1e6e9eb commit 6bd992f
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 32 deletions.
4 changes: 2 additions & 2 deletions platforms/linux/aarch64/external.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LIBCARGS_SHA=5949a20a926e902931de4a32adaad9f19c76f251
LIBOPENAL_SHA=d3875f333fb6abe2f39d82caca329414871ae53b
LIBPINMAME_SHA=master
LIBPPUC_SHA=main
LIBDMDUTIL_SHA=master
LIBDMDUTIL_SHA=3af59032f9fcc0f2ea9462c6d55416cf99ad869e

echo "Building libraries..."
echo " LIBCARGS_SHA: ${LIBCARGS_SHA}"
Expand All @@ -24,7 +24,7 @@ cd external
# libdmdutil
#

curl -sL https://github.com/vpinball/libdmdutil/archive/${LIBDMDUTIL_SHA}.zip -o libdmdutil.zip
curl -sL https://github.com/ppuc/libdmdutil/archive/${LIBDMDUTIL_SHA}.zip -o libdmdutil.zip
unzip libdmdutil.zip
cd libdmdutil-${LIBDMDUTIL_SHA}
cp -r include/DMDUtil ../../third-party/include/
Expand Down
2 changes: 1 addition & 1 deletion platforms/linux/x64/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

./platforms/linux/x64/external.sh

cmake -DPLATFORM=linux -DARCH=x64 -DCMAKE_BUILD_TYPE=Release -B build
cmake -DPLATFORM=linux -DARCH=x64 -DCMAKE_BUILD_TYPE=Debug -B build
cmake --build build

rm -rf ppuc
Expand Down
4 changes: 2 additions & 2 deletions platforms/linux/x64/external.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LIBCARGS_SHA=5949a20a926e902931de4a32adaad9f19c76f251
LIBOPENAL_SHA=d3875f333fb6abe2f39d82caca329414871ae53b
LIBPINMAME_SHA=master
LIBPPUC_SHA=main
LIBDMDUTIL_SHA=master
LIBDMDUTIL_SHA=3af59032f9fcc0f2ea9462c6d55416cf99ad869e

echo "Building libraries..."
echo " LIBCARGS_SHA: ${LIBCARGS_SHA}"
Expand All @@ -24,7 +24,7 @@ cd external
# libdmdutil
#

curl -sL https://github.com/vpinball/libdmdutil/archive/${LIBDMDUTIL_SHA}.zip -o libdmdutil.zip
curl -sL https://github.com/ppuc/libdmdutil/archive/${LIBDMDUTIL_SHA}.zip -o libdmdutil.zip
unzip libdmdutil.zip
cd libdmdutil-${LIBDMDUTIL_SHA}
cp -r include/DMDUtil ../../third-party/include/
Expand Down
4 changes: 2 additions & 2 deletions platforms/macos/arm64/external.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LIBCARGS_SHA=5949a20a926e902931de4a32adaad9f19c76f251
LIBOPENAL_SHA=d3875f333fb6abe2f39d82caca329414871ae53b
LIBPINMAME_SHA=master
LIBPPUC_SHA=main
LIBDMDUTIL_SHA=master
LIBDMDUTIL_SHA=3af59032f9fcc0f2ea9462c6d55416cf99ad869e

echo "Building libraries..."
echo " LIBCARGS_SHA: ${LIBCARGS_SHA}"
Expand All @@ -24,7 +24,7 @@ cd external
# libdmdutil
#

curl -sL https://github.com/vpinball/libdmdutil/archive/${LIBDMDUTIL_SHA}.zip -o libdmdutil.zip
curl -sL https://github.com/ppuc/libdmdutil/archive/${LIBDMDUTIL_SHA}.zip -o libdmdutil.zip
unzip libdmdutil.zip
cd libdmdutil-${LIBDMDUTIL_SHA}
cp -r include/DMDUtil ../../third-party/include/
Expand Down
4 changes: 2 additions & 2 deletions platforms/macos/x64/external.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LIBCARGS_SHA=5949a20a926e902931de4a32adaad9f19c76f251
LIBOPENAL_SHA=d3875f333fb6abe2f39d82caca329414871ae53b
LIBPINMAME_SHA=master
LIBPPUC_SHA=main
LIBDMDUTIL_SHA=master
LIBDMDUTIL_SHA=3af59032f9fcc0f2ea9462c6d55416cf99ad869e

echo "Building libraries..."
echo " LIBCARGS_SHA: ${LIBCARGS_SHA}"
Expand All @@ -24,7 +24,7 @@ cd external
# libdmdutil
#

curl -sL https://github.com/vpinball/libdmdutil/archive/${LIBDMDUTIL_SHA}.zip -o libdmdutil.zip
curl -sL https://github.com/ppuc/libdmdutil/archive/${LIBDMDUTIL_SHA}.zip -o libdmdutil.zip
unzip libdmdutil.zip
cd libdmdutil-${LIBDMDUTIL_SHA}
cp -r include/DMDUtil ../../third-party/include/
Expand Down
50 changes: 27 additions & 23 deletions src/ppuc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,26 +426,6 @@ int main(int argc, char* argv[]) {
// So it is important to start that search before the RS485 BUS gets
// initialized.
DMDUtil::Config* dmdConfig = DMDUtil::Config::GetInstance();
pDmd = new DMDUtil::DMD();
if (opt_debug) {
printf("Finding displays...\n");
dmdConfig->SetZeDMDDebug(opt_debug);
}
pDmd->FindDisplays();
if (opt_console_display) {
pDmd->CreateConsoleDMD(!opt_debug);
}
if (opt_dump) {
pDmd->DumpDMDTxt();
}

while (DMDUtil::DMD::IsFinding())
std::this_thread::sleep_for(std::chrono::milliseconds(100));

if (!opt_no_serial && !ppuc->Connect()) {
printf("Unable to open serial communication to PPUC boards.\n");
return 1;
}

PinmameConfig config = {
PINMAME_AUDIO_FORMAT_INT16,
Expand Down Expand Up @@ -476,10 +456,9 @@ int main(int argc, char* argv[]) {
if (opt_serum) {
char altcolorPath[PINMAME_MAX_PATH + 10];
#if defined(_WIN32) || defined(_WIN64)
snprintf(altcolorPath, PINMAME_MAX_PATH + 9, "%s\\altcolor",
config.vpmPath);
snprintf(altcolorPath, PINMAME_MAX_PATH + 8, "%saltcolor", config.vpmPath);
#else
snprintf(altcolorPath, PINMAME_MAX_PATH + 9, "%s/altcolor", config.vpmPath);
snprintf(altcolorPath, PINMAME_MAX_PATH + 8, "%saltcolor", config.vpmPath);
#endif

dmdConfig->SetAltColorPath(altcolorPath);
Expand All @@ -497,6 +476,31 @@ int main(int argc, char* argv[]) {
ssf >> serum_skip_frames;
dmdConfig->SetMaximumUnknownFramesToSkip(serum_skip_frames);
}
} else {
dmdConfig->SetAltColor(false);
}

if (opt_debug) {
printf("Finding displays...\n");
dmdConfig->SetZeDMDDebug(opt_debug);
}

pDmd = new DMDUtil::DMD();
pDmd->SetRomName(opt_rom);
pDmd->FindDisplays();
if (opt_console_display) {
pDmd->CreateConsoleDMD(!opt_debug);
}
if (opt_dump) {
pDmd->DumpDMDTxt();
}

while (pDmd->IsFinding())
std::this_thread::sleep_for(std::chrono::milliseconds(100));

if (!opt_no_serial && !ppuc->Connect()) {
printf("Unable to open serial communication to PPUC boards.\n");
return 1;
}

// Initialize the sound device
Expand Down

0 comments on commit 6bd992f

Please sign in to comment.