How to Dim the Wii Video Output?

Discussion in 'Wii - Hacking' started by Fruity_Grebbles, Feb 8, 2015.

  1. Fruity_Grebbles
    OP

    Fruity_Grebbles Newbie

    Newcomer
    9
    2
    Feb 8, 2015
    United States
    Basically, I need the Wii to output darker video, and it needs to be done console side.

    Less basically, I'm overlaying some text/graphics on the video stream and for my overlay to detect the white sync signal as independent from bright on screen whites, the whites need to be darker.

    Is there some way I can make the "burn in reduction" dimness on all the time? Or is there another possible fix?
     
  2. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23,522
    9,359
    Nov 21, 2005
    Hmm, a bit different than what we usually see around here.

    I am guessing by sync on white you mean sync on luma and are using component cables (if you have made it to the point in life where you are doing something like this it is a fairly safe bet but hey, though I believe svideo has this). Equally I assume some kind of software mod works for you more than an internal hardware based one. I also assume emulators and a PC side software overlay are not an option here. If this is not some kind of live stream that needs your hardware overlay then I would suggest using some editing software instead. Possibly also if your setup can support it then a Wii U has HDMI which might change things.
    In some cases it might have worked to play with some kind of simple passive device on the output (read sticking a resistor on something) but it sounds like your compositing/overlay device uses a bit of a hacky method to do its overlaying, to that end I am not sure an equivalently hacky method will do you much good here.

    Screen burn in mode helps you say. I must say I have never investigated this mode and have not seen anybody else do it. http://en-americas-support.nintendo...how-to-activate-screen-burn-in-reduction-mode saying it does not work in GC mode would lead me to believe it it IOS based (MIOS being the thing to run GC), though that is not an especially far out concept for the Wii.

    Screen burn in activation being time since input driven it is probably something you could mod into an IOS, and if the Wii is going to use texture animations/shaders/general computed colours I probably would still look at that before I looked at game specific modding, even when I only cared about a single game save perhaps if it was just one aspect of a game causing me trouble. However making your own CIOS* and that saves having to mod some 30 subtle variations on the theme) is not something I have done and not something most do if it is an actual mod -- many people just took IOS modules and changed their representation value. I do not envisage it being a terribly hard modification (it is a button driven timer to activate and dismiss, if you are really flash then you could also tell it to ignore the system settings, and all three can probably be mitigated with maybe 12 bytes being changed**) once you have the IOS module in a disassembled/more human readable form, the trick is getting it to that point and back again once you have changed what you want to change. If you are lucky then it will not be a mode inside the GPU and you can slightly dim colours and retain colour range in final output, if it is a fixed GPU dimming then you will have to suffer colour crush if you insist upon your current setup.

    *I do not know how familiar you are with Wii modding. Crash course if you are not would be IOS are the modules that games use to interact with the system (the system menu plays a comparatively small role in anything and basically none once games are running), hackers mod them into custom IOS modules to do things like read games from USB and all sorts of other things, there are some 30 of them in common use ( http://wiibrew.org/wiki/Template:Navbox_IOS < all those that say active) that different games all use but you can force games, including unmodded real/pressed games, to use a given one (usually a high number custom one) to spare you the hassle for this. The only problem I envisage, other than the hacking itself, is if your game needs a specific one for hardware support, things like rock band and other crazy peripheral type games being the more prominent examples of stuff like this but if you can do one IOS then you can do more easily enough.

    **assuming you can not set the dimming if it turns out to be GPU forced then you would disable the one check to disable the timer/wait to active, another check to prevent it from ending and a final check to disable whether it cares about the system menu settings. Doing it for other ARM based things then that is entirely possible for it to be done with three instructions being changed (would not be the most elegant but who cares really) and at bytes per instruction you have 12 bytes.
     
  3. Fruity_Grebbles
    OP

    Fruity_Grebbles Newbie

    Newcomer
    9
    2
    Feb 8, 2015
    United States
    Whoah, ok, that's a lot of information. Thank you so much! Can you point me in the right direction as far as IOS modding goes? I don't even know where to start.
     
  4. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23,522
    9,359
    Nov 21, 2005
    Step 1 would be to have a hacked Wii. Pretty much every hacking guide will cover installed hacked IOS modules. https://sites.google.com/site/completesg/ if you needed a guide for this sort of thing.

    I do not know what your general level of code reverse engineering/ROM hacking/coding in general/electronics experience is. It need not be for the Wii but something would help here.

    Afraid I have not really kept up with the Wii-IOS hacking behind the scenes/under the bonnet stuff since the very start of it all so I am having a bit of crash course on the matter to type this. You are playing in an area that few people play in, though at least for this initial foray it is not going to be the harder aspects of it. It is possible that you could damage your wii making the initial hacks but if you understand what you are doing and do not try replacing an IOS module used by the system/homebrew channel then the worst that will happen is you have to installed a fixed IOS module.

    The IOS runs on an internal ARM9 processor known to most as Starlet, http://wiibrew.org/wiki/Starlet
    That page has docs but I should also note ARM9 is the main processor of the DS and very similar to the GBA's one (and 3ds has some ARM action as well, as does basically every modern mobile phone) so you will find quite a few people familiar with it all. ARM assembly is not that bad and you are not going to need to know all of it by any means.

    http://wiibrew.org/wiki/ARM_Binaries has more on the binaries themselves.

    I would suggest starting with a hacked IOS and modding that. They do not tend to get distributed as hacked modules any more (rather they are distributed as patching programs) but it should not be hard to dump one and you might still find an already hacked one that works for you. For game running purposes most will tend to have a "base" IOS and install that to a location somewhere (it might be a base of IOS36 but installed as IOS 222 or something). I am not sure what dolphin (the emulator) will be able to do for your for the reverse engineering/testing stages.

    It says the IOS modules tend to come and be installed as WAD files (common enough on the wii) and packed within the wads are ELF files (a common executable format).
    For WAD files https://gbatemp.net/threads/wii-and-gc-standard-hacker-grade-iso-and-wad-manipulation-tools.328729/ is what you want.

    ELF... it seems most people playing on the Wii IOS side of things tend to opt for IDA (an amazing but very expensive reverse engineering toolkit) where most of us playing on the GBA and DS can get by with the free tools other hackers/devs made. Wii games will not use the ARM processor but the main powerpc one so there is not likely to be much there. I am not sure if the binaries use any compression/obfuscation or if you could feed them into any old disassembler.

    Anyway I will have to handwave and assume you have the disassembled code sitting in front of you.

    I also looked up the dimming, it is a hardware triggered thing but you got lucky and it is able to be controlled
    http://wiibrew.org/wiki/Hardware/Hollywood_Registers (do a page search for dimming)

    0x0d80001c is the address it changes and it is only the first 8 bits that are changed.
    You want to find anything that fiddles with that in the IOS module. It is enabled by changing bit 7 to high and the luma and the chroma are changed using bits 6-3 and 2-0 respectively, so 8 options for each and I am not sure what the values count as, (personally I would leave the chroma alone so you get the best colours and only dip the luma enough that your overlay device is not fooled any more but you can try that after proof of concept if you want).

    Once you have found the thing (possibly things) that writes the value to 0x0d80001c then you will get to work backwards. I do not know how it will be coded here but from the sounds of things there will be a timer that counts up to 5 minutes (the processor has no concept of seconds really so do not go looking for that exactly) and resets with every button press (not sure about stick waggle), and also resets from that mode with a button press. If the code is really good then it will check for the screensaver value to have been checked in the menu (or more accurately passed by the menu into memory when the IOS is called/launched) and only count when the use a screensaver value is there, I do not place much stock in Nintendo's coders but the compiler is pretty good so who knows.
    You have many options as to what you can do here. Possibly the easiest would be if the game writes one value to the dimming when it is normal and another when it is on screensaver. Here you would then change the values it writes so dimming is turned on all the time to the value you want. The way I was on about in the previous post would be to get it to ignore the timer and dim all the time -- the timer probably has some kind of compare or check and then a write to the location, you change the check so that it is ignored or always returns the check you want, there are many more options for the assembly hacker but most of those will be obvious once you have figured out what is going on.
     
  5. Fruity_Grebbles
    OP

    Fruity_Grebbles Newbie

    Newcomer
    9
    2
    Feb 8, 2015
    United States
    You sir, are credit to team. Thanks so much! I'll happily give some more info on my project if you'd like, I think you might find it interesting. I appreciate it!
     
  6. Fruity_Grebbles
    OP

    Fruity_Grebbles Newbie

    Newcomer
    9
    2
    Feb 8, 2015
    United States
    I can't find IOS source, CIOS or otherwise, anywhere! Am I missing something?
     
  7. endoverend

    endoverend AKA zooksman

    pip Contributor
    GBAtemp Patron
    endoverend is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    2,847
    3,550
    Jun 6, 2013
    United States
    You're going to have to dump IOS from your own Wii, it is illegal to distribute it as it is not open source. Use BlueDumpMod to do that.
     
  8. Fruity_Grebbles
    OP

    Fruity_Grebbles Newbie

    Newcomer
    9
    2
    Feb 8, 2015
    United States
    Ah, thank you!
     
  9. Fruity_Grebbles
    OP

    Fruity_Grebbles Newbie

    Newcomer
    9
    2
    Feb 8, 2015
    United States
    Think that I'm going the right direction with all of this, but I have a couple more questions: Between Nintendon't, USBLoader, and regular, non-weird-hardware wii games, as well as the HBC, which IOS's should I modify? Or can I change one and force all of these? D2X says it can only be used in loaders, and Nintendon't relies on IOS 58 specifically. Also, is there any chance of me modifying MINI for Bootmii dimming? I want to keep bootmii for brick protection, but if I can't dim that, it would be rather annoying. I literally do not need the system menu at all, so that can be avoided. An additional thanks for all your help.
     
  10. Fruity_Grebbles
    OP

    Fruity_Grebbles Newbie

    Newcomer
    9
    2
    Feb 8, 2015
    United States

    Goofed a little bit there: 58 is one of the IOSs that D2x patches for... USB loading. So Nintendon't uses that anyway. My bad. Other questions stand though.
     
  11. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23,522
    9,359
    Nov 21, 2005
    Just thread through the d2x stuff ( https://code.google.com/p/d2x-cios/wiki/How_to_compile and various things on http://d2x-cios.googlecode.com/svn/ ) and it is a wonderful resource. However it is probably overkill for what you want here -- to do things like load over USB the CIOS devs have to add fairly extensive amounts of code to an existing compiled piece of code (not commonly done in any hacking really), to do what you want you probably have to change a few instructions and all in place. You can modify a fully compiled version of d2x-cios if you like, it would probably even be a good bet but you do not need to go to the hassle of compiling it all yourself if you do not want to. No doubt you could then add it as a patch to d2x-cios (if might even be worth contributing it to them)

    What IOS to modify as a base and install as a mod. Whatever works really, if IOS58 supports the games you want (likely enough, it is mainly games with odd hardware that want others) and you can force games to boot with your modified one if you install it on a high number IOS (it is what loaders tend to do) then go that. Various people did mod every IOS on the Wii (see darkcorp and cioscorp) but it is not the best course of action; the only real benefit being for those that absolutely must boot from the disc channel and it has a few downsides as well (the homebrew channel will probably boot upsidedown, other homebrew from similar devs might not care for it as well, most of the darkcorp/cioscorp type stuff was not as well made as straight up d2x-cios and co).

    mini instead of IOS... not really as the Wii does not really have an always present hypervisor/handler -- things load and can trouble the hardware (as this topic is covering), however it then gets swapped out for various other things along the way. The wii really is a quite primitive and oddly made device.