Hacking Possible to Disable the Wii's (De)Flicker Filter?

NoobletCheese

Well-Known Member
Member
Joined
Aug 12, 2018
Messages
409
Trophies
0
Age
23
XP
771
Country
United States
Or can anyone help me figure out the process of turning a dither removal into a cheat code? I know to you remove it from the .dol, but not how to make it a cheat.

GXSetDither seems to be:
XXXXXXXX3C80CC0138A000613800000080C702205066177A98A4800090C4800090C70220B00700024E800020

XXXXXXXX seems to vary between games, but we always want to replace it with either 4E800020 or 48000028.

For this example we'll replace it with 4E800020 ("return" instruction).

Gecko code should be:
28YYYYYY 00003C80 // if 2 bytes at mem address 0x80YYYYYY contain 3C80
06ZZZZZZ 00000008 // write to mem address 0x80ZZZZZZ the following 8 bytes
4E800020 3C80CC01 // 8 bytes to be written
e0000000 80008000 // end of code

YYYYYY
YYYYYY = mem address discovered with eg. Dolphin debugging UI (Config > interface tab > show debugging UI) which contains the string 3C80CC0138A000613800000080C702205066177A98A4800090C4800090C70220B00700024E800020

Dolphin debugging UI doesn't seem to find long strings, so click "dump MRAM" which dumps to C:\Users\YourUsername\Documents\Dolphin Emulator\Dump\mem1.raw

Then inside mem1.raw search the string and get the offset highlighted in red:

gm76NC.png


So for this game YYYYYY = 4BDC50

ZZZZZZ
ZZZZZZ = YYYYYY - 4
= 4BDC50 - 4 (eg. Windows calculator > view > programmer > hex radio button)
= 4BDC4C

So the code for this game would be:
284BDC50 00003C80 // if 2 bytes at mem address 0x804BDC50 contain 3C80
064BDC4C 00000008 // write to mem address 0x804BDC4C the following 8 bytes
4E800020 3C80CC01 // 8 bytes to be written
e0000000 80008000 // end of code

An alternative to disabling dithering is to patch the game's vfilter to a weak strength filter like 04041010100404 ("Low" in ULGX Enhanced) which reduces dithering artefacts a bit at expense of some image clarity.
 
Last edited by NoobletCheese,
  • Like
Reactions: iGom

TheLegendOfXela

Well-Known Member
Newcomer
Joined
Jan 8, 2019
Messages
72
Trophies
0
XP
218
Country
United States
GXSetDither seems to be:
XXXXXXXX3C80CC0138A000613800000080C702205066177A98A4800090C4800090C70220B00700024E800020

XXXXXXXX seems to vary between games, but we always want to replace it with either 4E800020 or 48000028.

For this example we'll replace it with 4E800020 ("return" instruction).

Gecko code should be:
28YYYYYY 00003C80 // if 2 bytes at mem address 0x80YYYYYY contain 3C80
06ZZZZZZ 00000008 // write to mem address 0x80ZZZZZZ the following 8 bytes
4E800020 3C80CC01 // 8 bytes to be written
e0000000 80008000 // end of code

YYYYYY
YYYYYY = mem address discovered with eg. Dolphin debugging UI (Config > interface tab > show debugging UI) which contains the string 3C80CC0138A000613800000080C702205066177A98A4800090C4800090C70220B00700024E800020

Dolphin debugging UI doesn't seem to find long strings, so click "dump MRAM" which dumps to C:\Users\YourUsername\Documents\Dolphin Emulator\Dump\mem1.raw

Then inside mem1.raw search the string and get the offset highlighted in red:

gm76NC.png


So for this game YYYYYY = 4BDC50

ZZZZZZ
ZZZZZZ = YYYYYY - 4
= 4BDC50 - 4 (eg. Windows calculator > view > programmer > hex radio button)
= 4BDC4C

So the code for this game would be:
284BDC50 00003C80 // if 2 bytes at mem address 0x804BDC50 contain 3C80
064BDC4C 00000008 // write to mem address 0x804BDC4C the following 8 bytes
4E800020 3C80CC01 // 8 bytes to be written
e0000000 80008000 // end of code

An alternative to disabling dithering is to patch the game's vfilter to a weak strength filter like 04041010100404 ("Low" in ULGX Enhanced) which reduces dithering artefacts a bit at expense of some image clarity.

Oh man… that’s way out of my expertise. Any chance someone here could make 1 code, for Animal Crossing City Folk, please?
 

NoobletCheese

Well-Known Member
Member
Joined
Aug 12, 2018
Messages
409
Trophies
0
Age
23
XP
771
Country
United States
Ghouls n ghosts and others.

I checked it out (Ghosts n Goblins) and yes the graphics do look filtered.

Disabling Wii's filter in Dolphin has no effect on anything. I've never observed Dolphin fail to remove it from any game.

Maybe the arcade board has its own filtering as those old arcade machines used CRTs.
 

mive

Well-Known Member
Member
Joined
Jul 19, 2018
Messages
252
Trophies
0
Age
38
XP
577
Country
Germany
you need to unpack arcade wad, decompress 0000001.app (lz11), remove filter, (maybe optional) compress 000001.aṕp, repack wad. If you want I can upload a python script which does this for you, but its only for linux (should be in this thread somewhere)
 

mive

Well-Known Member
Member
Joined
Jul 19, 2018
Messages
252
Trophies
0
Age
38
XP
577
Country
Germany
do you mean ghost and goblins (arcade) or ghouls n ghosts (genesis/mega drive/pce)? because afaik only ghost and goblins has an wii vc arcade version
 

mive

Well-Known Member
Member
Joined
Jul 19, 2018
Messages
252
Trophies
0
Age
38
XP
577
Country
Germany
1. unpack wad
Code:
[email protected]:/tmp/Ghosts 'n Goblins (Europe) (Arcade)/tmp$ wadunpacker Ghosts\ \'n\ Goblins\ \(Europe\)\ \(Arcade\)\ \(Virtual\ Console\).wad
wad header:
0000: 00000020 49730000 00000a00 00000000
0010: 000002a4 0000034c 01303dc0 00034600
--- cid=00000000 index=0000 type=0001 len=00034600
--- cid=00000001 index=0001 type=0001 len=001b7080
--- cid=00000002 index=0002 type=8001 len=0045940f
--- cid=00000003 index=0003 type=0001 len=0028d874
--- cid=00000004 index=0004 type=8001 len=0020e900
--- cid=00000005 index=0005 type=0001 len=003056f5
--- cid=00000006 index=0006 type=8001 len=0005a8c0
--- cid=00000007 index=0007 type=8001 len=0037adfc
--- cid=00000008 index=0008 type=8001 len=000f7e8a
--- cid=00000009 index=0009 type=0001 len=00050500
2. decompress 00000001.app
Code:
[email protected]:/tmp/Ghosts 'n Goblins (Europe) (Arcade)/tmp/0001000145353450$ gbalzss --lz11 d 00000001.app 00000001_decompressed.app
3. open 00000001_decompressed.app file in hex editor
search for
Code:
2C 03 00 00 41 82 00 F8 89 04 00 00 38 00 00 00 89 44 00 01 38 60 00 00 51 00 07 3E 88 E4 00 06 51 40 26 36 89 04 00 0C 50 E3 07 3E 38 E0 00 00 51 07 07 3E 89 44 00 0D 89 64 00 07 39 00 00 00 51 47 26 36 89 44 00 02 89 24 00 12 51 63 26 36 51 40 45 2E 89 44 00 0E 51 28 07 3E 89 24 00 13 51 47 45 2E 89 44 00 03 51 28 26 36 89 24 00 14 51 40 64 26 89 44 00 0F 51 28 45 2E 89 24 00 15 51 47 64 26 89 44 00 04 89 64 00 08 51 28 64 26 51 40 83 1E 89 44 00 10 89 24 00 16 51 63 45 2E 89 64 00 09 51 47 83 1E 89 44 00 05 51 28 83 1E 89 24 00 11 51 63 64 26 89 64 00 0A 51 40 A2 16 89 44 00 0B 51 27 A2 16 88 84 00 17 39 20 00 01 51 63 83 1E 51 43 A2 16 50 88 A2 16 51 20 C0 0E 39 40 00 02 39 20 00 03 38 80 00 04 51 43 C0 0E 51 27 C0 0E 50 88 C0 0E 48 00 00 24 3D 00 01 66 3C 60 02 66 3C E0 03 66 3C 80 04 66 38 08 66 66 38 63 66 66 38 E7 66 66 39 04 66 66 3D 20 CC 01 39 40 00 61 99 49 80 00 2C 05 00 00 38 80 00 53 39 60 00 00 90 09 80 00 38 00 00 54 39 80 00 00 50 8B C0 0E 99 49 80 00 50 0C C0 0E 90 69 80 00 99 49 80 00 90 E9 80 00 99 49 80 00 91 09 80 00 41 82 00 40

png1.png

and change to

Code:
2C 03 00 00 41 82 00 F8 89 04 00 00 38 00 00 00 89 44 00 01 38 60 00 00 51 00 07 3E 88 E4 00 06 51 40 26 36 89 04 00 0C 50 E3 07 3E 38 E0 00 00 51 07 07 3E 89 44 00 0D 89 64 00 07 39 00 00 00 51 47 26 36 89 44 00 02 89 24 00 12 51 63 26 36 51 40 45 2E 89 44 00 0E 51 28 07 3E 89 24 00 13 51 47 45 2E 89 44 00 03 51 28 26 36 89 24 00 14 51 40 64 26 89 44 00 0F 51 28 45 2E 89 24 00 15 51 47 64 26 89 44 00 04 89 64 00 08 51 28 64 26 51 40 83 1E 89 44 00 10 89 24 00 16 51 63 45 2E 89 64 00 09 51 47 83 1E 89 44 00 05 51 28 83 1E 89 24 00 11 51 63 64 26 89 64 00 0A 51 40 A2 16 89 44 00 0B 51 27 A2 16 88 84 00 17 39 20 00 01 51 63 83 1E 51 43 A2 16 50 88 A2 16 51 20 C0 0E 39 40 00 02 39 20 00 03 38 80 00 04 51 43 C0 0E 51 27 C0 0E 50 88 C0 0E 48 00 00 24 3D 00 01 66 3C 60 02 66 3C E0 03 66 3C 80 04 66 38 08 66 66 38 63 66 66 38 E7 66 66 39 04 66 66 3D 20 CC 01 39 40 00 61 99 49 80 00 2C 05 00 00 38 80 00 53 39 60 00 00 90 09 80 00 38 00 00 54 39 80 00 00 50 8B C0 0E 99 49 80 00 50 0C C0 0E 90 69 80 00 99 49 80 00 90 E9 80 00 99 49 80 00 91 09 80 00 48 00 00 40

png2.png

4. compress 00000001_decompressed.app
Code:
[email protected]:/tmp/Ghosts 'n Goblins (Europe) (Arcade)/tmp/0001000145353450$ rm 00000001.app && gbalzss --lz11 e 00000001_decompressed.app 00000001.app

5. repack wad
Code:
[email protected]:/tmp/Ghosts 'n Goblins (Europe) (Arcade)/tmp$ wadpacker 0001000145353450 "Ghosts 'n Goblins (Europe) (Arcade) (Virtual Console)(No VFilter).wad"
Cert... OK
TMD... OK
There are 10 files described on the TMD.
Ticket... OK
00000000.app... OK
00000001.app... OK
00000002.app... OK
00000003.app... OK
00000004.app... OK
00000005.app... OK
00000006.app... OK
00000007.app... OK
00000008.app... OK
00000009.app... OK
Header... OK
Writing Ghosts 'n Goblins (Europe) (Arcade) (Virtual Console)(No VFilter).wad file... OK


edit:
try also setting scanlines to 1 instead of off (off seems to use some sort of bilinear filtering which is much better (or disabled) with scanline setting)
 
Last edited by mive,

NoobletCheese

Well-Known Member
Member
Joined
Aug 12, 2018
Messages
409
Trophies
0
Age
23
XP
771
Country
United States
I've already disabled it but it's still the same.

Yeah it's not the Wii's vfilter as Dolphin can always kill it regardless of whether the game uses compression, and toggling it on and off shows no difference in image quality (unless Ghouls n Goblins is set to 480i).

So I'm 99% sure it's not Wii's vfilter causing it, but something exclusive to the games themselves. In the same way "set dark filter" function was exclusive to N64 games, maybe there is a similar unique function these arcade games can use to set their own deflicker filter.

So we'd have to find it, possibly by toggling between 240p and 480i and dumping memory contents to see what changed, if as you say that removes the filter.

Speculation: maybe it's not actually a deflicker filter but the game simply rendering at 240p and getting bilinear scaling to 480p instead of the optimal line-doubling ("double strike") for 480i mode.

I looked at Altered Beast USA vs EUR arcade versions and strangely the EUR version is filtered, USA is not, and toggling Wii's vfilter has no effect either.. a bit like how the JPN ver of Bomberman 94 has a filter and USA ver does not. ¹
 

NoobletCheese

Well-Known Member
Member
Joined
Aug 12, 2018
Messages
409
Trophies
0
Age
23
XP
771
Country
United States
NoobletCheese wouldn't it be possible then to disable double strike ?

I thought we want to enable double strike to avoid the bilinear scaling, if bilinear is the culprit. But looking at the SDK it seems double strike mode is just 240p output from the console, not 480i with field 1 and field 2 containing the same image. There is no 480p double strike mode either. I'll just try all the modes and see what happens...
 
General chit-chat
Help Users
  • No one is chatting at the moment.
    KenniesNewName @ KenniesNewName: And no it's not a pic of uremum