Author Topic: [Help]Need help with retroarch command line C#  (Read 796 times)

arthurvalenca

  • Sr. Member
  • ****
  • Posts: 125
    • View Profile
[Help]Need help with retroarch command line C#
« on: February 16, 2023, 02:22:05 PM »
I'm trying to start games in the retroarch emulator from command lines for retroarch but it's not working out very well, I think the problem is in the command line that calls the core. I can even open the emulator but it doesn't load the core or the game, if anyone can help me I would be grateful. Below is the code I'm trying to make work.

Code: [Select]
private void StartGame()
{
    string rom = @"ROMFILES\" + RomfilesList.Text + ".zip";
    string emulator = @"EMULATOR\retroarch.exe";
    string commandline = @"-L EMULATOR\cores\genesis_plus_gx_libretro.dll";

            if (!File.Exists(emulator))
            {
                MessageBox.Show("Emulator is required to continue.", "ERROR", MessageBoxButtons.OK,MessageBoxIcon.Error);
            }

            else
            {
                Process.Start(emulator, "\"" + commandline + rom);
            }
}




zpaolo11x

  • Hero Member
  • *****
  • Posts: 1235
    • View Profile
    • My deviantart page
Re: [Help]Need help with retroarch command line C#
« Reply #1 on: February 18, 2023, 12:49:38 AM »
Shouldn't there be a space between commandline and rom when you build the command line to execute? Also no need to put the full core path after -L, the mnemonic name of the core is enough, like -L genesis_plus_gx

arthurvalenca

  • Sr. Member
  • ****
  • Posts: 125
    • View Profile
Re: [Help]Need help with retroarch command line C#
« Reply #2 on: February 18, 2023, 07:44:42 AM »
Shouldn't there be a space between commandline and rom when you build the command line to execute? Also no need to put the full core path after -L, the mnemonic name of the core is enough, like -L genesis_plus_gx

Code: [Select]
private void StartGame()
        {
            string rom = @"ROMFILES\" + RomfilesList.Text + ".zip";
            string emulator = @"EMULATOR\retroarch.exe";
            string commandline = "-L genesis_plus_gx_libretro.dll" + " " + rom ;

            if (!File.Exists(emulator))
            {
                MessageBox.Show("Emulator is required to continue.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            else
            {
                Process.Start(emulator, "\"" + commandline);
            }
        }

I tried that way but it didn't work, it just opens the emulator but no games, could you give me an example?