aboutsummaryrefslogtreecommitdiff
path: root/frontend
diff options
context:
space:
mode:
authornotaz2011-07-29 00:25:41 +0300
committernotaz2011-07-30 02:43:33 +0300
commit90f1d26c2e771993c1a563f4c0ea81432bd9fc5e (patch)
tree8c7ee9903f4b9ca6079f06d1b8a2bbf952c1c762 /frontend
parent78c60846942cad7d41d6d23a7c3d2b905ee4b822 (diff)
downloadpcsx_rearmed-90f1d26c2e771993c1a563f4c0ea81432bd9fc5e.tar.gz
pcsx_rearmed-90f1d26c2e771993c1a563f4c0ea81432bd9fc5e.tar.bz2
pcsx_rearmed-90f1d26c2e771993c1a563f4c0ea81432bd9fc5e.zip
frontend: add chan display option, for fun mostly
Diffstat (limited to 'frontend')
-rw-r--r--frontend/main.c4
-rw-r--r--frontend/menu.c3
-rw-r--r--frontend/menu.h1
-rw-r--r--frontend/plugin_lib.c32
4 files changed, 39 insertions, 1 deletions
diff --git a/frontend/main.c b/frontend/main.c
index 13be9ac..b17df53 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 dee0159..2b9c155 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 d8aa892..7e401a3 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 58c67d2..8d5605f 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<<c)) ? 0 :
+ (fmod_chans & (1<<c)) ? 0xf000 :
+ (noise_chans & (1<<c)) ? 0x001f :
+ colors[c & 1];
+ for (y = 0; y < 8; y++, d += pl_fbdev_w)
+ for (x = 0; x < 8; x++)
+ d[x] = p;
+ }
+}
+
void *pl_fbdev_set_mode(int w, int h, int bpp)
{
void *ret;
@@ -102,6 +131,9 @@ void *pl_fbdev_flip(void)
flip_cnt++;
if (pl_fbdev_buf != NULL) {
+ if (g_opts & OPT_SHOWSPU)
+ draw_active_chans();
+
if (hud_msg[0] != 0)
print_hud();
else if (g_opts & OPT_SHOWFPS)