Initial lockpick_rcm code
+ small modifications, just for fun
This commit is contained in:
13
source/meme/main.c
Normal file
13
source/meme/main.c
Normal file
@@ -0,0 +1,13 @@
|
||||
#include <string.h>
|
||||
#include "../gfx/di.h"
|
||||
#include "../gfx/gfx.h"
|
||||
#include "../utils/btn.h"
|
||||
#include "utils.h"
|
||||
#include "main.h"
|
||||
|
||||
void meme_main(){
|
||||
utils_gfx_init();
|
||||
static const u32 colors[7] = {COLOR_RED, COLOR_ORANGE, COLOR_YELLOW, COLOR_GREEN, COLOR_BLUE, COLOR_VIOLET, COLOR_DEFAULT};
|
||||
gfx_printf("%k%pHello World!\n%k%pHi denn i think i did it\n%p%kAnother test", colors[1], colors[0], colors[2], colors[5], colors[6], colors[3]);
|
||||
utils_waitforpower();
|
||||
}
|
||||
3
source/meme/main.h
Normal file
3
source/meme/main.h
Normal file
@@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
void meme_main();
|
||||
21
source/meme/utils.c
Normal file
21
source/meme/utils.c
Normal file
@@ -0,0 +1,21 @@
|
||||
#include "../gfx/di.h"
|
||||
#include "../gfx/gfx.h"
|
||||
#include "../utils/btn.h"
|
||||
#include "../utils/util.h"
|
||||
#include "utils.h"
|
||||
|
||||
void utils_gfx_init(){
|
||||
display_backlight_brightness(100, 1000);
|
||||
gfx_clear_grey(0x1B);
|
||||
gfx_con_setpos(0, 0);
|
||||
}
|
||||
|
||||
void utils_waitforpower(){
|
||||
u32 btn = btn_wait();
|
||||
if (btn & BTN_VOL_UP)
|
||||
reboot_rcm();
|
||||
else if (btn & BTN_VOL_DOWN)
|
||||
reboot_normal();
|
||||
else
|
||||
power_off();
|
||||
}
|
||||
4
source/meme/utils.h
Normal file
4
source/meme/utils.h
Normal file
@@ -0,0 +1,4 @@
|
||||
#pragma once
|
||||
|
||||
void utils_gfx_init();
|
||||
void utils_waitforpower();
|
||||
Reference in New Issue
Block a user