MiSTer Extensions

Kernel, Main, Utilities & Applications, Miscellaneous Devices.
User avatar
wizzo
Scripting Wizard
Posts: 183
Joined: Sat Mar 12, 2022 11:32 am
Has thanked: 15 times
Been thanked: 243 times

MiSTer Extensions

Unread post by wizzo »

Extensions and utilities to make your MiSTer even better.

https://github.com/wizzomafizzo/mrext

Make sure to check the linked documentation for each script you use. Most are simple and work out-of-the-box, but some require manual setup before they do anything useful.
rafael
Posts: 13
Joined: Sun May 24, 2020 10:11 pm
Has thanked: 26 times
Been thanked: 5 times

Re: MiSTer Extensions

Unread post by rafael »

Thanks for the hard work!
This is quite handy. Most often than not we are spoiled for options and it can be very difficult to pick something to play. It would be awesome to be able to set filters such as "only pick selected cores" for example.
Neocaron
Top Contributor
Posts: 375
Joined: Sun Sep 27, 2020 10:16 am
Has thanked: 209 times
Been thanked: 87 times

Re: MiSTer Extensions

Unread post by Neocaron »

This and the attract mode are such cool features, especially when you consider how massive the library is. It's great for retro gaming parties with friends, you can just try game truly randomly! Thanks for that!

Remastering Classic Game Cinematics: My new Youtube fun, check it out :D
https://www.youtube.com/@neocaron87

User avatar
wizzo
Scripting Wizard
Posts: 183
Joined: Sat Mar 12, 2022 11:32 am
Has thanked: 15 times
Been thanked: 243 times

Re: MiSTer Extensions

Unread post by wizzo »

Hey thank you for the feedback. Glad you like the idea.

I've decided to go in a bit of a different direction with this one and turn it into something to search for games instead. I've kept the random script in the repo if anyone still wants to try it, though a major downside of it is it won't ever support zip files. I'm going to implement the random launch functionality into this new script though which will support them plus the filtering suggestion.

On first run this creates a database of all your files, which can take a minute or two, but after that it's very fast to search everything. Right now you'll need a keyboard to input text but I was also going to mess around with some ideas for controller input.

It's probably still buggy but you can give it a shot here (the old url redirects here):

https://github.com/wizzomafizzo/MiSTer_Search

And these are some screenshots of it working so far.
searchinput.png
searchinput.png (17.9 KiB) Viewed 21998 times
searchresults.png
searchresults.png (91.84 KiB) Viewed 21998 times
User avatar
mrchrister
Scripting Wizard
Posts: 295
Joined: Tue Mar 30, 2021 6:23 pm
Location: Canada
Has thanked: 32 times
Been thanked: 122 times

Re: MiSTer Extensions

Unread post by mrchrister »

Great stuff wizzo! Love the search feature idea!
Super Attract Mode has a setting in the menu called game roulette, which will let you play random games for a set timer. It also has zip support since it creates game lists on first launch of all files in a directory and uses an unzipper tool called partun (written for MiSTer large zip support) to list all files in a zip.
akeley
Top Contributor
Posts: 1441
Joined: Mon May 25, 2020 7:54 pm
Has thanked: 496 times
Been thanked: 467 times

Re: MiSTer Extensions

Unread post by akeley »

Like both the search/random ideas. Tried the search script, get a "line 8: syntax error near unexpected token..." error.

EDIT: scratch that, it got saved as HTML. Oh, github...

Ok, works fine. Seriously impressive - the indexing is so fast! (of +40k files) And search itself is pretty snappy too. Very neat feature I never knew I needed :) Hope you can do still do something on the random front (with zips) too, I love RNG gaming.

One thing is, it kind of takes a long time on quitting? (after Press any key to continue)

Also, is it possible to run the indexing again? I did mine when my HDD was disconnected..

CRT SCR$ Project - building a collection of high-quality photos of CRT displays
CRT ART Books - retro-gaming books with authentic CRT photos

User avatar
wizzo
Scripting Wizard
Posts: 183
Joined: Sat Mar 12, 2022 11:32 am
Has thanked: 15 times
Been thanked: 243 times

Re: MiSTer Extensions

Unread post by wizzo »

Glad it is working for you!
akeley wrote: Mon Jul 11, 2022 6:11 pm One thing is, it kind of takes a long time on quitting? (after Press any key to continue)

Also, is it possible to run the indexing again? I did mine when my HDD was disconnected..
First one, I am not sure. When that "Press any key" message is displayed the script has already exited and mister is back in control. Does it happen with other scripts or just this one in particular? I don't recall it being particularly slow for me either.

Second one, just delete the "search.db" file in the root of your SD card. It will make a new one when you re-run. In the future I'll add a menu option to regenerate it.
User avatar
wizzo
Scripting Wizard
Posts: 183
Joined: Sat Mar 12, 2022 11:32 am
Has thanked: 15 times
Been thanked: 243 times

Re: MiSTer Extensions

Unread post by wizzo »

I've just put up a new update which I'd appreciate some feedback on. I've made a custom on screen keyboard input for the search. I am keeping it simple on purpose because it's pretty complicated making these custom widgets, but I'm open to some useful suggestions. I will be adding the original regular text input screen as a configurable option for people who normally have a keyboard on hand.
Attachments
2022-07-12_15-54-01.png
2022-07-12_15-54-01.png (23.44 KiB) Viewed 21908 times
Neocaron
Top Contributor
Posts: 375
Joined: Sun Sep 27, 2020 10:16 am
Has thanked: 209 times
Been thanked: 87 times

Re: MiSTer Extensions

Unread post by Neocaron »

A search option like this is massive. Can't try it in the next few day since I'm out of town, but once it's completed this needs to be in main!

Remastering Classic Game Cinematics: My new Youtube fun, check it out :D
https://www.youtube.com/@neocaron87

User avatar
mrchrister
Scripting Wizard
Posts: 295
Joined: Tue Mar 30, 2021 6:23 pm
Location: Canada
Has thanked: 32 times
Been thanked: 122 times

Re: MiSTer Extensions

Unread post by mrchrister »

What do you think about adding the favorites maker to this script? Search for a game and make it a favorite.
BTW, on my setup it says "Found 0 games" but the script seems to work!

Edit:
Spoke too soon, when launching games I get an error:

Code: Select all

Traceback (most recent call last):
  File "/media/fat/Scripts/./search.sh", line 897, in <module>
    display_keyboard_input(db)
  File "/media/fat/Scripts/./search.sh", line 708, in display_keyboard_input
    display_search_results(db, text)
  File "/media/fat/Scripts/./search.sh", line 856, in display_search_results
    launch_game(selected[0], selected[1])
  File "/media/fat/Scripts/./search.sh", line 333, in launch_game
    mgl = create_mgl_file(system_name, path)
  File "/media/fat/Scripts/./search.sh", line 121, in create_mgl_file
    generate_mgl(*to_mgl_args(system, match_system_file(system, path), path))
  File "/media/fat/Scripts/./search.sh", line 110, in to_mgl_args
    match[1],
TypeError: 'NoneType' object is not subscriptable
/media/fat/Scripts#
User avatar
wizzo
Scripting Wizard
Posts: 183
Joined: Sat Mar 12, 2022 11:32 am
Has thanked: 15 times
Been thanked: 243 times

Re: MiSTer Extensions

Unread post by wizzo »

mrchrister wrote: Mon Jul 18, 2022 5:21 pm What do you think about adding the favorites maker to this script? Search for a game and make it a favorite.
I'm definitely doing this.

A little update on this one. I've been working on a compiled version of these 2 scripts. The search one is still in progress but I've just got the random one to a state I'm happy with. You can test it here:

https://github.com/wizzomafizzo/mrext/r ... /random.sh

Same as any other script, just throw it in the Scripts folder and run it from the menu. This one now supports zip files and is a lot "more random" than the old method of traversing directories. There's a couple seconds of delay for giant zip files like snes and c64 packs but in general it's instant.

I've also added 2 arguments to the script: -filter and -ignore. Filter lets you restrict the app to certain directories:

Code: Select all

/media/fat/Scripts/random.sh -filter arcade,psx,snes
Ignore does the opposite:

Code: Select all

/media/fat/Scripts/random.sh -ignore c64,atari7800
Right now if you want to use those from the menu you'd have to create your own bash script. For example create "/media/fat/Scripts/random_psx.sh":

Code: Select all

#!/usr/bin/bash
/media/fat/Scripts/random.sh -filter psx
In the future I'm also considering adding an optional ini file that lets you set default values.
User avatar
wizzo
Scripting Wizard
Posts: 183
Joined: Sat Mar 12, 2022 11:32 am
Has thanked: 15 times
Been thanked: 243 times

Re: MiSTer Extensions

Unread post by wizzo »

I'm hijacking this thread to talk about my new project, since it basically evolved from the search scripts:

https://github.com/wizzomafizzo/mrext

This is MiSTer Extensions. It's a few new scripts I've written plus my old scripts in one place. While I always want the scripts to remain independent of each other, they had a lot of overlapping code I was repeating and it became hard to maintain. Now the new ones have shared code for those parts which is much easier for me to deal with (and no more Python which really sucks to work with in a single 2000 line file). Eventually I also want to rewrite my old stuff, but it's pretty low priority since they seem to work fine as is and are basically stable

What I'd like this to become eventually is a shared library for managing all parts of a MiSTer system. Right now I'm working on expanding support for the number of cores the scripts can interact with and supporting custom cores. It's a bit complex, because each core is a somewhat unique, and I have to come up with a unified way to handle them all. But it's coming together pretty well

Anyway, no cool new stuff to show off sorry! Just wanted to get this out there. Always happy to hear feedback though
User avatar
wizzo
Scripting Wizard
Posts: 183
Joined: Sat Mar 12, 2022 11:32 am
Has thanked: 15 times
Been thanked: 243 times

Re: MiSTer Extensions

Unread post by wizzo »

A couple new bits to show off.

LaunchSync has been up in my repo for a while now but I haven't really "announced" it anywhere. This is a script that uses special "sync" files to generate game playlists in the menu. They use search queries to match games on the target system, so they should be quite portable. They're also subscriptable. You can host your own sync file somewhere, make updates to it, and those updates will show up for everyone else's menu. Potential for some really cool stuff if it catches on.

PlayLog is a service that runs in the background and keeps track of what games and cores you've been playing. It tracks total time played and a history of events. Right now it only shows your top 10 games and cores, but in the future it could generate more complex reports. There's even potential to plug it into services like Discord statuses.
User avatar
wizzo
Scripting Wizard
Posts: 183
Joined: Sat Mar 12, 2022 11:32 am
Has thanked: 15 times
Been thanked: 243 times

Re: MiSTer Extensions

Unread post by wizzo »

Hi forum friends.

Since I made this post I've mostly been working on Remote in the other thread. But I also released these goodies lately:

LastPlayed is a service which dynamically created shortcuts in the MiSTer menu. Right now it can create a "last game played" shortcut which will always point to the last game launched, and a "recently played" folder which lists all the most recently launched games (unlike the official recents menu, which can only list cores and mgls). The first feature is also usable with the bootcore option so you can automatically launch the last played game on boot, which was the original intention of the script.

NFC is a service which lets you use cheap consumer grade USB NFC scanners to launch cores, game and custom commands. It's a pretty new one but I've gotten good feedback on it so far. I've tried to make launching files from it as robust as possible, and it also does cool stuff like launch a randomly selected game from a system. Works with Amiibos too. The intention for this script is to make NFC scanning more accessible. Current solutions are awesome, but most people don't want a soldering project. This is plug and play.

chimaera
Posts: 92
Joined: Sat Aug 01, 2020 10:53 am
Has thanked: 13 times
Been thanked: 17 times

Re: MiSTer Extensions

Unread post by chimaera »

Great work with the NFC script!
Is there a way to send a command to switch ini file via NFC?
It would be great to be able to switch ini with a card if I switch TV.

User avatar
wizzo
Scripting Wizard
Posts: 183
Joined: Sat Mar 12, 2022 11:32 am
Has thanked: 15 times
Been thanked: 243 times

Re: MiSTer Extensions

Unread post by wizzo »

chimaera wrote: Wed Aug 30, 2023 8:21 am

Great work with the NFC script!
Is there a way to send a command to switch ini file via NFC?
It would be great to be able to switch ini with a card if I switch TV.

Sure! Cool idea. I'll include a custom command to do that

User avatar
NML32
Posts: 298
Joined: Sun May 24, 2020 6:57 pm
Has thanked: 301 times
Been thanked: 51 times

Re: MiSTer Extensions

Unread post by NML32 »

wizzo wrote: Wed Aug 30, 2023 8:36 am
chimaera wrote: Wed Aug 30, 2023 8:21 am

Great work with the NFC script!
Is there a way to send a command to switch ini file via NFC?
It would be great to be able to switch ini with a card if I switch TV.

Sure! Cool idea. I'll include a custom command to do that

I'm also enjoying the NFC script. Thank you!!
Would it be possible to run scripts from the NFC Tag?

User avatar
wizzo
Scripting Wizard
Posts: 183
Joined: Sat Mar 12, 2022 11:32 am
Has thanked: 15 times
Been thanked: 243 times

Re: MiSTer Extensions

Unread post by wizzo »

NML32 wrote: Wed Aug 30, 2023 12:38 pm

I'm also enjoying the NFC script. Thank you!!
Would it be possible to run scripts from the NFC Tag?

Glad to hear it :D

You can run system commands with it: https://github.com/wizzomafizzo/mrext/b ... md#command

Perhaps in the future I can add an option to enable those written to cards.

If you mean launch from the scripts menu like that. I could probably reuse the way Remote launches them

User avatar
NML32
Posts: 298
Joined: Sun May 24, 2020 6:57 pm
Has thanked: 301 times
Been thanked: 51 times

Re: MiSTer Extensions

Unread post by NML32 »

wizzo wrote: Wed Aug 30, 2023 12:48 pm
NML32 wrote: Wed Aug 30, 2023 12:38 pm

I'm also enjoying the NFC script. Thank you!!
Would it be possible to run scripts from the NFC Tag?

Glad to hear it :D

You can run system commands with it: https://github.com/wizzomafizzo/mrext/b ... md#command

Perhaps in the future I can add an option to enable those written to cards.

If you mean launch from the scripts menu like that. I could probably reuse the way Remote launches them

Yes, I was wondering if I could launch downloader.sh from a NFC tag.

Thank you.

Lightwave
Posts: 261
Joined: Sun May 24, 2020 10:06 pm
Has thanked: 136 times
Been thanked: 78 times

Re: MiSTer Extensions

Unread post by Lightwave »

wizzo wrote: Sun Aug 13, 2023 12:06 am

NFC is a service which lets you use cheap consumer grade USB NFC scanners to launch cores, game and custom commands.

I'm really interested in jumping into the NFC stuff, I've checked Amazon and Ali Express and it seems there are tons of different vendors selling the ACR122U reader with wildly different prices.

Is any ACR122U as good as another? can I just grab the cheapest one?

User avatar
wizzo
Scripting Wizard
Posts: 183
Joined: Sat Mar 12, 2022 11:32 am
Has thanked: 15 times
Been thanked: 243 times

Re: MiSTer Extensions

Unread post by wizzo »

Lightwave wrote: Thu Aug 31, 2023 7:26 am
wizzo wrote: Sun Aug 13, 2023 12:06 am

NFC is a service which lets you use cheap consumer grade USB NFC scanners to launch cores, game and custom commands.

I'm really interested in jumping into the NFC stuff, I've checked Amazon and Ali Express and it seems there are tons of different vendors selling the ACR122U reader with wildly different prices.

Is any ACR122U as good as another? can I just grab the cheapest one?

My advice at the moment is do not get the cheapest one. There's a certain clone that doesn't work with the script and I have no way to identify the listing if it's a dud or not.

These links I can confirm are legit:
https://www.amazon.com/dp/B07KRKPWYC
https://www.ebay.co.uk/itm/145044206870

You are welcome to give AliExpress a go! But yeah just a warning for now until I can either support the clone or work out how to tell before buying

Lightwave
Posts: 261
Joined: Sun May 24, 2020 10:06 pm
Has thanked: 136 times
Been thanked: 78 times

Re: MiSTer Extensions

Unread post by Lightwave »

wizzo wrote: Thu Aug 31, 2023 7:31 am

You are welcome to give AliExpress a go! But yeah just a warning for now until I can either support the clone or work out how to tell before buying

Ah, I'm in Asia so those US/UK links aren't really good for me. Ali Express would be ideal, but I'd rather not waste my money on an incompatible version, so I think I'll hold off for now until things are clearer as you mentioned.

Thanks for all your work on these scripts! Looking forward to the iOS remote app.

Lightwave
Posts: 261
Joined: Sun May 24, 2020 10:06 pm
Has thanked: 136 times
Been thanked: 78 times

Re: MiSTer Extensions

Unread post by Lightwave »

wizzo wrote: Thu Aug 31, 2023 7:31 am

NFC

Ok, I ended up taking a chance after all because I was excited about this, and I managed to get a reader that works!

I have a question about using the .csv file:
Will having many entries add a noticeable delay to launching games (vs writing the commands directly to NFC)? I'm assuming it needs to load and parse the list each time?

I'm trying to figure out my approach before I add a bunch of cards, and using the csv method seems more flexible to me.

User avatar
wizzo
Scripting Wizard
Posts: 183
Joined: Sat Mar 12, 2022 11:32 am
Has thanked: 15 times
Been thanked: 243 times

Re: MiSTer Extensions

Unread post by wizzo »

Lightwave wrote: Fri Sep 15, 2023 4:50 am
wizzo wrote: Thu Aug 31, 2023 7:31 am

NFC

Ok, I ended up taking a chance after all because I was excited about this, and I managed to get a reader that works!

I have a question about using the .csv file:
Will having many entries add a noticeable delay to launching games (vs writing the commands directly to NFC)? I'm assuming it needs to load and parse the list each time?

I'm trying to figure out my approach before I add a bunch of cards, and using the csv method seems more flexible to me.

It's only loaded when the file is changed for exactly that reason :D I don't think it would ever be slow unless it was insanely big, but I found it was causing screen flickering in the menu. It has a monitor running and will auto reload the CSV each edit

Djiem
Posts: 31
Joined: Tue Apr 05, 2022 5:38 pm
Been thanked: 5 times

Re: MiSTer Extensions

Unread post by Djiem »

wizzo wrote: Wed Aug 30, 2023 8:36 am
chimaera wrote: Wed Aug 30, 2023 8:21 am

Great work with the NFC script!
Is there a way to send a command to switch ini file via NFC?
It would be great to be able to switch ini with a card if I switch TV.

Sure! Cool idea. I'll include a custom command to do that

I have a question regarding the ini switching via NFC. I've been able to load games via the cards, but not switching inis. I made sure to use the latest script, and I made a few NFC cards where I entered the text as described in the github (**ini:1 ) but when I tap them, I get some kind of error beeps and nothing happens.

I don't know if it matters, but I also created a nfc.ini that I put in the Script folder, and I changed "allow_commands" to "yes", but that didn't help. Am I missing something obvious, or perhaps I've used the wrong syntax? I tried to troubleshoot as best I can: I used the same type of cards (even the same card via rewriting) to load the game successfully and switch ini unsuccessfully, I've double-checked the spelling and syntax on the github, I re-ran the nfc script after updating it, just to be sure.

chimaera
Posts: 92
Joined: Sat Aug 01, 2020 10:53 am
Has thanked: 13 times
Been thanked: 17 times

Re: MiSTer Extensions

Unread post by chimaera »

Djiem wrote: Sat Sep 30, 2023 12:34 am

I have a question regarding the ini switching via NFC. I've been able to load games via the cards, but not switching inis. I made sure to use the latest script, and I made a few NFC cards where I entered the text as described in the github (**ini:1 ) but when I tap them, I get some kind of error beeps and nothing happens.

I don't know if it matters, but I also created a nfc.ini that I put in the Script folder, and I changed "allow_commands" to "yes", but that didn't help. Am I missing something obvious, or perhaps I've used the wrong syntax? I tried to troubleshoot as best I can: I used the same type of cards (even the same card via rewriting) to load the game successfully and switch ini unsuccessfully, I've double-checked the spelling and syntax on the github, I re-ran the nfc script after updating it, just to be sure.

Have you updated to the latest nfc.sh?
Try download it and replace it in the Scripts folder if it doesn't automatically download.

Code: Select all

#TAGNR#,,**ini:1

worked for me without further configuration, but i use the nfc.csv to define each nfc tag action.
To get the tagnumber, run the nfc.sh script and scan an empty tag and you will get the nr.
Don't forget to restart the nfc.sh service if you add stuff to nfc.cvs.

Djiem
Posts: 31
Joined: Tue Apr 05, 2022 5:38 pm
Been thanked: 5 times

Re: MiSTer Extensions

Unread post by Djiem »

Unfortunately, nothing worked, even though I'm using the latest nfc.sh and restarted the service after updating. I was able to load a random SNES game, so commands do work and I believe I'm using the right syntax. With that said, I see the script is still being worked on, and that a script from sigboe is being created to have some sort of GUI. I'm gonna wait a bit and work around with those and see if they help; maybe I am doing something wrong.

chimaera
Posts: 92
Joined: Sat Aug 01, 2020 10:53 am
Has thanked: 13 times
Been thanked: 17 times

Re: MiSTer Extensions

Unread post by chimaera »

Djiem wrote: Tue Oct 03, 2023 3:59 am

Unfortunately, nothing worked, even though I'm using the latest nfc.sh and restarted the service after updating. I was able to load a random SNES game, so commands do work and I believe I'm using the right syntax. With that said, I see the script is still being worked on, and that a script from sigboe is being created to have some sort of GUI. I'm gonna wait a bit and work around with those and see if they help; maybe I am doing something wrong.

Maybe it is your NFC tag that is unsupported?
You can check tag version with the android app recommended on the github and see if it is supported.

Djiem
Posts: 31
Joined: Tue Apr 05, 2022 5:38 pm
Been thanked: 5 times

Re: MiSTer Extensions

Unread post by Djiem »

chimaera wrote: Tue Oct 03, 2023 5:06 pm
Djiem wrote: Tue Oct 03, 2023 3:59 am

Unfortunately, nothing worked, even though I'm using the latest nfc.sh and restarted the service after updating. I was able to load a random SNES game, so commands do work and I believe I'm using the right syntax. With that said, I see the script is still being worked on, and that a script from sigboe is being created to have some sort of GUI. I'm gonna wait a bit and work around with those and see if they help; maybe I am doing something wrong.

Maybe it is your NFC tag that is unsupported?
You can check tag version with the android app recommended on the github and see if it is supported.

It should be supported normally; I used the very same tag (not just a tag of the same type, literally the same tag) to load a specific NES game, and even to use the command to load a random SNES game, both before and after failing to use it for ini changes. It only gives me an error beep when I try to change ini files.

Lightwave
Posts: 261
Joined: Sun May 24, 2020 10:06 pm
Has thanked: 136 times
Been thanked: 78 times

Re: MiSTer Extensions

Unread post by Lightwave »

Djiem wrote: Wed Oct 04, 2023 1:49 am

It only gives me an error beep when I try to change ini files.

Are your ini files named using the original convention (MiSTer.ini, MiSTer_alt_1.ini, MiSTer_alt_2.ini, etc.)?

Or are you using the newer naming that allows arbitrary labels (MiSTer_CRT.ini, MiSTer_HDMI.ini, etc.)?

Post Reply