N64 VC - Mario Kart 64 frame limiting

steval_beaning

Well-Known Member
OP
Newcomer
Joined
Feb 4, 2022
Messages
62
Trophies
0
Age
23
Location
some crap town
XP
639
Country
United Kingdom
EDIT: i've found a fix! in a hex editor open the extracted 00000001.app and change these values:

Code:
32520: 38000001 -> 38000000
596F8: 93640030 -> 93840030
5972C: 93640038 -> 93840038
59758: 9364003C -> 9384003C
59784: 93640040 -> 93840040

I also recommend applying the dark filter removal patch:

Code:
46DB8: 9421FFE0 -> 4E800020

You'd then need to patch the original MK64 ROM and inject it into the WAD. You can do it with the BPS file I attatched (which also re-enables music in multiplayer) and then inject it (into the WAD you edited and rebuilt) with something like Friishproduce or Patcher64+ Tool.

Original post:
In Mario Kart 64, the game targets 30FPS in single player but wasn't able to reach that in multiplayer. Nintendo's (very hacky) solution was to add a lookup table for each track which adjusts the game speed to match some expected framerate. More info here: https://tasvideos.org/GameResources/N64/MarioKart64/Patches

When it came time to release the game on Wii Virtual Console (which doesn't have such performance issues), rather than editing the lookup table to target 30FPS for all tracks, Nintendo for some reason implemented a frame limiter (limiting to either 30, 20 or 15) based on the track and number of players, so that tracks would run at their proper speeds.

This implementation is bad however, as they seemingly forgot which tracks needed to run at different speeds, resulting in tracks like Moo Moo Farm and Bowser's Castle running way too fast in 3 player.

I've been able to use the resource I linked above to patch the N64 ROM so that all tracks target 30FPS, and inject that ROM into a Mario Kart 64 WAD, but I'd like to disable that frame limiter. I should note that when I run the same WAD in dolphin, all tracks run at 30FPS as expected, whereas on console the tracks are limited to 15, 20FPS etc. Has the way the virtual console emulator patches memory been reversed engineered at all, could a gecko code be feasible to create?
 

Attachments

  • Mario Kart 64 - 30FPS + Music in Multiplayer.zip
    264 bytes · Views: 7
Last edited by steval_beaning,

JuanMena

90's Kid, Old Skull Gamer & Artist
Member
Joined
Dec 17, 2019
Messages
5,147
Trophies
3
Age
31
Location
the 90's 💙
XP
12,088
Country
Mexico
Patcher 64 PLUS tool has had a Mario Kart 60FPS patch for some years now.

Maybe take a look at that.
It's not a gecko code, the tool literally patches the original WAD file making the game 60FPS in both Emulators and real hardware.

I've been playing MK64 in Wii with Widescreen anf 60FPS for some years now.
 
  • Like
Reactions: SaulFabre

steval_beaning

Well-Known Member
OP
Newcomer
Joined
Feb 4, 2022
Messages
62
Trophies
0
Age
23
Location
some crap town
XP
639
Country
United Kingdom
Patcher 64 PLUS tool has had a Mario Kart 60FPS patch for some years now.

Maybe take a look at that.
It's not a gecko code, the tool literally patches the original WAD file making the game 60FPS in both Emulators and real hardware.

I've been playing MK64 in Wii with Widescreen anf 60FPS for some years now.
Do you know if this works in multiplayer?
 
  • Like
Reactions: SaulFabre

steval_beaning

Well-Known Member
OP
Newcomer
Joined
Feb 4, 2022
Messages
62
Trophies
0
Age
23
Location
some crap town
XP
639
Country
United Kingdom
After playing around with Dolphin Memory Engine i've managed to create some gecko codes.
Code:
009B0F0B 00000000
009B0EF7 00000000
should disable the frame limiter, and
Code:
010C1ED7 00000002
should make the tracks target 30fps. (in theory, when i tried it in dolphin the value in memory kept getting overwritten.)

However, when I try these on usb loader gx, nothing happens... What would the problem be? Do I have to inject these into the WAD?
 
  • Like
Reactions: SaulFabre

SaulFabre

I like Yoshis and the Wii/Wii U scene.
Member
Joined
Feb 6, 2019
Messages
3,285
Trophies
2
Age
25
Location
Ecuador
Website
saulfabreg-wiivc.blogspot.com
XP
8,410
Country
Ecuador
After playing around with Dolphin Memory Engine i've managed to create some gecko codes.
Code:
009B0F0B 00000000
009B0EF7 00000000
should disable the frame limiter, and
Code:
010C1ED7 00000002
should make the tracks target 30fps. (in theory, when i tried it in dolphin the value in memory kept getting overwritten.)

However, when I try these on usb loader gx, nothing happens... What would the problem be? Do I have to inject these into the WAD?
maybe try looking a way for insert those Gecko codes into the main.dol of the VC WAD (00000001.app).
I recommend modifying the main.dol/00000001.app instead so we can pack the mods into a new WAD and make a patch for the WAD...
 

steval_beaning

Well-Known Member
OP
Newcomer
Joined
Feb 4, 2022
Messages
62
Trophies
0
Age
23
Location
some crap town
XP
639
Country
United Kingdom
maybe try looking a way for insert those Gecko codes into the main.dol of the VC WAD (00000001.app).
I recommend modifying the main.dol/00000001.app instead so we can pack the mods into a new WAD and make a patch for the WAD...

Well making the tracks target 30fps can be done with a patch to the N64 rom - as for the main.dol/00000001.app, would I just be looking for an instruction that targets those addresses? What would I be looking for?
Post automatically merged:

Ok so in the 00000001.app the vals at these offsets need to be changed:

Code:
32520: 38000001 -> 38000000
596F8: 93640030 -> 93840030
5972C: 93640038 -> 93840038
59758: 9364003C -> 9384003C
59784: 93640040 -> 93840040

I also applied the dark filter removal patch:

Code:
46DB8: 9421FFE0 -> 4E800020

You'd then need to replace the ROM with one with the courses patched to target 30fps - I had a patched ROM already but I think the tasvideos.org link has an ASM patch you can apply to the ROM. The BPS file I attached should do it, and it also re-enables music in multiplayer. Apply to a big-endian (.z64) MK64 ROM, CRC32=434389C1.
 

Attachments

  • Mario Kart 64 - 30FPS + Music in Multiplayer.zip
    264 bytes · Views: 6
Last edited by steval_beaning,

SaulFabre

I like Yoshis and the Wii/Wii U scene.
Member
Joined
Feb 6, 2019
Messages
3,285
Trophies
2
Age
25
Location
Ecuador
Website
saulfabreg-wiivc.blogspot.com
XP
8,410
Country
Ecuador
@steval_beaning
Done, and it's now working "flawlessly", i haven't extensively tested it but it works like it was on actual N64 console!

Suggestions: add this modification in hex to the ROM file (the file called rom inside 00000005.app) after patching with the 30FPS + Multiplayer Music fix attached in OP post, and the lag on some parts is also gone:

Code:
EB2D2: 020D0000 -> 0D0D0000

Some other patches i also could suggest applying in hex also to the rom in the VC release:

Remove Rubber Banding - removes the most hated way the AI (CPU) cheats to human players in MK64:

Code:
297AA: BCD783A7 -> B49A83A7

Max Draw Distance - Renders geometries further.

Code:
123220: 458CA000 -> 477DE800

No Camera Shake - The camera won't shake when using mushrooms.

Code:
8E018: E6040DBC -> 24000DBC

Always Advance - You always advance to the next race, even if you end up 5th place or lower

Code:
F8600: 10200003 -> 00000000

There's some other patches for apply in hex but for take an idea, i took those patches from Patcher64+ source code: https://github.com/Admentus64/Patch.../Files/Scripts/Options/Mario Kart 64.psm1#L47

1722960448772.png


Moo Moo Farm IS NOW AT A CORRECT SPEED WOOHOO!
 

steval_beaning

Well-Known Member
OP
Newcomer
Joined
Feb 4, 2022
Messages
62
Trophies
0
Age
23
Location
some crap town
XP
639
Country
United Kingdom
yeah patcher64+ was where I got the multiplayer music fix from, I just happened to have the patched rom to hand so yeah you could apply different ones depending on preference. if you want the tempo fix and not the multiplayer music then I think I originally applied the ASM patch from tasvideos
 
  • Like
Reactions: SaulFabre

SaulFabre

I like Yoshis and the Wii/Wii U scene.
Member
Joined
Feb 6, 2019
Messages
3,285
Trophies
2
Age
25
Location
Ecuador
Website
saulfabreg-wiivc.blogspot.com
XP
8,410
Country
Ecuador
For enable music on 3-Player and 4-Player (Multiplayer) modes on MK64, modify these in hex in the rom:
Credit: https://github.com/Admentus64/Patch.../Files/Scripts/Options/Mario Kart 64.psm1#L48

Code:
F82BF: 3AAFA400 -> 00AFA400
F8FE7: 17032880 -> 00032880

if you want the tempo fix and not the multiplayer music then I think I originally applied the ASM patch from tasvideos
@steval_beaning
For disable again multiplayer music after applying the multiplayer music in hex, just look for the same addresses and replace with the inverted changes (ex. if you find 00AFA400, which you enabled multiplayer music, replace with 3AAFA400 for disable again)
 

steval_beaning

Well-Known Member
OP
Newcomer
Joined
Feb 4, 2022
Messages
62
Trophies
0
Age
23
Location
some crap town
XP
639
Country
United Kingdom
For enable music on 3-Player and 4-Player (Multiplayer) modes on MK64, modify these in hex in the rom:
Credit: https://github.com/Admentus64/Patcher64Plus-Tool/blob/master/Files/Scripts/Options/Mario Kart 64.psm1#L48

Code:
F82BF: 3AAFA400 -> 00AFA400
F8FE7: 17032880 -> 00032880


@steval_beaning
For disable again multiplayer music after applying the multiplayer music in hex, just look for the same addresses and replace with the inverted changes (ex. if you find 00AFA400, which you enabled multiplayer music, replace with 3AAFA400 for disable again)
yeah - based on that and doing a diff between my patched and unpatched roms, i believe that this hex edit should apply the tempo fix:
Code:
2638: 3C0980158D290114 -> 2409000200000000
2890: 3C0A80158D4A0114 -> 240A000200000000
 
  • Like
Reactions: SaulFabre

Exidous

Well-Known Member
Member
Joined
Mar 2, 2021
Messages
389
Trophies
0
Age
44
XP
796
Country
United States
After Juan mentioned it I gave the patches a try. They're impressive at improving the look and feel of single player, but the full complement of the patches discussed (60fps+widescreen+multiplayermusic+nolag) rendered some modes effectively unplayable: 4p vs mode DK jungle was probably a consistent 5fps. Maybe some subset of the patches will improve the real hardware Wii MK64 experience, but they're not a panacea. I'd be interested to hear of a mix of patches that improves the vanilla Wii VC MK64 experience without outright sacrifice.
 
  • Like
Reactions: SaulFabre

Maeson

Well-Known Member
Member
Joined
Apr 3, 2013
Messages
1,246
Trophies
2
XP
3,615
Country
Spain
I had no idea about this N64Patcher Tool being able to bump the frame rate to 60, that's crazy, but even more so is finding that there are patches for OOT and MM to increase frame rate from 20 to 30.

Has anyone tried them? Do they work fine on Wii?
 

steval_beaning

Well-Known Member
OP
Newcomer
Joined
Feb 4, 2022
Messages
62
Trophies
0
Age
23
Location
some crap town
XP
639
Country
United Kingdom
I had no idea about this N64Patcher Tool being able to bump the frame rate to 60, that's crazy, but even more so is finding that there are patches for OOT and MM to increase frame rate from 20 to 30.

Has anyone tried them? Do they work fine on Wii?
I think they've been around for a while but have always had issues. e.g. you need to keep switching between 20fps and 30fps for things to work. afaik ship of harkinian was the first decent implementation for higher framerates
 
  • Like
Reactions: Maeson

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Kirbydogs @ Kirbydogs: https://www.youtube.com/watch?v=Rax8NvkXfyI