diff --git a/README.md b/README.md index 4c35c46..08f12d8 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Source code spreads under the GNU General Public License v.3. You can find it in ## Requirements -JRE 8 or higher. +JRE 8 or higher. See below. ## Used libraries * OpenJFX https://wiki.openjdk.java.net/display/OpenJFX/Main @@ -17,12 +17,29 @@ JRE 8 or higher. * Few icons taken from: http://materialdesignicons.com/ ## Usage -Linux: +### Linux: + +Install JRE/JDK 8 or higher (openJDK is good. Oracle's one is also good). JavaFX not needed, if you're interested (it's embedded). `root # java -jar /path/to/NS-USBloader.jar` +### Windows: + +* Download Zadig: https://zadig.akeo.ie/ +* Open tinfoil. Set 'Title Managment' -> 'Usb install NSP' +* Connect NS to pc +* Open Zadig, select NS in dropdown, select 'libusbK (v3.0.7.0)' (version may vary), click 'Install WCID Driver' +* Check that in device list of you system you have 'libusbK USB Devices' folder and your NS inside of it +* Download and install Java JRE (8+) +* Get this application (JAR file) double-click on on it (alternatively open 'cmd', go to place where jar located and execute via 'java -jar thisAppName.jar') +* Remember to have fun! + +### macOS + +Coming... + ## Tips&tricks -### Add user to udev rules to use NS non-root: +### Add user to udev rules to use NS non-root (Linux): `root # vim /etc/udev/rules.d/99-NS.rules` `SUBSYSTEM=="usb", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="3000", GROUP="plugdev"` `root # udevadm control --reload-rules && udevadm trigger` @@ -32,4 +49,5 @@ Linux: ## TODO: - [ ] macOS QA -- [ ] Windows support \ No newline at end of file +- [x] Windows support +- [ ] code refactoring \ No newline at end of file diff --git a/src/main/java/nsusbloader/UsbCommunications.java b/src/main/java/nsusbloader/UsbCommunications.java index baee27f..8ba6f1c 100644 --- a/src/main/java/nsusbloader/UsbCommunications.java +++ b/src/main/java/nsusbloader/UsbCommunications.java @@ -336,7 +336,7 @@ class UsbCommunications extends Task { * After we sent commands to NS, this chain starts * */ private void proceedCommands(){ - printLog("Waiting for NS commands.", MsgType.INFO); + printLog("Awaiting for NS commands.", MsgType.INFO); /* byte[] magic = new byte[4]; ByteBuffer bb = StandardCharsets.UTF_8.encode("TUC0").rewind().get(magic); @@ -565,7 +565,7 @@ class UsbCommunications extends Task { IntBuffer readBufTransferred = IntBuffer.allocate(1); int result; - result = LibUsb.bulkTransfer(handlerNS, (byte) 0x81, readBuffer, readBufTransferred, 0); // last one is TIMEOUT. 0 stands for unlimited. Endpoint IN = 0x81 + result = LibUsb.bulkTransfer(handlerNS, (byte) 0x81, readBuffer, readBufTransferred, 5000); // last one is TIMEOUT. 0 stands for unlimited. Endpoint IN = 0x81 if (result != LibUsb.SUCCESS){ switch (result){ @@ -588,7 +588,6 @@ class UsbCommunications extends Task { return null; } else { // DEBUG START---------------------------------------------------------------------------------------------- - readBuffer.rewind(); int trans = readBufTransferred.get(); byte[] receivedBytes = new byte[trans]; readBuffer.get(receivedBytes);