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)
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"
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),
OPT_SHOWFPS = 1 << 0,
OPT_SHOWCPU = 1 << 1,
OPT_NO_FRAMELIM = 1 << 2,
+ OPT_SHOWSPU = 1 << 3,
};
extern int g_opts;
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;
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)
}
*/
+// debug
+void spu_get_debug_info(int *chans_out, int *fmod_chans_out, int *noise_chans_out)
+{
+ int ch = 0, fmod_chans = 0, noise_chans = 0;
+
+ for(;ch<MAXCHAN;ch++)
+ {
+ if (!(dwChannelOn & (1<<ch)))
+ continue;
+ if (s_chan[ch].bFMod == 2)
+ fmod_chans |= 1 << ch;
+ if (s_chan[ch].bNoise)
+ noise_chans |= 1 << ch;
+ }
+
+ *chans_out = dwChannelOn;
+ *fmod_chans_out = fmod_chans;
+ *noise_chans_out = noise_chans;
+}
+
// vim:shiftwidth=1:expandtab