Compare commits

...

7 Commits
readme ... main

4 changed files with 32 additions and 7 deletions

2
.gitmodules vendored
View File

@ -1,3 +1,3 @@
[submodule "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
View 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

View File

@ -3,11 +3,12 @@
#include <gccore.h>
#include <network.h>
#include <wiiuse/wpad.h>
#include <jansson.h>
#include <stdbool.h>
#include "sandia/sandia.h"
#include <jansson.h>
#include "input_macros.h"
// Uncomment if this is a development build
//#include "debug.h"
@ -89,7 +90,7 @@ int main(int argc, char **argv) {
printf("%s.\n", localip);
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;
int resBodyLength = strlen(res.body);
for (int i = 0; i < resBodyLength; i++) {
@ -133,8 +134,8 @@ int main(int argc, char **argv) {
u32 pressed = WPAD_ButtonsDown(0);
if ( pressed & WPAD_BUTTON_HOME ) {
logprint(0, "HOME pressed, quitting!");
if ( pressed && INPUT_BUTTON_HOME ) {
logprint(0, "HOME pressed, quitting!\n");
exit(0);
}

@ -1 +1 @@
Subproject commit 62ea4d024fda8663463ddc20c13eec5e1c08b2de
Subproject commit 8f4d62429b06bb851f03c21c7796ae69f78541a8