Attract-Mode Support Forum

Attract-Mode Support => General => Topic started by: arthurvalenca on February 16, 2023, 02:22:05 PM

Title: [Help]Need help with retroarch command line C#
Post by: arthurvalenca 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);
            }
}

(https://i.postimg.cc/HxSTgz1j/1.png)

(https://i.postimg.cc/hPQckVyP/2.png)
Title: Re: [Help]Need help with retroarch command line C#
Post by: zpaolo11x 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
Title: Re: [Help]Need help with retroarch command line C#
Post by: arthurvalenca 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?