That “code” that you’re seeing is the console output, which probably shows an error explaining why it isn’t working. Not sure if it gets captured in any log, but you could check the es_log in .emulationstation.
The best way to diagnose is to try launching from the command line using the same command that Emulation Station uses. It’s defined by the “COMMAND=” line in .emulationstation/es_systems.cfg for the emulator you’re trying to launch. You’ll need to manually substitute the %ROM% value with a full path to the rom you’re trying to launch, and if the rom title has spaces or other characters like “(” you’ll need to backslash them which can be a pain. To make it easier you could rename your rom something simple like maria.nes, put it in your root directory and then the path could just be something like “/home/pi/mario.nes”
Hope this helps.