Hacking Wii U Hacking & Homebrew Discussion

  • Thread starter Thread starter filfat
  • Start date Start date
  • Views Views 5,098,293
  • Replies Replies 21,104
  • Likes Likes 29
fwiw I never had any issues with my dumper and I set up rednand on three different consoles. maybe some patches got lost in the public release

Of course there has always appeared to be some stuff "lost in the public release" (like bugs and missing sections) but the question has always been was it intentional or accidental.

This is some of what @Datalogger has said in the past.

OK, it looks like SMEA's .py script is failing to keep things Word Aligned properly.
If you extract the elf and run readelf -a, it does great until it gets down to virtual address 0x124C6000, where it stops Word Aligning.

Edit:
I can get it to make an almost perfect copy by rem'ing out two lines in the .PY script:
Code:
      #if not(special):
                      #self.phdrs[i].p_offset = data_offset


When I turn off all patches, it creates a new FW.IMG that is only one byte different than a "Stock" clean FW.IMG

The only difference is that one single 0x02 it does not put at 0x4975BF
(And of course the SHA because of it.)

Not sure what the "If Not (special):" was for, but without it, everything Word Aligns perfectly.


Edit2: =done.
OK, I got it to make a 100% same FW.IMG file by the change above and adding this to the top of the def encrypt
Code:
    def encrypt(self, file, offset):
        key='02'
        key = key.decode('hex');
        file.seek(0x497DC3)
        file.write(key)
(It's 0x4975bf+0x804 byte Header)

The SHA-1 matches the "stock" FW.IMG 100%

Obviously, I'm not a Python Programmer - but hey, it works!
Show me a more simple way to poke an 0x02 at that offset so I can get back to my comfort zone in raw assembly.




.
 
Last edited by Bug_Checker_,
They basically don't know that the hard part is the graphics.

The Wii U uses a scary swizzling algorithm that was a nightmare, even for @Exzap, but they can nicely steal code from my wiki page about deswizzling Wii U textures.
You don't have to use swizzling though, my Texture2D apps work fine with just a linear RGBA buffer.
 
  • Like
Reactions: I pwned U!
Last edited by AboodXD,
You don't have to use it, but this is an emulator we're talking about, they will have to make a working deswizzling function.

All GTX files and their variants need to be deswizzled, PNG and JPG look fine on Wii U.

Edit: Here's the wiki page I was talking about:
http://mk8.tockdom.com/wiki/GTX_(File_Format)#Swizzling
Why would an emulator need GTX files...? Chances are they're displaying a framebuffer from something and it would take longer to bother swizzling it than any gains which might be gained in performance with swizzling.
 
  • Like
Reactions: I pwned U!
Example of using the code to deswizzle:
  • RGBA8:
    deswizzled_data = swizzle(2048, 512, 1, 0x1A, 4, 0xD0000, 2048, data)
  • DXT5/BC3:
    deswizzled_data = swizzle_BC(2048, 512, 1, 0x33, 4, 0x40000, 512, data)

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

Why would an emulator need GTX files...? Chances are they're displaying a framebuffer from something and it would take longer to bother swizzling it than any gains which might be gained in performance with swizzling.
Here's @Exzap 's explaination:
AboodXD: By the way, how does Cemu handle BFLIM files?
Exzap: It doesn't! That's the magic of emulation. All the decoding is done by the game code (which CEMU executes but it's clueless about).
The only reason we have the swizzeling code is because the data is never unswizzeled on the real hardware and we need to convert textures to a PC readable format.

BFLIM is one of GTX' variants.
 
Last edited by AboodXD,
Example of using the code to deswizzle:
  • RGBA8:
    deswizzled_data = swizzle(2048, 512, 1, 0x1A, 4, 0xD0000, 2048, data)
  • DXT5/BC3:
    deswizzled_data = swizzle_BC(2048, 512, 1, 0x33, 4, 0x40000, 512, data)

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


Here's @Exzap 's explaination:


BFLIM is one of GTX' variants.
OK I think you confused the RetroArch Wii U port with a RetroArch Wii U core, emulators running as Wii U homebrew through RetroArch don't have to deal with swizzling at all.
 

Site & Scene News

Popular threads in this forum