diff --git a/README.md b/README.md index 214f6b9..8f5aa97 100644 --- a/README.md +++ b/README.md @@ -69,8 +69,7 @@ other platforms, refer to the [Building](#building) section. ## Running ### Windows -Execute `xsystem35`, and a dialog will appear for you to select a folder. -Choose the game folder (where the ALD files are located). +Copy `xsystem35.exe` to the game folder and run it. ### Android diff --git a/src/profile.c b/src/profile.c index 8f31e43..c6ccd68 100644 --- a/src/profile.c +++ b/src/profile.c @@ -35,7 +35,6 @@ #define RC_NAME ".xsys35rc" #define RC_LINE_CHARS_MAX 256 -#define REGKEY_PROFILE XSYSTEM35_REGKEY "\\profile" struct profile_kv { char *name; diff --git a/src/win/dialog.c b/src/win/dialog.c index 382ee61..07166b1 100644 --- a/src/win/dialog.c +++ b/src/win/dialog.c @@ -17,7 +17,6 @@ * */ #include -#include #undef min #undef max #include @@ -25,8 +24,6 @@ #include "sdl_private.h" #include "resources.h" -#define REGVAL_RECENT_FOLDER "RecentFolder" - static HWND get_hwnd(SDL_Window *window) { SDL_SysWMinfo info; SDL_VERSION(&info.version); @@ -34,49 +31,6 @@ static HWND get_hwnd(SDL_Window *window) { return info.info.win.window; } -static int CALLBACK select_game_callback(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData) { - if (uMsg == BFFM_INITIALIZED) - SendMessage(hwnd, BFFM_SETSELECTION, (WPARAM)TRUE, lpData); - return 0; -} - -boolean current_folder_has_ald(void) { - WIN32_FIND_DATA find_data; - HANDLE hFind = FindFirstFile("*.ALD", &find_data); - if (hFind == INVALID_HANDLE_VALUE) - return FALSE; - FindClose(hFind); - return TRUE; -} - -boolean select_game_folder(void) { - char title[256]; - LoadString(GetModuleHandle(NULL), IDS_CHOOSE_GAME_FOLDER, title, sizeof(title)); - - char path[MAX_PATH] = ""; - DWORD value_size = sizeof(path); - RegGetValue(HKEY_CURRENT_USER, XSYSTEM35_REGKEY, REGVAL_RECENT_FOLDER, - RRF_RT_REG_SZ, NULL, path, &value_size); - - BROWSEINFO bi = { - .lpszTitle = title, - .ulFlags = BIF_RETURNONLYFSDIRS, - .lpfn = &select_game_callback, - .lParam = (LPARAM)path, - }; - LPITEMIDLIST pidl = SHBrowseForFolder(&bi); - if (!pidl) - return FALSE; - SHGetPathFromIDList(pidl, path); - CoTaskMemFree(pidl); - if (!SetCurrentDirectory(path)) - return FALSE; - - RegSetKeyValue(HKEY_CURRENT_USER, XSYSTEM35_REGKEY, REGVAL_RECENT_FOLDER, - REG_SZ, path, strlen(path) + 1); - return TRUE; -} - static INT_PTR CALLBACK text_dialog_proc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) { static INPUTSTRING_PARAM *p; diff --git a/src/win/dialog.h b/src/win/dialog.h index 683fdd2..d52d267 100644 --- a/src/win/dialog.h +++ b/src/win/dialog.h @@ -24,8 +24,6 @@ struct inputstring_param; struct inputnum_param; -boolean current_folder_has_ald(void); -boolean select_game_folder(void); boolean input_string(struct inputstring_param *p); boolean input_number(struct inputnum_param *p); diff --git a/src/win/resources.h b/src/win/resources.h index ee06a9b..b60dca6 100644 --- a/src/win/resources.h +++ b/src/win/resources.h @@ -19,8 +19,6 @@ #ifndef __RESOURCES_H__ #define __RESOURCES_H__ -#define XSYSTEM35_REGKEY "Software\\Kichikuou\\xsystem35" - #define IDR_MENU1 101 #define IDD_DIALOG1 103 #define IDC_TEXT 104 diff --git a/src/xsystem35.c b/src/xsystem35.c index 309f65e..5482b07 100644 --- a/src/xsystem35.c +++ b/src/xsystem35.c @@ -476,12 +476,6 @@ int main(int argc, char **argv) { if (strcmp(argv[1], "-gamedir") == 0) chdir(argv[2]); #endif -#ifdef _WIN32 - if (argc == 1 && !current_folder_has_ald()) { - if (!select_game_folder()) - return 0; - } -#endif load_profile(); check_profile();