So well.. I finally had some time to recheck the code.. well, C# progress is fine.. I implemented the core functions and already one user function.. which is a complicated one: the dump!
right now its syntax would be:
public void Dump(UInt32 startdump,UInt32 enddump, Stream saveStream) { }
So a basic call would be Dump(0x80000000,0x80400000,fileToSaveTo);
The reason I went for dump is simple. It is a quite complicated, yet absolutely important function. It has the strongest communication part with the Wii console:
- Reset buffers
- Announce dump command (send 1 byte 04 to the USB Gecko)
- Wait for the reply (should be 1 byte - and AA = Acknowledge)
- Send the memory range to dump in Big Endian to the console: a valid message would be 80 00 00 00 80 40 00 00 = dump from 80000000 to 80400000)
- wait for ackowledge
- Now packages are split.. package size of each max package is 63488 bytes (3968 for upload). So the download has to be splitted into packages of maximally 63488 bytes
- Get a package
- Check its length - if invalid: retry the package (send BB = retry to console) - after 3 retries give up (send FF to abort dumping)
- if invalid transfer status reply: give up (Send FF)
- if length okay and no status error: ackowledge package: send AA
- Next package or finish if all packages done
So well.. that's the truth behind the dump command for those who didn't know it.. and well..that command being a core command is working. If anyone wants to get a glance at the current communication library with the dump example. Sure!