Skip to content

Commit 670968a

Browse files
committed
Update for FW 13.0.0
1 parent 7686597 commit 670968a

File tree

7 files changed

+19
-7
lines changed

7 files changed

+19
-7
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Instead, clone the repository **recursively** using any git client you have. (Gi
4545

4646
Like all other switch projects, you need to have [devkitA64](https://switchbrew.org/wiki/Setting_up_Development_Environment) set up on your system.
4747

48-
For compatibility with the Atmosphere-libs dependency, this project currently uses a version of libnx at commit **[5509f8f](https://github.com/switchbrew/libnx/commit/5509f8f14bc87a41794855d2b965cf0c08e9dd6d)**. Clone the repository, checkout to that commit, and run `make install` to set it up.
48+
For compatibility with the Atmosphere-libs dependency, this project currently uses a version of libnx at commit **[b35d42f](https://github.com/switchbrew/libnx/commit/b35d42faaa60b02662aaaf0702614f6e4afcbbbc)**. Clone the repository, checkout to that commit, and run `make install` to set it up.
4949

5050
If you have **Visual Studio Code**, you can open the project as a folder and run the build tasks from inside the program. It also has Intellisense configured for switch development, if you have DEVKITPRO correctly defined in your environment variables. Handy!
5151

source/ControllerSwitch/SwitchHDLHandler.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#include "ControllerHelpers.h"
33
#include <cmath>
44

5+
static HiddbgHdlsSessionId g_hdlsSessionId;
6+
57
SwitchHDLHandler::SwitchHDLHandler(std::unique_ptr<IController> &&controller)
68
: SwitchVirtualGamepadHandler(std::move(controller))
79
{
@@ -84,7 +86,7 @@ Result SwitchHDLHandler::UpdateHdlState()
8486
//Checks if the virtual device was erased, in which case re-attach the device
8587
bool isAttached;
8688

87-
if (R_SUCCEEDED(hiddbgIsHdlsVirtualDeviceAttached(m_hdlHandle, &isAttached)))
89+
if (R_SUCCEEDED(hiddbgIsHdlsVirtualDeviceAttached(GetHdlsSessionId(), m_hdlHandle, &isAttached)))
8890
{
8991
if (!isAttached)
9092
hiddbgAttachHdlsVirtualDevice(&m_hdlHandle, &m_deviceInfo);
@@ -196,4 +198,9 @@ void SwitchHDLHandler::UpdateOutput()
196198
}
197199

198200
svcSleepThread(1e+7L);
201+
}
202+
203+
HiddbgHdlsSessionId &SwitchHDLHandler::GetHdlsSessionId()
204+
{
205+
return g_hdlsSessionId;
199206
}

source/ControllerSwitch/SwitchHDLHandler.h

+2
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,6 @@ class SwitchHDLHandler : public SwitchVirtualGamepadHandler
3434
void FillHdlState(const NormalizedButtonData &data);
3535
//Passes the HDL state to HID so that it could register the inputs
3636
Result UpdateHdlState();
37+
38+
static HiddbgHdlsSessionId &GetHdlsSessionId();
3739
};

source/Sysmodule/config.json

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
"pool_partition": 2,
1212
"is_64_bit": true,
1313
"address_space_type": 1,
14+
"system_resource_size": "0",
15+
"disable_device_address_space_merge": true,
1416
"filesystem_access": {
1517
"permissions": "0xffffffffffffffff"
1618
},

source/Sysmodule/source/config_handler.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ namespace syscon::config
5555

5656
ControllerButton StringToKey(const char *text)
5757
{
58-
for (int i = 0; i != keyNames.size(); ++i)
58+
for (std::size_t i = 0; i != keyNames.size(); ++i)
5959
{
6060
if (strcmp(keyNames[i], text) == 0)
6161
{

source/Sysmodule/source/main.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
#include "controller_handler.h"
77
#include "config_handler.h"
88
#include "psc_module.h"
9+
#include "SwitchHDLHandler.h"
910

10-
#define APP_VERSION "0.6.3"
11+
#define APP_VERSION "0.6.4"
1112

1213
// libnx fake heap initialization
1314
extern "C"
@@ -66,7 +67,7 @@ extern "C" void __appInit(void)
6667

6768
R_ABORT_UNLESS(hiddbgInitialize());
6869
if (hosversionAtLeast(7, 0, 0))
69-
R_ABORT_UNLESS(hiddbgAttachHdlsWorkBuffer());
70+
R_ABORT_UNLESS(hiddbgAttachHdlsWorkBuffer(&SwitchHDLHandler::GetHdlsSessionId()));
7071
R_ABORT_UNLESS(usbHsInitialize());
7172
R_ABORT_UNLESS(pscmInitialize());
7273
R_ABORT_UNLESS(fsInitialize());
@@ -81,7 +82,7 @@ extern "C" void __appExit(void)
8182
{
8283
pscmExit();
8384
usbHsExit();
84-
hiddbgReleaseHdlsWorkBuffer();
85+
hiddbgReleaseHdlsWorkBuffer(SwitchHDLHandler::GetHdlsSessionId());
8586
hiddbgExit();
8687
fsdevUnmountAll();
8788
fsExit();

source/libstratosphere

Submodule libstratosphere updated 543 files

0 commit comments

Comments
 (0)