aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author浅倉麗子2020-05-20 10:08:13 -0400
committer浅倉麗子2020-05-20 10:08:13 -0400
commitc1070e24168ea666f86d6552e377c37bfc3dd1fa (patch)
tree7c8d40fee85bdcdd03f3a5a9f5b3f5cf9f752a30
parentIncrease config app memory budget from 6MB to 8MB (diff)
downloadsharpscale-c1070e24168ea666f86d6552e377c37bfc3dd1fa.tar.gz
Show error if kernel module not linked
-rw-r--r--config-app/CMakeLists.txt2
-rw-r--r--config-app/main.c70
2 files changed, 43 insertions, 29 deletions
diff --git a/config-app/CMakeLists.txt b/config-app/CMakeLists.txt
index ffebf7a..1c46a59 100644
--- a/config-app/CMakeLists.txt
+++ b/config-app/CMakeLists.txt
@@ -53,6 +53,6 @@ dolce_create_vpk(${PROJECT_NAME}.vpk
AKRK00005
"${SELF}"
NAME "Sharpscale Config Menu"
- VERSION 01.02
+ VERSION 01.03
FILE icon0.png sce_sys/icon0.png
)
diff --git a/config-app/main.c b/config-app/main.c
index c61df99..c4209f4 100644
--- a/config-app/main.c
+++ b/config-app/main.c
@@ -29,6 +29,7 @@ int _newlib_heap_size_user = 4 * 1024;
#define TEXT_BLACK 0xFF202020
#define TEXT_BLUE 0xFFFF8000
#define TEXT_YELLOW 0xFF009090
+#define TEXT_RED 0xFF0000FF
static int text_blue(int a) {
return a ? TEXT_BLUE : TEXT_BLACK;
@@ -72,12 +73,16 @@ int main(int argc, char **argv) { (void)argc; (void)argv;
int ui_row = 0;
SceCtrlData last_ctrl = {0};
SharpscaleConfig config = {0};
- SharpscaleGetConfig(&config);
+
+ bool kmod_linked = *(uint32_t*)SharpscaleGetConfig != 0xE24FC008;
+ if (kmod_linked) {
+ SharpscaleGetConfig(&config);
+ }
for (;;) {
SceCtrlData ctrl;
- if (sceCtrlReadBufferPositive(0, &ctrl, 1) == 1) {
+ if (kmod_linked && sceCtrlReadBufferPositive(0, &ctrl, 1) == 1) {
int btns = ~last_ctrl.buttons & ctrl.buttons;
if (btns & SCE_CTRL_UP) {
@@ -116,32 +121,41 @@ int main(int argc, char **argv) { (void)argc; (void)argv;
vita2d_draw_line(50.0f, line_height * 2.75f, 910.0f, line_height * 2.75f, TEXT_BLACK);
- x_pos = 50;
- y_pos = line_height * 4;
- draw_text(x_pos, y_pos, text_yellow(ui_row == 0), "Scaling mode");
- draw_text(x_pos += 300, y_pos, text_blue(config.mode == SHARPSCALE_MODE_ORIGINAL), "Original");
- draw_text(x_pos += 100, y_pos, text_blue(config.mode == SHARPSCALE_MODE_INTEGER), "Integer");
- draw_text(x_pos += 100, y_pos, text_blue(config.mode == SHARPSCALE_MODE_REAL), "Real");
- draw_text(x_pos += 100, y_pos, text_blue(config.mode == SHARPSCALE_MODE_FITTED), "Fitted");
-
- x_pos = 50;
- y_pos = line_height * 5;
- draw_text(x_pos, y_pos, text_yellow(ui_row == 1), "PS1 aspect ratio mode");
- draw_text(x_pos += 300, y_pos, text_blue(config.psone_mode == SHARPSCALE_PSONE_MODE_PIXEL), "Pixel");
- draw_text(x_pos += 100, y_pos, text_blue(config.psone_mode == SHARPSCALE_PSONE_MODE_4_3), "4:3");
- draw_text(x_pos += 100, y_pos, text_blue(config.psone_mode == SHARPSCALE_PSONE_MODE_16_9), "16:9");
-
- x_pos = 50;
- y_pos = line_height * 6;
- draw_text(x_pos, y_pos, text_yellow(ui_row == 2), "Bilinear filtering");
- draw_text(x_pos += 300, y_pos, text_blue(config.bilinear), "On");
- draw_text(x_pos += 100, y_pos, text_blue(!config.bilinear), "Off");
-
- x_pos = 50;
- y_pos = line_height * 7;
- draw_text(x_pos, y_pos, text_yellow(ui_row == 3), "Enable Full HD");
- draw_text(x_pos += 300, y_pos, text_blue(config.full_hd), "On");
- draw_text(x_pos += 100, y_pos, text_blue(!config.full_hd), "Off");
+ if (kmod_linked) {
+ x_pos = 50;
+ y_pos = line_height * 4;
+ draw_text(x_pos, y_pos, text_yellow(ui_row == 0), "Scaling mode");
+ draw_text(x_pos += 300, y_pos, text_blue(config.mode == SHARPSCALE_MODE_ORIGINAL), "Original");
+ draw_text(x_pos += 100, y_pos, text_blue(config.mode == SHARPSCALE_MODE_INTEGER), "Integer");
+ draw_text(x_pos += 100, y_pos, text_blue(config.mode == SHARPSCALE_MODE_REAL), "Real");
+ draw_text(x_pos += 100, y_pos, text_blue(config.mode == SHARPSCALE_MODE_FITTED), "Fitted");
+
+ x_pos = 50;
+ y_pos = line_height * 5;
+ draw_text(x_pos, y_pos, text_yellow(ui_row == 1), "PS1 aspect ratio mode");
+ draw_text(x_pos += 300, y_pos, text_blue(config.psone_mode == SHARPSCALE_PSONE_MODE_PIXEL), "Pixel");
+ draw_text(x_pos += 100, y_pos, text_blue(config.psone_mode == SHARPSCALE_PSONE_MODE_4_3), "4:3");
+ draw_text(x_pos += 100, y_pos, text_blue(config.psone_mode == SHARPSCALE_PSONE_MODE_16_9), "16:9");
+
+ x_pos = 50;
+ y_pos = line_height * 6;
+ draw_text(x_pos, y_pos, text_yellow(ui_row == 2), "Bilinear filtering");
+ draw_text(x_pos += 300, y_pos, text_blue(config.bilinear), "On");
+ draw_text(x_pos += 100, y_pos, text_blue(!config.bilinear), "Off");
+
+ x_pos = 50;
+ y_pos = line_height * 7;
+ draw_text(x_pos, y_pos, text_yellow(ui_row == 3), "Enable Full HD");
+ draw_text(x_pos += 300, y_pos, text_blue(config.full_hd), "On");
+ draw_text(x_pos += 100, y_pos, text_blue(!config.full_hd), "Off");
+
+ } else {
+ y_pos = line_height * 4;
+ draw_text(x_pos, y_pos, TEXT_RED, "FATAL ERROR");
+
+ y_pos = line_height * 5;
+ draw_text(x_pos, y_pos, TEXT_BLACK, "Sharpscale kernel module not loaded or incompatible version.");
+ }
y_pos = line_height * 13;
draw_text_centre(y_pos, TEXT_BLACK, "CBPS Productions");