From: notaz Date: Thu, 28 Jul 2011 21:25:41 +0000 (+0300) Subject: frontend: add chan display option, for fun mostly X-Git-Tag: r9~29 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=90f1d26c2e771993c1a563f4c0ea81432bd9fc5e;p=pcsx_rearmed.git frontend: add chan display option, for fun mostly --- diff --git a/frontend/main.c b/frontend/main.c index 13be9acc..b17df53b 100644 --- a/frontend/main.c +++ b/frontend/main.c @@ -476,7 +476,9 @@ int emu_save_state(int slot) if (ret != 0) return ret; - return SaveState(fname); + ret = SaveState(fname); + printf("* %s \"%s\" [%d]\n", ret == 0 ? "saved" : "failed to save", fname, slot); + return ret; } int emu_load_state(int slot) diff --git a/frontend/menu.c b/frontend/menu.c index dee01597..2b9c1555 100644 --- a/frontend/menu.c +++ b/frontend/menu.c @@ -1143,6 +1143,8 @@ static int menu_loop_plugin_options(int id, int keys) static const char *men_cfg_cdrr[] = { "Auto", "ON", "OFF", NULL }; static const char h_cfg_cpul[] = "Shows CPU usage in %"; +static const char h_cfg_spu[] = "Shows active SPU channels\n" + "(green: normal, red: fmod, blue: noise)"; static const char h_cfg_fl[] = "Frame Limiter keeps the game from running too fast"; static const char h_cfg_xa[] = "Disables XA sound, which can sometimes improve performance"; static const char h_cfg_cdda[] = "Disable CD Audio for a performance boost\n" @@ -1161,6 +1163,7 @@ static const char h_cfg_nodrc[] = "Disable dynamic recompiler and use interpret static menu_entry e_menu_adv_options[] = { mee_onoff_h ("Show CPU load", 0, g_opts, OPT_SHOWCPU, h_cfg_cpul), + mee_onoff_h ("Show SPU channels", 0, g_opts, OPT_SHOWSPU, h_cfg_spu), mee_onoff_h ("Disable Frame Limiter", 0, g_opts, OPT_NO_FRAMELIM, h_cfg_fl), mee_onoff_h ("Disable XA Decoding", 0, Config.Xa, 1, h_cfg_xa), mee_onoff_h ("Disable CD Audio", 0, Config.Cdda, 1, h_cfg_cdda), diff --git a/frontend/menu.h b/frontend/menu.h index d8aa8921..7e401a34 100644 --- a/frontend/menu.h +++ b/frontend/menu.h @@ -9,6 +9,7 @@ enum opts { OPT_SHOWFPS = 1 << 0, OPT_SHOWCPU = 1 << 1, OPT_NO_FRAMELIM = 1 << 2, + OPT_SHOWSPU = 1 << 3, }; extern int g_opts; diff --git a/frontend/plugin_lib.c b/frontend/plugin_lib.c index 58c67d27..8d5605ff 100644 --- a/frontend/plugin_lib.c +++ b/frontend/plugin_lib.c @@ -74,6 +74,35 @@ static void print_cpu_usage(void) pl_text_out16(pl_fbdev_w - 28, pl_fbdev_h - 10, "%3d", tick_per_sec); } +// draw 192x8 status of 24 sound channels +static __attribute__((noinline)) void draw_active_chans(void) +{ + extern void spu_get_debug_info(int *chans_out, int *fmod_chans_out, int *noise_chans_out); // hack + int live_chans, fmod_chans, noise_chans; + + static const unsigned short colors[2] = { 0x1fe3, 0x0700 }; + unsigned short *dest = (unsigned short *)pl_fbdev_buf + + pl_fbdev_w * (pl_fbdev_h - 10) + pl_fbdev_w / 2 - 192/2; + unsigned short *d, p; + int c, x, y; + + if (pl_fbdev_bpp != 16) + return; + + spu_get_debug_info(&live_chans, &fmod_chans, &noise_chans); + + for (c = 0; c < 24; c++) { + d = dest + c * 8; + p = !(live_chans & (1<