Hatsune Miku Project DIVA F + F 2nd 60 FPS Patches
Started by Brolijah




4 posts in this topic
Brolijah
Member


0
2 posts 1 threads Joined: Aug 2017
08-31-2017, 03:26 AM -
#1
Hello RPCS3 Community,
Recently, I dived into the executables for Project DIVA F and F 2nd to see if I could remove the 30 FPS frame limit. It didn't take too long to find. Combined with the time I spent learning my way around IDA Pro, I think I only burned ~30 hours into it all.

If you have no other patches, you can save the file in the directory of your emulator as "patch.yml"
AS A FULL DISCLAIMER: This 60 FPS patch IS NOT PERFECT. 2D animations (menu stuff, mainly) and the Results screen 3D animations still run at double speed. This patch is released AS-IS since the PV animations play correctly, and that's what we mostly care about, right? That said, I'll still see if there's a way I can fix those, though I make no promises. In F 1, there are some 2D effects during PVs that are affected by this and are sped up.

https://www.dropbox.com/s/g25yixl8tmr0x7..._patch.yml

Some demonstration videos of both games using the patch:



Frequently Asked Questions:
Q: I am currently experience stuttering while playing the game. What is your configuration?
A: For every first time viewing a PV, it needs to recompile shaders. Personally I don't like it and was against forcing this to always be on. This causes stuttering or freezing when you view a PV the first time (sometimes first two times). Best advice is to watch a PV before trying to play the song.
Q: And stuttering in the audio?
A: In the CPU settings, tick the box that says "Enable thread scheduler." This removes *most* audio stutter.
Q: I don't see that option "Enable thread scheduler."
A: Update your RPCS3 emulator...

How it Works & My Understanding of These Values
This section may be useful for anybody looking to remove a frame limit in another game. I only offer this as a conceptual explanation... Okay, so this is gonna be very layman's way of describing things, so bear with me:
SEGA hard coded update cycles in F and F 2nd down to the graphical refresh. In essence, most game developers would have invoked this function cellGcmSetVFrequency(someBitShiftedByte) or another and let the PS3 manage frame skipping all on its own. Not SEGA. Their frame update function more or less does the same thing but it seems they also like to do other things during the update, so that's probably why they chose to do it like this.
My patch, while imperfect, alters a couple things. The 1s were formerly all 2. They compare against a value saved previously into memory at a specific address (which I found first before getting to the others) which is specified as 1. These shorts (the 2s, now 1s) were like Update Checks. They were compared against that 1 and when equal or modulo equaled 0 (I'm not sure about the high level logic), the frame would update. The 1 and the 2 act like an Update Ratio combined. Where 1:1 is 60 FPS, and 1:2 is 30. And for experimentation and fun, I also did 1:4 to get 15 FPS and then 1:12 for 5 FPS.
The other value is what I called an Update Rate. This was used for most of the 3D animations. By default, it is a floating point value of 0.5 exactly. My interpretation is "only show half of the keyframes to play correctly in our target frame rate, 30 fps." So changing this to a 1.0 makes it show all keyframes to an animation, playing at proper speed.
My understanding of this one is admittedly iffy, but it works, doesn't it? Below I've also included a simple image of what I'm seeing. Note that I've personally renamed the functions once I found them.
http://i.imgur.com/xe6xvrI.png
(I'd use spoiler tags to embed the image, but that doesn't seem doable on this forum...)
This post was last modified: 05-26-2021, 05:09 PM by Brolijah. Edit Reason: Removed contact info blyat
Jocko
Member


0
2 posts 1 threads Joined: Sep 2017
09-21-2017, 06:09 PM -
#2
Thanks, this is working great.
The post-song animations at 2x are hilarious though.
Rauldj
Member


0
6 posts 0 threads Joined: Aug 2017
09-25-2017, 03:54 PM -
#3
Thank you very much for the patches! They work pretty well.
Radomyr
Member


0
1 posts 0 threads Joined: Mar 2020
03-03-2020, 01:04 AM -
#4
On NPEB02013 patch not working Sad
What can I do?
Mailton15
Member


0
1 posts 0 threads Joined: Apr 2020
04-17-2020, 12:49 AM -
#5
(08-31-2017, 03:26 AM)Brolijah Wrote: Hello RPCS3 Community,
Recently, I dived into the executables for Project DIVA F and F 2nd to see if I could remove the 30 FPS frame limit. It didn't take too long to find. Combined with the time I spent learning my way around IDA Pro, I think I only burned ~30 hours into it all.

If you have no other patches, you can save the file in the directory of your emulator as "patch.yml"
These are each of the versions of Project DIVA F and F 2nd I could get a hold of. If your version isn't listed AND you're also not getting more than 30 FPS in the game, either reply below in this thread, PM me on forums or on Discord, and I will help out as soon as I can.
Discord: Brolijah#8502
AS A FULL DISCLAIMER: This 60 FPS patch IS NOT PERFECT. 2D animations (menu stuff, mainly) and the Results screen 3D animations still run at double speed. This patch is released AS-IS since the PV animations play correctly, and that's what we mostly care about, right? That said, I'll still see if there's a way I can fix those, though I make no promises. In F 1, there are some 2D effects during PVs that are affected by this and are sped up.

https://www.dropbox.com/s/g25yixl8tmr0x7..._patch.yml
Note for F 1 Players: I don't have an Asian copy to play with, so if you're using the Asian version of Project DIVA F, please message on Discord me so we can get those added in too.

Some demonstration videos of both games using the patch:



Frequently Asked Questions:
Q: I am currently experience stuttering while playing the game. What is your configuration?
A: For every first time viewing a PV, it needs to recompile shaders. Personally I don't like it and was against forcing this to always be on. This causes stuttering or freezing when you view a PV the first time (sometimes first two times). Best advice is to watch a PV before trying to play the song.
Q: And stuttering in the audio?
A: In the CPU settings, tick the box that says "Enable thread scheduler." This removes *most* audio stutter.
Q: I don't see that option "Enable thread scheduler."
A: Update your RPCS3 emulator...

How it Works & My Understanding of These Values
This section may be useful for anybody looking to remove a frame limit in another game. I only offer this as a conceptual explanation... Okay, so this is gonna be very layman's way of describing things, so bear with me:
SEGA hard coded update cycles in F and F 2nd down to the graphical refresh. In essence, most game developers would have invoked this function cellGcmSetVFrequency(someBitShiftedByte) or another and let the PS3 manage frame skipping all on its own. Not SEGA. Their frame update function more or less does the same thing but it seems they also like to do other things during the update, so that's probably why they chose to do it like this.
My patch, while imperfect, alters a couple things. The 1s were formerly all 2. They compare against a value saved previously into memory at a specific address (which I found first before getting to the others) which is specified as 1. These shorts (the 2s, now 1s) were like Update Checks. They were compared against that 1 and when equal or modulo equaled 0 (I'm not sure about the high level logic), the frame would update. The 1 and the 2 act like an Update Ratio combined. Where 1:1 is 60 FPS, and 1:2 is 30. And for experimentation and fun, I also did 1:4 to get 15 FPS and then 1:12 for 5 FPS.
The other value is what I called an Update Rate. This was used for most of the 3D animations. By default, it is a floating point value of 0.5 exactly. My interpretation is "only show half of the keyframes to play correctly in our target frame rate, 30 fps." So changing this to a 1.0 makes it show all keyframes to an animation, playing at proper speed.
My understanding of this one is admittedly iffy, but it works, doesn't it? Below I've also included a simple image of what I'm seeing. Note that I've personally renamed the functions once I found them.
http://i.imgur.com/xe6xvrI.png
(I'd use spoiler tags to embed the image, but that doesn't seem doable on this forum...)
I recently installed F 2nd DLC's and the 60fps patch stopped working, there is any way to fix it?


Forum Jump:


Users browsing this thread: 2 Guest(s)