You are not logged in.
Pages: 1
I am dual booting Windows 10 and Linux Mint 18.1 and I have installed DeSmuME 0.9.11 in both of them. What I want to do is unify the save files of both machines and since Windows can't read ext4 I will have to do it through Mint. The easiest way to go about it is to just make Mint DesMuME save in the same place as Windows DeSmuME but I just can't figure out how to do this. So I came over here to ask help, and in case there is no way I can do what I just asked, I would like you to suggest alternatives. Thank You!
Offline
since youre on linux, hack the source code. modify line 143-146 of path.h
to something like strncpy(pathToModule, "/path/you/want/battery/to/appear/under")
and you should get /path/you/want/battery/to/appear/under/Battery
Offline
Didn't work, it seems as though pathToModule is defined somewhere other than path.h but I'm not completely sure maybe I didn't do it quite right. Here are the original lines 135-162:
void LoadModulePath()
{
#if defined(HOST_WINDOWS)
char *p;
ZeroMemory(pathToModule, sizeof(pathToModule));
GetModuleFileName(NULL, pathToModule, sizeof(pathToModule));
p = pathToModule + lstrlen(pathToModule);
while (p >= pathToModule && *p != DIRECTORY_DELIMITER_CHAR) p--;
if (++p >= pathToModule) *p = 0;
#ifndef DESMUME_QT
extern char* _hack_alternateModulePath;
if(_hack_alternateModulePath)
{
strcpy(pathToModule,_hack_alternateModulePath);
}
#endif
#elif defined(DESMUME_COCOA)
std::string pathStr = Path::GetFileDirectoryPath(path);
strncpy(pathToModule, pathStr.c_str(), MAX_PATH);
#else
char *cwd = g_build_filename(g_get_user_config_dir(), "desmume", NULL);
g_mkdir_with_parents(cwd, 0755);
strncpy(pathToModule, cwd, MAX_PATH);
g_free(cwd);
#endif
}
I'm using desmume --cpu-mode=1 in case that helps.
Offline
You didnt do it right. You should have pasted your attempt.
Look at the linux codepath there. it does (something, something, strncpy, something). You only have to do the strncpy, and instead of cwd, the literal string
Offline
Didn't work, here is the second attempt:
void LoadModulePath()
{
#if defined(HOST_WINDOWS)
char *p;
ZeroMemory(pathToModule, sizeof(pathToModule));
GetModuleFileName(NULL, pathToModule, sizeof(pathToModule));
p = pathToModule + lstrlen(pathToModule);
while (p >= pathToModule && *p != DIRECTORY_DELIMITER_CHAR) p--;
if (++p >= pathToModule) *p = 0;
#ifndef DESMUME_QT
extern char* _hack_alternateModulePath;
if(_hack_alternateModulePath)
{
strcpy(pathToModule,_hack_alternateModulePath);
}
#endif
#elif defined(DESMUME_COCOA)
std::string pathStr = Path::GetFileDirectoryPath(path);
strncpy(pathToModule, pathStr.c_str(), MAX_PATH);
#else
char *cwd = g_build_filename(g_get_user_config_dir(), "desmume", NULL);
g_mkdir_with_parents(cwd, 0755);
strncpy(pathToModule, "/media/jim/Windows/Users/dtrai/Desktop/προγραμματα/DeSmuME");
g_free(cwd);
#endif
}
Also desmume didn't create a Battery folder, it just stores the saves in ~/.config/desmume maybe that's the problem
Offline
you must not use paths with non-english characters, unless you're an expert.
the line above strncpy creates the directory. it uses the old built path. get rid of that code and create the battery directory yourself.
however if it still stores saves in ~/.config/desmume (are you SURE it does that?) then the code hack did not work.
I think it's more likely youre confused, but I'm not 100% sure the code hack is correct.
Please double check your work.
Offline
It didn't work this time either. It definitely saves in ~/.config/desmume
Attempt #3:
#elif defined(DESMUME_COCOA)
std::string pathStr = Path::GetFileDirectoryPath(path);
strncpy(pathToModule, pathStr.c_str(), MAX_PATH);
#else
char *cwd = g_build_filename(g_get_user_config_dir(), "desmume", NULL);
strncpy(pathToModule, "/media/jim/Windows/Users/dtrai/Desktop/Programmes/DeSmuME");
g_free(cwd);
#endif
Offline
strncpy takes 3 arguments. I can't believe your code even COMPILES.
use strcpy(pathToModule, "/media/jim/Windows/Users/dtrai/Desktop/Programmes/DeSmuME"); instead
the line above and below it do nothing
Offline
Well... this is a little awkward... Apparently I had to compile desmume every time I made a change but I didn't know that so I have been kind of wasting you time with that. Worry not though cause I figured it out and finally made it work.
For anyone with the same problem who couldn't follow through:
1. Open desmume*/src/path.h with your favorite text editor
2. Remove line 160 which should look like this:
g_mkdir_with_parents(cwd, 0755);
3.Change line 161 which should look like this:
strncpy(pathToModule, cwd, MAX_PATH);
to something like this
strcpy(pathToModule, "/path/where/you/want/demume/to/save");
4.Save, then open a command line and do:
cd /path/to/desmume*
./configure
make
sudo make install
Now it should save at the location specified, thanks a lot zeromus for the help!
Offline
I store my save files in Dropbox and I have links to them in the ~/.config/desmume directory. Works like a charm.
Offline
Pages: 1