-
Notifications
You must be signed in to change notification settings - Fork 549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add an option for user-provided .cmd file for libretroMAME #13216
add an option for user-provided .cmd file for libretroMAME #13216
Conversation
this requires users to manually update the .conf file which is not ideal. |
@dmanlfc good point. I'll add that as well. |
Thanks @dmanlfc . I added your suggestion and updated the original description above. |
cmdFile.write(' '.join(str(item) for item in commandLine)) | ||
cmdFile.close() | ||
# Check to see whether user provided a custom cmd file, at either a default location, or specified in batocera.conf | ||
defaultCustomCmdFilepath = f'{rom}.cmd' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If use rom.with_suffix(f'{rom.suffix}.cmd')
, you'll get a path object and won't need to use Path()
on the next line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The filename variable is used again in line 460 when copying. If we use that, we'll have to construct the filename again for line 460, no?
That said, I condensed this section for brevity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, my bad. I see your point now. Will fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol. too late. I have other stuff to push and will include this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me, the current version
if Path(defaultCustomCmdFilepath := f"{rom}.cmd").is_file():
is slightly easier to understand than:
if (defaultCustomCmdFilepath := rom.with_suffix(f"{rom.suffix}.cmd")).is_file():
I did look into pathlib's source code and saw that a new construction is fairly cheap so the performance isn't really an issue.
I see you have another PR about using the Path object throughout. I think I'll leave this one for you to decide.
@tsankuanglee we shouldn't need |
@dmanlfc Feature removed as advised. The way I saw it: users who need advanced options, such as assigning two harddrives, or any changes not available through the UI, will have to edit However, I now agree with you that offering too much customization might be too confusing. |
MAME supports many different systems with variations in parameter logic. Currently libretroMAMEConfig captures common cases but there are still too many exceptions.
(edit: now incorporating @dmanlfc's suggestion)
Custom .cmd file contents
This PR adds the possibility to let user provide custom raw parameters to pass to libretroMAME in a custom .cmd file.For example, the file
/userdata/roms/apple2/Where in the World is Carmen Sandiego (1985)/Where in the World is Carmen Sandiego (disc 1).dsk.cmd
has the following contents:In this example, when users launches disk 1 from the menu, disk 2 is also loaded in floopy 2. There is no need to pause the game, change game/menu focus, open retroarch/MAME's file manager from the menu to change disks back and forth, close the menu, restore the focus, and then resume the game. (The particular game above is a good example since it requires such a change for each round.)
Other use cases include user provided hard drive image for booting plus a menu-selected CD-ROM image, multiple hard drives with multiple floppy drives, different hardware requirement for different games, etc.
Location of the .cmd file
If provided, this .cmd file needs to reside beside the ROM file, but with an additional .cmd extension. For example, for the floppy disk image:
/userdata/roms/apple2/Where in the World is Carmen Sandiego (1985)/Where in the World is Carmen Sandiego (disc 1).dsk
Batcoera will look for the cmd file at:
/userdata/roms/apple2/Where in the World is Carmen Sandiego (1985)/Where in the World is Carmen Sandiego (disc 1).dsk.cmd