Mr. Encyclopedia wrote: ↑Fri Mar 04, 2022 8:01 pmLooking at the github page it looks like mrchrisster and others are looking into MGL file support in SAM, I might just take a look myself and see if I can make my own variation of it.
Yup, I'm currently looking into this. I spent dozens of hours adding whitelist support and improving how SAM handles zip files. I was just about to add zip support to MiSTer Batch Control so SAM wouldn't have to extract ROMs to load them when I heard about MGL. If I'd had MGLs a couple of months back I would've gotten all of that functionality for free!
The main issue I've run into is that MGLs stop working if you have a USB plugged in with a game folder for the core you're trying to load. E.g. If you try to load an NES game and /media/usb0/games/NES/ exists, the MGL will fail regardless of whether it's pointing to a game on the SD card or the USB drive. So until that bug is fixed, if you use USB and you're interested in having SAM load MGL files, you should make sure to put your USB games in a non-standard folder.
I have my own SAM fork [here](https://github.com/InquisitiveCoder/MiSTer_SAM) which I use to test out my code before I open pull requests to mrchrisster's repo. I'm was planning on making a branch that's MGL-only, when it's ready I'll post here again so you can try it out if you want.
hipsofjw wrote: ↑Sun Jan 30, 2022 8:09 am
Has anyone been able to successfully use this in offline mode? Here's what happens whenever I try and run it following the instructions on the github either from the MiSTer menu or from SSH:
- /media/fat/Scripts/MiSTer_SAM_on.sh
- autoboot menu
- enable autoboot
- SAM required files not found.
- Surprised? Check your INI.
- Proceeds to try and download stuff from Github (which it can't since it's blocked in my country)
- Times out
- Any key to escape
I've tried over and over again to get this running but it just won't operate in offline mode since it has to connect to github to even start. I don't really understand the "Surprised? Check your INI." I don't see anything in the ini file about running autoboot or offline mode.
Has anyone successfully used this in offline mode yet?
hipsofjw wrote: ↑Sat Mar 05, 2022 6:48 am
Has anyone successfully used this in offline mode yet?
Was playing around with SAM today, and it looks like there are two files in my .MiSTer_SAM folder that are not included in that directory on the github:
patrun
mbc
When running for the first time, it re-populates those files though I'm not sure if they're self generated or being pulled from somewhere. Other than that I see no reason why it shouldn't be able to work offline. Do you have everything in the .MiSTer_SAM folder downloaded and in the right directory, or did you just pull down the MiSTer_SAM_On script?
Unrelated, but I seem to have broken my MiSTer SAM so that auto-start no longer works. I've got it enabled form the setup menu and have a 1 minute timeout set. But I can sit on the main menu for ten minutes and nothing happens. Manually starting works fine, but after a reboot (soft or cold) it always just stays at the menu and never launches. No clue what changed from when it was working before to now, and I even tried a clean reinstall. Not the end of the world, but a bit of a bummer.
@Sigismond0 Every time you install a Linux update, you have to re-enable it for startup in the config menu (because the setting it changes is in the Linux blob that gets wiped out on update).
- Update SAM by running MiSTer_SAM_on.sh and wait until the timer goes to zero.
You should now be on the MGL version of SAM. Please report any issues you find.
Current status:
- Included PSX core in this build
- Custom directory isn't working (due to the nature of how mgl files work atm)
- No more problems loading games for Neogeo and GBA core
- I tested Everdrive zip packs and unpacked archives. I haven't tested individually zipped roms yet.
Giving it a quick test, and it's looking neat so far. Not cycling through the menus looks so much nicer, and makes it faster too.
Issues:
NeoGeo fails for me. Just get a black screen when it selects the core. I have .neo format in a couple of big zip files, so that might be why-even just browsing can be slow. Tried unzipping and it still fails. Both file structures worked with the non-MGL version of SAM. If I manually load a NeoGeo game through the menu it works. Then if SAM shuffles another one up next, it launches but corrputed.
TGFX16-CD fails. The core opens and sits on a bootrom I have, but he SAM game doesn't load. Note that these are loading from USB0 instead of FAT, and I have made that change in the ini. This core worked yesterday with the same settings. If I remove the bootrom, I just get a black screen. If I load a CD manually it works. If SAM shuffles to the next game after one has successfully loaded this way, it dumps into the CD player screen of the BIOS.
At first PSX failed to launch for me because A) I had PSX core in _Unstable folder (which I suspect a lot of people do right now) and B) the psxpath line is case sensitive which caused a file not found error. Dropped the .rbf into _console and fixed my case in the .ini and it got past that. Now it finds games and loads the core, but just sits in the BIOS menu instead of launching the game. Again, loading CD manually works. If SAM shuffles after a manual load, nothing changes. If SAM shuffles after a manual load, it just gets stuck in BIOS again.
MegaCD also fails, just boots into the bios which never advance. On previous SAM version, it would autoboot out of the BIOS into the game. Manually loading works as expected. If SAM shuffles after a manual load, it just gets stuck in BIOS again.
NOTE: The three CD cores noted here are all loading from USB0, and the games paths are correct in the .ini. TGFX16-CD and MegaCD both work on the non-MGL build. NeoGeo is running from SD.
Trying to start from SSH with something like "MiSTer_SAM_on.sh megacd" shows in the terminal that it's only selected that core. But when running, it still shuffles all cores. Trying to run with "psx" or "tgfx16-cd" it says the parameter is invalid.
TTY2OLED is still broken in this version.
Edit: Striking through the ones related to USB storage, as I now see custom directories currently don't work. Theoretically, a path like ../../USB0/games/PSX/whatever/whatever.chd should be able to be worked into the MGL right? The current ini/script is expecting an absolute path, but the MGL requires a relative one. Could that just be provided on another line?
Odd that NeoGeo is supposed to be better in this version, but seems to be completely broken for me despite working just fine on older releases.
Thanks for testing! Just changed the logic to use absolute paths. Can you give this a try?
Direct core selection through command line is broken currently, please use ini.
I've only tried NeoGeo with unzipped roms. If you keep zipped and unzipped roms in the same dir, SAM will look which you have more of and use that, so your unpacked roms were most likely ignored. With the new version, you could define a custom path for Neo Geo and see if unpacked .neo files work.
I have two fully populated NeoGeo folders. One with zips, one with loose files in folders. When I want to test with zips, I just rename the loose folder to "games/NeoGeoLoose". When I want to test loose folders, I name the zipped folder "games/NeoGeoZip". And whatever is "active" is just "games/NeoGeo". Neither the loose or zipped ROMs are working on this new build. Sometimes I get a black screen, sometimes random flashing colors. I reverted back to the main SAM branch, and both folder types worked fine.
TGFX16-CD appears to be working off of USB0 with the latest build!
MegaCD and PSX running off of the same USB0 both still stick at BIOS without launching the game.
I can now successfully use the corenames from terminal, helpful for troubleshooting!
TTY2OLED support still not working (I know you didn't mention its fix here, but just wanted to make sure there's visibility. It broke after greyscale support was added to TTY2OLED. There are fixed MiSTer_SAM_ON.sh files floating around, so it's fixable.)
The fact that tgfx16-cd works for you means it's probably related to the type setting in mgl. AFAIK, type can be either "f" or "s". I only had "s" set for tgfx16cd, all other cores using f. I'm using an unstable test build of MiSTer main so maybe some of the settings like index and type work different in the newest build. Looking at the mgl documentation on the wiki, it says Neo Geo requires an index of 1. I had it set to 0 because it worked fine but again, this might be related to my main build.
I just updated the code ... Can you test once more if NeoGeo, MegaCD and PSX work now?
BTW, I told Mellified about ttyoled since he implemented it. Maybe he'll find some time to work on it. Otherwise if you find a working version of MiSTer_SAM_on.sh, let me know and I'll update the code.
SAM script that works with current TTY: viewtopic.php?f=9&t=1887&start=780#p43043. There's another one lower down that does random effects between the core logo and game.
Just updated, and get the following on stable main:
NeoGeo now works! (And with zips!)
MegaCD now works!
PSX still sticks in BIOS. Looking at the Github, PSX should be type S index 1, don't know if that's the culprit. Might also just be a file delay? I'll see if I can make a working MGL for it and let you know.
Didn't test with the other cores that were working previously, just assuming nothing broke there.
Thank you for all the awesome work here. Glad to be part of the process.
That must be it. I had index set to 0 for PSX, just updated the code to index="1". Thanks for posting your mgl file, that's helpful! I also used the ttyoled code you linked to, hopefully that makes it work now!
TTY2OLED looks good. PSX works! Will enable all cores and let it shuffle for a while and see how it goes.
Edit: Ran into an odd scenario where it looks like attempted to load the entire SuperGrafX zip file as a ROM. On the TTY, it even said "3 SuperGrafx" as the game name. When I browse through for files, I can navigate the zip normally and select a game. Seems like SAM just put the ZIP name into the MGL.
Ok, glad this is working now!
Interesting issue with SuperGrafX...SAM filters the rom collection for a specific file extension, in this case ".pce" ending. If it doesn't find any files with that ending, inside the zip, it just tries to play the zip file I guess...
Just to confirm, so you have a zip file with only SuperGrafX files (.sgx) in the TGFX16 folder?
Yeah, my directory looks something like this. SuperGrafx folder has all SGX ROMs.
Screenshot 2022-03-11 120533.png (10.43 KiB) Viewed 6806 times
Just saw a case where it shuffled into a GBA game, then never shuffled away even long after the timer was up. I think this might have coincided with my BT controller timeout, so maybe it read that as an input. Will do some more testing to see if that's consistent. Even though the .ini says it can't listen for BT controllers, when I run from terminal I can see it flagging input from BT as an interrupt. Has this changed from how it used to work?
Some BT controllers might work if they write to /dev/input/js. Maybe this is something that changed with Mister's codebase recently, not sure... I don't have any BT controllers so I can't test myself unfortunately. Please let me know what you find out.
Yeah, don't think it was related to that. Shuffled again with 2 minute switchover time. Ran for a while, saw loads of games from various cores, and then eventually it hit MechWarrior on SNES and just stayed on it indefinitely. Will try launching from terminal to see if it gives any better insight.
Edit: Ran "MiSTer_SAM_ON.sh monitor" on a terminal. It shows MechWarrior as the second most recent game it attempted to load. It says "Mister Arcade: UniWar S" launched after, but then nothing else has happened for like ten minutes. MechWarrior was the 12th item shuffled on this run. Was able to issue a SKIP and it loaded a Genisis game and then ummediately dropped into UniWar. After 120s, it said LodeRunner was launching in the terminal, but nothing happened on the MiSTer and there was no longer a countdown timer in the terminal. Soft rebooted, SAM restarted at Lode Runner, and I have the countdown timer again in terminal. After 120s, it successfully shuffled to a new game.
I can confirm that at least on my controller and my BT adapter, pushing a button does cause the terminal to immediately say "Monitoring new joystick" as soon as a hit a button. This was not happening when it "froze" as described above.
Monitor log attached if it's useful to you.
Second edit: After the log I have attached ends, it played two or three more games, then did the same thing. Monitor says it switched games, but does not put a countdown timer up. MiSTer never actually changes. Seems to happen pretty consistently if just left running for a while. I issued SKIP, it jumped to a NeoGeo game (that isn't in the monitor window), then the arcade game that was last in the monitor loaded after like three seconds. Countdown started back up.
Additionally, after I picked up my controller and pushed some buttons, the monitor thread existed. Looks like it did successfully interrupt the script like USB controllers do.
Triple Edit: OK, so seeing a pattern. Three times in a row it "froze" when it said it was about to load an arcade game. The game never loaded, and SAM's countdown never started back up. Might be something messed up with the arcade logic? Every time this happens, I can issue a skip, it will show whatever game SKIP sent it to, then after a few seconds it goes back to the arcade game that failed to load previously. If I go back into MONITOR, the countdown has restarted.
Final edit: Five times in a row. Definitely happening every time it tries to launch Arcade.
Just kidding one more edit: If I launch it with the ARCADE flag, or just set only arcade in the ini, it tries to run but never launches a game at all. Skipping while only arcade is enabled does not cause a core to load.
Thanks for the analysis. I can not reproduce your problem unfortunately. You are using the latest main build correct? Are you using update-all for your Arcade stuff?
Giving it a quick try at the moment, didn't seem to change games with my DS4 wired, it does now with it connected by Bluetooth, I need to test that a bit more.
Arcade works, TGFX-16 worked with the first game, black screen on the second one now, I need to look into that as well. SNES is also working, Genesis/Megadrive, NES, GBA, TGFX-16 CD and Mega CD as well.
Great job with testing @Sigismond0!
I found a bug: Starting single core mode from the SAM menu pops up a 'no rbf found' error message.
mrchrister wrote: ↑Fri Mar 11, 2022 9:25 pm
Thanks for the analysis. I can not reproduce your problem unfortunately. You are using the latest main build correct? Are you using update-all for your Arcade stuff?
Yep. Ran update all just a few minutes ago to get the System16 stuff. That should have main updated as well. Just to be safe, I reverted to the main channel, and it fails in the same way. So I deleted and re-downladed all MiSTerSAM files, and it worked again on the main branch. Updated to test again, and it still seems to work. Something must have just gotten messed up somewhere along the line with all the testing.
Ran for a while on just TGFX16 core with 15 second timer, never got the black screen of death when it tried to load the SGFX zip, so that looks fixed.
As far as I can tell everything is working correctly on the test branch at this time! Thanks for the awesome work.
LamerDeluxe wrote: ↑Fri Mar 11, 2022 11:08 pm
I found a bug: Starting single core mode from the SAM menu pops up a 'no rbf found' error message.
Did you by chance try starting PSX this way, while it's in the _Unstable folder? I found the same thing, but that's because SAM is looking for it in _consoles. I can successfully start in single core mode from terminal.
LamerDeluxe wrote: ↑Fri Mar 11, 2022 11:08 pm
I found a bug: Starting single core mode from the SAM menu pops up a 'no rbf found' error message.
Did you by chance try starting PSX this way, while it's in the _Unstable folder? I found the same thing, but that's because SAM is looking for it in _consoles. I can successfully start in single core mode from terminal.
No, I don't have an unstable folder and PSX isn't in SAM's menu yet.
Looks like we're close to merging test branch with main.
@LamerDeluxe PSX is integrated with this version of SAM. I guess not having PSX installed will throw the error then. Got to do more testing on Monday when I'm back at the office.
Whatever that arcade failing to load issue is, it started happening again.
After the full SAM reset, I set it to shuffle just arcade cores and ran for like 15 minutes no problem. Set all cores back up in the ini, rebooted, ran for a while, and then as soon as it hit the arcade core again it froze. After it happened the first time, it happens every time it tries to shuffle to arcade. I'll try resetting SAM again tomorrow. I expect it to start working again after the reset, then fail.
The only thing I noticed that may be a pattern is that both times it froze for the first time after a reset, I believe it was an arcade core right after a GBA game. Probably just coincidence, but something for me to keep an eye out for tomorrow.
In my experience repeatedly jumping from core to core introduces instabilities, which is why I usually reset the MiSTer and go back to the menu core when I change games. I wouldn't be surprised if this is part of the problem, especially with arcade cores that haven't been updated to the latest framework over the years.