Compare commits

...
3 Commits
Author SHA1 Message Date
dkeruza-neo f67f30cbcd Fixed a bug in LGJ when GPU was nVidia and Mesa was set as shader patches. 2025-01-26 03:58:41 +01:00
dkeruza-neo 7ea08b3db3 Cleaned up commented code. 2025-01-26 03:58:41 +01:00
dkeruza dde7cc7b56 Update lindbergh.conf
typo
2025-01-25 00:29:58 +01:00
5 changed files with 133 additions and 192 deletions
+34
View File
@@ -0,0 +1,34 @@
# Changelog
All notable changes to this project will be documented in this file.
## [Unreleased]
### Added
- Let's go Jungle resolution patch.
- 2 Spicy resolution patch.
- 2 Spicy Patch to allow any IP for Network play.
- HOD4 SP CPU Frequency fix.
- ID4 and ID5 patches for Network link to allowed any NIC name and any IP.
- Harley patch for network link to allowed any NIC name and any IP.
- Fixed a bug in Let's go Jungle when GPU was nVidia and Mesa was set as shader patches.
### [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
+1 -1
View File
@@ -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) # Sets the IP address in the eeprom for Outrun link (you have to put your NIC ip)
# OR2_IP 192.168.1.2 # 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 # CPU_FREQ_GHZ 4.0
# Set the colour of the lindbergh to change the Segaboot logo # Set the colour of the lindbergh to change the Segaboot logo
-11
View File
@@ -12,7 +12,6 @@
#undef __x86_64__ #undef __x86_64__
#include <arpa/inet.h> #include <arpa/inet.h>
#include <dlfcn.h> #include <dlfcn.h>
#include <errno.h>
#include <link.h> #include <link.h>
#include <linux/sockios.h> #include <linux/sockios.h>
#include <math.h> #include <math.h>
@@ -266,12 +265,6 @@ void __attribute__((constructor)) hook_init()
(getConfig()->crc32 == INITIALD_5_EXP_30) || (getConfig()->crc32 == INITIALD_5_EXP_40))) { (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()); printf("WARNING: Game %s is unsupported in AMD GPU with ATI driver\n",getGameName());
} }
if (getConfig()->lgjRenderWithMesa &&
((getConfig()->crc32 == LETS_GO_JUNGLE) || (getConfig()->crc32 == LETS_GO_JUNGLE_REVA) ||
(getConfig()->crc32 == LETS_GO_JUNGLE_SPECIAL)))
{
getConfig()->GPUVendor = AMD_GPU;
}
} }
DIR *opendir(const char *dirname) DIR *opendir(const char *dirname)
@@ -468,10 +461,6 @@ FILE *fopen(const char *restrict pathname, const char *restrict mode)
return fileHooks[CPUINFO]; 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 (strcmp(pathname, "/usr/lib/boot/SEGA_KakuGothic-DB-Roman_12.tga") == 0)
{ {
if (!getConfig()->disableBuiltinFont) if (!getConfig()->disableBuiltinFont)
+2 -80
View File
@@ -364,25 +364,6 @@ int isTestMode()
void glBindTextureABC(GLenum target, GLuint texture) void glBindTextureABC(GLenum target, GLuint texture)
{ {
// const char *targetName = "";
// switch (target)
// {
// case GL_TEXTURE_2D:
// targetName = "GL_TEXTURE_2D";
// break;
// case GL_TEXTURE_CUBE_MAP:
// targetName = "GL_TEXTURE_CUBE_MAP";
// break;
// case GL_TEXTURE_3D:
// targetName = "GL_TEXTURE_3D";
// break;
// case GL_TEXTURE_1D:
// targetName = "GL_TEXTURE_1D";
// break;
// default:
// targetName = "UNKNOWN";
// break;
// }
curTargetABC = target; curTargetABC = target;
curTextureIDABC = texture; curTextureIDABC = texture;
@@ -1168,7 +1149,6 @@ void glBindTextureGE(GLenum target, GLuint texture)
if (getConfig()->crc32 == TOO_SPICY) if (getConfig()->crc32 == TOO_SPICY)
{ {
// printf("glBindTexture called: Target = %s (0x%x), Texture ID = %u\n", targetName, target, texture);
if (texture == 902 || texture == 1642) if (texture == 902 || texture == 1642)
{ // 55 title { // 55 title
enableScaling = true; // Enable scaling enableScaling = true; // Enable scaling
@@ -1189,25 +1169,11 @@ void glVertex3fHOD4(GLfloat x, GLfloat y, GLfloat z)
void *returnAddress = __builtin_return_address(0); void *returnAddress = __builtin_return_address(0);
// printf("glVertex3f hooked: x=%f, y=%f, z=%f\n", x, y, z);
// float scaleX = 1920.0f / 1280.0f;
// float scaleY = 1080.0f / 768.0f;
float scaleX = getConfig()->width / 1280.0f; float scaleX = getConfig()->width / 1280.0f;
float scaleY = getConfig()->height / 768.0f; float scaleY = getConfig()->height / 768.0f;
float TestX = ((((getConfig()->width - 1280.0) / 2.0) * 1.1116317809) / 1280.0) * (1.5 / scaleX); float TestX = ((((getConfig()->width - 1280.0) / 2.0) * 1.1116317809) / 1280.0) * (1.5 / scaleX);
float TestY = ((((getConfig()->height - 768.0) / 2.0) * 0.666979044) / 768.0) * (1.5 / scaleX); float TestY = ((((getConfig()->height - 768.0) / 2.0) * 0.666979044) / 768.0) * (1.5 / scaleX);
// float OffsetX = 0.277907945225; // 1920x1080
// float OffsetY = 0.1354801183125;
// float OffsetX = 0.166744767135; // 0.1659539726125; //1600x900
// float OffsetY = 0.0687822139125; // 0.06731851159375
// float OffsetX = 0.0490425785691176; //1360x768
// float OffsetY = 0.0;
float OffsetX = TestX; // test float OffsetX = TestX; // test
float OffsetY = TestY; float OffsetY = TestY;
@@ -1216,16 +1182,8 @@ void glVertex3fHOD4(GLfloat x, GLfloat y, GLfloat z)
float AdjOffsetX = OffsetX * scaleZ; float AdjOffsetX = OffsetX * scaleZ;
float AdjOffsetY = OffsetY * scaleZ; float AdjOffsetY = OffsetY * scaleZ;
if (z == -1.000000f) if (z == -1.510000f)
{ // 3d { // logo 2d elemtents target
// printf("glVertex3f hooked: x=%f, y=%f, z=%f\n", x, y, z);
}
else if (z == -1.000010f)
{ // subtitles
}
else if (z == -1.510000f)
{ // logo 2d elemtents target
if (curTextureIDGE != 260) // target boss fight if (curTextureIDGE != 260) // target boss fight
{ {
x += OffsetX; x += OffsetX;
@@ -1234,21 +1192,9 @@ void glVertex3fHOD4(GLfloat x, GLfloat y, GLfloat z)
x *= scaleX; x *= scaleX;
y *= scaleY; y *= scaleY;
} }
else
{
}
}
else if (z == -2.000000f)
{ // videos - cutscenes
}
else if (z == -3.000000f)
{ // ??
} }
else if (z == -1.210000f) else if (z == -1.210000f)
{ // coins start select side { // coins start select side
// printf(" x values: %.10f\n", x);
// printf(" y values: %.10f\n", y);
x += AdjOffsetX; x += AdjOffsetX;
y -= AdjOffsetY; y -= AdjOffsetY;
@@ -1257,7 +1203,6 @@ void glVertex3fHOD4(GLfloat x, GLfloat y, GLfloat z)
} }
else if (z == -1.310000f) else if (z == -1.310000f)
{ // main bd { // main bd
x += AdjOffsetX; x += AdjOffsetX;
y -= AdjOffsetY; y -= AdjOffsetY;
@@ -1266,7 +1211,6 @@ void glVertex3fHOD4(GLfloat x, GLfloat y, GLfloat z)
} }
else if (z == -1.509800f) else if (z == -1.509800f)
{ // frame 2d elements { // frame 2d elements
x += AdjOffsetX; x += AdjOffsetX;
y -= AdjOffsetY; y -= AdjOffsetY;
@@ -1276,7 +1220,6 @@ void glVertex3fHOD4(GLfloat x, GLfloat y, GLfloat z)
else if (z == -1.4099999666f) else if (z == -1.4099999666f)
{ // continue { // continue
x += AdjOffsetX; x += AdjOffsetX;
y -= AdjOffsetY; y -= AdjOffsetY;
@@ -1285,7 +1228,6 @@ void glVertex3fHOD4(GLfloat x, GLfloat y, GLfloat z)
} }
else if (z == -1.6099998951f) else if (z == -1.6099998951f)
{ // score { // score
x += AdjOffsetX; x += AdjOffsetX;
y -= AdjOffsetY; y -= AdjOffsetY;
@@ -1294,7 +1236,6 @@ void glVertex3fHOD4(GLfloat x, GLfloat y, GLfloat z)
} }
else if (z == -1.7100000381f) else if (z == -1.7100000381f)
{ // side select { // side select
x += AdjOffsetX; x += AdjOffsetX;
y -= AdjOffsetY; y -= AdjOffsetY;
@@ -1303,7 +1244,6 @@ void glVertex3fHOD4(GLfloat x, GLfloat y, GLfloat z)
} }
else if (z == -1.5091999769f || z == -1.5094000101f || z == -1.5095999241f) else if (z == -1.5091999769f || z == -1.5094000101f || z == -1.5095999241f)
{ // bar boss fight { // bar boss fight
x += AdjOffsetX; x += AdjOffsetX;
y -= AdjOffsetY; y -= AdjOffsetY;
@@ -1318,24 +1258,6 @@ void glVertex3fHOD4(GLfloat x, GLfloat y, GLfloat z)
x *= scaleX; x *= scaleX;
y *= scaleY; y *= scaleY;
} }
else
{
if (curTextureIDGE != 26)
{ // gun effect
// printf(" z values: %.10f\n", z);
if (z > -1.8f && z < -1.0f)
{
// x += AdjOffsetX;
// y -= AdjOffsetY;
// x *= 1920.0f /1280.0f;
// y *= 1080.0f /768.0f;
}
}
}
_glVertex3f(x, y, z); _glVertex3f(x, y, z);
} }
+96 -100
View File
@@ -435,6 +435,7 @@ bool shaderFileInList(const char *pathname, int *idx)
{ {
uint32_t gId = getConfig()->crc32; uint32_t gId = getConfig()->crc32;
char cwd[256]; char cwd[256];
int gpuVendor = getConfig()->GPUVendor;
if (gId == GHOST_SQUAD_EVOLUTION) if (gId == GHOST_SQUAD_EVOLUTION)
{ {
if (getConfig()->GPUVendor != NVIDIA_GPU) if (getConfig()->GPUVendor != NVIDIA_GPU)
@@ -560,104 +561,100 @@ bool shaderFileInList(const char *pathname, int *idx)
} }
return false; 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))
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)
{ {
*idx = x; *idx = x;
return true; 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_30 || gId == INITIALD_5_EXP_40) &&
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_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) &&
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; return false;
} }
@@ -1098,17 +1095,16 @@ char *cgCreateProgram(uint32_t context, int program_type, const char *program, i
const char **args) = dlsym(RTLD_NEXT, "cgCreateProgram"); const char **args) = dlsym(RTLD_NEXT, "cgCreateProgram");
uint32_t gId = getConfig()->crc32; uint32_t gId = getConfig()->crc32;
if (((gId != VIRTUA_TENNIS_3) && (gId != VIRTUA_TENNIS_3_TEST) && (gId != VIRTUA_TENNIS_3_REVA) && 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_REVA_TEST) && (gId != VIRTUA_TENNIS_3_REVB) && (gId != VIRTUA_TENNIS_3_REVB_TEST) && gId != VIRTUA_TENNIS_3_REVB && gId != VIRTUA_TENNIS_3_REVB_TEST && gId != VIRTUA_TENNIS_3_REVC &&
(gId != VIRTUA_TENNIS_3_REVC) && (gId != VIRTUA_TENNIS_3_REVC_TEST) && (gId != INITIALD_4_EXP_REVB) && gId != VIRTUA_TENNIS_3_REVC_TEST && gId != INITIALD_4_EXP_REVB && gId != INITIALD_4_EXP_REVC && gId != INITIALD_4_EXP_REVD &&
(gId != INITIALD_4_EXP_REVC) && (gId != INITIALD_4_EXP_REVD) && (gId != LETS_GO_JUNGLE) && gId != LETS_GO_JUNGLE && gId != LETS_GO_JUNGLE_REVA && gId != LETS_GO_JUNGLE_SPECIAL && gId != INITIALD_4_REVA &&
(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_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) ||
(gId != INITIALD_5_JAP_REVA) && (gId != INITIALD_5_JAP_REVF) && (gId != INITIALD_5_EXP_30) &&
(gId != INITIALD_5_EXP_40)) ||
(getConfig()->GPUVendor == NVIDIA_GPU)) (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) || if ((gId == INITIALD_4_EXP_REVB) || (gId == INITIALD_4_EXP_REVC) || (gId == INITIALD_4_EXP_REVD) ||