Can't get MGL files to work

Kernel, Main, Utilities & Applications, Miscellaneous Devices.
justaguy
Posts: 45
Joined: Thu Jun 18, 2020 5:23 pm
Has thanked: 3 times
Been thanked: 20 times

Can't get MGL files to work

Unread post by justaguy »

I saw that the 20220224 Main update added support for MGL files, which per the changelog are like MRAs but for (almost) any core. I can't seem to get this feature to work on my fully up-to-date (ran update_all just today) MiSTer. My MGL file looks like this, modified from the example that Sorgelig provided on Patreon:

Code: Select all

<mistergamedescription>
	<rbf>snes</rbf>
	<!--
		delay: amount of seconds to wait before load/mount
		type:  f - loading, s - mounting
		index: index :)
		path:  path to file relative to core's home folder
	    
		All parameters must be present
		
		Note: some cores popup OSD menu on start. To prevent it to popup increase delay parameter. 
		Usually 2 seconds is enough.
	-->
	<file delay="2" type="f" index="0" path="test.sfc"/>
</mistergamedescription>
test.sfc is located in /media/fat/games/SNES (it's actually Super Mario World, if that matters). I can select and run the MGL from the MiSTer menu, but there's only a brief flash and nothing else happens. Has anyone had any luck getting this feature to work?
Fallon
Posts: 111
Joined: Mon May 25, 2020 1:48 am
Has thanked: 52 times
Been thanked: 22 times

Re: Can't get MGL files to work

Unread post by Fallon »

For Genesis, this works for me:

<mistergamedescription>
<rbf>_console/genesis</rbf>
<file delay="2" type="f" index="0" path="../../games/Genesis/Sonic the Hedgehog 2.md"/>
</mistergamedescription>
onaryc
Posts: 15
Joined: Sun May 24, 2020 7:11 pm
Has thanked: 4 times
Been thanked: 1 time

Re: Can't get MGL files to work

Unread post by onaryc »

i think you have to put <rbf>_console/snes</rbf>
justaguy
Posts: 45
Joined: Thu Jun 18, 2020 5:23 pm
Has thanked: 3 times
Been thanked: 20 times

Re: Can't get MGL files to work

Unread post by justaguy »

Thanks for the quick responses, adding the _console path prefix did the trick. Unfortunately it doesn't seem to work with the bootcore setting in MiSTer.ini, so you can't use it to boot the MiSTer directly into a game (you can do this with cores that support loading boot#.rom at startup, but SRAM saves and save states don't work). It's still a great feature that I'll be using a lot.
edr
Posts: 122
Joined: Mon Jan 04, 2021 3:35 am
Has thanked: 37 times
Been thanked: 29 times

Re: Can't get MGL files to work

Unread post by edr »

This mgl feature is a very nice improvement on the way to the graphical single-click carousel launcher with floating animated holographic box covers.

Only wish mras would launch when run outside of their default arcade location. If that worked, I would mix mra's and mgl's into a single favorites games dir for quick launch of current things I want to play, and move all cores to a cores dir, for ex.

Code: Select all

_Cores
    _Arcade
    _Consoles
    ...
_Games
    Donkey Kong.mra
    Ghouls'n Ghosts.mgl
(of course would require running scripts, which I'm already doing, before updates and after updates to undo and redo the new structure so that the downloader (updater) doesn't re-download all the stuff each update run).

An example mgl that works for me (I reorg my games in subdirs like Adventure, Platform etc, and I rename my cores for ex `Super NES`):

Code: Select all

<mistergamedescription>
	<rbf>_Console/Super NES</rbf>
	<!--
		delay: amount of seconds to wait before load/mount
		type:  f - loading, s - mounting
		index: index :)
		path:  path to file relative to core's home folder
	    
		All parameters must be present
		
		Note: some cores popup OSD menu on start. To prevent it to popup increase delay parameter. 
		Usually 2 seconds is enough.
	-->
	<file delay="2" type="f" index="0" path="Adventure/Ghouls'n Ghosts.sfc"/>
</mistergamedescription>
Note that `path` does not need to be a full path like `../../../something`. It's relative to the core's default game path.
Kopert
Posts: 7
Joined: Sun Oct 03, 2021 4:51 pm
Been thanked: 6 times

Re: Can't get MGL files to work

Unread post by Kopert »

edr wrote: Fri Feb 25, 2022 4:34 pm Only wish mras would launch when run outside of their default arcade location. If that worked, I would mix mra's and mgl's into a single favorites games dir for quick launch of current things I want to play, and move all cores to a cores dir, for ex.
I think I figured out a workaround for this. I linked an .mra into my _Favorites folder and it didn't work, complained that there was no .rbf file. Then I just linked the _Arcade/cores folder into my _Favorites folder and it worked just fine. The cores folder does not show up on the menu when navigating the Favorites. Maybe give that a try, see if it works for your use case?
edr
Posts: 122
Joined: Mon Jan 04, 2021 3:35 am
Has thanked: 37 times
Been thanked: 29 times

Re: Can't get MGL files to work

Unread post by edr »

@Kopert brilliant. Think I'd considered it but didn't want `cores` to show up in the menu and wasn't sure symlinks even work on an exfat system. It all works and it's great. Is it still MiSTer if it's easy and fast to launch games without having to care what core something is using?

Something like this structure works fine -

Code: Select all

# ls -al /media/fat/_Games/
...
lrwxr-xr-x  1 root root   24 Feb 25 12:20  cores -> /media/fat/_Arcade/cores
-rwxr-xr-x  1 root root 4.0K Nov 12 08:52 "Ghosts'n Goblins.mra"
-rwxr-xr-x  1 root root  499 Feb 25 08:20 "Ghouls'n Ghosts.mgl"
(btw tried using an mgl to launch a psx .cue, didn't work for me. Maybe mgl support for PSX .cue will come later. PSX core loaded, but went to the bios, did not load the cue.)
Kopert
Posts: 7
Joined: Sun Oct 03, 2021 4:51 pm
Been thanked: 6 times

Re: Can't get MGL files to work

Unread post by Kopert »

Keep in mind you can also link the MRA instead of copying it. Might save space, and if it gets updated, so does the linked version, of course.

But yeah, it's working great like this. I'm happy with the functionality, as I've missed having favorites before.
onaryc
Posts: 15
Joined: Sun May 24, 2020 7:11 pm
Has thanked: 4 times
Been thanked: 1 time

Re: Can't get MGL files to work

Unread post by onaryc »

has someone find a way to use mgl files with zip files? (with just one file in a zip file or a complete zipped pack like htgdb)
Kopert
Posts: 7
Joined: Sun Oct 03, 2021 4:51 pm
Been thanked: 6 times

Re: Can't get MGL files to work

Unread post by Kopert »

You mean, having the mgl point to a rom inside a zip file?
If so, I had no issue with

Code: Select all

<file delay="2" type="f" index="0" path="usa-world.zip/Rock N' Roll Racing (USA).sfc"/>
It found the zip in the /media/fat/games/snes folder just fine.
onaryc
Posts: 15
Joined: Sun May 24, 2020 7:11 pm
Has thanked: 4 times
Been thanked: 1 time

Re: Can't get MGL files to work

Unread post by onaryc »

haaa, i did not think to put the zip extension, thank you so much :)
Lightwave
Posts: 261
Joined: Sun May 24, 2020 10:06 pm
Has thanked: 136 times
Been thanked: 78 times

Re: Can't get MGL files to work

Unread post by Lightwave »

edr wrote: Fri Feb 25, 2022 8:30 pm (btw tried using an mgl to launch a psx .cue, didn't work for me. Maybe mgl support for PSX .cue will come later. PSX core loaded, but went to the bios, did not load the cue.)
Did you try type="s" index="1"?
onaryc
Posts: 15
Joined: Sun May 24, 2020 7:11 pm
Has thanked: 4 times
Been thanked: 1 time

Re: Can't get MGL files to work

Unread post by onaryc »

for now, i have successfully made mgl file for snes, psx, mega cd and pc engine/turbografx16, but not for pcengine-cd :

Code: Select all

<mistergamedescription>
	<rbf>_Console/TurboGrafx16</rbf>
	<file delay="1" type="s" index="3" path="Shmup/Gate of Thunder (Japan)/Gate of Thunder (J).chd"/>
</mistergamedescription>
I've tried index 0, 1, 2, 3 and 4. From my understanding, it shall be superior or equal to 2, but no luck so far.
Flandango
Core Developer
Posts: 459
Joined: Wed May 26, 2021 9:35 pm
Has thanked: 59 times
Been thanked: 383 times

Re: Can't get MGL files to work

Unread post by Flandango »

onaryc wrote: Sat Feb 26, 2022 7:29 pm for now, i have successfully made mgl file for snes, psx, mega cd and pc engine/turbografx16, but not for pcengine-cd :

Code: Select all

<mistergamedescription>
	<rbf>_Console/TurboGrafx16</rbf>
	<file delay="1" type="s" index="3" path="Shmup/Gate of Thunder (Japan)/Gate of Thunder (J).chd"/>
</mistergamedescription>
I've tried index 0, 1, 2, 3 and 4. From my understanding, it shall be superior or equal to 2, but no luck so far.
The index value for CD ISO/CHD for the core is 0.
Is the CHD stored on the SD card or external USB?
onaryc
Posts: 15
Joined: Sun May 24, 2020 7:11 pm
Has thanked: 4 times
Been thanked: 1 time

Re: Can't get MGL files to work

Unread post by onaryc »

How do you know the index is 0 for this core? My theory was that it was the osd menu index.

The chd is stored in my sd card.
Flandango
Core Developer
Posts: 459
Joined: Wed May 26, 2021 9:35 pm
Has thanked: 59 times
Been thanked: 383 times

Re: Can't get MGL files to work

Unread post by Flandango »

The best way to tell the Index # is to look at the code for the core. To be exact, you look at the top level SV file for the particular core where the configuration string is defined.
For example, if you go the repo for the TurboGraphics core and look at the file TurboGrafx16.sv, look for a section that starts with "parameter CONF_STR". Then in that section look for the particular item you are loading/mounting. In this case it will be this string :

Code: Select all

"S0,CUECHD,Insert CD;",
Notice the S0, that is the "s" type with index of 0.
User avatar
dfilskov
Posts: 34
Joined: Sun May 24, 2020 9:35 pm
Has thanked: 26 times
Been thanked: 9 times
Contact:

Re: Can't get MGL files to work

Unread post by dfilskov »

What about C64 or Amiga?

Have you had any MGL files work for computer core games at ALL?

I cannot make MGLs work for computer cores ... ONLY for console cores.
onaryc
Posts: 15
Joined: Sun May 24, 2020 7:11 pm
Has thanked: 4 times
Been thanked: 1 time

Re: Can't get MGL files to work

Unread post by onaryc »

ok thanks, checking the code make more sense now :

Code: Select all

"FS0,PCEBIN,Load TurboGrafx;",
When selecting "f" for loading a rom file, the index is 0.

Code: Select all

"S0,CUECHD,Insert CD;",
When selecting "s" for mounting a cue/chd file, the index is also 0.

I was confused the index for psx was 1 (although it is the first entry in the menu) but in the code :

Code: Select all

"S1,CUECHD,Load CD;",
My mgl file is still not working but i know the index is 0 now :)
onaryc
Posts: 15
Joined: Sun May 24, 2020 7:11 pm
Has thanked: 4 times
Been thanked: 1 time

Re: Can't get MGL files to work

Unread post by onaryc »

ok, i manage to get it working by moving the chd file and the cd bios in the TGFX16 folder, seems like a bug
User avatar
dfilskov
Posts: 34
Joined: Sun May 24, 2020 9:35 pm
Has thanked: 26 times
Been thanked: 9 times
Contact:

Re: Can't get MGL files to work

Unread post by dfilskov »

onaryc wrote: Sun Feb 27, 2022 10:44 am ok, i manage to get it working by moving the chd file and the cd bios in the TGFX16 folder, seems like a bug
Great! Which path did you move the chd and cd bios from ... and to?
User avatar
dfilskov
Posts: 34
Joined: Sun May 24, 2020 9:35 pm
Has thanked: 26 times
Been thanked: 9 times
Contact:

Re: Can't get MGL files to work

Unread post by dfilskov »

I got Sorgelig's / Alexey's MGL file for C64 and it has these parameters:

<mistergamedescription>
<rbf>c64</rbf>
<file delay="1" type="f" index="1" path="scramble.prg"/>
</mistergamedescription>

... but it doesn't work for me.
Flandango
Core Developer
Posts: 459
Joined: Wed May 26, 2021 9:35 pm
Has thanked: 59 times
Been thanked: 383 times

Re: Can't get MGL files to work

Unread post by Flandango »

MGL is still a new implementation and is really not ideal for the average user and there are things that may still need to be ironed out or worked around.
For example, the TG16 normally looks for CD images in a games folder named TGFX16-CD, but MGL looks under the core's name as specified in the <rbf> field so you either have to move the file into the core's games folder or you could specify the path to it in the MGL file. For example if both the TurboGrafx16 and the TGFX16-CD reside on your SD card under the games folder, simply add ../TGFX16-CD/ in front of the path to the rom/image.
User avatar
dfilskov
Posts: 34
Joined: Sun May 24, 2020 9:35 pm
Has thanked: 26 times
Been thanked: 9 times
Contact:

Re: Can't get MGL files to work

Unread post by dfilskov »

Flandango wrote: Sun Feb 27, 2022 1:07 pm MGL is still a new implementation and is really not ideal for the average user and there are things that may still need to be ironed out or worked around.
For example, the TG16 normally looks for CD images in a games folder named TGFX16-CD, but MGL looks under the core's name as specified in the <rbf> field so you either have to move the file into the core's games folder or you could specify the path to it in the MGL file. For example if both the TurboGrafx16 and the TGFX16-CD reside on your SD card under the games folder, simply add ../TGFX16-CD/ in front of the path to the rom/image.
"MGL looks under the core's name as specified in the <rbf> field" - more precisely: It looks for a folder with the core's name inside /games/ (or /Games/) :)
.
User avatar
dfilskov
Posts: 34
Joined: Sun May 24, 2020 9:35 pm
Has thanked: 26 times
Been thanked: 9 times
Contact:

Re: Can't get MGL files to work

Unread post by dfilskov »

SOLVED!

I needed to delete a file called C64.f7 inside /config/ to make my MGL files for C64 work - go figure :)
User avatar
keith.f.kelly
Posts: 90
Joined: Sun May 24, 2020 11:10 pm
Location: Sammamish, WA, USA
Has thanked: 3 times
Been thanked: 8 times
Contact:

Re: Can't get MGL files to work

Unread post by keith.f.kelly »

MGL files seem like one step closer to a nice way to list and launch individual PC games directly from the OSD with the ao486 core. If the MGL could tell the ao486 core which virtual drives/cds/floppies to mount at which positions, then each game could go onto its own bootable VHD/floppy/CD (with its own AUTOEXEC.BAT and CONFIG.SYS files), with another/shared VHD holding the rest of the OS files (DOS or Windows, along with any TSRs/drivers) so they need not be duplicated for every game, and with any corresponding required game CD mounted as well. That way we wouldn't need to use a DOS-based or Windows-based game launcher, and we could easily give each game its own dedicated set of DOS configuration, and we could rely on the core completely resetting to initial state every time the user switches games. Is anyone thinking about extending the MGL format to support that kind of usage scenario?
User avatar
LamerDeluxe
Top Contributor
Posts: 1239
Joined: Sun May 24, 2020 10:25 pm
Has thanked: 887 times
Been thanked: 284 times

Re: Can't get MGL files to work

Unread post by LamerDeluxe »

keith.f.kelly wrote: Thu Mar 03, 2022 3:59 am MGL files seem like one step closer to a nice way to list and launch individual PC games directly from the OSD with the ao486 core. If the MGL could tell the ao486 core which virtual drives/cds/floppies to mount at which positions, then each game could go onto its own bootable VHD/floppy/CD (with its own AUTOEXEC.BAT and CONFIG.SYS files), with another/shared VHD holding the rest of the OS files (DOS or Windows, along with any TSRs/drivers) so they need not be duplicated for every game, and with any corresponding required game CD mounted as well. That way we wouldn't need to use a DOS-based or Windows-based game launcher, and we could easily give each game its own dedicated set of DOS configuration, and we could rely on the core completely resetting to initial state every time the user switches games. Is anyone thinking about extending the MGL format to support that kind of usage scenario?
Similarly with VIC-20 cartridges, you could define which cartridge memory blocks to activate and which ROMs to load into them (16KB ones are split between ROM files). With VIC-20 games for expanded memory, you could define the correct expansion memory blocks to activate.

With the game selection menu of the The C64, The VIC-20 and C64 Mini systems they use save state snapshots of games (from the Vice emulator). The advantage is that those contain the mounted media and can optionally start straight at the main menu.
84mattcarter@gmail.com
Posts: 1
Joined: Fri Mar 04, 2022 4:50 pm

Re: Can't get MGL files to work

Unread post by 84mattcarter@gmail.com »

edr wrote: Fri Feb 25, 2022 8:30 pm @Kopert brilliant. Think I'd considered it but didn't want `cores` to show up in the menu and wasn't sure symlinks even work on an exfat system. It all works and it's great. Is it still MiSTer if it's easy and fast to launch games without having to care what core something is using?

Something like this structure works fine -

Code: Select all

# ls -al /media/fat/_Games/
...
lrwxr-xr-x  1 root root   24 Feb 25 12:20  cores -> /media/fat/_Arcade/cores
-rwxr-xr-x  1 root root 4.0K Nov 12 08:52 "Ghosts'n Goblins.mra"
-rwxr-xr-x  1 root root  499 Feb 25 08:20 "Ghouls'n Ghosts.mgl"
Hi there, I'm new to the MiSTer and have been using is for a couple weeks, so please excuse my inexperience. I was wondering if someone can expand upon how to get the arcade .mgl files to work properly? I've successfully set up most all other cores .mgl files, but am getting stuck on the arcade cores .mgl files to load.

Also, has anyone got the GB/GBC .mgl files boot to game? I can boot the to the core but the game will not load. I've tried all the different type and index combinations but game will still not load. Thanks!
RegalCutlass
Posts: 6
Joined: Tue May 11, 2021 1:28 am
Has thanked: 2 times
Been thanked: 2 times

Re: Can't get MGL files to work

Unread post by RegalCutlass »

I don't think MGL files support arcade games. MiSTer already has MRA files for that, which serve the same function but have way more metadata about how to load the ROM.

I haven't tried loading GB or GBC games yet but I'll give it a shot tomorrow and report back.
AmintaMister
Posts: 313
Joined: Thu Sep 16, 2021 10:54 pm
Has thanked: 840 times
Been thanked: 51 times

Re: Can't get MGL files to work

Unread post by AmintaMister »

Hi all!

What about mounting a C64 disk ".D64"?

In the C64.csv files I've found:

Code: Select all

"H7S0,D64G64T64D81,Mount #8;",
"H0S1,D64G64T64D81,Mount #9;",
AmintaMister
Posts: 313
Joined: Thu Sep 16, 2021 10:54 pm
Has thanked: 840 times
Been thanked: 51 times

Re: Can't get MGL files to work

Unread post by AmintaMister »

Ok, I've figured out:

Code: Select all

<mistergamedescription>
	<rbf>_Computer/C64</rbf>
	<file delay="1" type="s" index="0" path="playing/time_of_silence_1.0.d64"/>
</mistergamedescription>
Problem is that games like "Time of silence" need the normal rom and not the Dolphin one, how can I set this in <mistergamedescription>?
Post Reply