Need help with N64 VC Injects

  • Thread starter Thread starter Memes1921
  • Start date Start date
  • Views Views 14,117
  • Replies Replies 86
  • Likes Likes 2
@pedro702 .ini is Default, I literally said it last sentence. The Nintendo config causes issues with many hacks for that specific game (found out in actual testing). Some constrained hacks like Black Pit etc. run Perfect, while many others cannot function properly/nominally to different levels. That includes Widescreen hacks/patches applied to VC.

Paper Mario has always been a tricky game to emulate properly. Every emulated version of the game has issues to begin with.

@Memes1921 I'm gonna thinker with these settings. Thanks for the hint! =)
 
I was looking at the configuration file for the games Tony Hawk's Pro Skater and Spider-Man for the Nintendo Switch and came across settings that work on the Wii U's Virtual Console. Texts are fixed, but the frame rate still bad. "TicksPerInst" and "TicksPerFrame" seems to do nothing.


My custom TV Boot Images: https://archive.org/details/wiiu-n64-custom-inject
 
I was looking at the configuration file for the games Tony Hawk's Pro Skater and Spider-Man for the Nintendo Switch and came across settings that work on the Wii U's Virtual Console. Texts are fixed, but the frame rate still bad. "TicksPerInst" and "TicksPerFrame" seems to do nothing.


My custom TV Boot Images: https://archive.org/details/wiiu-n64-custom-inject

"TicksPerInst" is a Switch exclusive setting. "TicksPerFrame" sometimes doesn't work on some games like CastleVania.
Post automatically merged:

Some things to update:
About the weird WinBack's gray box flying on screen, I believe that can be fixed with a cheat code. The issue is also present in other N64 emulator plugins like Jabo's Direct 3D8. A Github thread was also made for this issue and someone uploaded a video by using a cheat code in cheat engine but of course the quality and clarity of the video has to be bad because it has to. This has also led me to believe that "Lua_BeforeInst" on [SpecialInst] actually goes in the cheat section, this makes sense since on the Switch's configuration file of WinBack. both special instructions have comments like "Hack Controller Pak message" (Which Nintendo doesn't bother to emulate the Controller Pak officially for some reason) and "Hack the shake in box".
Code:
    "SpecialInst" :
    [
        {
            "Addr": "0x800401A8",
            "Inst": "0x4604303C",
            "Type": "Lua_BeforeInst",
            "Comment": "hack the shake in Box"
        },
        {
            "Addr": "0x800910A8",
            "Inst": "0x14620006",
            "Type": "Lua_BeforeInst",
            "Comment": "hack cntpak message"
        }
    ],
So, here's how I would translate it to the Wii U:
Code:
[Cheat]
Cheat0 = 1
;Hack the shake in Box
Cheat0_Addr = 0x800401A8
Cheat0_Value = 0x4604303C
Cheat0_Bytes = 4

Cheat1 = 1
;Hack cntpak message
Cheat1_Addr = 0x800910A8
Cheat1_Value = 0x14620006
Cheat1_Bytes = 4
Though it didn't do anything, but I feel like the missing part has to be on the .lua script. Also, I have found a forum about how do cheat codes work for the Switch's .lua scripts and maybe that could be used as a reference.



As for "DepthCompareLess" and "ZClip" on the Wii U, here's how each setting work:
ZClip changes the Z-Axis of the camera further from 3D objects, here's an image for visual reference as to what I mean (Sorry for my bad handwritting):
ZClip.png


As for DepthCompareLess, it changes the Z-Axis position for 2D textures, here's another image:
DepthCompareLess.png

Although I don't think "DepthCompare" is a valid option since I didn't had any visual difference. Also, Blast Dozer didn't boot with Nintendo's official .ini, not sure what am I doing wrong.
 
Last edited by Memes1921,
Just went to see the wiiu vc inject compatibility list and what did you guys do to the wiki? its all messed up not even alphabetized anymore and there are games listed with issues but no description about the issues, the wiki was alphabetized and nice and now its a total mess its a shame.
 
Although I don't think "DepthCompare" is a valid option since I didn't had any visual difference. Also, Blast Dozer didn't boot with Nintendo's official .ini, not sure what am I doing wrong.
;BlastDozer JAPAN

[RomOption]
MemPak = 1
BackupType = 3
BackupSize = 512
UseTimer = 1

[Render]
NeedPreParse = 1
CanvasWidth = 854
CanvasHeight = 480
CopyAlphaForceOne = 1

[BreakBlockInst]
Count = 0
Address0 = 0x80298DC8
Inst0 = 0x00000000
JmpPC0= 0x80298A34
Type0 = 1

[Idle]
Count = 1
Address0 = 0x80245E70
Inst0 = 0x3C0C8031
Type0 = 1

[RSPG]
GTaskDelay = 681250

;YOU NEED TO USE ONE OF THE FOLLOWING BUILDS.
;SVN: 1918, SVN: 1955, SVN: 1970, SVN: 1991, SVN: 2043.

SVN is the Build used with the Game it came with; SVN: 1680 , That is Donkey Kong 64 / Super Mario 64.
SVN: 1690 Donkey Kong 64 Japan. All builds in the Research and each Build has different Ini Functions mainly the Newer has more Functions.

But each Build is unique although similar some Games wont Boot unless it uses a certain Build or sometimes Video Errors.

Not all Bases have same Functions also DepthCompare could also be a bogus function.

Oh regarding the Wiki it is bit of a wild work in progress I guess lol , I have never edited the Wiki but @pedro702 put a lot of work into editing it while we were working on these ini's and Compatibility Lists.

Perhaps I can throw some Test Ini's in here if others do some testing ie get Games to Boot , Game bugs and glitches need to be listed by others. [Figure out Fixes]
 
Last edited by CORE,
Oh regarding the Wiki it is bit of a wild work in progress I guess lol , I have never edited the Wiki but @pedro702 put a lot of work into editing it while we were working on these ini's and Compatibility Lists.

Perhaps I can throw some Test Ini's in here if others do some testing ie get Games to Boot , Game bugs and glitches need to be listed by others. [Figure out Fixes]
yeah me and other members had the wiki all alphabetized months of finds and work in there, detailed descriptions of the errors and issues now its a total mess they split-ed pal and ntsc which doesn't even make sense since you have a region flag on the wiki so why divide it? and then the games are all over the place not a single thing is in order, why they did that i have no idea, the wiki is unreadable now.
 
  • Wow
Reactions: CORE
@pedro702 Read the previous posts.

@CORE I forgot that you needed to use another build of the emulator, completely slipped out of my mind... I will try again when I get back.

Pardon our dust! We're working on the Wiki so it can be more up to date. Also, I have updated the Custom TV Boot Screens in case anyone wants them.
 
Thanks! Biohazard 2 seems to be fully playable now!
Also, WinBack are working a lot. Check here: https://wiki.gbatemp.net/wiki/WiiU_VC_N64_inject_compatibility_list.
no problem buddy resident evil 2 JPN is running great i just finished playing both LEON A and B and CLAIRE A and B it works until the end.

There's one thing I forgot to mention, megaman64 never ran perfectly, it crashes in one part of the game, if you test it you'll see that it crashes in the battle with the yellow robot boss.
maybe we can make perfect dark work better or even 007 goldeneye but it will be a bit difficult,
I've been thinking that if the virtual console is an official emulator maybe by decompiling it I could get an idea of how to adapt its operation to an N64 emulator but this is just a theory because if we look closely there are some options in it that exist in emulator plugins the problem is that in order to run the games we are trying to discover or convert to the console the inis so that it works well all this manually like idl etcs
 
  • Like
Reactions: YakiNeen
"TicksPerInst" is a Switch exclusive setting. "TicksPerFrame" sometimes doesn't work on some games like CastleVania.
Post automatically merged:

Some things to update:
About the weird WinBack's gray box flying on screen, I believe that can be fixed with a cheat code. The issue is also present in other N64 emulator plugins like Jabo's Direct 3D8. A Github thread was also made for this issue and someone uploaded a video by using a cheat code in cheat engine but of course the quality and clarity of the video has to be bad because it has to. This has also led me to believe that "Lua_BeforeInst" on [SpecialInst] actually goes in the cheat section, this makes sense since on the Switch's configuration file of WinBack. both special instructions have comments like "Hack Controller Pak message" (Which Nintendo doesn't bother to emulate the Controller Pak officially for some reason) and "Hack the shake in box".
Code:
    "SpecialInst" :
    [
        {
            "Addr": "0x800401A8",
            "Inst": "0x4604303C",
            "Type": "Lua_BeforeInst",
            "Comment": "hack the shake in Box"
        },
        {
            "Addr": "0x800910A8",
            "Inst": "0x14620006",
            "Type": "Lua_BeforeInst",
            "Comment": "hack cntpak message"
        }
    ],
So, here's how I would translate it to the Wii U:
Code:
[Cheat]
Cheat0 = 1
;Hack the shake in Box
Cheat0_Addr = 0x800401A8
Cheat0_Value = 0x4604303C
Cheat0_Bytes = 4

Cheat1 = 1
;Hack cntpak message
Cheat1_Addr = 0x800910A8
Cheat1_Value = 0x14620006
Cheat1_Bytes = 4
Though it didn't do anything, but I feel like the missing part has to be on the .lua script. Also, I have found a forum about how do cheat codes work for the Switch's .lua scripts and maybe that could be used as a reference.



As for "DepthCompareLess" and "ZClip" on the Wii U, here's how each setting work:
ZClip changes the Z-Axis of the camera further from 3D objects, here's an image for visual reference as to what I mean (Sorry for my bad handwritting):
View attachment 480202

As for DepthCompareLess, it changes the Z-Axis position for 2D textures, here's another image:
View attachment 480204
Although I don't think "DepthCompare" is a valid option since I didn't had any visual difference. Also, Blast Dozer didn't boot with Nintendo's official .ini, not sure what am I doing wrong.
the winback game had the same gray box problem on emulators
on pc this was fixed with the glindeN64 3.0 plugin if I'm not mistaken
maybe you'll find a reference there on how to fix it, if I'm not
I'm not mistaken, it's just something that was added.
 
the winback game had the same gray box problem on emulators
on pc this was fixed with the glindeN64 3.0 plugin if I'm not mistaken
maybe you'll find a reference there on how to fix it, if I'm not
I'm not mistaken, it's just something that was added.
I did looked into how GlideN64 fixes some stuff but it wouldn't be easy to add those features to the Wii U emulator since it's basically rewritting how does the Wii U VC emulator renders graphics and the .ini file can't do that, sadly. Either way, it's interesting to read how does GlideN64 fixes some stuff like how PilotWings 64's shadow rendering is calculated through a combination of FB effects and N64 Depth Compare, the info is on these Blogs. Although, some HLE bugs like WinBack's gray square and PilotWings 64's shadow glitch can be fixed with cheat codes, which I need to figure out how to implement them properly in the emulator.
@CORE, do you know which builds of the emulator support cheat codes? Also, do you know how to convert GameShark cheat codes into RAW format? I'm trying to figure that out to fix the things I said earlier.
 
I dont think the early builds such as DK64 support it because back when someone explained the Code Conversion Process I tryed the Cheat = Function. DK64 End Boss Inf Health, it did not work but I did manage to get it working.

I copied DK64 into F-Zero X Build the latest and the Cheat = Function worked Inf Health , I have notes somewhere I will post when come across them and the Member here on this site too?

@JacobM did you help out with Cheats at one point?

@andot ?

These may help out https://doc.kodewerx.org/hacking_n64.html#gs_code_types
https://doc.kodewerx.org/hacking_n64.html#hack_basics_ram
https://macrox.gshi.org/The Hacking Text.htm#learn_your_shark

This thread may help https://gbatemp.net/threads/wiiu-vi...re-dark-filter-and-widescreen-support.517158/ try further up page 21?

https://gbatemp.net/threads/wiiu-vi...-filter-and-widescreen-support.517158/page-11

https://github.com/EnterpriseFreak/gs2vc Gameshark to Virtual Console.

Roms can be Patched directly but dont know of a tool to patch cheats to the to the Roms , DS has such a tool but sadly it did not work for me via DS VC the Rom patch works on PC etc but perhaps something blocking in the Emulator. But DS another topic.
 
Last edited by CORE,
I dont think the early builds such as DK64 support it because back when someone explained the Code Conversion Process I tryed the Cheat = Function. DK64 End Boss Inf Health, it did not work but I did manage to get it working.

I copied DK64 into F-Zero X Build the latest and the Cheat = Function worked Inf Health , I have notes somewhere I will post when come across them and the Member here on this site too?

@JacobM did you help out with Cheats at one point?

@andot ?

These may help out https://doc.kodewerx.org/hacking_n64.html#gs_code_types
https://doc.kodewerx.org/hacking_n64.html#hack_basics_ram
https://macrox.gshi.org/The Hacking Text.htm#learn_your_shark

This thread may help https://gbatemp.net/threads/wiiu-vi...re-dark-filter-and-widescreen-support.517158/ try further up page 21?

https://gbatemp.net/threads/wiiu-vi...-filter-and-widescreen-support.517158/page-11

https://github.com/EnterpriseFreak/gs2vc Gameshark to Virtual Console.

Roms can be Patched directly but dont know of a tool to patch cheats to the to the Roms , DS has such a tool but sadly it did not work for me via DS VC the Rom patch works on PC etc but perhaps something blocking in the Emulator. But DS another topic.
I'm still skeptical of DK64 not supporting cheat codes because:
1. There are already cheat codes in the official .ini file
2. The VC version of the game has a hack that speeds up the character's speed when there's a lot of lag
Though, not sure if the cheat codes are in other format or something else.
Either way, thanks for all of those resources, really helpful!
 
  • Like
Reactions: CORE
I did looked into how GlideN64 fixes some stuff but it wouldn't be easy to add those features to the Wii U emulator since it's basically rewritting how does the Wii U VC emulator renders graphics and the .ini file can't do that, sadly. Either way, it's interesting to read how does GlideN64 fixes some stuff like how PilotWings 64's shadow rendering is calculated through a combination of FB effects and N64 Depth Compare, the info is on these Blogs. Although, some HLE bugs like WinBack's gray square and PilotWings 64's shadow glitch can be fixed with cheat codes, which I need to figure out how to implement them properly in the emulator.
@CORE, do you know which builds of the emulator support cheat codes? Also, do you know how to convert GameShark cheat codes into RAW format? I'm trying to figure that out to fix the things I said earlier.
I think it would be best to insert the cheat code into the rom instead of using the ini as a patch
in the case of winback I think it would solve
 
Hey guys! I wasn't really that active working on the N64 emulator because of some... stuff. Anyways, here's what I found recently, and I'm also updating some things:

Wii U Configuration Settings:
[Render]
ZClip: Pushes 3D assets/Backgrounds further from the Z-Axis. Setting it to 1 is the same as removing the setting.
ONLY AFFECTS 3D OBJECTS/BACKGROUNDS!
ZClip.png

DepthCompareLess: Moves 2D assets closer on the Z-Axis
ONLY AFFECTS 2D ASSETS!
*No drawing yet, still working on it*
InitPerspectiveMode: Fixes how textures are rendered in chunks, see image for visual reference:
InitPerspectiveMode.png

ForceRectFilterPoint: Tries to remove colored halos around 2D textures. Sometimes also disables bilinear filtering for background textures.

[RSPG]
Skip: Disables video rendering
RIntAfterGTask: Frame skips

[CMP]
BlockSize: Sets the size of data to read in chunks? Blast Dozer has this set to 1C00, which transformed from hexadecimal to decimal equals 7168 (~7 KB)



I was also taking a quick look at Shadow Man's .lua hacks from the Switch's .dtz file and I have found some things that fit perfectly in the Wii U's settings:

[InsertIdleInst]:
Code:
;Switch
BeforeVIFrameEnd = L0_0
function L0_0(A0_3, A1_4)
  local L2_5, L3_6, L4_7
  if A0_3 == 1161760 and A1_4 == 8392737 then
    L2_5 = n64GPRRead32
    L3_6 = 4
    L2_5 = L2_5(L3_6)
    L3_6 = n64GPRRead32
    L4_7 = 5
    L3_6 = L3_6(L4_7)
    L4_7 = n64GPRRead32
    L4_7 = L4_7(6)
    if L2_5 == 2150694912 and L3_6 == 0 and (L4_7 == 691200 or L4_7 == 307200) then
      n64InsertIdle(20, 1161760)
HookFunc_BeforeInst = L0_0
function L0_0(A0_8, A1_9)
  if A0_8 == 2992536 and A1_9 == 878941823 then
    n64InsertIdle(10, 2992536)
    n64GPRWrite32(3, 0)
(Focus only on the "n64InsertIdle" part and the "if, then" sections)
Code:
;Wii U
[InsertIdleInst]
Count = 2
Address0 = 0x0011B0A0
;Maybe address needs to be offset to RDRAM? Or maybe not...
;2nd value from the parentheses, "n64InsertIdle(20, 1161760)"
Inst0 = 0x00BFC6A1
;From "if A0_3 == 1161760 (Address) and A1_4 == 8392737 (Instruction) then
Type0 = 1
Value0 = 20
;1st value from the parentheses, "n64InsertIdle(20, 1161760)"
Address1 = 0x802DA998
Inst1 = 0x345F92DF
;From "if A0_8 == 2992536 and A1_9 == 878941823 then"
Type1 = 1
Value1 = 10
Type2 = 1
I looked at these addresses from Project 64 and the instructions are kind of similar to the ones from the Switch (Looking in the virtual memory, Inst0 = 0x008B2821 & Inst1 = 0x3463967F).

[FrameTickHack]:
Code:
;Switch
  n64ResetParameter("FrameTicks")
  if 2974528 == n64MemRead32(2147821432) then
    if n64MemRead32(n64MemRead32(2147991384) + 0) == 1313035008 and n64MemRead32(n64MemRead32(2147991384) + 4) == 916 and n64MemRead32(n64MemRead32(2147991384) + 8) == 13208 and n64MemRead32(n64MemRead32(2147991384) + 12) == 922 then
      n64SetParameter("FrameTicks", 783250)
    elseif n64MemRead32(n64MemRead32(2147991384) + 0) == 1313035008 and n64MemRead32(n64MemRead32(2147991384) + 4) == 4294967295 and n64MemRead32(n64MemRead32(2147991384) + 8) == 0 and n64MemRead32(n64MemRead32(2147991384) + 12) == 443 then
      n64SetParameter("FrameTicks", 783250)
    elseif n64MemRead32(n64MemRead32(2147991384) + 0) == 1313035008 and n64MemRead32(n64MemRead32(2147991384) + 4) == 367 and n64MemRead32(n64MemRead32(2147991384) + 8) == 5348 and n64MemRead32(n64MemRead32(2147991384) + 12) == 381 then
      n64SetParameter("FrameTicks", 783250)
    elseif n64MemRead32(n64MemRead32(2147991384) + 0) == 1313035008 and n64MemRead32(n64MemRead32(2147991384) + 4) == 372 and n64MemRead32(n64MemRead32(2147991384) + 8) == 5392 and n64MemRead32(n64MemRead32(2147991384) + 12) == 383 then
      n64SetParameter("FrameTicks", 783250)
    elseif n64MemRead32(n64MemRead32(2147991384) + 0) == 1313035008 and n64MemRead32(n64MemRead32(2147991384) + 4) == 378 and n64MemRead32(n64MemRead32(2147991384) + 8) == 5624 and n64MemRead32(n64MemRead32(2147991384) + 12) == 387 then
      n64SetParameter("FrameTicks", 783250)
(Again, only focus on the "FrameTicks" parts)
Code:
;Wii U
[FrameTickHack]
Hack0 = 783250
Hack1 = 783250
Hack2 = 783250
Hack3 = 783250
Hack4 = 783250

Haven't really tested these setting for other games since I'm busy, but I will try them some other day. Also, I was looking at the .rpx file inside the "code" folder and found these 2 things located in [RomOption]:
"n64PIF_TPak_Read" and "n64PIF_TPak_Write"
My personal theory is that these 2 things act like "BackupSize" for the GB(C) ROM and I speculate that the ROM should be placed on the emulator itself and the save data should be placed inside the NAND's save data folder, though I haven't seen any relevant file paths for any of those since after some lines, it's just garbage data because the .rpx tool can't decode any more after some stuff. Or maybe it's used to specify a file path like how "PDFUrl" works or like how MemPak has inside the .rpx (e:\temp\mempak.bin).
I have found this in the decoded .rpx from Donkey Kong 64, I haven't found any traces of it in Mario Tennis tho, meaning that future builds do not support this command.

- UPDATE -
I found that the last build of the emulator to support these commands was Zelda OoT but that version of the emulator doesn't have TPak as an option. Maybe "n64PIF_TPak_Read/Write" wasn't decrypted correctly in future versions of the emulator?
 
Last edited by Memes1921,
  • Like
Reactions: CORE

Site & Scene News

Popular threads in this forum