diff --git a/PC/3DSController.ini b/PC/3DSController.ini index c4731c4..29ce15a 100644 --- a/PC/3DSController.ini +++ b/PC/3DSController.ini @@ -1,12 +1,12 @@ -Default port is 8888, if you change this, you must change it in the 3DS's 3DSController.ini as well, +Default port is 8889, if you change this, you must change it in the 3DS's 3DSController.ini as well, Circle Pad and Touch can be either JOYSTICK or MOUSE, Buttons can either be a letter for example B, or a special key, like SPACE, CLICK, RIGHT CLICK, ENTER, BACKSPACE, SHIFT, TAB, LEFT, RIGHT, UP, DOWN, PAGE UP, PAGE DOWN, or WINDOWS, Alternatively, you can disable a key by binding it to NONE, Make sure to use a space, not a tab for seperating settings Throttle controls the delay between checking for new packets (in milliseconds), a high number will have slightly more lag between pressing a button on the 3DS and receiving it on the PC, however will make the application use less CPU. In my experience, 20 is a reasonable throttling amount. -Throttle: 20 Port: 8889 +Throttle: 20 Circle Pad: JOYSTICK Touch: MOUSE Mouse Speed: 4 diff --git a/PC/include/settings.h b/PC/include/settings.h index 3c21488..c25114f 100644 --- a/PC/include/settings.h +++ b/PC/include/settings.h @@ -8,6 +8,7 @@ enum analogue { }; struct settings { + int port; int throttle; enum analogue circlePad; enum analogue touch; diff --git a/PC/include/wireless.h b/PC/include/wireless.h index 33b46b5..338ed57 100644 --- a/PC/include/wireless.h +++ b/PC/include/wireless.h @@ -30,8 +30,6 @@ struct packet { } touch; }; -extern int port; - extern SOCKET listener; extern SOCKET client; diff --git a/PC/source/main.c b/PC/source/main.c index c1a7341..30f5d40 100644 --- a/PC/source/main.c +++ b/PC/source/main.c @@ -43,7 +43,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmd, int nShow) initNetwork(); - printf("Port: %d\n", port); + printf("Port: %d\n", settings.port); printf("Running on: %s\n", hostName); diff --git a/PC/source/settings.c b/PC/source/settings.c index fcccb9a..32193b1 100644 --- a/PC/source/settings.c +++ b/PC/source/settings.c @@ -9,6 +9,7 @@ struct settings settings; struct settings defaultSettings = { + port: 8889, throttle: 20, circlePad: joystick, touch: mouse, @@ -93,12 +94,12 @@ bool readSettings(void) { char setting[64] = { '\0' }; - if(getSetting("Throttle: ", buffer, setting)) { - sscanf(setting, "%d", &settings.throttle); + if(getSetting("Port: ", buffer, setting)) { + sscanf(setting, "%d", &settings.port); } - if(getSetting("Port: ", buffer, setting)) { - sscanf(setting, "%d", &port); + if(getSetting("Throttle: ", buffer, setting)) { + sscanf(setting, "%d", &settings.throttle); } if(getSetting("Circle Pad: ", buffer, setting)) { diff --git a/PC/source/wireless.c b/PC/source/wireless.c index ee4c66b..a14162e 100644 --- a/PC/source/wireless.c +++ b/PC/source/wireless.c @@ -1,8 +1,8 @@ #include "general.h" -#include "wireless.h" +#include "settings.h" -int port = 8888; +#include "wireless.h" SOCKET listener; SOCKET client; @@ -55,7 +55,7 @@ void startListening(void) { serverInfo.sin_family = AF_INET; serverInfo.sin_addr.s_addr = IP; - serverInfo.sin_port = htons(port); + serverInfo.sin_port = htons(settings.port); u_long one = 1; ioctlsocket(listener, FIONBIO, &one);