Apply formatting for files
This commit is contained in:
parent
048d4e8289
commit
28adbd583a
10 changed files with 685 additions and 583 deletions
|
@ -1,8 +1,9 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "3ds/types.h"
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
#include "3ds/types.h"
|
||||||
|
|
||||||
struct settings {
|
struct settings {
|
||||||
char IPString[16];
|
char IPString[16];
|
||||||
int port;
|
int port;
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
#include <3ds.h>
|
#include <3ds.h>
|
||||||
#include <sys/socket.h>
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <netdb.h>
|
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <netdb.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
|
||||||
#include "3ds/services/hid.h"
|
#include "3ds/services/hid.h"
|
||||||
#include "inet_pton.h"
|
#include "inet_pton.h"
|
||||||
#include "sys/_types.h"
|
#include "sys/_types.h"
|
||||||
|
|
301
source/drawing.c
301
source/drawing.c
|
@ -1,108 +1,203 @@
|
||||||
#include <string.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
|
|
||||||
#include <3ds.h>
|
|
||||||
|
|
||||||
#include "drawing.h"
|
#include "drawing.h"
|
||||||
|
|
||||||
static const char fonts[] = { //Fonte 8x8 1BPP
|
#include <3ds.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
static const char fonts[] = {
|
||||||
|
// Fonte 8x8 1BPP
|
||||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 // tile:0
|
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 // tile:0
|
||||||
, 0x18, 0x18, 0x18, 0x18, 0x18, 0x0, 0x18, 0x0 //tile:1
|
,
|
||||||
, 0x6c, 0x6c, 0x6c, 0x0, 0x0, 0x0, 0x0, 0x0 //tile:2
|
0x18, 0x18, 0x18, 0x18, 0x18, 0x0, 0x18, 0x0 // tile:1
|
||||||
, 0x6c, 0x6c, 0xfe, 0x6c, 0xfe, 0x6c, 0x6c, 0x0 //tile:3
|
,
|
||||||
, 0x18, 0x7e, 0xc0, 0x7c, 0x6, 0xfc, 0x18, 0x0 //tile:4
|
0x6c, 0x6c, 0x6c, 0x0, 0x0, 0x0, 0x0, 0x0 // tile:2
|
||||||
, 0x0, 0xc6, 0xcc, 0x18, 0x30, 0x66, 0xc6, 0x0 //tile:5
|
,
|
||||||
, 0x38, 0x6c, 0x38, 0x76, 0xdc, 0xcc, 0x76, 0x0 //tile:6
|
0x6c, 0x6c, 0xfe, 0x6c, 0xfe, 0x6c, 0x6c, 0x0 // tile:3
|
||||||
, 0x30, 0x30, 0x60, 0x0, 0x0, 0x0, 0x0, 0x0 //tile:7
|
,
|
||||||
, 0xc, 0x18, 0x30, 0x30, 0x30, 0x18, 0xc, 0x0 //tile:8
|
0x18, 0x7e, 0xc0, 0x7c, 0x6, 0xfc, 0x18, 0x0 // tile:4
|
||||||
, 0x30, 0x18, 0xc, 0xc, 0xc, 0x18, 0x30, 0x0 //tile:9
|
,
|
||||||
, 0x0, 0x66, 0x3c, 0xff, 0x3c, 0x66, 0x0, 0x0 //tile:10
|
0x0, 0xc6, 0xcc, 0x18, 0x30, 0x66, 0xc6, 0x0 // tile:5
|
||||||
, 0x0, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x0, 0x0 //tile:11
|
,
|
||||||
, 0x0, 0x0, 0x0, 0x0, 0x0, 0x18, 0x18, 0x30 //tile:12
|
0x38, 0x6c, 0x38, 0x76, 0xdc, 0xcc, 0x76, 0x0 // tile:6
|
||||||
, 0x0, 0x0, 0x0, 0x7e, 0x0, 0x0, 0x0, 0x0 //tile:13
|
,
|
||||||
, 0x0, 0x0, 0x0, 0x0, 0x0, 0x18, 0x18, 0x0 //tile:14
|
0x30, 0x30, 0x60, 0x0, 0x0, 0x0, 0x0, 0x0 // tile:7
|
||||||
, 0x6, 0xc, 0x18, 0x30, 0x60, 0xc0, 0x80, 0x0 //tile:15
|
,
|
||||||
, 0x7c, 0xce, 0xde, 0xf6, 0xe6, 0xc6, 0x7c, 0x0 //tile:16
|
0xc, 0x18, 0x30, 0x30, 0x30, 0x18, 0xc, 0x0 // tile:8
|
||||||
, 0x18, 0x38, 0x18, 0x18, 0x18, 0x18, 0x7e, 0x0 //tile:17
|
,
|
||||||
, 0x7c, 0xc6, 0x6, 0x7c, 0xc0, 0xc0, 0xfe, 0x0 //tile:18
|
0x30, 0x18, 0xc, 0xc, 0xc, 0x18, 0x30, 0x0 // tile:9
|
||||||
, 0xfc, 0x6, 0x6, 0x3c, 0x6, 0x6, 0xfc, 0x0 //tile:19
|
,
|
||||||
, 0xc, 0xcc, 0xcc, 0xcc, 0xfe, 0xc, 0xc, 0x0 //tile:20
|
0x0, 0x66, 0x3c, 0xff, 0x3c, 0x66, 0x0, 0x0 // tile:10
|
||||||
, 0xfe, 0xc0, 0xfc, 0x6, 0x6, 0xc6, 0x7c, 0x0 //tile:21
|
,
|
||||||
, 0x7c, 0xc0, 0xc0, 0xfc, 0xc6, 0xc6, 0x7c, 0x0 //tile:22
|
0x0, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x0, 0x0 // tile:11
|
||||||
, 0xfe, 0x6, 0x6, 0xc, 0x18, 0x30, 0x30, 0x0 //tile:23
|
,
|
||||||
, 0x7c, 0xc6, 0xc6, 0x7c, 0xc6, 0xc6, 0x7c, 0x0 //tile:24
|
0x0, 0x0, 0x0, 0x0, 0x0, 0x18, 0x18, 0x30 // tile:12
|
||||||
, 0x7c, 0xc6, 0xc6, 0x7e, 0x6, 0x6, 0x7c, 0x0 //tile:25
|
,
|
||||||
, 0x0, 0x18, 0x18, 0x0, 0x0, 0x18, 0x18, 0x0 //tile:26
|
0x0, 0x0, 0x0, 0x7e, 0x0, 0x0, 0x0, 0x0 // tile:13
|
||||||
, 0x0, 0x18, 0x18, 0x0, 0x0, 0x18, 0x18, 0x30 //tile:27
|
,
|
||||||
, 0xc, 0x18, 0x30, 0x60, 0x30, 0x18, 0xc, 0x0 //tile:28
|
0x0, 0x0, 0x0, 0x0, 0x0, 0x18, 0x18, 0x0 // tile:14
|
||||||
, 0x0, 0x0, 0x7e, 0x0, 0x7e, 0x0, 0x0, 0x0 //tile:29
|
,
|
||||||
, 0x30, 0x18, 0xc, 0x6, 0xc, 0x18, 0x30, 0x0 //tile:30
|
0x6, 0xc, 0x18, 0x30, 0x60, 0xc0, 0x80, 0x0 // tile:15
|
||||||
, 0x3c, 0x66, 0xc, 0x18, 0x18, 0x0, 0x18, 0x0 //tile:31
|
,
|
||||||
, 0x7c, 0xc6, 0xde, 0xde, 0xde, 0xc0, 0x7e, 0x0 //tile:32
|
0x7c, 0xce, 0xde, 0xf6, 0xe6, 0xc6, 0x7c, 0x0 // tile:16
|
||||||
, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0x0 //tile:33
|
,
|
||||||
, 0xfc, 0xc6, 0xc6, 0xfc, 0xc6, 0xc6, 0xfc, 0x0 //tile:34
|
0x18, 0x38, 0x18, 0x18, 0x18, 0x18, 0x7e, 0x0 // tile:17
|
||||||
, 0x7c, 0xc6, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c, 0x0 //tile:35
|
,
|
||||||
, 0xf8, 0xcc, 0xc6, 0xc6, 0xc6, 0xcc, 0xf8, 0x0 //tile:36
|
0x7c, 0xc6, 0x6, 0x7c, 0xc0, 0xc0, 0xfe, 0x0 // tile:18
|
||||||
, 0xfe, 0xc0, 0xc0, 0xf8, 0xc0, 0xc0, 0xfe, 0x0 //tile:37
|
,
|
||||||
, 0xfe, 0xc0, 0xc0, 0xf8, 0xc0, 0xc0, 0xc0, 0x0 //tile:38
|
0xfc, 0x6, 0x6, 0x3c, 0x6, 0x6, 0xfc, 0x0 // tile:19
|
||||||
, 0x7c, 0xc6, 0xc0, 0xc0, 0xce, 0xc6, 0x7c, 0x0 //tile:39
|
,
|
||||||
, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x0 //tile:40
|
0xc, 0xcc, 0xcc, 0xcc, 0xfe, 0xc, 0xc, 0x0 // tile:20
|
||||||
, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7e, 0x0 //tile:41
|
,
|
||||||
, 0x6, 0x6, 0x6, 0x6, 0x6, 0xc6, 0x7c, 0x0 //tile:42
|
0xfe, 0xc0, 0xfc, 0x6, 0x6, 0xc6, 0x7c, 0x0 // tile:21
|
||||||
, 0xc6, 0xcc, 0xd8, 0xf0, 0xd8, 0xcc, 0xc6, 0x0 //tile:43
|
,
|
||||||
, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xfe, 0x0 //tile:44
|
0x7c, 0xc0, 0xc0, 0xfc, 0xc6, 0xc6, 0x7c, 0x0 // tile:22
|
||||||
, 0xc6, 0xee, 0xfe, 0xfe, 0xd6, 0xc6, 0xc6, 0x0 //tile:45
|
,
|
||||||
, 0xc6, 0xe6, 0xf6, 0xde, 0xce, 0xc6, 0xc6, 0x0 //tile:46
|
0xfe, 0x6, 0x6, 0xc, 0x18, 0x30, 0x30, 0x0 // tile:23
|
||||||
, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x0 //tile:47
|
,
|
||||||
, 0xfc, 0xc6, 0xc6, 0xfc, 0xc0, 0xc0, 0xc0, 0x0 //tile:48
|
0x7c, 0xc6, 0xc6, 0x7c, 0xc6, 0xc6, 0x7c, 0x0 // tile:24
|
||||||
, 0x7c, 0xc6, 0xc6, 0xc6, 0xd6, 0xde, 0x7c, 0x6 //tile:49
|
,
|
||||||
, 0xfc, 0xc6, 0xc6, 0xfc, 0xd8, 0xcc, 0xc6, 0x0 //tile:50
|
0x7c, 0xc6, 0xc6, 0x7e, 0x6, 0x6, 0x7c, 0x0 // tile:25
|
||||||
, 0x7c, 0xc6, 0xc0, 0x7c, 0x6, 0xc6, 0x7c, 0x0 //tile:51
|
,
|
||||||
, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x0 //tile:52
|
0x0, 0x18, 0x18, 0x0, 0x0, 0x18, 0x18, 0x0 // tile:26
|
||||||
, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0x0 //tile:53
|
,
|
||||||
, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x38, 0x0 //tile:54
|
0x0, 0x18, 0x18, 0x0, 0x0, 0x18, 0x18, 0x30 // tile:27
|
||||||
, 0xc6, 0xc6, 0xc6, 0xc6, 0xd6, 0xfe, 0x6c, 0x0 //tile:55
|
,
|
||||||
, 0xc6, 0xc6, 0x6c, 0x38, 0x6c, 0xc6, 0xc6, 0x0 //tile:56
|
0xc, 0x18, 0x30, 0x60, 0x30, 0x18, 0xc, 0x0 // tile:28
|
||||||
, 0xc6, 0xc6, 0xc6, 0x7c, 0x18, 0x30, 0xe0, 0x0 //tile:57
|
,
|
||||||
, 0xfe, 0x6, 0xc, 0x18, 0x30, 0x60, 0xfe, 0x0 //tile:58
|
0x0, 0x0, 0x7e, 0x0, 0x7e, 0x0, 0x0, 0x0 // tile:29
|
||||||
, 0x3c, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3c, 0x0 //tile:59
|
,
|
||||||
, 0xc0, 0x60, 0x30, 0x18, 0xc, 0x6, 0x2, 0x0 //tile:60
|
0x30, 0x18, 0xc, 0x6, 0xc, 0x18, 0x30, 0x0 // tile:30
|
||||||
, 0x3c, 0xc, 0xc, 0xc, 0xc, 0xc, 0x3c, 0x0 //tile:61
|
,
|
||||||
, 0x10, 0x38, 0x6c, 0xc6, 0x0, 0x0, 0x0, 0x0 //tile:62
|
0x3c, 0x66, 0xc, 0x18, 0x18, 0x0, 0x18, 0x0 // tile:31
|
||||||
, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff //tile:63
|
,
|
||||||
, 0x18, 0x18, 0xc, 0x0, 0x0, 0x0, 0x0, 0x0 //tile:64
|
0x7c, 0xc6, 0xde, 0xde, 0xde, 0xc0, 0x7e, 0x0 // tile:32
|
||||||
, 0x0, 0x0, 0x7c, 0x6, 0x7e, 0xc6, 0x7e, 0x0 //tile:65
|
,
|
||||||
, 0xc0, 0xc0, 0xc0, 0xfc, 0xc6, 0xc6, 0xfc, 0x0 //tile:66
|
0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0x0 // tile:33
|
||||||
, 0x0, 0x0, 0x7c, 0xc6, 0xc0, 0xc6, 0x7c, 0x0 //tile:67
|
,
|
||||||
, 0x6, 0x6, 0x6, 0x7e, 0xc6, 0xc6, 0x7e, 0x0 //tile:68
|
0xfc, 0xc6, 0xc6, 0xfc, 0xc6, 0xc6, 0xfc, 0x0 // tile:34
|
||||||
, 0x0, 0x0, 0x7c, 0xc6, 0xfe, 0xc0, 0x7c, 0x0 //tile:69
|
,
|
||||||
, 0x1c, 0x36, 0x30, 0x78, 0x30, 0x30, 0x78, 0x0 //tile:70
|
0x7c, 0xc6, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c, 0x0 // tile:35
|
||||||
, 0x0, 0x0, 0x7e, 0xc6, 0xc6, 0x7e, 0x6, 0xfc //tile:71
|
,
|
||||||
, 0xc0, 0xc0, 0xfc, 0xc6, 0xc6, 0xc6, 0xc6, 0x0 //tile:72
|
0xf8, 0xcc, 0xc6, 0xc6, 0xc6, 0xcc, 0xf8, 0x0 // tile:36
|
||||||
, 0x18, 0x0, 0x38, 0x18, 0x18, 0x18, 0x3c, 0x0 //tile:73
|
,
|
||||||
, 0x6, 0x0, 0x6, 0x6, 0x6, 0x6, 0xc6, 0x7c //tile:74
|
0xfe, 0xc0, 0xc0, 0xf8, 0xc0, 0xc0, 0xfe, 0x0 // tile:37
|
||||||
, 0xc0, 0xc0, 0xcc, 0xd8, 0xf8, 0xcc, 0xc6, 0x0 //tile:75
|
,
|
||||||
, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x0 //tile:76
|
0xfe, 0xc0, 0xc0, 0xf8, 0xc0, 0xc0, 0xc0, 0x0 // tile:38
|
||||||
, 0x0, 0x0, 0xcc, 0xfe, 0xfe, 0xd6, 0xd6, 0x0 //tile:77
|
,
|
||||||
, 0x0, 0x0, 0xfc, 0xc6, 0xc6, 0xc6, 0xc6, 0x0 //tile:78
|
0x7c, 0xc6, 0xc0, 0xc0, 0xce, 0xc6, 0x7c, 0x0 // tile:39
|
||||||
, 0x0, 0x0, 0x7c, 0xc6, 0xc6, 0xc6, 0x7c, 0x0 //tile:79
|
,
|
||||||
, 0x0, 0x0, 0xfc, 0xc6, 0xc6, 0xfc, 0xc0, 0xc0 //tile:80
|
0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x0 // tile:40
|
||||||
, 0x0, 0x0, 0x7e, 0xc6, 0xc6, 0x7e, 0x6, 0x6 //tile:81
|
,
|
||||||
, 0x0, 0x0, 0xfc, 0xc6, 0xc0, 0xc0, 0xc0, 0x0 //tile:82
|
0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7e, 0x0 // tile:41
|
||||||
, 0x0, 0x0, 0x7e, 0xc0, 0x7c, 0x6, 0xfc, 0x0 //tile:83
|
,
|
||||||
, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x18, 0xe, 0x0 //tile:84
|
0x6, 0x6, 0x6, 0x6, 0x6, 0xc6, 0x7c, 0x0 // tile:42
|
||||||
, 0x0, 0x0, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x0 //tile:85
|
,
|
||||||
, 0x0, 0x0, 0xc6, 0xc6, 0xc6, 0x7c, 0x38, 0x0 //tile:86
|
0xc6, 0xcc, 0xd8, 0xf0, 0xd8, 0xcc, 0xc6, 0x0 // tile:43
|
||||||
, 0x0, 0x0, 0xc6, 0xc6, 0xd6, 0xfe, 0x6c, 0x0 //tile:87
|
,
|
||||||
, 0x0, 0x0, 0xc6, 0x6c, 0x38, 0x6c, 0xc6, 0x0 //tile:88
|
0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xfe, 0x0 // tile:44
|
||||||
, 0x0, 0x0, 0xc6, 0xc6, 0xc6, 0x7e, 0x6, 0xfc //tile:89
|
,
|
||||||
, 0x0, 0x0, 0xfe, 0xc, 0x38, 0x60, 0xfe, 0x0 //tile:90
|
0xc6, 0xee, 0xfe, 0xfe, 0xd6, 0xc6, 0xc6, 0x0 // tile:45
|
||||||
, 0xe, 0x18, 0x18, 0x70, 0x18, 0x18, 0xe, 0x0 //tile:91
|
,
|
||||||
, 0x18, 0x18, 0x18, 0x0, 0x18, 0x18, 0x18, 0x0 //tile:92
|
0xc6, 0xe6, 0xf6, 0xde, 0xce, 0xc6, 0xc6, 0x0 // tile:46
|
||||||
, 0x70, 0x18, 0x18, 0xe, 0x18, 0x18, 0x70, 0x0 //tile:93
|
,
|
||||||
, 0x76, 0xdc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 //tile:94
|
0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x0 // tile:47
|
||||||
, 0x0, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0x0 //tile:95
|
,
|
||||||
|
0xfc, 0xc6, 0xc6, 0xfc, 0xc0, 0xc0, 0xc0, 0x0 // tile:48
|
||||||
|
,
|
||||||
|
0x7c, 0xc6, 0xc6, 0xc6, 0xd6, 0xde, 0x7c, 0x6 // tile:49
|
||||||
|
,
|
||||||
|
0xfc, 0xc6, 0xc6, 0xfc, 0xd8, 0xcc, 0xc6, 0x0 // tile:50
|
||||||
|
,
|
||||||
|
0x7c, 0xc6, 0xc0, 0x7c, 0x6, 0xc6, 0x7c, 0x0 // tile:51
|
||||||
|
,
|
||||||
|
0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x0 // tile:52
|
||||||
|
,
|
||||||
|
0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0x0 // tile:53
|
||||||
|
,
|
||||||
|
0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x38, 0x0 // tile:54
|
||||||
|
,
|
||||||
|
0xc6, 0xc6, 0xc6, 0xc6, 0xd6, 0xfe, 0x6c, 0x0 // tile:55
|
||||||
|
,
|
||||||
|
0xc6, 0xc6, 0x6c, 0x38, 0x6c, 0xc6, 0xc6, 0x0 // tile:56
|
||||||
|
,
|
||||||
|
0xc6, 0xc6, 0xc6, 0x7c, 0x18, 0x30, 0xe0, 0x0 // tile:57
|
||||||
|
,
|
||||||
|
0xfe, 0x6, 0xc, 0x18, 0x30, 0x60, 0xfe, 0x0 // tile:58
|
||||||
|
,
|
||||||
|
0x3c, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3c, 0x0 // tile:59
|
||||||
|
,
|
||||||
|
0xc0, 0x60, 0x30, 0x18, 0xc, 0x6, 0x2, 0x0 // tile:60
|
||||||
|
,
|
||||||
|
0x3c, 0xc, 0xc, 0xc, 0xc, 0xc, 0x3c, 0x0 // tile:61
|
||||||
|
,
|
||||||
|
0x10, 0x38, 0x6c, 0xc6, 0x0, 0x0, 0x0, 0x0 // tile:62
|
||||||
|
,
|
||||||
|
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff // tile:63
|
||||||
|
,
|
||||||
|
0x18, 0x18, 0xc, 0x0, 0x0, 0x0, 0x0, 0x0 // tile:64
|
||||||
|
,
|
||||||
|
0x0, 0x0, 0x7c, 0x6, 0x7e, 0xc6, 0x7e, 0x0 // tile:65
|
||||||
|
,
|
||||||
|
0xc0, 0xc0, 0xc0, 0xfc, 0xc6, 0xc6, 0xfc, 0x0 // tile:66
|
||||||
|
,
|
||||||
|
0x0, 0x0, 0x7c, 0xc6, 0xc0, 0xc6, 0x7c, 0x0 // tile:67
|
||||||
|
,
|
||||||
|
0x6, 0x6, 0x6, 0x7e, 0xc6, 0xc6, 0x7e, 0x0 // tile:68
|
||||||
|
,
|
||||||
|
0x0, 0x0, 0x7c, 0xc6, 0xfe, 0xc0, 0x7c, 0x0 // tile:69
|
||||||
|
,
|
||||||
|
0x1c, 0x36, 0x30, 0x78, 0x30, 0x30, 0x78, 0x0 // tile:70
|
||||||
|
,
|
||||||
|
0x0, 0x0, 0x7e, 0xc6, 0xc6, 0x7e, 0x6, 0xfc // tile:71
|
||||||
|
,
|
||||||
|
0xc0, 0xc0, 0xfc, 0xc6, 0xc6, 0xc6, 0xc6, 0x0 // tile:72
|
||||||
|
,
|
||||||
|
0x18, 0x0, 0x38, 0x18, 0x18, 0x18, 0x3c, 0x0 // tile:73
|
||||||
|
,
|
||||||
|
0x6, 0x0, 0x6, 0x6, 0x6, 0x6, 0xc6, 0x7c // tile:74
|
||||||
|
,
|
||||||
|
0xc0, 0xc0, 0xcc, 0xd8, 0xf8, 0xcc, 0xc6, 0x0 // tile:75
|
||||||
|
,
|
||||||
|
0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x0 // tile:76
|
||||||
|
,
|
||||||
|
0x0, 0x0, 0xcc, 0xfe, 0xfe, 0xd6, 0xd6, 0x0 // tile:77
|
||||||
|
,
|
||||||
|
0x0, 0x0, 0xfc, 0xc6, 0xc6, 0xc6, 0xc6, 0x0 // tile:78
|
||||||
|
,
|
||||||
|
0x0, 0x0, 0x7c, 0xc6, 0xc6, 0xc6, 0x7c, 0x0 // tile:79
|
||||||
|
,
|
||||||
|
0x0, 0x0, 0xfc, 0xc6, 0xc6, 0xfc, 0xc0, 0xc0 // tile:80
|
||||||
|
,
|
||||||
|
0x0, 0x0, 0x7e, 0xc6, 0xc6, 0x7e, 0x6, 0x6 // tile:81
|
||||||
|
,
|
||||||
|
0x0, 0x0, 0xfc, 0xc6, 0xc0, 0xc0, 0xc0, 0x0 // tile:82
|
||||||
|
,
|
||||||
|
0x0, 0x0, 0x7e, 0xc0, 0x7c, 0x6, 0xfc, 0x0 // tile:83
|
||||||
|
,
|
||||||
|
0x18, 0x18, 0x7e, 0x18, 0x18, 0x18, 0xe, 0x0 // tile:84
|
||||||
|
,
|
||||||
|
0x0, 0x0, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x0 // tile:85
|
||||||
|
,
|
||||||
|
0x0, 0x0, 0xc6, 0xc6, 0xc6, 0x7c, 0x38, 0x0 // tile:86
|
||||||
|
,
|
||||||
|
0x0, 0x0, 0xc6, 0xc6, 0xd6, 0xfe, 0x6c, 0x0 // tile:87
|
||||||
|
,
|
||||||
|
0x0, 0x0, 0xc6, 0x6c, 0x38, 0x6c, 0xc6, 0x0 // tile:88
|
||||||
|
,
|
||||||
|
0x0, 0x0, 0xc6, 0xc6, 0xc6, 0x7e, 0x6, 0xfc // tile:89
|
||||||
|
,
|
||||||
|
0x0, 0x0, 0xfe, 0xc, 0x38, 0x60, 0xfe, 0x0 // tile:90
|
||||||
|
,
|
||||||
|
0xe, 0x18, 0x18, 0x70, 0x18, 0x18, 0xe, 0x0 // tile:91
|
||||||
|
,
|
||||||
|
0x18, 0x18, 0x18, 0x0, 0x18, 0x18, 0x18, 0x0 // tile:92
|
||||||
|
,
|
||||||
|
0x70, 0x18, 0x18, 0xe, 0x18, 0x18, 0x70, 0x0 // tile:93
|
||||||
|
,
|
||||||
|
0x76, 0xdc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 // tile:94
|
||||||
|
,
|
||||||
|
0x0, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0x0 // tile:95
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void clearScreen(void) {
|
inline void clearScreen(void) {
|
||||||
|
@ -169,8 +264,6 @@ void disableBacklight() {
|
||||||
GSPGPU_WriteHWRegs(REG_LCDBACKLIGHTSUB, &off, 4);
|
GSPGPU_WriteHWRegs(REG_LCDBACKLIGHTSUB, &off, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void enableBacklight() {
|
void enableBacklight() {
|
||||||
GSPGPU_WriteHWRegs(REG_LCDBACKLIGHTMAIN, &brightnessMain, 4);
|
GSPGPU_WriteHWRegs(REG_LCDBACKLIGHTMAIN, &brightnessMain, 4);
|
||||||
GSPGPU_WriteHWRegs(REG_LCDBACKLIGHTSUB, &brightnessSub, 4);
|
GSPGPU_WriteHWRegs(REG_LCDBACKLIGHTSUB, &brightnessSub, 4);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#include "wireless.h"
|
|
||||||
|
|
||||||
#include "inet_pton.h"
|
#include "inet_pton.h"
|
||||||
|
|
||||||
|
#include "wireless.h"
|
||||||
|
|
||||||
int inet_pton4(const char *src, unsigned char *dst) {
|
int inet_pton4(const char *src, unsigned char *dst) {
|
||||||
static const char digits[] = "0123456789";
|
static const char digits[] = "0123456789";
|
||||||
int saw_digit, octets, ch;
|
int saw_digit, octets, ch;
|
||||||
|
@ -27,14 +27,12 @@ int inet_pton4(const char *src, unsigned char *dst) {
|
||||||
return (0);
|
return (0);
|
||||||
saw_digit = 1;
|
saw_digit = 1;
|
||||||
}
|
}
|
||||||
}
|
} else if (ch == '.' && saw_digit) {
|
||||||
else if(ch == '.' && saw_digit) {
|
|
||||||
if (octets == 4)
|
if (octets == 4)
|
||||||
return (0);
|
return (0);
|
||||||
*++tp = 0;
|
*++tp = 0;
|
||||||
saw_digit = 0;
|
saw_digit = 0;
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
if (octets < 4)
|
if (octets < 4)
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
#include <stdlib.h>
|
#include "input.h"
|
||||||
#include <string.h>
|
|
||||||
#include <malloc.h>
|
|
||||||
|
|
||||||
#include <3ds.h>
|
#include <3ds.h>
|
||||||
|
#include <malloc.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "drawing.h"
|
#include "drawing.h"
|
||||||
|
|
||||||
#include "input.h"
|
|
||||||
|
|
||||||
int inputIP(void) {
|
int inputIP(void) {
|
||||||
touchPosition touch;
|
touchPosition touch;
|
||||||
hidTouchRead(&touch);
|
hidTouchRead(&touch);
|
||||||
|
@ -30,29 +29,40 @@ int inputIP(void) {
|
||||||
|
|
||||||
// Bottom Strip
|
// Bottom Strip
|
||||||
if (touch.py > 50 + 50 && touch.py < 50 + 70) {
|
if (touch.py > 50 + 50 && touch.py < 50 + 70) {
|
||||||
if(touch.px < 160 && touch.px > 160-20) return 11; // Dot
|
if (touch.px < 160 && touch.px > 160 - 20)
|
||||||
else if(touch.px < 160+20 && touch.px > 160) return 0; // Zero
|
return 11; // Dot
|
||||||
|
else if (touch.px < 160 + 20 && touch.px > 160)
|
||||||
|
return 0; // Zero
|
||||||
}
|
}
|
||||||
|
|
||||||
// First Column
|
// First Column
|
||||||
else if (touch.px < 160 - 10 && touch.px > 160 - 30) {
|
else if (touch.px < 160 - 10 && touch.px > 160 - 30) {
|
||||||
if(touch.py < 50+10 && touch.py > 50-10) return 1; // One
|
if (touch.py < 50 + 10 && touch.py > 50 - 10)
|
||||||
else if(touch.py < 50+30 && touch.py > 50+10) return 4; // Four
|
return 1; // One
|
||||||
else if(touch.py < 50+50 && touch.py > 50+30) return 7; // Seven
|
else if (touch.py < 50 + 30 && touch.py > 50 + 10)
|
||||||
|
return 4; // Four
|
||||||
|
else if (touch.py < 50 + 50 && touch.py > 50 + 30)
|
||||||
|
return 7; // Seven
|
||||||
}
|
}
|
||||||
|
|
||||||
// Second Column
|
// Second Column
|
||||||
else if (touch.px < 160 + 10 && touch.px > 160 - 10) {
|
else if (touch.px < 160 + 10 && touch.px > 160 - 10) {
|
||||||
if(touch.py < 50+10 && touch.py > 50-10) return 2; // Two
|
if (touch.py < 50 + 10 && touch.py > 50 - 10)
|
||||||
else if(touch.py < 50+30 && touch.py > 50+10) return 5; // Five
|
return 2; // Two
|
||||||
else if(touch.py < 50+50 && touch.py > 50+30) return 8; // Eight
|
else if (touch.py < 50 + 30 && touch.py > 50 + 10)
|
||||||
|
return 5; // Five
|
||||||
|
else if (touch.py < 50 + 50 && touch.py > 50 + 30)
|
||||||
|
return 8; // Eight
|
||||||
}
|
}
|
||||||
|
|
||||||
// Third Column
|
// Third Column
|
||||||
else if (touch.px < 160 + 30 && touch.px > 160 + 10) {
|
else if (touch.px < 160 + 30 && touch.px > 160 + 10) {
|
||||||
if(touch.py < 50+10 && touch.py > 50-10) return 3; // Three
|
if (touch.py < 50 + 10 && touch.py > 50 - 10)
|
||||||
else if(touch.py < 50+30 && touch.py > 50+10) return 6; // Six
|
return 3; // Three
|
||||||
else if(touch.py < 50+50 && touch.py > 50+30) return 9; // Nine
|
else if (touch.py < 50 + 30 && touch.py > 50 + 10)
|
||||||
|
return 6; // Six
|
||||||
|
else if (touch.py < 50 + 50 && touch.py > 50 + 30)
|
||||||
|
return 9; // Nine
|
||||||
}
|
}
|
||||||
|
|
||||||
return 10;
|
return 10;
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
|
#include "keyboard.h"
|
||||||
|
|
||||||
#include <3ds.h>
|
#include <3ds.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "drawing.h"
|
#include "drawing.h"
|
||||||
|
|
||||||
#include "keyboard.h"
|
|
||||||
|
|
||||||
const char keyboardChars[60] = "!1234567890\x08QWERTYUIOP\13\13ASDFGHJKL-\13\13ZXCVBNM,.?\13\13\0\0\0 \0\0\0\0";
|
const char keyboardChars[60] = "!1234567890\x08QWERTYUIOP\13\13ASDFGHJKL-\13\13ZXCVBNM,.?\13\13\0\0\0 \0\0\0\0";
|
||||||
|
|
||||||
unsigned char keyboardActive = false;
|
unsigned char keyboardActive = false;
|
||||||
|
@ -28,8 +28,8 @@ void preRenderKeyboard(void) {
|
||||||
if (chars[x + y * 12] == '\x08') {
|
if (chars[x + y * 12] == '\x08') {
|
||||||
drawStringFramebuffer(keyboardGfx, (int)((float)x * 320.0f / 12.0f) + 10, (int)(78.0f + (float)y * 320.0f / 12.0f) + 9, "-");
|
drawStringFramebuffer(keyboardGfx, (int)((float)x * 320.0f / 12.0f) + 10, (int)(78.0f + (float)y * 320.0f / 12.0f) + 9, "-");
|
||||||
drawStringFramebuffer(keyboardGfx, (int)((float)x * 320.0f / 12.0f) + 8, (int)(78.0f + (float)y * 320.0f / 12.0f) + 9, "<");
|
drawStringFramebuffer(keyboardGfx, (int)((float)x * 320.0f / 12.0f) + 8, (int)(78.0f + (float)y * 320.0f / 12.0f) + 9, "<");
|
||||||
}
|
} else
|
||||||
else drawStringFramebuffer(keyboardGfx, (int)((float)x * 320.0f / 12.0f) + 9, (int)(78.0f + (float)y * 320.0f / 12.0f) + 9, "%c", chars[x + y * 12]);
|
drawStringFramebuffer(keyboardGfx, (int)((float)x * 320.0f / 12.0f) + 9, (int)(78.0f + (float)y * 320.0f / 12.0f) + 9, "%c", chars[x + y * 12]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
|
#include <3ds.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <3ds.h>
|
|
||||||
#include "3ds/services/gsplcd.h"
|
#include "3ds/services/gsplcd.h"
|
||||||
#include "3ds/services/hid.h"
|
#include "3ds/services/hid.h"
|
||||||
#include "3ds/services/soc.h"
|
#include "3ds/services/soc.h"
|
||||||
|
|
||||||
#include "drawing.h"
|
#include "drawing.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
// #include "keyboard.h"
|
// #include "keyboard.h"
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
#include <stdio.h>
|
#include "settings.h"
|
||||||
#include <malloc.h>
|
|
||||||
|
|
||||||
#include <3ds.h>
|
#include <3ds.h>
|
||||||
|
#include <malloc.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "3ds/services/fs.h"
|
#include "3ds/services/fs.h"
|
||||||
#include "wireless.h"
|
#include "wireless.h"
|
||||||
|
|
||||||
#include "settings.h"
|
|
||||||
|
|
||||||
struct settings settings;
|
struct settings settings;
|
||||||
|
|
||||||
struct settings defaultSettings = {
|
struct settings defaultSettings = {
|
||||||
|
@ -68,8 +67,7 @@ bool readSettings(void) {
|
||||||
if (getSetting("IP: ", buffer, settings.IPString)) {
|
if (getSetting("IP: ", buffer, settings.IPString)) {
|
||||||
// inet_pton(AF_INET, settings.IPString, &(saout.sin_addr));
|
// inet_pton(AF_INET, settings.IPString, &(saout.sin_addr));
|
||||||
inet_pton4(settings.IPString, (unsigned char *)&(saout.sin_addr));
|
inet_pton4(settings.IPString, (unsigned char *)&(saout.sin_addr));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
free(buffer);
|
free(buffer);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
|
#include "wireless.h"
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "keyboard.h"
|
#include "keyboard.h"
|
||||||
#include "sys/_types.h"
|
#include "sys/_types.h"
|
||||||
#include "wireless.h"
|
|
||||||
|
|
||||||
int sock;
|
int sock;
|
||||||
struct sockaddr_in sain, saout;
|
struct sockaddr_in sain, saout;
|
||||||
|
|
Loading…
Add table
Reference in a new issue