mirror of
https://github.com/lindbergh-loader/lindbergh-loader.git
synced 2026-10-15 02:20:12 +03:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
73d2131c73 | ||
|
|
813ea1c49d |
+1
-1
@@ -129,7 +129,7 @@ IncludeIsMainRegex: '(Test)?$'
|
|||||||
IncludeIsMainSourceRegex: ''
|
IncludeIsMainSourceRegex: ''
|
||||||
IndentAccessModifiers: false
|
IndentAccessModifiers: false
|
||||||
IndentCaseBlocks: false
|
IndentCaseBlocks: false
|
||||||
IndentCaseLabels: false
|
IndentCaseLabels: true
|
||||||
IndentExternBlock: AfterExternBlock
|
IndentExternBlock: AfterExternBlock
|
||||||
IndentGotoLabels: true
|
IndentGotoLabels: true
|
||||||
IndentPPDirectives: None
|
IndentPPDirectives: None
|
||||||
|
|||||||
@@ -18,9 +18,23 @@ jobs:
|
|||||||
name: version-file
|
name: version-file
|
||||||
path: src/lindbergh/
|
path: src/lindbergh/
|
||||||
|
|
||||||
|
- name: Cache APT packages
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: /var/cache/apt/archives
|
||||||
|
key: ${{ runner.os }}-apt-${{ hashFiles('**/install-packages.sh') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-apt-
|
||||||
|
|
||||||
- name: Install Packages
|
- name: Install Packages
|
||||||
run: scripts/appimage/install-packages.sh
|
run: scripts/appimage/install-packages.sh
|
||||||
|
|
||||||
|
- name: Pack ID Libs
|
||||||
|
run: scripts/appimage/id-libs.sh
|
||||||
|
|
||||||
|
- name: Install Kisak
|
||||||
|
run: scripts/appimage/install-kisak.sh
|
||||||
|
|
||||||
- name: Build Deps
|
- name: Build Deps
|
||||||
run: scripts/appimage/build-deps.sh
|
run: scripts/appimage/build-deps.sh
|
||||||
|
|
||||||
@@ -33,6 +47,15 @@ jobs:
|
|||||||
make
|
make
|
||||||
scripts/appimage/make-appimage.sh
|
scripts/appimage/make-appimage.sh
|
||||||
|
|
||||||
|
- name: Compress build directory
|
||||||
|
run: tar -czvf build.tar.gz -C ./build .
|
||||||
|
|
||||||
|
- name: Upload build.tar.gz artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: "linux-build"
|
||||||
|
path: "build.tar.gz"
|
||||||
|
|
||||||
- name: Upload AppImage
|
- name: Upload AppImage
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
@@ -42,7 +65,8 @@ jobs:
|
|||||||
- name: Upload SDL3 and FAudio
|
- name: Upload SDL3 and FAudio
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: SDL3-FAudio
|
name: SDL3-FAudio-ID
|
||||||
path: |
|
path: |
|
||||||
libs/libs.tar
|
libs/libs.tar
|
||||||
libs/includes.tar
|
libs/includes.tar
|
||||||
|
libs/lib32ID.tar
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ jobs:
|
|||||||
- name: Download SDL3 libs
|
- name: Download SDL3 libs
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: SDL3-FAudio
|
name: SDL3-FAudio-ID
|
||||||
path: libs/
|
path: libs/
|
||||||
|
|
||||||
# Work around container ownership issue
|
# Work around container ownership issue
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ jobs:
|
|||||||
- name: Download SDL3 libs
|
- name: Download SDL3 libs
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: SDL3-FAudio
|
name: SDL3-FAudio-ID
|
||||||
path: libs/
|
path: libs/
|
||||||
|
|
||||||
# Set up Docker Buildx
|
# Set up Docker Buildx
|
||||||
|
|||||||
+61
-30
@@ -33,41 +33,30 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
CHANGELOG_FILE="./docs/changelog"
|
CHANGELOG_FILE="./docs/changelog"
|
||||||
VERSION_FILE="src/lindbergh/version.h"
|
VERSION_FILE="src/lindbergh/version.h"
|
||||||
|
|
||||||
if [[ ! -f "$CHANGELOG_FILE" ]]; then
|
if [[ ! -f "$CHANGELOG_FILE" ]]; then
|
||||||
echo "Error: Changelog file '$CHANGELOG_FILE' not found."
|
echo "Error: Changelog file '$CHANGELOG_FILE' not found."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
VERSION=$(awk '/^## \[/ { match($0, /\[([^]]+)\]/, arr); print arr[1]; exit }' "$CHANGELOG_FILE")
|
VERSION=$(awk '/^## \[/ { match($0, /\[([^]]+)\]/, arr); print arr[1]; exit }' "$CHANGELOG_FILE")
|
||||||
|
|
||||||
# Check if a version was actually extracted
|
|
||||||
if [[ -z "$VERSION" ]]; then
|
if [[ -z "$VERSION" ]]; then
|
||||||
echo "Error: Could not find version in '$CHANGELOG_FILE'. Expected format like '## [X.Y.Z]' near the top."
|
echo "Error: Could not find version in '$CHANGELOG_FILE'. Expected format like '## [X.Y.Z]' near the top."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Found version: $VERSION"
|
echo "Found version: $VERSION"
|
||||||
|
|
||||||
MAJOR=$(echo $VERSION | cut -d. -f1)
|
MAJOR=$(echo $VERSION | cut -d. -f1)
|
||||||
MINOR=$(echo $VERSION | cut -d. -f2)
|
MINOR=$(echo $VERSION | cut -d. -f2)
|
||||||
UPDATE=$(echo $VERSION | cut -d. -f3)
|
UPDATE=$(echo $VERSION | cut -d. -f3)
|
||||||
|
|
||||||
if [ -z "$UPDATE" ]; then
|
if [ -z "$UPDATE" ]; then
|
||||||
UPDATE=0
|
UPDATE=0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -f "$VERSION_FILE" ]]; then
|
if [[ ! -f "$VERSION_FILE" ]]; then
|
||||||
echo "Error: Version file '$VERSION_FILE' not found."
|
echo "Error: Version file '$VERSION_FILE' not found."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sed -i "s/\(#define MAJOR_VERSION \).*/\1$MAJOR/" "$VERSION_FILE"
|
sed -i "s/\(#define MAJOR_VERSION \).*/\1$MAJOR/" "$VERSION_FILE"
|
||||||
sed -i "s/\(#define MINOR_VERSION \).*/\1$MINOR/" "$VERSION_FILE"
|
sed -i "s/\(#define MINOR_VERSION \).*/\1$MINOR/" "$VERSION_FILE"
|
||||||
sed -i "s/\(#define UPDATE_VERSION \).*/\1$UPDATE/" "$VERSION_FILE"
|
sed -i "s/\(#define UPDATE_VERSION \).*/\1$UPDATE/" "$VERSION_FILE"
|
||||||
|
|
||||||
echo "Updated $VERSION_FILE with version $MAJOR.$MINOR.$UPDATE"
|
echo "Updated $VERSION_FILE with version $MAJOR.$MINOR.$UPDATE"
|
||||||
|
|
||||||
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_OUTPUT
|
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_OUTPUT
|
||||||
echo "RELEASE_TAG=v$VERSION" >> $GITHUB_OUTPUT
|
echo "RELEASE_TAG=v$VERSION" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
@@ -82,21 +71,15 @@ jobs:
|
|||||||
needs: prepare-source
|
needs: prepare-source
|
||||||
uses: "./.github/workflows/appimage-build.yml"
|
uses: "./.github/workflows/appimage-build.yml"
|
||||||
|
|
||||||
linux-build:
|
|
||||||
name: 💻 Linux
|
|
||||||
needs: [prepare-source, linux-appimage]
|
|
||||||
uses: "./.github/workflows/linux-build.yml"
|
|
||||||
|
|
||||||
linux-flatpak:
|
linux-flatpak:
|
||||||
name: 📦 Linux Flatpak
|
name: 📦 Linux Flatpak
|
||||||
needs: [prepare-source, linux-appimage]
|
needs: [prepare-source, linux-appimage]
|
||||||
uses: "./.github/workflows/flatpak-build.yml"
|
uses: "./.github/workflows/flatpak-build.yml"
|
||||||
|
|
||||||
create-release:
|
create-release:
|
||||||
name: 📤 Create Release
|
name: 📤 Create Release and Notify
|
||||||
needs: [linux-build, linux-flatpak, linux-appimage, prepare-source]
|
needs: [linux-flatpak, linux-appimage, prepare-source]
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -107,18 +90,66 @@ jobs:
|
|||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
path: ./artifacts/
|
path: ./artifacts/
|
||||||
|
|
||||||
- name: Display Downloaded Artifacts
|
- name: Display Downloaded Artifacts
|
||||||
run: find ./artifacts/
|
run: find ./artifacts/
|
||||||
|
|
||||||
- name: Create Release
|
- name: Parse Changelog and Save to File
|
||||||
uses: "marvinpinto/action-automatic-releases@latest"
|
id: changelog
|
||||||
with:
|
run: |
|
||||||
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
VERSION='${{ needs.prepare-source.outputs.release_version }}'
|
||||||
automatic_release_tag: ${{ needs.prepare-source.outputs.release_tag }}
|
awk -v version="$VERSION" '
|
||||||
prerelease: false
|
$0 ~ "^## \\[" version "\\]" { in_section=1; next }
|
||||||
title: "Build ${{ needs.prepare-source.outputs.release_tag }}"
|
/^## / && in_section { exit }
|
||||||
files: |
|
in_section { print }
|
||||||
|
' ./docs/changelog > RELEASENOTES.md
|
||||||
|
echo "notes_file=RELEASENOTES.md" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
|
||||||
|
- name: Create Release with GitHub CLI
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
gh release create ${{ needs.prepare-source.outputs.release_tag }} \
|
||||||
|
--title "Build ${{ needs.prepare-source.outputs.release_tag }}" \
|
||||||
|
--notes-file ${{ steps.changelog.outputs.notes_file }} \
|
||||||
|
./artifacts/linux-build/build.tar.gz \
|
||||||
|
./artifacts/linux-appimage/lindbergh-loader.AppImage \
|
||||||
./artifacts/linux-flatpak/lindbergh-loader.flatpak
|
./artifacts/linux-flatpak/lindbergh-loader.flatpak
|
||||||
./artifacts/linux-build/build.tar.gz
|
|
||||||
./artifacts/linux-appimage/lindbergh-loader.AppImage
|
- name: Notify Discord of New Release
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
# Fetch the asset details
|
||||||
|
ASSETS_JSON=$(gh release view ${{ needs.prepare-source.outputs.release_tag }} --json assets)
|
||||||
|
|
||||||
|
# Extract each URL
|
||||||
|
FLATPAK_URL=$(echo "$ASSETS_JSON" | jq -r '.assets[] | select(.name=="lindbergh-loader.flatpak") | .url')
|
||||||
|
APPIMAGE_URL=$(echo "$ASSETS_JSON" | jq -r '.assets[] | select(.name=="lindbergh-loader.AppImage") | .url')
|
||||||
|
TAR_URL=$(echo "$ASSETS_JSON" | jq -r '.assets[] | select(.name=="build.tar.gz") | .url')
|
||||||
|
|
||||||
|
# Get the changelog body (no need to escape it for jq)
|
||||||
|
CHANGELOG_BODY=$(cat ${{ steps.changelog.outputs.notes_file }} | head -c 2000)
|
||||||
|
|
||||||
|
# Use jq to build the JSON payload and pipe it to curl
|
||||||
|
jq -n \
|
||||||
|
--arg content "New lindbergh loader development build **v${{ needs.prepare-source.outputs.release_version }}** has been released!" \
|
||||||
|
--arg changelog "$CHANGELOG_BODY" \
|
||||||
|
--arg flatpak_url "$FLATPAK_URL" \
|
||||||
|
--arg appimage_url "$APPIMAGE_URL" \
|
||||||
|
--arg tar_url "$TAR_URL" \
|
||||||
|
'{
|
||||||
|
"username": "Build Bot",
|
||||||
|
"content": $content,
|
||||||
|
"embeds": [{
|
||||||
|
"description": $changelog,
|
||||||
|
"color": 5814783,
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "Downloads",
|
||||||
|
"value": "[Flatpak](\($flatpak_url))\n[AppImage](\($appimage_url))\n[Build Tarball](\($tar_url))"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}]
|
||||||
|
}' | curl -X POST -H "Content-Type: application/json" -d @- "${{ secrets.DISCORD_WEBHOOK_URL }}"
|
||||||
@@ -2,6 +2,24 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
## [2.1.1]
|
||||||
|
### Added
|
||||||
|
- HOD4 Boss battle targets should be fine now.
|
||||||
|
- Discord Bot.
|
||||||
|
- Zink support in appimage (fixes Zink in the Steam Deck).
|
||||||
|
- Change the Mesa version on the fly to fix ID games rendering issues in the appimage.
|
||||||
|
### Fixed
|
||||||
|
- A typo in the command to load custom gamecontrollerdb (--controllerdb) to match the guide.
|
||||||
|
- Disable SDL input when EvDev is selected.
|
||||||
|
- A fix to make the Maximize window button show.
|
||||||
|
### Missing from las changelog
|
||||||
|
- Harley network link support (up to 4 players)
|
||||||
|
- R-Tuned network link support (up to 4 players)
|
||||||
|
- Hummer network link support (up to 4 players)
|
||||||
|
- 2 Spicy network link support (up to 2 players)
|
||||||
|
- Sega Race TV network link support (up to 4 players)
|
||||||
|
- ID4 and ID5 network link support (up to 2 players)
|
||||||
|
|
||||||
## [2.1.0]
|
## [2.1.0]
|
||||||
### Added
|
### Added
|
||||||
- Rambo DVP-0078 (China version) support.
|
- Rambo DVP-0078 (China version) support.
|
||||||
|
|||||||
Binary file not shown.
Executable
+64
@@ -0,0 +1,64 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
PACKAGES=(
|
||||||
|
"libdrm-amdgpu1:i386"
|
||||||
|
"libdrm-intel1:i386"
|
||||||
|
"libdrm-nouveau2:i386"
|
||||||
|
"libdrm-radeon1:i386"
|
||||||
|
"libgl1-mesa-dri:i386"
|
||||||
|
"libglx-mesa0:i386"
|
||||||
|
)
|
||||||
|
|
||||||
|
COMPRESSION_TARGET_PATH="ext/usr/lib/i386-linux-gnu"
|
||||||
|
|
||||||
|
cd libs
|
||||||
|
|
||||||
|
rm -rf deb_files
|
||||||
|
mkdir -p deb_files
|
||||||
|
cd deb_files
|
||||||
|
|
||||||
|
apt-get download "${PACKAGES[@]}"
|
||||||
|
|
||||||
|
mkdir -p ext
|
||||||
|
for deb_file in *.deb; do
|
||||||
|
dpkg-deb -x "$deb_file" ext
|
||||||
|
done
|
||||||
|
|
||||||
|
rm ext/usr/lib/i386-linux-gnu/dri/i915_dri.so
|
||||||
|
ln -s -f crocus_dri.so ext/usr/lib/i386-linux-gnu/dri/i915_dri.so
|
||||||
|
rm ext/usr/lib/i386-linux-gnu/dri/iris_dri.so
|
||||||
|
ln -s -f crocus_dri.so ext/usr/lib/i386-linux-gnu/dri/iris_dri.so
|
||||||
|
rm ext/usr/lib/i386-linux-gnu/dri/kms_swrast_dri.so
|
||||||
|
ln -s -f crocus_dri.so ext/usr/lib/i386-linux-gnu/dri/kms_swrast_dri.so
|
||||||
|
rm ext/usr/lib/i386-linux-gnu/dri/nouveau_dri.so
|
||||||
|
ln -s -f crocus_dri.so ext/usr/lib/i386-linux-gnu/dri/nouveau_dri.so
|
||||||
|
rm ext/usr/lib/i386-linux-gnu/dri/r300_dri.so
|
||||||
|
ln -s -f crocus_dri.so ext/usr/lib/i386-linux-gnu/dri/r300_dri.so
|
||||||
|
rm ext/usr/lib/i386-linux-gnu/dri/r600_dri.so
|
||||||
|
ln -s -f crocus_dri.so ext/usr/lib/i386-linux-gnu/dri/r600_dri.so
|
||||||
|
rm ext/usr/lib/i386-linux-gnu/dri/radeonsi_dri.so
|
||||||
|
ln -s -f crocus_dri.so ext/usr/lib/i386-linux-gnu/dri/radeonsi_dri.so
|
||||||
|
rm ext/usr/lib/i386-linux-gnu/dri/swrast_dri.so
|
||||||
|
ln -s -f crocus_dri.so ext/usr/lib/i386-linux-gnu/dri/swrast_dri.so
|
||||||
|
rm ext/usr/lib/i386-linux-gnu/dri/virtio_gpu_dri.so
|
||||||
|
ln -s -f crocus_dri.so ext/usr/lib/i386-linux-gnu/dri/virtio_gpu_dri.so
|
||||||
|
rm ext/usr/lib/i386-linux-gnu/dri/vmwgfx_dri.so
|
||||||
|
ln -s -f crocus_dri.so ext/usr/lib/i386-linux-gnu/dri/vmwgfx_dri.so
|
||||||
|
rm ext/usr/lib/i386-linux-gnu/dri/zink_dri.so
|
||||||
|
ln -s -f crocus_dri.so ext/usr/lib/i386-linux-gnu/dri/zink_dri.so
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# cp -d /usr/lib/i386-linux-gnu/libedit.so* ext/usr/lib/i386-linux-gnu
|
||||||
|
# cp -d /usr/lib/i386-linux-gnu/libglapi.so* ext/usr/lib/i386-linux-gnu
|
||||||
|
# cp -d /usr/lib/i386-linux-gnu/libLLVM-15.so* ext/usr/lib/i386-linux-gnu
|
||||||
|
# cp -d /usr/lib/i386-linux-gnu/libsensors.so* ext/usr/lib/i386-linux-gnu
|
||||||
|
|
||||||
|
tar -cf lib32ID.tar -C "$COMPRESSION_TARGET_PATH" .
|
||||||
|
|
||||||
|
mv lib32ID.tar ../
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
rm -rf deb_files
|
||||||
Executable
+7
@@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
sudo snap refresh --hold=forever
|
||||||
|
sudo apt-mark hold linux-image-$(uname -r)
|
||||||
|
sudo apt-mark hold linux-headers-$(uname -r)
|
||||||
|
sudo add-apt-repository ppa:kisak/turtle -y
|
||||||
|
sudo apt update -y && sudo apt upgrade -y
|
||||||
@@ -2,12 +2,10 @@
|
|||||||
|
|
||||||
echo "Install Packages Running..."
|
echo "Install Packages Running..."
|
||||||
sudo dpkg --add-architecture i386
|
sudo dpkg --add-architecture i386
|
||||||
sudo apt update
|
sudo apt update # && sudo apt upgrade -y
|
||||||
sudo apt -y install --no-install-recommends \
|
sudo apt -y install --no-install-recommends \
|
||||||
build-essential gcc-multilib g++-multilib cmake fuse freeglut3-dev:i386 libvdpau1:i386 libstdc++5:i386 libxmu6:i386 \
|
build-essential gcc-multilib g++-multilib cmake fuse freeglut3-dev:i386 libvdpau1:i386 libstdc++5:i386 libxmu6:i386 \
|
||||||
libpcsclite1:i386 libncurses5:i386 unzip libsndio-dev libsndio-dev:i386 pulseaudio-utils:i386 zlib1g:i386 libgpg-error0:i386 \
|
libpcsclite1:i386 libncurses5:i386 unzip libsndio-dev libsndio-dev:i386 pulseaudio-utils:i386 zlib1g:i386 libgpg-error0:i386 \
|
||||||
libasound2 libasound2-dev libasound2:i386 libasound2-dev:i386 libfreetype6-dev:i386 libdbus-1-dev libpulse-dev libdbus-1-dev:i386 \
|
libasound2 libasound2-dev libasound2:i386 libasound2-dev:i386 libfreetype6-dev:i386 libdbus-1-dev libpulse-dev libdbus-1-dev:i386 \
|
||||||
libudev-dev:i386 libxcursor-dev:i386 libxfixes-dev:i386 libxi-dev:i386 libxrandr-dev:i386 libxss-dev:i386 libxxf86vm-dev:i386 git
|
libudev-dev:i386 libxcursor-dev:i386 libxfixes-dev:i386 libxi-dev:i386 libxrandr-dev:i386 libxss-dev:i386 libxxf86vm-dev:i386 git libvulkan1:i386 \
|
||||||
|
mesa-vulkan-drivers:i386
|
||||||
sudo add-apt-repository ppa:kisak/turtle -y
|
|
||||||
sudo apt update -y && sudo apt upgrade -y
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ APPIMAGENAME=lindbergh-loader
|
|||||||
APPIMAGEDIRNAME=lindbergh-loader.AppDir
|
APPIMAGEDIRNAME=lindbergh-loader.AppDir
|
||||||
|
|
||||||
declare -a ADDED_LIBS=(
|
declare -a ADDED_LIBS=(
|
||||||
|
"libasound.so.2"
|
||||||
"libfreetype.so.6"
|
"libfreetype.so.6"
|
||||||
"libOpenGL.so.0"
|
"libOpenGL.so.0"
|
||||||
"libGLdispatch.so.0"
|
"libGLdispatch.so.0"
|
||||||
@@ -35,6 +36,15 @@ declare -a ADDED_LIBS=(
|
|||||||
"libstdc++.so.6"
|
"libstdc++.so.6"
|
||||||
"libudev.so.1"
|
"libudev.so.1"
|
||||||
"libsndio.so.7"
|
"libsndio.so.7"
|
||||||
|
"libvulkan.so.1"
|
||||||
|
"libVkLayer_INTEL_nullhw.so"
|
||||||
|
"libVkLayer_MESA_device_select.so"
|
||||||
|
"libVkLayer_MESA_overlay.so"
|
||||||
|
"libvulkan_intel_hasvk.so"
|
||||||
|
"libvulkan_intel.so"
|
||||||
|
"libvulkan_lvp.so"
|
||||||
|
"libvulkan_radeon.so"
|
||||||
|
"libvulkan_virtio.so"
|
||||||
)
|
)
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
@@ -63,13 +73,18 @@ ADDED_LIBS_ARGS+=("--library=/usr/lib/i386-linux-gnu/pulseaudio/libpulsedsp.so")
|
|||||||
echo "Copying files into AppDir..."
|
echo "Copying files into AppDir..."
|
||||||
mkdir -p "$OUTPUT_FOLDER/usr/bin"
|
mkdir -p "$OUTPUT_FOLDER/usr/bin"
|
||||||
mkdir -p "$OUTPUT_FOLDER/usr/lib"
|
mkdir -p "$OUTPUT_FOLDER/usr/lib"
|
||||||
mkdir -p "$OUTPUT_FOLDER/usr/lib32"
|
mkdir -p "$OUTPUT_FOLDER/usr/lib32/dri"
|
||||||
|
mkdir -p "$OUTPUT_FOLDER/usr/lib32ID"
|
||||||
|
mkdir -p "$OUTPUT_FOLDER/usr/share/vulkan/icd.d"
|
||||||
|
|
||||||
|
|
||||||
# We create the AppRun file
|
# We create the AppRun file
|
||||||
cat > "$OUTPUT_FOLDER/AppRun" << 'EOF'
|
cat > "$OUTPUT_FOLDER/AppRun" << 'EOF'
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
APP_IMG_ROOT="$(dirname "$(readlink -f "$0")")"
|
APP_IMG_ROOT="$(dirname "$(readlink -f "$0")")"
|
||||||
export APP_IMG_ROOT=$APP_IMG_ROOT
|
export APP_IMG_ROOT=$APP_IMG_ROOT
|
||||||
|
VK="/$APP_IMG_ROOT/usr/share/vulkan/icd.d"
|
||||||
|
export VK_ICD_FILENAMES="$VK/intel_hasvk_icd.i686.json:$VK/intel_icd.i686.json:$VK/lvp_icd.i686.json:$VK/radeon_icd.i686.json:$VK/virtio_icd.i686.json"
|
||||||
export LD_LIBRARY_PATH="$APP_IMG_ROOT/usr/lib32:$LD_LIBRARY_PATH"
|
export LD_LIBRARY_PATH="$APP_IMG_ROOT/usr/lib32:$LD_LIBRARY_PATH"
|
||||||
exec "$APP_IMG_ROOT/usr/bin/lindbergh" "$@"
|
exec "$APP_IMG_ROOT/usr/bin/lindbergh" "$@"
|
||||||
EOF
|
EOF
|
||||||
@@ -82,7 +97,11 @@ cp lindbergh.so $OUTPUT_FOLDER/usr/lib
|
|||||||
cp libposixtime.so $OUTPUT_FOLDER/usr/lib
|
cp libposixtime.so $OUTPUT_FOLDER/usr/lib
|
||||||
cp lindbergh $OUTPUT_FOLDER/usr/bin
|
cp lindbergh $OUTPUT_FOLDER/usr/bin
|
||||||
mkdir -p $OUTPUT_FOLDER/usr/lib/dri
|
mkdir -p $OUTPUT_FOLDER/usr/lib/dri
|
||||||
cp /usr/lib/i386-linux-gnu/dri/* $OUTPUT_FOLDER/usr/lib/dri
|
cp /usr/lib/i386-linux-gnu/dri/libdril_dri.so $OUTPUT_FOLDER/usr/lib/dri/libdril_dri.so
|
||||||
|
cp /usr/share/vulkan/icd.d/* $OUTPUT_FOLDER/usr/share/vulkan/icd.d
|
||||||
|
for file in $OUTPUT_FOLDER/usr/share/vulkan/icd.d/*; do
|
||||||
|
sed -i 's|/usr/lib/i386-linux-gnu/||' "$file"
|
||||||
|
done
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
echo "Running linuxdeploy to create AppDir..."
|
echo "Running linuxdeploy to create AppDir..."
|
||||||
@@ -94,18 +113,33 @@ mv $OUTPUT_FOLDER/usr/lib/libkswapapi.so $OUTPUT_FOLDER/usr/lib32
|
|||||||
mv $OUTPUT_FOLDER/usr/lib/libsegaapi.so $OUTPUT_FOLDER/usr/lib32
|
mv $OUTPUT_FOLDER/usr/lib/libsegaapi.so $OUTPUT_FOLDER/usr/lib32
|
||||||
mv $OUTPUT_FOLDER/usr/lib/lindbergh.so $OUTPUT_FOLDER/usr/lib32
|
mv $OUTPUT_FOLDER/usr/lib/lindbergh.so $OUTPUT_FOLDER/usr/lib32
|
||||||
mv $OUTPUT_FOLDER/usr/lib/libposixtime.so $OUTPUT_FOLDER/usr/lib32
|
mv $OUTPUT_FOLDER/usr/lib/libposixtime.so $OUTPUT_FOLDER/usr/lib32
|
||||||
mv $OUTPUT_FOLDER/usr/lib/dri $OUTPUT_FOLDER/usr/lib32
|
mv $OUTPUT_FOLDER/usr/lib/dri $OUTPUT_FOLDER/usr/lib32/
|
||||||
|
ln -s -f libdril_dri.so $OUTPUT_FOLDER/usr/lib32/dri/crocus_dri.so
|
||||||
|
ln -s -f libdril_dri.so $OUTPUT_FOLDER/usr/lib32/dri/i915_dri.so
|
||||||
|
ln -s -f libdril_dri.so $OUTPUT_FOLDER/usr/lib32/dri/iris_dri.so
|
||||||
|
ln -s -f libdril_dri.so $OUTPUT_FOLDER/usr/lib32/dri/kms_swrast_dri.so
|
||||||
|
ln -s -f libdril_dri.so $OUTPUT_FOLDER/usr/lib32/dri/nouveau_dri.so
|
||||||
|
ln -s -f libdril_dri.so $OUTPUT_FOLDER/usr/lib32/dri/r300_dri.so
|
||||||
|
ln -s -f libdril_dri.so $OUTPUT_FOLDER/usr/lib32/dri/r600_dri.so
|
||||||
|
ln -s -f libdril_dri.so $OUTPUT_FOLDER/usr/lib32/dri/radeonsi_dri.so
|
||||||
|
ln -s -f libdril_dri.so $OUTPUT_FOLDER/usr/lib32/dri/swrast_dri.so
|
||||||
|
ln -s -f libdril_dri.so $OUTPUT_FOLDER/usr/lib32/dri/virtio_gpu_dri.so
|
||||||
|
ln -s -f libdril_dri.so $OUTPUT_FOLDER/usr/lib32/dri/vmwgfx_dri.so
|
||||||
|
ln -s -f libdril_dri.so $OUTPUT_FOLDER/usr/lib32/dri/zink_dri.so
|
||||||
|
|
||||||
|
|
||||||
unzip libs/Cg-3.1.zip -d $OUTPUT_FOLDER/usr/lib32
|
unzip libs/Cg-3.1.zip -d $OUTPUT_FOLDER/usr/lib32
|
||||||
cp libs/libCg.so $OUTPUT_FOLDER/usr/lib32/libCg2.so
|
cp libs/libCg.so $OUTPUT_FOLDER/usr/lib32/libCg2.so
|
||||||
cp libs/libopenal.so.0 $OUTPUT_FOLDER/usr/lib32/libopenal.so.0
|
cp libs/libopenal.so.0 $OUTPUT_FOLDER/usr/lib32/libopenal.so.0
|
||||||
cp libs/libcrypto.so.0.9.7 $OUTPUT_FOLDER/usr/lib32/libcrypto.so.0.9.7
|
cp libs/libcrypto.so.0.9.7 $OUTPUT_FOLDER/usr/lib32/libcrypto.so.0.9.7
|
||||||
cp libs/libssl.so.0.9.7 $OUTPUT_FOLDER/usr/lib32/libssl.so.0.9.7
|
cp libs/libssl.so.0.9.7 $OUTPUT_FOLDER/usr/lib32/libssl.so.0.9.7
|
||||||
|
tar -xf libs/lib32ID.tar -C $OUTPUT_FOLDER/usr/lib32ID
|
||||||
ln -s -f libposixtime.so $OUTPUT_FOLDER/usr/lib32/libposixtime.so.1
|
ln -s -f libposixtime.so $OUTPUT_FOLDER/usr/lib32/libposixtime.so.1
|
||||||
ln -s -f libposixtime.so $OUTPUT_FOLDER/usr/lib32/libposixtime.so.2.4
|
ln -s -f libposixtime.so $OUTPUT_FOLDER/usr/lib32/libposixtime.so.2.4
|
||||||
ln -s -f libkswapapi.so $OUTPUT_FOLDER/usr/lib32/libGLcore.so.1
|
ln -s -f libkswapapi.so $OUTPUT_FOLDER/usr/lib32/libGLcore.so.1
|
||||||
ln -s -f libkswapapi.so $OUTPUT_FOLDER/usr/lib32/libnvidia-tls.so.1
|
ln -s -f libkswapapi.so $OUTPUT_FOLDER/usr/lib32/libnvidia-tls.so.1
|
||||||
ln -s -f libGLX.so $OUTPUT_FOLDER/usr/lib32/libGLX.so.0
|
ln -s -f libGLX.so $OUTPUT_FOLDER/usr/lib32/libGLX.so.0
|
||||||
|
rm -rf $OUTPUT_FOLDER/usr/share/doc
|
||||||
|
|
||||||
echo "Generating AppImage..."
|
echo "Generating AppImage..."
|
||||||
rm -f "$APPIMAGENAME.AppImage"
|
rm -f "$APPIMAGENAME.AppImage"
|
||||||
|
|||||||
@@ -37,19 +37,18 @@ add-extensions:
|
|||||||
org.freedesktop.Platform.Compat.i386:
|
org.freedesktop.Platform.Compat.i386:
|
||||||
directory: lib/i386-linux-gnu
|
directory: lib/i386-linux-gnu
|
||||||
version: *runtime-version
|
version: *runtime-version
|
||||||
no-autodownload: true
|
|
||||||
|
|
||||||
org.freedesktop.Platform.Compat.i386.Debug:
|
org.freedesktop.Platform.Compat.i386.Debug:
|
||||||
directory: lib/debug/lib/i386-linux-gnu
|
directory: lib/debug/lib/i386-linux-gnu
|
||||||
version: *runtime-version
|
version: *runtime-version
|
||||||
no-autodownload: true
|
# no-autodownload: true
|
||||||
|
|
||||||
org.freedesktop.Platform.GL32:
|
org.freedesktop.Platform.GL32:
|
||||||
directory: lib/i386-linux-gnu/GL
|
directory: lib/i386-linux-gnu/GL
|
||||||
version: *gl-version
|
version: *gl-version
|
||||||
versions: *gl-versions
|
versions: *gl-versions
|
||||||
subdirectories: true
|
subdirectories: true
|
||||||
no-autodownload: true
|
# no-autodownload: true
|
||||||
autodelete: false
|
autodelete: false
|
||||||
add-ld-path: lib
|
add-ld-path: lib
|
||||||
merge-dirs: *gl-merge-dirs
|
merge-dirs: *gl-merge-dirs
|
||||||
@@ -61,8 +60,8 @@ add-extensions:
|
|||||||
directory: lib/debug/lib/i386-linux-gnu/GL
|
directory: lib/debug/lib/i386-linux-gnu/GL
|
||||||
version: *gl-version
|
version: *gl-version
|
||||||
versions: *gl-versions
|
versions: *gl-versions
|
||||||
subdirectories: true
|
# subdirectories: true
|
||||||
no-autodownload: true
|
# no-autodownload: true
|
||||||
merge-dirs: *gl-merge-dirs
|
merge-dirs: *gl-merge-dirs
|
||||||
enable-if: active-gl-driver
|
enable-if: active-gl-driver
|
||||||
autoprune-unless: active-gl-driver
|
autoprune-unless: active-gl-driver
|
||||||
@@ -77,7 +76,7 @@ modules:
|
|||||||
- type: file
|
- type: file
|
||||||
path: ./assets/libstdc++.so.5
|
path: ./assets/libstdc++.so.5
|
||||||
|
|
||||||
- name: SDL3-FAudio
|
- name: SDL3-FAudio-ID
|
||||||
buildsystem: simple
|
buildsystem: simple
|
||||||
build-commands:
|
build-commands:
|
||||||
- tar -xf libs/libs.tar -C /app/lib32
|
- tar -xf libs/libs.tar -C /app/lib32
|
||||||
@@ -105,10 +104,11 @@ modules:
|
|||||||
config-opts:
|
config-opts:
|
||||||
- -DCMAKE_BUILD_TYPE=Release
|
- -DCMAKE_BUILD_TYPE=Release
|
||||||
- -DCMAKE_INSTALL_PREFIX=/app
|
- -DCMAKE_INSTALL_PREFIX=/app
|
||||||
|
- -DCMAKE_POLICY_VERSION_MINIMUM=3.5
|
||||||
sources:
|
sources:
|
||||||
- type: archive
|
- type: git
|
||||||
url: https://downloads.sourceforge.net/freeglut/freeglut-3.2.2.tar.gz
|
url: https://github.com/freeglut/freeglut.git
|
||||||
sha256: c5944a082df0bba96b5756dddb1f75d0cd72ce27b5395c6c1dde85c2ff297a50
|
branch: master
|
||||||
build-options:
|
build-options:
|
||||||
arch:
|
arch:
|
||||||
x86_64: *i386-build-options
|
x86_64: *i386-build-options
|
||||||
@@ -151,11 +151,8 @@ modules:
|
|||||||
url: https://xorg.freedesktop.org/releases/individual/lib/libXmu-1.2.1.tar.gz
|
url: https://xorg.freedesktop.org/releases/individual/lib/libXmu-1.2.1.tar.gz
|
||||||
sha256: bf0902583dd1123856c11e0a5085bd3c6e9886fbbd44954464975fd7d52eb599
|
sha256: bf0902583dd1123856c11e0a5085bd3c6e9886fbbd44954464975fd7d52eb599
|
||||||
build-options:
|
build-options:
|
||||||
env:
|
arch:
|
||||||
CC: /usr/lib/sdk/toolchain-i386/bin/i686-unknown-linux-gnu-gcc
|
x86_64: *i386-build-options
|
||||||
CXX: /usr/lib/sdk/toolchain-i386/bin/i686-unknown-linux-gnu-g++
|
|
||||||
LD: /usr/lib/sdk/toolchain-i386/bin/i686-unknown-linux-gnu-ld
|
|
||||||
libdir: /app/lib32
|
|
||||||
|
|
||||||
- name: libmd
|
- name: libmd
|
||||||
buildsystem: autotools
|
buildsystem: autotools
|
||||||
@@ -181,25 +178,6 @@ modules:
|
|||||||
arch:
|
arch:
|
||||||
x86_64: *i386-build-options
|
x86_64: *i386-build-options
|
||||||
|
|
||||||
- name: ncurses
|
|
||||||
buildsystem: autotools
|
|
||||||
config-opts:
|
|
||||||
- --libdir=/app/lib32
|
|
||||||
- --with-shared
|
|
||||||
- --without-debug
|
|
||||||
sources:
|
|
||||||
- type: archive
|
|
||||||
url: https://invisible-island.net/archives/ncurses/ncurses-5.9.tar.gz
|
|
||||||
sha256: 9046298fb440324c9d4135ecea7879ffed8546dd1b58e59430ea07a4633f563b
|
|
||||||
- type: patch
|
|
||||||
path: ./assets/ncurses-5.9.patch
|
|
||||||
build-options:
|
|
||||||
arch:
|
|
||||||
x86_64: *i386-build-options
|
|
||||||
env:
|
|
||||||
CPPFLAGS: "-P"
|
|
||||||
CXXFLAGS: "-std=c++14"
|
|
||||||
|
|
||||||
- name: nvidia-cg-toolkit
|
- name: nvidia-cg-toolkit
|
||||||
buildsystem: simple
|
buildsystem: simple
|
||||||
build-commands:
|
build-commands:
|
||||||
@@ -230,6 +208,24 @@ modules:
|
|||||||
url: https://pcsclite.apdu.fr/files/pcsc-lite-2.3.1.tar.xz
|
url: https://pcsclite.apdu.fr/files/pcsc-lite-2.3.1.tar.xz
|
||||||
sha256: a641d44d57affe1edd8365dd75307afc307e7eefb4e7ad839f6f146baa41ed56
|
sha256: a641d44d57affe1edd8365dd75307afc307e7eefb4e7ad839f6f146baa41ed56
|
||||||
|
|
||||||
|
# Build 32-bit libFAudio (static)
|
||||||
|
- name: libFAudio-Static
|
||||||
|
buildsystem: cmake-ninja
|
||||||
|
config-opts:
|
||||||
|
- -DBUILD_SHARED_LIBS=off
|
||||||
|
- -DCMAKE_INSTALL_PREFIX=/app
|
||||||
|
- -DCMAKE_INSTALL_LIBDIR=/app/lib32
|
||||||
|
build-options:
|
||||||
|
arch:
|
||||||
|
x86_64: *i386-build-options
|
||||||
|
env:
|
||||||
|
CFLAGS: "-m32 -mstackrealign"
|
||||||
|
CXXFLAGS: "-m32 -mstackrealign"
|
||||||
|
sources:
|
||||||
|
- type: git
|
||||||
|
url: https://github.com/FNA-XNA/FAudio.git
|
||||||
|
branch: master
|
||||||
|
|
||||||
- name: lindbergh-loader
|
- name: lindbergh-loader
|
||||||
buildsystem: simple
|
buildsystem: simple
|
||||||
build-commands:
|
build-commands:
|
||||||
@@ -251,6 +247,7 @@ modules:
|
|||||||
- ln -s -f libposixtime.so /app/lib32/libposixtime.so.2.4
|
- ln -s -f libposixtime.so /app/lib32/libposixtime.so.2.4
|
||||||
- ln -s -f libkswapapi.so /app/lib32/libGLcore.so.1
|
- ln -s -f libkswapapi.so /app/lib32/libGLcore.so.1
|
||||||
- ln -s -f libkswapapi.so /app/lib32/libnvidia-tls.so.1
|
- ln -s -f libkswapapi.so /app/lib32/libnvidia-tls.so.1
|
||||||
|
- ln -s -f /usr/lib/i386-linux-gnu/libncurses.so /app/lib32/libncurses.so.5
|
||||||
build-options:
|
build-options:
|
||||||
arch:
|
arch:
|
||||||
x86_64: *i386-build-options
|
x86_64: *i386-build-options
|
||||||
@@ -274,10 +271,6 @@ modules:
|
|||||||
- find /app/lib /app/lib32 -name '*.a' -type f -delete
|
- find /app/lib /app/lib32 -name '*.a' -type f -delete
|
||||||
- find /app/lib /app/lib32 -name '*.la' -type f -delete
|
- find /app/lib /app/lib32 -name '*.la' -type f -delete
|
||||||
- find /app/bin -mindepth 1 ! -name "lindbergh*" -exec rm -f {} \;
|
- find /app/bin -mindepth 1 ! -name "lindbergh*" -exec rm -f {} \;
|
||||||
- rm -d /app/lib/terminfo
|
|
||||||
- rm -rf /app/lib/pkgconfig /app/lib32/pkgconfig /app/share/pkgconfig /app/lib32/cmake /app/lib/debug /app/include /app/man /app/share
|
- rm -rf /app/lib/pkgconfig /app/lib32/pkgconfig /app/share/pkgconfig /app/lib32/cmake /app/lib/debug /app/include /app/man /app/share
|
||||||
- rm /app/lib32/libmenu.*
|
|
||||||
- rm /app/lib32/libform.*
|
|
||||||
- rm /app/lib32/libpanel.*
|
|
||||||
- rm /app/lib32/libXmuu.*
|
- rm /app/lib32/libXmuu.*
|
||||||
- rm /app/lib32/libbsd.so
|
- rm /app/lib32/libbsd.so
|
||||||
|
|||||||
+144
-141
@@ -88,21 +88,24 @@ int initBaseboard()
|
|||||||
|
|
||||||
strcpy(serialString, SERIAL_STRING);
|
strcpy(serialString, SERIAL_STRING);
|
||||||
|
|
||||||
time_t t = time(NULL); // Get current time
|
time_t t = time(NULL); // Get current time
|
||||||
struct tm *tm_info = localtime(&t); // Convert to local time structure
|
struct tm *tm_info = localtime(&t); // Convert to local time structure
|
||||||
|
|
||||||
int month = tm_info->tm_mon + 1; // tm_mon is 0-based (0 = Jan, 4 = May)
|
int month = tm_info->tm_mon + 1; // tm_mon is 0-based (0 = Jan, 4 = May)
|
||||||
int day = tm_info->tm_mday; // tm_mday is the day of the month
|
int day = tm_info->tm_mday; // tm_mday is the day of the month
|
||||||
|
|
||||||
if (month == 1 && day == 18) {
|
if (month == 1 && day == 18)
|
||||||
|
{
|
||||||
strcpy(serialString, "HAPPY BIRTHDAY!!");
|
strcpy(serialString, "HAPPY BIRTHDAY!!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (month == 5 && day == 20) {
|
if (month == 5 && day == 20)
|
||||||
|
{
|
||||||
strcpy(serialString, "HAPPY BIRTHDAY!!");
|
strcpy(serialString, "HAPPY BIRTHDAY!!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (month == 5 && day == 21) {
|
if (month == 5 && day == 21)
|
||||||
|
{
|
||||||
strcpy(serialString, "HAPPY BIRTHDAY!!");
|
strcpy(serialString, "HAPPY BIRTHDAY!!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,171 +135,171 @@ int baseboardIoctl(int fd, unsigned long request, void *data)
|
|||||||
switch (request)
|
switch (request)
|
||||||
{
|
{
|
||||||
|
|
||||||
case BASEBOARD_GET_VERSION:
|
case BASEBOARD_GET_VERSION:
|
||||||
{
|
|
||||||
uint8_t versionData[4] = {0x00, 0x19, 0x20, 0x07};
|
|
||||||
memcpy(data, versionData, 4);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BASEBOARD_INIT:
|
|
||||||
{
|
|
||||||
// selectReply = -1; Considering adding this in
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BASEBOARD_READY: // Not sure if this is what it should be called
|
|
||||||
{
|
|
||||||
selectReply = 0;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BASEBOARD_SEEK_SHM:
|
|
||||||
{
|
|
||||||
sharedMemoryIndex = (size_t)data;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BASEBOARD_READ_SRAM:
|
|
||||||
{
|
|
||||||
readData_t *_data = data;
|
|
||||||
fseek(sram, _data->offset, SEEK_SET);
|
|
||||||
fread(_data->data, 1, _data->size, sram);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BASEBOARD_WRITE_SRAM:
|
|
||||||
{
|
|
||||||
writeData_t *_data = data;
|
|
||||||
fseek(sram, _data->offset, SEEK_SET);
|
|
||||||
fwrite(_data->data, 1, _data->size, sram);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BASEBOARD_REQUEST:
|
|
||||||
{
|
|
||||||
uint32_t *_data = data;
|
|
||||||
|
|
||||||
switch (_data[0])
|
|
||||||
{
|
{
|
||||||
|
uint8_t versionData[4] = {0x00, 0x19, 0x20, 0x07};
|
||||||
case BASEBOARD_GET_SERIAL: // bcCmdSysInfoGetReq
|
memcpy(data, versionData, 4);
|
||||||
{
|
return 0;
|
||||||
serialCommand.destAddress = _data[1];
|
|
||||||
serialCommand.destSize = _data[2];
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BASEBOARD_WRITE_FLASH: // bcCmdSysFlashWrite
|
case BASEBOARD_INIT:
|
||||||
{
|
{
|
||||||
log_warn("The game attempted to write to the baseboard flash\n");
|
// selectReply = -1; Considering adding this in
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BASEBOARD_PROCESS_JVS:
|
case BASEBOARD_READY: // Not sure if this is what it should be called
|
||||||
{
|
{
|
||||||
jvsCommand.srcAddress = _data[1];
|
selectReply = 0;
|
||||||
jvsCommand.srcSize = _data[2];
|
return 0;
|
||||||
jvsCommand.destAddress = _data[3];
|
}
|
||||||
jvsCommand.destSize = _data[4];
|
break;
|
||||||
memcpy(inputBuffer, &sharedMemory[jvsCommand.srcAddress], jvsCommand.srcSize);
|
|
||||||
|
|
||||||
if (getConfig()->emulateJVS)
|
case BASEBOARD_SEEK_SHM:
|
||||||
|
{
|
||||||
|
sharedMemoryIndex = (size_t)data;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case BASEBOARD_READ_SRAM:
|
||||||
|
{
|
||||||
|
readData_t *_data = data;
|
||||||
|
fseek(sram, _data->offset, SEEK_SET);
|
||||||
|
fread(_data->data, 1, _data->size, sram);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case BASEBOARD_WRITE_SRAM:
|
||||||
|
{
|
||||||
|
writeData_t *_data = data;
|
||||||
|
fseek(sram, _data->offset, SEEK_SET);
|
||||||
|
fwrite(_data->data, 1, _data->size, sram);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case BASEBOARD_REQUEST:
|
||||||
|
{
|
||||||
|
uint32_t *_data = data;
|
||||||
|
|
||||||
|
switch (_data[0])
|
||||||
{
|
{
|
||||||
processPacket(&jvsPacketSize);
|
|
||||||
}
|
case BASEBOARD_GET_SERIAL: // bcCmdSysInfoGetReq
|
||||||
else if (jvsFileDescriptor >= 0)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < jvsCommand.srcSize; i++)
|
|
||||||
{
|
{
|
||||||
write(jvsFileDescriptor, &inputBuffer[i], 1);
|
serialCommand.destAddress = _data[1];
|
||||||
if (inputBuffer[i] == 0xF0)
|
serialCommand.destSize = _data[2];
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case BASEBOARD_WRITE_FLASH: // bcCmdSysFlashWrite
|
||||||
|
{
|
||||||
|
log_warn("The game attempted to write to the baseboard flash\n");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case BASEBOARD_PROCESS_JVS:
|
||||||
|
{
|
||||||
|
jvsCommand.srcAddress = _data[1];
|
||||||
|
jvsCommand.srcSize = _data[2];
|
||||||
|
jvsCommand.destAddress = _data[3];
|
||||||
|
jvsCommand.destSize = _data[4];
|
||||||
|
memcpy(inputBuffer, &sharedMemory[jvsCommand.srcAddress], jvsCommand.srcSize);
|
||||||
|
|
||||||
|
if (getConfig()->emulateJVS)
|
||||||
{
|
{
|
||||||
setSenseLine(3);
|
processPacket(&jvsPacketSize);
|
||||||
}
|
}
|
||||||
else if (inputBuffer[i] == 0xF1)
|
else if (jvsFileDescriptor >= 0)
|
||||||
{
|
{
|
||||||
setSenseLine(1);
|
for (int i = 0; i < jvsCommand.srcSize; i++)
|
||||||
|
{
|
||||||
|
write(jvsFileDescriptor, &inputBuffer[i], 1);
|
||||||
|
if (inputBuffer[i] == 0xF0)
|
||||||
|
{
|
||||||
|
setSenseLine(3);
|
||||||
|
}
|
||||||
|
else if (inputBuffer[i] == 0xF1)
|
||||||
|
{
|
||||||
|
setSenseLine(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case BASEBOARD_GET_SENSE_LINE:
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
printf("Error: Unknown baseboard command %X\n", _data[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Acknowledge the command
|
||||||
|
_data[0] |= 0xF0000000;
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BASEBOARD_GET_SENSE_LINE:
|
case BASEBOARD_RECEIVE:
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
printf("Error: Unknown baseboard command %X\n", _data[0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Acknowledge the command
|
|
||||||
_data[0] |= 0xF0000000;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BASEBOARD_RECEIVE:
|
|
||||||
{
|
|
||||||
uint32_t *_data = data;
|
|
||||||
|
|
||||||
switch (_data[0] & 0xFFF)
|
|
||||||
{
|
{
|
||||||
|
uint32_t *_data = data;
|
||||||
|
|
||||||
case BASEBOARD_GET_SERIAL:
|
switch (_data[0] & 0xFFF)
|
||||||
{
|
|
||||||
memcpy(&sharedMemory[serialCommand.destAddress + 96], serialString, strlen(serialString));
|
|
||||||
_data[1] = 1; // Set the status to success
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BASEBOARD_GET_SENSE_LINE:
|
|
||||||
{
|
|
||||||
_data[2] = getSenseLine();
|
|
||||||
_data[1] = 1; // Set the status to success
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BASEBOARD_PROCESS_JVS:
|
|
||||||
{
|
|
||||||
if (getConfig()->emulateJVS)
|
|
||||||
{
|
{
|
||||||
memcpy(&sharedMemory[jvsCommand.destAddress], outputBuffer, jvsPacketSize);
|
|
||||||
_data[2] = jvsCommand.destAddress;
|
case BASEBOARD_GET_SERIAL:
|
||||||
_data[3] = jvsPacketSize;
|
{
|
||||||
_data[1] = 1; // Set the status to success
|
memcpy(&sharedMemory[serialCommand.destAddress + 96], serialString, strlen(serialString));
|
||||||
}
|
_data[1] = 1; // Set the status to success
|
||||||
else if (jvsFileDescriptor >= 0)
|
}
|
||||||
{
|
break;
|
||||||
JVSFrame frame = readJVSFrameFromThread();
|
|
||||||
memcpy(&sharedMemory[jvsCommand.destAddress], frame.buffer, frame.size);
|
case BASEBOARD_GET_SENSE_LINE:
|
||||||
_data[2] = jvsCommand.destAddress;
|
{
|
||||||
_data[3] = frame.size;
|
_data[2] = getSenseLine();
|
||||||
_data[1] = frame.ready;
|
_data[1] = 1; // Set the status to success
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case BASEBOARD_PROCESS_JVS:
|
||||||
|
{
|
||||||
|
if (getConfig()->emulateJVS)
|
||||||
|
{
|
||||||
|
memcpy(&sharedMemory[jvsCommand.destAddress], outputBuffer, jvsPacketSize);
|
||||||
|
_data[2] = jvsCommand.destAddress;
|
||||||
|
_data[3] = jvsPacketSize;
|
||||||
|
_data[1] = 1; // Set the status to success
|
||||||
|
}
|
||||||
|
else if (jvsFileDescriptor >= 0)
|
||||||
|
{
|
||||||
|
JVSFrame frame = readJVSFrameFromThread();
|
||||||
|
memcpy(&sharedMemory[jvsCommand.destAddress], frame.buffer, frame.size);
|
||||||
|
_data[2] = jvsCommand.destAddress;
|
||||||
|
_data[3] = frame.size;
|
||||||
|
_data[1] = frame.ready;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
printf("Error: Unknown baseboard receive command %X\n", _data[0] & 0xFFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Acknowledge the command
|
||||||
|
_data[0] |= 0xF0000000;
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
printf("Error: Unknown baseboard receive command %X\n", _data[0] & 0xFFF);
|
printf("Error: Unknown baseboard ioctl %lX\n", request);
|
||||||
}
|
|
||||||
|
|
||||||
// Acknowledge the command
|
|
||||||
_data[0] |= 0xF0000000;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
printf("Error: Unknown baseboard ioctl %lX\n", request);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ extern SDL_Window *sdlWindow;
|
|||||||
extern Display *x11Display;
|
extern Display *x11Display;
|
||||||
extern char sdlGameTitle[];
|
extern char sdlGameTitle[];
|
||||||
extern char current_text[256];
|
extern char current_text[256];
|
||||||
extern double local_fps;
|
extern double localFps;
|
||||||
bool winHidden = true;
|
bool winHidden = true;
|
||||||
|
|
||||||
void *displayFunc = NULL;
|
void *displayFunc = NULL;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ extern SDL_Window *sdlWindow;
|
|||||||
extern SDL_GLContext sdlContext;
|
extern SDL_GLContext sdlContext;
|
||||||
extern Display *x11Display;
|
extern Display *x11Display;
|
||||||
extern char sdlGameTitle[];
|
extern char sdlGameTitle[];
|
||||||
double local_fps = 0.0;
|
double localFps = 0.0;
|
||||||
|
|
||||||
bool createContextCalled = false;
|
bool createContextCalled = false;
|
||||||
int ctxCnt = 0;
|
int ctxCnt = 0;
|
||||||
@@ -49,8 +49,8 @@ void glXSwapBuffers(Display *dpy, GLXDrawable drawable)
|
|||||||
frameTiming();
|
frameTiming();
|
||||||
|
|
||||||
char windowTitle[512];
|
char windowTitle[512];
|
||||||
local_fps = calculateFps();
|
localFps = calculateFps();
|
||||||
sprintf(windowTitle, "%s - FPS: %.2f", sdlGameTitle, local_fps);
|
sprintf(windowTitle, "%s - FPS: %.2f", sdlGameTitle, localFps);
|
||||||
SDL_SetWindowTitle(sdlWindow, windowTitle);
|
SDL_SetWindowTitle(sdlWindow, windowTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+71
-25
@@ -8,6 +8,7 @@
|
|||||||
#include <libgen.h>
|
#include <libgen.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
#include "configIni.h"
|
#include "configIni.h"
|
||||||
#include "evdevInput.h"
|
#include "evdevInput.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
@@ -122,6 +123,34 @@ uint32_t cleanElfCRC32[] = {
|
|||||||
|
|
||||||
int cleanElfCRC32Count = sizeof(cleanElfCRC32) / sizeof(uint32_t);
|
int cleanElfCRC32Count = sizeof(cleanElfCRC32) / sizeof(uint32_t);
|
||||||
|
|
||||||
|
bool isIDGame()
|
||||||
|
{
|
||||||
|
switch (elf_crc)
|
||||||
|
{
|
||||||
|
case 0x22905D60: // DVP-0019A | id4.elf
|
||||||
|
case 0x43582D48: // DVP-0019B | id4.elf
|
||||||
|
case 0x2D2A18C1: // DVP-0019C | id4.elf
|
||||||
|
case 0x9BFD0D98: // DVP-0019D | id4.elf
|
||||||
|
case 0x9CF9BBCC: // DVP-0019G | id4.elf
|
||||||
|
case 0xC345E213: // DVP-0030B | id4.elf
|
||||||
|
case 0x98E6A516: // DVP-0030C | id4.elf
|
||||||
|
case 0xF67365C9: // DVP-0030D | id4.elf
|
||||||
|
case 0xE4F202BB: // DVP-0070A | id5.elf
|
||||||
|
case 0x400C09CD: // DVP-0070C | id5.elf
|
||||||
|
case 0x2E6732A3: // DVP-0070F | id5.elf
|
||||||
|
case 0xF99A3CDB: // DVP-0075 | id5.elf
|
||||||
|
case 0x8DF6BBF9: // DVP-0084 | id5.elf
|
||||||
|
case 0x2AF8004E: // DVP-0084A | id5.elf
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
uint32_t calcCrc32(uint32_t crc, uint8_t data)
|
uint32_t calcCrc32(uint32_t crc, uint8_t data)
|
||||||
{
|
{
|
||||||
crc ^= data;
|
crc ^= data;
|
||||||
@@ -204,12 +233,11 @@ void isCleanElf(char *command)
|
|||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t crc;
|
if (calculateCRC32inChunks(elfName, &elf_crc) != 0)
|
||||||
if (calculateCRC32inChunks(elfName, &crc) != 0)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
crc = crc ^ 0xFFFFFFFF;
|
elf_crc = elf_crc ^ 0xFFFFFFFF;
|
||||||
if (!lookupCrcTable(crc))
|
if (!lookupCrcTable(elf_crc))
|
||||||
{
|
{
|
||||||
printf("\033[1;31m");
|
printf("\033[1;31m");
|
||||||
printf("Warning: The ELF you are running is not Clean and might cause unwanted behavior.\n");
|
printf("Warning: The ELF you are running is not Clean and might cause unwanted behavior.\n");
|
||||||
@@ -305,11 +333,19 @@ void setEnvironmentVariables(const char *ldLibPath, const char *originalDir, con
|
|||||||
char *currentLibraryPath = getenv("LD_LIBRARY_PATH");
|
char *currentLibraryPath = getenv("LD_LIBRARY_PATH");
|
||||||
char newLdLibPath[MAX_PATH_LENGTH * 3] = "";
|
char newLdLibPath[MAX_PATH_LENGTH * 3] = "";
|
||||||
|
|
||||||
if (currentLibraryPath && strlen(currentLibraryPath) > 0)
|
char *appImgRoot = getenv("APP_IMG_ROOT");
|
||||||
snprintf(newLdLibPath, sizeof(newLdLibPath), "%s:", currentLibraryPath);
|
if (getenv("APP_IMG_ROOT") && isIDGame()) // If appimage and ID game.
|
||||||
|
{
|
||||||
|
strcat(newLdLibPath, appImgRoot);
|
||||||
|
strcat(newLdLibPath, "/usr/lib32ID:");
|
||||||
|
strcat(newLdLibPath, currentLibraryPath);
|
||||||
|
}
|
||||||
|
else if (currentLibraryPath && strlen(currentLibraryPath) > 0)
|
||||||
|
{
|
||||||
|
snprintf(newLdLibPath, sizeof(newLdLibPath), "%s", currentLibraryPath);
|
||||||
|
}
|
||||||
|
|
||||||
char *tmpLibPath = dirname(strdup(ldLibPath));
|
char *tmpLibPath = dirname(strdup(ldLibPath));
|
||||||
|
|
||||||
if (strcmp(tmpLibPath, ".") != 0)
|
if (strcmp(tmpLibPath, ".") != 0)
|
||||||
{
|
{
|
||||||
strcat(newLdLibPath, ":");
|
strcat(newLdLibPath, ":");
|
||||||
@@ -343,7 +379,7 @@ void setEnvironmentVariables(const char *ldLibPath, const char *originalDir, con
|
|||||||
log_error("The loader will use the default configuration.");
|
log_error("The loader will use the default configuration.");
|
||||||
confFilePath = "";
|
confFilePath = "";
|
||||||
}
|
}
|
||||||
else if(!fileExists(confFilePath))
|
else if (!fileExists(confFilePath))
|
||||||
{
|
{
|
||||||
log_error("The file \'%s\' does not exist, will be using default config.", confFilePath);
|
log_error("The file \'%s\' does not exist, will be using default config.", confFilePath);
|
||||||
confFilePath = "";
|
confFilePath = "";
|
||||||
@@ -395,6 +431,7 @@ void setEnvironmentVariables(const char *ldLibPath, const char *originalDir, con
|
|||||||
|
|
||||||
if (zink)
|
if (zink)
|
||||||
{
|
{
|
||||||
|
setenv("LIBGL_KOPPER_DRI2", "1", 1);
|
||||||
setenv("MESA_LOADER_DRIVER_OVERRIDE", "zink", 1);
|
setenv("MESA_LOADER_DRIVER_OVERRIDE", "zink", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -404,13 +441,17 @@ void setEnvironmentVariables(const char *ldLibPath, const char *originalDir, con
|
|||||||
setenv("__NV_PRIME_RENDER_OFFLOAD", "1", 1);
|
setenv("__NV_PRIME_RENDER_OFFLOAD", "1", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *appImgRoot = getenv("APP_IMG_ROOT");
|
char libglDriPath[MAX_PATH_LENGTH] = {0};
|
||||||
if (appImgRoot != NULL)
|
if (appImgRoot != NULL)
|
||||||
{
|
{
|
||||||
char libglDriPath[MAX_PATH_LENGTH];
|
if (isIDGame())
|
||||||
sprintf(libglDriPath, "%s/usr/lib32/dri", appImgRoot);
|
snprintf(libglDriPath, sizeof(libglDriPath), "%s/usr/lib32ID/dri", appImgRoot);
|
||||||
setenv("LIBGL_DRIVERS_PATH", libglDriPath, 1);
|
else
|
||||||
|
snprintf(libglDriPath, sizeof(libglDriPath), "%s/usr/lib32/dri", appImgRoot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (libglDriPath[0] != '\0')
|
||||||
|
setenv("LIBGL_DRIVERS_PATH", libglDriPath, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void printUsage(char *programName)
|
void printUsage(char *programName)
|
||||||
@@ -428,7 +469,7 @@ void printUsage(char *programName)
|
|||||||
printf(" --help | -h Displays this usage text\n");
|
printf(" --help | -h Displays this usage text\n");
|
||||||
printf(" --config | -c Specifies configuration ini file path\n");
|
printf(" --config | -c Specifies configuration ini file path\n");
|
||||||
printf(" --controls | -o Specifies controls ini file path\n");
|
printf(" --controls | -o Specifies controls ini file path\n");
|
||||||
printf(" --controlsdb | -d Specifies gamecontrollerdb.txt file path\n");
|
printf(" --controllerdb | -d Specifies gamecontrollerdb.txt file path\n");
|
||||||
printf(" --gamepath | -g Specifies game path without ELF name\n");
|
printf(" --gamepath | -g Specifies game path without ELF name\n");
|
||||||
printf(" --create | -C Creates a default config or controls file. Use '--create --help' for more info.\n");
|
printf(" --create | -C Creates a default config or controls file. Use '--create --help' for more info.\n");
|
||||||
}
|
}
|
||||||
@@ -514,7 +555,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
return listSdlControllers();
|
return listSdlControllers();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (argc > 1 && (strcmp(argv[1], "--create") == 0 || strcmp(argv[1], "-C") == 0))
|
if (argc > 1 && (strcmp(argv[1], "--create") == 0 || strcmp(argv[1], "-C") == 0))
|
||||||
{
|
{
|
||||||
if (argc < 3)
|
if (argc < 3)
|
||||||
@@ -536,7 +577,6 @@ int main(int argc, char *argv[])
|
|||||||
char *argCopyForDirname = NULL;
|
char *argCopyForDirname = NULL;
|
||||||
char *argCopyForBasename = NULL;
|
char *argCopyForBasename = NULL;
|
||||||
|
|
||||||
|
|
||||||
if (strcmp(subOption, "config") != 0 && strcmp(subOption, "controls") != 0)
|
if (strcmp(subOption, "config") != 0 && strcmp(subOption, "controls") != 0)
|
||||||
{
|
{
|
||||||
log_error("Invalid sub-option for --create: '%s'. Must be 'config' or 'controls'.\n", subOption);
|
log_error("Invalid sub-option for --create: '%s'. Must be 'config' or 'controls'.\n", subOption);
|
||||||
@@ -576,8 +616,10 @@ int main(int argc, char *argv[])
|
|||||||
if (!dot || strcmp(dot, ".ini") != 0)
|
if (!dot || strcmp(dot, ".ini") != 0)
|
||||||
{
|
{
|
||||||
log_error("Invalid filename: '%s'. Must have .ini extension.\n", filename);
|
log_error("Invalid filename: '%s'. Must have .ini extension.\n", filename);
|
||||||
if(argCopyForDirname) free(argCopyForDirname);
|
if (argCopyForDirname)
|
||||||
if(argCopyForBasename) free(argCopyForBasename);
|
free(argCopyForDirname);
|
||||||
|
if (argCopyForBasename)
|
||||||
|
free(argCopyForBasename);
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -585,8 +627,10 @@ int main(int argc, char *argv[])
|
|||||||
if (!dirExists(path))
|
if (!dirExists(path))
|
||||||
{
|
{
|
||||||
log_error("Output directory does not exist: %s\n", path);
|
log_error("Output directory does not exist: %s\n", path);
|
||||||
if(argCopyForDirname) free(argCopyForDirname);
|
if (argCopyForDirname)
|
||||||
if(argCopyForBasename) free(argCopyForBasename);
|
free(argCopyForDirname);
|
||||||
|
if (argCopyForBasename)
|
||||||
|
free(argCopyForBasename);
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -613,8 +657,10 @@ int main(int argc, char *argv[])
|
|||||||
log_info("Successfully created controls file at %s\n", finalPath);
|
log_info("Successfully created controls file at %s\n", finalPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(argCopyForDirname) free(argCopyForDirname);
|
if (argCopyForDirname)
|
||||||
if(argCopyForBasename) free(argCopyForBasename);
|
free(argCopyForDirname);
|
||||||
|
if (argCopyForBasename)
|
||||||
|
free(argCopyForBasename);
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -687,7 +733,7 @@ int main(int argc, char *argv[])
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(argv[i], "-d") == 0 || strcmp(argv[i], "--controlsdb") == 0)
|
if (strcmp(argv[i], "-d") == 0 || strcmp(argv[i], "--controllerdb") == 0)
|
||||||
{
|
{
|
||||||
if (i + 1 >= argc)
|
if (i + 1 >= argc)
|
||||||
{
|
{
|
||||||
@@ -835,9 +881,6 @@ int main(int argc, char *argv[])
|
|||||||
printf("You might not get sound because libopenal.so.0 was not found.\n");
|
printf("You might not get sound because libopenal.so.0 was not found.\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setEnvironmentVariables(libPath, originalDir, targetedGameDir, zink, nvidia, extConfigPath, extControlsPath, extControlsDbPath,
|
|
||||||
libOpenal);
|
|
||||||
|
|
||||||
if (segaboot)
|
if (segaboot)
|
||||||
{
|
{
|
||||||
@@ -857,6 +900,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
isCleanElf(command);
|
isCleanElf(command);
|
||||||
|
|
||||||
|
setEnvironmentVariables(libPath, originalDir, targetedGameDir, zink, nvidia, extConfigPath, extControlsPath, extControlsDbPath,
|
||||||
|
libOpenal);
|
||||||
|
|
||||||
if (gdb)
|
if (gdb)
|
||||||
{
|
{
|
||||||
char temp[128];
|
char temp[128];
|
||||||
|
|||||||
+19
-11
@@ -11,7 +11,7 @@
|
|||||||
#include "passthrough.h"
|
#include "passthrough.h"
|
||||||
|
|
||||||
#define TIMEOUT_SELECT 200
|
#define TIMEOUT_SELECT 200
|
||||||
#define CTS_ON_RETRY 20
|
#define CTS_ON_RETRY 100
|
||||||
|
|
||||||
// Used to read JVS frame in a non-blocking way
|
// Used to read JVS frame in a non-blocking way
|
||||||
JVSFrame jvsFrameBuffer;
|
JVSFrame jvsFrameBuffer;
|
||||||
@@ -23,12 +23,14 @@ pthread_mutex_t jvsBuffer_lock = PTHREAD_MUTEX_INITIALIZER;
|
|||||||
* @param jvsPath The serial port path. Ex: "/dev/ttyS3"
|
* @param jvsPath The serial port path. Ex: "/dev/ttyS3"
|
||||||
* @return A file descriptor
|
* @return A file descriptor
|
||||||
*/
|
*/
|
||||||
int openJVSSerial(char *jvsPath) {
|
int openJVSSerial(char *jvsPath)
|
||||||
|
{
|
||||||
int jvsFileDescriptor = -1;
|
int jvsFileDescriptor = -1;
|
||||||
|
|
||||||
// TODO: check O_NOCTTY declaration
|
// TODO: check O_NOCTTY declaration
|
||||||
jvsFileDescriptor = open(jvsPath, O_RDWR | O_NOCTTY);
|
jvsFileDescriptor = open(jvsPath, O_RDWR | O_NOCTTY);
|
||||||
if (jvsFileDescriptor < 0) {
|
if (jvsFileDescriptor < 0)
|
||||||
|
{
|
||||||
printf("Failed to open '%s' for JVS.\n", jvsPath);
|
printf("Failed to open '%s' for JVS.\n", jvsPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,7 +43,8 @@ int openJVSSerial(char *jvsPath) {
|
|||||||
* @param fd
|
* @param fd
|
||||||
* @return 0|1
|
* @return 0|1
|
||||||
*/
|
*/
|
||||||
int initJVSSerial(int fd) {
|
int initJVSSerial(int fd)
|
||||||
|
{
|
||||||
struct termios options;
|
struct termios options;
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
@@ -94,7 +97,7 @@ int initJVSSerial(int fd) {
|
|||||||
options.c_cc[VMIN] = 0;
|
options.c_cc[VMIN] = 0;
|
||||||
options.c_cc[VTIME] = 1;
|
options.c_cc[VTIME] = 1;
|
||||||
|
|
||||||
|
// options.c_cflag |= CREAD; // Turn on READ, let ctrl lines work
|
||||||
tcsetattr(fd, TCSANOW, &options);
|
tcsetattr(fd, TCSANOW, &options);
|
||||||
|
|
||||||
/* No use ? Save it for later
|
/* No use ? Save it for later
|
||||||
@@ -108,22 +111,26 @@ int initJVSSerial(int fd) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The DCD (Data Carrier Detect) status of a serial port indicates whether a carrier is present on the line, meaning that a connection has been established with another device.
|
* The DCD (Data Carrier Detect) status of a serial port indicates whether a carrier is present on the line, meaning that a connection has
|
||||||
|
* been established with another device.
|
||||||
* @param fd File descriptor of JVS (serial) port
|
* @param fd File descriptor of JVS (serial) port
|
||||||
* @return 0|1 According to control line status
|
* @return 0|1 According to control line status
|
||||||
*/
|
*/
|
||||||
int getDCD(int fd) {
|
int getDCD(int fd)
|
||||||
|
{
|
||||||
int status;
|
int status;
|
||||||
ioctl(fd, TIOCMGET, &status);
|
ioctl(fd, TIOCMGET, &status);
|
||||||
return (status & TIOCM_CAR) != 0;
|
return (status & TIOCM_CAR) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The DSR (Data Set Ready) status of a serial port indicates whether the device at the other end of the connection is ready to receive data.
|
* The DSR (Data Set Ready) status of a serial port indicates whether the device at the other end of the connection is ready to receive
|
||||||
|
* data.
|
||||||
* @param fd File descriptor of JVS (serial) port
|
* @param fd File descriptor of JVS (serial) port
|
||||||
* @return 0|1 According to control line status
|
* @return 0|1 According to control line status
|
||||||
*/
|
*/
|
||||||
int getDSR(int fd) {
|
int getDSR(int fd)
|
||||||
|
{
|
||||||
int status;
|
int status;
|
||||||
ioctl(fd, TIOCMGET, &status);
|
ioctl(fd, TIOCMGET, &status);
|
||||||
return (status & TIOCM_DSR) != 0;
|
return (status & TIOCM_DSR) != 0;
|
||||||
@@ -134,7 +141,8 @@ int getDSR(int fd) {
|
|||||||
* @param fd File descriptor of JVS (serial) port
|
* @param fd File descriptor of JVS (serial) port
|
||||||
* @return 0|1 According to control line status
|
* @return 0|1 According to control line status
|
||||||
*/
|
*/
|
||||||
int getCTS(int fd) {
|
int getCTS(int fd)
|
||||||
|
{
|
||||||
int status;
|
int status;
|
||||||
ioctl(fd, TIOCMGET, &status);
|
ioctl(fd, TIOCMGET, &status);
|
||||||
return (status & TIOCM_CTS) != 0;
|
return (status & TIOCM_CTS) != 0;
|
||||||
@@ -164,7 +172,7 @@ void *readJVSFrameThread(void * arg)
|
|||||||
// printf("SERIAL thread debug: trying to read byte.\n");
|
// printf("SERIAL thread debug: trying to read byte.\n");
|
||||||
// Try to read a byte from serial, this call will be blocking if VMIN > 0 and VTIME = 0
|
// Try to read a byte from serial, this call will be blocking if VMIN > 0 and VTIME = 0
|
||||||
bytesRead = read(fd, &localBuffer[byteCount], 1);
|
bytesRead = read(fd, &localBuffer[byteCount], 1);
|
||||||
|
|
||||||
// If nothing on serial and CTS is ON, we try to read "CTS_ON_RETRY" times
|
// If nothing on serial and CTS is ON, we try to read "CTS_ON_RETRY" times
|
||||||
ctsRetry = CTS_ON_RETRY;
|
ctsRetry = CTS_ON_RETRY;
|
||||||
while (bytesRead < 1 && --ctsRetry > 0 && jvsFrameBuffer.ready == 0) {
|
while (bytesRead < 1 && --ctsRetry > 0 && jvsFrameBuffer.ready == 0) {
|
||||||
|
|||||||
@@ -1127,7 +1127,7 @@ void glVertex3fHOD4(GLfloat x, GLfloat y, GLfloat z)
|
|||||||
else if (z == -1.510000f)
|
else if (z == -1.510000f)
|
||||||
{ // logo 2d elemtents target
|
{ // logo 2d elemtents target
|
||||||
|
|
||||||
if (curTextureID != 262) // target boss fight // Added 2 because of the crosshairs.
|
if (curTextureID != 260) // target boss fight // Added 2 because of the crosshairs.
|
||||||
{
|
{
|
||||||
x += OffsetX;
|
x += OffsetX;
|
||||||
y -= OffsetY;
|
y -= OffsetY;
|
||||||
@@ -1218,7 +1218,6 @@ void glVertex3fHOD4(GLfloat x, GLfloat y, GLfloat z)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
if (curTextureID != 26)
|
if (curTextureID != 26)
|
||||||
{ // gun effect
|
{ // gun effect
|
||||||
if (z > -1.8f && z < -1.0f)
|
if (z > -1.8f && z < -1.0f)
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ SDL_GLContext sdlContext = NULL;
|
|||||||
Display *x11Display = NULL;
|
Display *x11Display = NULL;
|
||||||
Window x11Window;
|
Window x11Window;
|
||||||
char sdlGameTitle[256] = {0};
|
char sdlGameTitle[256] = {0};
|
||||||
|
bool sdlInputInitialized = false;
|
||||||
|
|
||||||
extern SDL_Cursor *customCursor;
|
extern SDL_Cursor *customCursor;
|
||||||
extern SDL_Cursor *touchCursor;
|
extern SDL_Cursor *touchCursor;
|
||||||
@@ -187,6 +188,9 @@ void startSDL(int *argcp, char **argv)
|
|||||||
|
|
||||||
initBlitting();
|
initBlitting();
|
||||||
|
|
||||||
|
if (gId != PRIMEVAL_HUNT)
|
||||||
|
SDL_SetWindowResizable(sdlWindow, true);
|
||||||
|
|
||||||
SDL_ShowWindow(sdlWindow);
|
SDL_ShowWindow(sdlWindow);
|
||||||
|
|
||||||
Uint64 startTime = SDL_GetTicks();
|
Uint64 startTime = SDL_GetTicks();
|
||||||
@@ -203,9 +207,6 @@ void startSDL(int *argcp, char **argv)
|
|||||||
SDL_GL_SwapWindow(sdlWindow);
|
SDL_GL_SwapWindow(sdlWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gId != PRIMEVAL_HUNT)
|
|
||||||
SDL_SetWindowResizable(sdlWindow, true);
|
|
||||||
|
|
||||||
creatingWindow = false;
|
creatingWindow = false;
|
||||||
|
|
||||||
printf(" RESOLUTION: %dx%d\n", gWidth, gHeight);
|
printf(" RESOLUTION: %dx%d\n", gWidth, gHeight);
|
||||||
@@ -309,8 +310,11 @@ void pollEvents()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (gGrp == GROUP_HOD4 || gGrp == GROUP_HOD4_TEST)
|
if (sdlInputInitialized)
|
||||||
updateGunShake();
|
{
|
||||||
updateCombinedAxes();
|
if (gGrp == GROUP_HOD4 || gGrp == GROUP_HOD4_TEST)
|
||||||
processChangedActions();
|
updateGunShake();
|
||||||
|
updateCombinedAxes();
|
||||||
|
processChangedActions();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#include <SDL3/SDL_keyboard.h>
|
#include <SDL3/SDL_keyboard.h>
|
||||||
#include <SDL3/SDL_mouse.h>
|
#include <SDL3/SDL_mouse.h>
|
||||||
#include <SDL3/SDL_scancode.h>
|
#include <SDL3/SDL_scancode.h>
|
||||||
|
#include <libgen.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@@ -58,6 +59,7 @@ extern int gHeight;
|
|||||||
int widthOri;
|
int widthOri;
|
||||||
int heightOri;
|
int heightOri;
|
||||||
extern SDL_Window *sdlWindow;
|
extern SDL_Window *sdlWindow;
|
||||||
|
extern bool sdlInputInitialized;
|
||||||
|
|
||||||
extern Dest dest;
|
extern Dest dest;
|
||||||
|
|
||||||
@@ -201,7 +203,7 @@ int initSdlInput(char *controlsPath)
|
|||||||
if (envDbPath)
|
if (envDbPath)
|
||||||
{
|
{
|
||||||
SDL_AddGamepadMappingsFromFile(envDbPath);
|
SDL_AddGamepadMappingsFromFile(envDbPath);
|
||||||
printf("%s, as a controller database.\n", envDbPath);
|
printf("%s loaded as a controller database.\n", basename(envDbPath));
|
||||||
}
|
}
|
||||||
|
|
||||||
gameType = getConfig()->gameType;
|
gameType = getConfig()->gameType;
|
||||||
@@ -378,6 +380,7 @@ int initSdlInput(char *controlsPath)
|
|||||||
// Apply any final game-specific mapping overrides.
|
// Apply any final game-specific mapping overrides.
|
||||||
remapPerGame();
|
remapPerGame();
|
||||||
|
|
||||||
|
sdlInputInitialized = true;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1227,6 +1230,9 @@ void addActionToDirtyList(JVSPlayer player, LogicalAction action)
|
|||||||
*/
|
*/
|
||||||
void processSdlEvent(const SDL_Event *e)
|
void processSdlEvent(const SDL_Event *e)
|
||||||
{
|
{
|
||||||
|
if (!sdlInputInitialized)
|
||||||
|
return;
|
||||||
|
|
||||||
switch (e->type)
|
switch (e->type)
|
||||||
{
|
{
|
||||||
case SDL_EVENT_KEY_DOWN:
|
case SDL_EVENT_KEY_DOWN:
|
||||||
@@ -1522,9 +1528,9 @@ void processSdlEvent(const SDL_Event *e)
|
|||||||
break;
|
break;
|
||||||
case SDL_EVENT_MOUSE_MOTION:
|
case SDL_EVENT_MOUSE_MOTION:
|
||||||
{
|
{
|
||||||
double mX = e->motion.x;
|
float mX = e->motion.x;
|
||||||
double mY = e->motion.y;
|
float mY = e->motion.y;
|
||||||
float posX, posY;
|
float posX = 0.0f, posY = 0.0f;
|
||||||
|
|
||||||
if (gId == PRIMEVAL_HUNT)
|
if (gId == PRIMEVAL_HUNT)
|
||||||
{
|
{
|
||||||
@@ -1534,8 +1540,8 @@ void processSdlEvent(const SDL_Event *e)
|
|||||||
|
|
||||||
int motX = mX, motY = mY;
|
int motX = mX, motY = mY;
|
||||||
phTouchScreenCursor(mX, mY, &motX, &motY);
|
phTouchScreenCursor(mX, mY, &motX, &motY);
|
||||||
posX = ((double)(motX - phX) / (double)phW);
|
posX = ((float)(motX - phX) / (float)phW);
|
||||||
posY = ((double)(motY - phY) / (double)phH);
|
posY = ((float)(motY - phY) / (float)phH);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user