AmatCoder / mednaffe

A front-end (GUI) for mednafen emulator
GNU General Public License v3.0
429 stars 35 forks source link

Fix failure to find mednafen.cfg when inside bin/ or lib/ folders on Windows #130

Closed mayawarrier closed 3 years ago

mayawarrier commented 3 years ago

It seems from reading the code that the intent is to look in the process directory for mednafen.cfg. g_win32_get_package_installation_directory_of_module() returns the parent directory when the path contains "bin" or "lib".

I switched out g_win32_get_package_installation_directory_of_module(NULL) with new function win32_get_process_directory() instead.

Resolves #129

AmatCoder commented 3 years ago

Thanks for patch, it is correct but it has two issues:

  1. Building Mednaffe with Cygwin is not supported.
  2. g_win32_get_package_installation_directory_of_module function is used in more places.
mayawarrier commented 3 years ago

@AmatCoder Just made the required fixes. Let me know if more changes are needed.

mayawarrier commented 3 years ago

hey @AmatCoder, just following up on this PR :)

AmatCoder commented 3 years ago

Merged. Thanks very much!