forked from wiiu-controller-mods/wup-installer-gx2
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
44b442b
commit aecb01d
Showing
9 changed files
with
103 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/.vscode | ||
/build | ||
*.elf | ||
*.rpx | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#include <stdio.h> | ||
#include <malloc.h> | ||
#include <vpad/input.h> | ||
#include "utils/logger.h" | ||
#include "ErrorViewer.h" | ||
|
||
ErrorViewer::ErrorViewer() | ||
{ | ||
client = (FSClient *)malloc(sizeof(FSClient)); | ||
FSAddClient(client, FS_ERROR_FLAG_ALL); | ||
|
||
createArg.workMemory = malloc(nn::erreula::GetWorkMemorySize()); | ||
createArg.fsClient = client; | ||
if (!nn::erreula::Create(createArg)) { | ||
log_printf("Failed to create error viewer"); | ||
return; | ||
} | ||
} | ||
|
||
ErrorViewer::~ErrorViewer() | ||
{ | ||
nn::erreula::Destroy(); | ||
free(createArg.workMemory); | ||
FSDelClient(client, FS_ERROR_FLAG_ALL); | ||
free(client); | ||
} | ||
|
||
void ErrorViewer::calc() | ||
{ | ||
VPADStatus vpadStatus; | ||
VPADRead(VPAD_CHAN_0, &vpadStatus, 1, nullptr); | ||
VPADGetTPCalibratedPoint(VPAD_CHAN_0, &vpadStatus.tpNormal, &vpadStatus.tpNormal); | ||
|
||
nn::erreula::ControllerInfo controllerInfo; | ||
controllerInfo.vpad = &vpadStatus; | ||
controllerInfo.kpad[0] = nullptr; | ||
controllerInfo.kpad[1] = nullptr; | ||
controllerInfo.kpad[2] = nullptr; | ||
controllerInfo.kpad[3] = nullptr; | ||
|
||
nn::erreula::Calc(controllerInfo); | ||
} | ||
|
||
void ErrorViewer::drawTV() | ||
{ | ||
nn::erreula::DrawTV(); | ||
} | ||
|
||
void ErrorViewer::drawDRC() | ||
{ | ||
nn::erreula::DrawDRC(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#pragma once | ||
|
||
#include <nn/erreula.h> | ||
#include <coreinit/filesystem.h> | ||
|
||
class ErrorViewer | ||
{ | ||
public: | ||
ErrorViewer(); | ||
|
||
~ErrorViewer(); | ||
|
||
void calc(); | ||
|
||
static void drawTV(); | ||
|
||
static void drawDRC(); | ||
|
||
private: | ||
FSClient *client; | ||
nn::erreula::CreateArg createArg; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters