Skip to content

Commit

Permalink
change for new notif script
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent-FK <[email protected]>
  • Loading branch information
Vincent-FK committed May 15, 2021
1 parent a2f9326 commit 2cc6248
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions frontend/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,12 @@ void do_emu_action(void)
case SACTION_LOAD_STATE:
//snprintf(hud_msg, sizeof(hud_msg), "LOADING FROM SLOT %d...", state_slot+1);
sprintf(shell_cmd, "%s %d \" LOADING FROM SLOT %d...\"",
SHELL_CMD_NOTIF, NOTIF_SECONDS_DISP, state_slot+1);
SHELL_CMD_NOTIF_SET, NOTIF_SECONDS_DISP, state_slot+1);
ret = emu_load_state(state_slot);
//snprintf(hud_msg, sizeof(hud_msg), "%s FROM SLOT %d", ret == 0 ? "LOADED" : "FAILED TO LOAD", state_slot+1);
//hud_new_msg = 4;
sprintf(shell_cmd, "%s %d \"%s FROM SLOT %d\"",
SHELL_CMD_NOTIF, NOTIF_SECONDS_DISP, ret == 0 ? " LOADED" : " FAILED TO LOAD", state_slot+1);
SHELL_CMD_NOTIF_SET, NOTIF_SECONDS_DISP, ret == 0 ? " LOADED" : " FAILED TO LOAD", state_slot+1);
fp = popen(shell_cmd, "r");
if (fp == NULL) {
printf("Failed to run command %s\n", shell_cmd);
Expand All @@ -263,7 +263,7 @@ void do_emu_action(void)
/*snprintf(hud_msg, sizeof(hud_msg), "SAVING IN SLOT %d...", state_slot+1);
hud_new_msg = 4;*/
sprintf(shell_cmd, "%s %d \" SAVING IN SLOT %d...\"",
SHELL_CMD_NOTIF, NOTIF_SECONDS_DISP, state_slot+1);
SHELL_CMD_NOTIF_SET, NOTIF_SECONDS_DISP, state_slot+1);
fp = popen(shell_cmd, "r");
if (fp == NULL) {
printf("Failed to run command %s\n", shell_cmd);
Expand All @@ -278,7 +278,7 @@ void do_emu_action(void)
/*snprintf(hud_msg, sizeof(hud_msg), "%s IN SLOT %d", ret == 0 ? "SAVED" : "FAILED TO LOAD", state_slot+1);
hud_new_msg = 4;*/
sprintf(shell_cmd, "%s %d \"%s IN SLOT %d\"",
SHELL_CMD_NOTIF, NOTIF_SECONDS_DISP, ret == 0 ? " SAVED" : " FAILED TO SAVE", state_slot+1);
SHELL_CMD_NOTIF_SET, NOTIF_SECONDS_DISP, ret == 0 ? " SAVED" : " FAILED TO SAVE", state_slot+1);
fp = popen(shell_cmd, "r");
if (fp == NULL) {
printf("Failed to run command %s\n", shell_cmd);
Expand Down Expand Up @@ -326,12 +326,12 @@ void do_emu_action(void)
if(aspect_ratio == ASPECT_RATIOS_TYPE_MANUAL){
//snprintf(hud_msg, sizeof(hud_msg), " DISPLAY MODE: ZOOMED %d%%", aspect_ratio_factor_percent);
sprintf(shell_cmd, "%s %d \" DISPLAY MODE: ZOOMED %d%%%%\"",
SHELL_CMD_NOTIF, NOTIF_SECONDS_DISP, aspect_ratio_factor_percent);
SHELL_CMD_NOTIF_SET, NOTIF_SECONDS_DISP, aspect_ratio_factor_percent);
}
else{
//snprintf(hud_msg, sizeof(hud_msg), "DISPLAY MODE: %s", aspect_ratio_name[aspect_ratio]);
sprintf(shell_cmd, "%s %d \" DISPLAY MODE: %s\"",
SHELL_CMD_NOTIF, NOTIF_SECONDS_DISP, aspect_ratio_name[aspect_ratio]);
SHELL_CMD_NOTIF_SET, NOTIF_SECONDS_DISP, aspect_ratio_name[aspect_ratio]);
}
//hud_new_msg = 4;
fp = popen(shell_cmd, "r");
Expand All @@ -356,7 +356,7 @@ void do_emu_action(void)
/*snprintf(hud_msg, sizeof(hud_msg), " DISPLAY MODE: ZOOMED %d%%", aspect_ratio_factor_percent);
hud_new_msg = 4;*/
sprintf(shell_cmd, "%s %d \" DISPLAY MODE: ZOOMED %d%%%%\"",
SHELL_CMD_NOTIF, NOTIF_SECONDS_DISP, aspect_ratio_factor_percent);
SHELL_CMD_NOTIF_SET, NOTIF_SECONDS_DISP, aspect_ratio_factor_percent);
fp = popen(shell_cmd, "r");
if (fp == NULL) {
printf("Failed to run command %s\n", shell_cmd);
Expand All @@ -380,7 +380,7 @@ void do_emu_action(void)
/*snprintf(hud_msg, sizeof(hud_msg), " DISPLAY MODE: ZOOMED %d%%", aspect_ratio_factor_percent);
hud_new_msg = 4;*/
sprintf(shell_cmd, "%s %d \" DISPLAY MODE: ZOOMED %d%%%%\"",
SHELL_CMD_NOTIF, NOTIF_SECONDS_DISP, aspect_ratio_factor_percent);
SHELL_CMD_NOTIF_SET, NOTIF_SECONDS_DISP, aspect_ratio_factor_percent);
fp = popen(shell_cmd, "r");
if (fp == NULL) {
printf("Failed to run command %s\n", shell_cmd);
Expand Down
12 changes: 6 additions & 6 deletions frontend/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -999,11 +999,11 @@ void run_menu_loop()
if(ret){
MENU_ERROR_PRINTF("Save Failed\n");
sprintf(shell_cmd, "%s %d \" SAVE FAILED\"",
SHELL_CMD_NOTIF, NOTIF_SECONDS_DISP);
SHELL_CMD_NOTIF_SET, NOTIF_SECONDS_DISP);
}
else{
sprintf(shell_cmd, "%s %d \" SAVED IN SLOT %d\"",
SHELL_CMD_NOTIF, NOTIF_SECONDS_DISP, state_slot+1);
SHELL_CMD_NOTIF_SET, NOTIF_SECONDS_DISP, state_slot+1);
}
system(shell_cmd);
}
Expand Down Expand Up @@ -1033,16 +1033,16 @@ void run_menu_loop()
if(ret){
MENU_ERROR_PRINTF("Load Failed\n");
sprintf(shell_cmd, "%s %d \" LOAD FAILED\"",
SHELL_CMD_NOTIF, NOTIF_SECONDS_DISP);
SHELL_CMD_NOTIF_SET, NOTIF_SECONDS_DISP);
}
else{
if(quick_load_slot_chosen){
sprintf(shell_cmd, "%s %d \" LOADED FROM AUTO SAVE\"",
SHELL_CMD_NOTIF, NOTIF_SECONDS_DISP);
SHELL_CMD_NOTIF_SET, NOTIF_SECONDS_DISP);
}
else{
sprintf(shell_cmd, "%s %d \" LOADED FROM SLOT %d\"",
SHELL_CMD_NOTIF, NOTIF_SECONDS_DISP, state_slot+1);
SHELL_CMD_NOTIF_SET, NOTIF_SECONDS_DISP, state_slot+1);
}
}
system(shell_cmd);
Expand Down Expand Up @@ -3178,7 +3178,7 @@ static void menu_bios_warn(void)
/** Set notif for BIOS */
char shell_cmd[400];
sprintf(shell_cmd, "%s 0 \" BIOS FILES MISSING^^While many games work fine ^with fake BIOS, others (like ^MGS and FF8) require BIOS to^work. Copy the BIOS^files in PS1/bios/^^BIOS file is called^: SCPH1001.BIN^File size is always 512KB^^For more instructions:^www.funkey-project.com^^Press any button to continue^^\"",
SHELL_CMD_NOTIF);
SHELL_CMD_NOTIF_SET);
system(shell_cmd);

/// ------ Wait for key press ------
Expand Down
4 changes: 2 additions & 2 deletions frontend/menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ typedef enum {RESUME_OPTIONS} ENUM_RESUME_OPTIONS;
#define SHELL_CMD_VOLUME_SET "volume set"
#define SHELL_CMD_BRIGHTNESS_GET "brightness get"
#define SHELL_CMD_BRIGHTNESS_SET "brightness set"
#define SHELL_CMD_NOTIF "notif_set"
#define SHELL_CMD_NOTIF_CLEAR "notif_clear"
#define SHELL_CMD_NOTIF_SET "notif set"
#define SHELL_CMD_NOTIF_CLEAR "notif clear"
#define SHELL_CMD_AUDIO_AMP_ON "audio_amp on"
#define SHELL_CMD_AUDIO_AMP_OFF "audio_amp off"
#define SHELL_CMD_CANCEL_SCHED_POWERDOWN "cancel_sched_powerdown"
Expand Down

0 comments on commit 2cc6248

Please sign in to comment.