![]() |
|
Wii Serial Interface: Dolphin doesn't match real hardware? - Printable Version +- Dolphin, the GameCube and Wii emulator - Forums (https://forums.dolphin-emu.org) +-- Forum: Dolphin Emulator Discussion and Support (https://forums.dolphin-emu.org/Forum-dolphin-emulator-discussion-and-support) +--- Forum: Development Discussion (https://forums.dolphin-emu.org/Forum-development-discussion) +--- Thread: Wii Serial Interface: Dolphin doesn't match real hardware? (/Thread-wii-serial-interface-dolphin-doesn-t-match-real-hardware) |
Wii Serial Interface: Dolphin doesn't match real hardware? - Shonumi - 11-24-2018 So, I'm dabbling with some Wii homebrew. The goal is to probe any JoyBus devices via the Serial Interface (SI). To start off, I simply want to send the ID command (0x00) and read the response to get the device ID. I'm using the latest DevkitPro and DevkitPPC. Here is the source code: Code: #include <stdio.h>Attached below are the .dol and .elf files as well (in the ZIP file). I believe this is the (mostly) correct way of doing things. Clear the SI I/O buffer, write the command to the buffer, then initiate a transfer via SICOMCSR. I only had Dolphin's source code + Yet Another Gamecube Doc to go off of, and I haven't touched the GC/Wii Serial Interface in years (not since 2014 I guess). Anyway, the latest master builds of Dolphin run the code as expected. Every second, it prints out something like... Code: ID 1 -> 0x09000000This is normally what I'd want/expect to see. 0x09000000 represents a standard GC controller attached to a given controller port, and 0x8 is Dolphin's default response an unconnected device. I can change the attached device in Dolphin to something like the GC Keyboard or Steering Wheel or Dancing Mat, and it updates the ID accordingly. Unfortunately, running this on real hardware (Nintendo Wii RVL-001) gives different results. I loaded up the .dol through the Homebrew menu and got results like this (Standard 1st-party GC Controller attached to Port 1): Code: ID 1 -> 0x20000300So, my question is, does anyone have any idea what's going on? The zeroes for the rest of the IDs are not concerning, but the first one is totally unexpected. RE: Wii Serial Interface: Dolphin doesn't match real hardware? - DJBarry004 - 11-24-2018 I "played" with your program and catched some more values (in Dolphin). If you select the GC adapter for Wii U or the Steering Wheel they will both print 0x8000000. Dance Mat will print 0x9000930 and the DK Bongos will print the same value as Standard Controller. The GC Keyboard prints 0x8200000. For some reason, if I enable the DK Bongos in ports 2, 3 and 4, it will keep printing the "disconnected" value (0x8). RE: Wii Serial Interface: Dolphin doesn't match real hardware? - Shonumi - 11-24-2018 Yeah, those are the expected values when using Dolphin. Those are the JoyBus IDs for each device. The thing is that a real Wii was messing up. Should have reported 0x9000000 for a Gamecube controller, but instead on my Wii it reported 0x200000300. Anyway, I guess this might be due to something to do with the Homebrew Channel? My guess is that it's doing something before loading the .dol that changes how the Serial Interface works before executing the .dol. Maybe interrupt related, I dunno. I guess I should have run my .dol through the Homebrew Channel in Dolphin to compare results accurately, my bad. I think I may have tried going too low-level, accessing the individual hardware registers instead of using libogc's built-in SI functions. I couldn't figure out how they worked until I found the source code for some GBA Link Cable dumper. Now I've modified my source code, and I can get the JoyBus IDs in both Dolphin and my Wii. There are still some minor differences, but the JoyBus ID is what I need for now, so I'm satisfied with the results. |