Wednesday, March 14, 2007

The Secret of Wiimote Access

Have been busy at work, so havn't gotten around to blog anything. I thought I would reveal the trick behind the "Wii-remote access from Xbox 360 demo". Some of the commenters on here and Youtube already pointed out the various pieces of the illusion. Here is how I have done it.

  • Wii remote uses bluetooth to connect to Wii or PC
  • Xbox 360 does not have IR port or Bluetooth port
  • Xbox 360 has USB port, but XNA does not have any low level access to the hardwares
  • I only know software, so this isn't a hardware hack
  • XNA has no network API, so I couldn't create network sockets

Since Xbox can't access Wiimote directly (without hardware mod), my solution is to use an "adapter" to acquire the data. In this case, my laptop is used as an all purpose adapter. :) With some googling, I was able to find Ziggy's wiimote library. And after reading through's wiimote page, I was able to read input from on my laptop.

Now the remaining puzzle is how to get data in and out between the PC and the Xbox. It's relatively easy to get data out of the Xbox. But to get the data into the Xbox takes some doing... Since XNA doesn't have any low level access, USB is out. It's probably possible to create an adapter by simulating the joypad, but I am a software guy. :) The final solution I settled with is borrowing the conduit MS has provided: the debugger! By using the debugger, I was able to read variable data directly from the Xbox, and also modify Xhox data from the PC. If you are interested in how that is done, you would have to read about it in my next blog... :)

Big thanks to everyone who dropped by and checked out the video. :) As a treat, here is the source code to the Wiimote Demo. It will take some preparation to get it working properly. Here is the short instruction:
  • Make sure you can access the Wiimote from Windows.. Verify using GlovePie or WiinRemote
  • Load the solution in MS C# Express. Make sure you have only a single instance of C# Express running.
  • Make sure you can deploy and debug program on your Xbox from C# Express
  • Start the X360WiiTest project in Debug mode. The code will probably hit a break point and paused with some line highlighted. Don't worry about it.
  • Make sure you can see the Locals debug window open (from menu Debug->Windows->Locals)
  • Start WaruProxy.exe within the archive. Click on the button.
  • If you don't have C# Express open, or Wiimote isn't connected properly, WaruProxy will crash
  • If you have done everything correctly, WaruProxy will unpause the program and gather input from the wiimote and pass to your Xbox all by itself!

WaruProxy monitors C# Express to see when it hits a break point. If C# is in break mode, WaruProxy will check the Locals window for any known variable. If WaruProxy can find the proper variables, it will use them to communicate with the Xbox. Voila! That is how I access Wiimote from the Xbox. Enjoy! :)

Monday, March 05, 2007

XNA Team Delievers!

There were some grumblings in the MSDN's XNA/XGSE forums regarding the lack of samples and certain features and what Creators Club's benefits really are. After months of incommunicado, the XNA team has finally announced what they have been working on:
  • A Creators Club online community full of samples/tutorials/forums
  • The main Dream, Build and Play contest is now live with a chance to get your game published on XBLA!
  • Exclusive content for CC member such as free license to GarageGames Torque X Engine, Softimage's new 3-D solutions, and Allegorithmic ProFX. This may come May or later though.

Pretty exciting stuff! :) Thanks, XNA team!

Friday, February 23, 2007

Quick tech demo

Hell everyone, here is a short tease of what I've been working on. It demonstrate a sample Xbox 360 XNA project pulling data from a wii-remote. As demoed in the video, it can read the buttons, IR locations, and the motion data. Too bad that the process is very slow due to a couple of limitations. It can roughly read the data 5 times per second. This causes the lag in the videdo. Maybe I can improve the speed when more MS expands XNA's API library and/or tools capability. Won't it be cool to use wii-motes on the XBox 360? Now that I have access to retrieve data from outside the box, there are more interesting things I can do... As the next demo will show. ;)

Sunday, February 11, 2007

XNA project progress...

Quick update on my XNA project (problems with short attention span?)
  • side tracked to look at different modelling program
  • side tracked to look at Google's 3D ware house
  • played with Sketchup
  • side tracked to look at Google MAP API, KML
  • finally found a model I wanted, and converted to the format XNA likes
  • diddling with XNA's 3D rotations
  • learned what a Gimbal Lock is (doh!)
  • learned more about quaternion and how to use it

Finally, at this point, have a model that rotates (yaw, pitch and roll) on its own axis. I think it's time to polish up that Linear Algebra book from last millenium...

Saturday, February 10, 2007

How a typo gets around the world...

So, in a previous post, I mentioned that this blog was linked by Engadget. Turns out that Engadget folks made a typo (used a "t" instead a "s" in the domain name). I have asked them to correct the typo since. The term "waru360" is new and unique, so it's easy to keep track of the typo on google. It is interesting to see how far the typo has travelled. It first turned up on SWik, and then Zimbio (food and wine portal?), and now on a Japanese site. These reminds me of what happens when you have your identity stolen. The misinformation just propagates itself and gets harder and hard to correct... This will probably diminish after the the correct spelling shows up in more places.