rearrange globals

scripted find/replace
gives slightly better code on ARM, less unnecessary asm,
~400 bytes saved
This commit is contained in:
notaz 2017-10-19 02:38:20 +03:00
parent 759c9d3846
commit 93f9619ed8
47 changed files with 532 additions and 573 deletions

View file

@ -266,9 +266,9 @@ static int custom_read(menu_entry *me, const char *var, const char *val)
if (*tmp == 'Z' || *tmp == 'z') tmp++;
while (*tmp == ' ') tmp++;
if (strcasecmp(tmp, "stereo") == 0) {
PicoOpt |= POPT_EN_STEREO;
PicoIn.opt |= POPT_EN_STEREO;
} else if (strcasecmp(tmp, "mono") == 0) {
PicoOpt &= ~POPT_EN_STEREO;
PicoIn.opt &= ~POPT_EN_STEREO;
} else
return 0;
return 1;
@ -279,31 +279,31 @@ static int custom_read(menu_entry *me, const char *var, const char *val)
{
const char *p = val + 5, *end = val + strlen(val);
int i;
PicoRegionOverride = PicoAutoRgnOrder = 0;
PicoIn.regionOverride = PicoIn.autoRgnOrder = 0;
for (i = 0; p < end && i < 3; i++)
{
while (*p == ' ') p++;
if (p[0] == 'J' && p[1] == 'P') {
PicoAutoRgnOrder |= 1 << (i*4);
PicoIn.autoRgnOrder |= 1 << (i*4);
} else if (p[0] == 'U' && p[1] == 'S') {
PicoAutoRgnOrder |= 4 << (i*4);
PicoIn.autoRgnOrder |= 4 << (i*4);
} else if (p[0] == 'E' && p[1] == 'U') {
PicoAutoRgnOrder |= 8 << (i*4);
PicoIn.autoRgnOrder |= 8 << (i*4);
}
while (*p != ' ' && *p != 0) p++;
if (*p == 0) break;
}
}
else if (strcasecmp(val, "Auto") == 0) {
PicoRegionOverride = 0;
PicoIn.regionOverride = 0;
} else if (strcasecmp(val, "Japan NTSC") == 0) {
PicoRegionOverride = 1;
PicoIn.regionOverride = 1;
} else if (strcasecmp(val, "Japan PAL") == 0) {
PicoRegionOverride = 2;
PicoIn.regionOverride = 2;
} else if (strcasecmp(val, "USA") == 0) {
PicoRegionOverride = 4;
PicoIn.regionOverride = 4;
} else if (strcasecmp(val, "Europe") == 0) {
PicoRegionOverride = 8;
PicoIn.regionOverride = 8;
} else
return 0;
return 1;

View file

@ -171,8 +171,8 @@ static const char *find_bios(int *region, const char *cd_fname)
ret = emu_read_config(cd_fname, 0);
if (!ret) emu_read_config(NULL, 0);
if (PicoRegionOverride) {
*region = PicoRegionOverride;
if (PicoIn.regionOverride) {
*region = PicoIn.regionOverride;
lprintf("override region to %s\n", *region != 4 ?
(*region == 8 ? "EU" : "JAP") : "USA");
}
@ -266,16 +266,16 @@ static char *emu_make_rom_id(const char *fname)
static char id_string[3+0xe*3+0x3*3+0x30*3+3];
int pos, swab = 1;
if (PicoAHW & PAHW_MCD) {
if (PicoIn.AHW & PAHW_MCD) {
strcpy(id_string, "CD|");
swab = 0;
}
else if (PicoAHW & PAHW_SMS)
else if (PicoIn.AHW & PAHW_SMS)
strcpy(id_string, "MS|");
else strcpy(id_string, "MD|");
pos = 3;
if (!(PicoAHW & PAHW_SMS)) {
if (!(PicoIn.AHW & PAHW_SMS)) {
pos += extract_text(id_string + pos, media_id_header + 0x80, 0x0e, swab); // serial
id_string[pos] = '|'; pos++;
pos += extract_text(id_string + pos, media_id_header + 0xf0, 0x03, swab); // region
@ -296,7 +296,7 @@ static char *emu_make_rom_id(const char *fname)
// buffer must be at least 150 byte long
void emu_get_game_name(char *str150)
{
int ret, swab = (PicoAHW & PAHW_MCD) ? 0 : 1;
int ret, swab = (PicoIn.AHW & PAHW_MCD) ? 0 : 1;
char *s, *d;
ret = extract_text(str150, media_id_header + 0x50, 0x30, swab); // overseas name
@ -315,22 +315,22 @@ static void system_announce(void)
const char *sys_name, *tv_standard, *extra = "";
int fps;
if (PicoAHW & PAHW_SMS) {
if (PicoIn.AHW & PAHW_SMS) {
sys_name = "Master System";
#ifdef NO_SMS
extra = " [no support]";
#endif
} else if (PicoAHW & PAHW_PICO) {
} else if (PicoIn.AHW & PAHW_PICO) {
sys_name = "Pico";
} else if ((PicoAHW & (PAHW_32X|PAHW_MCD)) == (PAHW_32X|PAHW_MCD)) {
} else if ((PicoIn.AHW & (PAHW_32X|PAHW_MCD)) == (PAHW_32X|PAHW_MCD)) {
sys_name = "32X + Mega CD";
if ((Pico.m.hardware & 0xc0) == 0x80)
sys_name = "32X + Sega CD";
} else if (PicoAHW & PAHW_MCD) {
} else if (PicoIn.AHW & PAHW_MCD) {
sys_name = "Mega CD";
if ((Pico.m.hardware & 0xc0) == 0x80)
sys_name = "Sega CD";
} else if (PicoAHW & PAHW_32X) {
} else if (PicoIn.AHW & PAHW_32X) {
sys_name = "32X";
} else {
sys_name = "MegaDrive";
@ -451,7 +451,7 @@ int emu_reload_rom(const char *rom_fname_in)
}
// make quirks visible in UI
if (PicoQuirks & PQUIRK_FORCE_6BTN)
if (PicoIn.quirks & PQUIRK_FORCE_6BTN)
currentConfig.input_dev0 = PICO_INPUT_PAD_6BTN;
menu_romload_end();
@ -470,12 +470,12 @@ int emu_reload_rom(const char *rom_fname_in)
PicoSetInputDevice(0, indev);
PicoSetInputDevice(1, indev);
PicoOpt |= POPT_DIS_VDP_FIFO; // no VDP fifo timing
PicoIn.opt |= POPT_DIS_VDP_FIFO; // no VDP fifo timing
if (movie_data[0xF] >= 'A') {
if (movie_data[0x16] & 0x80) {
PicoRegionOverride = 8;
PicoIn.regionOverride = 8;
} else {
PicoRegionOverride = 4;
PicoIn.regionOverride = 4;
}
PicoReset();
// TODO: bits 6 & 5
@ -486,7 +486,7 @@ int emu_reload_rom(const char *rom_fname_in)
else
{
system_announce();
PicoOpt &= ~POPT_DIS_VDP_FIFO;
PicoIn.opt &= ~POPT_DIS_VDP_FIFO;
}
strncpy(rom_fname_loaded, rom_fname, sizeof(rom_fname_loaded)-1);
@ -603,10 +603,10 @@ void emu_prep_defconfig(void)
void emu_set_defconfig(void)
{
memcpy(&currentConfig, &defaultConfig, sizeof(currentConfig));
PicoOpt = currentConfig.s_PicoOpt;
PicoIn.opt = currentConfig.s_PicoOpt;
PsndRate = currentConfig.s_PsndRate;
PicoRegionOverride = currentConfig.s_PicoRegion;
PicoAutoRgnOrder = currentConfig.s_PicoAutoRgnOrder;
PicoIn.regionOverride = currentConfig.s_PicoRegion;
PicoIn.autoRgnOrder = currentConfig.s_PicoAutoRgnOrder;
}
int emu_read_config(const char *rom_fname, int no_defaults)
@ -767,20 +767,20 @@ static void update_movie(void)
lprintf("END OF MOVIE.\n");
} else {
// MXYZ SACB RLDU
PicoPad[0] = ~movie_data[offs] & 0x8f; // ! SCBA RLDU
if(!(movie_data[offs] & 0x10)) PicoPad[0] |= 0x40; // C
if(!(movie_data[offs] & 0x20)) PicoPad[0] |= 0x10; // A
if(!(movie_data[offs] & 0x40)) PicoPad[0] |= 0x20; // B
PicoPad[1] = ~movie_data[offs+1] & 0x8f; // ! SCBA RLDU
if(!(movie_data[offs+1] & 0x10)) PicoPad[1] |= 0x40; // C
if(!(movie_data[offs+1] & 0x20)) PicoPad[1] |= 0x10; // A
if(!(movie_data[offs+1] & 0x40)) PicoPad[1] |= 0x20; // B
PicoPad[0] |= (~movie_data[offs+2] & 0x0A) << 8; // ! MZYX
if(!(movie_data[offs+2] & 0x01)) PicoPad[0] |= 0x0400; // X
if(!(movie_data[offs+2] & 0x04)) PicoPad[0] |= 0x0100; // Z
PicoPad[1] |= (~movie_data[offs+2] & 0xA0) << 4; // ! MZYX
if(!(movie_data[offs+2] & 0x10)) PicoPad[1] |= 0x0400; // X
if(!(movie_data[offs+2] & 0x40)) PicoPad[1] |= 0x0100; // Z
PicoIn.pad[0] = ~movie_data[offs] & 0x8f; // ! SCBA RLDU
if(!(movie_data[offs] & 0x10)) PicoIn.pad[0] |= 0x40; // C
if(!(movie_data[offs] & 0x20)) PicoIn.pad[0] |= 0x10; // A
if(!(movie_data[offs] & 0x40)) PicoIn.pad[0] |= 0x20; // B
PicoIn.pad[1] = ~movie_data[offs+1] & 0x8f; // ! SCBA RLDU
if(!(movie_data[offs+1] & 0x10)) PicoIn.pad[1] |= 0x40; // C
if(!(movie_data[offs+1] & 0x20)) PicoIn.pad[1] |= 0x10; // A
if(!(movie_data[offs+1] & 0x40)) PicoIn.pad[1] |= 0x20; // B
PicoIn.pad[0] |= (~movie_data[offs+2] & 0x0A) << 8; // ! MZYX
if(!(movie_data[offs+2] & 0x01)) PicoIn.pad[0] |= 0x0400; // X
if(!(movie_data[offs+2] & 0x04)) PicoIn.pad[0] |= 0x0100; // Z
PicoIn.pad[1] |= (~movie_data[offs+2] & 0xA0) << 4; // ! MZYX
if(!(movie_data[offs+2] & 0x10)) PicoIn.pad[1] |= 0x0400; // X
if(!(movie_data[offs+2] & 0x40)) PicoIn.pad[1] |= 0x0100; // Z
}
}
@ -809,9 +809,9 @@ char *emu_get_save_fname(int load, int is_sram, int slot, int *time)
if (is_sram)
{
strcpy(ext, (PicoAHW & PAHW_MCD) ? ".brm" : ".srm");
strcpy(ext, (PicoIn.AHW & PAHW_MCD) ? ".brm" : ".srm");
romfname_ext(saveFname, sizeof(static_buff),
(PicoAHW & PAHW_MCD) ? "brm"PATH_SEP : "srm"PATH_SEP, ext);
(PicoIn.AHW & PAHW_MCD) ? "brm"PATH_SEP : "srm"PATH_SEP, ext);
if (!load)
return saveFname;
@ -885,9 +885,9 @@ int emu_save_load_game(int load, int sram)
int sram_size;
unsigned char *sram_data;
int truncate = 1;
if (PicoAHW & PAHW_MCD)
if (PicoIn.AHW & PAHW_MCD)
{
if (PicoOpt & POPT_EN_MCD_RAMCART) {
if (PicoIn.opt & POPT_EN_MCD_RAMCART) {
sram_size = 0x12000;
sram_data = Pico.sv.data;
if (sram_data)
@ -912,7 +912,7 @@ int emu_save_load_game(int load, int sram)
ret = fread(sram_data, 1, sram_size, sramFile);
ret = ret > 0 ? 0 : -1;
fclose(sramFile);
if ((PicoAHW & PAHW_MCD) && (PicoOpt&POPT_EN_MCD_RAMCART))
if ((PicoIn.AHW & PAHW_MCD) && (PicoIn.opt&POPT_EN_MCD_RAMCART))
memcpy(Pico_mcd->bram, sram_data, 0x2000);
} else {
// sram save needs some special processing
@ -974,7 +974,7 @@ void emu_set_fastforward(int set_on)
PsndRerate(1);
is_on = 0;
// mainly to unbreak pcm
if (PicoAHW & PAHW_MCD)
if (PicoIn.AHW & PAHW_MCD)
pcd_state_loaded();
}
}
@ -1034,11 +1034,11 @@ void run_events_pico(unsigned int events)
return;
/* handle other input modes */
if (PicoPad[0] & 1) pico_pen_y--;
if (PicoPad[0] & 2) pico_pen_y++;
if (PicoPad[0] & 4) pico_pen_x--;
if (PicoPad[0] & 8) pico_pen_x++;
PicoPad[0] &= ~0x0f; // release UDLR
if (PicoIn.pad[0] & 1) pico_pen_y--;
if (PicoIn.pad[0] & 2) pico_pen_y++;
if (PicoIn.pad[0] & 4) pico_pen_x--;
if (PicoIn.pad[0] & 8) pico_pen_x++;
PicoIn.pad[0] &= ~0x0f; // release UDLR
lim_x = (Pico.video.reg[12]&1) ? 319 : 255;
if (pico_pen_y < 8)
@ -1057,7 +1057,7 @@ void run_events_pico(unsigned int events)
PicoPicohw.pen_pos[1] = pico_inp_mode == 1 ? (0x2f8 + pico_pen_y) : (0x1fc + pico_pen_y);
}
static void do_turbo(int *pad, int acts)
static void do_turbo(unsigned short *pad, int acts)
{
static int turbo_pad = 0;
static unsigned char turbo_cnt[3] = { 0, 0, 0 };
@ -1159,13 +1159,13 @@ void emu_update_input(void)
pl_actions[0] = actions[IN_BINDTYPE_PLAYER12];
pl_actions[1] = actions[IN_BINDTYPE_PLAYER12] >> 16;
PicoPad[0] = pl_actions[0] & 0xfff;
PicoPad[1] = pl_actions[1] & 0xfff;
PicoIn.pad[0] = pl_actions[0] & 0xfff;
PicoIn.pad[1] = pl_actions[1] & 0xfff;
if (pl_actions[0] & 0x7000)
do_turbo(&PicoPad[0], pl_actions[0]);
do_turbo(&PicoIn.pad[0], pl_actions[0]);
if (pl_actions[1] & 0x7000)
do_turbo(&PicoPad[1], pl_actions[1]);
do_turbo(&PicoIn.pad[1], pl_actions[1]);
events = actions[IN_BINDTYPE_EMU] & PEV_MASK;
@ -1181,7 +1181,7 @@ void emu_update_input(void)
events &= ~prev_events;
if (PicoAHW == PAHW_PICO)
if (PicoIn.AHW == PAHW_PICO)
run_events_pico(events);
if (events)
run_events_ui(events);
@ -1202,14 +1202,14 @@ static void mkdir_path(char *path_with_reserve, int pos, const char *name)
void emu_cmn_forced_frame(int no_scale, int do_emu)
{
int po_old = PicoOpt;
int po_old = PicoIn.opt;
memset32(g_screen_ptr, 0, g_screen_width * g_screen_height * 2 / 4);
PicoOpt &= ~POPT_ALT_RENDERER;
PicoOpt |= POPT_ACC_SPRITES;
PicoIn.opt &= ~POPT_ALT_RENDERER;
PicoIn.opt |= POPT_ACC_SPRITES;
if (!no_scale)
PicoOpt |= POPT_EN_SOFTSCALE;
PicoIn.opt |= POPT_EN_SOFTSCALE;
PicoDrawSetOutFormat(PDF_RGB555, 1);
Pico.m.dirtyPal = 1;
@ -1218,7 +1218,7 @@ void emu_cmn_forced_frame(int no_scale, int do_emu)
else
PicoFrameDrawOnly();
PicoOpt = po_old;
PicoIn.opt = po_old;
}
void emu_init(void)
@ -1293,7 +1293,7 @@ void emu_sound_start(void)
if (currentConfig.EmuOpt & EOPT_EN_SOUND)
{
int is_stereo = (PicoOpt & POPT_EN_STEREO) ? 1 : 0;
int is_stereo = (PicoIn.opt & POPT_EN_STEREO) ? 1 : 0;
PsndRerate(Pico.m.frame_count ? 1 : 0);
@ -1470,9 +1470,9 @@ void emu_loop(void)
emu_update_input();
if (skip) {
int do_audio = diff > -target_frametime_x3 * 2;
PicoSkipFrame = do_audio ? 1 : 2;
PicoIn.skipFrame = do_audio ? 1 : 2;
PicoFrame();
PicoSkipFrame = 0;
PicoIn.skipFrame = 0;
}
else {
PicoFrame();

View file

@ -281,7 +281,7 @@ static void menu_loop_patches(void)
// -------------- key config --------------
// PicoPad[] format: MXYZ SACB RLDU
// PicoIn.pad[] format: MXYZ SACB RLDU
me_bind_action me_ctrl_actions[] =
{
{ "UP ", 0x0001 },
@ -410,10 +410,10 @@ static const char h_scfx[] = "Emulate scale/rotate ASIC chip for graphics effe
static menu_entry e_menu_cd_options[] =
{
mee_onoff_h("CD LEDs", MA_CDOPT_LEDS, currentConfig.EmuOpt, EOPT_EN_CD_LEDS, h_cdleds),
mee_onoff_h("CDDA audio", MA_CDOPT_CDDA, PicoOpt, POPT_EN_MCD_CDDA, h_cdda),
mee_onoff_h("PCM audio", MA_CDOPT_PCM, PicoOpt, POPT_EN_MCD_PCM, h_cdpcm),
mee_onoff_h("SaveRAM cart", MA_CDOPT_SAVERAM, PicoOpt, POPT_EN_MCD_RAMCART, h_srcart),
mee_onoff_h("Scale/Rot. fx", MA_CDOPT_SCALEROT_CHIP, PicoOpt, POPT_EN_MCD_GFX, h_scfx),
mee_onoff_h("CDDA audio", MA_CDOPT_CDDA, PicoIn.opt, POPT_EN_MCD_CDDA, h_cdda),
mee_onoff_h("PCM audio", MA_CDOPT_PCM, PicoIn.opt, POPT_EN_MCD_PCM, h_cdpcm),
mee_onoff_h("SaveRAM cart", MA_CDOPT_SAVERAM, PicoIn.opt, POPT_EN_MCD_RAMCART, h_srcart),
mee_onoff_h("Scale/Rot. fx", MA_CDOPT_SCALEROT_CHIP, PicoIn.opt, POPT_EN_MCD_GFX, h_scfx),
mee_end,
};
@ -464,9 +464,9 @@ static const char h_sh2cycles[] = "Cycles/millisecond (similar to DOSBox)\n"
static menu_entry e_menu_32x_options[] =
{
mee_onoff_h ("32X enabled", MA_32XOPT_ENABLE_32X, PicoOpt, POPT_EN_32X, h_32x_enable),
mee_onoff_h ("32X enabled", MA_32XOPT_ENABLE_32X, PicoIn.opt, POPT_EN_32X, h_32x_enable),
mee_enum ("32X renderer", MA_32XOPT_RENDERER, currentConfig.renderer32x, renderer_names32x),
mee_onoff_h ("PWM sound", MA_32XOPT_PWM, PicoOpt, POPT_EN_PWM, h_pwm),
mee_onoff_h ("PWM sound", MA_32XOPT_PWM, PicoIn.opt, POPT_EN_PWM, h_pwm),
mee_cust_h ("Master SH2 cycles", MA_32XOPT_MSH2_CYCLES, mh_opt_sh2cycles, mgn_opt_sh2cycles, h_sh2cycles),
mee_cust_h ("Slave SH2 cycles", MA_32XOPT_SSH2_CYCLES, mh_opt_sh2cycles, mgn_opt_sh2cycles, h_sh2cycles),
mee_end,
@ -491,15 +491,15 @@ static int menu_loop_32x_options(int id, int keys)
static menu_entry e_menu_adv_options[] =
{
mee_onoff ("SRAM/BRAM saves", MA_OPT_SRAM_STATES, currentConfig.EmuOpt, EOPT_EN_SRAM),
mee_onoff ("Disable sprite limit", MA_OPT2_NO_SPRITE_LIM, PicoOpt, POPT_DIS_SPRITE_LIM),
mee_onoff ("Emulate Z80", MA_OPT2_ENABLE_Z80, PicoOpt, POPT_EN_Z80),
mee_onoff ("Emulate YM2612 (FM)", MA_OPT2_ENABLE_YM2612, PicoOpt, POPT_EN_FM),
mee_onoff ("Emulate SN76496 (PSG)", MA_OPT2_ENABLE_SN76496,PicoOpt, POPT_EN_PSG),
mee_onoff ("Disable sprite limit", MA_OPT2_NO_SPRITE_LIM, PicoIn.opt, POPT_DIS_SPRITE_LIM),
mee_onoff ("Emulate Z80", MA_OPT2_ENABLE_Z80, PicoIn.opt, POPT_EN_Z80),
mee_onoff ("Emulate YM2612 (FM)", MA_OPT2_ENABLE_YM2612, PicoIn.opt, POPT_EN_FM),
mee_onoff ("Emulate SN76496 (PSG)", MA_OPT2_ENABLE_SN76496,PicoIn.opt, POPT_EN_PSG),
mee_onoff ("gzip savestates", MA_OPT2_GZIP_STATES, currentConfig.EmuOpt, EOPT_GZIP_SAVES),
mee_onoff ("Don't save last used ROM", MA_OPT2_NO_LAST_ROM, currentConfig.EmuOpt, EOPT_NO_AUTOSVCFG),
mee_onoff ("Disable idle loop patching",MA_OPT2_NO_IDLE_LOOPS,PicoOpt, POPT_DIS_IDLE_DET),
mee_onoff ("Disable idle loop patching",MA_OPT2_NO_IDLE_LOOPS,PicoIn.opt, POPT_DIS_IDLE_DET),
mee_onoff ("Disable frame limiter", MA_OPT2_NO_FRAME_LIMIT,currentConfig.EmuOpt, EOPT_NO_FRMLIMIT),
mee_onoff ("Enable dynarecs", MA_OPT2_DYNARECS, PicoOpt, POPT_EN_DRC),
mee_onoff ("Enable dynarecs", MA_OPT2_DYNARECS, PicoIn.opt, POPT_EN_DRC),
mee_onoff ("Status line in main menu", MA_OPT2_STATUS_LINE, currentConfig.EmuOpt, EOPT_SHOW_RTC),
MENU_OPTIONS_ADV
mee_end,
@ -556,15 +556,15 @@ static int sndrate_prevnext(int rate, int dir)
i += dir ? 1 : -1;
if (i > 4) {
if (!(PicoOpt & POPT_EN_STEREO)) {
PicoOpt |= POPT_EN_STEREO;
if (!(PicoIn.opt & POPT_EN_STEREO)) {
PicoIn.opt |= POPT_EN_STEREO;
return rates[0];
}
return rates[4];
}
if (i < 0) {
if (PicoOpt & POPT_EN_STEREO) {
PicoOpt &= ~POPT_EN_STEREO;
if (PicoIn.opt & POPT_EN_STEREO) {
PicoIn.opt &= ~POPT_EN_STEREO;
return rates[4];
}
return rates[0];
@ -579,24 +579,24 @@ static void region_prevnext(int right)
int i;
if (right) {
if (!PicoRegionOverride) {
if (!PicoIn.regionOverride) {
for (i = 0; i < 6; i++)
if (rgn_orders[i] == PicoAutoRgnOrder) break;
if (i < 5) PicoAutoRgnOrder = rgn_orders[i+1];
else PicoRegionOverride=1;
if (rgn_orders[i] == PicoIn.autoRgnOrder) break;
if (i < 5) PicoIn.autoRgnOrder = rgn_orders[i+1];
else PicoIn.regionOverride=1;
}
else
PicoRegionOverride <<= 1;
if (PicoRegionOverride > 8)
PicoRegionOverride = 8;
PicoIn.regionOverride <<= 1;
if (PicoIn.regionOverride > 8)
PicoIn.regionOverride = 8;
} else {
if (!PicoRegionOverride) {
if (!PicoIn.regionOverride) {
for (i = 0; i < 6; i++)
if (rgn_orders[i] == PicoAutoRgnOrder) break;
if (i > 0) PicoAutoRgnOrder = rgn_orders[i-1];
if (rgn_orders[i] == PicoIn.autoRgnOrder) break;
if (i > 0) PicoIn.autoRgnOrder = rgn_orders[i-1];
}
else
PicoRegionOverride >>= 1;
PicoIn.regionOverride >>= 1;
}
}
@ -667,7 +667,7 @@ static const char *mgn_opt_sound(int id, int *offs)
{
const char *str2;
*offs = -8;
str2 = (PicoOpt & POPT_EN_STEREO) ? "stereo" : "mono";
str2 = (PicoIn.opt & POPT_EN_STEREO) ? "stereo" : "mono";
sprintf(static_buff, "%5iHz %s", PsndRate, str2);
return static_buff;
}
@ -676,7 +676,7 @@ static const char *mgn_opt_region(int id, int *offs)
{
static const char *names[] = { "Auto", " Japan NTSC", " Japan PAL", " USA", " Europe" };
static const char *names_short[] = { "", " JP", " JP", " US", " EU" };
int code = PicoRegionOverride;
int code = PicoIn.regionOverride;
int u, i = 0;
*offs = -6;
@ -689,7 +689,7 @@ static const char *mgn_opt_region(int id, int *offs)
} else {
strcpy(static_buff, "Auto:");
for (u = 0; u < 3; u++) {
code = (PicoAutoRgnOrder >> u*4) & 0xf;
code = (PicoIn.autoRgnOrder >> u*4) & 0xf;
for (i = 0; code; code >>= 1, i++)
;
strcat(static_buff, names_short[i]);
@ -887,9 +887,9 @@ static void debug_menu_loop(void)
if (inp & PBTN_MA2) pv->debug_p ^= PVD_KILL_32X;
if (inp & PBTN_MOK) {
PsndOut = NULL; // just in case
PicoSkipFrame = 1;
PicoIn.skipFrame = 1;
PicoFrame();
PicoSkipFrame = 0;
PicoIn.skipFrame = 0;
while (inp & PBTN_MOK) inp = in_menu_wait_any(NULL, -1);
}
break;
@ -1023,7 +1023,7 @@ static int main_menu_handler(int id, int keys)
}
break;
case MA_MAIN_CHANGE_CD:
if (PicoAHW & PAHW_MCD) {
if (PicoIn.AHW & PAHW_MCD) {
// if cd is loaded, cdd_unload() triggers eject and
// returns 1, else we'll select and load new CD here
if (!cdd_unload())
@ -1081,7 +1081,7 @@ void menu_loop(void)
me_enable(e_menu_main, MA_MAIN_SAVE_STATE, PicoGameLoaded);
me_enable(e_menu_main, MA_MAIN_LOAD_STATE, PicoGameLoaded);
me_enable(e_menu_main, MA_MAIN_RESET_GAME, PicoGameLoaded);
me_enable(e_menu_main, MA_MAIN_CHANGE_CD, PicoAHW & PAHW_MCD);
me_enable(e_menu_main, MA_MAIN_CHANGE_CD, PicoIn.AHW & PAHW_MCD);
me_enable(e_menu_main, MA_MAIN_PATCHES, PicoPatches != NULL);
menu_enter(PicoGameLoaded);
@ -1168,7 +1168,7 @@ void menu_update_msg(const char *msg)
/* hidden options for config engine only */
static menu_entry e_menu_hidden[] =
{
mee_onoff("Accurate sprites", MA_OPT_ACC_SPRITES, PicoOpt, 0x080),
mee_onoff("Accurate sprites", MA_OPT_ACC_SPRITES, PicoIn.opt, 0x080),
mee_onoff("autoload savestates", MA_OPT_AUTOLOAD_SAVE, g_autostateld_opt, 1),
mee_end,
};

View file

@ -115,7 +115,7 @@ void mp3_start_play(void *f_, int pos1024)
cdda_out_pos = 0;
decoder_active = 0;
if (!(PicoOpt & POPT_EN_MCD_CDDA) || f == NULL) // cdda disabled or no file?
if (!(PicoIn.opt & POPT_EN_MCD_CDDA) || f == NULL) // cdda disabled or no file?
return;
fseek(f, 0, SEEK_END);