Syncing new remotes in homebrew

Discussion in 'Wii - Emulation and Homebrew' started by JoostinOnline, Jan 3, 2012.

Jan 3, 2012
  1. JoostinOnline
    OP

    Member JoostinOnline Certified Crash Test Dummy

    Joined:
    Apr 2, 2011
    Messages:
    10,834
    Location:
    The Twilight Zone
    Country:
    United States
    I have done some searching, and I can't find any (current) info on the matter. Is there any way to code a homebrew app so that you can sync new remotes through the red buttons? It would be very helpful for postLoader enthusiast who go so far as to replace the System Menu with postLoader. I imagine there are other uses as well.
     
  2. SifJar

    Member SifJar Not a pirate

    Joined:
    Apr 4, 2009
    Messages:
    6,022
    Country:
    United Kingdom
    No, there is no way to do it. I believe that no one has ever reverse engineered the official code to do, so it is not known how it would be done in homebrew. I would imagine that somewhere on NAND there is a file with a list of the bluetooth addresses of synced remotes or something. But some information would also have to be sent back to the remote, as well as storing information from the remote on the wii itself.
     
  3. giantpune

    Member giantpune GBAtemp Addict

    Joined:
    Apr 10, 2009
    Messages:
    2,860
    Country:
    United States
    in the sysconf there is stored an array of the wiimotes that are "permanently" synced to the wii. this is read by libogc when a homebrew is starting up and used to tell which wiimotes the program will talk to. the early homebrew didnt use this method, but instead had you press 1+2 to sync your controller at the start of the program. you can try getting an old libogc from the svn and take a peek at some of the old homebrew to see how they did it.

    you still would want to come up with a way to tell if the red button on the wii has been pressed. then you would accept a connection from a wiimote, and if there is room in the sysconf array, add it there (or remove another wiimote from the existing list to make room for the new one?).
     
    1 person likes this.
  4. obcd

    Member obcd GBAtemp Advanced Maniac

    Joined:
    Apr 5, 2011
    Messages:
    1,594
    Country:
    Belgium
    Maybe the red button can be read the same as the power and reset button. This would be logical.
    It's just a wild guess. I have never tested it.
     
  5. JoostinOnline
    OP

    Member JoostinOnline Certified Crash Test Dummy

    Joined:
    Apr 2, 2011
    Messages:
    10,834
    Location:
    The Twilight Zone
    Country:
    United States
    Thanks. I knew info about it was stored in SYSCONF, but I didn't know how.

    Would anybody be interested in helping me on this? It would be very useful to postLoader enthusiasts who (I should probably ask stfour about this), and it would be a nice feature to add to BLIND.

    PS: I think I remember having to use 1+2 to register the remote in homebrew, but how long ago was this? I barely remember the day I tried out the Twilight Hack (this was shortly before the HBC was released).
     
  6. JoostinOnline
    OP

    Member JoostinOnline Certified Crash Test Dummy

    Joined:
    Apr 2, 2011
    Messages:
    10,834
    Location:
    The Twilight Zone
    Country:
    United States
    Crap, I have searched and searched, but have been unable to find code for temporary syncing via 1+2. Maybe I'm just looking in the wrong places, IDK.
     
  7. Jacobeian

    Member Jacobeian GBAtemp Advanced Maniac

    Joined:
    May 15, 2008
    Messages:
    1,879
    Country:
    Cuba
    As far as I remember, there was no code needed, everything was done by libogc (through wiiuse early implementation).
    They simply changed the way WPAD is initialized in further implementation, using SYSCONF registered IDs instead of relying on user to press 1+2 on each wiimotes everytime they launch the application.
    At least, this is how I remember early emulators in Wii mode were working, look for "Lopst" version of snes9xgx and genplusgx to try out...
     
  8. JoostinOnline
    OP

    Member JoostinOnline Certified Crash Test Dummy

    Joined:
    Apr 2, 2011
    Messages:
    10,834
    Location:
    The Twilight Zone
    Country:
    United States
    I finally figured out how SYSCONF works and what needs to be done to add options. Of course, megazig kindly spoiled my excitement when he pointed out that almost all that information was already on Wiibrew, but whatever.

    While coding this is still over my head, maybe someone else can make use from my findings. Here is what (I believe) you would have to do in order to add a setting to SYSCONF:
    1. Increase the number after "SCv0." by 1. It's the number of settings currently in SYSCONF
    2. Log all the values after that which are offsets. There should be the same number of offsets as number of settings, since they represent the location of each one.
    3. Find a place with enough room for your new setting. and add it. Before the actual setting, you need a u8 that represents the data type and length of the name. Check out the actual SYSCONF file to find what each one is. Keep it at least 2 characters away from the data at the end of SYSCONF, since you will need that space for the new offset.
    4. Insert a new offset to the list from step 2. You will have to recalculate all the offset for each setting.
    I know those instructions suck, and I'll try to clean them up later (I'm sick right now). There is surely a neater way to do what I just said.


    Note: Since the Wii remotes start with the model Nintendo RVL-CNT-01, the M+ ones might use Nintendo RVL-CNT-01-TR. I'm not sure what the data is after the model number, but it's probably the bluetooth address or something.

    PS: If this is already common knowledge or I'm just wrong, sorry for wasting your time.
     

Share This Page