RFC: rework mess support for mame/lr-mame#15667
Conversation
|
@bryanforbes was going to look at this for v44. Bryan, thoughts on the approach? |
|
I’ll review it sometime this weekend |
don't hesitate to ping me if you have any question about the implementation |
|
Why use lua? Why not just python as per configgen? Id prefer that if possible. |
|
iirc this is what MAME uses. lua is mainly their own scripting system. |
lua is the internal language of mame for mame autoboot scripts, I have verify they are no python support inside mame. |
|
i'm aware of that but configgen is python and if the configuration can be done in python, that is the preference ideally... |
no, you can't really do same work outside mame with basic sent autoload command like we currently do in v42. For example fast cassette loading. for example : send command "LOAD ...", play tape, speed tape motor to max speed until load it's finished, restore motor speed normal, sent command "RUN" This is really a basic example, they are more complex loader with parsing the cassette header to find the correct command to launch, parse disk content ,etc.. depending of each systems, it need really fine tuning. |
|
Main configgen must remain python, but MAME is using its own lua scripting langage. I've done something similar here to enable offscreen reload helper (newly introduced): https://github.com/batocera-linux/batocera.linux/blob/master/package/batocera/emulators/mame/009-offscreenreload-autoconfig.patch I didn't check the current PR, I'm just throwing what I know about MAME. On first look, it seems bloated. |
sure, the main configgen in in the python code, this is only the autoloading script that are in lua. Now, all the differents systems options are all defined in the json + the autoloading part in lua. (with big improvements like reading cassette headers or list diskette catalog find correct command to launch) and they are no duplicate code between mame && libretro mame anymore. (where it was missing sometimes some feature on 1 side or the other) |
This is a rework for old computers support in mame (mess). The new code is using lua autoboot scripts to load floppy && cass (with fast cass loading when possible). I have used https://github.com/dsync89/mess-curated-autoboot-scripts as base, but I have reworked a lot of scripts and write new one to handle auto-loading based on cassette headers or floppy disk structure, without relying of specific rom name. The lua code is shared between mame && lr-mame, so it's remove a lot of spaghetti code in both generator. It's re-introduce a fake "mess" core, to cleary split code between softlist (mess) && arcade/rom (mame), and avoid the need to rely on system.name. (And also allow user to add new custom systems, compute or arcade, without need to hack the generatorsà In mess mode, by default, a sha1 of the rom is done to compare to mame xml files, to detect the correct softlist and configure the machine && media. A new messSoftlistMap.json has been added, with all existing mess softlists and best compatible machine && media. It's possible to define custom options for each softmap in the json too. (We could also add a new "MESS" system if needed, to allow user to put all obscures system games inside, it should work automatically if autodetected) If no auto detection is found, it's search the default mapping from the system name. For this, A new messSystems.json is introduce to replace messSystems.csv, with mapping based on rom extension to a mess softlist.
|
Just have done a push . I have refactored the lua scripts to move zip parsing code to a common function |
This is a rework for old computers support in mame (mess).
The new code is using lua autoboot scripts to load floppy && cass (with fast cass loading when possible).
I have used https://github.com/dsync89/mess-curated-autoboot-scripts as base, but I have reworked a lot of scripts and write new one to handle auto-loading based on cassette headers or floppy disk structure, without relying of specific rom name.
The lua code is shared between mame && lr-mame, so it's remove a lot of spaghetti code in both generator.
It's re-introduce a fake "mess" core, to cleary split code between softlist (mess) && arcade/rom (mame), and avoid the need to rely on system.name.
(And also allow user to add new custom systems, compute or arcade, without need to hack the generatorsà
In mess mode, by default, a sha1 of the rom is done to compare to mame xml files, to detect the correct softlist and configure the machine && media. A new messSoftlistMap.json has been added, with all existing mess softlists and best compatible machine && media. It's possible to define custom options for each softmap in the json too.
(We could also add a new "MESS" system if needed, to allow user to put all obscures system games inside, it should work automatically if autodetected)
If no auto detection is found, it's search the default mapping from the system name. For this, A new messSystems.json is introduce to replace messSystems.csv, with mapping based on rom extension to a mess softlist.
I have tried to test all existing softlist (also for systems not existing in batocera), it should be pretty complete, but maybe I have missed something, so please review carefully.