mirror of
https://github.com/lindbergh-loader/lindbergh-loader.git
synced 2026-10-14 01:49:12 +03:00
Compare commits
16
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec428d26be | ||
|
|
ba51502fdb | ||
|
|
aedad4dcdf | ||
|
|
374ecd6e84 | ||
|
|
f5c8c8c0f0 | ||
|
|
feaa6a912e | ||
|
|
b129220822 | ||
|
|
4d07faa251 | ||
|
|
5558718f29 | ||
|
|
e9e62a3bd1 | ||
|
|
293b4e8c25 | ||
|
|
e7d8c5a80a | ||
|
|
92eb48691d | ||
|
|
55fd8955c1 | ||
|
|
ea35dcdad2 | ||
|
|
fb557044d7 |
@@ -8,7 +8,7 @@ jobs:
|
||||
linux-appimage:
|
||||
name: "Build"
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 120
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -17,11 +17,15 @@ jobs:
|
||||
- name: Install Packages
|
||||
run: scripts/appimage/install-packages.sh
|
||||
|
||||
- name: Build Deps
|
||||
run: scripts/appimage/build-deps.sh
|
||||
|
||||
- name: Compile Build
|
||||
shell: bash
|
||||
run: |
|
||||
make
|
||||
scripts/appimage/make-appimage.sh
|
||||
|
||||
- name: Upload AppImage
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
|
||||
@@ -16,6 +16,7 @@ on:
|
||||
- '**.md'
|
||||
- '.github/ISSUE_TEMPLATE/*'
|
||||
- '.docs/changelog'
|
||||
- '.github/workflows/*'
|
||||
|
||||
jobs:
|
||||
linux-build:
|
||||
@@ -32,29 +33,69 @@ jobs:
|
||||
name: 📤 Create Release
|
||||
needs: [linux-build, linux-flatpak, linux-appimage]
|
||||
runs-on: ubuntu-22.04
|
||||
if: github.ref == 'refs/heads/master'
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
||||
steps:
|
||||
# Step 1: Checkout the code to access Git history and tags
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
# Fetch all history and tags, necessary for git tag command
|
||||
fetch-depth: 0
|
||||
|
||||
# Step 2: Download artifacts from previous build jobs
|
||||
- name: Download Artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: ./artifacts/
|
||||
|
||||
# Optional: Display downloaded artifacts for debugging
|
||||
- name: Display Downloaded Artifacts
|
||||
run: find ./artifacts/
|
||||
|
||||
- name: Add 161 to github.run_number
|
||||
# Step 3: Extract the latest version from changelog.md
|
||||
- name: Extract Version from Changelog
|
||||
id: get_version
|
||||
run: |
|
||||
NEW_RUN_NUMBER=$(( ${{ github.run_number }} + 161 ))
|
||||
echo "NEW_RUN_NUMBER=$NEW_RUN_NUMBER" >> $GITHUB_ENV
|
||||
# Define the path to the changelog file (adjust if it's not at the root)
|
||||
CHANGELOG_FILE="./docs/changelog"
|
||||
|
||||
- name: Create Preview Release
|
||||
if: github.ref == 'refs/heads/master'
|
||||
echo "Attempting to extract version from $CHANGELOG_FILE..."
|
||||
|
||||
# Check if the changelog file exists
|
||||
if [[ ! -f "$CHANGELOG_FILE" ]]; then
|
||||
echo "Error: Changelog file '$CHANGELOG_FILE' not found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
VERSION=$(awk '/^## \[/ { match($0, /\[([^]]+)\]/, arr); print arr[1]; exit }' "$CHANGELOG_FILE")
|
||||
|
||||
# Check if a version was actually extracted
|
||||
if [[ -z "$VERSION" ]]; then
|
||||
echo "Error: Could not find version in '$CHANGELOG_FILE'. Expected format like '## [X.Y.Z]' near the top."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Found version: $VERSION"
|
||||
|
||||
# Set environment variables for the release step
|
||||
# RELEASE_TAG often includes a 'v' prefix, RELEASE_VERSION is the plain version
|
||||
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
|
||||
echo "RELEASE_TAG=v$VERSION" >> $GITHUB_ENV # Add 'v' prefix for the tag
|
||||
echo "Using tag: v$VERSION"
|
||||
|
||||
# Step 4: Create the release using the calculated tag
|
||||
- name: Create Release
|
||||
uses: "marvinpinto/action-automatic-releases@latest"
|
||||
with:
|
||||
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
automatic_release_tag: v${{ env.NEW_RUN_NUMBER }}
|
||||
# Use the environment variable set in the previous step
|
||||
# automatic_release_tag: ${{ env.NEXT_TAG }}
|
||||
automatic_release_tag: ${{ env.RELEASE_TAG }}
|
||||
# Keep prerelease as false unless you want preview releases
|
||||
prerelease: false
|
||||
title: "Build v${{ env.NEW_RUN_NUMBER }}"
|
||||
# Update the title to use the new tag
|
||||
# title: "Build ${{ env.NEXT_TAG }}"
|
||||
title: "Build ${{ env.RELEASE_TAG }}"
|
||||
files: |
|
||||
./artifacts/linux-flatpak/lindbergh-loader.flatpak
|
||||
./artifacts/linux-build/build.tar.gz
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
.cache
|
||||
bld
|
||||
build/
|
||||
test/
|
||||
|
||||
+5
-6
@@ -12,9 +12,8 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build)
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build)
|
||||
|
||||
# Source files for various targets
|
||||
file(GLOB LIND_OBJS "src/lindbergh/*.c" "src/lindbergh/*.cpp")
|
||||
list(FILTER LIND_OBJS EXCLUDE REGEX "src/lindbergh/lindbergh.o")
|
||||
list(FILTER LIND_OBJS EXCLUDE REGEX "src/lindbergh/evdevinput.o")
|
||||
file(GLOB LIND_OBJS "src/lindbergh/*.c")
|
||||
list(FILTER LIND_OBJS EXCLUDE REGEX "src/lindbergh/lindbergh.c")
|
||||
|
||||
file(GLOB XDIFF_SRCS "src/libxdiff/xdiff/*.c")
|
||||
|
||||
@@ -27,12 +26,12 @@ set(LINDBERGH_CXX_FLAGS ${LINDBERGH_C_FLAGS} -std=c++11)
|
||||
set(LIBXDIFF_C_FLAGS -DHAVE_CONFIG_H -fPIC -m32)
|
||||
set(LIBSEGAAPI_CXX_FLAGS -m32 -fPIC -shared)
|
||||
set(LIBSEGAAPI_LINKER_FLAGS -m32 -lFAudio)
|
||||
set(SHARED_LINKER_FLAGS -m32 -Wl,-z,defs -rdynamic -static-libstdc++ -static-libgcc -lc -ldl -lGL -lglut -lX11 -lSDL2 -lm -lpthread -shared -lstdc++ -nostdlib -lasound)
|
||||
set(SHARED_LINKER_FLAGS -m32 -Wl,-z,defs -rdynamic -static-libstdc++ -static-libgcc -lc -ldl -lGL -lglut -lX11 -lXcursor -lSDL2 -lm -lpthread -shared -lstdc++ -nostdlib -lasound)
|
||||
|
||||
# Build executable for lindbergh
|
||||
add_executable(lindyloader src/lindbergh/lindbergh.c src/lindbergh/evdevinput.c src/lindbergh/evdevinput.h)
|
||||
add_executable(lindyloader src/lindbergh/lindbergh.c src/lindbergh/evdevinput.c src/lindbergh/evdevinput.h src/lindbergh/log.c src/lindbergh/log.h src/lindbergh/jvs.c src/lindbergh/jvs.h src/lindbergh/config.h src/lindbergh/config.c)
|
||||
set_target_properties(lindyloader PROPERTIES OUTPUT_NAME "lindbergh")
|
||||
set_target_properties(lindyloader PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} LINK_FLAGS "-m32")
|
||||
set_target_properties(lindyloader PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} LINK_FLAGS "-m32 -lm")
|
||||
target_compile_options(lindyloader PRIVATE ${LINDBERGH_EXE})
|
||||
|
||||
# Build static library libxdiff.a with its own flags
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[](https://github.com/lindbergh-loader/lindbergh-loader/actions)
|
||||
[](https://github.com/lindbergh-loader/lindbergh-loader/actions)
|
||||
|
||||
# SEGA Lindbergh Emulator
|
||||
|
||||
|
||||
@@ -2,6 +2,24 @@
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
## [2.0.14]
|
||||
### Added
|
||||
- Bobby's birthday checking!
|
||||
- FPS target to float.
|
||||
### Fixed
|
||||
- a bub in config.c where MJ4_ENABLED_ALL_THE_TIME was using the wrong variable.
|
||||
|
||||
## [2.0.13]
|
||||
### Added
|
||||
|
||||
- Clear window when the game is loading to prevent ghosting in SDL
|
||||
- Prevent the created windows to resize/maximize.
|
||||
- Version in github now matches the version in the changelog.
|
||||
### Fixed
|
||||
- Fixed a bug in Let's Go Jungle Special Resolution Patch.
|
||||
- Cleaned unnecessary global variables in resolution.c
|
||||
- Fixed a bug in that prevented the loader to start when the current folder contained spaces and lindbergh.so was there.
|
||||
|
||||
## [2.0.12]
|
||||
### Added
|
||||
- AppImage support.
|
||||
|
||||
Executable
+30
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
APPIMAGEDIRNAME=lindbergh-loader.AppDir
|
||||
OUTPUT_FOLDER=$(realpath "./$APPIMAGEDIRNAME")
|
||||
|
||||
mkdir build-deps
|
||||
cd build-deps
|
||||
|
||||
# Build openal
|
||||
wget https://github.com/kcat/openal-soft/archive/refs/tags/openal-soft-1.17.2.tar.gz
|
||||
tar -xzf openal-soft-1.17.2.tar.gz
|
||||
cd openal-soft-openal-soft-1.17.2/build
|
||||
|
||||
CFLAGS="-m32 -mstackrealign" CXXFLAGS="-m32 -std=c++14 -mstackrealign" cmake ../ -DALSOFT_BACKEND_PULSEAUDIO=ON -DALSOFT_BACKEND_ALSA=ON -DALSOFT_BACKEND_JACK=OFF -DALSOFT_BACKEND_SNDIO=ON
|
||||
|
||||
make -j4
|
||||
sudo cp libopenal.so.1.17.2 /usr/lib/i386-linux-gnu/libopenal.so.0
|
||||
cd ../../
|
||||
|
||||
# Build libSSL and libCrypto
|
||||
wget https://github.com/openssl/openssl/archive/refs/tags/OpenSSL_0_9_7.tar.gz
|
||||
tar -xzf OpenSSL_0_9_7.tar.gz
|
||||
cd openssl-OpenSSL_0_9_7
|
||||
cp ../../scripts/appimage/patches/openssl-0.9.7.patch .
|
||||
./Configure shared 386 no-asm no-krb5 linux-pentium -m32
|
||||
patch -p1 < openssl-0.9.7.patch
|
||||
CFLAGS=-m32 make
|
||||
sudo cp libcrypto.so.0.9.7 /usr/lib/i386-linux-gnu
|
||||
sudo cp libssl.so.0.9.7 /usr/lib/i386-linux-gnu
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
echo "Install Packages Running..."
|
||||
sudo dpkg --add-architecture i386
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install --no-install-recommends \
|
||||
build-essential gcc-multilib fuse freeglut3-dev:i386 libsdl2-dev:i386 libfaudio-dev:i386 libvdpau1:i386 \
|
||||
libstdc++5:i386 libxmu6:i386 libpcsclite1:i386 libncurses5:i386 unzip
|
||||
sudo apt update
|
||||
sudo apt -y install --no-install-recommends \
|
||||
build-essential gcc-multilib g++-multilib cmake fuse freeglut3-dev:i386 libsdl2-dev:i386 libfaudio-dev:i386 libvdpau1:i386 \
|
||||
libstdc++5:i386 libxmu6:i386 libpcsclite1:i386 libncurses5:i386 unzip libsndio-dev:i386
|
||||
|
||||
sudo add-apt-repository ppa:kisak/kisak-mesa -y
|
||||
sudo apt-get -y update && sudo apt -y dist-upgrade
|
||||
sudo apt update -y && sudo apt upgrade -y
|
||||
@@ -13,6 +13,8 @@ declare -a ADDED_LIBS=(
|
||||
"libGLU.so.1"
|
||||
"libglut.so.3"
|
||||
"libglapi.so.0"
|
||||
"libICE.so.6"
|
||||
"libSM.so.6"
|
||||
"libX11.so.6"
|
||||
"libX11-xcb.so.1"
|
||||
"libxcb.so.1"
|
||||
@@ -25,6 +27,11 @@ declare -a ADDED_LIBS=(
|
||||
"libstdc++.so.5"
|
||||
"libdrm.so.2"
|
||||
"libexpat.so.1"
|
||||
"libm.so.6"
|
||||
"libopenal.so.0"
|
||||
"libcrypto.so.0.9.7"
|
||||
"libssl.so.0.9.7"
|
||||
"libuuid.so.1"
|
||||
)
|
||||
|
||||
set -e
|
||||
@@ -71,10 +78,7 @@ cp lindbergh.so $OUTPUT_FOLDER/usr/lib
|
||||
cp libposixtime.so $OUTPUT_FOLDER/usr/lib
|
||||
mv lindbergh $OUTPUT_FOLDER/usr/bin
|
||||
mkdir -p $OUTPUT_FOLDER/usr/lib/dri
|
||||
cp /usr/lib/i386-linux-gnu/dri/* $OUTPUT_FOLDER/usr/lib/dri
|
||||
cp ../libs/libcrypto.so.0.9.7 $OUTPUT_FOLDER/usr/lib
|
||||
cp ../libs/libssl.so.0.9.7 $OUTPUT_FOLDER/usr/lib
|
||||
cp ../libs/libopenal.so.0 $OUTPUT_FOLDER/usr/lib
|
||||
cp /usr/lib/i386-linux-gnu/dri/* $OUTPUT_FOLDER/usr/lib/dri
|
||||
cd ..
|
||||
|
||||
echo "Running linuxdeploy to create AppDir..."
|
||||
@@ -86,9 +90,6 @@ 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/lindbergh.so $OUTPUT_FOLDER/usr/lib32
|
||||
mv $OUTPUT_FOLDER/usr/lib/libposixtime.so $OUTPUT_FOLDER/usr/lib32
|
||||
mv $OUTPUT_FOLDER/usr/lib/libcrypto.so.0.9.7 $OUTPUT_FOLDER/usr/lib32
|
||||
mv $OUTPUT_FOLDER/usr/lib/libssl.so.0.9.7 $OUTPUT_FOLDER/usr/lib32
|
||||
mv $OUTPUT_FOLDER/usr/lib/libopenal.so.0 $OUTPUT_FOLDER/usr/lib32
|
||||
mv $OUTPUT_FOLDER/usr/lib/dri $OUTPUT_FOLDER/usr/lib32
|
||||
|
||||
unzip libs/Cg-3.1.zip -d $OUTPUT_FOLDER/usr/lib32
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
diff -ruN openssl-OpenSSL_0_9_7.orig/Makefile.ssl openssl-OpenSSL_0_9_7/Makefile.ssl
|
||||
--- openssl-OpenSSL_0_9_7.orig/Makefile.ssl 2025-04-14 05:05:11.162340308 +0000
|
||||
+++ openssl-OpenSSL_0_9_7/Makefile.ssl 2025-04-14 05:06:22.261420144 +0000
|
||||
@@ -198,7 +198,7 @@
|
||||
SHARED_SSL=libssl$(SHLIB_EXT)
|
||||
SHARED_LIBS=$(SHARED_CRYPTO) $(SHARED_SSL)
|
||||
SHARED_LIBS_LINK_EXTS=.so.$(SHLIB_MAJOR) .so
|
||||
-SHARED_LDFLAGS=
|
||||
+SHARED_LDFLAGS=-m32
|
||||
|
||||
GENERAL= Makefile
|
||||
BASENAME= openssl
|
||||
|
||||
@@ -72,7 +72,7 @@ modules:
|
||||
x86_64: *i386-build-options
|
||||
sources:
|
||||
- type: archive
|
||||
url: https://mesa.freedesktop.org/archive/glu/glu-9.0.2.tar.xz
|
||||
url: https://archive.mesa3d.org/glu/glu-9.0.2.tar.xz
|
||||
sha256: 6e7280ff585c6a1d9dfcdf2fca489251634b3377bfc33c29e4002466a38d02d4
|
||||
|
||||
# Build 32-bit freeglut
|
||||
|
||||
@@ -61,6 +61,8 @@ int selectReply = -1;
|
||||
int jvsFileDescriptor = -1;
|
||||
int jvsPacketSize = -1;
|
||||
|
||||
char serialString[1024] = {0};
|
||||
|
||||
int initBaseboard()
|
||||
{
|
||||
char *sramPath = getConfig()->sramPath;
|
||||
@@ -90,6 +92,26 @@ int initBaseboard()
|
||||
startJVSFrameThread(&jvsFileDescriptor);
|
||||
}
|
||||
|
||||
strcpy(serialString, SERIAL_STRING);
|
||||
|
||||
time_t t = time(NULL); // Get current time
|
||||
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 day = tm_info->tm_mday; // tm_mday is the day of the month
|
||||
|
||||
if (month == 1 && day == 18) {
|
||||
strcpy(serialString, "HAPPY BIRTHDAY!!");
|
||||
}
|
||||
|
||||
if (month == 5 && day == 20) {
|
||||
strcpy(serialString, "HAPPY BIRTHDAY!!");
|
||||
}
|
||||
|
||||
if (month == 5 && day == 21) {
|
||||
strcpy(serialString, "HAPPY BIRTHDAY!!");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -236,7 +258,7 @@ int baseboardIoctl(int fd, unsigned int request, void *data)
|
||||
|
||||
case BASEBOARD_GET_SERIAL:
|
||||
{
|
||||
memcpy(&sharedMemory[serialCommand.destAddress + 96], SERIAL_STRING, strlen(SERIAL_STRING));
|
||||
memcpy(&sharedMemory[serialCommand.destAddress + 96], serialString, strlen(serialString));
|
||||
_data[1] = 1; // Set the status to success
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1238,7 +1238,7 @@ int readConfig(FILE *configFile, EmulatorConfig *config)
|
||||
config->fpsLimiter = atoi(getNextToken(NULL, " ", &saveptr));
|
||||
|
||||
else if (strcmp(command, "FPS_TARGET") == 0)
|
||||
config->fpsTarget = atoi(getNextToken(NULL, " ", &saveptr));
|
||||
config->fpsTarget = atof(getNextToken(NULL, " ", &saveptr));
|
||||
|
||||
else if (strcmp(command, "LGJ_RENDER_WITH_MESA") == 0)
|
||||
config->lgjRenderWithMesa = atoi(getNextToken(NULL, " ", &saveptr));
|
||||
@@ -1274,7 +1274,7 @@ int readConfig(FILE *configFile, EmulatorConfig *config)
|
||||
config->phTouchCursorHeight = atoi(getNextToken(NULL, " ", &saveptr));
|
||||
|
||||
else if (strcmp(command, "MJ4_ENABLED_ALL_THE_TIME") == 0)
|
||||
config->phMode = atoi(getNextToken(NULL, " ", &saveptr));
|
||||
config->mj4EnabledAtT = atoi(getNextToken(NULL, " ", &saveptr));
|
||||
|
||||
else if (strcmp(command, "OR2_IP") == 0)
|
||||
strcpy(config->or2IP, getNextToken(NULL, " ", &saveptr));
|
||||
@@ -1567,7 +1567,7 @@ int initConfig(const char* configFilePath)
|
||||
config.jvsIOType = SEGA_TYPE_3;
|
||||
config.GPUVendor = AUTO_DETECT_GPU;
|
||||
config.fpsLimiter = 0;
|
||||
config.fpsTarget = 60;
|
||||
config.fpsTarget = 60.0f;
|
||||
config.noSDL = 0;
|
||||
config.phMode = 2;
|
||||
config.disableBuiltinFont = 0;
|
||||
|
||||
@@ -261,7 +261,7 @@ typedef struct
|
||||
int hummerFlickerFix;
|
||||
int keepAspectRatio;
|
||||
int fpsLimiter;
|
||||
int fpsTarget;
|
||||
float fpsTarget;
|
||||
int lgjRenderWithMesa;
|
||||
int noSDL;
|
||||
int phMode;
|
||||
|
||||
@@ -240,14 +240,15 @@ char *findPreloadLibrary(const char *originalDir, const char *gameDir)
|
||||
const char *folderCandidates[] = {"/app/lib32", appImageLib, originalDir, "/usr/lib/i386-linux-gnu", "/usr/lib/i686-linux-gnu",
|
||||
"/usr/lib32", "/usr/lib", NULL};
|
||||
|
||||
if (fileExists(PRELOAD_FILE_NAME))
|
||||
return PRELOAD_FILE_NAME;
|
||||
|
||||
for (int i = 0; i < sizeof(folderCandidates) / sizeof(folderCandidates[0]); i++)
|
||||
{
|
||||
snprintf(result, MAX_PATH_LENGTH, "%s/%s", folderCandidates[i], PRELOAD_FILE_NAME);
|
||||
if (fileExists(result))
|
||||
return result;
|
||||
}
|
||||
if (fileExists(PRELOAD_FILE_NAME))
|
||||
return PRELOAD_FILE_NAME;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -338,9 +339,13 @@ void setEnvironmentVariables(const char *ldLibPath, const char *originalDir, con
|
||||
setenv("__NV_PRIME_RENDER_OFFLOAD", "1", 1);
|
||||
}
|
||||
|
||||
char libglDriPath[MAX_PATH_LENGTH];
|
||||
sprintf(libglDriPath, "%s/usr/lib32/dri", getenv("APP_IMG_ROOT"));
|
||||
setenv("LIBGL_DRIVERS_PATH", libglDriPath, 1);
|
||||
char *appImgRoot = getenv("APP_IMG_ROOT");
|
||||
if (appImgRoot != NULL)
|
||||
{
|
||||
char libglDriPath[MAX_PATH_LENGTH];
|
||||
sprintf(libglDriPath, "%s/usr/lib32/dri", appImgRoot);
|
||||
setenv("LIBGL_DRIVERS_PATH", libglDriPath, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void printUsage(char *argv[])
|
||||
|
||||
+18
-25
@@ -48,11 +48,6 @@ float newReducedWidthABC, newReducedHeightABC;
|
||||
float newHalfWidthABC, newHalfHeightABC;
|
||||
float newWidthRangeABC, newHeightRangeABC;
|
||||
double new410ABC, new330ABC, new280ABC, new200ABC;
|
||||
uint32_t *newWidthRangePtr_CEI_ABC, *newHeightRangePtr_CEI_ABC;
|
||||
uint32_t *newWidthPtrABC, *newHeightPtrABC;
|
||||
uint32_t *newReducedWidthPtrABC, *newReducedHeightPtrABC;
|
||||
uint32_t *newHalfWidthPtrABC, *newHalfHeightPtrABC;
|
||||
uint32_t *new410PtrABC, *new330PtrABC, *new280PtrABC, *new200PtrABC;
|
||||
float angleABC;
|
||||
|
||||
float newVT3, newVT3HW, newVT3HH;
|
||||
@@ -68,6 +63,9 @@ int idTextShift = 0;
|
||||
float id4NewCaptionY;
|
||||
float idShiftX = 0.0;
|
||||
float isShiftY = 0.0;
|
||||
|
||||
float newHeightLGJ, newWidth2LGJ, newWidthHLGJ, newWidthSLGJ;
|
||||
|
||||
bool myEnableScaling = false;
|
||||
|
||||
int hummerRespatch()
|
||||
@@ -1062,15 +1060,15 @@ void patchABCMarkers(uint32_t addrCtrlEnemyInfo, uint32_t addrCtrlPlayerRivalFon
|
||||
new280ABC = (gWidth / 2.0) - 40.0; // 280
|
||||
new200ABC = (gHeight / 2.0) - 40.0; // 200
|
||||
|
||||
newWidthPtrABC = (uint32_t *)&newWidthABC;
|
||||
newHeightPtrABC = (uint32_t *)&newHeightABC;
|
||||
uint32_t *newWidthPtrABC = (uint32_t *)&newWidthABC;
|
||||
uint32_t *newHeightPtrABC = (uint32_t *)&newHeightABC;
|
||||
setVariable(addrCtrlPlayerRivalFont + 0x15b, (size_t)newWidthPtrABC); // 640
|
||||
setVariable(addrCtrlPlayerRivalFont + 0x163, (size_t)newHeightPtrABC); // 480
|
||||
setVariable(addrCtrlEnemyPursuit2d + 0x80, (size_t)newWidthPtrABC); // 640
|
||||
setVariable(addrCtrlEnemyPursuit2d + 0x88, (size_t)newHeightPtrABC); // 480
|
||||
|
||||
newReducedWidthPtrABC = (uint32_t *)&newReducedWidthABC;
|
||||
newReducedHeightPtrABC = (uint32_t *)&newReducedHeightABC;
|
||||
uint32_t *newReducedWidthPtrABC = (uint32_t *)&newReducedWidthABC;
|
||||
uint32_t *newReducedHeightPtrABC = (uint32_t *)&newReducedHeightABC;
|
||||
setVariable(addrCtrlPlayerRivalFont + 0x272, (size_t)newReducedWidthPtrABC); // 600
|
||||
setVariable(addrCtrlPlayerRivalFont + 0x29f, (size_t)newReducedHeightPtrABC); // 440
|
||||
setVariable(addrCtrlPlayerRivalFont + 0x8ff, *(uint32_t *)&newReducedHeightABC); // 440
|
||||
@@ -1081,8 +1079,8 @@ void patchABCMarkers(uint32_t addrCtrlEnemyInfo, uint32_t addrCtrlPlayerRivalFon
|
||||
setVariable(addrCtrlEnemyPursuit2d + 0x7b3, *(uint32_t *)&newReducedHeightABC); // 440
|
||||
setVariable(addrCtrlEnemyPursuit2d + 0x812, *(uint32_t *)&newReducedHeightABC); // 440
|
||||
|
||||
newHalfWidthPtrABC = (uint32_t *)&newHalfWidthABC;
|
||||
newHalfHeightPtrABC = (uint32_t *)&newHalfHeightABC;
|
||||
uint32_t *newHalfWidthPtrABC = (uint32_t *)&newHalfWidthABC;
|
||||
uint32_t *newHalfHeightPtrABC = (uint32_t *)&newHalfHeightABC;
|
||||
setVariable(addrCtrlPlayerRivalFont + 0x346, (size_t)newHalfWidthPtrABC); // 320
|
||||
setVariable(addrCtrlPlayerRivalFont + 0x34e, (size_t)newHalfHeightPtrABC); // 240
|
||||
setVariable(addrCtrlPlayerRivalFont + 0x4cb, (size_t)newHalfWidthPtrABC); // 320
|
||||
@@ -1108,10 +1106,10 @@ void patchABCMarkers(uint32_t addrCtrlEnemyInfo, uint32_t addrCtrlPlayerRivalFon
|
||||
setVariable(addrCtrlEnemyPursuit2d + 0x4ea, *(uint32_t *)&newWidthRangeABC); // 730
|
||||
setVariable(addrCtrlEnemyPursuit2d + 0x77b, *(uint32_t *)&newHeightRangeABC); // 570
|
||||
|
||||
new410PtrABC = (uint32_t *)&new410ABC;
|
||||
new330PtrABC = (uint32_t *)&new330ABC;
|
||||
new280PtrABC = (uint32_t *)&new280ABC;
|
||||
new200PtrABC = (uint32_t *)&new200ABC;
|
||||
uint32_t *new410PtrABC = (uint32_t *)&new410ABC;
|
||||
uint32_t *new330PtrABC = (uint32_t *)&new330ABC;
|
||||
uint32_t *new280PtrABC = (uint32_t *)&new280ABC;
|
||||
uint32_t *new200PtrABC = (uint32_t *)&new200ABC;
|
||||
setVariable(addrCtrlPlayerRivalFont + 0x40e, (size_t)new410PtrABC); // 410
|
||||
setVariable(addrCtrlPlayerRivalFont + 0x44a, (size_t)new330PtrABC); // 330
|
||||
setVariable(addrCtrlPlayerRivalFont + 0x5de, (size_t)new280PtrABC); // 280
|
||||
@@ -2436,23 +2434,18 @@ int initResolutionPatches()
|
||||
|
||||
setVariable(0x080d6ea0, gWidth); // 800
|
||||
setVariable(0x080d6eaa, gHeight); // 600
|
||||
patchMemory(0x08303c27, "01"); // FSAA
|
||||
|
||||
setVariable(0x080cf6ac, gWidth); // 800
|
||||
setVariable(0x080cf6b9, gHeight); // 600
|
||||
patchMemory(0x08303c27, "01"); // FSAA
|
||||
|
||||
float newWidthLGJ = (float)gWidth;
|
||||
float newHeightLGJ = (float)gHeight;
|
||||
uint32_t *newWidthPtrLGJ = (uint32_t *)&newWidthLGJ;
|
||||
newHeightLGJ = (float)gHeight;
|
||||
uint32_t *newHeightPtrLGJ = (uint32_t *)&newHeightLGJ;
|
||||
|
||||
float newWidth2LGJ = (float)gWidth * 2.0;
|
||||
newWidth2LGJ = (float)gWidth * 2.0;
|
||||
uint32_t *newWidth2PtrLGJ = (uint32_t *)&newWidth2LGJ;
|
||||
unsigned int address = 0x080cb730;
|
||||
|
||||
float newWidthHLGJ = (float)gWidth / 2.0;
|
||||
newWidthHLGJ = (float)gWidth / 2.0;
|
||||
uint32_t *newWidthHPtrLGJ = (uint32_t *)&newWidthHLGJ;
|
||||
float newWidthSLGJ = 1360.0 / (float)gWidth;
|
||||
newWidthSLGJ = 1360.0 / (float)gWidth;
|
||||
uint32_t *newWidthSPtrLGJ = (uint32_t *)&newWidthSLGJ;
|
||||
unsigned int addressC = 0x080cb3be;
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ void initSDL(int *argcp, char **argv)
|
||||
SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 1);
|
||||
}
|
||||
|
||||
uint32_t windowFlags = SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE;
|
||||
uint32_t windowFlags = SDL_WINDOW_OPENGL;
|
||||
|
||||
strcat(SDLgameTitle, getGameName());
|
||||
|
||||
@@ -156,6 +156,16 @@ void initSDL(int *argcp, char **argv)
|
||||
fprintf(stderr, "OpenGL context could not be created! SDL_Error: %s\n", SDL_GetError());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
glClearColor(0.1f, 0.1f, 0.1f, 1.0f); // Your bg color
|
||||
|
||||
// Force initial clear
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
SDL_GL_SwapWindow(SDLwindow);
|
||||
|
||||
// Now show the window
|
||||
SDL_ShowWindow(SDLwindow);
|
||||
|
||||
printf(" SDL RESOLUTION: %dx%d\n\n", getConfig()->width, getConfig()->height);
|
||||
|
||||
if (getConfig()->fullscreen)
|
||||
|
||||
@@ -60,6 +60,20 @@ Display *XOpenDisplay(const char *display_name)
|
||||
return x11Display;
|
||||
}
|
||||
|
||||
void setWindowProperties(Display *display, Window window)
|
||||
{
|
||||
XSizeHints *hints = XAllocSizeHints();
|
||||
|
||||
hints->flags = PMinSize | PMaxSize;
|
||||
hints->min_width = hints->max_width = getConfig()->width;
|
||||
hints->min_height = hints->max_height = getConfig()->height;
|
||||
XSetWMNormalHints(display, window, hints);
|
||||
XFree(hints);
|
||||
Atom hintsAtom = XInternAtom(display, "_MOTIF_WM_HINTS", False);
|
||||
XMapWindow(display, window);
|
||||
XFlush(display);
|
||||
}
|
||||
|
||||
Window XCreateWindow(Display *display, Window parent, int x, int y, unsigned int width, unsigned int height, unsigned int border_width,
|
||||
int depth, unsigned int class, Visual *visual, unsigned long valueMask, XSetWindowAttributes *attributes)
|
||||
{
|
||||
@@ -98,9 +112,21 @@ Window XCreateWindow(Display *display, Window parent, int x, int y, unsigned int
|
||||
{
|
||||
window = x11Window;
|
||||
}
|
||||
|
||||
// Eliminate the maximize window button and no more resizing
|
||||
if (!gettingGPUVendor && !creatingWindow)
|
||||
setWindowProperties(display, window);
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
// Here we prevent the games to change the window properties
|
||||
void XSetWMProperties(Display *display, Window w, XTextProperty *window_name, XTextProperty *icon_name, char **argv, int argc,
|
||||
XSizeHints *normal_hints, XWMHints *wm_hints, XClassHint *class_hints)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int XGrabPointer(Display *display, Window grab_window, Bool owner_events, unsigned int event_mask, int pointer_mode,
|
||||
int keyboard_mode, Window confine_to, Cursor cursor, Time time)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user