So for the past few days I've been playing around trying to see what I could do with Virtual Console. Since I don't own a Wii console, I am doing all of my testing with the dolphin emulator. You can create ROM hacks that work with VC; Skelux got SM64 Multiplayer to work with it. However, I have found some limitations that makes it difficult to directly port hacks to VC. Now I have little to no experience with wads and wii hacking, so some of these issues might have an easy fix that I don't know about. I'll update this main post if there is a fix for any of these issues.
There are 3 main issues that I'm having with extended ROMS:
1.) No expansion pack support as far as I know.
2.) 32MB seems to be the maximum ROM size. I don't know if there is a larger .wad file than Sin and Punishment.
3.) Injecting a ROM into the wad seems to cause the dialog text to get messed up. This also happens when I try to inject the 8MB ROM as well. (see screenshots spoiler below)
The biggest issue being the lack of expansion pack support. I thought about using a Majora's Mask wad file, but that seems to have poor support with dolphin. Does anyone have any ideas?
// Overwriting part of the top levelscript to call a custom function .org0x108A18 hex{
11 08 00 00 80 2C B1 C0
}
//(802CB1C0) Function that will copy data from the ROM to the RAM .org0x861C0 ADDIUSP, SP, $FFE8 SWRA, $0014(SP) SWA0, $0010(SP)// lvl cmd 0x11 safeguard
// Do not remove these following 4 instructions JAL@osViBlack MOVA0, R0 LUIT0, 0x8039 SWR0, 0xBE24(T0)// Set level accumulator to 0
Inspired by this post, I decided to take a crack at Wii WAD injection of SM64 hacks. With help from David and abitalive, I was able to make some progress. I tried two different programs for injection.
Auto Injectuwad Injector v3
Auto Injectuwad Injector v3 has a nice GUI and appears to work some of the time, but it is very inconsistent. Given the same set of input WAD and ROM files, it produces different output files. This can be seen by the md5sum sum being different and it doesn't respect the region specified, so Dolphin reports varying regions and tries to run it as a PAL WAD. Dolphin screenshot showing two different outputs given same inputs to Injectuwad:
Devilken Injector Devilken Injector is a bit harder to work with, but once you understand what inputs it's expecting, its outputs are consistent and I've been somewhat satisfied with the results. I was able to successfully inject the SM64 (U) stock ROM and a "Hello World" patched version of the ROM with it.
Devilken Injector Usage:
copy Devilken Injector to a very short path location without space (e.g.: C:\VC\ )
copy .wad file to C:\VC\ and make sure it doesn't have spaces in name
make directory to hold N64 ROM (e.g.: C:\VC\SM64hack\ )
copy .z64 ROM to C:\VC\SM64hack\ and make sure it doesn't have spaces in name
open cmd prompt in C:\VC and run "vc.exe [WADFILE] [ROM_DIR]" (e.g.: "vc.exe OOT.wad SM64hack" )
after dumping osme WAD information, it'll ask for region code, enter "1" for USA
it'll then prompt for 4 character ID, just copy the old ID as prompted
resulting WAD is title.wad
I tried the following WADs:
WAD
Result
Mario Kart 64
Works well, up to 12MB ROMs
Sin & Punishment
Works ok, with graphic glitches. Supports up to 32MB ROM
Super Mario 64
Works well, but only with 8MB ROMs
Zelda: Ocarina of Time
Works well, up to 32MB ROM
Spoiler: ASM Code
Code:
// SM64 (U) Hello World example using bass assembler
// overwrite the debug function 80253720/0E720 called from Mario's behavior
// overwrite 80253720/0E720
origin 0x0E720
base 0x80253720
HelloWorld: {
// increase stack and store return address
addiu sp, sp, -0x18
sw ra, 0x14(sp)
la a2, hello_string // message location
li a0, 0xA0 // X position of text
li a1, 0x28 // Y position of text
jal PrintXY
nop
// restore return address and jump back
lw ra, 0x14(sp)
jr ra
addiu sp, sp, 0x18
}
// ensure new code isn't too large
if pc() > 0x80253838 {
error "code + data > 0x80253838"
}
fill 0x80253838-pc()
// store string in data section
origin 0xF1420
hello_string:
db "- Hello World -"
(29-04-2016, 01:29 AM)David Wrote:
2.) 32MB seems to be the maximum ROM size. I don't know if there is a larger .wad file than Sin and Punishment.
ergazoobi mentioned that Ogre Battle 64 is 40MB, so that might be the largest. I also have a sm64compress tool in progress that will compress the SM64 extended ROM by removing all the unused space between scripts and levels, so that may help as well. Its current form is only released as a tool to adjust the DMA offsets for console compatibility.
(29-04-2016, 01:29 AM)David Wrote:
3.) Injecting a ROM into the wad seems to cause the dialog text to get messed up. This also happens when I try to inject the 8MB ROM as well.
I had the same issues for Sin & Punishment. For 32MB, TLOT: Ocarina of Time seems like a better candidate since it doesn't have these text rendering issues.
(29-04-2016, 01:29 AM)David Wrote:
1.) No expansion pack support as far as I know.
The biggest issue being the lack of expansion pack support. I thought about using a Majora's Mask wad file, but that seems to have poor support with dolphin. Does anyone have any ideas?
TLOT: Majora's Mask definitely required the expansion pack on the N64. However, as you mentioned, I cannot even get the WAD to run in Dolphin before injecting so I cannot test it. That's the only WAD I know of that might support it.
(15-08-2016, 06:59 PM)Captain Buggy Wrote:
Also Devilken Injector download links are all dead.
Yeah, that's just not true. Read some of the recent posts in the Devilken Injector thread linked above.
(15-08-2016, 06:59 PM)Captain Buggy Wrote:
This is what I get when injecting the rom hack into the wad.
I've seen stuff like this if the ROM I've injected mixed data in the same RAM regions as code. The ROM would run fine on N64 console, but die in VC WAD injection. Does your ROM hack do anything like this?