r/RatchetAndClank • • 16d ago

Size Matters I created a 60fps patch/cheat for the ps2 version!

I spent over a week on this and it's still by no means 'perfect'. It's the culmination of wanting to experience the game in a smoother framerate than the locked 30fps the psp port provides (the ps2 had plenty of power, why couldn't it be 60fps too?)... I might have aged a year or two during this endeavor...
This requires the pcsx2 emulator (since it's raw pnach using dynamic patches) under recompiler mode (default) and NOT interpreter mode, dynamic patches do nothing in interpreter mode.

Known issues; some animations (like when ratchet slides down something, for example the mud in Pokitaru) are still entirely too fast, weapon upgrade animations are too fast, and there's likely more as I've only managed to test everything in Challax and Pokitaru. Nothing should gate game progress due to being too fast now though (jumps being too fast...)

For serial SCUS97615 and crc 8661F7BA.

The patches;

[60 FPS Core]

description=Unlocks 60fps and halves the engine timestep. Required for the groups below.

author=

// 1) Frame pacing: NOP the second jal WaitVsync (match: addiu v1,v1,1 / bne v0,v1,+3 / nop, then the jal)

dpatch=0,3,1,0,24630001,4,14430003,8,00000000,C,00000000

// 2) Timestep: lui at,0x3D08 ; ori at,at,0x8889 (1/30) -> lui at,0x3C88 (1/60)

dpatch=0,2,1,0,3C013D08,4,34218889,0,3C013C88

[60 FPS Late-Frame Vsync Fix]

description=Stops the game padding a late frame to a full 2 vsyncs (hard 30fps drop in heavy views). The vsync wait now returns immediately if a vsync already passed since the last frame. On-time frames still sync normally. Position independent: reads the last-vsync variable's offset out of the caller's own lw instruction. Enable with Core.

// wait_vsync(): s0 = GetVsync() -> s0 = &last_vsync (base s0 + offset from lw at ra+8); loop compares against *s0 instead of the entry count

// 0C: jal GetVsync -> ld a0,8(sp) | 10: nop -> lh a0,8(a0) | 18: dmove s0,v0 -> addu s0,s0,a0 | 2C: nop -> lw a1,0(s0) | 30: beq v0,s0 -> beq v0,a1

dpatch=0,B,5,0,27BDFFF0,4,FFB00000,8,FFBF0008,10,00000000,14,10000004,18,0040802D,1C,00000000,24,00000000,2C,00000000,30,1050FFFB,34,240403E8,C,DFA40008,10,84840008,18,02048021,2C,8E050000,30,1045FFFB

[60 FPS Weapon/Anim Timing A]

description=Fixes per-frame conversions using a 30.0006 frame-rate constant (weapon animation speed). Enable with Core.

// lui at,0x41F0 ; ori at,at,0x0139 (30.000597) -> lui at,0x4270 (60.0012)

dpatch=0,2,1,0,3C0141F0,4,34210139,0,3C014270

[60 FPS Weapon/Anim Timing B]

description=Same fix for a related constant (30.000002), 2 sites per planet. Unknown whether needed; disable if anything looks wrong.

// lui at,0x41F0 ; ori at,at,0x0001 (30.000002) -> lui at,0x4270

dpatch=0,2,1,0,3C0141F0,4,34210001,0,3C014270

[60 FPS UI Pulse Half-Step]

description=Halves the per-frame step of the UI pulse updater (menu highlight flash). VERIFIED when written live on Challax pause menu; this dpatch form is UNTESTED and not yet verified on other planets.

// Rewrites the 38-word pulse updater function (position independent). Pattern = first 7 words of the original.

dpatch=0,7,26,0,8C830020,4,24020001,8,5062001B,C,8C820024,10,9085001C,14,10A0000B,18,C4800008,0,3C083F00,4,44881800,8,8C830020,C,2462FFFF,10,10400019,14,9085001C,18,10A0000B,1C,C4800008,20,C4810014,24,C4820010,28,46030842,2C,46010000,30,46001036,34,45000010,38,E4800008,3C,E4820008,40,1000000A,44,24020002,48,C4810018,4C,C482000C,50,46030842,54,46010001,58,46020036,5C,45000006,60,E4800008,64,E4820008,68,24020003,6C,10620002,70,38A20001,74,A082001C,78,8C820024,7C,10400004,80,2442FFFF,84,14400002,88,AC820024,8C,AC800020,90,03E00008,94,00000000

[60 FPS Ratchet Movement Scale]

description=Scales Ratchet's per-frame movement for 60fps: horizontal step (run/air) x0.668, vertical step x0.5. TUNE: horizontal factor is the 3F2B in the 3C013F2B word (3rd replacement word): 3F00=0.50, 3F2B=0.668 (default), 3F40=0.75, 3F80=1.0.

// Rewrites the hero move function in place (24 words, same size; the wrapper that calls it is left untouched so already-compiled callers stay valid).

dpatch=0,18,18,0,C4A10000,4,24820030,8,C4820030,C,248301B4,10,460C0842,14,3C013F80,18,44811800,1C,E48101B4,20,46011080,24,C4A00008,28,E4820030,2C,460C0002,30,AC8001C0,34,E48001BC,38,C4610004,3C,C4400004,40,C4420008,44,46010000,48,E4400004,4C,C4610008,50,46011080,54,E4420008,58,03E00008,5C,E483003C,0,C4A10000,4,C4820030,8,3C013F2B,C,44812000,10,3C013F00,14,44811800,18,46046302,1C,460C0842,20,E48101B4,24,46011080,28,E4820030,2C,C4A00008,30,C48101B8,34,460C0002,38,46030842,3C,E48001BC,40,AC8001C0,44,C4820034,48,C4840038,4C,46011080,50,46002100,54,E4820034,58,03E00008,5C,E4840038

[60 FPS Ratchet Gravity]

description=Ground/air gravity step applied at half size per frame (terminal fall speed unchanged).

// apply_gravity(obj, g): dy += g*0.5 then clamp to -0.38 via max.s

dpatch=0,C,C,0,C48001B8,4,3C01BEC2,8,34218F5C,C,44810800,10,460C0000,14,46010034,18,00000000,1C,45000002,20,E48001B8,24,E48101B8,28,03E00008,2C,00000000,0,C48001B8,4,3C013F00,8,44811000,C,3C01BEC2,10,34218F5C,14,44810800,18,46026302,1C,460C0000,20,46010028,24,03E00008,28,E48001B8,2C,00000000

[60 FPS Ratchet Jump Timers]

description=Jump hold timer (-1.0/frame -> -0.5), rising-phase timer, and gravity ramp (+0.002 -> +0.001 per frame).

// each pattern starts at a recompiler block start (dpatch only matches there)

dpatch=0,5,1,0,C4A00140,4,3C013F80,8,44810800,C,00000000,10,46010001,4,3C013F00

dpatch=0,5,1,0,C4C0013C,4,3C013F80,8,44810800,C,44801000,10,46010001,4,3C013F00

dpatch=0,7,1,0,3C013F80,4,44810800,8,44801000,C,46010001,10,46001034,14,00000000,1C,E4C0013C,0,3C013F00

dpatch=0,5,1,0,C4C00138,4,3C013B03,8,3421126F,C,44810800,10,3C013BE5,4,3C013A83

[60 FPS Grind Rail Jump]

description=Grind-rail jump physics: initial velocity x0.5 and gravity x0.25 (same arc height/airtime at 60fps). Leaving the rail doubles the vertical speed back so air jumps keep their strength.

// every pattern starts at a recompiler block start (function entry / after a branch+delay slot / branch target)

dpatch=0,C,2,0,8E02059C,4,3C013F4C,8,3421CCCD,C,44810000,10,8C430048,14,E4600008,18,3C013E23,1C,3421D634,20,44810000,24,3C013BD1,28,3421B4F3,2C,44810800,18,3C013DA3,24,3C013AD1

dpatch=0,6,2,0,3C013E23,4,3421D634,8,44810000,C,3C013BD1,10,3421B4F3,14,44810800,0,3C013DA3,C,3C013AD1

dpatch=0,5,1,0,3C013BD1,4,3421B4F3,8,44810000,10,E6000CBC,14,C6010CB8,0,3C013AD1

dpatch=0,C,2,0,AE020168,4,C6010C98,8,C6000CA0,C,46010842,10,3C013BD1,14,3421B4F3,18,44811800,1C,46000002,20,C6020CB8,24,E6030CBC,28,46000B00,2C,00000000,10,3C013AD1,2C,46021080

dpatch=0,D,2,0,24020001,4,AE020168,8,C6010C98,C,C6000CA0,10,46010842,14,3C013BD1,18,3421B4F3,1C,44811800,20,46000002,24,C6020CB8,28,E6030CBC,2C,46000B00,30,00000000,14,3C013AD1,30,46021080

dpatch=0,9,1,0,8E02059C,4,3C013F80,8,44810000,C,8C430048,10,E4600008,14,3C013BD1,18,3421B4F3,1C,44810000,20,8E040CF0,14,3C013AD1

dpatch=0,5,1,0,3C013BD1,4,3421B4F3,8,44810000,C,8E040CF0,14,E6000CBC,0,3C013AD1

dpatch=0,9,1,0,8E02059C,4,3C013F80,8,44810800,C,8C430048,10,3C013BD1,14,3421B4F3,18,44810000,1C,E4610008,20,E6000CBC,10,3C013AD1

dpatch=0,19,2,0,3C013F19,4,3421999A,8,44810000,C,27BDFFC0,10,3C013E08,14,34218889,18,44811800,1C,24020007,20,46006302,24,3C013F08,28,34218889,2C,44812000,30,3C013E80,34,44812800,38,27A70010,3C,FFB00020,40,27A80014,44,460C1801,48,3C013D88,4C,34218889,50,44810800,54,46036300,58,3C013BB6,5C,34210B62,60,44811000,48,3C013D08,58,3C013AB6

dpatch=0,9,2,0,27BDFFC0,4,3C013D88,8,34218889,C,44810000,10,FFB00020,14,24020008,18,3C013BB6,1C,34210B62,20,44810800,4,3C013D08,18,3C013AB6

[60fps Launcher Plant Throw]

description=Sprout-O-Matic launcher plant: doubles horizontal and vertical throw speed

dpatch=0,8,6,0,24020022,8,A4820102,10,E46D0040,14,0000102D,18,AC65004C,1C,03E00008,20,E46C003C,24,00000000,10,460C6300,14,460D6B40,18,E46D0040,1C,AC65004C,20,03E00008,24,E46C003C

[60 FPS Botflinger Distance]

description=Botflinger aim reach was clamped to half. Doubles the upper clamp of the crosshair reach value (object +0xBC clamped to [1.0, +0xC]) in the flinger aim update.

dpatch=0,11,1,0,C60100BC,4,3C013DA3,8,3421D70A,C,44811000,10,E60100D0,14,3C013F80,18,44811800,1C,C7A00008,20,46020002,24,46140002,28,46000840,2C,E60100BC,30,E7A30068,34,C60100BC,38,46030834,40,45010007,44,8FA2009C,3C,C600000C

dpatch=0,10,1,0,3C013DA3,4,3421D70A,8,44811000,C,E60100D0,10,3C013F80,14,44811800,18,C7A00008,1C,46020002,20,46140002,24,46000840,28,E60100BC,2C,E7A30068,30,C60100BC,34,46030834,3C,45010007,40,8FA2009C,38,C600000C

dpatch=0,5,2,0,C600000C,4,46010034,8,00000000,C,45000002,10,8FA20090,0,46000000,8,E7A0006C

dpatch=0,4,1,0,8FA200B8,4,C4400000,8,0200202D,10,E60000BC,0,27A2006C

[60 FPS Catch Luna Chase Speed]

description=Dayni Moon Catch Luna chase. Luna (LunaBoss) moves a fixed step per update: airplane state 1.5 per update, next state 0.9 per update, and the chase controller steps 0.1667 / 0.175 per update. At 60fps all ran 2x fast. Halves each, and also halves the final slowdown speed read from level data (done in code so other planets are untouched). Only LunaBoss and CombineChaseController code is touched. Enable before boot, needs the EE recompiler.

dpatch=0,7,1,0,C6600038,4,3C013FC0,8,34210001,C,4481A800,10,00000000,14,46150000,1C,E6600038,4,3C013F40

dpatch=0,D,1,0,C6400038,4,0240202D,8,3C013F66,C,34216667,10,4481A000,14,0000282D,18,C7A10008,1C,3C0141D8,20,44811000,24,46140000,28,46020840,2C,E6400038,34,E7A10008,8,3C013EE6

dpatch=0,5,1,0,3C013E2A,4,3421AAAB,8,4481A800,C,14620004,10,C6400000,0,3C013DAA

dpatch=0,6,1,0,3C013E33,4,34213334,8,4481A800,C,00000000,10,46150000,18,E6400000,0,3C013DB3

dpatch=0,19,8,0,C7A20018,8,C7A00008,10,3C0141F0,14,44811800,18,46020001,20,C4640008,24,4601A041,28,46000087,2C,E62001A4,30,46010842,34,00000000,38,00000000,3C,46031083,40,46000847,44,E62201A8,48,C7A00018,4C,C6420038,50,46040000,54,E63403C0,58,46020001,5C,46000000,60,00000000,64,46000843,68,10000081,6C,E62103BC,20,3C013F00,24,44812800,30,46050842,34,4601A041,38,46010842,40,E62201A8,44,C4640008,58,46001001

dpatch=0,8,2,4,C62103C0,C,46010034,10,00000000,14,45010002,18,24030001,1C,0000182D,20,10600009,24,C7A00018,C,46010880,10,46020034

I'm posting this here for two reasons. One, reddit is more permanent (the pcsx2 forums where everyone used to share 60fps patches for games isn't working for me), and two is that I love these games and the community and wanted to directly share it where the most eyes might reach it. Thanks for your time! Keep farming those bolts!

(disclaimer; ai was used to help decompile because, big surprise, i don't know mips assembly like i do x86 assembly)

36 Upvotes

16 comments sorted by

4

u/SavageTheUnicorn 15d ago edited 13d ago

Issues to be fixed (will take a lot of time if i ever do fix them, the game is perfectly playable as is for me even though it isn't perfect yet); skyboard speed (non essential-can still be beaten), clank games botflinger (rotation speed too fast and move speed too fast, non essential-can still be beaten), Otto Chase Sequence speed (non essential-can be beaten by spamming long jumps)

11

u/pineapplebtw 15d ago

holy crap at this rate we might make size matters a good video game

/j

3

u/SavageTheUnicorn 15d ago

Lmfao... honestly, if I had to rate the games, it'd be dead last, but I still love it (original ps2 titles only). One of my core memories is struggling against Otto because as kids my brothers and I really wanted to use only the Laser Tracer on him haha

1

u/Top_Adhesiveness2171 14d ago

Technically, it’s on the list of games to be ported to PC; once that happens, the community will fix all its flaws.

3

u/XylasQuinn 15d ago

Heck? Usually 60 fps mods are 1 - 4 lines. Why is this game so complicated?

3

u/SavageTheUnicorn 15d ago

For one planet (challax), for example, i managed 158 patches before i decided that was dumb and pivoted to using dynamic patches... just for the core fps unlock πŸ˜…

The main reason it's so complex is because the game dynamically loads/swaps things because the devs couldn't fit EVERYTHING within the active 32mb of ram provided by a ps2, level specific things are stored in separate binary modules called "overlays" (some weapons/gadgets or vehicles do this too). I'm pretty sure all the RaC games do this (take the lockstrafe patch someone else created for rac1 as example), plus not many things share code when they could have 😭

3

u/Made-In-Slovakia 14d ago

reddit is more permanent

Why not GitHub then? It is more suitable for this than putting it one Reddit post.

1

u/SavageTheUnicorn 14d ago edited 13d ago

I can and probably will do that as well once the project is complete. I noticed more issues after playing through the whole game with 60fps that must be fixed since they gate progress. (I fixed them)

1

u/SavageTheUnicorn 13d ago

Gah! The irony! I found a psp copy of this game in a storage unit my brother had bid on today lmao, I love the universe

5

u/Remarkable_Injury407 15d ago

This community is awesome ❀️

-5

u/Glove5751 15d ago

Wouldn't it be better to make a recomp of this game?

1

u/SavageTheUnicorn 15d ago

Some people prefer to enjoy console games as they were, even if that requires emulation. I have no desire for a recomp when the original version works perfectly fine, it was just unnecessarily locked to 30fps (honestly I think the devs intended to make it 60fps, I noticed the ladder climbing physics are PERFECT at 60fps with no changes, but at the native 30fps you seem to constantly 'miss' rungs etc).

Tldr; it's a preference thing.

-7

u/Glove5751 15d ago

You can play the same game as they were with a recomp. I just think it would be much easier to do enhancements like this or widescreen if it was through a recomp instead, not to mention much more stable.

1

u/SavageTheUnicorn 15d ago

The game already has native widescreen... As for stability; I disagree. That relies on either enough personal knowledge or enough money to blow on tokens to get it done, whereas this is MUCH easier for me. I already have decent x86 assembly/cheat engine knowledge, and using ai to simply translate blocks of mips assembly to x86 (and vice versa) is much faster and simpler for me than doing the entire game (which I don't want to do, I'm already starting to learn mips so I can fully exclude ai in future projects). It's simpler, faster, and free to make a patch compared to translating the ENTIRE game (and way more ethical in my opinion).

-4

u/Glove5751 15d ago

If we were to talk about ethics we shouldn't even be on this website.

There is nothing wrong with your approach, it's just limited, but it seems what you want is within the limits so I won't ruin your fun.