Pokemon USUM Ghosting Fix

  • Thread starter Thread starter gking53
  • Start date Start date
  • Views Views 24,045
  • Replies Replies 20
  • Likes Likes 8

gking53

Member
Newcomer
Joined
Jul 10, 2018
Messages
10
Reaction score
10
Trophies
0
Age
27
XP
349
Country
Canada
image.png

Couldn't handle playing USUM with the ghosting outside. Spent a few days in ida and ghidra (couldnt get ghidra debugging to work w citra, but ctr_loader is a must have), found a code that removes the ghosting without affecting the rest of the bloom. Thanks to Moonling for the inspiration and knowledge this may be possible, their fix in FE fates was my catalyst to dive in. I also have the "no outlines" cheat in the image, they stack really well together, custom textures should be the cherry on top.

If anyone wants to do this on other games, this is highly related to the bloom pipeline. For USUM, the ROM has some symbols left in for the main code, editing the AlphaMaskTexture from the bloom pipeline or the bloom SetDrawEnvNode either forced the ghosting to maximum or removed it and blew up the rest of the shader. Lucky for us, the ghosting was only called on the outside pass, which makes debugging much easier. Spent awhile going thru bloom memory references, surrounding calls to the bloom pipeline, getting lost of the DoF pipeline, etc etc etc. Finally got lucky and this call to part of the bloom shader pipeline was the culprit.

If you find any issues lmk, i haven't played thru fully yet but its stable going between inside moms house, outside running, battles, etc. Patch is in .code and not any RO, so this should be pretty stable throughout the game.

Currently only porting to USA copies v1.2 for both games, and UM 1.0 as its the original I decompiled to find this. The function signature is ~trivial to look up if you own a copy of the other games, it was the same for UM 1.0->1.2 and US->UM, likely the same in the other versions just different offset like usual. Search for 0c0090e5000050e3000000a009ffffea (in ida add spaces between bytes) and there should be a single reference, patch the BEQ to B (gateway code EA000000) and you should be good.

[UM 1.0 USA No Ghosting]
0042DA50 EA000000

[UM 1.2 USA No Ghosting]
0042F340 EA000000

[US 1.2 USA No Ghosting]
0042F33C EA000000

[UM 1.0 USA No Ghosting v2]
0042D6E0 EA000032
0042BB8C 00000000
 
Last edited by gking53,
[UM 1.0 USA No Ghosting]
0042DA50 EA000000

[UM 1.2 USA No Ghosting]
0042F340 EA000000

[US 1.2 USA No Ghosting]
0042F33C EA000000
I tried the first one on UM 1.0 and it worked great. It's odd I was just about to start regular moon on lime3ds but that ghosting was driving me nuts. Quick google and this day old post.

So it works on Ultra moon 1.0 on latest lime3ds on my zflip 4, with rudimentary testing. Bravo dude

Edit: I updated to 1.2 and tried that as well and it worked
 
Last edited by WhitronPhenomenon,
  • Like
Reactions: gking53
View attachment 452173
Couldn't handle playing USUM with the ghosting outside. Spent a few days in ida and ghidra (couldnt get ghidra debugging to work w citra, but ctr_loader is a must have), found a code that removes the ghosting without affecting the rest of the bloom. Thanks to Moonling for the inspiration and knowledge this may be possible, their fix in FE fates was my catalyst to dive in. I also have the "no outlines" cheat in the image, they stack really well together, custom textures should be the cherry on top.

If anyone wants to do this on other games, this is highly related to the bloom pipeline. For USUM, the ROM has some symbols left in for the main code, editing the AlphaMaskTexture from the bloom pipeline or the bloom SetDrawEnvNode either forced the ghosting to maximum or removed it and blew up the rest of the shader. Lucky for us, the ghosting was only called on the outside pass, which makes debugging much easier. Spent awhile going thru bloom memory references, surrounding calls to the bloom pipeline, getting lost of the DoF pipeline, etc etc etc. Finally got lucky and this call to part of the bloom shader pipeline was the culprit.

If you find any issues lmk, i haven't played thru fully yet but its stable going between inside moms house, outside running, battles, etc. Patch is in .code and not any RO, so this should be pretty stable throughout the game.

Currently only porting to USA copies v1.2 for both games, and UM 1.0 as its the original I decompiled to find this. The function signature is ~trivial to look up if you own a copy of the other games, it was the same for UM 1.0->1.2 and US->UM, likely the same in the other versions just different offset like usual. Search for 0c0090e5000050e3000000a009ffffea (in ida add spaces between bytes) and there should be a single reference, patch the BEQ to B (gateway code EA000000) and you should be good.

[UM 1.0 USA No Ghosting]
0042DA50 EA000000

[UM 1.2 USA No Ghosting]
0042F340 EA000000

[US 1.2 USA No Ghosting]
0042F33C EA000000
btw there was some material from USUM in the gigaleaks, i believe it's partial but if you want to keep modding the game that would help
 
View attachment 452173
Couldn't handle playing USUM with the ghosting outside. Spent a few days in ida and ghidra (couldnt get ghidra debugging to work w citra, but ctr_loader is a must have), found a code that removes the ghosting without affecting the rest of the bloom. Thanks to Moonling for the inspiration and knowledge this may be possible, their fix in FE fates was my catalyst to dive in. I also have the "no outlines" cheat in the image, they stack really well together, custom textures should be the cherry on top.

If anyone wants to do this on other games, this is highly related to the bloom pipeline. For USUM, the ROM has some symbols left in for the main code, editing the AlphaMaskTexture from the bloom pipeline or the bloom SetDrawEnvNode either forced the ghosting to maximum or removed it and blew up the rest of the shader. Lucky for us, the ghosting was only called on the outside pass, which makes debugging much easier. Spent awhile going thru bloom memory references, surrounding calls to the bloom pipeline, getting lost of the DoF pipeline, etc etc etc. Finally got lucky and this call to part of the bloom shader pipeline was the culprit.

If you find any issues lmk, i haven't played thru fully yet but its stable going between inside moms house, outside running, battles, etc. Patch is in .code and not any RO, so this should be pretty stable throughout the game.

Currently only porting to USA copies v1.2 for both games, and UM 1.0 as its the original I decompiled to find this. The function signature is ~trivial to look up if you own a copy of the other games, it was the same for UM 1.0->1.2 and US->UM, likely the same in the other versions just different offset like usual. Search for 0c0090e5000050e3000000a009ffffea (in ida add spaces between bytes) and there should be a single reference, patch the BEQ to B (gateway code EA000000) and you should be good.

[UM 1.0 USA No Ghosting]
0042DA50 EA000000

[UM 1.2 USA No Ghosting]
0042F340 EA000000

[US 1.2 USA No Ghosting]
0042F33C EA000000
Would you be able to make the code for ultra sun 1.0? im not able to figure it out
 
Amazing!
I've just tested it with the European version of Ultra Moon 1.2 and it works (although it seems to remove all the bloom, it's still a fair deal).
 

Attachments

  • Pokémon Ultra Moon EUR 1.2 WITH GHOSTING.jpg
    Pokémon Ultra Moon EUR 1.2 WITH GHOSTING.jpg
    397.6 KB · Views: 118
  • Pokémon Ultra Moon EUR 1.2 WITHOUT GHOSTING.jpg
    Pokémon Ultra Moon EUR 1.2 WITHOUT GHOSTING.jpg
    390 KB · Views: 135
how do i use these codes? i want to fix this problem but dont know how
You can do it through the UI of citra/lime, but I find it easier to place the text in a text file of the game ID in the cheats folder. So in my case on Android /lime3ds/cheats/00040000001B5100.txt for ultra moon
 

Attachments

  • Screenshot_20240827_143411_Cx File Explorer.jpg
    Screenshot_20240827_143411_Cx File Explorer.jpg
    93 KB · Views: 142
Thank you so much! It works perfectly
I'm currently playing on a s23 ultra using mandarine+ a citra build I found that is stable and doesn't crash every 2 seconds

I have tried entering all of these codes on my pokemon sun
I see no difference and the bloom is still unbearable any help would be appreciated
Post automatically merged:

I have tried entering all these as cheat codes on pokemon sun and i see no difference on 3x res
 

Attachments

  • Screenshot_20240830_001901_Mandarine.jpg
    Screenshot_20240830_001901_Mandarine.jpg
    745 KB · Views: 159
  • Screenshot_20240830_001849_Mandarine.jpg
    Screenshot_20240830_001849_Mandarine.jpg
    822.7 KB · Views: 169
Hey - any chance you could provide some guidance on getting this to work in a romhack called Supernova Sun? It's a romhack of US v1.2. Currently, running this code crashes the game on launch. I assume the offsets would be different but I am not at all experienced in that. I tried to figure it out but it is certainly far above my paygrade, lol.
 
View attachment 452173
Couldn't handle playing USUM with the ghosting outside. Spent a few days in ida and ghidra (couldnt get ghidra debugging to work w citra, but ctr_loader is a must have), found a code that removes the ghosting without affecting the rest of the bloom. Thanks to Moonling for the inspiration and knowledge this may be possible, their fix in FE fates was my catalyst to dive in. I also have the "no outlines" cheat in the image, they stack really well together, custom textures should be the cherry on top.

If anyone wants to do this on other games, this is highly related to the bloom pipeline. For USUM, the ROM has some symbols left in for the main code, editing the AlphaMaskTexture from the bloom pipeline or the bloom SetDrawEnvNode either forced the ghosting to maximum or removed it and blew up the rest of the shader. Lucky for us, the ghosting was only called on the outside pass, which makes debugging much easier. Spent awhile going thru bloom memory references, surrounding calls to the bloom pipeline, getting lost of the DoF pipeline, etc etc etc. Finally got lucky and this call to part of the bloom shader pipeline was the culprit.

If you find any issues lmk, i haven't played thru fully yet but its stable going between inside moms house, outside running, battles, etc. Patch is in .code and not any RO, so this should be pretty stable throughout the game.

Currently only porting to USA copies v1.2 for both games, and UM 1.0 as its the original I decompiled to find this. The function signature is ~trivial to look up if you own a copy of the other games, it was the same for UM 1.0->1.2 and US->UM, likely the same in the other versions just different offset like usual. Search for 0c0090e5000050e3000000a009ffffea (in ida add spaces between bytes) and there should be a single reference, patch the BEQ to B (gateway code EA000000) and you should be good.

[UM 1.0 USA No Ghosting]
0042DA50 EA000000

[UM 1.2 USA No Ghosting]
0042F340 EA000000

[US 1.2 USA No Ghosting]
0042F33C EA000000
do you know if the hex code would be the same for the modded penumbra moon? i cant find the specific code in my modded version and replacing the reference for 0042F340 doesnt change anything in the game
 
View attachment 452173
Couldn't handle playing USUM with the ghosting outside. Spent a few days in ida and ghidra (couldnt get ghidra debugging to work w citra, but ctr_loader is a must have), found a code that removes the ghosting without affecting the rest of the bloom. Thanks to Moonling for the inspiration and knowledge this may be possible, their fix in FE fates was my catalyst to dive in. I also have the "no outlines" cheat in the image, they stack really well together, custom textures should be the cherry on top.

If anyone wants to do this on other games, this is highly related to the bloom pipeline. For USUM, the ROM has some symbols left in for the main code, editing the AlphaMaskTexture from the bloom pipeline or the bloom SetDrawEnvNode either forced the ghosting to maximum or removed it and blew up the rest of the shader. Lucky for us, the ghosting was only called on the outside pass, which makes debugging much easier. Spent awhile going thru bloom memory references, surrounding calls to the bloom pipeline, getting lost of the DoF pipeline, etc etc etc. Finally got lucky and this call to part of the bloom shader pipeline was the culprit.

If you find any issues lmk, i haven't played thru fully yet but its stable going between inside moms house, outside running, battles, etc. Patch is in .code and not any RO, so this should be pretty stable throughout the game.

Currently only porting to USA copies v1.2 for both games, and UM 1.0 as its the original I decompiled to find this. The function signature is ~trivial to look up if you own a copy of the other games, it was the same for UM 1.0->1.2 and US->UM, likely the same in the other versions just different offset like usual. Search for 0c0090e5000050e3000000a009ffffea (in ida add spaces between bytes) and there should be a single reference, patch the BEQ to B (gateway code EA000000) and you should be good.

[UM 1.0 USA No Ghosting]
0042DA50 EA000000

[UM 1.2 USA No Ghosting]
0042F340 EA000000

[US 1.2 USA No Ghosting]
0042F33C EA000000
The UM 1.2 didnt do anything do you have any tips on how to make it work
 
any chance of this being applicable to the original sun and moon? i assume itll require just as much digging in ida
 
I'm trying to do this on the US v1.0 but the cheat code for UM v1.0 seems to crash my game all the time. i get black screens. any chance the code for US and UM v1.0 might be different? thanks
 
any chance of this being applicable to the original sun and moon? i assume itll require just as much digging in ida
Original Sun and Moon use the same offsets, I tested them both and confirm it works:
[Sun/Moon 1.0 USA No Ghosting]
0041AEE0 EA000000

[Sun/Moon 1.2 USA No Ghosting]
0041C764 EA000000

[Sun/Moon Special Demo Version No Ghosting]
0037CB68 EA000000

I'm trying to do this on the US v1.0 but the cheat code for UM v1.0 seems to crash my game all the time. i get black screens. any chance the code for US and UM v1.0 might be different? thanks
Use the code for US 1.0, not the one for UM:
[Ultra Sun 1.0 USA No Ghosting]
0042DA4C EA000000

how do i use these codes? i want to fix this problem but dont know how
In Citra/Lime emulator, go to Emulation > Configure Current Game > Cheats > Add Cheat
Then paste the code in the code section that corresponds to your version of SM/USUM. Click the checkbox to activate the cheat and then restart the game.

If using custom firmware on actual 3DS hardware (Luma), you would need an ips file to patch into the game. Not sure how to do that, there might be tutorials that apply in this case.
 
Was wondering if anyone has a working version for the european version of Sun 1.2? (and maybe also one for removing the outlines)
 
might have a better fix. I noticed in some fights there were visual glitches on the original one. Like eyes would look weird in fights, etc. Only tested on UM 1.0:

[Ultra Moon 1.0 Ghosting Fix v2]
0042D6E0 EA000032
0042BB8C 00000000

Instead of bypassing the entire render pass which would effectively kill anything that tried to use the same gpu context as the motion blur / ghosting render, this just skips the blur passes and the composition for the motion blur.

I dont have UM updates or US on hand anymore, but porting should be similar work to the original codes. Two searches to do,
  • E0 00 95 E5 00 40 A0 E3 00 00 50 E3
    • 12 bytes after there there will be a 9A you want to patch to an EA, use the EA000032 code with that 12 byte offset from the search
  • 18 00 D9 E5 00 00 50 E3
    • 4 bytes after that there will be an 0A you want to use the full 0 code on.
UM is only showing a single result for those 2 searches, hopefully UM updates and US are identical
 

Site & Scene News

Popular threads in this forum