Compare commits

..
6 Commits
Author SHA1 Message Date
dkeruza a68dcbbdcf Merge pull request #88 from dkeruza-neo/master
Resolution patches for 2Spicy and HOD-Ex
2025-04-06 13:28:44 -04:00
dkeruza 75642e285e Merge branch 'master' into master 2025-04-06 13:22:14 -04:00
dkeruza-neo d9d076f120 Added 2Spicy and HOD-Ex resolution patches. 2025-04-06 13:11:58 -04:00
dkeruza a5633bbf1d Fixed an indentation in the Flatpak script. 2025-04-06 12:38:17 -04:00
dkeruza d72ac379ea Fixed Flatpak script.
There was a bug in the script preventing it to launch.
2025-04-06 11:34:49 -04:00
dkeruza-neo c5c44ce395 Fixed flatpak build script. 2025-04-06 11:33:14 -04:00
10 changed files with 457 additions and 321 deletions
+52 -101
View File
@@ -1,18 +1,17 @@
app-id: com.github.lindberghloader app-id: com.github.lindberghloader
runtime: org.freedesktop.Platform runtime: org.freedesktop.Platform
runtime-version: &runtime-version '24.08' # Define runtime version alias runtime-version: &runtime-version '24.08'
sdk: org.freedesktop.Sdk sdk: org.freedesktop.Sdk
# Define reusable aliases x-gl-versions: &gl-versions '24.08;1.4'
x-gl-versions: &gl-versions '24.08;1.4' # Define GL versions list alias
x-gl-merge-dirs: &gl-merge-dirs vulkan/icd.d;glvnd/egl_vendor.d;egl/egl_external_platform.d;OpenCL/vendors;lib/dri;lib/d3d;lib/gbm;vulkan/explicit_layer.d;vulkan/implicit_layer.d # Define GL merge dirs alias x-gl-merge-dirs: &gl-merge-dirs vulkan/icd.d;glvnd/egl_vendor.d;egl/egl_external_platform.d;OpenCL/vendors;lib/dri;lib/d3d;lib/gbm;vulkan/explicit_layer.d;vulkan/implicit_layer.d # Define GL merge dirs alias
x-i386-build-options: &i386-build-options # Define 32-bit build options alias x-i386-build-options: &i386-build-options
libdir: /app/lib32 # Default library install dir for autotools/meson etc. libdir: /app/lib32
env: env:
CC: /usr/lib/sdk/toolchain-i386/bin/i686-unknown-linux-gnu-gcc CC: /usr/lib/sdk/toolchain-i386/bin/i686-unknown-linux-gnu-gcc
CXX: /usr/lib/sdk/toolchain-i386/bin/i686-unknown-linux-gnu-g++ CXX: /usr/lib/sdk/toolchain-i386/bin/i686-unknown-linux-gnu-g++
LD: /usr/lib/sdk/toolchain-i386/bin/i686-unknown-linux-gnu-ld LD: /usr/lib/sdk/toolchain-i386/bin/i686-unknown-linux-gnu-ld
LDFLAGS: "-L/app/lib32" # Add custom lib dir to linker search path during build LDFLAGS: "-L/app/lib32"
command: lindbergh command: lindbergh
@@ -21,41 +20,32 @@ sdk-extensions:
- org.freedesktop.Sdk.Extension.toolchain-i386 - org.freedesktop.Sdk.Extension.toolchain-i386
- org.freedesktop.Sdk.Compat.i386 - org.freedesktop.Sdk.Compat.i386
# Runtime arguments and permissions
finish-args: finish-args:
# Environment variables needed at runtime - --env=LD_LIBRARY_PATH=/app/lib32:$LD_LIBRARY_PATH
- --env=LD_LIBRARY_PATH=/app/lib32:$LD_LIBRARY_PATH # Make custom 32-bit libs findable
- --env=PATH=/app/bin:/usr/bin - --env=PATH=/app/bin:/usr/bin
# Permissions - --allow=multiarch
- --allow=multiarch # Needed for running 32-bit code
- --share=ipc - --share=ipc
- --share=network - --share=network
- --socket=x11 - --socket=x11
- --socket=wayland - --socket=wayland
- --socket=pulseaudio
# WARNING: --device=all grants broad hardware access. Consider using --device=dri and specific devices if possible.
- --device=all - --device=all
# Filesystem access - adjust path as needed - --socket=pulseaudio
- --filesystem=~/Games - --filesystem=~/Games
# Runtime extensions automatically downloaded and installed with the app # Runtime extensions automatically downloaded and installed with the app (For some reason does not work)
add-extensions: add-extensions:
# 32-bit compatibility libraries from the runtime
org.freedesktop.Platform.Compat.i386: org.freedesktop.Platform.Compat.i386:
directory: lib/i386-linux-gnu directory: lib/i386-linux-gnu
version: *runtime-version # Match the main runtime version version: *runtime-version
# no-autodownload removed (or set to false) to ensure installation
# 32-bit graphics driver extension # 32-bit graphics driver extension
org.freedesktop.Platform.GL32: org.freedesktop.Platform.GL32:
directory: lib/i386-linux-gnu/GL directory: lib/i386-linux-gnu/GL
versions: *gl-versions # Use defined GL versions list versions: *gl-versions
subdirectories: true subdirectories: true
# no-autodownload removed (or set to false) to ensure installation
autodelete: false autodelete: false
add-ld-path: lib add-ld-path: lib
merge-dirs: *gl-merge-dirs # Use defined merge dirs list merge-dirs: *gl-merge-dirs
# Conditions for downloading and enabling the GL driver extension
download-if: active-gl-driver download-if: active-gl-driver
enable-if: active-gl-driver enable-if: active-gl-driver
autoprune-unless: active-gl-driver autoprune-unless: active-gl-driver
@@ -75,12 +65,11 @@ modules:
- name: libGLU - name: libGLU
buildsystem: autotools buildsystem: autotools
config-opts: config-opts:
- --host=i686-unknown-linux-gnu # Specify 32-bit target host - --host=i686-unknown-linux-gnu
- --prefix=/app # Base install prefix - --prefix=/app
# --libdir=/app/lib32 should be handled by build-options->libdir
build-options: build-options:
arch: arch:
x86_64: *i386-build-options # Apply 32-bit build options on 64-bit host x86_64: *i386-build-options
sources: sources:
- type: archive - type: archive
url: https://mesa.freedesktop.org/archive/glu/glu-9.0.2.tar.xz url: https://mesa.freedesktop.org/archive/glu/glu-9.0.2.tar.xz
@@ -91,15 +80,15 @@ modules:
buildsystem: cmake buildsystem: cmake
config-opts: config-opts:
- -DCMAKE_BUILD_TYPE=Release - -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_INSTALL_PREFIX=/app # Base install prefix - -DCMAKE_INSTALL_PREFIX=/app
- -DCMAKE_INSTALL_LIBDIR=/app/lib32 # Explicitly set library install dir for CMake - -DCMAKE_INSTALL_LIBDIR=/app/lib32
sources: sources:
- type: archive - type: archive
url: https://downloads.sourceforge.net/freeglut/freeglut-3.2.2.tar.gz url: https://downloads.sourceforge.net/freeglut/freeglut-3.2.2.tar.gz
sha256: c5944a082df0bba96b5756dddb1f75d0cd72ce27b5395c6c1dde85c2ff297a50 sha256: c5944a082df0bba96b5756dddb1f75d0cd72ce27b5395c6c1dde85c2ff297a50
build-options: build-options:
arch: arch:
x86_64: *i386-build-options # Apply 32-bit build options x86_64: *i386-build-options
# Build 32-bit libFAudio (dynamic) # Build 32-bit libFAudio (dynamic)
- name: libFAudio-Dynamic - name: libFAudio-Dynamic
@@ -107,40 +96,37 @@ modules:
config-opts: config-opts:
- -DCMAKE_BUILD_TYPE=Release - -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_INSTALL_PREFIX=/app - -DCMAKE_INSTALL_PREFIX=/app
- -DBUILD_SDL3=off # Assuming SDL3 integration is not needed - -DBUILD_SDL3=off
- -DCMAKE_INSTALL_LIBDIR=/app/lib32 # Explicitly set library install dir - -DCMAKE_INSTALL_LIBDIR=/app/lib32
build-options: build-options:
arch: arch:
x86_64: *i386-build-options # Apply 32-bit build options x86_64: *i386-build-options
env: env:
# Specific flags needed for FAudio 32-bit build?
CFLAGS: "-m32 -mstackrealign" CFLAGS: "-m32 -mstackrealign"
CXXFLAGS: "-m32 -mstackrealign" CXXFLAGS: "-m32 -mstackrealign"
sources: sources:
- type: git - type: git
url: https://github.com/FNA-XNA/FAudio.git url: https://github.com/FNA-XNA/FAudio.git
tag: "24.12" # Using a specific tag tag: "24.12"
# Build 32-bit libXmu # Build 32-bit libXmu
- name: libxmu - name: libxmu
buildsystem: autotools buildsystem: autotools
config-opts: config-opts:
# --libdir=/app/lib32 should be handled by build-options->libdir
- --prefix=/app - --prefix=/app
- --with-shared # Ensure shared library is built - --with-shared
sources: sources:
- type: archive - type: archive
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:
arch: arch:
x86_64: *i386-build-options # Apply 32-bit build options (Standardized) x86_64: *i386-build-options
# Build 32-bit libmd # Build 32-bit libmd
- name: libmd - name: libmd
buildsystem: autotools buildsystem: autotools
config-opts: config-opts:
# --libdir=/app/lib32 should be handled by build-options->libdir
- --prefix=/app - --prefix=/app
sources: sources:
- type: archive - type: archive
@@ -148,13 +134,12 @@ modules:
sha256: 1bd6aa42275313af3141c7cf2e5b964e8b1fd488025caf2f971f43b00776b332 sha256: 1bd6aa42275313af3141c7cf2e5b964e8b1fd488025caf2f971f43b00776b332
build-options: build-options:
arch: arch:
x86_64: *i386-build-options # Apply 32-bit build options x86_64: *i386-build-options
# Build 32-bit libbsd # Build 32-bit libbsd
- name: libbsd - name: libbsd
buildsystem: autotools buildsystem: autotools
config-opts: config-opts:
# --libdir=/app/lib32 should be handled by build-options->libdir
- --prefix=/app - --prefix=/app
sources: sources:
- type: archive - type: archive
@@ -162,14 +147,12 @@ modules:
sha256: b88cc9163d0c652aaf39a99991d974ddba1c3a9711db8f1b5838af2a14731014 sha256: b88cc9163d0c652aaf39a99991d974ddba1c3a9711db8f1b5838af2a14731014
build-options: build-options:
arch: arch:
x86_64: *i386-build-options # Apply 32-bit build options x86_64: *i386-build-options
# Build 32-bit ncurses (very old version) # Build 32-bit ncurses (very old version)
- name: ncurses - name: ncurses
# WARNING: ncurses 5.9 is very old. Consider updating if possible.
buildsystem: autotools buildsystem: autotools
config-opts: config-opts:
# --libdir=/app/lib32 should be handled by build-options->libdir
- --prefix=/app - --prefix=/app
- --with-shared - --with-shared
- --without-debug - --without-debug
@@ -178,24 +161,22 @@ modules:
url: https://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz url: https://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz
sha256: 9046298fb440324c9d4135ecea7879ffed8546dd1b58e59430ea07a4633f563b sha256: 9046298fb440324c9d4135ecea7879ffed8546dd1b58e59430ea07a4633f563b
- type: patch - type: patch
path: ./assets/ncurses-5.9.patch # Assuming this patch is necessary path: ./assets/ncurses-5.9.patch
build-options: build-options:
arch: arch:
x86_64: *i386-build-options # Apply 32-bit build options x86_64: *i386-build-options
env: env:
CPPFLAGS: "-P" # Often needed for ncurses builds CPPFLAGS: "-P"
CXXFLAGS: "-std=c++14" # Is C++14 really needed for ncurses build? Check this. CXXFLAGS: "-std=c++14"
# Install pre-built 32-bit Nvidia Cg Toolkit (old) # Install pre-built 32-bit Nvidia Cg Toolkit (old)
- name: nvidia-cg-toolkit - name: nvidia-cg-toolkit
# WARNING: Cg Toolkit is deprecated and old.
buildsystem: simple buildsystem: simple
build-commands: build-commands:
- install -Dm755 usr/lib/libCg.so /app/lib32/libCg.so - install -Dm755 usr/lib/libCg.so /app/lib32/libCg.so
- install -Dm755 usr/lib/libCgGL.so /app/lib32/libCgGL.so - install -Dm755 usr/lib/libCgGL.so /app/lib32/libCgGL.so
sources: sources:
- type: archive - type: archive
# Consider hosting this locally or finding a more reliable source if possible
url: http://developer.download.nvidia.com/cg/Cg_3.1/Cg-3.1_April2012_x86.tgz url: http://developer.download.nvidia.com/cg/Cg_3.1/Cg-3.1_April2012_x86.tgz
sha256: cef3591e436f528852db0e8c145d3842f920e0c89bcfb219c466797cb7b18879 sha256: cef3591e436f528852db0e8c145d3842f920e0c89bcfb219c466797cb7b18879
@@ -203,32 +184,27 @@ modules:
- name: libsndio-dynamic - name: libsndio-dynamic
buildsystem: autotools buildsystem: autotools
config-opts: config-opts:
# --libdir=/app/lib32 should be handled by build-options->libdir
- --prefix=/app - --prefix=/app
- --enable-dynamic # Build shared library - --enable-dynamic
# - --disable-static # Don't build static library - --enable-alsa
- --enable-alsa # Enable ALSA backend
sources: sources:
- type: archive - type: archive
url: https://www.sndio.org/sndio-1.10.0.tar.gz url: https://www.sndio.org/sndio-1.10.0.tar.gz
sha256: bebd3bfd01c50c9376cf3e7814b9379bed9e17d0393b5113b7eb7a3d0d038c54 sha256: bebd3bfd01c50c9376cf3e7814b9379bed9e17d0393b5113b7eb7a3d0d038c54
build-options: build-options:
arch: arch:
x86_64: *i386-build-options # Apply 32-bit build options x86_64: *i386-build-options
# Build 32-bit libopenal (old version) # Build 32-bit libopenal (old version)
- name: libopenal - name: libopenal
# WARNING: OpenAL Soft 1.17.2 is quite old. Consider updating.
buildsystem: cmake buildsystem: cmake
config-opts: config-opts:
- -DCMAKE_INSTALL_PREFIX=/app - -DCMAKE_INSTALL_PREFIX=/app
- -DCMAKE_INSTALL_LIBDIR=/app/lib32 # Explicitly set library install dir - -DCMAKE_INSTALL_LIBDIR=/app/lib32
# Backend selection
- -DALSOFT_BACKEND_PULSEAUDIO=ON - -DALSOFT_BACKEND_PULSEAUDIO=ON
- -DALSOFT_BACKEND_ALSA=ON - -DALSOFT_BACKEND_ALSA=ON
- -DALSOFT_BACKEND_JACK=OFF - -DALSOFT_BACKEND_JACK=OFF
- -DALSOFT_BACKEND_SNDIO=ON # Depends on libsndio-dynamic - -DALSOFT_BACKEND_SNDIO=ON
# Point to the previously built sndio library/headers
- -DSOUNDIO_INCLUDE_DIR=/app/include - -DSOUNDIO_INCLUDE_DIR=/app/include
- -DSOUNDIO_LIBRARY=/app/lib32/libsndio.so - -DSOUNDIO_LIBRARY=/app/lib32/libsndio.so
sources: sources:
@@ -237,29 +213,20 @@ modules:
sha256: 11ea176f6cbf9763dbce0953dd77ab72d032b4ad95f07afffb91844abb174033 sha256: 11ea176f6cbf9763dbce0953dd77ab72d032b4ad95f07afffb91844abb174033
build-options: build-options:
arch: arch:
x86_64: *i386-build-options # Apply 32-bit build options x86_64: *i386-build-options
env: env:
# Specific flags needed for OpenAL 32-bit build?
CFLAGS: "-m32 -mstackrealign" CFLAGS: "-m32 -mstackrealign"
CXXFLAGS: "-m32 -std=c++14 -mstackrealign" # Needs C++14? CXXFLAGS: "-m32 -std=c++14 -mstackrealign"
# Build 32-bit OpenSSL (extremely old and insecure version) # Build 32-bit OpenSSL (extremely old and insecure version)
- name: openssl - name: openssl
# CRITICAL WARNING: OpenSSL 0.9.7 is extremely old, unsupported, and has known vulnerabilities.
# This should be updated or removed if at all possible. Using it poses a security risk.
buildsystem: simple buildsystem: simple
build-commands: build-commands:
# Configure for 32-bit Linux (pentium target), shared libs, install to /app
- ./Configure --prefix=/app --openssldir=/app/etc/ssl shared 386 no-asm no-krb5 linux-pentium - ./Configure --prefix=/app --openssldir=/app/etc/ssl shared 386 no-asm no-krb5 linux-pentium
# Build using the 32-bit toolchain
# - make -j$(nproc) CC=/usr/lib/sdk/toolchain-i386/bin/i686-unknown-linux-gnu-gcc RANLIB=/usr/lib/sdk/toolchain-i386/bin/i686-unknown-linux-gnu-ranlib
- make CC=/usr/lib/sdk/toolchain-i386/bin/i686-unknown-linux-gnu-gcc RANLIB=/usr/lib/sdk/toolchain-i386/bin/i686-unknown-linux-gnu-ranlib - make CC=/usr/lib/sdk/toolchain-i386/bin/i686-unknown-linux-gnu-gcc RANLIB=/usr/lib/sdk/toolchain-i386/bin/i686-unknown-linux-gnu-ranlib
# Manually move built libraries to the target lib32 directory
- install -d /app/lib32 - install -d /app/lib32
- mv libcrypto.so* /app/lib32/ - mv libcrypto.so* /app/lib32/
- mv libssl.so* /app/lib32/ - mv libssl.so* /app/lib32/
# Install headers (needed by other modules?) - will be cleaned later if not
# - make install_hdrs
sources: sources:
- type: archive - type: archive
url: https://github.com/openssl/openssl/archive/refs/tags/OpenSSL_0_9_7.tar.gz url: https://github.com/openssl/openssl/archive/refs/tags/OpenSSL_0_9_7.tar.gz
@@ -269,23 +236,16 @@ modules:
- name: libpcsclite - name: libpcsclite
buildsystem: meson buildsystem: meson
config-opts: config-opts:
# --libdir=/app/lib32 should be handled by build-options->libdir - -Dpolkit=false
# - -Dprefix=/app - -Dlibsystemd=false
- -Dpolkit=false # Disable polkit integration
- -Dlibsystemd=false # Disable systemd integration
# -Dudevrulesdir=no # Might be needed if it tries to install udev rules
build-options: build-options:
arch: arch:
x86_64: *i386-build-options # Apply 32-bit build options x86_64: *i386-build-options
env: env:
# Meson cross-compilation setup often requires explicit flags and paths
CFLAGS: "-m32" CFLAGS: "-m32"
CXXFLAGS: "-m32" CXXFLAGS: "-m32"
LDFLAGS: "-m32 -L/app/lib32" # Ensure LDFLAGS includes -L/app/lib32 LDFLAGS: "-m32 -L/app/lib32"
# Point pkg-config to custom and SDK 32-bit locations
PKG_CONFIG_PATH: "/app/lib32/pkgconfig:/usr/lib/i386-linux-gnu/pkgconfig:/usr/lib/sdk/toolchain-i386/lib/pkgconfig" PKG_CONFIG_PATH: "/app/lib32/pkgconfig:/usr/lib/i386-linux-gnu/pkgconfig:/usr/lib/sdk/toolchain-i386/lib/pkgconfig"
# LD_LIBRARY_PATH might not be needed here if LDFLAGS is sufficient for linking stage
# LD_LIBRARY_PATH: "/app/lib32:/usr/lib/i386-linux-gnu/pkgconfig:$LD_LIBRARY_PATH"
sources: sources:
- type: archive - type: archive
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
@@ -295,59 +255,50 @@ modules:
- name: lindbergh-loader - name: lindbergh-loader
buildsystem: simple buildsystem: simple
build-commands: build-commands:
# Ensure make finds the libraries built in previous steps
- export LD_LIBRARY_PATH=/app/lib32:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH=/app/lib32:$LD_LIBRARY_PATH
- make -j$(nproc) # Build the application - make -j$(nproc)
# Install application binary and required libraries/symlinks - mkdir -p /app/lib/i386-linux-gnu
- mkdir -p /app/lib/i386-linux-gnu/GL
- install -Dm755 ./build/lindbergh /app/bin/ - install -Dm755 ./build/lindbergh /app/bin/
- install -Dm755 ./build/lindbergh.so /app/lib32/ - install -Dm755 ./build/lindbergh.so /app/lib32/
- install -Dm755 ./build/libsegaapi.so /app/lib32/ - install -Dm755 ./build/libsegaapi.so /app/lib32/
- install -Dm755 ./build/libkswapapi.so /app/lib32/ - install -Dm755 ./build/libkswapapi.so /app/lib32/
- install -Dm755 ./build/libposixtime.so /app/lib32/ - install -Dm755 ./build/libposixtime.so /app/lib32/
# Install bundled library? Make sure this doesn't conflict with nvidia-cg-toolkit
- install -Dm755 ./libs/libCg.so /app/lib32/libCg2.so - install -Dm755 ./libs/libCg.so /app/lib32/libCg2.so
# Create necessary symlinks in the lib32 directory
- ln -sf libposixtime.so /app/lib32/libposixtime.so.1 - ln -sf libposixtime.so /app/lib32/libposixtime.so.1
- ln -sf libposixtime.so /app/lib32/libposixtime.so.2.4 - ln -sf libposixtime.so /app/lib32/libposixtime.so.2.4
- ln -sf libopenal.so.1 /app/lib32/libopenal.so.0 # Link to correct openal versioned so - ln -sf libopenal.so.1 /app/lib32/libopenal.so.0
- ln -sf libkswapapi.so /app/lib32/libGLcore.so.1 - ln -sf libkswapapi.so /app/lib32/libGLcore.so.1
- ln -sf libkswapapi.so /app/lib32/libnvidia-tls.so.1 - ln -sf libkswapapi.so /app/lib32/libnvidia-tls.so.1
- mv /app/lib/libopenal* /app/lib32/ - mv /app/lib/libopenal* /app/lib32/
build-options: build-options:
arch: arch:
x86_64: *i386-build-options # Apply 32-bit build options (for env vars mainly) x86_64: *i386-build-options
sources: sources:
- type: dir - type: dir
path: ../.. # Assumes source code is one level up from manifest directory path: ../..
# Setup dynamic linker configuration # Setup dynamic linker configuration
- name: bundle-setup - name: bundle-setup
buildsystem: simple buildsystem: simple
build-commands: build-commands:
# Install ld.so.conf to ensure /app/lib32 is searched by the dynamic linker
- install -Dm644 -t /app/etc ld.so.conf - install -Dm644 -t /app/etc ld.so.conf
sources: sources:
- type: file - type: file
path: ./assets/ld.so.conf # Assumes this file contains "/app/lib32" path: ./assets/ld.so.conf
# Cleanup unnecessary files to reduce final flatpak size # Cleanup unnecessary files to reduce final flatpak size
- name: cleanup - name: cleanup
buildsystem: simple buildsystem: simple
build-commands: build-commands:
# Remove static libraries and libtool archives
- find /app/lib32 -name '*.a' -type f -delete - find /app/lib32 -name '*.a' -type f -delete
- find /app/lib32 -name '*.la' -type f -delete - find /app/lib32 -name '*.la' -type f -delete
# Remove any executables other than the main command - find /app/bin -mindepth 1 ! -name "lindbergh" -exec rm -f {} \;
#- find /app/bin -mindepth 1 ! -name "lindbergh" -exec rm -f {} \; - rm -rf /app/lib/pkgconfig /app/lib32/pkgconfig /app/share/pkgconfig
# Remove development/debugging/documentation files - rm -rf /app/lib32/cmake /app/lib/debug /app/include /app/man /app/share /app/etc/bash_completion.d
#- rm -rf /app/lib/pkgconfig /app/lib32/pkgconfig /app/share/pkgconfig
#- rm -rf /app/lib32/cmake /app/lib/debug /app/include /app/man /app/share /app/etc/bash_completion.d
# Remove specific libraries if they are not needed at runtime
# (These were in the original, assuming they are safe to remove)
- rm -f /app/lib32/libmenu.so* - rm -f /app/lib32/libmenu.so*
- rm -f /app/lib32/libform.so* - rm -f /app/lib32/libform.so*
- rm -f /app/lib32/libpanel.so* - rm -f /app/lib32/libpanel.so*
- rm -f /app/lib32/libXmuu.so* - rm -f /app/lib32/libXmuu.so*
#- rm -f /app/lib32/libbsd.so* - rm -f /app/lib32/libbsd.so*
# Remove ncurses terminfo db if not needed
- rm -rf /app/lib/terminfo - rm -rf /app/lib/terminfo
+183 -182
View File
@@ -29,10 +29,10 @@
typedef struct typedef struct
{ {
uint32_t srcAddress; uint32_t srcAddress;
uint32_t srcSize; uint32_t srcSize;
uint32_t destAddress; uint32_t destAddress;
uint32_t destSize; uint32_t destSize;
} BaseboardCommand; } BaseboardCommand;
BaseboardCommand jvsCommand = {0}; BaseboardCommand jvsCommand = {0};
@@ -40,16 +40,16 @@ BaseboardCommand serialCommand = {0};
typedef struct typedef struct
{ {
uint32_t *data; uint32_t *data;
uint32_t offset; uint32_t offset;
uint32_t size; uint32_t size;
} readData_t; } readData_t;
typedef struct typedef struct
{ {
uint32_t offset; uint32_t offset;
uint32_t *data; uint32_t *data;
uint32_t size; uint32_t size;
} writeData_t; } writeData_t;
FILE *sram = NULL; FILE *sram = NULL;
@@ -63,224 +63,225 @@ int jvsPacketSize = -1;
int initBaseboard() int initBaseboard()
{ {
char *sramPath = getConfig()->sramPath; char *sramPath = getConfig()->sramPath;
sram = fopen(sramPath, "a"); sram = fopen(sramPath, "a");
// Create file if it doesn't exist // Create file if it doesn't exist
if (sram == NULL) if (sram == NULL)
{
printf("Error: Cannot open %s\n", sramPath);
return 1;
}
fclose(sram);
sram = fopen(sramPath, "rb+");
fseek(sram, 0, SEEK_SET);
if (getConfig()->emulateJVS == 0 && strcmp(getConfig()->jvsPath, "none") != 0)
{
jvsFileDescriptor = openJVSSerial(getConfig()->jvsPath);
if (jvsFileDescriptor < 0)
{ {
printf("Error: Failed to open %s for JVS\n", getConfig()->jvsPath); printf("Error: Cannot open %s\n", sramPath);
return -1; return 1;
}
fclose(sram);
sram = fopen(sramPath, "rb+");
fseek(sram, 0, SEEK_SET);
if (getConfig()->emulateJVS == 0 && strcmp(getConfig()->jvsPath, "none") != 0)
{
jvsFileDescriptor = openJVSSerial(getConfig()->jvsPath);
if (jvsFileDescriptor < 0)
{
printf("Error: Failed to open %s for JVS\n", getConfig()->jvsPath);
return -1;
}
initJVSSerial(jvsFileDescriptor);
startJVSFrameThread(&jvsFileDescriptor);
} }
initJVSSerial(jvsFileDescriptor); return 0;
startJVSFrameThread(&jvsFileDescriptor);
}
return 0;
} }
ssize_t baseboardRead(int fd, void *buf, size_t count) ssize_t baseboardRead(int fd, void *buf, size_t count)
{ {
memcpy(buf, &sharedMemory[sharedMemoryIndex], count); memcpy(buf, &sharedMemory[sharedMemoryIndex], count);
return count; return count;
} }
ssize_t baseboardWrite(int fd, const void *buf, size_t count) ssize_t baseboardWrite(int fd, const void *buf, size_t count)
{ {
memcpy(&sharedMemory[sharedMemoryIndex], buf, count); memcpy(&sharedMemory[sharedMemoryIndex], buf, count);
return count; return count;
} }
int baseboardSelect(int nfds, fd_set *restrict readfds, fd_set *restrict writefds, fd_set *restrict exceptfds, struct timeval *restrict timeout) int baseboardSelect(int nfds, fd_set *restrict readfds, fd_set *restrict writefds, fd_set *restrict exceptfds,
struct timeval *restrict timeout)
{ {
return selectReply; return selectReply;
} }
int baseboardIoctl(int fd, unsigned int request, void *data) int baseboardIoctl(int fd, unsigned int request, void *data)
{ {
switch (request) switch (request)
{
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 = (unsigned int)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])
{ {
case BASEBOARD_GET_SERIAL: // bcCmdSysInfoGetReq case BASEBOARD_GET_VERSION:
{ {
serialCommand.destAddress = _data[1]; uint8_t versionData[4] = {0x00, 0x19, 0x20, 0x07};
serialCommand.destSize = _data[2]; memcpy(data, versionData, 4);
return 0;
} }
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:
{ {
processPacket(&jvsPacketSize); sharedMemoryIndex = (unsigned int)data;
} return 0;
else if (jvsFileDescriptor >= 0) }
{ break;
for (int i = 0; i < jvsCommand.srcSize; i++)
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])
{ {
write(jvsFileDescriptor, &inputBuffer[i], 1);
if (inputBuffer[i] == 0xF0) case BASEBOARD_GET_SERIAL: // bcCmdSysInfoGetReq
{ {
setSenseLine(3); serialCommand.destAddress = _data[1];
} serialCommand.destSize = _data[2];
else if (inputBuffer[i] == 0xF1)
{
setSenseLine(1);
}
} }
} 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)
{
processPacket(&jvsPacketSize);
}
else if (jvsFileDescriptor >= 0)
{
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], SERIAL_STRING, strlen(SERIAL_STRING));
_data[1] = 1; // Set the status to success
}
break;
case BASEBOARD_GET_SENSE_LINE: case BASEBOARD_GET_SERIAL:
{ {
_data[2] = getSenseLine(); memcpy(&sharedMemory[serialCommand.destAddress + 96], SERIAL_STRING, strlen(SERIAL_STRING));
_data[1] = 1; // Set the status to success _data[1] = 1; // Set the status to success
} }
break; break;
case BASEBOARD_PROCESS_JVS: case BASEBOARD_GET_SENSE_LINE:
{ {
if (getConfig()->emulateJVS) _data[2] = getSenseLine();
{ _data[1] = 1; // Set the status to success
memcpy(&sharedMemory[jvsCommand.destAddress], outputBuffer, jvsPacketSize); }
_data[2] = jvsCommand.destAddress; break;
_data[3] = jvsPacketSize;
_data[1] = 1; // Set the status to success case BASEBOARD_PROCESS_JVS:
} {
else if (jvsFileDescriptor >= 0) if (getConfig()->emulateJVS)
{ {
JVSFrame frame = readJVSFrameFromThread(); memcpy(&sharedMemory[jvsCommand.destAddress], outputBuffer, jvsPacketSize);
memcpy(&sharedMemory[jvsCommand.destAddress], frame.buffer, frame.size); _data[2] = jvsCommand.destAddress;
_data[2] = jvsCommand.destAddress; _data[3] = jvsPacketSize;
_data[3] = frame.size; _data[1] = 1; // Set the status to success
_data[1] = frame.ready; }
} 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 %X\n", request);
} }
// Acknowledge the command
_data[0] |= 0xF0000000;
return 0; return 0;
}
break;
default:
printf("Error: Unknown baseboard ioctl %X\n", request);
}
return 0;
} }
+1 -4
View File
@@ -76,10 +76,7 @@ int initCardReader()
int carReaderGetFdIdx(int fd) int carReaderGetFdIdx(int fd)
{ {
if (fd == serialFD[0].fd) return (fd == serialFD[0].fd) ? 0 : 1;
return 0;
return 1;
} }
uint8_t cardReaderGenChecksum(int fdIdx) uint8_t cardReaderGenChecksum(int fdIdx)
+10
View File
@@ -174,6 +174,8 @@ static int detectGame(uint32_t elf_crc)
config.gameStatus = WORKING; config.gameStatus = WORKING;
config.jvsIOType = SEGA_TYPE_1; config.jvsIOType = SEGA_TYPE_1;
config.gameType = ABC; config.gameType = ABC;
config.width = 640;
config.height = 480;
return 0; return 0;
} }
break; break;
@@ -188,6 +190,8 @@ static int detectGame(uint32_t elf_crc)
config.gameStatus = WORKING; config.gameStatus = WORKING;
config.jvsIOType = SEGA_TYPE_1; config.jvsIOType = SEGA_TYPE_1;
config.gameType = ABC; config.gameType = ABC;
config.width = 640;
config.height = 480;
return 0; return 0;
} }
break; break;
@@ -249,6 +253,8 @@ static int detectGame(uint32_t elf_crc)
config.gameNativeResolutions = ""; config.gameNativeResolutions = "";
config.gameType = DRIVING; config.gameType = DRIVING;
config.gameStatus = WORKING; config.gameStatus = WORKING;
config.width = 1280;
config.height = 768;
return 0; return 0;
} }
break; break;
@@ -262,6 +268,8 @@ static int detectGame(uint32_t elf_crc)
config.gameNativeResolutions = "1280x768"; config.gameNativeResolutions = "1280x768";
config.gameType = DRIVING; config.gameType = DRIVING;
config.gameStatus = WORKING; config.gameStatus = WORKING;
config.width = 1280;
config.height = 768;
return 0; return 0;
} }
break; break;
@@ -275,6 +283,8 @@ static int detectGame(uint32_t elf_crc)
config.gameNativeResolutions = ""; config.gameNativeResolutions = "";
config.gameType = DRIVING; config.gameType = DRIVING;
config.gameStatus = WORKING; config.gameStatus = WORKING;
config.width = 1280;
config.height = 768;
return 0; return 0;
} }
break; break;
-1
View File
@@ -1,4 +1,3 @@
// #pragma once
int loadNewCursor(const char *cursorFileName, void **cursor, int customWidth, int customHeight); int loadNewCursor(const char *cursorFileName, void **cursor, int customWidth, int customHeight);
void loadCursors(); void loadCursors();
+5 -19
View File
@@ -302,6 +302,7 @@ void __attribute__((constructor)) hook_init()
} }
getGPUVendor(); getGPUVendor();
if (initPatch() != 0) if (initPatch() != 0)
exit(1); exit(1);
@@ -763,6 +764,7 @@ FILE *fopen(const char *restrict pathname, const char *restrict mode)
{ {
return 0; return 0;
} }
if (cachedShaderFilesLoaded) if (cachedShaderFilesLoaded)
{ {
void *addr = __builtin_return_address(0); void *addr = __builtin_return_address(0);
@@ -1079,17 +1081,11 @@ ssize_t read(int fd, void *buf, size_t count)
return driveboardRead(fd, buf, count); return driveboardRead(fd, buf, count);
} }
if (fd == hooks[SERIAL0] && getConfig()->emulateCardreader) if ((fd == hooks[SERIAL0] || fd == hooks[SERIAL1]) && getConfig()->emulateCardreader)
{ {
return cardReaderRead(fd, buf, count); return cardReaderRead(fd, buf, count);
} }
if (fd == hooks[SERIAL1] && getConfig()->emulateCardreader)
{
return cardReaderRead(fd, buf, count);
}
// If we don't hook the serial just reply with nothing
if (fd == hooks[SERIAL0] || fd == hooks[SERIAL1]) if (fd == hooks[SERIAL0] || fd == hooks[SERIAL1])
{ {
if (gId == PRIMEVAL_HUNT && getConfig()->emulateTouchscreen == 1) if (gId == PRIMEVAL_HUNT && getConfig()->emulateTouchscreen == 1)
@@ -1136,11 +1132,6 @@ size_t fread(void *buf, size_t size, size_t count, FILE *stream)
return freadReplace(buf, size, count, fileRead[FILE_RW2]); return freadReplace(buf, size, count, fileRead[FILE_RW2]);
} }
// if (stream == fileHooks[FILE_HARLEY])
// {
// return harleyFreadReplace(buf, size, count, fileHooks[FILE_HARLEY]);
// }
if (stream == fileHooks[FILE_FONT_ABC]) if (stream == fileHooks[FILE_FONT_ABC])
{ {
memcpy(buf, fontABC + fontABCidx, size * count); memcpy(buf, fontABC + fontABCidx, size * count);
@@ -1278,12 +1269,7 @@ ssize_t write(int fd, const void *buf, size_t count)
return driveboardWrite(fd, buf, count); return driveboardWrite(fd, buf, count);
} }
if (fd == hooks[SERIAL0] && getConfig()->emulateCardreader) if ((fd == hooks[SERIAL0] || fd == hooks[SERIAL1]) && getConfig()->emulateCardreader)
{
return cardReaderWrite(fd, buf, count);
}
if (fd == hooks[SERIAL1] && getConfig()->emulateCardreader)
{ {
return cardReaderWrite(fd, buf, count); return cardReaderWrite(fd, buf, count);
} }
@@ -1685,7 +1671,7 @@ int setenv(const char *name, const char *value, int overwrite)
/** /**
* @brief Hook for the getenv function. * @brief Hook for the getenv function.
* *
* This function iFake the TEA_DIR environment variable to games that require it to run * This function "Fakes" the TEA_DIR environment variable to games that require it to run
* @param name The name of the environment variable. * @param name The name of the environment variable.
*/ */
char *getenv(const char *name) char *getenv(const char *name)
+10 -6
View File
@@ -212,8 +212,8 @@ void *readJVSFrameThread(void * arg)
* @param fd * @param fd
* @return 0|1 * @return 0|1
*/ */
int startJVSFrameThread(int * fd) { int startJVSFrameThread(int *fd)
int fdlocal = *((int *) fd); {
printf("SERIAL: starting thread.\n"); printf("SERIAL: starting thread.\n");
// Clean shared JVS frame buffer // Clean shared JVS frame buffer
@@ -236,17 +236,21 @@ int startJVSFrameThread(int * fd) {
* Return a JVSFrame structure with empty or full data, no in between * Return a JVSFrame structure with empty or full data, no in between
* @return * @return
*/ */
JVSFrame readJVSFrameFromThread() { JVSFrame readJVSFrameFromThread()
{
JVSFrame frame; JVSFrame frame;
// Lock while reading/writing to shared frame // Lock while reading/writing to shared frame
pthread_mutex_lock(&jvsBuffer_lock); pthread_mutex_lock(&jvsBuffer_lock);
// Check if we have a valid frame // Check if we have a valid frame
if (jvsFrameBuffer.ready == 1) { if (jvsFrameBuffer.ready == 1)
{
frame = jvsFrameBuffer; frame = jvsFrameBuffer;
// It has been red, we disable this frame // It has been read, we disable this frame
jvsFrameBuffer.ready = 0; jvsFrameBuffer.ready = 0;
} else { }
else
{
frame.ready = 0; frame.ready = 0;
frame.size = 0; frame.size = 0;
memset(frame.buffer, 0, JVSBUFFER_SIZE); memset(frame.buffer, 0, JVSBUFFER_SIZE);
+1
View File
@@ -2136,6 +2136,7 @@ int initPatch()
detourFunction(0x084d44fc, amDipswSetLed); detourFunction(0x084d44fc, amDipswSetLed);
detourFunction(0x084d4485, amDipswGetData); detourFunction(0x084d4485, amDipswGetData);
patchMemory(0x0804edb2, "9090909090"); //__intel_new_proc_init_P patchMemory(0x0804edb2, "9090909090"); //__intel_new_proc_init_P
detourFunction(0x08178e6c, stubRetOne); // _ZN7am_ctrl18SetNetworkAddrEth0Ejj.
detourFunction(0x0804e594, gl_XGetProcAddressARB); detourFunction(0x0804e594, gl_XGetProcAddressARB);
srtvElfShaderPatcher(); srtvElfShaderPatcher();
+193 -5
View File
@@ -1267,6 +1267,172 @@ void glVertex3fHOD4(GLfloat x, GLfloat y, GLfloat z)
_glVertex3f(x, y, z); _glVertex3f(x, y, z);
} }
void tooSpicySC(uint32_t param_1, uint32_t param_2)
{
myEnableScaling = true;
SDL_WarpMouseInWindow(SDLwindow, 1280 / 2, 768 / 2);
((void (*)(uint32_t, uint32_t))0x082fa77c)(param_1, param_2);
}
void tooSpicyPR(uint32_t param_1, uint32_t param_2)
{
myEnableScaling = false;
((void (*)(uint32_t, uint32_t))0x081eb4d4)(param_1, param_2);
}
int tooSpicyVsprintf(char *str, const char *format, va_list arg)
{
int (*_vsprintf)(char *str, const char *format, va_list arg) = dlsym(RTLD_NEXT, "vsprintf");
int res = _vsprintf(str, format, arg);
if (strcmp(str, "Additional 475") == 0)
{
myEnableScaling = false;
}
return res;
}
void glVertex3f2SP(GLfloat x, GLfloat y, GLfloat z)
{
int (*_glVertex3f)(GLfloat x, GLfloat y, GLfloat z) = dlsym(RTLD_NEXT, "glVertex3f");
void *returnAddress = __builtin_return_address(0);
float scaleX = gWidth / 1280.0f;
float scaleY = gHeight / 768.0f;
float TestX = ((((gWidth - 1280.0) / 2.0) * 1.1116317809) / 1280.0) * (1.5 / scaleX);
float TestY = ((((gHeight - 768.0) / 2.0) * 0.666979044) / 768.0) * (1.5 / scaleX);
float OffsetX = TestX; // test
float OffsetY = TestY;
float scaleZ = fabs(z) / 1.510000;
float AdjOffsetX = OffsetX * scaleZ;
float AdjOffsetY = OffsetY * scaleZ;
if (z == -3.000000f)
{ // videos
}
else if (z == -1.010000f)
{ // bd main
x += AdjOffsetX;
y -= AdjOffsetY;
x *= scaleX;
y *= scaleY;
}
else if (z == -1.510000f)
{ // logo - coin/start - 2D
if (curTextureID == 497) // right
{
x -= OffsetX;
y -= OffsetY;
x *= scaleX;
y *= scaleY;
}
else if (curTextureID == 498)
{ // deadend
}
else
{
x += OffsetX;
y -= OffsetY;
x *= scaleX;
y *= scaleY;
}
}
else if (z == -1.460000f)
{ // 2D title
x += AdjOffsetX;
y -= AdjOffsetY;
x *= scaleX;
y *= scaleY;
}
else if (z == -1.490000f)
{ // 2D title
x += AdjOffsetX;
y -= AdjOffsetY;
x *= scaleX;
y *= scaleY;
}
else if (z == -1.500000f)
{ // 2D title
x += AdjOffsetX;
y -= AdjOffsetY;
x *= scaleX;
y *= scaleY;
}
else if (z == -1.310000f)
{ // 2D
x += AdjOffsetX;
y -= AdjOffsetY;
x *= scaleX;
y *= scaleY;
}
else if (z == -1.210000f)
{ // 2D
x += AdjOffsetX;
y -= AdjOffsetY;
x *= scaleX;
y *= scaleY;
}
else if (z == -1.5109999180f)
{ // 2D
x += AdjOffsetX;
y -= AdjOffsetY;
x *= scaleX;
y *= scaleY;
}
else if (z == -1.200000f)
{ // target - select
if (curTextureID == 454 || curTextureID == 461 || curTextureID == 456)
{ // 457 X - 454 461 456 O
if (myEnableScaling)
{
x += AdjOffsetX;
y -= AdjOffsetY;
x *= scaleX;
y *= scaleY;
}
}
}
else if (z == -1.710000f)
{ // 2D
x += AdjOffsetX;
y -= AdjOffsetY;
x *= scaleX;
y *= scaleY;
}
else if (z > -1.85f)
{ // 2d
x += AdjOffsetX;
y -= AdjOffsetY;
x *= scaleX;
y *= scaleY;
}
else
{
}
_glVertex3f(x, y, z);
}
void glVertex3fHarley(GLfloat x, GLfloat y, GLfloat z) void glVertex3fHarley(GLfloat x, GLfloat y, GLfloat z)
{ {
int (*_glVertex3f)(GLfloat x, GLfloat y, GLfloat z) = dlsym(RTLD_NEXT, "glVertex3f"); int (*_glVertex3f)(GLfloat x, GLfloat y, GLfloat z) = dlsym(RTLD_NEXT, "glVertex3f");
@@ -1286,11 +1452,6 @@ void glVertex3fHarley(GLfloat x, GLfloat y, GLfloat z)
y *= scaleY; y *= scaleY;
} }
void *addr = __builtin_return_address(0); void *addr = __builtin_return_address(0);
// printf("glVertex3f is hooked: x=%f, y=%f, z=%f\n", x, y, z);
// printf("z values: %.10f\n", z);
// if ( z == -3517.2272949219f){ //1360x768
// if ( z == -4271.795898f){ //900p
if (z == -5300.7529296875) if (z == -5300.7529296875)
{ // 1080p { // 1080p
printf("glVertex3f hooked: x=%f, y=%f, z=%f, addr: %p\n", x, y, z, addr); printf("glVertex3f hooked: x=%f, y=%f, z=%f, addr: %p\n", x, y, z, addr);
@@ -2655,6 +2816,23 @@ int initResolutionPatches()
{ {
break; break;
} }
setVariable(0x08785b80, gWidth); // main
setVariable(0x08785b84, gHeight);
patchMemory(0x082a3222, "02");
setVariable(0x08785ad8, 1360); // sprite res 1280x768
setVariable(0x08785adc, 768);
setVariable(0x087859b8, 1360); // sprite res 640x480
setVariable(0x087859bc, 768);
patchMemory(0x081775d2, "b801000000"); // target
patchMemory(0x0804e5d2, "909090909090");
// detourFunction(0x0804d254, glVertex3fHODEX);
setVariable(0x087aa080, gWidth); // render res
patchMemory(0x0804e60c, "909090909090");
patchMemory(0x0828cc2f, "909090909090");
} }
break; break;
case TOO_SPICY: case TOO_SPICY:
@@ -2669,6 +2847,16 @@ int initResolutionPatches()
{ {
break; break;
} }
setVariable(0x08202b22, gWidth); // render res
patchMemory(0x08202b19, "74");
setVariable(0x08664410, gWidth); // 1280x768
setVariable(0x08664414, gHeight);
detourFunction(0x0804d0d0, glVertex3f2SP);
detourFunction(0x0804dda0, myGlBindTexture);
replaceCallAtAddress(0x080d96ff, tooSpicySC);
replaceCallAtAddress(0x080da026, tooSpicyPR);
detourFunction(0x0804ce10, tooSpicyVsprintf);
patchMemory(0x081f96b9, "02"); // 5
} }
break; break;
case TOO_SPICY_TEST: case TOO_SPICY_TEST:
-1
View File
@@ -1,7 +1,6 @@
#ifndef __i386__ #ifndef __i386__
#define __i386__ #define __i386__
#include "log.h"
#include <stdint.h> #include <stdint.h>
#endif #endif
#undef __x86_64__ #undef __x86_64__