nba-emu / NanoBoyAdvance

A cycle-accurate Nintendo Game Boy Advance emulator.
GNU General Public License v3.0
955 stars 53 forks source link

Issue with working directory running NanoBoyAdvance through command-line #343

Open ElektroStudios opened 6 months ago

ElektroStudios commented 6 months ago

I think there is no documentation to know which command-line argument I need to use in order to just load a rom. Under windows (CMD).

For example: NanoBoyAdvance.exe "C:\rom.gba"

That will not work. The emulator GUI will not open.

fleroviux commented 6 months ago

That command line should work normally, probably something broke.

ElektroStudios commented 6 months ago

I'm using NanoBoyAdvance v1.7.1 x64 under Windows 10.

If I open a CMD window inside the emulator directory (where NanoBoyAdvance.exe is) and I run this command, it will not work:

"NanoBoyAdvance.exe" "C:\full path to rom.gba"

Or these two commands which does the same:

PUSHD "C:\NanoBoyAdvance Directory\"
"NanoBoyAdvance.exe" "C:\full path to rom.gba"`

The program tries to load (I can see it for a moment in the task manager) but the user-interface is not shown, and the program closes instantly. There is no error message about a handled or unhandled exception, nothing happens, the program just fails to start up so it kills itself.

This is the log from Windows Event Viewer and translated to English (Google Translator):

Errored application name: NanoBoyAdvance.exe, version: 1.7.1.0, timestamp: 0x64629636 Errored module name: NanoBoyAdvance.exe, version: 1.7.1.0, timestamp: 0x64629636 Exception code: 0x40000015 Error offset: 0x0000000000db5576 Errored process identifier: 0x33ac Errored application start time: 0x01da2ee23283e109 Path of the failed application: C:\Users\Administrator\Desktop\Emulators\NanoBoyAdvance\NanoBoyAdvance.exe

- System 
  - Provider 
   [ Name]  Application Error 

  - EventID 1000 
   [ Qualifiers]  0 
   Version 0 
   Level 2 
   Task 100 
   Opcode 0 
   Keywords 0x80000000000000 

  - TimeCreated 
   [ SystemTime]  2023-12-14T23:06:55.6484209Z 
   EventRecordID 62021 
   Correlation 

  - Execution 
   [ ProcessID]  0 
   [ ThreadID]  0 
   Channel Application 
   Computer ELEKTRO-PC 
   Security 

- EventData 
   NanoBoyAdvance.exe 
   1.7.1.0 
   64629636 
   NanoBoyAdvance.exe 
   1.7.1.0 
   64629636 
   40000015 
   0000000000db5576 
   33ac 
   01da2ee23283e109 
   C:\Users\Administrador\Desktop\Emulators\NanoBoyAdvance\NanoBoyAdvance.exe 
   C:\Users\Administrador\Desktop\Emulators\NanoBoyAdvance\NanoBoyAdvance.exe 
   d737283c-1413-4a2b-9aaa-393fc9f7e77a 

I discovered that in order to avoid the strange issue, I must specify the full path to the NanoBoyAdvance.exe executable, even if the CMD working directory is the same directory of the NanoBoyAdvance.exe file, so this command now will work as expected:

"C:\full path to NanoBoyAdvance.exe" "C:\full path to rom.gba"

Using relative path for the current working directory (".\") will also work:

PUSHD "C:\NanoBoyAdvance Directory\"
".\NanoBoyAdvance.exe" "C:\full path to rom.gba"`

But this will NOT work as I said before:

PUSHD "C:\NanoBoyAdvance Directory\"
"NanoBoyAdvance.exe" "C:\full path to rom.gba"`