PadSend for DS/Wii (PC Application)

Discussion in 'NDS - Emulation and Homebrew' started by mntorankusu, Jun 1, 2011.

Jun 1, 2011
  1. mntorankusu
    OP

    Newcomer mntorankusu Newbie

    Joined:
    Sep 4, 2006
    Messages:
    6
    Country:
    United States
    PadSend lets you use Gamecube pads connected to a Wii, or a DS, as a PC gamepad. PPJoy must be installed. Just run the server on your computer (requires .NET framework 2.0) and run the client on your Wii or DS. It will only work right now if your DS or Wii has an IP address that starts with 192.168.1. (this will be fixed soon)

    You can download it here: http://dl.dropbox.com/u/211987/pad_send.zip

    Wii features:
    • Support for all four controller ports, simultaneously.
    • Analog sticks and triggers are supported.
    • Mouse control using either (or both) of the analog sticks and L/R buttons. Mouse movement is choppy, though, due to how messages are handled
    DS features:
    • Support for up to 16 connected DS systems.
    • Relative mouse control using the touch screen and L/R buttons.
    • Absolute joystick control using the touch screen (must be calibrated in the Windows joystick panel)

    Server features:
    • Automatically creates PPJoy virtual joysticks for each unique device connected. It does not automatically delete them, though, because it turns out that is really annoying. (manual deletion will be added later)
    • Writes button and axis names to the registry, which means games that bother to look for this can use accurate button labels.
    • You can rename each device connected through the program interface-- you can have two systems connected named "Nintendo DS Lite" and "Nintendo 3DS" for example.
    • An icon is displayed on the status window next to each device, the color of which can be changed to match your controller or system.
    • Mouse control can be enabled or disabled, and this setting can be applied per-controller.
    • All settings are saved and loaded automatically. The MAC address on the DS is used as a unique identifier, so settings can be saved, loaded per-system.
    • Sits quietly in the tray, and if it works (I can guarantee it works on my machine, as they say), then it never requires any settings or attention.
    [​IMG]

    You must install PPJoy before this will do anything. The newest version of PPJoy does work with 64-bit systems-- I'll add an explanation on how to install it later.

    First run the server application on your computer. It will pop up for a second and then hide itself in the tray. When you click the tray icon, the status window will appear. The behavior and appearance is intended to mimic the way Windows 7's volume, network, etc, tray icons work. If you have Wiiload configured or if you know your Wii's IP address, you can send the Wii client directly to your Wii from here-- open the Homebrew Channel on your Wii, and click Wiiload Client. If wiiload is already configured, it will send it over right then. If it's not configured, it will prompt for you to enter your Wii's IP address, then send it. You can also do this from the tray icon's right click context menu, if you don't want to bring up the full status window.

    Once a device is connected, it will be shown on the status menu. You can click the device icon to change its name or color. Right clicking the icon will change how the color is displayed, but this isn't saved, so it's not very useful.

    Click About/Help to see descriptions for what each checkbox does.


    For developers who want to write apps to interface with my server, UDP messages are sent to 192.168.1.255, on port 9501. The data structure for both types of controllers is (bytes):
    00 - Counter (not used yet)
    01 - Unique ID
    02 - Identifier (explained below)
    03 - Extension (not used yet)
    04 - Buttons 0 (each bit is one button state)
    05 - Buttons 1

    After this it's different for each; GC:
    06 - Left Analog X
    07 - Left Analog Y
    08 - Right Analog X
    09 - Right Analog Y
    10 - Analog Trigger L
    11 - Analog Trigger R

    DS:
    06 - TouchX1 (each two bytes makes up a single unsigned 16-bit number-- maximum is 4000 though)
    07 - TouchX2
    08 - TouchY1
    09 - TouchY2

    Identifier:
    01 - Gamecube Port 1
    02 - Gamecube Port 2
    03 - Gamecube Port 3
    04 - Gamecube Port 4
    09 - Nintendo DS

    The server expects at least one message every second, or it assumes the device has disconnected.

    Known bugs:
    • Only the last byte of the MAC address is used to identify the connected DS, so two systems may identify as one and fight over a single virtual joystick.
    • The Wii does not send a unique identifier, so you can't use more than four Gamecube controllers by connecting multiple Wiis. Not that I figure anyone would want to do this.
    • Color settings either do not save or load properly for Gamecube controllers.
    • If the virtual joysticks configured by ppjoy are not sequentially numbered, the server may (probably will) create duplicate joysticks.
    • There's no dead zone for Gamecube analog sticks, so if your pads are worn out, you may find your mouse pointer wandering.
    • Input is only updated each time a new message is received, so mouse control is not consistent when controlling it with an analog stick.
    • It will only work if your router assigns addresses that start with 192.168.1.-- You might be able to hex edit the executables to change this to match your situation (leave the last octet as 255, though). ndslib and libogc do not seem to properly handle broadcasting or multicasting, so I don't know how to fix this and still be "configuration-free". Anyone have any ideas? Either way, I'll add a manual configuration in the future.
    • There are a million features I still want to add

    Please post any bugs or issues you find. I don't even know if this will work for anyone else!
     
    Margen67 and Fishaman P like this.


  2. Another World

    Former Staff Another World Emulate the Planet!

    Joined:
    Jan 3, 2008
    Messages:
    10,476
    Location:
    From Where???
    Country:
    Colombia
    since BST is in effect you are fine.

    -another world
     
  3. mntorankusu
    OP

    Newcomer mntorankusu Newbie

    Joined:
    Sep 4, 2006
    Messages:
    6
    Country:
    United States
    PadSend Server has been updated to revision 3 and the Wii .dol client has had a bug fixed (no version change). Anyone who tried to use it before and couldn't, please download it again and try the new version.
     
  4. Cyan

    Global Moderator Cyan GBATemp's lurking knight

    Joined:
    Oct 27, 2002
    Messages:
    16,455
    Location:
    Engine room, learning
    Country:
    France
    The boot.dol has been updated?
    It's still dated from june 1st in the zip (from the download in the first post).

    The server is from june 5th, so this file has really been updated, but no bug fix for the dol?
     
  5. mntorankusu
    OP

    Newcomer mntorankusu Newbie

    Joined:
    Sep 4, 2006
    Messages:
    6
    Country:
    United States
    I think it's the right one. I made the changes to the dol file not long after I first posted this, I just got around to updating all of the files.

    Have you tried to use it?
     
  6. Cyan

    Global Moderator Cyan GBATemp's lurking knight

    Joined:
    Oct 27, 2002
    Messages:
    16,455
    Location:
    Engine room, learning
    Country:
    France
    Yes, I tried it.
    I couldn't make it to work [​IMG]



    My network uses 192.168.0.x
    PC : 192.168.0.1
    Wii : 192.168.0.5
    My computer host the access point wifi card used by the network.


    When I launch the server, it stays on "Waiting for connexion".
    I launch the boot.dol using the wiiload menu, and the homebrew is launched on wii correctly.

    I have this on screen:
    Code:
    PadSend 0.0a - Wii version
    by mntorankusu - 0.0a for GBATemp
    Only Gamecube Pads work right now.
    Run the server application on your PC.
    I don't know if there must be something else once the connexion is established, but the homebrew on wii seems it doesn't have a way to exit back to HBC [​IMG]
    I have to hold power to switch off the Wii.


    I tried to hexedit the server executable to 192.168.0.255 like you said, but it's still not connecting.
    I'm using windows XP Pro SP2
    PPjoy is installed, and have no controller added to the list.
    Maybe my firewall is blocking the access?

    What does the wii homebrew to access the server ? he knows the computer IP?
    I don't have a network interface on IP 255
    you create a fake network interface to host the server on 255? if we could edit the server IP on the Wii homebrew, it will be great, no?


    I'll try the DS version, maybe I'll have more luck.
    edit:
    the DS is in wifi mode (led blinking), but still not detected by the server.

    I guess I'll have to change all my network IPs to try it properly [​IMG]

    Anyway, it's a nice idea for a homebrew [​IMG]
    I'm sure with time it will be useful and will work great, I hope you'll add all the ideas you have.
     
  7. mntorankusu
    OP

    Newcomer mntorankusu Newbie

    Joined:
    Sep 4, 2006
    Messages:
    6
    Country:
    United States
    I'll try to release an updated version soon that should work on more network configurations. I was just lazy with the 192.168.1. thing because I figured it would work for most people. The 255 is used like a wildcard to indicate a broadcast on network addresses-- anything that matches the rest can receive packets sent like that. I'm not an expert on network stuff (not even close) so I could be doing everything wrong, but it does work for me right now, so it should also work for you once I make it adapt to different ranges of network addresses.

    There is a button combo to exit, I forgot to mention it. Press L+R+Z+A+Y+Start on the first controller. I meant to make the reset button work too, but I was in a hurry to get everything working and released so I forgot. I'll fix that in the next release, too.

    Edit: Did you use the hex editor on both the server and the client? The client sends to 192.168.1.255, and the server receives on 192.168.1.255, so they would both need to be changed for it to work.
     
  8. Cyan

    Global Moderator Cyan GBATemp's lurking knight

    Joined:
    Oct 27, 2002
    Messages:
    16,455
    Location:
    Engine room, learning
    Country:
    France
    I edited only the server, but you are right I should have edited the dol too.

    Will you release the source too?
    I'm sure other developers can help you with the network interface.
     
  9. Rydian

    Member Rydian Resident Furvertâ„¢

    Joined:
    Feb 4, 2010
    Messages:
    27,883
    Location:
    Cave Entrance, Watching Cyan Write Letters
    Country:
    United States
    Yeah there's also private Class-A (10.x.x.x) networks and other such configs, so getting people to help make it auto-detect should fix this.
     
  10. Cyan

    Global Moderator Cyan GBATemp's lurking knight

    Joined:
    Oct 27, 2002
    Messages:
    16,455
    Location:
    Engine room, learning
    Country:
    France
    I edited the boot.dol and it works fine now [​IMG]

    All the gamecube controller's buttons are recognized, and all the analog button/stick are well recognized as analog too.


    When the pad has been detected, it added the "joystick" to PPJoy and windows asked me twice to install the driver.
    I chose "do not connect to microsoft update" and "Try to find the best driver". all went fine and the joystick is correctly added in config pannel/game controllers.
     
  11. mntorankusu
    OP

    Newcomer mntorankusu Newbie

    Joined:
    Sep 4, 2006
    Messages:
    6
    Country:
    United States
    Great, thanks! I created an updated version that should work for more network configurations. Try it here: http://dl.dropbox.com/u/211987/ps-beta.zip

    No DS client yet. If someone reports that this works for them, I'll update the DS client as well.
     
  12. mightymage

    Member mightymage GBAtemp Regular

    Joined:
    Jul 26, 2007
    Messages:
    193
    Country:
    United States
    this program is no good for me i have a 10.0.0.0.2 network and i cant get it to find my wii so im giving up until a version that auto configures
     
  13. Quincy

    Member Quincy Your own personal guitarist :3

    Joined:
    Nov 13, 2008
    Messages:
    1,435
    Location:
    Your house, robbing your stuff
    Country:
    Netherlands
    I don't think that you have a 10.0.0.0.2 network. That is about 1 octate too much. 10.0.0.x in that case would be possible yho.
     
  14. Cyan

    Global Moderator Cyan GBATemp's lurking knight

    Joined:
    Oct 27, 2002
    Messages:
    16,455
    Location:
    Engine room, learning
    Country:
    France
    you can either change your router/computerIP to use 192.168.1.x or 192.168.0.x instead of 10.0.0.x
    it's just a matter of choice, it doesn't change the performance of the network.

    or you can edit the dol/nds file and the server executable .exe in a hex editor, search for 192.168.1.255 and replace it to 010.000.000.255


    Sorry mntorankusu, I still didn't try your latest version.
    But I hope you will provide a version with user settings. I don't have a PC controller, using the DS or Wii is great.
     
  15. F. Lobot

    Member F. Lobot GBAtemp Regular

    Joined:
    Dec 28, 2010
    Messages:
    143
    Country:
    United States
    How exactly is the Wii communicating with the computer? Local wifi? Internet? Bluetooth?
     
  16. Cyan

    Global Moderator Cyan GBATemp's lurking knight

    Joined:
    Oct 27, 2002
    Messages:
    16,455
    Location:
    Engine room, learning
    Country:
    France
    Local Wifi or ethernet (if you have the LAN adapter).
    it's using the local IP (192.168.1.x by default).

    If your network is using a different IP, like 192.168.0.x or 10.0.0.x then you will have to hex-edit the dol/nds/exe as there's currently no user settings.
     
  17. chaosdarkneo

    Member chaosdarkneo GBAtemp Advanced Fan

    Joined:
    Sep 13, 2009
    Messages:
    530
    Country:
    United States
    Does this work for wireless gamecube controllers? I'd have mine connected to the Wii... but downstairs while I'm playing something like... Minecraft? IDK, but this might have useful applications.
     
  18. Cyan

    Global Moderator Cyan GBATemp's lurking knight

    Joined:
    Oct 27, 2002
    Messages:
    16,455
    Location:
    Engine room, learning
    Country:
    France
    if your controller is recognized by the Wii, then I think it will work.
    You just need to have enough Bluetooth (or is it WiFi too?) strength to broadcast to your Wii's Wireless GameCube Controller receiver downstairs, and enough Wifi strength in your Wii to broadcast back to your computer upstairs.

    Wifi should be fine.
    You have to see if your Wireless controller works on your Wii from the other floor.
     
  19. F. Lobot

    Member F. Lobot GBAtemp Regular

    Joined:
    Dec 28, 2010
    Messages:
    143
    Country:
    United States
    So, I've gotten past the Windows 7 64-bit trite and got PPjoy working. I restarted Windows in 'disable driver signature enforcement' mode. My problem is with the Wiiload client.

    Basically, I used the split second that the Padsend Wii app tells me my Wii's IP address (it would be helpful if this stayed on the screen), and then used it to try and connect to the Wii.

    But then, nothing happens. The Wiiload client opens for about a second, says 'transfer failed' and then closes. Padsend still tells me 'Waiting for connections'.
     
  20. Cyan

    Global Moderator Cyan GBATemp's lurking knight

    Joined:
    Oct 27, 2002
    Messages:
    16,455
    Location:
    Engine room, learning
    Country:
    France
    Don't use Wiiload.
    Wiiload require special settings in your windows, it's for developers or to prevent going to the wii homebrew channel to launch padsend and come back to your computer.
    Just place boot.dol in your SD card and launch it from homebrew channel like any other homebrew.


    If you really want to use Wiiload:
    on WinXp : hit window_key+pause to open the system properties.
    go to advanced > environement variables
    add a system variable :
    name : WIILOAD
    value : tcp:xxx.xxx.xxx.xxx

    (where xxx = your wii's local IP).
    You may need to reboot your computer to register is as a variable.


    Then :
    Wii : go to homebrew channel.
    PC : Drag and drop boot.dol on Wiiload.exe to run the homebrew from Wifi instead of SD card.

    You don't need the Wii IP at all, PadSend it set to forward on all available IP of the local network (it looks on x.x.1.255)
    if you local network use 0 instead of 1, hexedit both the dol and the exe to 192.168.0.255


    Also, check that you don't have firewall/router/peerguardian blocking the .255
     

Share This Page