Skip to content

Commit 420139c

Browse files
committed
better framing for DISPLAY MODE notif & print FPS on stdout with -fps arg && ampli turned off when necessary
1 parent 4c48411 commit 420139c

File tree

3 files changed

+78
-1
lines changed

3 files changed

+78
-1
lines changed

menu/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ uint32 S9xReadJoypad (int which1)
400400

401401
char shell_cmd[100];
402402
FILE *fp;
403-
sprintf(shell_cmd, "%s %d \" DISPLAY MODE: %s\"",
403+
sprintf(shell_cmd, "%s %d \" DISPLAY MODE: %s\"",
404404
SHELL_CMD_NOTIF, NOTIF_SECONDS_DISP, aspect_ratio_name[aspect_ratio]);
405405
fp = popen(shell_cmd, "r");
406406
if (fp == NULL) {

menu/menu.cpp

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,9 @@ void run_menu_loop()
664664
memcpy(backup_hw_screen->pixels, dst_virtual,
665665
RES_HW_SCREEN_HORIZONTAL * RES_HW_SCREEN_VERTICAL * sizeof(u16));
666666

667+
/* Stop Ampli */
668+
popen(SHELL_CMD_TURN_AMPLI_OFF, "r");
669+
667670
/// -------- Main loop ---------
668671
while (!stop_menu_loop)
669672
{
@@ -1014,6 +1017,9 @@ void run_menu_loop()
10141017
if(SDL_EnableKeyRepeat(backup_key_repeat_delay, backup_key_repeat_interval)){
10151018
MENU_ERROR_PRINTF("ERROR with SDL_EnableKeyRepeat: %s\n", SDL_GetError());
10161019
}
1020+
1021+
/* Start Ampli */
1022+
popen(SHELL_CMD_TURN_AMPLI_ON, "r");
10171023
}
10181024

10191025

@@ -1037,6 +1043,9 @@ int launch_resume_menu_loop()
10371043
uint8_t menu_confirmation = 0;
10381044
int option_idx=RESUME_YES;
10391045

1046+
/* Stop Ampli */
1047+
popen(SHELL_CMD_TURN_AMPLI_OFF, "r");
1048+
10401049
/* Save prev key repeat params and set new Key repeat */
10411050
SDL_GetKeyRepeat(&backup_key_repeat_delay, &backup_key_repeat_interval);
10421051
if(SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL)){
@@ -1199,9 +1208,75 @@ int launch_resume_menu_loop()
11991208
MENU_ERROR_PRINTF("ERROR with SDL_EnableKeyRepeat: %s\n", SDL_GetError());
12001209
}
12011210

1211+
/* Start Ampli */
1212+
popen(SHELL_CMD_TURN_AMPLI_ON, "r");
1213+
12021214
return option_idx;
12031215
}
12041216

1217+
1218+
1219+
1220+
1221+
1222+
1223+
1224+
1225+
1226+
1227+
1228+
1229+
1230+
1231+
1232+
1233+
1234+
1235+
1236+
1237+
1238+
1239+
1240+
1241+
1242+
1243+
1244+
1245+
1246+
1247+
1248+
1249+
1250+
1251+
1252+
1253+
1254+
1255+
1256+
1257+
1258+
1259+
1260+
1261+
1262+
1263+
1264+
1265+
1266+
1267+
1268+
1269+
1270+
1271+
1272+
1273+
1274+
1275+
1276+
1277+
1278+
1279+
12051280
void DefaultMenuOptions(void)
12061281
{
12071282
mMenuOptions->frameSkip=0; //auto

menu/menu.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ typedef enum {RESUME_OPTIONS} ENUM_RESUME_OPTIONS;
192192
#define SHELL_CMD_SCHEDULE_POWERDOWN "sched_shutdown"
193193
#define SHELL_CMD_NOTIF "notif_set"
194194
#define SHELL_CMD_WRITE_QUICK_LOAD_CMD "write_args_quick_load_file"
195+
#define SHELL_CMD_TURN_AMPLI_ON "start_audio_amp 1"
196+
#define SHELL_CMD_TURN_AMPLI_OFF "start_audio_amp 0"
195197

196198
////------ Global variables -------
197199
extern int volume_percentage;

0 commit comments

Comments
 (0)