Compare commits

..
9 Commits
Author SHA1 Message Date
Bobby Dilley 565a9208b7 Update guide.md 2025-01-28 15:36:05 +00:00
Bobby Dilley be78a23a31 Make dkeruza happy 2025-01-28 15:24:06 +00:00
Bobby Dilley 8942c510ec Look for /dev/dsp and /dev/dsp1 2025-01-28 10:45:35 +00:00
Bobby Dilley 685d569a08 Remove not needed message 2025-01-28 10:16:06 +00:00
Bobby Dilley 5f19cdc44c Fix wrong error message 2025-01-28 10:11:55 +00:00
Bobby Dilley be1b88b92f Merge remote-tracking branch 'caviar/master' 2025-01-28 10:01:27 +00:00
Synth_Magic 51eaec106c Do changes as requested 2025-01-10 22:03:06 +08:00
Synth Magic dcae95fe03 rename linux/limits.h to limits.h 2025-01-10 20:54:24 +08:00
Synth_Magic fbc76dfe5e Add config path sepcification 2025-01-10 20:52:07 +08:00
7 changed files with 59 additions and 12 deletions
+11 -2
View File
@@ -48,11 +48,20 @@ sudo ln -s /lib/i386-linux-gnu/libglut.so /lib/i386-linux-gnu/libglut.so.3
### Let's Go Jungle Rev A ### 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 ### 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 complaining that the system cannot open `/dev[/sound]/dsp` in which case 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/
```
## Configuration File : lindbergh.conf ## Configuration File : lindbergh.conf
+11 -3
View File
@@ -1,3 +1,4 @@
#include <limits.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@@ -1483,7 +1484,7 @@ KeyMapping getDefaultKeymap()
return defaultKeyMapping; return defaultKeyMapping;
} }
int initConfig() int initConfig(const char* configFilePath)
{ {
config.emulateRideboard = 0; config.emulateRideboard = 0;
config.emulateDriveboard = 0; config.emulateDriveboard = 0;
@@ -1551,11 +1552,18 @@ int initConfig()
config.inputMode = 0; // Default to all inputs config.inputMode = 0; // Default to all inputs
configFile = fopen(CONFIG_PATH, "r"); char filePath[PATH_MAX];
strncpy(filePath, CONFIG_PATH, PATH_MAX);
if (configFilePath != NULL && configFilePath[0] != '\0')
{
strncpy(filePath, configFilePath, PATH_MAX);
}
configFile = fopen(filePath, "r");
if (configFile == NULL) if (configFile == NULL)
{ {
log_warn("Cannot open %s, using default values.\n", CONFIG_PATH); log_warn("Cannot open %s, using default values.\n", filePath);
return 1; return 1;
} }
+1 -1
View File
@@ -280,7 +280,7 @@ typedef struct
} EmulatorConfig; } EmulatorConfig;
KeyMapping getDefaultKeymap(); KeyMapping getDefaultKeymap();
int initConfig(); int initConfig(const char* configFilePath);
EmulatorConfig *getConfig(); EmulatorConfig *getConfig();
char *getGameName(); char *getGameName();
char *getDVPName(); char *getDVPName();
+12 -1
View File
@@ -185,7 +185,9 @@ void __attribute__((constructor)) hook_init()
act.sa_flags = SA_SIGINFO; act.sa_flags = SA_SIGINFO;
sigaction(SIGSEGV, &act, NULL); 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) if (getConfig()->fpsLimiter == 1)
{ {
@@ -303,6 +305,15 @@ int open(const char *pathname, int flags, ...)
int (*_open)(const char *pathname, int flags, ...) = dlsym(RTLD_NEXT, "open"); int (*_open)(const char *pathname, int flags, ...) = dlsym(RTLD_NEXT, "open");
// Attempt to open /dev/dsp and /dev/dsp1
if (strcmp(pathname, "/dev/dsp") == 0) {
int dspFileDescriptor = _open("/dev/dsp", flags, mode);
if(dspFileDescriptor != -1)
return dspFileDescriptor;
return _open("/dev/dsp1", flags, mode);
}
if (strcmp(pathname, "/dev/lbb") == 0) if (strcmp(pathname, "/dev/lbb") == 0)
{ {
hooks[BASEBOARD] = _open(HOOK_FILE_NAME, flags, mode); hooks[BASEBOARD] = _open(HOOK_FILE_NAME, flags, mode);
+19 -2
View File
@@ -1,4 +1,5 @@
#include <dirent.h> #include <dirent.h>
#include <limits.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@@ -12,6 +13,7 @@
#define LD_PRELOAD "LD_PRELOAD" #define LD_PRELOAD "LD_PRELOAD"
#define PRELOAD_FILE_NAME "lindbergh.so" #define PRELOAD_FILE_NAME "lindbergh.so"
#define TEAM "bobbydilley, retrofan, dkeruza-neo, doozer, francesco, rolel, caviar-x" #define TEAM "bobbydilley, retrofan, dkeruza-neo, doozer, francesco, rolel, caviar-x"
#define LINDBERGH_CONFIG_PATH "LINDBERGH_CONFIG_PATH"
uint32_t elf_crc = 0; uint32_t elf_crc = 0;
@@ -119,6 +121,7 @@ void printUsage(char *argv[])
printf(" --list-controllers Lists available controllers and inputs\n"); printf(" --list-controllers Lists available controllers and inputs\n");
printf(" --version Displays the version of the loader and team's names\n"); printf(" --version Displays the version of the loader and team's names\n");
printf(" --help Displays this usage text\n"); printf(" --help Displays this usage text\n");
printf(" --config | -c Specifies configuration path\n");
} }
/** /**
@@ -248,8 +251,9 @@ int main(int argc, char *argv[])
int gdb = 0; int gdb = 0;
int forceGame = 0; int forceGame = 0;
int segaboot = 0; int segaboot = 0;
char extConfigPath[PATH_MAX] = {0};
char forceGamePath[128] = {0}; char forceGamePath[128] = {0};
for (int i = 1; i < argc; i++) for (int i = 1; i < argc; i++)
{ {
if (strcmp(argv[i], "-t") == 0 || strcmp(argv[i], "--test") == 0) if (strcmp(argv[i], "-t") == 0 || strcmp(argv[i], "--test") == 0)
@@ -269,7 +273,16 @@ int main(int argc, char *argv[])
gdb = 1; gdb = 1;
continue; 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 // Treat the argument as the game name
strcpy(forceGamePath, argv[i]); strcpy(forceGamePath, argv[i]);
forceGame = 1; forceGame = 1;
@@ -305,6 +318,10 @@ int main(int argc, char *argv[])
strcat(temp, command); strcat(temp, command);
strcpy(command, temp); strcpy(command, temp);
} }
if (extConfigPath[0] != '\0')
{
setenv(LINDBERGH_CONFIG_PATH,extConfigPath,1);
}
log_info("Starting $ %s", command); log_info("Starting $ %s", command);
-1
View File
@@ -4,7 +4,6 @@
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <time.h>
// Structure to hold the formatted message and its size // Structure to hold the formatted message and its size
+5 -2
View File
@@ -2,6 +2,7 @@
#include "securityboard.h" #include "securityboard.h"
#include "log.h" #include "log.h"
#include "config.h"
#define SECURITY_BOARD_FRONT_PANEL 0x38 #define SECURITY_BOARD_FRONT_PANEL 0x38
#define SECURITY_BOARD_FRONT_PANEL_NON_ROOT 0x1038 #define SECURITY_BOARD_FRONT_PANEL_NON_ROOT 0x1038
@@ -51,8 +52,10 @@ int securityBoardSetDipResolution(int width, int height)
setResolutionDips(1, 1, 0); setResolutionDips(1, 1, 0);
else if (width == 1360 && height == 768) else if (width == 1360 && height == 768)
setResolutionDips(1, 1, 1); setResolutionDips(1, 1, 1);
else else {
log_warn("Resolution not compatible, using 640 x 480\n"); if(getConfig()->showDebugMessages)
log_warn("Resolution not original, setting dips to 640 x 480.\n");
}
return 0; return 0;
} }