Jump to content

Support for game IPS patches in Raine


mer-curious

Recommended Posts

Hello Tux and ffman1985! I saw the discussion in the other thread about the recently added support for IPS patches in Raine and thought it would be better to split the discussion into a separate thread since there the focus is on ffman's cheats distribution, and the IPS discussion may become too long.

After ffman shared the IPS file to remove the flash effect in K.O.F '96 and '97 I went and tried to find which other IPS patches people would have created and shared out there in the internet, and there's actually a lot of them. I link below some good IPS collections which I found for different arcade systems. Here they are:

https://www.youtube.com/watch?v=JewKnkptZe8

This collection (link in the video description) is focused in Neo Geo games. Many patches are in Chinese with Chinese comments, so I could only understand what they did by copying and pasting the comment into a translator. Perhaps it's good to test this in Raine to see if the program can display the Chinese characters and comments correctly.

Emu France's and Taoenwen's collection for FBNeo:

https://github.com/taoenwen/FBNeo_IPS

http://www.emu-france.com/emulateurs/6-arcades/89-final-burn/3794-ips-collection-v4-3-4-4-test/

Both these packs are targeted to FBNeo but should work with Raine too I suppose. They lack some of the patches present in the "Chinese pack", at least for K.O.F '97 (didn't test other games yet). To test Taoenwen's collection you need to download the complete master code in Git Hub.

I tried to insert ffman "no flash effect" in FBNeo's IPS folder for both K.O.F '96 and '97 and the program didn't identify the files to patch the ROMs, so it's possible that some patches work and some don't depending on the emulators' IPS managers.

If you check the video linked above you'll see how the patches work in FBNeo. You have to select the patches in the IPS Manager and then tick "Apply Patches" in order that the patches work. The IPS files selected are remembered after closing the program, but you always need to tick "Apply Patches" again every time you load the ROM so the IPS files take effect, which I don't think is very user friendly.

For the patches that are applied before the ROM is loaded, I was thinking if Raine could show a message like "The game ROM needs to be reloaded for some patches to take effect. Reload / Cancel", and then the user would confirm or not reloading the game to see if or how the patches work.

Finally, what do you think about renaming the option to "Game IPS patches" to keep the parallelism with the previous options?

Anyway, I'm so glad you could add this feature to Raine to complement the cheats function already available in the program. I'm looking forward to test it as soon as you are happy with the stage of operation of this new feature.

Thank you so much for your work.

Link to comment
Share on other sites

Yeah well for now I am not sure I'll add the patching for sprites. The big difference with the patches is that they can't be patched on the fly, you have to patch the rom before it's decoded, which is a lot trickier.

There are already a few interesting patches in the github repo, I liked the patch to update the kf2k5uni clone, too bad it doesn't detail what the changes are exactly (I added kf2k5uni because of that, it has a bug with sound when using the 32 bits version and there is a memory leak somewhere, but it works). I'll check the bugs later eventually, but this patch patches only the rom, and it's quite good.

Yeah most of the arcade bootlegs come from Korea and China apparently, these people are crazy hackers for roms, that's why the ips files come from there.
Most of the stuff doesn't look very interesting though, sadly all the bootleg are not interesting too, far from that.

The idea was to have a simple way to try an ips file without having to deal with the bad crc warning if you patch the rom directly. That's done for the code part at least, I'll see if I push this further or not, for now I take a break !

 

  • Like 1
Link to comment
Share on other sites

After a longer look, it's lacking more descriptions for sure ! It's in the spirit of bootlegs where sometimes you really wonder what the difference is... !

Found a few oddities like the sailormn ips which make the game crazily harder, oh well....

the kf2k5uni which does an update without telling what is in the update and it's not obvious... !

Except that a ton where I couldn't tell what the difference is actually !

I'd say for now it's not motivating at all to add more support for that, I'll try to have a look at the video though...

Edited by Tux
  • Like 1
Link to comment
Share on other sites

Ok after a good break I finally decided to add some support for these dat out of curiosity (curiosity works well on me usually !).

So it's some basic support, it works by preloading the dat file, a new command appears in the main menu when no game is loaded : preload ips dat file, it gives a file selector where you must choose the .dat file you want. Normally you should return to the main menu without message after that, you can load the real rom now.

If the patches apply without error, you won't get any message, and then you can play normally.

In my tests I found some dat files reference a rom file that I don't have, specifically for kof97 in the github repository
kof97ae_20180212.dat
and kof97ae_20200810.dat
both reference a very big 232-v3.v3 rom. We have this rom, but not so big, our size is $400000 when they try to access it as far as $f00000, which created a very nice rom crash here. So I added some tests for the maximum size allowed, for now it just displays a message on the console and tries to patch what it can as long as it's not over limit.

I have tested pacman (in Misc), it changes everything, but is not very interesting, I prefer the original version !
and puzzle bubble 3, there are changes alright, but it seems to force you in a duel against the computer (there is some kind of cheat in the menu of the game which selects the right choice before you can move !). Anyway at least it shows it works.

The previous command to load an ips file is still here for the cases where you have just an ips file, it still has the same rules, applies only to the rom code on the fly.
These dat files apply the ips files referenced at a super low level, just after the rom has been loaded but before any decoding could take place.

I didn't try to put a super interface for that, because I didn't find a really interesting dat file yet. Maybe later, I am far from having tested everything, but I am at saturation now... ! So it doesn't try to extract any description from the dat file, you'll have to select your dat file yourself !

 

Edited by Tux
  • Like 1
Link to comment
Share on other sites

The most broken dat file found so far is for double dragon, doubledrsp_20220717.dat

its 1st ips references the code rom beyond its size, thanks to the new size limit for avoiding the crash
and then the 2 following ips files in the dat file don't even have the same name as on disk, so they can't be found !

It's almost a shame to add some support for something which can be so broken... !

So don't worry if you have problems with all that, it was worth an experiment, but probably not worth loosing too much time on it.

At least the code to add support for that is short, there won't be any problem with that !

Edited by Tux
  • Like 1
Link to comment
Share on other sites

Hello Tux! Thank you so much for your efforts and time put into having this feature working similarly to FBNeo. There are some patches that greatly improve the options available in the original game, in a similar fashion ffman is doing with his cheat files.

For example, I have five patches applied to KOF97, which give me a practice mode, an option to turn off the flash effect, an option to select the boss stages in versus matches, no time counter in character select screen and finally a random/roulette icon with all secret characters in character select screen. You can see them all here with screenshots if you would like to test them:

https://imgur.com/a/oe6ok4z

FBNeo generates an *.ini file in config -> ips with the ROM name and there we have all the patches currently selected for that game. In my very case, it is a kof97.ini file and inside we have:

// FinalBurn Neo v1.0.0.03 --- IPS Config File for kof97 (The King of Fighters '97 (NGM-2320))

2-Stage.dat
8r-hcsjh2n.dat
97lx.dat
k1-TimePS.dat
k4-flash.dat

Perhaps you are already using that, or if not, this could be a good way to remember our selection to possibly share it with others and move it to a new installation if it's the case.

These patches are all from the "Chinese pack" which was linked in the video description I posted in my first post. Interestingly there are many patches in this pack that claim to do the same thing but actually don't work here, so we have to set and test many of them to see which ones work or not. I still have to test the other packs to see if they have some good features too (to my taste, I mean).

Anyway, apparently this seems all already possible in Raine, right?

Thank you so much again for your recent work. 😊👍

 

Edit: after testing a little longer I found that the roulette patch obliges me to reselect my team before every match, which is not fine to me. So I removed this patch and added the following:

3-hchr2ps.dat

This one shows all the secret characters in the character select screen including the final boss portrait in the middle and it won't oblige me to reselect the team before every match. You can see a screenshot here:

https://imgur.com/a/o3GOu7U

Edited by mer-curious
Link to comment
Share on other sites

Well you are lucky to be able to use these patches simultaneously, these are not simple plugins, these are patches, I mean if 2 patches you use happen to patch the same area, it's boum !

For now I didn't add any support to have more than 1 dat file at a time, but it shouldn't be too hard to do.

Yeah the git repo is definitely low quality, it's not a super idea to put this in git to begin with because ips are binary files and even if git allows to put binary files, it shines for ascii files, here it looks like a waste of space.

For your broken roulette patch, if I have to guess I'd say it was 8r-hcsjh2n.dat, replaced by 3-hchr2ps.dat... (names similar !).
I'll try to add the possibility to make combinations of dat files later then.

  • Like 1
Link to comment
Share on other sites

It is always no guarantee that different ips can use together, especially the big hack. It is because it requires to add a very long instructions put into the rom. Most likely, hacker put these instructions at the end part of the rom file. To modify this, it requires some knowledge on 68k programming, and find out the jump instruction which jump to the long part of instructions. So, you can copy and paste the long instructions to other address and change the jump instruction accordingly.

  • Like 1
Link to comment
Share on other sites

It will take longer than anticipated because I must start by adding a gui widget and it's been a long time since I did it for the last time, a little rusted here.

By the way I even found a french dat file : 2-plus06.dat, it should be relatively understandable in english even without google ?
They say this modification is major, contrary to most of the others which are very targeted, it probably explains why you can use many at the same time without problem, still lucky though, it means they don't use the trick of adding a jump and moving the code at the end of the rom, otherwise all the code of all the patches would happily overwrite each other at the end of the rom... !

Still crazy, but indeed this time there are more valuable approaches there.

  • Like 1
Link to comment
Share on other sites

Ok it's pushed to git, I used the collection you posted as a test, good thing because there was 1 of the dat file containing garbage utf8 characters at the start which needed to be filtered out...

Apparently it works now. The file selector which appears when choosing "preload ips dat files" now allows to select multiple files in a game directory (and it can't leave the ips directory), when you leave the game directory or close the file selector the corresponding config is saved in the ini file in the ips directory. This ini file is read when a game is loaded with a corresponding name. That's all there is to it, quite simple to sum up, but full of small annoyances when coding it.

There is a hard limit of 20 ips files at max, the prog will complain if you try to go over that, but you would really want to push the limit to do it, your collection uses 11 ips files, and that's already quite something, and there is still some margin here !

Congratulations for finding this combination by the way, it's right that kof97 is much better with this !

I should improve the way it looks by displaying some description and maybe the picture while browsing the dat files, but I keep that for later... !

Edited by Tux
  • Like 1
Link to comment
Share on other sites

And now I have the info in text and picture in the status bar at the bottom of the screen, this part was easy.

Now it would be cool to add some code to check if there are conflicts between the selected ips, but I'll keep that for tomorrow... !

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...