Skip to content

Commit

Permalink
Improve error handling and add checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Maingron committed Nov 19, 2022
1 parent 5ad8c7d commit 8543445
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion Open With Retroarch.bat
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,19 @@ goto %rom-ext%


:run
start %retroarch-exe% -L %emu-core% %1
:run-checks
goto check-core_set

:run-run
start %retroarch-exe% -L %emu-core% %1
exit

:check_stuff
:check-core_set
IF NOT DEFINED emu-core (goto error-no_core_defined)

goto run-run


:error_stuff

Expand All @@ -135,12 +145,25 @@ goto %rom-ext%
goto list-variables
goto eof

:error-no_core_defined
echo No core defined for %emu-system%. Please edit the script and add a core for this system.
echo You can CTRL+F and search for ":%rom-ext%" to find the section you need to edit.
echo.
echo By the way: If you know of a core that works for this system, please submit a pull request on GitHub.
goto list-variables
goto eof

:list-variables
echo.
echo --------------------
echo Variables in use:
echo retroarch-exe = %retroarch-exe%
echo rom-path = %rom-path%
echo rom-name = %rom-name%
echo rom-ext = %rom-ext%
echo emu-system = %emu-system%
echo emu-core = %emu-core%
echo --------------------
pause

:eof
Expand Down

0 comments on commit 8543445

Please sign in to comment.