Hacking N64 Expansion Pak emulation on Wii VC (8 MB of RAM on N64 VC!)

SaulFabre

I like Yoshis and the Wii/Wii U scene.
OP
Member
Joined
Feb 6, 2019
Messages
3,166
Trophies
1
Age
25
Location
Ecuador
Website
saulfabreg-wiivc.blogspot.com
XP
7,717
Country
Ecuador
(PD: Maybe @SuperrSonic is interested in it, so i'm mentionating him for see if he's interested in it, he is still working and investigating about VC emulation on Wii)

Hello to all GBAtemp!

I recently worked on trying to increase maximum RAM memory of the emulated Nintendo 64 games on Wii VC games, and even emulating the Expansion Pak, which gives 4 MB of extra RAM to the Nintendo 64 (4 MB of principal N64 RAM + 4 MB from Expansion Pak = 8 MB of RAM!)

So, for do this, i'm basing on aglab2's work on inject Super Mario 64 romhacks (which most require Expansion Pak for run), also using krimtonz's gzinject patches (in *.gzi) based on glankk's work and fixes on the N64 VC emulator of "The Legend of Zelda: Ocarina of Time".

Original patches on *.gzi for see comparison between enabled 8 MB RAM and disabled 8 MB RAM (4 MB RAM) can be downloaded from here:
4MB_RAM_N64VC.gzi.zip
8MB_RAM_N64VC.gzi.zip

I decided to try it since i'm upset of the slowdowns and other graphical details not shown in some games, including "Road Rash 64", which has so much slowdown (runs at 30 FPS instead of 60 FPS).

I am so tired of getting this when running my VC inject of Road Rash 64 on Mario Golf (with romc compression):

noexpansionpak_rr64_vc.PNG


So I did something for get this screen like this:

expansionpak_rr64_vc.PNG


How I did it? Here's the steps:
  1. First, grab your favorite N64 VC WAD or an Expansion Pak-compatible N64 VC injected WAD
  2. Unpack it with wwPacker tool (download link). Drag your WAD file you want to edit its 00000001.app and drop it into __wwunpacker.bat batch file.
  3. Once unpacked, open the unpacked WAD folder and check if the 00000001.app is compressed. This can be checked if the 00000001.app size is below 1 MB.
  4. If it is not compressed (its size is more than 1 MB), skip to Step 6. But if it is compressed (its size is less of 1 MB), then procced from Step 5.
  5. Copy the 00000001.app from unpacked WAD folder to wwPacker folder (where wwcxtool is).
  6. Now uncompress the original 00000001.app with wwcxtool. For this, open the CMD in the wwPacker folder and run this command: wwcxtool /u 00000001.app 00000001_dec.app
  7. NOTE: DO NOT DELETE THE ORIGINAL 00000001.app FILE, WE ARE USING IT LATER FOR USE THE SAME COMPRESSION LIKE THE ORIGINAL 00000001.app HAD!
  8. Now open the 00000001.app file (or 00000001_dec.app if the original 00000001.app is compressed) with a hex editor (I recommend HxD)
  9. step1hex.PNG

  10. Now, in the hex editor, click in Search tab > Search. Or, press Ctrl+F (for open Search in hex) and search for the following hex values: 41 82 00 08 3C 80 00 80
  11. (Remember: Hex values 3C 80 00 80 after hex values of number of RAM used is for define maximum RAM memory of N64 for use on the VC emulator.)
  12. step2hex.PNG
  13. Once searched, you must see these values highlighted in hex:
  14. step3hex.PNG

  15. Now, click in the first byte of 41 82 00 08 3C 80 00 80 and then replace these hex values with the following: 60 00 00 00 3C 80 00 80
  16. Once modified the values, you must have something like this: (yellow line is only for highlighting by me, this won't appear int he hex editor):
  17. step4hex.PNG

  18. Once finished editing the uncompressed 00000001.app file, save the changes made to the file.
  19. step5hex.PNG

  20. Once saved, a backup file (*.bak) of 00000001.app (or 00000001_dec.app if it had compression) will be generated. Delete that backup file, we are only using the edited file. DO NOT DELETE THE ORIGINAL 00000001.app FILE, WE ARE USING IT FOR USE THE SAME COMPRESSION LIKE THE ORIGINAL HAD!
  21. step6hex.PNG
  22. If your original 00000001.app does not have a compression, skip to step 26. But if the original 00000001.app is compressed, then procced from Step 22.
  23. Now we have to recompress the edited 00000001_dec.app with wwcxtool, using the original 00000001.app compression. For this, open the CMD in the wwPacker folder and run this command: wwcxtool /cr 00000001.app 00000001_dec.app 00000001_out.app
  24. Once finished compressing the edited 00000001_dec.app, you will get a new 00000001_out.app with original compression that had original 00000001.app file.
  25. step7hex.PNG

  26. Copy the edited 00000001.app (or 000000001_out.app if the original 00000001.app is compressed) to the unpacked WAD folder. FOR NON-COMPRESSED 00000001.app FILES: If a warning shows that do you want to replace the current file, accept and continue replacing the old 00000001.app file with the new 00000001.app file. Then skip to step 33.
  27. Go to the unpacked WAD folder, then delete the original 00000001.app file from the unpacked WAD folder, then use the edited 000000001_out.app file.
  28. step8hex.PNG
  29. In order for use the edited and compressed 00000001_out.app file you MUST rename it to 00000001.app, otherwise you won't be able to repack the WAD due to missing 1.app file.
  30. step9hex.PNG

  31. After renaming the 000000001_out.app to 00000001.app you must have something like this:
  32. step10hex.PNG

  33. Now go to wwPacker folder, then drag your unpacked WAD file that you edited its 00000001.app and drop it into __wwpacker-NoMod.bat or __wwpacker-RegionFree.bat batch file.
  34. Once repacked the new WAD, try it out with Dolphin Emulator and see if the new WAD uses Expansion Pak! If it shows symbols or text like "EXPANSION PAK ENHANCED", good work! If not, try doing all these steps again.
Enjoy full 8 MB of RAM expansion of N64 Expansion Pak on Wii VC!

IMPORTANT NOTE: Remember, Nintendo 64 VC emulation is still too poor on the Wii, so only a few games that are Expansion Pak-compatible can be injected and enhanced by doing this procedure. Remember that you have an 85% chance of your injection fails because it crashes on the 'You will need the Classic Controller' screen, and only you have a 15% chance of your injection works (often with issues).

See you in a next thread on Wii scene!

saulfabreg - @SaulFabre
 

Attachments

  • 4MB_RAM_N64VC.gzi.zip
    190 bytes · Views: 296
  • 8MB_RAM_N64VC.gzi.zip
    190 bytes · Views: 399
Last edited by SaulFabre,

XFlak

Wiitired but still kicking
Member
Joined
Sep 12, 2009
Messages
13,795
Trophies
3
Age
38
Location
Cyprus, originally from Toronto
Website
modmii.github.io
XP
9,778
Country
Cyprus
Amazing documentation, thank you! I can't help but think about how this can be automated in a bat script. If there's lots of demand I could probably whip something together, or find a place to insert it into ModMii, lol
 

flowlapache

Well-Known Member
Member
Joined
Sep 7, 2010
Messages
243
Trophies
1
Age
38
Website
Visit site
XP
1,059
Country
France
Whaou!! until now I believed it was possible to have expansion pack enhanced just by injecting a game in a VC wich use this feature..but apparently nintendo didn't try it. fortunately you made it! Thanks for your detailed tutorial! And for jsure, a batch script would be so sweet!
 

SaulFabre

I like Yoshis and the Wii/Wii U scene.
OP
Member
Joined
Feb 6, 2019
Messages
3,166
Trophies
1
Age
25
Location
Ecuador
Website
saulfabreg-wiivc.blogspot.com
XP
7,717
Country
Ecuador
Whaou!! until now I believed it was possible to have expansion pack enhanced just by injecting a game in a VC wich use this feature..but apparently nintendo didn't try it. fortunately you made it! Thanks for your detailed tutorial! And for jsure, a batch script would be so sweet!
Nintendo improved and applied the Nintendo 64 (N64) Expansion Pak in only one official VC game for Wii... That game was "The Legend of Zelda: Majora's Mask" (launched firstly in 2000), but for it also used a newer "romc" compression called romc Type 2, which also used LZ77 and Huffman (i think Huffman8 / Huf8) code.

However, after the release of Zelda: Majora's Mask to Wii VC, Nintendo didn't work anymore with N64 Expansion Pak games on VC games for Wii, for keep working on N64 games on Wii U (such Donkey Kong 64)... so I had to try it and go more far away the limits of N64 VC :)
 
Last edited by SaulFabre,

SaulFabre

I like Yoshis and the Wii/Wii U scene.
OP
Member
Joined
Feb 6, 2019
Messages
3,166
Trophies
1
Age
25
Location
Ecuador
Website
saulfabreg-wiivc.blogspot.com
XP
7,717
Country
Ecuador
UPDATE!!!! I've tried the same thing with Nintendo's official VC release for Wii "The Legend of Zelda: Majora's Mask" with the same fix of this thread, but by replacing the old hex values in the uncompressed 00000001.app of the extracted Zelda MM WAD.
Original Zelda MM 00000001.app WAD Expansion Pak hex values:
48 00 00 64 3C 80 00 80
I replaced with the following hex values from Expansion Pak Mod by glankk:
60 00 00 00 3C 80 00 80
Then I recompressed the 1.app and repacked the WAD and when I tested it, surprisingly it still worked with the same performance and I didn't find any issue nor glitch during in-game even when modded the 1.app file.
Some screenshots:
majora1.PNG


majora2.PNG


majora3.PNG


majora4.PNG


Greetings ;)
@SaulFabre
 
Last edited by SaulFabre,

SaulFabre

I like Yoshis and the Wii/Wii U scene.
OP
Member
Joined
Feb 6, 2019
Messages
3,166
Trophies
1
Age
25
Location
Ecuador
Website
saulfabreg-wiivc.blogspot.com
XP
7,717
Country
Ecuador
Amazing!! Good Job Saul!! ;)
Thanks @Zorg1996! It took me more than 7 months for see if i can modify the 00000001.app file for get Expansion Pak emulation, in order for get working some Expansion Pak-required games, and for enhance other games. If you liked this, please tell everyone my work ;)
 

raxadian

Well-Known Member
Member
Joined
Nov 10, 2018
Messages
4,339
Trophies
1
Age
41
XP
4,519
Country
Argentina
Slightly off topic, anyone else think SaulFabre needs something like this (but slightly modified of course)? Lol


images

Only if he lives in Japan were modifying a game or a video game console or even making backup saves the game doesn't let you backup is a crime.
 
Last edited by raxadian,

JuanMena

90's Kid, Old Skull Gamer & Artist
Member
Joined
Dec 17, 2019
Messages
4,868
Trophies
2
Age
30
Location
the 90's 💙
XP
10,001
Country
Mexico
One noob and probably pretty stupid question...

If VC Injected wads crashes on "You will need a classic controller" screen...

Can't it be skipped/erased via hacking?
I mean, is the screen prompted by the Wii's internal instructions?
Or is something Nintendo themselves made on exclusive Virtual Console games?

Isn't it "logical" to remove that screen in case we know what's starting it in the first place?
If so, couldn't it be replaced by something else or just erase it altogether?
:shy:
 

SaulFabre

I like Yoshis and the Wii/Wii U scene.
OP
Member
Joined
Feb 6, 2019
Messages
3,166
Trophies
1
Age
25
Location
Ecuador
Website
saulfabreg-wiivc.blogspot.com
XP
7,717
Country
Ecuador
so is there any games that work better off here than they do win wii64/not64?
Not many games... only very few games. Remember the Nintendo 64 emulation on Wii via VC is still too poor, and the chances to get your game working on N64 VC it's just 15% percent! (But often with issues such graphical glitches, no sound, etc...)
The other 85% percent it's just chances to get your injection failed/broken because of crashing/hanging/freezing on "You will need the Classic Controller." screen, also soft-locking the Wii due to incompatible N64 game on VC.
This is most common when trying to inject Rare / Rareware games to VC (ex. Diddy Kong Racing, Mickey's Speedway USA, Perfect Dark, Donkey Kong 64, etc...). It's not just by its special CIC code for avoiding running in some emulators (which can be hacked), but also because of its special-programmed graphics on N64.
One noob and probably pretty stupid question...

If VC Injected wads crashes on "You will need a classic controller" screen...

Can't it be skipped/erased via hacking?
I mean, is the screen prompted by the Wii's internal instructions?
Or is something Nintendo themselves made on exclusive Virtual Console games?

Isn't it "logical" to remove that screen in case we know what's starting it in the first place?
If so, couldn't it be replaced by something else or just erase it altogether?
:shy:
Well, I don't know. Unless you know what is the general coding of Nintendo's VC 000000001.app/main.dol emulator of the Nintendo 64 games on VC for Wii, there isn't any easy way for hacking the emulator for get better compatibility nor removing the Classic Controller notice (because the Classic Controller / GameCube Controller is required for SNES VC / N64 VC games). The 000000001.app file has so many code and instructions made by Nintendo for the VC emulation, and it only uses common N64 graphics coding, (examples of games with common N64 graphics code are on Super Mario 64, TLOZ: Ocarina of Time, Paper Mario, Wave Race 64, etc.)
Other reasons for notice that the N64 VC emulation on Wii is still too poor: poor custom ASM code support and 32 MB size file. (But some N64 games, such Pokémon Stadium 2, Resident Evil 2, and Conker's Bad Fur Day, have 64 MB of size, which is not supported by Wii VC :( )
 

pedro702

Well-Known Member
Member
Joined
Mar 3, 2014
Messages
12,719
Trophies
2
Age
33
XP
8,690
Country
Portugal
Not many games... only very few games. Remember the Nintendo 64 emulation on Wii via VC is still too poor, and the chances to get your game working on N64 VC it's just 15% percent! (But often with issues such graphical glitches, no sound, etc...)
The other 85% percent it's just chances to get your injection failed/broken because of crashing/hanging/freezing on "You will need the Classic Controller." screen, also soft-locking the Wii due to incompatible N64 game on VC.
This is most common when trying to inject Rare / Rareware games to VC (ex. Diddy Kong Racing, Mickey's Speedway USA, Perfect Dark, Donkey Kong 64, etc...). It's not just by its special CIC code for avoiding running in some emulators (which can be hacked), but also because of its special-programmed graphics on N64.

Well, I don't know. Unless you know what is the general coding of Nintendo's VC 000000001.app/main.dol emulator of the Nintendo 64 games on VC for Wii, there isn't any easy way for hacking the emulator for get better compatibility nor removing the Classic Controller notice (because the Classic Controller / GameCube Controller is required for SNES VC / N64 VC games). The 000000001.app file has so many code and instructions made by Nintendo for the VC emulation, and it only uses common N64 graphics coding, (examples of games with common N64 graphics code are on Super Mario 64, TLOZ: Ocarina of Time, Paper Mario, Wave Race 64, etc.)
Other reasons for notice that the N64 VC emulation on Wii is still too poor: poor custom ASM code support and 32 MB size file. (But some N64 games, such Pokémon Stadium 2, Resident Evil 2, and Conker's Bad Fur Day, have 64 MB of size, which is not supported by Wii VC :( )
is there a list of this very few games that run better? i would like to know which ones xD
 

SaulFabre

I like Yoshis and the Wii/Wii U scene.
OP
Member
Joined
Feb 6, 2019
Messages
3,166
Trophies
1
Age
25
Location
Ecuador
Website
saulfabreg-wiivc.blogspot.com
XP
7,717
Country
Ecuador
is there a list of this very few games that run better? i would like to know which ones xD
There's no list but I know some few games that runs better on N64 VC than Wii64 / Not64:
  • Tom & Jerry in Fists of Furry (injected in Star Fox 64 WAD)
  • Super Smash Bros. 64 (injected in Sin & Punishment WAD or F-ZERO X WAD)
  • Magical Tetris Challenge (injected in Sin & Punishment WAD)
  • AeroGauge (injected in Sin & Punishment WAD)
  • International Superstar Soccer 64 (injected in Star Fox 64 WAD)
Greetings ;)
 

SaulFabre

I like Yoshis and the Wii/Wii U scene.
OP
Member
Joined
Feb 6, 2019
Messages
3,166
Trophies
1
Age
25
Location
Ecuador
Website
saulfabreg-wiivc.blogspot.com
XP
7,717
Country
Ecuador
Would it be possible to change video mode of european Majora's Mask to force it 60 hz on a Wii PAL console? Is there any modification for that?
There are two options:

- If your Wii is PAL region, and you want to play it on PAL60 instead of PAL50, then change the Screen settings for set it to PAL60.
For this, do these steps:
Go to the Wii Menu and then click on the Wii Options button, then select Wii Settings.
Then go to the following screens: Wii Settings Page 1 > Screen > TV Type.
You will get three options:
  • EDTV / HDTV (480p) <-- Default setting
  • 50 Hz (576i) <-- PAL50 (Max. speed: 50 FPS)
  • 60 Hz (480i) <-- PAL60 (Max. speed: 60 FPS)
Now, for use your Wii and play your PAL games in PAL60 (60 Hz) instead of PAL50 (50 Hz), change the TV Type setting to 60 Hz (480i) and then save the changes by pressing Confirm.
Then exit to the Wii Menu and try loading your PAL game again. Now enjoy PAL signal on full 60 FPS on your PAL Wii! :)

- But if your Wii is NTSC-U and you want to play the Majora's Mask PAL WAD, do these steps:
Use wwpacker-Custom.bat batch file from the wwPacker tool set made by fxxkmii and @alpha0000 (download link).
Drag your Majora's Mask PAL WAD and drop to wwpacker-Custom.bat, then modify the region value and, when the WiiGF tool asks you if you want to patch the video mode, choose Smart Patcher and then option PAL -> NTSC.
But I recommend using NTSC-U WAD of Majora's Mask for Wii instead of the PAL one. (If you use a NTSC-U Wii xD)
But if you're using a PAL Wii, do the steps on the up side of this message.
Greetings ;)

--------------------- MERGED ---------------------------

Would it be possible to change video mode of european Majora's Mask to force it 60 hz on a Wii PAL console? Is there any modification for that?
There are two options:

- If your Wii is PAL region, and you want to play it on PAL60 instead of PAL50, then change the Screen settings for set it to PAL60.
For this, do these steps:
Go to the Wii Menu and then click on the Wii Options button, then select Wii Settings.
Then go to the following screens: Wii Settings Page 1 > Screen > TV Type.
You will get three options:
  • EDTV / HDTV (480p) <-- Default setting
  • 50 Hz (576i) <-- PAL50 (Max. speed: 50 FPS)
  • 60 Hz (480i) <-- PAL60 (Max. speed: 60 FPS)
Now, for use your Wii and play your PAL games in PAL60 (60 Hz) instead of PAL50 (50 Hz), change the TV Type setting to 60 Hz (480i) and then save the changes by pressing Confirm.
Then exit to the Wii Menu and try loading your PAL game again. Now enjoy PAL signal on full 60 FPS on your PAL Wii! :)

- But if your Wii is NTSC-U and you want to play the Majora's Mask PAL WAD, do these steps:
Use wwpacker-Custom.bat batch file from the wwPacker tool set made by fxxkmii and @alpha0000 (download link).
Drag your Majora's Mask PAL WAD and drop to wwpacker-Custom.bat, then modify the region value and, when the WiiGF tool asks you if you want to patch the video mode, choose Smart Patcher and then option PAL -> NTSC.
But I recommend using NTSC-U WAD of Majora's Mask for Wii instead of the PAL one. (If you use a NTSC-U Wii xD)
But if you're using a PAL Wii, do the steps on the up side of this message.
Greetings ;)
@totakeke95 Message edited, please read it again
 
Last edited by SaulFabre,
  • Like
Reactions: Mama Looigi

pedro702

Well-Known Member
Member
Joined
Mar 3, 2014
Messages
12,719
Trophies
2
Age
33
XP
8,690
Country
Portugal
There's no list but I know some few games that runs better on N64 VC than Wii64 / Not64:
  • Tom & Jerry in Fists of Furry (injected in Star Fox 64 WAD)
  • Super Smash Bros. 64 (injected in Sin & Punishment WAD or F-ZERO X WAD)
  • Magical Tetris Challenge (injected in Sin & Punishment WAD)
  • AeroGauge (injected in Sin & Punishment WAD)
  • International Superstar Soccer 64 (injected in Star Fox 64 WAD)
Greetings ;)
doesnt smashbros has its own official release?
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: Ohkay