Jump to content

Playstation memory card manager from within Hyperspin?


spoonTRex

Recommended Posts

Posted

Tried doing a search, and either no one's asked this before, or everyone knows to look elsewhere.

So I've currently set up ePSXe, and have been trying it out, and I'm coming to the realization that like the PS2, most PSone games love ONLY using the first memory card. And at a limit of 15 slots per game, that fills up fast. Short of having to load up ePSXe to swap files whenever I need to, I'd much rather have easier access from within Hyperspin (even if it was launching something) so that I can quickly swap cards (preferably multiple cards). Anything like that? Maybe I'm way off on an idea.

OR, is there a way to setup ePSXe or even pSX to automatically create a new memory card per game so that I wouldn't even have to mess with that issue at all or ever again?

Or, if you guys have a great way that you're getting around the issue without having to mess in the "backend" of the system, I'd love to hear it, too.

Thanks heaps!

Posted
Tried doing a search, and either no one's asked this before, or everyone knows to look elsewhere.

So I've currently set up ePSXe, and have been trying it out, and I'm coming to the realization that like the PS2, most PSone games love ONLY using the first memory card. And at a limit of 15 slots per game, that fills up fast. Short of having to load up ePSXe to swap files whenever I need to, I'd much rather have easier access from within Hyperspin (even if it was launching something) so that I can quickly swap cards (preferably multiple cards). Anything like that? Maybe I'm way off on an idea.

OR, is there a way to setup ePSXe or even pSX to automatically create a new memory card per game so that I wouldn't even have to mess with that issue at all or ever again?

Or, if you guys have a great way that you're getting around the issue without having to mess in the "backend" of the system, I'd love to hear it, too.

Thanks heaps!

A couple ideas come to mind. The memory card files are called MCR0001.mcr or something, cant remember exactly off hand. But you can create a copy for every game you have, name it the same as the rom and store them in a MEMORYCARD folder. Then in a hyperlaunch module you can have it copy that file (since it matches the rom name) over to the MCR0001.mcr filebefore the emulator lauches a game.. This way each game would never run out of space to save.

Effectivly the same technique can be used for all systems that function the same way.

Another idea is to have a Wheel that launches the emulator without a game. This is typically how you would access the memory card manager in most systems the real way.

Brian

You must defeat Sheng Long to stand a chance.

Posted
A couple ideas come to mind. The memory card files are called MCR0001.mcr or something, cant remember exactly off hand. But you can create a copy for every game you have, name it the same as the rom and store them in a MEMORYCARD folder. Then in a hyperlaunch module you can have it copy that file (since it matches the rom name) over to the MCR0001.mcr filebefore the emulator lauches a game.. This way each game would never run out of space to save.

Effectivly the same technique can be used for all systems that function the same way.

Another idea is to have a Wheel that launches the emulator without a game. This is typically how you would access the memory card manager in most systems the real way.

Brian

Interesting, so, essentially, I can create new mcr files for each rom, then configure hyperlaunch to rename the mcr files to MCR0001.mcr (or whatever it's called), and then rename it back to ROM_NAME.mcr on exit?

I know hyperlaunch is just a compiled script using AutoHotKey, but every time I seem to run into little things that I want to do that seem outside, I'm just impressed at what a great system and frontend HyperSpin tends to be.

Well, I suppose I'll do some reading up about AutoHotKey on renaming files, and probably post back here if I have any issues with it. :)

Thanks

Posted

This seems to work:

else if (systemName = "Sony Playstation" && executable = "epsxe.exe")
{
hideDesktop()
[color="Red"]FileMove, %EmuPath%memcards\%romName%.mcr, %EmuPath%memcards\epsxe000.mcr[/color]
Hotkey, %exitEmulatorKey%, CloseProcess
Run, %Executable% -nogui -loadiso "%romPath%%romName%%romExtension%", %EmuPath%, UseErrorLevel
Process, WaitClose, %executable%
[color="Red"]FileMove, %EmuPath%memcards\epsxe000.mcr, %EmuPath%memcards\%romName%.mcr[/color]
}

What it doesn't do is ignore the "FileMove" command if there isn't a file there. So, right now, I'd have to manually create a .mcr file for every game, where as, if I could get it to ignore that command, ePSXe should create a epsxe000.mcr when none is found, and the script would rename it to the rom name on exit. (Sames me a bit of time.) Any ideas?

Posted

Ignore that last paragraph (I was having an unrelated issue that I failed to recognize); the code works great! As is, ePSXe creates a new memory card if none is present, then the script changes the file name on exit. Flip-flop back and forth as needed.

So, now, here's a question, that is very related to this concept that I've thrown on myself: Multiple disc games. As far as I'm aware, there's not a good way to swap discs from any front end launcher, and so I've got all the discs for a game right on the wheel. That's fine, I can deal with that (unless someone has a better way).

But this script is creating a new memory card per game, and on multidisc games, that doesn't really work. I need to be able to edit the "romName" atribute to be able to change the filename on a very specific basis. So, a "if %romName% contains '(Disc 2)' or '(Disc 3)' or '(Disc 4)' etc. change to '(Disc 1)'. But I'm not sure how to right that in this part"

FileMove, %EmuPath%memcards\[color="Red"]%romName%[/color].mcr, %EmuPath%memcards\epsxe000.mcr

I mean, can you even create an else if statment inside of an else if?

Posted

I'm going to guess it has to do with redefining %romName% in my Sony Playstation section of the script. I'm just a little boggled at how exactly it's being defined in the first place in order to redefine it. All I see is this section:

if 0 < 2
{
   MsgBox Usage: HyperLaunch.ahk/exe "System Name" [color="Red"]"Rom Name"[/color]
   ExitApp
}

systemName = %1%
[color="Red"]romName = %2%[/color]

That doesn't give me much hope of the script looking into "Rom Name" and being able to read it and replace text within it to do what I'd love it to do. :(

What am I missing here?

Posted

You can do something like:

newromName := RegExReplace(%romName%, "(Disc \d)", "(Disc 1)")

and then use newromName on your code. I'm writting this from the top of my head, I think the regex is correct, you'll have to test it, if it isn't you need to replace \d with the right code. But this is the command you want to do that.

This regex will only work for discs for 1-9, but you don't have any game with more than 9 discs for the PSX anyway :)

You could make it work even in those cases, then the regex should be something like (Disc \d*) I think.

Also I wouldn't create a mcr file per game, that's a lot of work if you have hundreds of games. Just keep a blank mcr file somewhere, and first check if you have a %romName%.mcr if you don't use that empty one instead. This way you don't have to create any cards manually.

Posted

Okay, here's where I put it in my code:

else if (systemName = "Sony Playstation" && executable = "epsxe.exe")
{
   hideDesktop()
[color="Red"]    newromName = RegExReplace(%romName%, "(Disc \d)", "(Disc 1)")[/color]
   FileMove, %EmuPath%memcards\[color="Red"]%newromName%[/color].mcr, %EmuPath%memcards\epsxe000.mcr
   Hotkey, %exitEmulatorKey%, CloseProcess
   Run, %Executable% -nogui -loadiso "%romPath%%romName%%romExtension%", %EmuPath%, UseErrorLevel
   Process, WaitClose, %executable%
   FileMove, %EmuPath%memcards\epsxe000.mcr, %EmuPath%memcards\[color="Red"]%newromName%[/color].mcr
}

brolly, I had to remove the colon in your line newromName := RegExReplace as it was providing an error (no worries). But now, replacing %romName% with %newromName% fails to utilize all ready created .mcr files, and then fails to rename epsxe000.mcr back to %newromName%.mcr on exit.

(Also, I don't have to create new .mcr files by hand, if epsxe000.mcr is missing, ePSXe automatically creates it on start of a game, so the script is creating the new file on exit every time. Not time wasted on my end.)

This is kinda a head scratcher to me, but mainly because I'm so new to this sort of scripting. Please excuse me if I'm trying to get you guys to code for me, because, ultimately, I'd love to understand this myself, and would you guys to even point me the right direction to look at so I can pound out my problem myself. (You know, like instead of saying here's the reference manual, you're instead saying check out this specific section.) :)

Posted

Nevermind, brolly, I apologize. I got the script to move past giving me an error without even trying to understand what the error was. newromName := RegExReplace is most definitely correct, the problem is in the name of the rom when it get's loaded in since it's containing illegal characters (parenthesis, spaces, and/or periods). Am I just stuck there, as I can't control those?

EDIT: Can't control how they're loaded into the script, that is, as I could go though and manually rename my roms, but I'd rather not.

Posted

That's what I was wondering, but anything in quotes apparently is printed as is, which confuses me on this:

   newromName = RegExReplace(%romName%, [color="Red"]"(Disc \d)"[/color], "(Disc 1)")

I don't know even know if that will read a digit or if it would literally read "\d".

I tried putting quotes around %romName% in the line, but that does literally print %romName% into the mcr file. (So ePSXe will create an "epsxe000.mcr" file, and then on exit HyperLaunch will then rename it "%romName%.mcr".)

Posted

Garwil is right, problem there is that the parenthesis are actually symbols used on regular expressions. Like I told I wrote that code without any testing.

Try this instead:

newromName := RegExReplace(%romName%, "\(Disc \d\)", "(Disc 1)")

Posted

Thanks Garwil, and brolly. I'm certain that will fix the problem, just reran it, though, and I get the same issue:

Error: The following variable name contains and illegal character:

"Ape Escape (USA)"

The current thread will exit.

And then it proceeds to write out that exact line. What research I was able to do was pointing to what both of you were saying: spaces and parenthesis are the issue, and when %romName% spits in the name (like "Ape Escape (USA)" in the above example) and then the script has an issue with the characters just brought in in that very name before it can even get to "Disc \d" or "Disc 1".

I'm kinda stuck here, though, as I'm not finding anything I understand to get it to ignore those supposed illegal characters. :(

  • 1 year later...
Posted

Another idea is to have a Wheel that launches the emulator without a game. This is typically how you would access the memory card manager in most systems the real way.

Brian

How do i launch the emulator without a game? I tried to launch an empty "Memory Card Manager.cdi" file for Nulldc, but the result is error "Selected image failed to load". in Nulldc.

Hope there is an intelligent person to help me!

  • 3 months later...
Posted

So if there is a more updated thread to this I apologize for missing it, however using the above code from spoonTRex's original help I have made that idea a possibility

else if (systemName = "Sony Playstation" && executable = "epsxe.exe")
{
hideDesktop()
tempMemRomName = %romName%    
StringReplace, tempRomName, tempMemRomName, %A_SPACE%,,All
Disc = Disc
IfInString, tempRomName, %Disc% 
{
StringTrimRight, tempMemRomName, romName, 7
}
memRomName = %tempMemRomName%
FileMove, %EmuPath%memcards\%memRomName%1.mcr, %EmuPath%memcards\epsxe000.mcr
FileMove, %EmuPath%memcards\%memRomName%2.mcr, %EmuPath%memcards\epsxe001.mcr
Hotkey, %exitEmulatorKey%, CloseProcess
Run, %Executable% -nogui -loadiso "%romPath%%romName%%romExtension%", %EmuPath%, UseErrorLevel
Process, WaitClose, %executable%
FileMove, %EmuPath%memcards\epsxe000.mcr, %EmuPath%memcards\%memRomName%1.mcr
FileMove, %EmuPath%memcards\epsxe001.mcr, %EmuPath%memcards\%memRomName%2.mcr
}

Now to go over some of the changes I have made to make this work. I'm going to dumb this down a bit more then most of you will need but that is for those that do need that extra help as I know I just started looking into AHK a few hours a go to figure this out and I most certainley did.

tempMemRomName = %romName%    

This is to copy the romName to a different variable we can work with because we do not want to trim the actual romName variable on multi-disc games.

StringReplace, tempRomName, tempMemRomName, %A_SPACE%,,All

This... this was the MAIN issue to this whole topic... Honestly the whole illegal character issue still boggles the hell out of me with AHK but what this is doing is taking the tempMemRomName string and replacing all the spaces with nothing (So basically removing them) then assigning the new string as tempRomName

From what I can gather characters in strings such as () - _ and maybe more aren't considered illegal characters for string manipulation (I.E. renaming parts of a string) however spaces are. How this makes sense.... I honestly have NO IDEA but that is how it works.

Disc = Disc

This is assigning my search variable ... Disc which is assigned to the string value "Disc" ... Honestly if there is a way to take this step out that would be great as I think its pointless as hell but in the next line I could only get it to work by actually having a variable and not something I just made up.

IfInString, tempRomName, %Disc% 

This line is searching the string tempRomName to see if it contains the string in Disc. If it does it enters the next gosub brackets. This is the first part to making it not change memory cards on multi-disc games.

{
StringTrimRight, tempMemRomName, romName, 7
}

This is the second part to multi-disc memory card gaming. This removes 7 characters from the end of romName variable. Depending on how you name your files it may be different from 7. I personally name all of my multi-disc games ending in - Disc #. (I.E. Final Fantasy VII - Disc 1.iso) The important thing here is that your disc labeling for multi-disc games is always at the end and is uniformed. I have personally tested this using - Disc # format and (Disc #) format and both have worked. Also note that I took out the % around romName. Once again something I don't know is the importance of the % signs around some variables and not others but I did find out that some commands CAN NOT use them and this is one of them.

memRomName = %tempMemRomName%

Finally we get to assigning the name of the memory card. Now tempMemRomName is a variable that is both assigned right away and also reassigned in an If statement if its a multidisc game. Considering this either way it will now make memRomName be the base name for the game.

FileMove, %EmuPath%memcards\%memRomName%1.mcr, %EmuPath%memcards\epsxe000.mcr
FileMove, %EmuPath%memcards\%memRomName%2.mcr, %EmuPath%memcards\epsxe001.mcr

This code had already been provided and working the only change I made was adding a second line and a 1 and 2 by the %memRomName% . I did this so that each game is using BOTH memory card slots just for consideration that there are some games where 2 players can battle each other, or go against each other (or help each other) but both need their own memory card/save. I doubt I'll ever need 30 blocks for just one game but then again with RPG Maker you never know.

FileMove, %EmuPath%memcards\epsxe000.mcr, %EmuPath%memcards\%memRomName%1.mcr
FileMove, %EmuPath%memcards\epsxe001.mcr, %EmuPath%memcards\%memRomName%2.mcr

Same thing as before just added a second memory card.

Other things I noticed while doing this depending on the game you load ePSXe will creature its default memory cards of epsxe000.mcr and epsxe001.mcr at different stages. The two test games I used for this was 007 Tomorrow Never Dies which creates the memory cards right away and Final Fantasy VII which waits until you are at the New Game/Continue screen. This leads me to believe ePSXe will create memory cards the second the game tries to detect them. Because of that with ePSXe you do not need to have a blank dummy card to copy from if a memory card was not already found and if a game never uses a memory card it will never make one for it.

There is still one potential "hole" in this code as well that I would like to make everyone using it aware of. If your game crashes, computer crashes, or anything happens that ePSXe does not exit back to Hyperspin properly the memory cards will stay named epsxe000.mcr and epsxe001.mcr instead of being renamed back to the name of the game you were playing. If the next time you load up hyperspin you choose to play the SAME GAME as you crashed on and then properly exist ePSXE you will not lose your save files, however if you choose to play a different game it could overwrite the memory cards with the ones for the new game. If there was no memory cards for the new game when you exit it will save the memory cards from the game that crashed to the new game instead. Sorry if that lost or confused anyone but in short if it crashes make sure you load up the SAME GAME and exit properly to not lose your memory cards to accidently overwrites/bad moves. I'm going to look into making a fix for this that I'm hoping is as simple as using FileCopy instead of FileMove but I don't even know if that is a valid command.

Posted

My current setup is as follows...

else if (systemName = "Sony Playstation" && executable = "epsxe.exe")
{
   hideDesktop()
   Run, %Executable% -slowboot -nogui -loadbin "%romPath%%romName%%romExtension%" -loadmemc0 "N:\Saves\Playstation\memcards\%romName%.mcr", %EmuPath%, UseErrorLevel
   Process, WaitClose, %executable%
}

...and it works for everything except the multi-disc games sharing memory cards. I think rather than the filemove operations, it may be better to set...

-loadmemc0 "N:\Saves\Playstation\memcards\%romName%.mcr"

to be

-loadmemc0 "N:\Saves\Playstation\memcards\%StrippedName%.mcr"

and add some script similar to discussed above to strip the disc number out of the rom name, and store it to %StrippedName%

Posted

Hmmm I like how that command works (well from what it looks like I haven't tried it yet) but would that create a new memory card if none were present? or would one still need to be pre-created for the game? If it could look for a card and if no card was found then create one that would be the kind of code that would prevent accidently overwriting a card and losing data. I'll probably mess around with it later if nothing else ^_^ Right now I'm extracting files which will take a few hours... then renaming and such...

  • 1 year later...
  • 2 weeks later...
Posted

I finaly decided to use Mednafen on Retroarch. Better compatibility (maybe, at least descent maximum doesnt have weird bug on it!) and it creates 2 memory cards per game. Excellent!

  • 1 year later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...