mirror of
https://github.com/lindbergh-loader/lindbergh-loader.git
synced 2026-10-13 17:48:27 +03:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
74d61985ec | ||
|
|
4d0996b905 | ||
|
|
52cb3eaf6b | ||
|
|
8b6604efc5 | ||
|
|
7b426f0d11 | ||
|
|
442d03b144 | ||
|
|
50a1a35f7f | ||
|
|
728c308835 | ||
|
|
543ebe4817 | ||
|
|
3c3f0f5eb5 | ||
|
|
fe2c749bb0 | ||
|
|
d3e6027139 | ||
|
|
565a9208b7 | ||
|
|
be78a23a31 | ||
|
|
8942c510ec | ||
|
|
685d569a08 | ||
|
|
5f19cdc44c | ||
|
|
be1b88b92f | ||
|
|
93927ef8c9 | ||
|
|
f67f30cbcd | ||
|
|
7ea08b3db3 | ||
|
|
dde7cc7b56 | ||
|
|
51eaec106c | ||
|
|
dcae95fe03 | ||
|
|
fbc76dfe5e |
@@ -42,7 +42,7 @@ jobs:
|
||||
|
||||
# Archive the build directory as an artifact for debugging
|
||||
- name: Archive build directory
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: build-output
|
||||
path: ./build
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
CC = gcc -m32 -pthread
|
||||
CFLAGS = -g -fPIC -m32 -Wall -Werror -Wno-misleading-indentation -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-function -D_GNU_SOURCE -Wno-char-subscripts
|
||||
LD = g++ -m32
|
||||
LDFLAGS = -Wl,-z,defs -rdynamic -static-libgcc -lc -ldl -lGL -lglut -lX11 -lSDL2 -lm -lpthread -shared -nostdlib -lasound -L./src/libxdiff -lxdiff
|
||||
CC ?= gcc
|
||||
CFLAGS = -g -fPIC -m32 -pthread -Wall -Werror -Wno-misleading-indentation -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-function -D_GNU_SOURCE -Wno-char-subscripts
|
||||
CXX ?= g++
|
||||
LD = $(CXX)
|
||||
LDFLAGS = -m32 -Wl,-z,defs -rdynamic -static-libgcc -lc -ldl -lGL -lglut -lX11 -lXcursor -lSDL2 -lm -lpthread -shared -nostdlib -lasound -L./src/libxdiff -lxdiff -L/app/lib32
|
||||
|
||||
BUILD = build
|
||||
|
||||
@@ -17,14 +18,14 @@ all: lindbergh libxdiff.a lindbergh.so libsegaapi.so libkswapapi.so libposixtime
|
||||
|
||||
lindbergh: src/lindbergh/lindbergh.c src/lindbergh/log.c src/lindbergh/log.h src/lindbergh/jvs.c src/lindbergh/jvs.h src/lindbergh/config.h src/lindbergh/config.c src/lindbergh/evdevinput.h src/lindbergh/evdevinput.c
|
||||
mkdir -p $(BUILD)
|
||||
$(CC) src/lindbergh/lindbergh.c src/lindbergh/log.h src/lindbergh/log.c src/lindbergh/jvs.h src/lindbergh/jvs.c src/lindbergh/config.h src/lindbergh/config.c src/lindbergh/evdevinput.c src/lindbergh/evdevinput.h -o $(BUILD)/lindbergh -lm
|
||||
$(CC) -m32 src/lindbergh/lindbergh.c src/lindbergh/log.h src/lindbergh/log.c src/lindbergh/jvs.h src/lindbergh/jvs.c src/lindbergh/config.h src/lindbergh/config.c src/lindbergh/evdevinput.c src/lindbergh/evdevinput.h -o $(BUILD)/lindbergh -lm
|
||||
|
||||
libxdiff.a: $(XDIFF_OBJS)
|
||||
mkdir -p $(BUILD)
|
||||
ar rcs src/libxdiff/libxdiff.a $(XDIFF_OBJS)
|
||||
|
||||
src/libxdiff/xdiff/%.o: src/libxdiff/xdiff/%.c
|
||||
$(CC) -DHAVE_CONFIG_H -fPIC -c $< -o $@
|
||||
$(CC) -m32 -DHAVE_CONFIG_H -fPIC -c $< -o $@
|
||||
|
||||
lindbergh.so: $(OBJS)
|
||||
mkdir -p $(BUILD)
|
||||
@@ -34,13 +35,13 @@ lindbergh.so: $(OBJS)
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
libsegaapi.so: src/libsegaapi/libsegaapi.o
|
||||
gcc -m32 -O0 -g src/libsegaapi/libsegaapi.c -lFAudio -fPIC -shared -o $(BUILD)/libsegaapi.so
|
||||
$(CC) -m32 -O0 -g src/libsegaapi/libsegaapi.c -lFAudio -fPIC -shared -o $(BUILD)/libsegaapi.so
|
||||
|
||||
libkswapapi.so: src/libkswapapi/libkswapapi.o
|
||||
$(CC) src/libkswapapi/libkswapapi.o -fPIC -shared -o $(BUILD)/libkswapapi.so
|
||||
$(CC) -m32 src/libkswapapi/libkswapapi.o -fPIC -shared -o $(BUILD)/libkswapapi.so
|
||||
|
||||
libposixtime.so:
|
||||
$(CC) src/libposixtime/libposixtime.c src/libposixtime/libposixtime.h -m32 -shared -o $(BUILD)/libposixtime.so
|
||||
$(CC) -m32 src/libposixtime/libposixtime.c src/libposixtime/libposixtime.h -m32 -shared -o $(BUILD)/libposixtime.so
|
||||
ln -s -f libposixtime.so $(BUILD)/libposixtime.so.1
|
||||
ln -s -f libposixtime.so $(BUILD)/libposixtime.so.2.4
|
||||
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
## [2.0.3]
|
||||
### Added
|
||||
- Display a warning when loading an Elf that is not clean.
|
||||
- Added to the lib folder, common libraries that are usually missing.
|
||||
### Fixed
|
||||
- Missing patch in HOD-EX.
|
||||
- Alows to run a game that does not support Card reader if option enabled in conf file.
|
||||
|
||||
## [2.0.2] 2025-01-27
|
||||
### Added
|
||||
- InitialD 5 SBRY added.
|
||||
- HOD4 SP CPU Frequency fix.
|
||||
### Fixed
|
||||
- Fixed a bug when a game uses GLUT and the conf was set to NO_SDL 1
|
||||
- Fixed a bug in Let's go Jungle when GPU was nVidia and Mesa was set as shader patches.
|
||||
- Exclude resolution patches when the resolution is the game's original resolution.
|
||||
- Reload with Right mouse click for Rambo and 2Spicy with SDL.
|
||||
|
||||
### [2.0.1] 2025-01-23
|
||||
### Added
|
||||
- HOD4 Custom crosshair.
|
||||
- HOD4 CPU frequency fix (Configurable via config file).
|
||||
- HOD4 New resolution patch that fixes Boss battle and scales from 1280x768 instead of the lower resolution.
|
||||
- Built in Logos and fonts (no more nee to use Lucida/SEGA_KakuGothic-DB-Roman_12 and logo.tga).
|
||||
- Outrun 2 Easy network config from the conf file (can set your IP address in the config file and the loader will set it in the eeprom for you).
|
||||
- Card Emulation for VT3 and R-tuned.
|
||||
- All the now games work inside an SDL window now, unless it is disabled in the conf file.
|
||||
|
||||
## [2.0] - 2024-12-24
|
||||
### Initial Release
|
||||
- First official public release.
|
||||
- Features of the loader:
|
||||
- Dynamic shader modification allowing games to work on Intel, nVidia and AMD
|
||||
- 5.1 Surround Sound Support
|
||||
- Dynamic resolution patching allowing most games to scale properly in HD
|
||||
- Original cabinet support with pass through of JVS and FFB
|
||||
- Network play
|
||||
- Both simple X11 and advanced evdev input system allowing for ready-to-play keyboard and mouse support or mapping of any controller
|
||||
+17
-2
@@ -48,11 +48,26 @@ sudo ln -s /lib/i386-linux-gnu/libglut.so /lib/i386-linux-gnu/libglut.so.3
|
||||
|
||||
### Let's Go Jungle Rev A
|
||||
|
||||
- The game must be run in export mode to have the stereo sound option.
|
||||
The game must be run in export mode to have the stereo sound option.
|
||||
|
||||
### Outrun 2 SP SDX
|
||||
|
||||
- You need to set `SKIP_OUTRUN_CABINET_CHECK` to 1 in `lindbergh.conf` to play in DX, SDX or Standard cabinet types.
|
||||
You need to set `SKIP_OUTRUN_CABINET_CHECK` to 1 in `lindbergh.conf` to play in DX, SDX or Standard cabinet types.
|
||||
|
||||
### Ghost Squad / 2Spicy
|
||||
|
||||
You may have sound issues such as the game complaining that the system cannot open `/dev[/sound]/dsp`. You **must not** use the `libopenal.so.0` files that came with the game, please delete those if you've moved them into your game folder. Do the following:
|
||||
|
||||
```
|
||||
sudo apt install pipewire-audio-client-libraries:i386
|
||||
sudo cp /usr/share/doc/pipewire/examples/alsa.conf.d/99-pipewire-default.conf /etc/alsa/conf.d/
|
||||
```
|
||||
|
||||
Then in the game folder you must create a symlink to the `libopenal.so.1` library installed on your system:
|
||||
|
||||
```
|
||||
ln -s /usr/lib/i386-linux-gnu/libopenal.so.1 libopenal.so.0
|
||||
```
|
||||
|
||||
## Configuration File : lindbergh.conf
|
||||
|
||||
|
||||
+1
-1
@@ -133,7 +133,7 @@ CUSTOM_CURSOR_HEIGHT 32
|
||||
|
||||
# Sets the IP address in the eeprom for Outrun link (you have to put your NIC ip)
|
||||
# OR2_IP 192.168.1.2
|
||||
# House of the dead 4 speed fix set the frequency of your CPU in Mhz (The speed reported by the manufacturer)
|
||||
# House of the dead 4 speed fix set the frequency of your CPU in Ghz (The speed reported by the manufacturer)
|
||||
# CPU_FREQ_GHZ 4.0
|
||||
|
||||
# Set the colour of the lindbergh to change the Segaboot logo
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -38,25 +38,28 @@ void initWriteCmd(int fdIdx)
|
||||
|
||||
int initCardReader()
|
||||
{
|
||||
initReadCmd(0);
|
||||
initReadCmd(1);
|
||||
initWriteCmd(0);
|
||||
initWriteCmd(1);
|
||||
|
||||
uint32_t gId = getConfig()->crc32;
|
||||
if (gId != VIRTUA_TENNIS_3 && gId != VIRTUA_TENNIS_3_TEST && gId != VIRTUA_TENNIS_3_REVA && gId != VIRTUA_TENNIS_3_REVA_TEST &&
|
||||
gId != VIRTUA_TENNIS_3_REVB && gId != VIRTUA_TENNIS_3_REVB_TEST && gId != VIRTUA_TENNIS_3_REVC &&
|
||||
gId != VIRTUA_TENNIS_3_REVC_TEST && gId != R_TUNED)
|
||||
{
|
||||
printf("Game does not support Card Reader, please disable the card reader emulation in the config file.\n");
|
||||
return -1;
|
||||
printf("Warning: This Game does not support Card Reader, please disable the card reader emulation in the config file.\n");
|
||||
printf(" I will disable the card reader for you.\n");
|
||||
EmulatorConfig *config = getConfig();
|
||||
config->emulateCardreader = 0;
|
||||
return 0;
|
||||
}
|
||||
if (getConfig()->emulateCardreader && getConfig()->emulateDriveboard && gId != R_TUNED)
|
||||
{
|
||||
printf("Game does not support Card Reader and Driver Board emulation enabled at the same time.\n");
|
||||
printf("Warning: This Game does not support Card Reader and Driver Board emulation enabled at the same time.\n");
|
||||
printf("Please disable Drive Board emulations in the config file.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
initReadCmd(0);
|
||||
initReadCmd(1);
|
||||
initWriteCmd(0);
|
||||
initWriteCmd(1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
+619
-588
File diff suppressed because it is too large
Load Diff
@@ -2,6 +2,7 @@
|
||||
#define CONFIG_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#define MAX_PATH_LENGTH 1024
|
||||
#define INPUT_STRING_LENGTH 256
|
||||
@@ -29,8 +30,9 @@
|
||||
#define INITIALD_4_EXP_REVD 0x62cc73a9 // DVP-0030D
|
||||
#define INITIALD_5_JAP_REVA 0xb3183112 // DVP-0070A
|
||||
#define INITIALD_5_JAP_REVF 0xfc3dc85d // DVP-0070F
|
||||
#define INITIALD_5_EXP_30 0x77c6b58b // DVP-0075 and DVP-0084????
|
||||
#define INITIALD_5_EXP_40 0xd4910e75 // DVP-0084A
|
||||
#define INITIALD_5_EXP 0x701b88cf // DVP-0075
|
||||
#define INITIALD_5_EXP_20 0x77c6b58b // DVP-0084
|
||||
#define INITIALD_5_EXP_20A 0xd4910e75 // DVP-0084A
|
||||
#define LETS_GO_JUNGLE 0xb1c8c901 // DVP-0011
|
||||
#define LETS_GO_JUNGLE_REVA 0xc697c4fb // DVP-0011A
|
||||
#define LETS_GO_JUNGLE_SPECIAL 0x240beedc // DVP-0036A
|
||||
@@ -70,7 +72,6 @@
|
||||
#define VIRTUA_FIGHTER_5_REVB 0x8953bd52 // DVP-0008B
|
||||
#define VIRTUA_FIGHTER_5_REVE 0x4c2edbf6 // DVP-0008E
|
||||
#define VIRTUA_FIGHTER_5_EXPORT 0xec474630 // DVP-0043
|
||||
#define VIRTUA_FIGHTER_5_FINAL_SHOWDOWN 0x48 // DVP-5019 or does not exist
|
||||
#define VIRTUA_FIGHTER_5_FINAL_SHOWDOWN_REVA 0xbae2be62 // DVP-5019A
|
||||
#define VIRTUA_FIGHTER_5_FINAL_SHOWDOWN_REVB 0x7cee1d81 // DVP-5020
|
||||
#define VIRTUA_FIGHTER_5_FINAL_SHOWDOWN_REVB_6000 0x34c0d02 // DVP-5020 ver 6.00 (Weird public version)
|
||||
@@ -268,6 +269,7 @@ typedef struct
|
||||
int customCursorHeight;
|
||||
int mj4EnabledAtT;
|
||||
char or2IP[16];
|
||||
char or2Netmask[16];
|
||||
float cpuFreqGhz;
|
||||
ArcadeInputs arcadeInputs;
|
||||
int inputMode; // 0 = both, 1 = SDL/X11 only, 2 = EVDEV only
|
||||
@@ -277,8 +279,9 @@ typedef struct
|
||||
int borderEnabled;
|
||||
} EmulatorConfig;
|
||||
|
||||
uint32_t get_crc32(const char *s, ssize_t n);
|
||||
KeyMapping getDefaultKeymap();
|
||||
int initConfig();
|
||||
int initConfig(const char* configFilePath);
|
||||
EmulatorConfig *getConfig();
|
||||
char *getGameName();
|
||||
char *getDVPName();
|
||||
|
||||
@@ -93,7 +93,7 @@ int initEeprom()
|
||||
|
||||
if ((getConfig()->crc32 == OUTRUN_2_SP_SDX || getConfig()->crc32 == OUTRUN_2_SP_SDX_REVA) && strcmp(getConfig()->or2IP, "") != 0)
|
||||
{
|
||||
if (setIP(eeprom, getConfig()->or2IP, "255.255.255.0") != 0)
|
||||
if (setIP(eeprom, getConfig()->or2IP, getConfig()->or2Netmask) != 0)
|
||||
{
|
||||
printf("Error setting the new IP address.");
|
||||
fclose(eeprom);
|
||||
|
||||
+13
-47
@@ -12,7 +12,6 @@
|
||||
#undef __x86_64__
|
||||
#include <arpa/inet.h>
|
||||
#include <dlfcn.h>
|
||||
#include <errno.h>
|
||||
#include <link.h>
|
||||
#include <linux/sockios.h>
|
||||
#include <math.h>
|
||||
@@ -31,8 +30,6 @@
|
||||
#include <ifaddrs.h>
|
||||
#include <dirent.h>
|
||||
|
||||
#include "hook.h"
|
||||
|
||||
#include "baseboard.h"
|
||||
#include "config.h"
|
||||
#include "driveboard.h"
|
||||
@@ -186,7 +183,9 @@ void __attribute__((constructor)) hook_init()
|
||||
act.sa_flags = SA_SIGINFO;
|
||||
sigaction(SIGSEGV, &act, NULL);
|
||||
|
||||
initConfig();
|
||||
char *(*_getenv)(const char *name) = dlsym(RTLD_NEXT, "getenv");
|
||||
char* envPath = _getenv("LINDBERGH_CONFIG_PATH");
|
||||
initConfig(envPath);
|
||||
|
||||
if (getConfig()->fpsLimiter == 1)
|
||||
{
|
||||
@@ -256,21 +255,16 @@ void __attribute__((constructor)) hook_init()
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
if (getConfig()->GPUVendor == ATI_GPU
|
||||
&& ((getConfig()->crc32 == LETS_GO_JUNGLE) || (getConfig()->crc32 == LETS_GO_JUNGLE_REVA) ||
|
||||
(getConfig()->crc32 == LETS_GO_JUNGLE_SPECIAL) || (getConfig()->crc32 == AFTER_BURNER_CLIMAX) ||
|
||||
(getConfig()->crc32 == AFTER_BURNER_CLIMAX_REVA) || (getConfig()->crc32 == AFTER_BURNER_CLIMAX_REVB) ||
|
||||
(getConfig()->crc32 == AFTER_BURNER_CLIMAX_SDX) || (getConfig()->crc32 == AFTER_BURNER_CLIMAX_SDX_REVA) ||
|
||||
(getConfig()->crc32 == AFTER_BURNER_CLIMAX_SE) || (getConfig()->crc32 == AFTER_BURNER_CLIMAX_SE_REVA) ||
|
||||
(getConfig()->crc32 == INITIALD_5_JAP_REVA) || (getConfig()->crc32 == INITIALD_5_JAP_REVF) ||
|
||||
(getConfig()->crc32 == INITIALD_5_EXP_30) || (getConfig()->crc32 == INITIALD_5_EXP_40))) {
|
||||
printf("WARNING: Game %s is unsupported in AMD GPU with ATI driver\n",getGameName());
|
||||
}
|
||||
if (getConfig()->lgjRenderWithMesa &&
|
||||
if (getConfig()->GPUVendor == ATI_GPU &&
|
||||
((getConfig()->crc32 == LETS_GO_JUNGLE) || (getConfig()->crc32 == LETS_GO_JUNGLE_REVA) ||
|
||||
(getConfig()->crc32 == LETS_GO_JUNGLE_SPECIAL)))
|
||||
(getConfig()->crc32 == LETS_GO_JUNGLE_SPECIAL) || (getConfig()->crc32 == AFTER_BURNER_CLIMAX) ||
|
||||
(getConfig()->crc32 == AFTER_BURNER_CLIMAX_REVA) || (getConfig()->crc32 == AFTER_BURNER_CLIMAX_REVB) ||
|
||||
(getConfig()->crc32 == AFTER_BURNER_CLIMAX_SDX) || (getConfig()->crc32 == AFTER_BURNER_CLIMAX_SDX_REVA) ||
|
||||
(getConfig()->crc32 == AFTER_BURNER_CLIMAX_SE) || (getConfig()->crc32 == AFTER_BURNER_CLIMAX_SE_REVA) ||
|
||||
(getConfig()->crc32 == INITIALD_5_JAP_REVA) || (getConfig()->crc32 == INITIALD_5_JAP_REVF) ||
|
||||
(getConfig()->crc32 == INITIALD_5_EXP_20) || (getConfig()->crc32 == INITIALD_5_EXP_20A)))
|
||||
{
|
||||
getConfig()->GPUVendor = AMD_GPU;
|
||||
printf("WARNING: Game %s is unsupported in AMD GPU with ATI driver\n", getGameName());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,8 +273,7 @@ DIR *opendir(const char *dirname)
|
||||
DIR *(*_opendir)(const char *dirname) = dlsym(RTLD_NEXT, "opendir");
|
||||
|
||||
int gId = getConfig()->crc32;
|
||||
if (gId == INITIALD_5_EXP_30 || gId == INITIALD_5_EXP_40 || gId == INITIALD_5_JAP_REVA ||
|
||||
gId == INITIALD_5_JAP_REVF)
|
||||
if (gId == INITIALD_5_EXP || gId == INITIALD_5_EXP_20 || gId == INITIALD_5_EXP_20A || gId == INITIALD_5_JAP_REVA || gId == INITIALD_5_JAP_REVF)
|
||||
{
|
||||
if (strcmp(dirname, "/tmp/") == 0)
|
||||
{
|
||||
@@ -468,10 +461,6 @@ FILE *fopen(const char *restrict pathname, const char *restrict mode)
|
||||
return fileHooks[CPUINFO];
|
||||
}
|
||||
|
||||
if (strcmp(pathname, "/usr/lib/boot/logo_red.tga") == 0)
|
||||
{
|
||||
return _fopen("logo_red.tga", mode);
|
||||
}
|
||||
if (strcmp(pathname, "/usr/lib/boot/SEGA_KakuGothic-DB-Roman_12.tga") == 0)
|
||||
{
|
||||
if (!getConfig()->disableBuiltinFont)
|
||||
@@ -566,8 +555,7 @@ FILE *fopen(const char *restrict pathname, const char *restrict mode)
|
||||
}
|
||||
|
||||
int gId = getConfig()->crc32;
|
||||
if (gId == INITIALD_5_EXP_30 || gId == INITIALD_5_EXP_40 || gId == INITIALD_5_JAP_REVA ||
|
||||
gId == INITIALD_5_JAP_REVF)
|
||||
if (gId == INITIALD_5_EXP || gId == INITIALD_5_EXP_20 || gId == INITIALD_5_EXP_20A || gId == INITIALD_5_JAP_REVA || gId == INITIALD_5_JAP_REVF)
|
||||
{
|
||||
if (strncmp(pathname, "/tmp/", 5) == 0)
|
||||
{
|
||||
@@ -1211,28 +1199,6 @@ int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen)
|
||||
return _connect(sockfd, addr, addrlen);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to calculate CRC32 checksum in memory.
|
||||
*/
|
||||
uint32_t get_crc32(const char *s, size_t n)
|
||||
{
|
||||
uint32_t crc = 0xFFFFFFFF;
|
||||
|
||||
for (size_t i = 0; i < n; i++)
|
||||
{
|
||||
char ch = s[i];
|
||||
for (size_t j = 0; j < 8; j++)
|
||||
{
|
||||
uint32_t b = (ch ^ crc) & 1;
|
||||
crc >>= 1;
|
||||
if (b)
|
||||
crc = crc ^ 0xEDB88320;
|
||||
ch >>= 1;
|
||||
}
|
||||
}
|
||||
return ~crc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback function to get the offset and size of the execution program in memory of the ELF we hook to.
|
||||
*/
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
uint32_t get_crc32(const char *s, size_t n);
|
||||
+12
-2
@@ -451,6 +451,7 @@ void sdlEventDriving(SDL_Event *event)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sdlEventShooting(SDL_Event *event)
|
||||
{
|
||||
KeyMapping keymap = getConfig()->keymap;
|
||||
@@ -585,13 +586,22 @@ void sdlEventShooting(SDL_Event *event)
|
||||
case SDL_MOUSEBUTTONUP:
|
||||
{
|
||||
if (event->button.button == SDL_BUTTON_LEFT) // Trigger
|
||||
{
|
||||
setSwitch(PLAYER_1, BUTTON_1, event->type == SDL_MOUSEBUTTONDOWN);
|
||||
|
||||
}
|
||||
else if (event->button.button == SDL_BUTTON_RIGHT) // Reload
|
||||
{
|
||||
if (getConfig()->crc32 == RAMBO || getConfig()->crc32 == TOO_SPICY)
|
||||
{
|
||||
setAnalogue(ANALOGUE_1, -1);
|
||||
setAnalogue(ANALOGUE_2, -1);
|
||||
}
|
||||
setSwitch(PLAYER_1, BUTTON_2, event->type == SDL_MOUSEBUTTONDOWN);
|
||||
|
||||
}
|
||||
else if (event->button.button == SDL_BUTTON_MIDDLE) // Extra Gun Button
|
||||
{
|
||||
setSwitch(PLAYER_1, BUTTON_3, event->type == SDL_MOUSEBUTTONDOWN);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
+187
-9
@@ -11,7 +11,9 @@
|
||||
#define LD_LIBRARY_PATH "LD_LIBRARY_PATH"
|
||||
#define LD_PRELOAD "LD_PRELOAD"
|
||||
#define PRELOAD_FILE_NAME "lindbergh.so"
|
||||
#define PRELOAD_FILE_FLATPAK "/app/lib32/lindbergh.so"
|
||||
#define TEAM "bobbydilley, retrofan, dkeruza-neo, doozer, francesco, rolel, caviar-x"
|
||||
#define LINDBERGH_CONFIG_PATH "LINDBERGH_CONFIG_PATH"
|
||||
|
||||
uint32_t elf_crc = 0;
|
||||
|
||||
@@ -39,6 +41,151 @@ char *games[] = {"main.exe",
|
||||
"a.elf",
|
||||
"END"};
|
||||
|
||||
/**
|
||||
* An array containin clean games elf's CRC32
|
||||
*/
|
||||
uint32_t cleanElfCRC32[] = {
|
||||
0x51C4D2F6, // DVP-0003A | hod4M.elf
|
||||
0x1348BCA8, // DVP-0003A | hod4testM.elf
|
||||
0x0AAE384E, // DVP-0003B | hod4M.elf
|
||||
0x352AA797, // DVP-0003B | hod4testM.elf
|
||||
0x42EED61A, // DVP-0003C | hod4M.elf
|
||||
0x6DA6E511, // DVP-0003C | hod4testM.elf
|
||||
0x0E4BF4B1, // DVP-0005 | vt3_Lindbergh
|
||||
0x9E48AB5B, // DVP-0005 | vt3_testmode
|
||||
0xE4C64D01, // DVP-0005A | vt3_Lindbergh
|
||||
0x9C0E77E5, // DVP-0005A | vt3_testmode
|
||||
0xA4BDB9E2, // DVP-0005B | vt3_Lindbergh
|
||||
0x74E25472, // DVP-0005B | vt3_testmode
|
||||
0x987AE3FF, // DVP-0005C | vt3_Lindbergh
|
||||
0x1E4271A4, // DVP-0005C | vt3_testmode
|
||||
0xD409B70C, // DVP-0008 | vf5
|
||||
0x08EBC0DB, // DVP-0008A | vf5
|
||||
0xA47FBA2D, // DVP-0008B | vf5
|
||||
0x8CA46167, // DVP-0008C | vf5
|
||||
0x75946796, // DVP-0008E | vf5
|
||||
0x2C8F5D57, // DVP-0009 | abc
|
||||
0x13D90755, // DVP-0009A | abc
|
||||
0x633AD6FB, // DVP-0009B | abc
|
||||
0xD39825A8, // DVP-0010 | hod4M.elf
|
||||
0x0745CF0A, // DVP-0010 | hod4testM.elf
|
||||
0x13E59583, // DVP-0010B | hod4M.elf
|
||||
0x302FEB00, // DVP-0010B | hod4testM.elf
|
||||
0x04E08C99, // DVP-0011 | lgj_final
|
||||
0x0C3D3CC3, // DVP-0011A | lgj_final
|
||||
0xD9660B2E, // DVP-0015 | JenTest
|
||||
0x821C3404, // DVP-0015 | Jennifer
|
||||
0x13AF8581, // DVP-0015A | JenTest
|
||||
0xB2CE9B23, // DVP-0015A | Jennifer
|
||||
0xCC32DEAE, // DVP-0018 | abc
|
||||
0x17114BC1, // DVP-0018A | abc
|
||||
0x22905D60, // DVP-0019A | id4.elf
|
||||
0x43582D48, // DVP-0019B | id4.elf
|
||||
0x2D2A18C1, // DVP-0019C | id4.elf
|
||||
0x9BFD0D98, // DVP-0019D | id4.elf
|
||||
0x9CF9BBCC, // DVP-0019G | id4.elf
|
||||
0xFA0F6AB0, // DVP-0027A | apacheM.elf
|
||||
0x9D414D18, // DVP-0029A | vsg
|
||||
0xC345E213, // DVP-0030B | id4.elf
|
||||
0x98E6A516, // DVP-0030C | id4.elf
|
||||
0xF67365C9, // DVP-0030D | id4.elf
|
||||
0x8BDD31BA, // DVP-0031 | abc
|
||||
0x3DF37873, // DVP-0031A | abc
|
||||
0xDD8BB792, // DVP-0036A | lgjsp_app
|
||||
0xB0A96E34, // DVP-0043 | vf5
|
||||
0xF99E5635, // DVP-0044 | drive.elf
|
||||
0x4143F6B4, // DVP-0048A | main.exe
|
||||
0x653BC83B, // DVP-0057 | a.elf
|
||||
0x04D88552, // DVP-0057B | a.elf
|
||||
0x089D6051, // DVP-0060 | dsr
|
||||
0x317F3B90, // DVP-0063 | hodexRI.elf
|
||||
0x3A5EEC69, // DVP-0063 | hodextestR.elf
|
||||
0x81E02850, // DVP-0069 | ramboM.elf
|
||||
0xE4F202BB, // DVP-0070A | id5.elf
|
||||
0x2E6732A3, // DVP-0070F | id5.elf
|
||||
0xF99A3CDB, // DVP-0075 | id5.elf
|
||||
0x05647A8E, // DVP-0079 | hummer_Master.elf
|
||||
0x4442EA15, // DVP-0083 | hummer_Master.elf
|
||||
0x8DF6BBF9, // DVP-0084 | id5.elf
|
||||
0x2AF8004E, // DVP-0084A | id5.elf
|
||||
0xB95528F4, // DVP-5004 | vf5
|
||||
0x012E4898, // DVP-5004D | vf5
|
||||
0x74465F9F, // DVP-5004G | vf5
|
||||
0x75B48E22, // DVP-5007 | chopperM.elf
|
||||
0xFCB9D941, // DVP-5019A | vf5
|
||||
0xAB70901C, // DVP-5020 | vf5
|
||||
0x6BAA510D, // DVP-5020 | vf5 | Ver 6.000
|
||||
};
|
||||
|
||||
int cleanElfCRC32Count = sizeof(cleanElfCRC32) / sizeof(uint32_t);
|
||||
|
||||
uint32_t calcCrc32(uint32_t crc, uint8_t data)
|
||||
{
|
||||
crc ^= data; // No shift needed; working in LSB-first order
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
if (crc & 1)
|
||||
{
|
||||
crc = (crc >> 1) ^ 0xEDB88320;
|
||||
}
|
||||
else
|
||||
{
|
||||
crc = (crc >> 1);
|
||||
}
|
||||
}
|
||||
return crc;
|
||||
}
|
||||
|
||||
int lookupCrcTable(uint32_t crc)
|
||||
{
|
||||
for (int x = 0; x < cleanElfCRC32Count; x++)
|
||||
{
|
||||
if (cleanElfCRC32[x] == crc)
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void isCleanElf(char *command)
|
||||
{
|
||||
const char *space_pos = strchr(command, ' ');
|
||||
size_t length = space_pos ? (size_t)(space_pos - command) : strlen(command);
|
||||
|
||||
char elfName[256];
|
||||
strncpy(elfName, command, length);
|
||||
elfName[length] = '\0';
|
||||
|
||||
FILE *file = fopen(elfName, "rb");
|
||||
if (!file)
|
||||
{
|
||||
log_error("Could not calculate the Elf CRC32.");
|
||||
return;
|
||||
}
|
||||
|
||||
uint32_t crc = 0xFFFFFFFF;
|
||||
uint8_t buffer[4096];
|
||||
size_t bytesRead;
|
||||
|
||||
while ((bytesRead = fread(buffer, 1, sizeof(buffer), file)) > 0)
|
||||
{
|
||||
for (size_t i = 0; i < bytesRead; i++)
|
||||
{
|
||||
crc = calcCrc32(crc, buffer[i]);
|
||||
}
|
||||
}
|
||||
|
||||
fclose(file);
|
||||
crc = crc ^ 0xFFFFFFFF;
|
||||
|
||||
if (!lookupCrcTable(crc))
|
||||
{
|
||||
printf("\033[1;31m");
|
||||
printf("Warning: The ELF you are running is not Clean and might cause unwanted behavior.\n");
|
||||
printf(" Make sure you ELF and game dump are clean before reporting issues.\n");
|
||||
printf("\033[0m");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests if the game uses a seperate elf for test mode
|
||||
* and updates the command line to this elf.
|
||||
@@ -86,7 +233,7 @@ void testModePath(char *name)
|
||||
* Makes sure the environment variables are set correctly
|
||||
* to run the game.
|
||||
*/
|
||||
void setEnvironmentVariables()
|
||||
void setEnvironmentVariables(int isFlatpak)
|
||||
{
|
||||
// Ensure the library path is set correctly
|
||||
char libraryPath[128] = {0};
|
||||
@@ -103,7 +250,10 @@ void setEnvironmentVariables()
|
||||
setenv(LD_LIBRARY_PATH, libraryPath, 1);
|
||||
|
||||
// Ensure the preload path is set correctly
|
||||
setenv(LD_PRELOAD, PRELOAD_FILE_NAME, 1);
|
||||
if (!isFlatpak)
|
||||
setenv(LD_PRELOAD, PRELOAD_FILE_NAME, 1);
|
||||
else
|
||||
setenv(LD_PRELOAD, PRELOAD_FILE_FLATPAK, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -119,6 +269,7 @@ void printUsage(char *argv[])
|
||||
printf(" --list-controllers Lists available controllers and inputs\n");
|
||||
printf(" --version Displays the version of the loader and team's names\n");
|
||||
printf(" --help Displays this usage text\n");
|
||||
printf(" --config | -c Specifies configuration path\n");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -169,9 +320,6 @@ void printVersion() {
|
||||
*/
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
// Ensure environment variables are set correctly
|
||||
setEnvironmentVariables();
|
||||
|
||||
// Check for --version before directory operations
|
||||
if (argc > 1 && strcmp(argv[1], "--version") == 0) {
|
||||
printVersion();
|
||||
@@ -191,6 +339,7 @@ int main(int argc, char *argv[])
|
||||
char *game = NULL;
|
||||
|
||||
int lindberghSharedObjectFound = 0;
|
||||
int isFlatpak = 0;
|
||||
|
||||
while ((ent = readdir(dir)) != NULL)
|
||||
{
|
||||
@@ -238,18 +387,31 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (!lindberghSharedObjectFound)
|
||||
{
|
||||
log_error("The preload object lindbergh.so was not found in this directory.");
|
||||
return EXIT_FAILURE;
|
||||
FILE *file = fopen(PRELOAD_FILE_FLATPAK, "r");
|
||||
if (file)
|
||||
{
|
||||
fclose(file);
|
||||
isFlatpak = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
log_error("The preload object lindbergh.so was not found in this directory.");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure environment variables are set correctly
|
||||
setEnvironmentVariables(isFlatpak);
|
||||
|
||||
// Build up the command to start the game
|
||||
|
||||
int testMode = 0;
|
||||
int gdb = 0;
|
||||
int forceGame = 0;
|
||||
int segaboot = 0;
|
||||
|
||||
char extConfigPath[PATH_MAX] = {0};
|
||||
char forceGamePath[128] = {0};
|
||||
|
||||
for (int i = 1; i < argc; i++)
|
||||
{
|
||||
if (strcmp(argv[i], "-t") == 0 || strcmp(argv[i], "--test") == 0)
|
||||
@@ -269,7 +431,16 @@ int main(int argc, char *argv[])
|
||||
gdb = 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (strcmp(argv[i], "-c") == 0 || strcmp(argv[i], "--config") == 0)
|
||||
{
|
||||
if (i+1 >= argc)
|
||||
{
|
||||
break;
|
||||
}
|
||||
strncpy(extConfigPath, argv[i+1], PATH_MAX);
|
||||
i += 1;
|
||||
continue;
|
||||
}
|
||||
// Treat the argument as the game name
|
||||
strcpy(forceGamePath, argv[i]);
|
||||
forceGame = 1;
|
||||
@@ -298,6 +469,8 @@ int main(int argc, char *argv[])
|
||||
if (testMode)
|
||||
testModePath(command);
|
||||
|
||||
isCleanElf(command);
|
||||
|
||||
if (gdb)
|
||||
{
|
||||
char temp[128];
|
||||
@@ -306,6 +479,11 @@ int main(int argc, char *argv[])
|
||||
strcpy(command, temp);
|
||||
}
|
||||
|
||||
if (extConfigPath[0] != '\0')
|
||||
{
|
||||
setenv(LINDBERGH_CONFIG_PATH,extConfigPath,1);
|
||||
}
|
||||
|
||||
log_info("Starting $ %s", command);
|
||||
|
||||
return system(command);
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
|
||||
// Structure to hold the formatted message and its size
|
||||
|
||||
+1593
-1519
File diff suppressed because it is too large
Load Diff
+876
-817
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,8 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include "securityboard.h"
|
||||
#include "config.h"
|
||||
#include "log.h"
|
||||
#include "config.h"
|
||||
|
||||
#define SECURITY_BOARD_FRONT_PANEL 0x38
|
||||
#define SECURITY_BOARD_FRONT_PANEL_NON_ROOT 0x1038
|
||||
@@ -52,8 +52,10 @@ int securityBoardSetDipResolution(int width, int height)
|
||||
setResolutionDips(1, 1, 0);
|
||||
else if (width == 1360 && height == 768)
|
||||
setResolutionDips(1, 1, 1);
|
||||
else
|
||||
log_warn("Resolution not compatible, using 640 x 480\n");
|
||||
else {
|
||||
if(getConfig()->showDebugMessages)
|
||||
log_warn("Resolution not original, setting dips to 640 x 480.\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
+163
-161
@@ -435,6 +435,7 @@ bool shaderFileInList(const char *pathname, int *idx)
|
||||
{
|
||||
uint32_t gId = getConfig()->crc32;
|
||||
char cwd[256];
|
||||
int gpuVendor = getConfig()->GPUVendor;
|
||||
if (gId == GHOST_SQUAD_EVOLUTION)
|
||||
{
|
||||
if (getConfig()->GPUVendor != NVIDIA_GPU)
|
||||
@@ -493,8 +494,7 @@ bool shaderFileInList(const char *pathname, int *idx)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if ((gId == THE_HOUSE_OF_THE_DEAD_4_REVA) || (gId == THE_HOUSE_OF_THE_DEAD_4_REVB) ||
|
||||
(gId == THE_HOUSE_OF_THE_DEAD_4_REVC))
|
||||
else if (gId == THE_HOUSE_OF_THE_DEAD_4_REVA || gId == THE_HOUSE_OF_THE_DEAD_4_REVB || gId == THE_HOUSE_OF_THE_DEAD_4_REVC)
|
||||
{
|
||||
for (int x = 0; x < hod4ShaderPatchesCount; x++)
|
||||
{
|
||||
@@ -507,7 +507,7 @@ bool shaderFileInList(const char *pathname, int *idx)
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else if ((gId == THE_HOUSE_OF_THE_DEAD_4_SPECIAL) || (gId == THE_HOUSE_OF_THE_DEAD_4_SPECIAL_REVB))
|
||||
else if (gId == THE_HOUSE_OF_THE_DEAD_4_SPECIAL || gId == THE_HOUSE_OF_THE_DEAD_4_SPECIAL_REVB)
|
||||
{
|
||||
for (int x = 0; x < hod4spShaderPatchesCount; x++)
|
||||
{
|
||||
@@ -546,7 +546,7 @@ bool shaderFileInList(const char *pathname, int *idx)
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else if ((gId == HUMMER) || (gId == HUMMER_SDLX) || (gId == HUMMER_EXTREME) || (gId == HUMMER_EXTREME_MDX))
|
||||
else if (gId == HUMMER || gId == HUMMER_SDLX || gId == HUMMER_EXTREME || gId == HUMMER_EXTREME_MDX)
|
||||
{
|
||||
|
||||
for (int x = 0; x < hummerFilesToModCount; x++)
|
||||
@@ -560,104 +560,101 @@ bool shaderFileInList(const char *pathname, int *idx)
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else if (getConfig()->GPUVendor != NVIDIA_GPU)
|
||||
else if (gId == TOO_SPICY && gpuVendor != NVIDIA_GPU)
|
||||
{
|
||||
if (gId == TOO_SPICY)
|
||||
for (int x = 0; x < tooSpicyShaderPatchesCount; x++)
|
||||
{
|
||||
for (int x = 0; x < tooSpicyShaderPatchesCount; x++)
|
||||
{
|
||||
if ((strcmp(tooSpicyShaderPatches[x].fileName, basename((char *)pathname)) == 0) &&
|
||||
(tooSpicyShaderPatches[x].shaderBufferSize != 0))
|
||||
{
|
||||
*idx = x;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else if (gId == THE_HOUSE_OF_THE_DEAD_EX)
|
||||
{
|
||||
for (int x = 0; x < hodexShaderPatchesCount; x++)
|
||||
{
|
||||
if ((strcmp(hodexShaderPatches[x].fileName, basename((char *)pathname)) == 0) &&
|
||||
(hodexShaderPatches[x].shaderBufferSize != 0))
|
||||
{
|
||||
*idx = x;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
const char *fName = strrchr(pathname, '/');
|
||||
char searchFileName[40];
|
||||
char *searchFolder1;
|
||||
char *searchFolder2;
|
||||
char *format;
|
||||
ShaderFilesToMod *filesToMod;
|
||||
int filesToModCount;
|
||||
|
||||
if ((gId == LETS_GO_JUNGLE) || (gId == LETS_GO_JUNGLE_REVA) || (gId == LETS_GO_JUNGLE_SPECIAL))
|
||||
{
|
||||
filesToMod = lgjShaderFilesToMod;
|
||||
filesToModCount = lgjFilesToModCount;
|
||||
searchFolder1 = "/shader/Cg";
|
||||
searchFolder2 = "/extraShader/Cg";
|
||||
format = "%s/inc%s";
|
||||
}
|
||||
|
||||
else if ((gId == INITIALD_4_EXP_REVB) || (gId == INITIALD_4_EXP_REVC) || (gId == INITIALD_4_EXP_REVD) ||
|
||||
(gId == INITIALD_4_REVA) || (gId == INITIALD_4_REVB) || (gId == INITIALD_4_REVC) ||
|
||||
(gId == INITIALD_4_REVD) || (gId == INITIALD_4_REVG) || (gId == INITIALD_5_JAP_REVA) ||
|
||||
(gId == INITIALD_5_JAP_REVF) || (gId == INITIALD_5_EXP_30) || (gId == INITIALD_5_EXP_40))
|
||||
{
|
||||
filesToMod = idShaderFilesToMod;
|
||||
filesToModCount = idFilesToModCount;
|
||||
if ((gId == INITIALD_4_REVA) || (gId == INITIALD_4_REVB) || (gId == INITIALD_4_REVC) ||
|
||||
(gId == INITIALD_4_REVD) || (gId == INITIALD_4_REVG))
|
||||
{
|
||||
filesToMod = id4jShaderFilesToMod;
|
||||
filesToModCount = id4FilesToModCount;
|
||||
}
|
||||
searchFolder1 = "/shader/Cg/inc";
|
||||
searchFolder2 = "/data/Shader";
|
||||
if ((gId == INITIALD_5_JAP_REVA) || (gId == INITIALD_5_JAP_REVF) || (gId == INITIALD_5_EXP_30) ||
|
||||
(gId == INITIALD_5_EXP_40))
|
||||
{
|
||||
searchFolder2 = "/data/V5SHADER";
|
||||
}
|
||||
format = "%s%s";
|
||||
}
|
||||
else if ((gId == VIRTUA_TENNIS_3) || (gId == VIRTUA_TENNIS_3_TEST) || (gId == VIRTUA_TENNIS_3_REVA) ||
|
||||
(gId == VIRTUA_TENNIS_3_REVA_TEST) || (gId == VIRTUA_TENNIS_3_REVB) ||
|
||||
(gId == VIRTUA_TENNIS_3_REVB_TEST) || (gId == VIRTUA_TENNIS_3_REVC) ||
|
||||
(gId == VIRTUA_TENNIS_3_REVC_TEST))
|
||||
{
|
||||
filesToMod = vt3ShaderFilesToMod;
|
||||
filesToModCount = vt3FilesToModCount;
|
||||
searchFolder1 = "/shader/Cg/inc";
|
||||
searchFolder2 = "/shader";
|
||||
format = "%s%s";
|
||||
}
|
||||
if (strstr(pathname, searchFolder1) != NULL)
|
||||
{
|
||||
sprintf((void *)searchFileName, format, searchFolder1, fName);
|
||||
}
|
||||
else if (strstr(pathname, searchFolder2) != NULL)
|
||||
{
|
||||
sprintf((void *)searchFileName, format, searchFolder2, fName);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
for (int x = 0; x < filesToModCount; x++)
|
||||
{
|
||||
if (strcmp(filesToMod[x].fileName, searchFileName) == 0)
|
||||
if ((strcmp(tooSpicyShaderPatches[x].fileName, basename((char *)pathname)) == 0) &&
|
||||
(tooSpicyShaderPatches[x].shaderBufferSize != 0))
|
||||
{
|
||||
*idx = x;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else if (gId == THE_HOUSE_OF_THE_DEAD_EX && gpuVendor != NVIDIA_GPU)
|
||||
{
|
||||
for (int x = 0; x < hodexShaderPatchesCount; x++)
|
||||
{
|
||||
if ((strcmp(hodexShaderPatches[x].fileName, basename((char *)pathname)) == 0) && (hodexShaderPatches[x].shaderBufferSize != 0))
|
||||
{
|
||||
*idx = x;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
const char *fName = strrchr(pathname, '/');
|
||||
char searchFileName[40];
|
||||
char *searchFolder1;
|
||||
char *searchFolder2;
|
||||
char *format;
|
||||
ShaderFilesToMod *filesToMod;
|
||||
int filesToModCount;
|
||||
|
||||
if ((gId == LETS_GO_JUNGLE || gId == LETS_GO_JUNGLE_REVA || gId == LETS_GO_JUNGLE_SPECIAL) &&
|
||||
(gpuVendor != NVIDIA_GPU || getConfig()->lgjRenderWithMesa == 1))
|
||||
{
|
||||
filesToMod = lgjShaderFilesToMod;
|
||||
filesToModCount = lgjFilesToModCount;
|
||||
searchFolder1 = "/shader/Cg";
|
||||
searchFolder2 = "/extraShader/Cg";
|
||||
format = "%s/inc%s";
|
||||
}
|
||||
|
||||
else if ((gId == INITIALD_4_EXP_REVB || gId == INITIALD_4_EXP_REVC || gId == INITIALD_4_EXP_REVD || gId == INITIALD_4_REVA ||
|
||||
gId == INITIALD_4_REVB || gId == INITIALD_4_REVC || gId == INITIALD_4_REVD || gId == INITIALD_4_REVG ||
|
||||
gId == INITIALD_5_JAP_REVA || gId == INITIALD_5_JAP_REVF || gId == INITIALD_5_EXP || gId == INITIALD_5_EXP_20 ||
|
||||
gId == INITIALD_5_EXP_20A) &&
|
||||
gpuVendor != NVIDIA_GPU)
|
||||
{
|
||||
filesToMod = idShaderFilesToMod;
|
||||
filesToModCount = idFilesToModCount;
|
||||
if (gId == INITIALD_4_REVA || gId == INITIALD_4_REVB || gId == INITIALD_4_REVC || gId == INITIALD_4_REVD || gId == INITIALD_4_REVG)
|
||||
{
|
||||
filesToMod = id4jShaderFilesToMod;
|
||||
filesToModCount = id4FilesToModCount;
|
||||
}
|
||||
searchFolder1 = "/shader/Cg/inc";
|
||||
searchFolder2 = "/data/Shader";
|
||||
if (gId == INITIALD_5_JAP_REVA || gId == INITIALD_5_JAP_REVF || gId == INITIALD_5_EXP || gId == INITIALD_5_EXP_20 ||
|
||||
gId == INITIALD_5_EXP_20A)
|
||||
{
|
||||
searchFolder2 = "/data/V5SHADER";
|
||||
}
|
||||
format = "%s%s";
|
||||
}
|
||||
else if ((gId == VIRTUA_TENNIS_3 || gId == VIRTUA_TENNIS_3_TEST || gId == VIRTUA_TENNIS_3_REVA || gId == VIRTUA_TENNIS_3_REVA_TEST ||
|
||||
gId == VIRTUA_TENNIS_3_REVB || gId == VIRTUA_TENNIS_3_REVB_TEST || gId == VIRTUA_TENNIS_3_REVC ||
|
||||
gId == VIRTUA_TENNIS_3_REVC_TEST) &&
|
||||
gpuVendor != NVIDIA_GPU)
|
||||
{
|
||||
filesToMod = vt3ShaderFilesToMod;
|
||||
filesToModCount = vt3FilesToModCount;
|
||||
searchFolder1 = "/shader/Cg/inc";
|
||||
searchFolder2 = "/shader";
|
||||
format = "%s%s";
|
||||
}
|
||||
if (strstr(pathname, searchFolder1) != NULL)
|
||||
{
|
||||
sprintf((void *)searchFileName, format, searchFolder1, fName);
|
||||
}
|
||||
else if (strstr(pathname, searchFolder2) != NULL)
|
||||
{
|
||||
sprintf((void *)searchFileName, format, searchFolder2, fName);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
for (int x = 0; x < filesToModCount; x++)
|
||||
{
|
||||
if (strcmp(filesToMod[x].fileName, searchFileName) == 0)
|
||||
{
|
||||
*idx = x;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -677,24 +674,22 @@ long int ftellGetShaderSize(int idx)
|
||||
}
|
||||
return gsevoNvidiaShaderPatches[idx].shaderBufferSize;
|
||||
}
|
||||
else if ((gId == LETS_GO_JUNGLE) || (gId == LETS_GO_JUNGLE_REVA) || (gId == LETS_GO_JUNGLE_SPECIAL))
|
||||
else if (gId == LETS_GO_JUNGLE || gId == LETS_GO_JUNGLE_REVA || gId == LETS_GO_JUNGLE_SPECIAL)
|
||||
{
|
||||
return lgjShaderFilesToMod[idx].shaderBufferSize;
|
||||
}
|
||||
else if ((gId == INITIALD_4_EXP_REVB) || (gId == INITIALD_4_EXP_REVC) || (gId == INITIALD_4_EXP_REVD) ||
|
||||
(gId == INITIALD_5_JAP_REVA) || (gId == INITIALD_5_JAP_REVF) || (gId == INITIALD_5_EXP_30) ||
|
||||
(gId == INITIALD_5_EXP_40))
|
||||
else if (gId == INITIALD_4_EXP_REVB || gId == INITIALD_4_EXP_REVC || gId == INITIALD_4_EXP_REVD || gId == INITIALD_5_JAP_REVA ||
|
||||
gId == INITIALD_5_JAP_REVF || gId == INITIALD_5_EXP || gId == INITIALD_5_EXP_20 || gId == INITIALD_5_EXP_20A)
|
||||
{
|
||||
return idShaderFilesToMod[idx].shaderBufferSize;
|
||||
}
|
||||
else if ((gId == INITIALD_4_REVA) || (gId == INITIALD_4_REVB) || (gId == INITIALD_4_REVC) ||
|
||||
(gId == INITIALD_4_REVD) || (gId == INITIALD_4_REVG))
|
||||
else if (gId == INITIALD_4_REVA || gId == INITIALD_4_REVB || gId == INITIALD_4_REVC || gId == INITIALD_4_REVD || gId == INITIALD_4_REVG)
|
||||
{
|
||||
return id4jShaderFilesToMod[idx].shaderBufferSize;
|
||||
}
|
||||
else if ((gId == VIRTUA_TENNIS_3) || (gId == VIRTUA_TENNIS_3_TEST) || (gId == VIRTUA_TENNIS_3_REVA) ||
|
||||
(gId == VIRTUA_TENNIS_3_REVA_TEST) || (gId == VIRTUA_TENNIS_3_REVB) ||
|
||||
(gId == VIRTUA_TENNIS_3_REVB_TEST) || (gId == VIRTUA_TENNIS_3_REVC) || (gId == VIRTUA_TENNIS_3_REVC_TEST))
|
||||
else if (gId == VIRTUA_TENNIS_3 || gId == VIRTUA_TENNIS_3_TEST || gId == VIRTUA_TENNIS_3_REVA || gId == VIRTUA_TENNIS_3_REVA_TEST ||
|
||||
gId == VIRTUA_TENNIS_3_REVB || gId == VIRTUA_TENNIS_3_REVB_TEST || gId == VIRTUA_TENNIS_3_REVC ||
|
||||
gId == VIRTUA_TENNIS_3_REVC_TEST)
|
||||
{
|
||||
return vt3ShaderFilesToMod[idx].shaderBufferSize;
|
||||
}
|
||||
@@ -713,12 +708,11 @@ long int ftellGetShaderSize(int idx)
|
||||
return ramboNvidiaShaderPatches[idx].shaderBufferSize;
|
||||
}
|
||||
}
|
||||
else if ((gId == THE_HOUSE_OF_THE_DEAD_4_REVA) || (gId == THE_HOUSE_OF_THE_DEAD_4_REVB) ||
|
||||
(gId == THE_HOUSE_OF_THE_DEAD_4_REVC))
|
||||
else if (gId == THE_HOUSE_OF_THE_DEAD_4_REVA || gId == THE_HOUSE_OF_THE_DEAD_4_REVB || gId == THE_HOUSE_OF_THE_DEAD_4_REVC)
|
||||
{
|
||||
return hod4ShaderPatches[idx].shaderBufferSize;
|
||||
}
|
||||
else if ((gId == THE_HOUSE_OF_THE_DEAD_4_SPECIAL) || (gId == THE_HOUSE_OF_THE_DEAD_4_SPECIAL_REVB))
|
||||
else if (gId == THE_HOUSE_OF_THE_DEAD_4_SPECIAL || gId == THE_HOUSE_OF_THE_DEAD_4_SPECIAL_REVB)
|
||||
{
|
||||
return hod4spShaderPatches[idx].shaderBufferSize;
|
||||
}
|
||||
@@ -726,7 +720,7 @@ long int ftellGetShaderSize(int idx)
|
||||
{
|
||||
return hodexShaderPatches[idx].shaderBufferSize;
|
||||
}
|
||||
else if ((gId == HUMMER) || (gId == HUMMER_SDLX) || (gId == HUMMER_EXTREME) || (gId == HUMMER_EXTREME_MDX))
|
||||
else if (gId == HUMMER || gId == HUMMER_SDLX || gId == HUMMER_EXTREME || gId == HUMMER_EXTREME_MDX)
|
||||
{
|
||||
return hummerShaderFilesToMod[idx].shaderBufferSize;
|
||||
}
|
||||
@@ -760,27 +754,25 @@ size_t freadReplace(void *buf, size_t size, size_t count, int idx)
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
else if ((gId == LETS_GO_JUNGLE) || (gId == LETS_GO_JUNGLE_REVA) || (gId == LETS_GO_JUNGLE_SPECIAL))
|
||||
else if (gId == LETS_GO_JUNGLE || gId == LETS_GO_JUNGLE_REVA || gId == LETS_GO_JUNGLE_SPECIAL)
|
||||
{
|
||||
memcpy(buf, lgjShaderFilesToMod[idx].shaderBuffer, size);
|
||||
return size;
|
||||
}
|
||||
else if ((gId == INITIALD_4_EXP_REVB) || (gId == INITIALD_4_EXP_REVC) || (gId == INITIALD_4_EXP_REVD) ||
|
||||
(gId == INITIALD_5_JAP_REVA) || (gId == INITIALD_5_JAP_REVF) || (gId == INITIALD_5_EXP_30) ||
|
||||
(gId == INITIALD_5_EXP_40))
|
||||
else if (gId == INITIALD_4_EXP_REVB || gId == INITIALD_4_EXP_REVC || gId == INITIALD_4_EXP_REVD || gId == INITIALD_5_JAP_REVA ||
|
||||
gId == INITIALD_5_JAP_REVF || gId == INITIALD_5_EXP || gId == INITIALD_5_EXP_20 || gId == INITIALD_5_EXP_20A)
|
||||
{
|
||||
memcpy(buf, idShaderFilesToMod[idx].shaderBuffer, size);
|
||||
return size;
|
||||
}
|
||||
else if ((gId == INITIALD_4_REVA) || (gId == INITIALD_4_REVB) || (gId == INITIALD_4_REVC) ||
|
||||
(gId == INITIALD_4_REVD) || (gId == INITIALD_4_REVG))
|
||||
else if (gId == INITIALD_4_REVA || gId == INITIALD_4_REVB || gId == INITIALD_4_REVC || gId == INITIALD_4_REVD || gId == INITIALD_4_REVG)
|
||||
{
|
||||
memcpy(buf, id4jShaderFilesToMod[idx].shaderBuffer, size);
|
||||
return size;
|
||||
}
|
||||
else if ((gId == VIRTUA_TENNIS_3) || (gId == VIRTUA_TENNIS_3_TEST) || (gId == VIRTUA_TENNIS_3_REVA) ||
|
||||
(gId == VIRTUA_TENNIS_3_REVA_TEST) || (gId == VIRTUA_TENNIS_3_REVB) ||
|
||||
(gId == VIRTUA_TENNIS_3_REVB_TEST) || (gId == VIRTUA_TENNIS_3_REVC) || (gId == VIRTUA_TENNIS_3_REVC_TEST))
|
||||
else if (gId == VIRTUA_TENNIS_3 || gId == VIRTUA_TENNIS_3_TEST || gId == VIRTUA_TENNIS_3_REVA || gId == VIRTUA_TENNIS_3_REVA_TEST ||
|
||||
gId == VIRTUA_TENNIS_3_REVB || gId == VIRTUA_TENNIS_3_REVB_TEST || gId == VIRTUA_TENNIS_3_REVC ||
|
||||
gId == VIRTUA_TENNIS_3_REVC_TEST)
|
||||
{
|
||||
memcpy(buf, vt3ShaderFilesToMod[idx].shaderBuffer, size);
|
||||
return size;
|
||||
@@ -803,13 +795,12 @@ size_t freadReplace(void *buf, size_t size, size_t count, int idx)
|
||||
return ramboNvidiaShaderPatches[idx].shaderBufferSize;
|
||||
}
|
||||
}
|
||||
else if ((gId == THE_HOUSE_OF_THE_DEAD_4_REVA) || (gId == THE_HOUSE_OF_THE_DEAD_4_REVB) ||
|
||||
(gId == THE_HOUSE_OF_THE_DEAD_4_REVC))
|
||||
else if (gId == THE_HOUSE_OF_THE_DEAD_4_REVA || gId == THE_HOUSE_OF_THE_DEAD_4_REVB || gId == THE_HOUSE_OF_THE_DEAD_4_REVC)
|
||||
{
|
||||
memcpy(buf, hod4ShaderPatches[idx].shaderBuffer, hod4ShaderPatches[idx].shaderBufferSize);
|
||||
return hod4ShaderPatches[idx].shaderBufferSize;
|
||||
}
|
||||
else if ((gId == THE_HOUSE_OF_THE_DEAD_4_SPECIAL) || (gId == THE_HOUSE_OF_THE_DEAD_4_SPECIAL_REVB))
|
||||
else if (gId == THE_HOUSE_OF_THE_DEAD_4_SPECIAL || gId == THE_HOUSE_OF_THE_DEAD_4_SPECIAL_REVB)
|
||||
{
|
||||
memcpy(buf, hod4spShaderPatches[idx].shaderBuffer, hod4spShaderPatches[idx].shaderBufferSize);
|
||||
return hod4spShaderPatches[idx].shaderBufferSize;
|
||||
@@ -819,7 +810,7 @@ size_t freadReplace(void *buf, size_t size, size_t count, int idx)
|
||||
memcpy(buf, hodexShaderPatches[idx].shaderBuffer, hodexShaderPatches[idx].shaderBufferSize);
|
||||
return hodexShaderPatches[idx].shaderBufferSize;
|
||||
}
|
||||
else if ((gId == HUMMER) || (gId == HUMMER_SDLX) || (gId == HUMMER_EXTREME) || (gId == HUMMER_EXTREME_MDX))
|
||||
else if (gId == HUMMER || gId == HUMMER_SDLX || gId == HUMMER_EXTREME || gId == HUMMER_EXTREME_MDX)
|
||||
{
|
||||
memcpy(buf, hummerShaderFilesToMod[idx].shaderBuffer, hummerShaderFilesToMod[idx].shaderBufferSize);
|
||||
return hummerShaderFilesToMod[idx].shaderBufferSize;
|
||||
@@ -849,10 +840,10 @@ char *cgGetProgramString(char *program, int e)
|
||||
|
||||
uint32_t gId = getConfig()->crc32;
|
||||
|
||||
if ((gId != INITIALD_4_EXP_REVB) && (gId != INITIALD_4_EXP_REVC) && (gId != INITIALD_4_EXP_REVD) &&
|
||||
(gId != INITIALD_4_REVA) && (gId != INITIALD_4_REVB) && (gId != INITIALD_4_REVC) && (gId != INITIALD_4_REVD) &&
|
||||
(gId != INITIALD_4_REVG) && (gId != INITIALD_5_JAP_REVA) && (gId != INITIALD_5_JAP_REVF) &&
|
||||
(gId != INITIALD_5_EXP_30) && (gId != INITIALD_5_EXP_40))
|
||||
if (gId != INITIALD_4_EXP_REVB && gId != INITIALD_4_EXP_REVC && gId != INITIALD_4_EXP_REVD && gId != INITIALD_4_REVA &&
|
||||
gId != INITIALD_4_REVB && gId != INITIALD_4_REVC && gId != INITIALD_4_REVD && gId != INITIALD_4_REVG &&
|
||||
gId != INITIALD_5_JAP_REVA && gId != INITIALD_5_JAP_REVF && gId != INITIALD_5_EXP && gId != INITIALD_5_EXP_20 &&
|
||||
gId != INITIALD_5_EXP_20A)
|
||||
{
|
||||
return _cgGetProgramString(program, e);
|
||||
}
|
||||
@@ -1098,23 +1089,23 @@ char *cgCreateProgram(uint32_t context, int program_type, const char *program, i
|
||||
const char **args) = dlsym(RTLD_NEXT, "cgCreateProgram");
|
||||
|
||||
uint32_t gId = getConfig()->crc32;
|
||||
if (((gId != VIRTUA_TENNIS_3) && (gId != VIRTUA_TENNIS_3_TEST) && (gId != VIRTUA_TENNIS_3_REVA) &&
|
||||
(gId != VIRTUA_TENNIS_3_REVA_TEST) && (gId != VIRTUA_TENNIS_3_REVB) && (gId != VIRTUA_TENNIS_3_REVB_TEST) &&
|
||||
(gId != VIRTUA_TENNIS_3_REVC) && (gId != VIRTUA_TENNIS_3_REVC_TEST) && (gId != INITIALD_4_EXP_REVB) &&
|
||||
(gId != INITIALD_4_EXP_REVC) && (gId != INITIALD_4_EXP_REVD) && (gId != LETS_GO_JUNGLE) &&
|
||||
(gId != LETS_GO_JUNGLE_REVA) && (gId != LETS_GO_JUNGLE_SPECIAL) && (gId != INITIALD_4_REVA) &&
|
||||
(gId != INITIALD_4_REVB) && (gId != INITIALD_4_REVC) && (gId != INITIALD_4_REVD) && (gId != INITIALD_4_REVG) &&
|
||||
(gId != INITIALD_5_JAP_REVA) && (gId != INITIALD_5_JAP_REVF) && (gId != INITIALD_5_EXP_30) &&
|
||||
(gId != INITIALD_5_EXP_40)) ||
|
||||
if ((gId != VIRTUA_TENNIS_3 && gId != VIRTUA_TENNIS_3_TEST && gId != VIRTUA_TENNIS_3_REVA && gId != VIRTUA_TENNIS_3_REVA_TEST &&
|
||||
gId != VIRTUA_TENNIS_3_REVB && gId != VIRTUA_TENNIS_3_REVB_TEST && gId != VIRTUA_TENNIS_3_REVC &&
|
||||
gId != VIRTUA_TENNIS_3_REVC_TEST && gId != INITIALD_4_EXP_REVB && gId != INITIALD_4_EXP_REVC && gId != INITIALD_4_EXP_REVD &&
|
||||
gId != LETS_GO_JUNGLE && gId != LETS_GO_JUNGLE_REVA && gId != LETS_GO_JUNGLE_SPECIAL && gId != INITIALD_4_REVA &&
|
||||
gId != INITIALD_4_REVB && gId != INITIALD_4_REVC && gId != INITIALD_4_REVD && gId != INITIALD_4_REVG &&
|
||||
gId != INITIALD_5_JAP_REVA && gId != INITIALD_5_JAP_REVF && gId != INITIALD_5_EXP && gId != INITIALD_5_EXP_20 &&
|
||||
gId != INITIALD_5_EXP_20A) ||
|
||||
(getConfig()->GPUVendor == NVIDIA_GPU))
|
||||
{
|
||||
return _cgCreateProgram(context, program_type, program, profile, entry, args);
|
||||
if ((gId != LETS_GO_JUNGLE && gId != LETS_GO_JUNGLE_REVA && gId != LETS_GO_JUNGLE_SPECIAL) || getConfig()->lgjRenderWithMesa == 0)
|
||||
return _cgCreateProgram(context, program_type, program, profile, entry, args);
|
||||
}
|
||||
|
||||
if ((gId == INITIALD_4_EXP_REVB) || (gId == INITIALD_4_EXP_REVC) || (gId == INITIALD_4_EXP_REVD) ||
|
||||
(gId == INITIALD_4_REVA) || (gId == INITIALD_4_REVB) || (gId == INITIALD_4_REVC) || (gId == INITIALD_4_REVD) ||
|
||||
(gId == INITIALD_4_REVG) || (gId == INITIALD_5_JAP_REVA) || (gId == INITIALD_5_JAP_REVF) ||
|
||||
(gId == INITIALD_5_EXP_30) || (gId == INITIALD_5_EXP_40))
|
||||
if (gId == INITIALD_4_EXP_REVB || gId == INITIALD_4_EXP_REVC || gId == INITIALD_4_EXP_REVD || gId == INITIALD_4_REVA ||
|
||||
gId == INITIALD_4_REVB || gId == INITIALD_4_REVC || gId == INITIALD_4_REVD || gId == INITIALD_4_REVG ||
|
||||
gId == INITIALD_5_JAP_REVA || gId == INITIALD_5_JAP_REVF || gId == INITIALD_5_EXP || gId == INITIALD_5_EXP_20 ||
|
||||
gId == INITIALD_5_EXP_20A)
|
||||
{
|
||||
if ((profile == 6148) || (profile == 6150) || profile == 7001)
|
||||
profile = 6150;
|
||||
@@ -1149,8 +1140,7 @@ char *cgCreateProgram(uint32_t context, int program_type, const char *program, i
|
||||
void gl_ShaderSourceARB(GLhandleARB shaderObj, GLsizei count, const GLcharARB **const string, const GLint *length)
|
||||
{
|
||||
uint32_t gId = getConfig()->crc32;
|
||||
if ((gId != SEGA_RACE_TV) && (gId != HUMMER) && (gId != HUMMER_SDLX) && (gId != HUMMER_EXTREME) &&
|
||||
(gId != HUMMER_EXTREME_MDX))
|
||||
if (gId != SEGA_RACE_TV && gId != HUMMER && gId != HUMMER_SDLX && gId != HUMMER_EXTREME && gId != HUMMER_EXTREME_MDX)
|
||||
{
|
||||
glShaderSourceARB(shaderObj, count, string, length);
|
||||
return;
|
||||
@@ -1191,7 +1181,7 @@ void gl_ShaderSourceARB(GLhandleARB shaderObj, GLsizei count, const GLcharARB **
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((gId == HUMMER) || (gId == HUMMER_SDLX) || (gId == HUMMER_EXTREME) || (gId == HUMMER_EXTREME_MDX))
|
||||
else if (gId == HUMMER || gId == HUMMER_SDLX || gId == HUMMER_EXTREME || gId == HUMMER_EXTREME_MDX)
|
||||
{
|
||||
void *addr = __builtin_return_address(0);
|
||||
if ((addr != (void *)0x830a501) && (addr != (void *)0x830a485) && (addr != (void *)0x08319841) &&
|
||||
@@ -1230,8 +1220,8 @@ void gl_ShaderSourceARB(GLhandleARB shaderObj, GLsizei count, const GLcharARB **
|
||||
void *gl_XGetProcAddressARB(const unsigned char *procName)
|
||||
{
|
||||
int dbgMsg = getConfig()->showDebugMessages;
|
||||
if ((getConfig()->crc32 != HUMMER) && (getConfig()->crc32 != HUMMER_SDLX) &&
|
||||
(getConfig()->crc32 != HUMMER_EXTREME) && (getConfig()->crc32 != HUMMER_EXTREME_MDX))
|
||||
if (getConfig()->crc32 != HUMMER && getConfig()->crc32 != HUMMER_SDLX && getConfig()->crc32 != HUMMER_EXTREME &&
|
||||
getConfig()->crc32 != HUMMER_EXTREME_MDX)
|
||||
{
|
||||
if (strcmp((const char *)procName, "glGenOcclusionQueriesNV") == 0)
|
||||
{
|
||||
@@ -1442,16 +1432,30 @@ int parseCgcArgs(const char *input, const char ***compilerArgs, const char **out
|
||||
|
||||
void loadLibCg()
|
||||
{
|
||||
int isFlatpak = 0;
|
||||
void *handle = dlopen("./libCg.so", RTLD_NOW);
|
||||
if (!handle)
|
||||
{
|
||||
fprintf(stderr, "Error: Unable to load library libCg.so %s\n", dlerror());
|
||||
fprintf(stderr, "Error: libCg.so version 2.0 is needed to compile the shaders in the game's folder.\n");
|
||||
exit(1);
|
||||
handle = dlopen("/app/lib32/libCg2.so", RTLD_NOW);
|
||||
if (!handle)
|
||||
{
|
||||
fprintf(stderr, "Error: Unable to load library libCg.so %s\n", dlerror());
|
||||
fprintf(stderr, "Error: libCg.so version 2.0 is needed to compile the shaders in the game's folder.\n");
|
||||
exit(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
isFlatpak = 1;
|
||||
}
|
||||
}
|
||||
|
||||
char libCgVersion[9];
|
||||
FILE *libF = fopen("./libCg.so", "r");
|
||||
FILE *libF;
|
||||
if (isFlatpak)
|
||||
libF = fopen("/app/lib32/libCg2.so", "r");
|
||||
else
|
||||
libF = fopen("./libCg.so", "r");
|
||||
|
||||
fseek(libF, 0x226d84, SEEK_SET);
|
||||
fread(libCgVersion, 9, 1, libF);
|
||||
fclose(libF);
|
||||
@@ -1699,15 +1703,14 @@ void cacheModedShaderFiles()
|
||||
free(newProgram);
|
||||
}
|
||||
}
|
||||
else if ((gId == INITIALD_4_EXP_REVB) || (gId == INITIALD_4_EXP_REVC) || (gId == INITIALD_4_EXP_REVD) ||
|
||||
(gId == INITIALD_4_REVA) || (gId == INITIALD_4_REVB) || (gId == INITIALD_4_REVC) ||
|
||||
(gId == INITIALD_4_REVD) || (gId == INITIALD_4_REVG) || (gId == INITIALD_5_JAP_REVA) ||
|
||||
(gId == INITIALD_5_JAP_REVF) || (gId == INITIALD_5_EXP_30) || (gId == INITIALD_5_EXP_40))
|
||||
else if (gId == INITIALD_4_EXP_REVB || gId == INITIALD_4_EXP_REVC || gId == INITIALD_4_EXP_REVD || gId == INITIALD_4_REVA ||
|
||||
gId == INITIALD_4_REVB || gId == INITIALD_4_REVC || gId == INITIALD_4_REVD || gId == INITIALD_4_REVG ||
|
||||
gId == INITIALD_5_JAP_REVA || gId == INITIALD_5_JAP_REVF || gId == INITIALD_5_EXP || gId == INITIALD_5_EXP_20 ||
|
||||
gId == INITIALD_5_EXP_20A)
|
||||
{
|
||||
ShaderFilesToMod *shaderFilesToMod;
|
||||
int filesToModCount;
|
||||
if ((gId == INITIALD_4_REVA) || (gId == INITIALD_4_REVB) || (gId == INITIALD_4_REVC) ||
|
||||
(gId == INITIALD_4_REVD) || (gId == INITIALD_4_REVG))
|
||||
if (gId == INITIALD_4_REVA || gId == INITIALD_4_REVB || gId == INITIALD_4_REVC || gId == INITIALD_4_REVD || gId == INITIALD_4_REVG)
|
||||
{
|
||||
shaderFilesToMod = id4jShaderFilesToMod;
|
||||
filesToModCount = id4FilesToModCount;
|
||||
@@ -1719,8 +1722,8 @@ void cacheModedShaderFiles()
|
||||
}
|
||||
for (int x = 0; x < filesToModCount; x++)
|
||||
{
|
||||
if ((gId == INITIALD_5_JAP_REVA) || (gId == INITIALD_5_JAP_REVF) || (gId == INITIALD_5_EXP_30) ||
|
||||
(gId == INITIALD_5_EXP_40))
|
||||
if (gId == INITIALD_5_JAP_REVA || gId == INITIALD_5_JAP_REVF || gId == INITIALD_5_EXP || gId == INITIALD_5_EXP_20 ||
|
||||
gId == INITIALD_5_EXP_20A)
|
||||
{
|
||||
char *fName = shaderFilesToMod[x].fileName;
|
||||
shaderFilesToMod[x].fileName = replaceSubstring(fName, 0, strlen(fName), "Shader", "V5SHADER");
|
||||
@@ -1749,9 +1752,9 @@ void cacheModedShaderFiles()
|
||||
free(newProgram);
|
||||
}
|
||||
}
|
||||
else if ((gId == VIRTUA_TENNIS_3) || (gId == VIRTUA_TENNIS_3_TEST) || (gId == VIRTUA_TENNIS_3_REVA) ||
|
||||
(gId == VIRTUA_TENNIS_3_REVA_TEST) || (gId == VIRTUA_TENNIS_3_REVB) ||
|
||||
(gId == VIRTUA_TENNIS_3_REVB_TEST) || (gId == VIRTUA_TENNIS_3_REVC) || (gId == VIRTUA_TENNIS_3_REVC_TEST))
|
||||
else if (gId == VIRTUA_TENNIS_3 || gId == VIRTUA_TENNIS_3_TEST || gId == VIRTUA_TENNIS_3_REVA || gId == VIRTUA_TENNIS_3_REVA_TEST ||
|
||||
gId == VIRTUA_TENNIS_3_REVB || gId == VIRTUA_TENNIS_3_REVB_TEST || gId == VIRTUA_TENNIS_3_REVC ||
|
||||
gId == VIRTUA_TENNIS_3_REVC_TEST)
|
||||
{
|
||||
for (int x = 0; x < vt3FilesToModCount; x++)
|
||||
{
|
||||
@@ -1830,14 +1833,13 @@ void cacheModedShaderFiles()
|
||||
shaderFilesToPatch = hodexShaderPatches;
|
||||
shaderFilesToPatchCount = hodexShaderPatchesCount;
|
||||
}
|
||||
else if ((gId == THE_HOUSE_OF_THE_DEAD_4_REVA) || (gId == THE_HOUSE_OF_THE_DEAD_4_REVB) ||
|
||||
(gId == THE_HOUSE_OF_THE_DEAD_4_REVC))
|
||||
else if (gId == THE_HOUSE_OF_THE_DEAD_4_REVA || gId == THE_HOUSE_OF_THE_DEAD_4_REVB || gId == THE_HOUSE_OF_THE_DEAD_4_REVC)
|
||||
{
|
||||
sprintf(folderName, "/../fs/dat/");
|
||||
shaderFilesToPatchCount = hod4ShaderPatchesCount;
|
||||
shaderFilesToPatch = hod4ShaderPatches;
|
||||
}
|
||||
else if ((gId == THE_HOUSE_OF_THE_DEAD_4_SPECIAL) || (gId == THE_HOUSE_OF_THE_DEAD_4_SPECIAL_REVB))
|
||||
else if (gId == THE_HOUSE_OF_THE_DEAD_4_SPECIAL || gId == THE_HOUSE_OF_THE_DEAD_4_SPECIAL_REVB)
|
||||
{
|
||||
sprintf(folderName, "/../fs/dat/");
|
||||
shaderFilesToPatchCount = hod4spShaderPatchesCount;
|
||||
|
||||
@@ -702,14 +702,14 @@ static int stbi__sse2_available()
|
||||
|
||||
static int stbi__sse2_available()
|
||||
{
|
||||
#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 // GCC 4.8 or later
|
||||
//#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 // GCC 4.8 or later
|
||||
// GCC 4.8+ has a nice way to do this
|
||||
return __builtin_cpu_supports("sse2");
|
||||
#else
|
||||
//return __builtin_cpu_supports("sse2");
|
||||
//#else
|
||||
// portable way to do this, preferably without using GCC inline ASM?
|
||||
// just bail for now.
|
||||
return 0;
|
||||
#endif
|
||||
//#endif
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -59,7 +59,7 @@ Window XCreateWindow(Display *display, Window parent, int x, int y, unsigned int
|
||||
unsigned long valueMask, XSetWindowAttributes *attributes) =
|
||||
dlsym(RTLD_NEXT, "XCreateWindow");
|
||||
|
||||
if (gettingGPUVendor || creatingWindow || GLUTGame)
|
||||
if ((gettingGPUVendor || creatingWindow) || (GLUTGame && getConfig()->noSDL == 0))
|
||||
{
|
||||
Window window = _XCreateWindow(display, parent, x, y, width, height, border_width, depth, class, visual,
|
||||
valueMask, attributes);
|
||||
|
||||
Reference in New Issue
Block a user