diff --git a/client/Makefile_arm7 b/client/Makefile_arm7
index 7e2a835..db84418 100644
--- a/client/Makefile_arm7
+++ b/client/Makefile_arm7
@@ -16,7 +16,7 @@ include $(DEVKITARM)/ds_rules
#---------------------------------------------------------------------------------
BUILD := build_arm7
SOURCES := source/arm7
-INCLUDES :=
+INCLUDES := ../../dsiwifi/include
DATA :=
#---------------------------------------------------------------------------------
@@ -36,13 +36,13 @@ CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -fno-rtti
ASFLAGS := -g $(ARCH)
LDFLAGS = -specs=ds_arm7.specs -g $(ARCH) -Wl,-Map,$(notdir $*).map
-LIBS := -ldswifi7 -lnds7
+LIBS := -ldsiwifi7 -lnds7
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
-LIBDIRS := $(LIBNDS)
+LIBDIRS := ../../dsiwifi $(LIBNDS)
#---------------------------------------------------------------------------------
@@ -85,10 +85,10 @@ else
endif
#---------------------------------------------------------------------------------
-.PHONY: $(BUILD) clean
+.PHONY: $(BUILD) clean ../dsiwifi/lib/libdsiwifi7
#---------------------------------------------------------------------------------
-$(BUILD):
+$(BUILD): ../dsiwifi/lib/libdsiwifi7
@[ -d $@ ] || mkdir -p $@
@make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile_arm7
@@ -96,6 +96,12 @@ $(BUILD):
clean:
@echo clean ...
@rm -fr $(BUILD) *.elf
+ $(MAKE) -C ../dsiwifi/arm_iop clean
+
+../dsiwifi/lib/libdsiwifi7:
+ mkdir -p ../dsiwifi/lib
+ $(MAKE) -C ../dsiwifi/arm_iop TOPDIR=$(CURDIR)/../dsiwifi BUILD=release
+
#---------------------------------------------------------------------------------
diff --git a/client/Makefile_arm9 b/client/Makefile_arm9
index 76b4ab7..83f3671 100644
--- a/client/Makefile_arm9
+++ b/client/Makefile_arm9
@@ -17,10 +17,9 @@ include $(DEVKITARM)/ds_rules
BUILD := build_arm9
SOURCES := source source/gui source/windows ../common ../common/iniparser/src
DATA :=
-INCLUDES := source source/gui source/windows ..
+INCLUDES := source source/gui source/windows .. ../dsiwifi/include
GRAPHICS :=
-PORTLIBS := $(DEVKITPRO)/portlibs/armv5te
-
+PORTLIBS := $(PORTLIBS_PATH)/nds
#---------------------------------------------------------------------------------
# options for code generation
@@ -41,14 +40,14 @@ LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project (order is important)
#---------------------------------------------------------------------------------
-LIBS := -lfat -ldswifi9 -lnds9 -lpng -lfreetype -lz
+LIBS := -lfat -ldsiwifi9 -lnds9 -lpng -lfreetype -lz
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
-LIBDIRS := $(LIBNDS) $(PORTLIBS)
+LIBDIRS := ../../dsiwifi $(LIBNDS) $(PORTLIBS)
#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
@@ -94,10 +93,10 @@ export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib)
-.PHONY: $(BUILD) clean
+.PHONY: $(BUILD) clean ../dsiwifi/lib/libdsiwif9
#---------------------------------------------------------------------------------
-$(BUILD):
+$(BUILD): ../dsiwifi/lib/libdsiwifi9
@[ -d $@ ] || mkdir -p $@
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile_arm9
@@ -105,6 +104,11 @@ $(BUILD):
clean:
@echo clean ...
@rm -fr $(BUILD) *.elf *.bin
+ $(MAKE) -C ../dsiwifi/arm_host clean
+
+../dsiwifi/lib/libdsiwifi9:
+ mkdir -p ../dsiwifi/lib
+ $(MAKE) -C ../dsiwifi/arm_host TOPDIR=$(CURDIR)/../dsiwifi BUILD=release
#---------------------------------------------------------------------------------
diff --git a/client/client.vcxproj b/client/client.vcxproj
index 02723e4..86f7d76 100644
--- a/client/client.vcxproj
+++ b/client/client.vcxproj
@@ -118,20 +118,20 @@
- C:\devkitPro\msys\bin\make.exe -f Makefile_nds
+ C:\devkitPro\msys2\msys2_shell.cmd -here -no-start -defterm -l -c "make -f Makefile_nds"
ds2key.nds
- C:\devkitPro\msys\bin\make.exe -f Makefile_nds clean
+ C:\devkitPro\msys2\msys2_shell.cmd -here -no-start -defterm -l -c "make -f Makefile_nds clean"
EMULATOR=0;D2KCLIENT;ARM9;_NDS;
- $(ProjectDir)source;$(ProjectDir)..\common;$(ProjectDir)..;C:\devkitPro\portlibs\armv5te\include\freetype2;C:\devkitPro\portlibs\armv5te\include;C:\devkitPro\devkitARM\include;C:\devkitPro\libnds\include;$(VC_IncludePath);$(WindowsSDK_IncludePath);
- C:\devkitPro\msys\bin\make.exe -f Makefile_nds clean && C:\devkitPro\msys\bin\make.exe -f Makefile_nds
+ $(ProjectDir)source;$(ProjectDir)..\common;$(ProjectDir)..;$(ProjectDir)..\dsiwifi\include;C:\devkitPro\portlibs\nds\include\freetype2;C:\devkitPro\portlibs\nds\include;C:\devkitPro\devkitARM\include;C:\devkitPro\libnds\include;$(VC_IncludePath);$(WindowsSDK_IncludePath);
+ C:\devkitPro\msys2\msys2_shell.cmd -here -no-start -defterm -l -c "make -f Makefile_nds clean && make -f Makefile_nds"
- C:\devkitPro\msys\bin\make.exe -f Makefile_3ds
+ C:\devkitPro\msys2\msys2_shell.cmd -here -no-start -defterm -l -c "make -f Makefile_3ds"
3ds2key.3dsx
- C:\devkitPro\msys\bin\make.exe -f Makefile_3ds clean
+ C:\devkitPro\msys2\msys2_shell.cmd -here -no-start -defterm -l -c "make -f Makefile_3ds clean"
EMULATOR=0;D2KCLIENT;ARM11;_3DS;
$(ProjectDir)source;$(ProjectDir)..\common;$(ProjectDir)..;C:\devkitPro\portlibs\armv6k\include\freetype2;C:\devkitPro\portlibs\armv6k\include;C:\devkitPro\devkitARM\include;C:\devkitPro\libctru\include;$(VC_IncludePath);$(WindowsSDK_IncludePath);
- C:\devkitPro\msys\bin\make.exe -f Makefile_3ds clean && C:\devkitPro\msys\bin\make.exe -f Makefile_3ds
+ C:\devkitPro\msys2\msys2_shell.cmd -here -no-start -defterm -l -c "make -f Makefile_3ds clean && make -f Makefile_3ds"
diff --git a/client/client.vcxproj.user b/client/client.vcxproj.user
index 0e46817..27fbac5 100644
--- a/client/client.vcxproj.user
+++ b/client/client.vcxproj.user
@@ -1,7 +1,7 @@
- true
+ false
@@ -9,8 +9,11 @@
WindowsLocalDebugger
- C:\devkitPro\msys\bin\make.exe
- -f Makefile_3ds run
+
+
+
+
+
@@ -18,7 +21,10 @@
WindowsLocalDebugger
- C:\devkitPro\msys\bin\make.exe
- -f Makefile_nds run
+
+
+
+
+
\ No newline at end of file
diff --git a/client/source/arm7/main7.c b/client/source/arm7/main7.c
index 00565b2..4a3c213 100644
--- a/client/source/arm7/main7.c
+++ b/client/source/arm7/main7.c
@@ -1,5 +1,5 @@
#include
-#include
+#include
volatile bool exit_flag = false;
diff --git a/client/source/core.cpp b/client/source/core.cpp
index 312d3a1..c2078d1 100644
--- a/client/source/core.cpp
+++ b/client/source/core.cpp
@@ -12,7 +12,7 @@
#elif defined(_NDS)
#include
#include
-#include
+#include
#endif
#include "core.h"
@@ -483,9 +483,9 @@ bool Init(int argc, char* argv[])
if(!EMULATOR)
{
LOG(INFO) << "Connecting via WFC data\n";
- if(!Wifi_InitDefault(WFC_CONNECT))
+ if(!DSiWifi_InitDefault(WFC_CONNECT))
{
- LOG(ERROR) << "Error (Wifi_InitDefault): Failed to connect\n";
+ LOG(ERROR) << "Error (DSiWifi_InitDefault): Failed to connect\n";
return true; // Return with error
}
@@ -513,6 +513,16 @@ bool Init(int argc, char* argv[])
UDP::Init(); // Initilize UDP
Config::Load(); // Load UDP settings
+
+ // wait a few seconds on nds
+#ifdef _NDS
+ for (int i = 0; i < 60*5; i++)
+ {
+ WaitForVBlank();
+ }
+#endif
+
+
UDP::Connect(); // Connect with settings
#ifdef _NDS
if(!toggle_both_lights)
diff --git a/client/source/windows/configWindow.cpp b/client/source/windows/configWindow.cpp
index 7249524..7db7299 100644
--- a/client/source/windows/configWindow.cpp
+++ b/client/source/windows/configWindow.cpp
@@ -320,7 +320,7 @@ bool WindowClass::Update()
ButtonSlider3DFunction();
last_slider_3d_status = g_slider_3d_status;
}
-#elif defined(_NDS)
+//#elif defined(_NDS) // TODO why did this check defined(_NDS)
else if(g_keys_down&KEY_BLUE)
ButtonBlueFunction();
else if(g_keys_down&KEY_YELLOW)
diff --git a/common/udp.cpp b/common/udp.cpp
index d1cf9e7..11a8759 100644
--- a/common/udp.cpp
+++ b/common/udp.cpp
@@ -17,7 +17,7 @@
#include // ioctl
#elif defined(_NDS)
#include
-#include
+#include
#include
#include
#include
@@ -52,8 +52,8 @@
#define NETclosesocket close
#define SOCKET_ERROR -1
#elif defined(_NDS)
-typedef int socklen_t;
-#define NETclosesocket closesocket
+#define SOCKET_ERROR -1
+#define NETclosesocket close
#elif defined(_3DS)
#define SOCKET_ERROR -1
#define NETclosesocket closesocket
@@ -63,8 +63,8 @@ typedef int socklen_t;
#if defined(_NDS) || defined(_3DS)
#include "core.h"
-#include "commandWindow.h"
-#include "configWindow.h"
+#include "windows/commandWindow.h"
+#include "windows/configWindow.h"
#endif
#include "udp.h"
@@ -199,7 +199,7 @@ int Connect(bool _non_blocking, uint16_t _port)
return err;
}
connected = true;
- LOG(INFO) << "Connected on UDP port #" << GetPort();
+ LOG(INFO) << "Connected on UDP port #" << GetPort() << "\n";
return 0;
}
@@ -220,7 +220,7 @@ int Disconnect()
return err;
}
- LOG(INFO) << "UDP Disconnected";
+ LOG(INFO) << "UDP Disconnected\n";
}
return 0;
@@ -252,7 +252,7 @@ int Send(const void* buffer, unsigned int length)
LOG(ERROR) << "Error #" << err << " (sendto): " << strerror(err) << "\n";
return err;
}
- LOG_EVERY_N(300, TRACE) << "Sent " << length << " bytes";
+ //LOG_EVERY_N(300, TRACE) << "Sent " << length << " bytes";
}
return 0;
@@ -296,7 +296,7 @@ int Recv(void* buffer, unsigned int length, struct sockaddr* _remote_sockaddr)
return err;
}
- LOG_EVERY_N(300, TRACE) << "Received " << length << " bytes";
+ //LOG_EVERY_N(300, TRACE) << "Received " << length << " bytes";
}
return 0;
@@ -305,7 +305,7 @@ int Recv(void* buffer, unsigned int length, struct sockaddr* _remote_sockaddr)
unsigned long GetLocalIP()
{
#if defined(_NDS)
- return Wifi_GetIP();
+ return DSiWifi_GetIP();
#elif defined(_3DS)
return gethostid();
#elif defined(_WIN32) || defined(__linux__)
@@ -367,7 +367,7 @@ void SetConfigPort(uint16_t _port)
{
// If port is 0, Use default port 9501
UDP::port = _port == 0 ? DEFAULT_PORT : _port;
- LOG(INFO) << "UDP Port set to #" << UDP::GetPort() << ".";
+ LOG(INFO) << "UDP Port set to #" << UDP::GetPort() << ".\n";
}
#if defined(D2KCLIENT)
@@ -375,7 +375,7 @@ void SetConfigPort(uint16_t _port)
void SendNormalSetting(DS2KeySingleInputSettingPacket setting)
{
Send(&setting, sizeof(DS2KeySingleInputSettingPacket));
- LOG(TRACE) << "SendNormalSetting()";
+ LOG(TRACE) << "SendNormalSetting()\n";
}
void SendCommand(uint8_t command)
{
@@ -388,7 +388,7 @@ void SendCommand(uint8_t command)
packet.keys = command;
Send(&packet, sizeof(DS2KeyPacket)); // Send packet
- LOG(TRACE) << "SendCommand(" << (int)command << ")";
+ LOG(TRACE) << "SendCommand(" << (int)command << ")\n";
}
void Update(uint32_t keys, uint32_t keysTurbo, const touchPosition* touch_position,
@@ -454,7 +454,7 @@ void Update(uint32_t keys, uint32_t keysTurbo, const touchPosition* touch_positi
packet.keyboard = keyboard;
Send(&packet, sizeof(DS2KeyPacket)); // Send packet
- LOG_EVERY_N(300, TRACE) << "Sent UDP::Update()";
+ //LOG_EVERY_N(300, TRACE) << "Sent UDP::Update()";
}
void SendLookupPacket()
@@ -463,7 +463,7 @@ void SendLookupPacket()
packet.type = UDP::PACKET::LOOKUP; // Set as a lookup packet
Send(&packet, sizeof(DS2KeyPacket)); // Send the packet out
- LOG_EVERY_N(10, TRACE) << "SendLookupPacket()";
+ //LOG_EVERY_N(10, TRACE) << "SendLookupPacket()";
}
void RequestSettingsCommand()
@@ -473,7 +473,7 @@ void RequestSettingsCommand()
packet.profile = UDP::GetProfile(); // Set profile
UDP::Send(&packet, sizeof(UDP::DS2KeyPacket)); // Send the packet out
- LOG(TRACE) << "RequestSettingsCommand()";
+ LOG(TRACE) << "RequestSettingsCommand()\n";
}
void RequestInputSettings()
@@ -483,7 +483,7 @@ void RequestInputSettings()
packet.profile = UDP::GetProfile(); // Set profile
UDP::Send(&packet, sizeof(UDP::DS2KeyPacket)); // Send the packet out
- LOG(TRACE) << "RequestInputSettings()";
+ LOG(TRACE) << "RequestInputSettings()\n";
}
void ServerLookup()
@@ -543,11 +543,11 @@ void ListenForServer()
break;
case UDP::PACKET::COMMAND_SETTINGS: // Received Command Settings
GUI::Command::ProcessCommandSettingsPacket(command_settings_packet);
- LOG(TRACE) << "Received UDP::PACKET::COMMAND_SETTINGS";
+ LOG(TRACE) << "Received UDP::PACKET::COMMAND_SETTINGS\n";
break;
case UDP::PACKET::INPUT_SETTINGS: // Received Input Settings
GUI::ConfigWindow::ProcessInputSettingsPacket(*input_settings_packet_pointer);
- LOG(TRACE) << "Received UDP::PACKET::INPUT_SETTINGS";
+ LOG(TRACE) << "Received UDP::PACKET::INPUT_SETTINGS\n";
break;
default:
break;
@@ -580,12 +580,12 @@ void SetProfile(uint8_t _profile)
void SendCommandSettings(DS2KeyCommandSettingsPacket settings)
{
Send(&settings, sizeof(DS2KeyCommandSettingsPacket));
- LOG(TRACE) << "SendCommandSettings()";
+ LOG(TRACE) << "SendCommandSettings()\n";
}
void SendInputSettings(DS2KeyInputSettingsPacket settings)
{
Send(&settings, sizeof(DS2KeyInputSettingsPacket));
- LOG(TRACE) << "SendInputSettings()";
+ LOG(TRACE) << "SendInputSettings()\n";
}
#endif
diff --git a/ds2key.sln b/ds2key.sln
index 22fe010..5558cb3 100644
--- a/ds2key.sln
+++ b/ds2key.sln
@@ -10,6 +10,31 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "client", "client\client.vcx
{90C7424E-D238-441D-8590-3A125AA0C29B} = {90C7424E-D238-441D-8590-3A125AA0C29B}
EndProjectSection
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dsiwifi", "dsiwifi", "{5450C5B6-A202-4689-9369-92A4F0D95B2A}"
+ ProjectSection(SolutionItems) = preProject
+ dsiwifi\.gitignore = dsiwifi\.gitignore
+ dsiwifi\dsiwifi_license.txt = dsiwifi\dsiwifi_license.txt
+ dsiwifi\dswifi_license.txt = dsiwifi\dswifi_license.txt
+ dsiwifi\Makefile = dsiwifi\Makefile
+ EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{521D02E3-B79C-4E40-AB11-2B6BEC4F1C16}"
+ ProjectSection(SolutionItems) = preProject
+ .gitignore = .gitignore
+ COPYING = COPYING
+ README.md = README.md
+ EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "arm_host", "arm_host", "{62A02FA3-7C5A-4688-9D6F-B581D984B623}"
+ ProjectSection(SolutionItems) = preProject
+ dsiwifi\arm_host\Makefile = dsiwifi\arm_host\Makefile
+ EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "arm_iop", "arm_iop", "{893E970F-E4CA-4FD0-B5B3-432EE689DB0B}"
+ ProjectSection(SolutionItems) = preProject
+ dsiwifi\arm_iop\Makefile = dsiwifi\arm_iop\Makefile
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3DS|x86 = 3DS|x86
@@ -21,7 +46,6 @@ Global
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{90C7424E-D238-441D-8590-3A125AA0C29B}.3DS|x86.ActiveCfg = Debug|Win32
- {90C7424E-D238-441D-8590-3A125AA0C29B}.3DS|x86.Build.0 = Debug|Win32
{90C7424E-D238-441D-8590-3A125AA0C29B}.Debug|x86.ActiveCfg = Debug|Win32
{90C7424E-D238-441D-8590-3A125AA0C29B}.Debug|x86.Build.0 = Debug|Win32
{90C7424E-D238-441D-8590-3A125AA0C29B}.GUI Debug|x86.ActiveCfg = GUI Debug|Win32
@@ -29,24 +53,24 @@ Global
{90C7424E-D238-441D-8590-3A125AA0C29B}.GUI Release|x86.ActiveCfg = GUI Release|Win32
{90C7424E-D238-441D-8590-3A125AA0C29B}.GUI Release|x86.Build.0 = GUI Release|Win32
{90C7424E-D238-441D-8590-3A125AA0C29B}.NDS|x86.ActiveCfg = Debug|Win32
- {90C7424E-D238-441D-8590-3A125AA0C29B}.NDS|x86.Build.0 = Debug|Win32
{90C7424E-D238-441D-8590-3A125AA0C29B}.Release|x86.ActiveCfg = Release|Win32
{90C7424E-D238-441D-8590-3A125AA0C29B}.Release|x86.Build.0 = Release|Win32
{6CEBDB4B-370A-4F11-A723-651484B0EF49}.3DS|x86.ActiveCfg = 3DS|ARM
{6CEBDB4B-370A-4F11-A723-651484B0EF49}.3DS|x86.Build.0 = 3DS|ARM
{6CEBDB4B-370A-4F11-A723-651484B0EF49}.Debug|x86.ActiveCfg = 3DS|ARM
- {6CEBDB4B-370A-4F11-A723-651484B0EF49}.Debug|x86.Build.0 = 3DS|ARM
{6CEBDB4B-370A-4F11-A723-651484B0EF49}.GUI Debug|x86.ActiveCfg = NDS|ARM
{6CEBDB4B-370A-4F11-A723-651484B0EF49}.GUI Release|x86.ActiveCfg = 3DS|ARM
- {6CEBDB4B-370A-4F11-A723-651484B0EF49}.GUI Release|x86.Build.0 = 3DS|ARM
{6CEBDB4B-370A-4F11-A723-651484B0EF49}.NDS|x86.ActiveCfg = NDS|ARM
{6CEBDB4B-370A-4F11-A723-651484B0EF49}.NDS|x86.Build.0 = NDS|ARM
{6CEBDB4B-370A-4F11-A723-651484B0EF49}.Release|x86.ActiveCfg = 3DS|ARM
- {6CEBDB4B-370A-4F11-A723-651484B0EF49}.Release|x86.Build.0 = 3DS|ARM
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {62A02FA3-7C5A-4688-9D6F-B581D984B623} = {5450C5B6-A202-4689-9369-92A4F0D95B2A}
+ {893E970F-E4CA-4FD0-B5B3-432EE689DB0B} = {5450C5B6-A202-4689-9369-92A4F0D95B2A}
+ EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E3DB59E8-1EB5-46A2-9211-BB4BA6284D85}
EndGlobalSection
diff --git a/server/server.vcxproj b/server/server.vcxproj
index c371da4..a4786be 100644
--- a/server/server.vcxproj
+++ b/server/server.vcxproj
@@ -127,7 +127,7 @@
true
true
true
- $(ProjectDir)core\vjoy\lib\vJoyInterface.lib;ws2_32.lib;%(AdditionalDependencies)
+ $(ProjectDir)core\vjoy\lib\vJoyInterface.lib;Winmm.lib;ws2_32.lib;%(AdditionalDependencies)
false
AsInvoker
@@ -151,7 +151,7 @@
true
true
true
- $(ProjectDir)core\vjoy\lib\vJoyInterface.lib;ws2_32.lib;%(AdditionalDependencies)
+ $(ProjectDir)core\vjoy\lib\vJoyInterface.lib;ws2_32.lib;Winmm.lib;%(AdditionalDependencies)
false