Hacking WiiSXR Remove Pesky Black Bars / Pillars / Columns (gamepad + hdmi) - Hexediting Wii DOL GXRModeObj!

jack44556677

Member
OP
Newcomer
Joined
Dec 22, 2018
Messages
20
Trophies
0
Age
54
XP
137
Country
United States
Are you tired of the wasted screen space on your gamepad and hdmi output from WiiSXR (latest 2.3 beta from 2017, https://github.com/Mystro256/wiisxr/releases/download/2.3/wiiSXR-beta2.3.zip)?

If so I have the solution for you! Attached is the modified WiiSXR dol, with changed display parameters which I manually altered using a hexeditor. Skip the rest of this and just download the main.dol and replace the one in your sd:\apps\WiiSXR folder with it (or read on to understand how I did it and how you might be able to use the process on other wii dol's)!

Please let me know if you have any problems.


Explanation and general process which can be used (in theory) to fix many more wii executables and games that will stubbornly NOT go fullscreen the way they should :

Overview :
I knew what the setting in nintendont (Video Width) was set to to fix the issue for my GC games (it was 690 pixels) and by studying the code for nintendont (and some other documentation strewn around the web) I got lucky and was able to manually edit the WiiSXR dol to accomplish the same!

Details : Looking at the code for nintendont - the process is that when Video Width is set in settings, which is found/stored in nincfg.bin in the third to last byte of the file ( Nintendont/common/include/CommonConfig.h has definition if this changes), is added to 600. Then that value is stored in ViWidth, followed by (720 - ViWidth (value just stored)) / 2 stored into xOrig. Allthough this worked for the menu, it caused a 15 pixel black column on the left hand side when in-game as a result of the way wiisx displays the psx rendered frame. Once I made xorig 0 (specifying no x offset), and added 21 to the computed ViWidth value that worked properly with/expecting that 21px x offset (690, 90 was the correct value in nintendont for me) 690 + 21 = 711 = 2c7 then both the menu and the psx render worked!!!

I was not sure which display mode was being invoked so I edited all of them. In the case of WiiSXR (and many other games) all the display (GXRModeObj) parameters are found in a block together. In main.dol of WiiSXR I found them to begin at offset 0x1B05A4. I found the block by searching for 720x480 in hex (0x028001E0). After I found an explanation of the display block parameters I knew that each individual configuration setting (each one in the block, each corresponding to another display mode - examples can be found here of the types https://libogc.devkitpro.org/group__gxrmode__obj.html & https://github.com/devkitPro/libogc/blob/master/gc/ogc/video_types.h) was 0x3c in length and began (typically) 4 bytes before the first found 0x028001E0 (720480 dec). I found an invaluable text file here that helped me to parse and understand the configuration settings and how they correlated to the nintendont patch - https://gbatemp.net/attachments/wii-video-mode-for-gx-txt.29369/

Hex-Editing : I will just show one example of the configuration setting being changed, but I changed them all myself because I wasn't sure which display mode would be invoked. The highlighted values are the ones to change, and should serve as a template to complete the others (and likely other Wii games/apps too!)

File: main.dol (from WiiSXR 2.3 Beta, link at top of this post)
Starting Offset : 0x1B05A4

Untouched original row, with header titles and added spaces to make the seperate values clear.
vi fbw ebw? xfbH xOri yOri Widt heig xFBMode fRend aa Sample Pattern VFilter
00000014 0280 01E0 01E0 0028 0000 0280 01E0 000000000001 00 00 060606060606060606060606060606060606060606060606 08080A0C0A0808

Edited row with changed values bold and underlined.

vi fbw ebw? xfbH xOri yOri Widt heig xFBMode fRend aa Sample Pattern VFilter
00000014 0280 01E0 01E0 0000 0000 02C7 01E0 000000000001 00 00 060606060606060606060606060606060606060606060606 08080A0C0A0808

As you can see, only Xorig and ViWidth are altered. Repeat that process for all the other display object parameters in the block (they were all grouped together in this dol, hopefully that is consistent in other ones) and you will have removed the black bars / pillars / columns and have real full screen!

Relevant Reading / Resources Used (further reading) :

https://devkitpro.org/viewtopic.php?f=14&t=335
https://pokeacer.xyz/wii/pdf/VI.pdf#G13.1052792
https://github.com/FIX94/Nintendont...de42866#diff-b0370a9095f90f6ab20086c378480710 (kernel/patch.c being the relevant code for the VideoScale gxdisplayobj patch)

Enjoy!
 

Attachments

  • WiiSXR_2.3beta_WiiuWidescreenFix_NoBlackBars_NoColumns_NoPillars_main.dol_only.7z
    595.5 KB · Views: 215

banjotooie

Member
Newcomer
Joined
May 26, 2009
Messages
13
Trophies
0
XP
220
Country
Nice work. Now we just need someone to modify the boot file to auto load a single game so we can make costom playstation game tiles on the wii u system menu :P
 

niuus

Well-Known Member
Member
Joined
Mar 4, 2016
Messages
2,023
Trophies
1
XP
4,456
Country
Venezuela
Are you tired of the wasted screen space on your gamepad and hdmi output from WiiSXR (latest 2.3 beta from 2017, https://github.com/Mystro256/wiisxr/releases/download/2.3/wiiSXR-beta2.3.zip)?

If so I have the solution for you! Attached is the modified WiiSXR dol, with changed display parameters which I manually altered using a hexeditor. Skip the rest of this and just download the main.dol and replace the one in your sd:\apps\WiiSXR folder with it (or read on to understand how I did it and how you might be able to use the process on other wii dol's)!

Please let me know if you have any problems.


Explanation and general process which can be used (in theory) to fix many more wii executables and games that will stubbornly NOT go fullscreen the way they should :

Overview :
I knew what the setting in nintendont (Video Width) was set to to fix the issue for my GC games (it was 690 pixels) and by studying the code for nintendont (and some other documentation strewn around the web) I got lucky and was able to manually edit the WiiSXR dol to accomplish the same!

Details : Looking at the code for nintendont - the process is that when Video Width is set in settings, which is found/stored in nincfg.bin in the third to last byte of the file ( Nintendont/common/include/CommonConfig.h has definition if this changes), is added to 600. Then that value is stored in ViWidth, followed by (720 - ViWidth (value just stored)) / 2 stored into xOrig. Allthough this worked for the menu, it caused a 15 pixel black column on the left hand side when in-game as a result of the way wiisx displays the psx rendered frame. Once I made xorig 0 (specifying no x offset), and added 21 to the computed ViWidth value that worked properly with/expecting that 21px x offset (690, 90 was the correct value in nintendont for me) 690 + 21 = 711 = 2c7 then both the menu and the psx render worked!!!

I was not sure which display mode was being invoked so I edited all of them. In the case of WiiSXR (and many other games) all the display (GXRModeObj) parameters are found in a block together. In main.dol of WiiSXR I found them to begin at offset 0x1B05A4. I found the block by searching for 720x480 in hex (0x028001E0). After I found an explanation of the display block parameters I knew that each individual configuration setting (each one in the block, each corresponding to another display mode - examples can be found here of the types https://libogc.devkitpro.org/group__gxrmode__obj.html & https://github.com/devkitPro/libogc/blob/master/gc/ogc/video_types.h) was 0x3c in length and began (typically) 4 bytes before the first found 0x028001E0 (720480 dec). I found an invaluable text file here that helped me to parse and understand the configuration settings and how they correlated to the nintendont patch - https://gbatemp.net/attachments/wii-video-mode-for-gx-txt.29369/

Hex-Editing : I will just show one example of the configuration setting being changed, but I changed them all myself because I wasn't sure which display mode would be invoked. The highlighted values are the ones to change, and should serve as a template to complete the others (and likely other Wii games/apps too!)

File: main.dol (from WiiSXR 2.3 Beta, link at top of this post)
Starting Offset : 0x1B05A4

Untouched original row, with header titles and added spaces to make the seperate values clear.
vi fbw ebw? xfbH xOri yOri Widt heig xFBMode fRend aa Sample Pattern VFilter
00000014 0280 01E0 01E0 0028 0000 0280 01E0 000000000001 00 00 060606060606060606060606060606060606060606060606 08080A0C0A0808

Edited row with changed values bold and underlined.

vi fbw ebw? xfbH xOri yOri Widt heig xFBMode fRend aa Sample Pattern VFilter
00000014 0280 01E0 01E0 0000 0000 02C7 01E0 000000000001 00 00 060606060606060606060606060606060606060606060606 08080A0C0A0808

As you can see, only Xorig and ViWidth are altered. Repeat that process for all the other display object parameters in the block (they were all grouped together in this dol, hopefully that is consistent in other ones) and you will have removed the black bars / pillars / columns and have real full screen!

Relevant Reading / Resources Used (further reading) :

https://devkitpro.org/viewtopic.php?f=14&t=335
https://pokeacer.xyz/wii/pdf/VI.pdf#G13.1052792
https://github.com/FIX94/Nintendont...de42866#diff-b0370a9095f90f6ab20086c378480710 (kernel/patch.c being the relevant code for the VideoScale gxdisplayobj patch)

Enjoy!
If you are interested, you could attach the edited source files here on a zip or submit a pull request yourself for this change to be officially introduced in WiiSXRX, so you wouldn't need to hex-hack the following updates.
 
  • Like
Reactions: SaulFabre

SaulFabre

I like Yoshis and the Wii/Wii U scene.
Member
Joined
Feb 6, 2019
Messages
3,175
Trophies
2
Age
25
Location
Ecuador
Website
saulfabreg-wiivc.blogspot.com
XP
7,795
Country
Ecuador
If you are interested, you could attach the edited source files here on a zip or submit a pull request yourself for this change to be officially introduced in WiiSXRX, so you wouldn't need to hex-hack the following updates.
@niuus
Sorry for bump :P
Looks like this small fix is so lots of easier than u think :)
This small "problem" of the pesky black bars can be fixed if you change this line 54 on the file Gamecube/libgui/GraphicsGX.cpp :

Before (at line 54):

Code:
#if 0
        if(CONF_GetAspectRatio()) {
            vmode->viWidth = 678;
            vmode->viXOrigin = (VI_MAX_WIDTH_PAL - 678) / 2;
        }
#endif
        if (memcmp( &vmode_phys, &TVPal528IntDf, sizeof(GXRModeObj)) == 0)
            memcpy( &vmode_phys, &TVPal576IntDfScale, sizeof(GXRModeObj));
        break;

After (at line 54):

Code:
#if 1
        if(CONF_GetAspectRatio()) {
            vmode->viWidth = 678;
            vmode->viXOrigin = (VI_MAX_WIDTH_PAL - 678) / 2;
        }
#endif
        if (memcmp( &vmode_phys, &TVPal528IntDf, sizeof(GXRModeObj)) == 0)
            memcpy( &vmode_phys, &TVPal576IntDfScale, sizeof(GXRModeObj));
        break;

And that's it, you have a bit more stretched out displayed image to fill 16:9 screen better, specially if you're using the Wii U GamePad.

This was taken from @FIX94's Mupen64GC-FIX94, but i personally have tested this fix on Dolphin (and it works fine for me). Didn't test it on real hardware though.

I've made a small PR for that, hope you can test it and merge it.
https://github.com/niuus/WiiSXRX/pull/87

Also, i saw this https://gbatemp.net/threads/wiisx-rx-a-new-fork.570252/post-9193517
So i decided to help with this "unknown" fix.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    NinStar @ NinStar: unless nintendo is going to start selling consoles at a loss that thing won't be cheap based on...