Jump to content
LaunchBox Community Forums

jayjay

Members
  • Posts

    385
  • Joined

  • Last visited

Posts posted by jayjay

  1. Yeah its in the image. As I said its ugly. I was writing a save state manager type app for LB and pcsx2 saves the states using the blusXXXXX code. I never did finish it or clean up the code but it works.

            private string Get_Id_PCSX2(string romPath)
            {
                string id = string.Empty;
    
                if (romPath.ToLower().EndsWith(".iso") || romPath.ToLower().EndsWith(".bin"))
                {
                    byte[] bytes = Get_Bytes(romPath, 0, 1000000);
                    string s = GetIdFromString_PCSX2(Encoding.ASCII.GetString(bytes));
    
                    if (!string.IsNullOrEmpty(Check_Id(s.Replace("-", ""))))
                    {
                        return s;
                    }
                }
                else
                {
                    return string.Empty;
                }
    
                return id;
            }
    
            private byte[] Get_Bytes(string path, int origin, int length)
            {
                byte[] data = new byte[length];
                using (BinaryReader reader = new BinaryReader(new FileStream(path, FileMode.Open)))
                {
                    reader.BaseStream.Seek(origin, SeekOrigin.Begin);
                    reader.Read(data, 0, length);
                }
    
                return data;
            }
    
            private string GetIdFromString_PCSX2(string data)
            {
                string id = string.Empty;
    
                if (data.Contains("SCUS-")) //NTSC-U
                {
                    int length = data.IndexOf("SCUS-");
                    id = data.Substring(length, 10);
                }
                else if (data.Contains("SCUS_")) //NTSC-U, contains underscore and period
                {
                    int length = data.IndexOf("SCUS_");
                    id = CleanPS2(data.Substring(length, 11));
                }
                else if (data.Contains("SLUS-")) //NTSC-U
                {
                    int length = data.IndexOf("SLUS-");
                    id = data.Substring(length, 10);
                }
                else if (data.Contains("SLUS_")) //NTSC-U, contains underscore and period
                {
                    int length = data.IndexOf("SLUS_");
                    id = CleanPS2(data.Substring(length, 11));
                }
                else if (data.Contains("SLES-")) //PAL
                {
                    int length = data.IndexOf("SCES-");
                    id = CleanPS2(data.Substring(length, 10));
                }
                else if (data.Contains("SLES_")) //PAL, contains underscore and period
                {
                    int length = data.IndexOf("SLES_");
                    id = CleanPS2(data.Substring(length, 11));
                }
                else if (data.Contains("SCED-")) //PAL
                {
                    int length = data.IndexOf("SCED-");
                    id = data.Substring(length, 10);
                }
                else if (data.Contains("SCED_")) //PAL
                {
                    int length = data.IndexOf("SCED_");
                    id = CleanPS2(data.Substring(length, 11));
                }
                else if (data.Contains("SCES-")) //PAL
                {
                    int length = data.IndexOf("SCES-");
                    id = data.Substring(length, 10);
                }
                else if (data.Contains("SCES_")) //PAL, contains underscore and period
                {
                    int length = data.IndexOf("SCES_");
                    id = CleanPS2(data.Substring(length, 11));
                }
                else if (data.Contains("SLPM-")) //NTSC-J
                {
                    int length = data.IndexOf("SLPM-");
                    id = data.Substring(length, 10);
                }
                else if (data.Contains("SLPM_")) //NTSC-J, contains underscore and period
                {
                    int length = data.IndexOf("SLPM_");
                    id = CleanPS2(data.Substring(length, 11));
                }
                else if (data.Contains("SLPS-")) //NTSC-J
                {
                    int length = data.IndexOf("SLPS-");
                    id = data.Substring(length, 10);
                }
                else if (data.Contains("SLPS_")) ////NTSC-J, contains underscore and period
                {
                    int length = data.IndexOf("SLPS_");
                    id = CleanPS2(data.Substring(length, 11));
                }
                else if (data.Contains("PBPX-"))
                {
                    int length = data.IndexOf("PBPX-");
                    id = data.Substring(length, 10);
                }
                else if (data.Contains("PBPX_"))
                {
                    int length = data.IndexOf("PBPX_");
                    id = CleanPS2(data.Substring(length, 11));
                }
                else if (data.Contains("PCPX-")) //NTSC-J
                {
                    int length = data.IndexOf("PCPX-");
                    id = data.Substring(length, 10);
                }
                else if (data.Contains("PCPX_")) //NTSC-J, contains underscore and period
                {
                    int length = data.IndexOf("PCPX_");
                    id = CleanPS2(data.Substring(length, 11));
                }
                else if (data.Contains("SCAJ-")) //NTSC-J
                {
                    int length = data.IndexOf("SCAJ-");
                    id = data.Substring(length, 10);
                }
                else if (data.Contains("SCAJ_")) //NTSC-J, contains underscore and period
                {
                    int length = data.IndexOf("SCAJ_");
                    id = CleanPS2(data.Substring(length, 11));
                }
                else if (data.Contains("SCKA-")) //NTSC-K
                {
                    int length = data.IndexOf("SCKA-");
                    id = data.Substring(length, 10);
                }
                else if (data.Contains("SCKA_")) //NTSC-K , contains underscore and period
                {
                    int length = data.IndexOf("SCKA_");
                    id = CleanPS2(data.Substring(length, 11));
                }
    
                if (id.Length == 11)
                {
                    id = id.Remove(8, 1);
                }
    
                return id;
            }
    
            private string CleanPS2(string s)
            {
                StringBuilder sb = new StringBuilder(s);
    
                sb.Replace(" ", "");
                sb.Replace("_", "-");
                sb.Replace(".", "");
    
                return sb.ToString();
            }
    
            private string Check_Id(string id)
            {
                foreach (char c in id)
                {
                    if (!char.IsUpper(c) && !char.IsNumber(c))
                    {
                        return string.Empty;
                    }
                }
    
                return id;
            }

     

  2. Cant help with .chd or any other format other than iso or bin. I have some ugly c# code to get the SLUSXXXXX code from bin or iso. I assumed if your using them on PS2, your roms might be iso, I know nothing about PS2 homebrew. Anyway if you want the code I can post it. 

  3. We cant add plugins to the pause menu. Unlike the game menu and system menu, we don't have an interface for pause menu. It'd be good to get a "PauseMenuItem" and also a "PauseThemeElement". But the problem is, not many people would use it. Jason and/or C-Beats would spend considerable time implementing it knowing its not gonna get much use. Which is a shame but understandable. 

    At this moment in time its not possible to cycle through your save states in the pause menu.

  4. 35 minutes ago, oslnx said:

    Snip

    You could use LB's API or ahk script/additional apps options to implement it yourself. Maybe even share your code with the community to help out those who can't do it. 

  5. Iv updated this plugin, I haven't much time to test so it will need some proper testing.

    Focus On Game Exit.zip

    Download it.

    Right click, properties, unblock.

    Extract the folder to Launchbox/Plugins.

    It has the original focus plugin built in but now has the option to override the original plugin on a per game basis. The focus being on games that uses launcher exe's.

     

    Right click on a game and select "Focus On Game Exit".

     

    Option 1 - Replace:

    Theoretically this should work with shut down screens. But don't hold me to it.

    Untitled.thumb.png.7149639de2988385a9e797202d2d22b0.png

    Exe1 - this needs to be the 1st .exe the game uses.

    Wait - this is the amount of time, in seconds, to wait between... when the 1st exe closes and the 2nd exe launches. Its a delay to give the 2nd exe time to "properly open".

    Exe2 - this needs to be the secondary exe.

    Make sure Exe1 and Exe2 are spelt exactly the same as the games exe's. Including upper and lower case letters.

    IMPORTANT NOTE: this method comes with a major downside. The way this option works is by replacing the  games  launcher exe with an autohotkey script. This means that this option isnt compatible with portable LB setups. It also means that at any point, if you delete this plugin's directory you cannot restore the games original exe path... this path:

    220184699_Editwindow.thumb.png.630b28f7797648d8cc978464b5b921f3.png

    If you want to remove this plugin but you have added a "Replace" script. Enable the "Focus On Game Exit" badge:

    Untitled2.thumb.png.fe264229baf05fa988f1ecd71a992be2.png

    This will make it easy to track down games that uses this plugin.

    Right click on the game and select "Focus On Game Exit" and press the delete button to restore the "Default Path".

    The default path... this:

    Untitled.thumb.png.770731c0455a6f872ea779a5c7807b94.png

    The ONLY time you need to change this path is if you move the associated game files. Otherwise dont change it at all.

    If using this option, you do so at your own risk. 

     

    Option 2 - Window;

    Wont work with shutdown screens.

    Untitled3.thumb.png.7dd2d919e24e24c3738ff4b331707f60.png

    Window 1: this is the games launcher window title.

    Wait. How many seconds to wait before the 2nd window opens. This is also a timeout (which may need more work). If the 2nd window doesn't open for whatever reason the timeout will elapse and should close the script.

    Window 2: the games secondary window title.

    Both window options need to be spelt exactly the same as the games window titles.

    This hasnt been tested a great deal.

     

    Option 3 - EXE:

    Wont work with shutdown screens.

    This option is the same as option 1 but it will not replace the games path in LB.

    The "wait" option, like option 2 is also a time out.

     

    To recap:

    Option 1 modifies LB data, use at your own risk.

    Options 2 and 3, does not modify LB data.

     

    Options 2 and 3, the ahk scripts could prob use some work. Can find the scripts in the plugin directory. If anyone has any suggestions for the scripts then let me know.

    Consider this a beta, I would suggest not adding the override scripts to a load of games til it has been properly tested.

    • Thanks 1
  6. 13 hours ago, nohero said:

    @jayjay

    it happens ( not always ) when exit game BB doesn't respond and I need to click on mouse button.

    Do you know how to fix it?

    Sometimes when launching from a .exe, that .exe will then launch another .exe at which point LB will assume the game has quit and the plugin will launch the ahk while the game is still running. 

    If that's not the case I'm not entirely sure why it isn't working correctly. Activating windows to bring them to the front can be a bit finicky at times.

    What game isn't working correctly? Is it a steam or gog game or what? 

  7. @narnz Iv updated the OP. Turns out the manual method is actually just "another method". I imported persona using the original method without problems so not sure why you couldn't. Anyway I would suggest deleting the "Launchbox/Plugins/PS3BBTrophy" folder. Delete the "Launchbox/Images/Sony Playstation 3 Trophies" folder and import everything again using the new plugin. Let me know how you get on.

    • Like 1
  8. I made a pos plugin some time a go. It was called missing media tool. I was going to improve upon it but never did complete it. I couldnt find any search api's that didnt require an api key or didnt charge for going over a quota... but anyway I started the design:

    Untitled.thumb.png.0930f06791ebf6709c796dfe53bc4adb.png

    At first I used a winforms webbrowser but its outdated, could get images from google search but couldnt really do much else with it. Then I tried cefsharps chromium, it works well but I dont know if its safe to browse the net with it, dont know what the security is like. Also the biggest problem was adverts, no ublock origin meant im not using it.

    What I was going to do instead... where you see the black space in the image above, I was going to make that space transparent so to be able to click the mouse through it. Place my browser (chrome or firefox or whatever) in that black space. It would look something like this:

    Untitled2.thumb.png.a231458fce1e9daca12b1fc5f6560d6d.png

    Using this method I wouldnt have to worry about updating the webbrowser, I could play on the net etc etc, keep Ublock goodness and click back and forth between the plugin and chrome. Where you see the "Search" button, all it would do is copy your search term to clipboard, then you would right click your browsers address bar and paste the search term. When you found an image just copy the images link to clipboard and in the plugin window press the "Get" button to grab the link from clipboard and use webclient to download the image straight into Launchbox directory.

    Im just not finding the time to continue coding the things I start so I doubt this will be completed. The point of this post was to give my suggestion on a way to achieve this without relying on api's. If anyone wants to attempt my suggestion it's pretty simple to create a search string for google:

    Say I wanted to do a meta data search for "Nintendo Entertainment System Super Mario 3 Publisher" your string would look like: 

    https://www.google.com/search?q=Nintendo+Entertainment+System+Super+Mario+3+Publisher

    Or if you want to do an image search:

    https://www.google.com/search?q=Nintendo+Entertainment+System+Super+Mario+3+Front+Cover&tbm=isch&site=imghp

    You can also use the same method for bing and youtube... 

    • Like 1
  9. Hey guys. I dont have this problem but you could try the following...

    In LB, go to tools, Manage Emulators.

    Select Cemu and open the "Running AutoHotkey Script" tab.

    Copy and paste the following into the running ahk script tab

    SetTitleMatchMode, 2
    
    loop 20
    {
    	Sleep 500
    
    	if WinExist("Cemu")
    	{
    		Sleep 1000
    		WinActivate
    		break
    	}
    }

     If you already have some code in the running ahk script tab,  place this^ code at the top above anything else. 

    Just to explain a little what is going on with this code.

    "Loop 20"... the code within the squirrely brackets will loop 20 times.

    "Sleep 500"... wait half a second between each loop.... these 2 commands combined is essentially a timeout of 10 seconds. 

    "if WinExist"... If a windows titlebar contains the word "Cemu" then "WinActivate", bring that window to the front.

     

  10. I updated this plugin some time ago. As @slipsystem hasnt been on for over a year I thought Id share it.

    Slipsystems Movie Scrapper.zip

    Extract the "Slipsystems Movie Scraper" folder to Launchbox/Plugins.

    All credit goes to slipsystem. If you get some use from this plugin consider donating some cash to slipsystem here: https://www.paypal.com/paypalme/slipsystem

     

    Source: FanartTv.zip

    Update notes:

    Updated targeting framework.

    Added security protocol to Json class.

    Removed reference to Unbroken.dll :(  

    • Thanks 1
×
×
  • Create New...