swiss-gc icon indicating copy to clipboard operation
swiss-gc copied to clipboard

USB Gecko Unable to Debug

Open ReclaimerShawn opened this issue 3 years ago • 10 comments

As of right now, I'm using Swiss Revision v0.5r1138. I have no SD Gecko, only a memory card with a Pokemon XD save to Boot into Swiss and a boot.dol of the latest Swiss. Whenever I turn on the option "WiiRd debugging", with my USB Gecko (Custom built - Works on Wii on Wii Mode) in Slot B, I'm unable to use either WiiRd GUI or Gecko.NET to debug my games. I've also tried setting "USB Gecko debugging to Slot B" alongside "WiiRd debugging", but to no avail. I am using Windows 10 x64 and am using the USB Gecko drivers found here. Specifically, the 2.12.36.4 version: https://ftdichip.com/drivers/d2xx-drivers/

For starters, I'm trying to debug Pokemon XD. I'm booting the game from a retail disc, by the way. If I use WiiRd GUI, it says it connects but has the Game ID is N€ =@ If I use Gecko.NET, the Game ID GXXE01 pops up, but the game hangs and the USB Gecko promptly disconnects. The game will continue to hang until the console is turned off.

The only clue I have is a log from Gecko.NET that says:

8/21/2021 10:34:25 PM: Opened log 10:34:25 PM: Exception occured! Exception: FTDIUSBGecko.EUSBGeckoException FTDIInvalidReply Message: Exception of type 'FTDIUSBGecko.EUSBGeckoException' was thrown. Stack Trace: at FTDIUSBGecko.USBGecko.Dump(UInt32 startdump, UInt32 enddump, Stream[] saveStream, Dump memdump) at FTDIUSBGecko.USBGecko.Dump(UInt32 startdump, UInt32 enddump, Stream saveStream) at GeckoApp.Disassembly.Disassemble(UInt32 address, Int32 commands) Inner Exception:

I haven't tried another revision of Swiss other than the one mentioned. Any solutions to getting my Gecko to work via Swiss on Gamecube? Maybe this is unrelated, but my USB Gecko is also unable to connect on my Wii if it's in Gamecube mode. The manufacturer of the Gecko said it worked on his Gamecube, so I don't know what I'm doing wrong.

ReclaimerShawn avatar Aug 22 '21 09:08 ReclaimerShawn

WiiRD debugging is currently in conflict with our hypervisor, and so we can't guarantee its function.

Extrems avatar Aug 22 '21 14:08 Extrems

WiiRD debugging is currently in conflict with our hypervisor, and so we can't guarantee its function.

Is there a version of Swiss that isn't in conflict? I'll downgrade to that version.

ReclaimerShawn avatar Aug 22 '21 19:08 ReclaimerShawn

v0.4r775 and earlier should work if you're using a disc.

Extrems avatar Aug 22 '21 19:08 Extrems

v0.4r775 and earlier should work if you're using a disc.

I used both v0.4r775 and v0.4r766 and both threw the same exception. I'm assuming either the Gecko Driver setup or my Gecko.NET version is incompatible. I'm using Gecko.NET 0.66.8 by the way, if that might affect anything. The Gecko appears as being available on Swiss. Heck, even Swissserver works.

ReclaimerShawn avatar Aug 22 '21 20:08 ReclaimerShawn

Partially fixed in 8e09246 (r1372).

Extrems avatar Sep 18 '22 18:09 Extrems

Partially fixed in 8e09246 (r1372).

Yep, I can confirm that it's partially fixed in r1387. It's working the same way it did in r775 now.

Both r1387 and r775 have these WiiRD bugs in common:

  • Whenever you set a breakpoint and the breakpoint is triggered, the game will hang. No instructions or the values of the registers are shown either.
  • Cannot debug Pokemon XD: Gale of Darkness. Both can debug Pokemon Colosseum, though.
  • Otherwise, memory viewing, poking, searching, and RAM Dumping all work fine.

Finally, r1387 has two new error notifications that r775 does not. This can be found whenever hooking GeckodNET to a game. Here's the errors that occur upon hooking Pokemon Colosseum (I think the same error occurs on SSBM, too): "ass.txt: Assembler messages: ass.txt:1: Error: operand out of range (0x8000081c is not between 0xfe00000 and 0x01ffffff)"

and

"ass.txt: Assembler messages: ass.txt:1: Error: operand out of range (0x8000051c is not between 0xfe00000 and 0x01ffffff)"

I did not expect this update to work yet as the commit set partially fixed, but it has been improved by leaps and bounds. Thank you all for the fixes!

ReclaimerShawn avatar Oct 18 '22 10:10 ReclaimerShawn

Cannot debug Pokemon XD: Gale of Darkness. Both can debug Pokemon Colosseum, though.

Yeah, it uses a custom DSI exception handler and debugging won't work until the debugger is rewritten and integrated with the hypervisor.

Extrems avatar Oct 18 '22 14:10 Extrems

Yeah, it uses a custom DSI exception handler and debugging won't work until the debugger is rewritten and integrated with the hypervisor.

Any word on when the debugger will be integrated with the hypervisor? I'd love to try it out whenever it's finished!

ReclaimerShawn avatar Jan 12 '23 17:01 ReclaimerShawn

Probably not any time soon since it has to be converted to ELF format and be dynamically relocated to get around the current memory limitations.

Extrems avatar Jan 12 '23 17:01 Extrems

@Extrems You changing Swiss's hooktype to VBI not only fixed the codehandler issues I mentioned before, but Pokemon XD and every other game I've tried are debuggable now. All that's left at this point is to get breakpoints to work, but otherwise, Swiss's debugger is almost entirely working now!

ReclaimerShawn avatar Feb 17 '24 06:02 ReclaimerShawn