forked from libreshop/libreshop_client
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
934d27ef53 | |||
086116422f | |||
1bf7af7226 | |||
dc8d2ab523 | |||
1b0469f5de | |||
b8ee888756 | |||
1a9807450f |
2
.gitmodules
vendored
2
.gitmodules
vendored
@ -1,3 +1,3 @@
|
|||||||
[submodule "source/sandia"]
|
[submodule "source/sandia"]
|
||||||
path = source/sandia
|
path = source/sandia
|
||||||
url = https://git.donut.eu.org/nez/sandia-Wii.git
|
url = https://git.donut.eu.org/libreshop/sandia-Wii.git
|
||||||
|
24
source/input_macros.h
Normal file
24
source/input_macros.h
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#ifndef INPUT_MACROS_H
|
||||||
|
#define INPUT_MACROS_H
|
||||||
|
|
||||||
|
#include <wiiuse/wpad.h>
|
||||||
|
|
||||||
|
// Input definitions table
|
||||||
|
// TODO: GameCube controller support
|
||||||
|
// Macro name Classic Controller Wii Remote
|
||||||
|
#define INPUT_BUTTON_HOME (WPAD_CLASSIC_BUTTON_HOME || WPAD_BUTTON_HOME )
|
||||||
|
|
||||||
|
#define INPUT_BUTTON_PLUS (WPAD_CLASSIC_BUTTON_PLUS || WPAD_BUTTON_PLUS )
|
||||||
|
#define INPUT_BUTTON_MINUS (WPAD_CLASSIC_BUTTON_MINUS || WPAD_BUTTON_MINUS )
|
||||||
|
|
||||||
|
#define INPUT_BUTTON_A (WPAD_CLASSIC_BUTTON_Y || WPAD_BUTTON_A )
|
||||||
|
#define INPUT_BUTTON_B (WPAD_CLASSIC_BUTTON_B || WPAD_BUTTON_B )
|
||||||
|
#define INPUT_BUTTON_X (WPAD_CLASSIC_BUTTON_X || WPAD_BUTTON_1 )
|
||||||
|
#define INPUT_BUTTON_Y (WPAD_CLASSIC_BUTTON_A || WPAD_BUTTON_2 )
|
||||||
|
|
||||||
|
#define INPUT_BUTTON_UP (WPAD_CLASSIC_BUTTON_UP || WPAD_BUTTON_UP )
|
||||||
|
#define INPUT_BUTTON_DOWN (WPAD_CLASSIC_BUTTON_DOWN || WPAD_BUTTON_DOWN )
|
||||||
|
#define INPUT_BUTTON_LEFT (WPAD_CLASSIC_BUTTON_LEFT || WPAD_BUTTON_LEFT )
|
||||||
|
#define INPUT_BUTTON_RIGHT (WPAD_CLASSIC_BUTTON_RIGHT || WPAD_BUTTON_RIGHT )
|
||||||
|
|
||||||
|
#endif // INPUT_MACROS_H
|
@ -3,11 +3,12 @@
|
|||||||
#include <gccore.h>
|
#include <gccore.h>
|
||||||
#include <network.h>
|
#include <network.h>
|
||||||
#include <wiiuse/wpad.h>
|
#include <wiiuse/wpad.h>
|
||||||
|
#include <jansson.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "sandia/sandia.h"
|
#include "sandia/sandia.h"
|
||||||
#include <jansson.h>
|
|
||||||
|
#include "input_macros.h"
|
||||||
|
|
||||||
// Uncomment if this is a development build
|
// Uncomment if this is a development build
|
||||||
//#include "debug.h"
|
//#include "debug.h"
|
||||||
@ -89,7 +90,7 @@ int main(int argc, char **argv) {
|
|||||||
printf("%s.\n", localip);
|
printf("%s.\n", localip);
|
||||||
|
|
||||||
sandia req = sandia_create("libreshop.donut.eu.org", 80);
|
sandia req = sandia_create("libreshop.donut.eu.org", 80);
|
||||||
sandia_response res = sandia_get_request(&req, "/");
|
sandia_response res = sandia_get_request(&req, "/", 1);
|
||||||
bool lastWasNewline = false;
|
bool lastWasNewline = false;
|
||||||
int resBodyLength = strlen(res.body);
|
int resBodyLength = strlen(res.body);
|
||||||
for (int i = 0; i < resBodyLength; i++) {
|
for (int i = 0; i < resBodyLength; i++) {
|
||||||
@ -133,8 +134,8 @@ int main(int argc, char **argv) {
|
|||||||
|
|
||||||
u32 pressed = WPAD_ButtonsDown(0);
|
u32 pressed = WPAD_ButtonsDown(0);
|
||||||
|
|
||||||
if ( pressed & WPAD_BUTTON_HOME ) {
|
if ( pressed && INPUT_BUTTON_HOME ) {
|
||||||
logprint(0, "HOME pressed, quitting!");
|
logprint(0, "HOME pressed, quitting!\n");
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 62ea4d024fda8663463ddc20c13eec5e1c08b2de
|
Subproject commit 8f4d62429b06bb851f03c21c7796ae69f78541a8
|
Loading…
Reference in New Issue
Block a user