Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lightgun support in fullscreen using an invisible cursor #27

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
31 changes: 31 additions & 0 deletions .gitignore
@@ -0,0 +1,31 @@
**/*.o
**/*.d
**/*.so
**/*.bak
daphne
daphne_log.txt
libsinge.so
libvldp2.so
logs/*
/roms/*
/singe
/vldp_dl
/src/vldp2/Makefile
/src/vldp2/autotools/Makefile
/src/vldp2/config.log
/src/vldp2/config.status
/src/vldp2/doc/.deps/
/src/vldp2/doc/Makefile
/src/vldp2/include/Makefile
/src/vldp2/include/config.h
/src/vldp2/include/stamp-h1
/src/vldp2/libmpeg2/.deps/
/src/vldp2/libmpeg2/Makefile
/src/vldp2/libmpeg2/libmpeg2.pc
/src/vldp2/libtool
/src/vldp2/libvo/.deps/
/src/vldp2/libvo/Makefile
/src/vldp2/src/.deps/
/src/vldp2/src/Makefile
/src/vldp2/test/Makefile
/src/vldp2/vc++/Makefile
67 changes: 48 additions & 19 deletions README.md
@@ -1,35 +1,31 @@

Daphne: the First Ever Multiple Arcade Laserdisc Emulator
=========================================================

<img src=https://raw.githubusercontent.com/baarreth/daphne/d25172eef41760559f84327672974b22aaa4e9a2/pics/daphne.gif />

Daphne, the First Ever Multiple Arcade Laserdisc Emulator is a program
that lets one play the original versions of many laserdisc arcade games
on one's PC.

The official website for Daphne is http://www.daphne-emu.com.

---
This is a fork from [DavidGriffith's work](https://github.com/DavidGriffith/daphne), and we are pretty outdated.
If you want to use a newer version, you should use the SDL2 port from [DirtBagXon](https://github.com/DirtBagXon/hypseus-singe).

### Here is the link: https://github.com/DirtBagXon/hypseus-singe

As development for Daphne has stopped, this repository is intended as
something of a continuation until the author decides to do something
official.
There is no good reason to use this outdated version, except if you are
having bugs with the SDL2 version, you are impatient and you have fun by messing with outdated code (which was my case).

## Compiling Daphne on Linux
---

## Compiling Daphne on Linux (64-bit)

These instructions will work to get Daphne built on a machine using an
amd64 processor. I'm not sure anymore how to get Daphne compiled for
32-bit Linux.
cd src
./compile_everything.sh

cd src/vldp2
./configure --disable-accel-detect
make -f Makefile.linux_x64
cd ../game/singe
make -f Makefile.linux_x64
cd ../..
ln -s Makefile.vars.linux_x64 Makefile.vars
make
cd ..
mkdir -p ~/.daphne
cp -a pics sound ~/.daphne/
This script will exit on the first error. So, pay attention on its instructions and execution.

### Missing libraries?

Expand All @@ -38,6 +34,39 @@ derivative), will install all prerequisite development libraries.

sudo apt install libsdl-dev libglew-dev libvorbis-dev libsdl-image1.2-dev libsdl-ttf2.0-dev

## Where to place this project in your computer

I suggest you create a folder called "games" in your home, another called "arcade" inside it,
and download this project inside it via git-clone.
So, you will have a "$HOME/games/arcade/daphne/", which will have the binary after compiling it.

The current practice is to place the disc images, roms and other media in "$HOME/.daphne" (a hidden folder),
but I really don't think it is a good idea for several reasons.
**You will need to copy or move "daphne/pics" and "daphne/sound" into this hidden folder**.
I suggest you to place the singe games (such as Mad Dog McCree) in "$HOME/games/arcade/daphne/singe/" and
vldp games (such as Dragon's Lair) in "$HOME/games/arcade/daphne/vldp_dl/".

*ATTENTION*: Daphne needs the games to have specific names and specific places to run.
So Dragon's Lair frames goes in "$HOME/games/arcade/daphne/vldp_dl/lair/", and its rom at
"$HOME/games/arcade/daphne/vldp_dl/roms/". The standard Daphne's name for its rom is "lair.zip"
(in Mame this **exact same rom** is called "dlair.zip").
Following this pattern, Mad Dog McCree frames should be placed at "$HOME/games/daphne/singe/maddog".

Obviously you can change this pattern...

Anyway, there are two good scripts from DavidGriffith called "run.sh" and "singe.sh",
which will run Dragon's Lair and Mad Dog McCree, respectively. Open the scripts and study them (they are
pointing to "$HOME/.daphne").
I changed them a little and renamed them to "run_vldp.sh" and "run_singe.sh"
(which are pointing to "$HOME/games/arcade/daphne"). Their settings worked fine on my raspberry pi 4b.

--------------------------------

If you are still having a hard time to configure it all, read the following text from
DavidGriffith.

--------------------------------

## Laserdisc images and ROMs

The laserdisc and game ROMs necessary to play a game are not included
Expand Down
Binary file added pics/daphne.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
73 changes: 73 additions & 0 deletions run_singe.sh
@@ -0,0 +1,73 @@
#!/bin/bash

SCRIPT_DIR=`dirname "$0"`
if realpath / >/dev/null; then SCRIPT_DIR=$(realpath "$SCRIPT_DIR"); fi
DAPHNE_BIN=daphne.bin
DAPHNE_SHARE=~/games/arcade/daphne

function STDERR () {
/bin/cat - 1>&2
}

echo "Singe Launcher : Script dir is $SCRIPT_DIR"
cd "$SCRIPT_DIR"

# point to our linked libs that user may not have
export LD_LIBRARY_PATH=$SCRIPT_DIR:$DAPHNE_SHARE:$LD_LIBRARY_PATH

if [ "$1" = "-fullscreen" ]; then
FULLSCREEN="-fullscreen"
shift
fi

if [ -z $1 ] ; then
echo "Specify a game to try: " | STDERR
echo
echo "$0 [-fullscreen] <gamename>" | STDERR
echo

echo -n "Games available: " | STDERR
for game in $(ls $DAPHNE_SHARE/singe/); do
installed="$installed $game"
done
echo "$installed" | fold -s -w60 | sed 's/^ //; s/^/\t/' | STDERR
echo
exit
fi

if [ ! -f $DAPHNE_SHARE/singe/$1/$1.singe ] || [ ! -f $DAPHNE_SHARE/singe/$1/$1.txt ]; then
echo
echo "Missing file: $DAPHNE_SHARE/singe/$1/$1.singe ?" | STDERR
echo " $DAPHNE_SHARE/singe/$1/$1.txt ?" | STDERR
echo
exit 1
fi

#strace -o strace.txt \
./$DAPHNE_BIN singe vldp \
$FULLSCREEN \
-framefile $DAPHNE_SHARE/singe/$1/$1.txt \
-script $DAPHNE_SHARE/singe/$1/$1.singe \
-homedir $DAPHNE_SHARE \
-datadir $DAPHNE_SHARE \
-sound_buffer 2048 \
-min_seek_delay 20 \
-seek_frames_per_ms 500 \
-x 1280 \
-y 720


EXIT_CODE=$?

if [ "$EXIT_CODE" -ne "0" ] ; then
if [ "$EXIT_CODE" -eq "127" ]; then
echo ""
echo "Daphne failed to start." | STDERR
echo "This is probably due to a library problem." | STDERR
echo "Run ./daphne.bin directly to see which libraries are missing." | STDERR
echo ""
else
echo "DaphneLoader failed with an unknown exit code : $EXIT_CODE." | STDERR
fi
exit $EXIT_CODE
fi
93 changes: 93 additions & 0 deletions run_vldp.sh
@@ -0,0 +1,93 @@
#!/bin/bash

SCRIPT_DIR=`dirname "$0"`
if realpath / >/dev/null; then SCRIPT_DIR=$(realpath "$SCRIPT_DIR"); fi
DAPHNE_BIN=daphne.bin
DAPHNE_SHARE=~/games/arcade/daphne

function STDERR () {
/bin/cat - 1>&2
}

echo "Daphne Launcher : Script dir is $SCRIPT_DIR"
cd "$SCRIPT_DIR"

# point to our linked libs that user may not have
export LD_LIBRARY_PATH=$SCRIPT_DIR:$DAPHNE_SHARE:$LD_LIBRARY_PATH

if [ "$1" = "-fullscreen" ]; then
FULLSCREEN="-fullscreen"
shift
fi

if [ -z "$1" ] ; then
echo "Specify a game to try: " | STDERR
echo
echo "$0 [-fullscreen] <gamename>" | STDERR


for game in ace astron badlands bega cliff cobra esh galaxyr gpworld interstellar lair lair2 mach3 roadblaster sdq tq uvt; do
if ls ${DAPHNE_SHARE}/vldp*/$game >/dev/null 2>&1; then
installed="$installed $game"
else
uninstalled="$uninstalled $game"
fi
done
if [ "$uninstalled" ]; then
echo
echo "Games not found in ${DAPHNE_SHARE}/vldp*: " | STDERR
echo "$uninstalled" | fold -s -w60 | sed 's/^ //; s/^/\t/' | STDERR
fi
if [ -z "$installed" ]; then
cat <<EOF

Error: No games installed. DVDs can be purchased from DigitalLeisure.com.
Please put the required files in ${DAPHNE_SHARE}/vldp_dl/gamename/
EOF
else
echo
echo "Games available: " | STDERR
echo "$installed" | fold -s -w60 | sed 's/^ //; s/^/\t/' | STDERR
fi
exit 1
fi

case "$1" in
lair|lair2|ace|tq)
VLDP_DIR="vldp_dl"
FASTBOOT="-fastboot"
;;
*) VLDP_DIR="vldp"
esac

#strace -o strace.txt \
./$DAPHNE_BIN $1 vldp \
$FASTBOOT \
$FULLSCREEN \
-framefile $DAPHNE_SHARE/$VLDP_DIR/$1/$1.txt \
-homedir $DAPHNE_SHARE \
-datadir $DAPHNE_SHARE \
-min_seek_delay 100 \
-seek_frames_per_ms 1000 \
-sound_buffer 2048 \
-x 1280 \
-y 720

#-bank 0 11111001 \
#-bank 1 00100111 \

EXIT_CODE=$?

if [ "$EXIT_CODE" -ne "0" ] ; then
if [ "$EXIT_CODE" -eq "127" ]; then
echo ""
echo "Daphne failed to start." | STDERR
echo "This is probably due to a library problem." | STDERR
echo "Run ./daphne.bin directly to see which libraries are missing." | STDERR
echo ""
else
echo "DaphneLoader failed with an unknown exit code : $EXIT_CODE." | STDERR
fi
exit $EXIT_CODE
fi

1 change: 1 addition & 0 deletions src/Makefile.vars
13 changes: 13 additions & 0 deletions src/compile_everything.sh
@@ -0,0 +1,13 @@
#!/bin/bash

# this is intended to run on a 64-bit machine

cd vldp2 || exit
./configure --disable-accel-detect --build=`uname -p` || exit
make -j4 -f Makefile.linux_x64 || exit
cd ../game/singe
make -j4 -f Makefile.linux_x64 || exit
cd ../..
ln -sf Makefile.vars.linux_x64 Makefile.vars
make -j4 || exit