#include "plugin.h"
#include "plugin_lib.h"
#include "omap.h"
+#include "pcnt.h"
#include "common/plat.h"
#include "../libpcsxcore/misc.h"
+#include "../libpcsxcore/cdrom.h"
#include "../libpcsxcore/psemu_plugin_defs.h"
+#include "../plugins/dfinput/pad.h"
#include "revision.h"
#define MENU_X2 1
MA_MAIN_LOAD_STATE,
MA_MAIN_RESET_GAME,
MA_MAIN_LOAD_ROM,
+ MA_MAIN_SWAP_CD,
MA_MAIN_RUN_BIOS,
MA_MAIN_CONTROLS,
MA_MAIN_CREDITS,
};
static int last_psx_w, last_psx_h, last_psx_bpp;
-static int scaling, filter, state_slot, cpu_clock, cpu_clock_st;
+static int scaling, filter, cpu_clock, cpu_clock_st;
static char rom_fname_reload[MAXPATHLEN];
static char last_selected_fname[MAXPATHLEN];
static int region, in_type_sel;
static int emu_check_save_file(int slot)
{
- char fname[MAXPATHLEN];
- int ret;
-
- ret = get_state_filename(fname, sizeof(fname), slot);
- if (ret != 0)
- return 0;
-
- ret = CheckState(fname);
+ int ret = emu_check_state(slot);
return ret == 0 ? 1 : 0;
}
-static int emu_save_load_game(int load, int sram)
+static int emu_save_load_game(int load, int unused)
{
- char fname[MAXPATHLEN];
int ret;
- ret = get_state_filename(fname, sizeof(fname), state_slot);
- if (ret != 0)
- return 0;
-
if (load) {
- ret = LoadState(fname);
+ ret = emu_load_state(state_slot);
// reflect hle/bios mode from savestate
if (Config.HLE)
bios_sel = 1;
}
else
- ret = SaveState(fname);
+ ret = emu_save_state(state_slot);
return ret;
}
iUseReverb = 2;
iUseInterpolation = 1;
- iXAPitch = iSPUIRQWait = 0;
+ iXAPitch = 0;
+ iSPUIRQWait = 1;
iUseTimer = 2;
menu_sync_config();
#define CE_INTVAL(val) \
{ #val, sizeof(val), &val }
+// 'versioned' var, used when defaults change
+#define CE_INTVAL_V(val, ver) \
+ { #val #ver, sizeof(val), &val }
+
static const struct {
const char *name;
size_t len;
CE_INTVAL(UseFrameSkip),
CE_INTVAL(dwActFixes),
CE_INTVAL(iUseReverb),
- CE_INTVAL(iUseInterpolation),
CE_INTVAL(iXAPitch),
- CE_INTVAL(iSPUIRQWait),
+ CE_INTVAL_V(iUseInterpolation, 2),
+ CE_INTVAL_V(iSPUIRQWait, 2),
CE_INTVAL(iUseTimer),
};
static unsigned short fname2color(const char *fname)
{
static const char *cdimg_exts[] = { ".bin", ".img", ".iso", ".cue", ".z", ".bz", ".znx", ".pbp" };
- static const char *other_exts[] = { ".ccd", ".toc", ".mds", ".sub", ".table", ".index" };
+ static const char *other_exts[] = { ".ccd", ".toc", ".mds", ".sub", ".table", ".index", ".sbi" };
const char *ext = strrchr(fname, '.');
int i;
me_bind_action emuctrl_actions[] =
{
-/*
- { "Load State ", PEV_STATE_LOAD },
- { "Save State ", PEV_STATE_SAVE },
- { "Prev Save Slot ", PEV_SSLOT_PREV },
- { "Next Save Slot ", PEV_SSLOT_NEXT },
-*/
- { "Enter Menu ", PEV_MENU },
+ { "Save State ", 1 << SACTION_SAVE_STATE },
+ { "Load State ", 1 << SACTION_LOAD_STATE },
+ { "Prev Save Slot ", 1 << SACTION_PREV_SSLOT },
+ { "Next Save Slot ", 1 << SACTION_NEXT_SSLOT },
+ { "Toggle Frameskip ", 1 << SACTION_TOGGLE_FSKIP },
+ { "Enter Menu ", 1 << SACTION_ENTER_MENU },
{ NULL, 0 }
};
bind = parse_bind_val(act, &bindtype);
if (bind != -1 && bind != 0) {
- printf("bind #%d '%s' %08x (%s)\n", dev_id, key, bind, act);
+ //printf("bind #%d '%s' %08x (%s)\n", dev_id, key, bind, act);
in_config_bind_key(dev_id, key, bind, bindtype);
}
else
static const char *men_spu_reverb[] = { "Off", "Fake", "On", NULL };
static const char *men_spu_interp[] = { "None", "Simple", "Gaussian", "Cubic", NULL };
-static const char h_spu_irq_wait[] = "Wait for CPU; only useful for some games, may cause glitches";
+static const char h_spu_irq_wait[] = "Wait for CPU (recommended set to ON)";
static const char h_spu_thread[] = "Run sound emulation in main thread (recommended)";
static menu_entry e_menu_plugin_spu[] =
// ------------ adv options menu ------------
-static const char h_cfg_cpul[] = "Shows CPU usage in %%";
+static const char h_cfg_cpul[] = "Shows CPU usage in %";
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"
{
if (CdromId[0] != 0) {
char buff[64];
- snprintf(buff, sizeof(buff), "%.32s/%.9s (running as %s)",
- get_cd_label(), CdromId, Config.PsxType ? "PAL" : "NTSC");
+ snprintf(buff, sizeof(buff), "%.32s/%.9s (running as %s, with %s)",
+ get_cd_label(), CdromId, Config.PsxType ? "PAL" : "NTSC",
+ Config.HLE ? "HLE" : "BIOS");
smalltext_out16(4, 1, buff, 0x105f);
}
}
ClosePlugins();
set_cd_image(NULL);
LoadPlugins();
+ pcnt_hook_plugins();
NetOpened = 0;
if (OpenPlugins() == -1) {
me_update_msg("failed to open plugins");
ClosePlugins();
set_cd_image(fname);
LoadPlugins();
+ pcnt_hook_plugins();
NetOpened = 0;
if (OpenPlugins() == -1) {
me_update_msg("failed to open plugins");
return 0;
}
+static int swap_cd_image(void)
+{
+ char *fname;
+
+ fname = menu_loop_romsel(last_selected_fname, sizeof(last_selected_fname));
+ if (fname == NULL)
+ return -1;
+
+ printf("selected file: %s\n", fname);
+
+ CdromId[0] = '\0';
+ CdromLabel[0] = '\0';
+
+ set_cd_image(fname);
+ if (ReloadCdromPlugin() < 0) {
+ me_update_msg("failed to load cdr plugin");
+ return -1;
+ }
+ if (CDR_open() < 0) {
+ me_update_msg("failed to open cdr plugin");
+ return -1;
+ }
+
+ SetCdOpenCaseTime(time(NULL) + 2);
+ LidInterrupt();
+
+ strcpy(last_selected_fname, rom_fname_reload);
+ return 0;
+}
+
static int main_menu_handler(int id, int keys)
{
switch (id)
if (romsel_run() == 0)
return 1;
break;
+ case MA_MAIN_SWAP_CD:
+ if (swap_cd_image() == 0)
+ return 1;
+ break;
case MA_MAIN_RUN_BIOS:
if (run_bios() == 0)
return 1;
mee_handler_id("Load State", MA_MAIN_LOAD_STATE, main_menu_handler),
mee_handler_id("Reset game", MA_MAIN_RESET_GAME, main_menu_handler),
mee_handler_id("Load CD image", MA_MAIN_LOAD_ROM, main_menu_handler),
+ mee_handler_id("Change CD image", MA_MAIN_SWAP_CD, main_menu_handler),
mee_handler_id("Run BIOS", MA_MAIN_RUN_BIOS, main_menu_handler),
mee_handler ("Options", menu_loop_options),
mee_handler ("Controls", menu_loop_keyconfig),
me_enable(e_menu_main, MA_MAIN_SAVE_STATE, ready_to_go && CdromId[0]);
me_enable(e_menu_main, MA_MAIN_LOAD_STATE, ready_to_go && CdromId[0]);
me_enable(e_menu_main, MA_MAIN_RESET_GAME, ready_to_go);
+ me_enable(e_menu_main, MA_MAIN_SWAP_CD, ready_to_go);
me_enable(e_menu_main, MA_MAIN_RUN_BIOS, bios_sel != 0);
in_set_config_int(0, IN_CFG_BLOCKING, 1);
if (ret)
fprintf(stderr, "Warning: GPU_open returned %d\n", ret);
}
+
+ dfinput_activate(in_type == PSE_PAD_TYPE_ANALOGPAD);
}
void me_update_msg(const char *msg)