changed default keycodes file name

This commit is contained in:
kanjitalk755 2020-03-21 10:21:53 +09:00
parent ecef51bc47
commit b3c4d46ca9

View File

@ -91,16 +91,16 @@ static int display_type = DISPLAY_WINDOW; // See enum above
#endif #endif
#ifdef SHEEPSHAVER #ifdef SHEEPSHAVER
#define PROGRAM_NAME "SheepShaver" #define PREFIX ""
#else #else
#define PROGRAM_NAME "BasiliskII" #define PREFIX "BasiliskII_"
#endif #endif
// Constants // Constants
#ifdef WIN32 #ifdef WIN32
const char KEYCODE_FILE_NAME[] = PROGRAM_NAME "_keycodes"; const char KEYCODE_FILE_NAME[] = PREFIX "keycodes";
#elif __MACOSX__ #elif __MACOSX__
const char KEYCODE_FILE_NAME[] = PROGRAM_NAME "_keycodes"; const char KEYCODE_FILE_NAME[] = PREFIX "keycodes";
#else #else
const char KEYCODE_FILE_NAME[] = DATADIR "/keycodes"; const char KEYCODE_FILE_NAME[] = DATADIR "/keycodes";
#endif #endif
@ -747,7 +747,7 @@ static SDL_Surface * init_sdl_video(int width, int height, int bpp, Uint32 flags
*/ */
if (!sdl_window) { if (!sdl_window) {
sdl_window = SDL_CreateWindow( sdl_window = SDL_CreateWindow(
PROGRAM_NAME, "Basilisk II",
SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
window_width, window_width,
@ -1206,7 +1206,7 @@ static void keycode_init(void)
const char *kc_path = PrefsFindString("keycodefile"); const char *kc_path = PrefsFindString("keycodefile");
// Open keycode table // Open keycode table
FILE *f = fopen(kc_path ? kc_path : KEYCODE_FILE_NAME, "r"); FILE *f = fopen(kc_path && *kc_path ? kc_path : KEYCODE_FILE_NAME, "r");
if (f == NULL) { if (f == NULL) {
char str[256]; char str[256];
snprintf(str, sizeof(str), GetString(STR_KEYCODE_FILE_WARN), kc_path ? kc_path : KEYCODE_FILE_NAME, strerror(errno)); snprintf(str, sizeof(str), GetString(STR_KEYCODE_FILE_WARN), kc_path ? kc_path : KEYCODE_FILE_NAME, strerror(errno));