tcache, DRC_TCACHE_SIZE, ret);
#ifdef __arm__
- if (PicoOpt & POPT_EN_DRC)
+ if (PicoIn.opt & POPT_EN_DRC)
{
static int test_done;
if (!test_done)
elprintf(EL_STATUS|EL_32X, "32X startup");
// TODO: OOM handling
- PicoAHW |= PAHW_32X;
+ PicoIn.AHW |= PAHW_32X;
sh2_init(&msh2, 0, &ssh2);
msh2.irq_callback = sh2_irq_cb;
sh2_init(&ssh2, 1, &msh2);
if (p32x_bios_m == NULL) {
sh2_set_gbr(0, 0x20004000);
- if (!(PicoAHW & PAHW_MCD)) {
+ if (!(PicoIn.AHW & PAHW_MCD)) {
unsigned int idl_src, idl_dst, idl_size; // initial data load
unsigned int vbr;
sh2_finish(&msh2);
sh2_finish(&ssh2);
- PicoAHW &= ~PAHW_32X;
+ PicoIn.AHW &= ~PAHW_32X;
}
void PicoReset32x(void)
{
- if (PicoAHW & PAHW_32X) {
+ if (PicoIn.AHW & PAHW_32X) {
p32x_trigger_irq(NULL, SekCyclesDone(), P32XI_VRES);
p32x_sh2_poll_event(&msh2, SH2_IDLE_STATES, 0);
p32x_sh2_poll_event(&ssh2, SH2_IDLE_STATES, 0);
static void p32x_start_blank(void)
{
- if (Pico32xDrawMode != PDM32X_OFF && !PicoSkipFrame) {
+ if (Pico32xDrawMode != PDM32X_OFF && !PicoIn.skipFrame) {
int offs, lines;
pprof_start(draw);
offs = 8; lines = 224;
- if ((Pico.video.reg[1] & 8) && !(PicoOpt & POPT_ALT_RENDERER)) {
+ if ((Pico.video.reg[1] & 8) && !(PicoIn.opt & POPT_ALT_RENDERER)) {
offs = 0;
lines = 240;
}
elprintf_sh2(sh2, EL_32X, "+run %u %d @%08x",
sh2->m68krcycles_done, cycles, sh2->pc);
- done = sh2_execute(sh2, cycles, PicoOpt & POPT_EN_DRC);
+ done = sh2_execute(sh2, cycles, PicoIn.opt & POPT_EN_DRC);
sh2->m68krcycles_done += C_SH2_TO_M68K(*sh2, done);
sh2->state &= ~SH2_STATE_RUN;
}
#define CPUS_RUN(m68k_cycles) do { \
- if (PicoAHW & PAHW_MCD) \
+ if (PicoIn.AHW & PAHW_MCD) \
pcd_run_cpus(m68k_cycles); \
else \
SekRunM68k(m68k_cycles); \
\
if ((Pico32x.emu_flags & P32XF_Z80_32X_IO) && Pico.m.z80Run \
- && !Pico.m.z80_reset && (PicoOpt & POPT_EN_Z80)) \
+ && !Pico.m.z80_reset && (PicoIn.opt & POPT_EN_Z80)) \
PicoSyncZ80(SekCyclesDone()); \
if (Pico32x.emu_flags & (P32XF_68KCPOLL|P32XF_68KVPOLL)) \
p32x_sync_sh2s(SekCyclesDone()); \
p32x_sh2_poll_event(&msh2, SH2_STATE_VPOLL, 0);
p32x_sh2_poll_event(&ssh2, SH2_STATE_VPOLL, 0);
- if (PicoAHW & PAHW_MCD)
+ if (PicoIn.AHW & PAHW_MCD)
pcd_prepare_frame();
PicoFrameStart();
}
if ((a & 0xfc00) != 0x5000) {
- if (PicoAHW & PAHW_MCD)
+ if (PicoIn.AHW & PAHW_MCD)
return PicoRead8_mcd_io(a);
else
return PicoRead8_io(a);
}
if ((a & 0xfc00) != 0x5000) {
- if (PicoAHW & PAHW_MCD)
+ if (PicoIn.AHW & PAHW_MCD)
return PicoRead16_mcd_io(a);
else
return PicoRead16_io(a);
}
if ((a & 0xfc00) != 0x5000) {
- if (PicoAHW & PAHW_MCD)
+ if (PicoIn.AHW & PAHW_MCD)
PicoWrite8_mcd_io(a, d);
else
PicoWrite8_io(a, d);
}
if ((a & 0xfc00) != 0x5000) {
- if (PicoAHW & PAHW_MCD)
+ if (PicoIn.AHW & PAHW_MCD)
PicoWrite16_mcd_io(a, d);
else
PicoWrite16_io(a, d);
u32 PicoRead8_32x(u32 a)
{
u32 d = 0;
- if ((a & 0xffc0) == 0x5100) { // a15100
- // regs are always readable
- d = ((u8 *)Pico32x.regs)[(a & 0x3f) ^ 1];
- goto out;
- }
- if ((a & 0xfffc) == 0x30ec) { // a130ec
- d = str_mars[a & 3];
- goto out;
+ if (PicoIn.opt & POPT_EN_32X) {
+ if ((a & 0xffc0) == 0x5100) { // a15100
+ // regs are always readable
+ d = ((u8 *)Pico32x.regs)[(a & 0x3f) ^ 1];
+ goto out;
+ }
+
+ if ((a & 0xfffc) == 0x30ec) { // a130ec
+ d = str_mars[a & 3];
+ goto out;
+ }
}
elprintf(EL_UIO, "m68k unmapped r8 [%06x] @%06x", a, SekPc);
u32 PicoRead16_32x(u32 a)
{
u32 d = 0;
- if ((a & 0xffc0) == 0x5100) { // a15100
- d = Pico32x.regs[(a & 0x3f) / 2];
- goto out;
- }
- if ((a & 0xfffc) == 0x30ec) { // a130ec
- d = !(a & 2) ? ('M'<<8)|'A' : ('R'<<8)|'S';
- goto out;
+ if (PicoIn.opt & POPT_EN_32X) {
+ if ((a & 0xffc0) == 0x5100) { // a15100
+ d = Pico32x.regs[(a & 0x3f) / 2];
+ goto out;
+ }
+
+ if ((a & 0xfffc) == 0x30ec) { // a130ec
+ d = !(a & 2) ? ('M'<<8)|'A' : ('R'<<8)|'S';
+ goto out;
+ }
}
elprintf(EL_UIO, "m68k unmapped r16 [%06x] @%06x", a, SekPc);
void PicoWrite8_32x(u32 a, u32 d)
{
- if ((a & 0xffc0) == 0x5100) { // a15100
+ if ((PicoIn.opt & POPT_EN_32X) && (a & 0xffc0) == 0x5100) // a15100
+ {
u16 *r = Pico32x.regs;
elprintf(EL_32X, "m68k 32x w8 [%06x] %02x @%06x", a, d & 0xff, SekPc);
void PicoWrite16_32x(u32 a, u32 d)
{
- if ((a & 0xffc0) == 0x5100) { // a15100
+ if ((PicoIn.opt & POPT_EN_32X) && (a & 0xffc0) == 0x5100) // a15100
+ {
u16 *r = Pico32x.regs;
elprintf(EL_UIO, "m68k 32x w16 [%06x] %04x @%06x", a, d & 0xffff, SekPc);
if (!is_sms)\r
{\r
// maybe we are loading MegaCD BIOS?\r
- if (!(PicoAHW & PAHW_MCD) && size == 0x20000 && (!strncmp((char *)rom+0x124, "BOOT", 4) ||\r
+ if (!(PicoIn.AHW & PAHW_MCD) && size == 0x20000 && (!strncmp((char *)rom+0x124, "BOOT", 4) ||\r
!strncmp((char *)rom+0x128, "BOOT", 4))) {\r
- PicoAHW |= PAHW_MCD;\r
+ PicoIn.AHW |= PAHW_MCD;\r
}\r
\r
// Check for SMD:\r
}\r
pdb_cleanup();\r
\r
- PicoAHW &= PAHW_MCD|PAHW_SMS;\r
+ PicoIn.AHW &= PAHW_MCD|PAHW_SMS;\r
\r
PicoCartMemSetup = NULL;\r
PicoDmaHook = NULL;\r
PicoLoadStateHook = NULL;\r
carthw_chunks = NULL;\r
\r
- if (!(PicoAHW & (PAHW_MCD|PAHW_SMS)))\r
+ if (!(PicoIn.AHW & (PAHW_MCD|PAHW_SMS)))\r
PicoCartDetect(carthw_cfg);\r
\r
// setup correct memory map for loaded ROM\r
- switch (PicoAHW) {\r
+ switch (PicoIn.AHW) {\r
default:\r
- elprintf(EL_STATUS|EL_ANOMALY, "starting in unknown hw configuration: %x", PicoAHW);\r
+ elprintf(EL_STATUS|EL_ANOMALY, "starting in unknown hw configuration: %x", PicoIn.AHW);\r
case 0:\r
case PAHW_SVP: PicoMemSetup(); break;\r
case PAHW_MCD: PicoMemSetupCD(); break;\r
if (PicoCartMemSetup != NULL)\r
PicoCartMemSetup();\r
\r
- if (PicoAHW & PAHW_SMS)\r
+ if (PicoIn.AHW & PAHW_SMS)\r
PicoPowerMS();\r
else\r
PicoPower();\r
PicoCartUnloadHook = NULL;\r
}\r
\r
- if (PicoAHW & PAHW_32X)\r
+ if (PicoIn.AHW & PAHW_32X)\r
PicoUnload32x();\r
\r
if (Pico.rom != NULL) {\r
else if (strcmp(p, "filled_sram") == 0)\r
*fill_sram = 1;\r
else if (strcmp(p, "force_6btn") == 0)\r
- PicoQuirks |= PQUIRK_FORCE_6BTN;\r
+ PicoIn.quirks |= PQUIRK_FORCE_6BTN;\r
else {\r
elprintf(EL_STATUS, "carthw:%d: unsupported prop: %s", line, p);\r
goto bad_nomsg;\r
#include <cpu/drc/cmn.h>
#include "compiler.h"
+#define SVP_CYCLES_LINE 850
+
svp_t *svp = NULL;
-int PicoSVPCycles = 850; // cycles/line, just a guess
static int svp_dyn_ready = 0;
/* save state stuff */
memcpy(svp->iram_rom + 0x800, Pico.rom + 0x800, 0x20000 - 0x800);
ssp1601_reset(&svp->ssp1601);
#ifdef _SVP_DRC
- if ((PicoOpt & POPT_EN_DRC) && svp_dyn_ready)
+ if ((PicoIn.opt & POPT_EN_DRC) && svp_dyn_ready)
ssp1601_dyn_reset(&svp->ssp1601);
#endif
}
#endif
#ifdef _SVP_DRC
- if ((PicoOpt & POPT_EN_DRC) && svp_dyn_ready)
- ssp1601_dyn_run(PicoSVPCycles * count);
+ if ((PicoIn.opt & POPT_EN_DRC) && svp_dyn_ready)
+ ssp1601_dyn_run(SVP_CYCLES_LINE * count);
else
#endif
{
- ssp1601_run(PicoSVPCycles * count);
+ ssp1601_run(SVP_CYCLES_LINE * count);
svp_dyn_ready = 0; // just in case
}
// test mode
- //if (Pico.m.frame_count == 13) PicoPad[0] |= 0xff;
+ //if (Pico.m.frame_count == 13) PicoIn.pad[0] |= 0xff;
}
// init SVP compiler
svp_dyn_ready = 0;
#ifdef _SVP_DRC
- if (PicoOpt & POPT_EN_DRC) {
+ if (PicoIn.opt & POPT_EN_DRC) {
if (ssp1601_dyn_startup())
return;
svp_dyn_ready = 1;
svp_states[1].ptr = svp->dram;
svp_states[2].ptr = &svp->ssp1601;
carthw_chunks = svp_states;
- PicoAHW |= PAHW_SVP;
+ PicoIn.AHW |= PAHW_SVP;
}
pcd_event_schedule(cycles, PCD_EVENT_GFX, 5 * w * lines);
}
- if (PicoOpt & POPT_EN_MCD_GFX)
+ if (PicoIn.opt & POPT_EN_MCD_GFX)
{
/* render lines */
while (lines--)
// reset button doesn't affect MCD hardware
// use Pico.sv.data for RAM cart
- if (PicoOpt & POPT_EN_MCD_RAMCART) {
+ if (PicoIn.opt & POPT_EN_MCD_RAMCART) {
if (Pico.sv.data == NULL)
Pico.sv.data = calloc(1, 0x12000);
}
\r
// main68k map (BIOS mapped by PicoMemSetup()):\r
// RAM cart\r
- if (PicoOpt & POPT_EN_MCD_RAMCART) {\r
+ if (PicoIn.opt & POPT_EN_MCD_RAMCART) {\r
cpu68k_map_set(m68k_read8_map, 0x400000, 0x7fffff, PicoReadM68k8_ramc, 1);\r
cpu68k_map_set(m68k_read16_map, 0x400000, 0x7fffff, PicoReadM68k16_ramc, 1);\r
cpu68k_map_set(m68k_write8_map, 0x400000, 0x7fffff, PicoWriteM68k8_ramc, 1);\r
pcd_pcm_sync(SekCyclesDoneS68k());
- if (!Pico_mcd->pcm_mixbuf_dirty || !(PicoOpt & POPT_EN_MCD_PCM))
+ if (!Pico_mcd->pcm_mixbuf_dirty || !(PicoIn.opt & POPT_EN_MCD_PCM))
goto out;
step = (Pico_mcd->pcm_mixpos << 16) / length;
int x, y;
Pico.m.dirtyPal = 1;
- if (PicoAHW & PAHW_SMS)
+ if (PicoIn.AHW & PAHW_SMS)
PicoDoHighPal555M4();
else
PicoDoHighPal555(1, 0, est);
dump_ram_noswab(PicoMem.zram, "dumps/zram.bin");
dump_ram(PicoMem.cram, "dumps/cram.bin");
- if (PicoAHW & PAHW_SMS)
+ if (PicoIn.AHW & PAHW_SMS)
{
dump_ram_noswab(PicoMem.vramb, "dumps/vram.bin");
}
dump_ram(PicoMem.vsram,"dumps/vsram.bin");
}
- if (PicoAHW & PAHW_MCD)
+ if (PicoIn.AHW & PAHW_MCD)
{
dump_ram(Pico_mcd->prg_ram, "dumps/prg_ram.bin");
if (Pico_mcd->s68k_regs[3]&4) // 1M mode?
}
#ifndef NO_32X
- if (PicoAHW & PAHW_32X)
+ if (PicoIn.AHW & PAHW_32X)
{
dump_ram(Pico32xMem->sdram, "dumps/sdram.bin");
dump_ram(Pico32xMem->dram[0], "dumps/dram0.bin");
{
int lines, line_sample;
- if (PicoAHW & PAHW_SMS)
+ if (PicoIn.AHW & PAHW_SMS)
return;
if (Pico.m.pal) {
z80_resetCycles();
PsndStartFrame();
- if (/*Pico.m.z80Run &&*/ !Pico.m.z80_reset && (PicoOpt&POPT_EN_Z80))
+ if (/*Pico.m.z80Run &&*/ !Pico.m.z80_reset && (PicoIn.opt&POPT_EN_Z80))
PicoSyncZ80(Pico.t.m68c_cnt + line_sample * 488);
if (PsndOut)
PsndGetSamples(line_sample);
- if (/*Pico.m.z80Run &&*/ !Pico.m.z80_reset && (PicoOpt&POPT_EN_Z80)) {
+ if (/*Pico.m.z80Run &&*/ !Pico.m.z80_reset && (PicoIn.opt&POPT_EN_Z80)) {
PicoSyncZ80(Pico.t.m68c_cnt + 224 * 488);
z80_int();
}
PsndGetSamples(224);
// sync z80
- if (/*Pico.m.z80Run &&*/ !Pico.m.z80_reset && (PicoOpt&POPT_EN_Z80)) {
+ if (/*Pico.m.z80Run &&*/ !Pico.m.z80_reset && (PicoIn.opt&POPT_EN_Z80)) {
Pico.t.m68c_cnt += Pico.m.pal ? 151809 : 127671; // cycles adjusted for converter
PicoSyncZ80(Pico.t.m68c_cnt);
}
void PDebugCPUStep(void)
{
- if (PicoAHW & PAHW_SMS)
+ if (PicoIn.AHW & PAHW_SMS)
z80_run_nr(1);
else
SekStepM68k();
\r
if (!(Pico.video.reg[12]&1))\r
max_sprites = 64, max_line_sprites = 16, max_width = 264;\r
- if (PicoOpt & POPT_DIS_SPRITE_LIM)\r
+ if (PicoIn.opt & POPT_DIS_SPRITE_LIM)\r
max_line_sprites = MAX_LINE_SPRITES;\r
\r
if (pvid->reg[1]&8) max_lines = 240;\r
if (Pico.video.reg[12]&1) {\r
len = 320;\r
} else {\r
- if (!(PicoOpt&POPT_DIS_32C_BORDER)) pd+=32;\r
+ if (!(PicoIn.opt&POPT_DIS_32C_BORDER)) pd+=32;\r
len = 256;\r
}\r
\r
if (Pico.video.reg[12]&1) {\r
len = 320;\r
} else {\r
- if (!(PicoOpt & POPT_DIS_32C_BORDER))\r
+ if (!(PicoIn.opt & POPT_DIS_32C_BORDER))\r
pd += 32;\r
len = 256;\r
}\r
else if (est->rendstatus & PDRAW_INTERLACE)\r
DrawAllSpritesInterlace(1, sh);\r
// have sprites without layer pri bit ontop of sprites with that bit\r
- else if ((sprited[1] & 0xd0) == 0xd0 && (PicoOpt & POPT_ACC_SPRITES))\r
+ else if ((sprited[1] & 0xd0) == 0xd0 && (PicoIn.opt & POPT_ACC_SPRITES))\r
DrawSpritesHiAS(sprited, sh);\r
else if (sh && (sprited[1] & SPRL_MAY_HAVE_OP))\r
DrawSpritesSHi(sprited, est);\r
Pico.est.DrawScanline = 0;\r
skip_next_line = 0;\r
\r
- if (PicoOpt & POPT_ALT_RENDERER)\r
+ if (PicoIn.opt & POPT_ALT_RENDERER)\r
return;\r
\r
if (Pico.m.dirtyPal)\r
{\r
struct PicoEState *est = &Pico.est;\r
int sh = (Pico.video.reg[0xC] & 8) >> 3; // shadow/hilight?\r
- if (PicoOpt & POPT_ALT_RENDERER)\r
+ if (PicoIn.opt & POPT_ALT_RENDERER)\r
sh = 0; // no s/h support\r
\r
PicoDoHighPal555(sh, 0, &Pico.est);\r
break;\r
\r
case PDF_RGB555:\r
- if ((PicoAHW & PAHW_32X) && use_32x_line_mode)\r
+ if ((PicoIn.AHW & PAHW_32X) && use_32x_line_mode)\r
FinalizeLine = FinalizeLine32xRGB555;\r
else\r
FinalizeLine = FinalizeLine555;\r
PicoScan32xBegin = NULL;\r
PicoScan32xEnd = NULL;\r
\r
- if ((PicoAHW & PAHW_32X) && FinalizeLine != FinalizeLine32xRGB555) {\r
+ if ((PicoIn.AHW & PAHW_32X) && FinalizeLine != FinalizeLine32xRGB555) {\r
PicoScan32xBegin = begin;\r
PicoScan32xEnd = end;\r
}\r
if (media_type == PM_BAD_DETECT)
goto out;
- if ((PicoAHW & PAHW_MCD) && Pico_mcd != NULL)
+ if ((PicoIn.AHW & PAHW_MCD) && Pico_mcd != NULL)
cdd_unload();
PicoCartUnload();
- PicoAHW = 0;
- PicoQuirks = 0;
+ PicoIn.AHW = 0;
+ PicoIn.quirks = 0;
if (media_type == PM_CD)
{
goto out;
}
- PicoAHW |= PAHW_MCD;
+ PicoIn.AHW |= PAHW_MCD;
}
else {
media_type = PM_BAD_CD;
}
else if (media_type == PM_MARK3) {
lprintf("detected SMS ROM\n");
- PicoAHW = PAHW_SMS;
+ PicoIn.AHW = PAHW_SMS;
}
rom = pm_open(rom_fname);
goto out;
}
- ret = PicoCartLoad(rom, &rom_data, &rom_size, (PicoAHW & PAHW_SMS) ? 1 : 0);
+ ret = PicoCartLoad(rom, &rom_data, &rom_size, (PicoIn.AHW & PAHW_SMS) ? 1 : 0);
pm_close(rom);
if (ret != 0) {
if (ret == 2) lprintf("Out of memory\n");
goto out;
}
- if (!(PicoAHW & PAHW_SMS)) {
+ if (!(PicoIn.AHW & PAHW_SMS)) {
unsigned short *d = (unsigned short *)(rom_data + 4);
if ((((d[0] << 16) | d[1]) & 0xffffff) >= (int)rom_size) {
lprintf("bad reset vector\n");
}
// load config for this ROM (do this before insert to get correct region)
- if (!(PicoAHW & PAHW_MCD)) {
+ if (!(PicoIn.AHW & PAHW_MCD)) {
memcpy(media_id_header, rom_data + 0x100, sizeof(media_id_header));
if (do_region_override != NULL)
do_region_override(filename);
Pico.m.ncart_in = 1;
}
- if (PicoQuirks & PQUIRK_FORCE_6BTN)
+ if (PicoIn.quirks & PQUIRK_FORCE_6BTN)
PicoSetInputDevice(0, PICO_INPUT_PAD_6BTN);
out:
\r
static u32 read_pad_3btn(int i, u32 out_bits)\r
{\r
- u32 pad = ~PicoPadInt[i]; // Get inverse of pad MXYZ SACB RLDU\r
+ u32 pad = ~PicoIn.padInt[i]; // Get inverse of pad MXYZ SACB RLDU\r
u32 value;\r
\r
if (out_bits & 0x40) // TH\r
\r
static u32 read_pad_6btn(int i, u32 out_bits)\r
{\r
- u32 pad = ~PicoPadInt[i]; // Get inverse of pad MXYZ SACB RLDU\r
+ u32 pad = ~PicoIn.padInt[i]; // Get inverse of pad MXYZ SACB RLDU\r
int phase = Pico.m.padTHPhase[i];\r
u32 value;\r
\r
}\r
else\r
{\r
- if ((PicoOpt&POPT_EN_Z80) && !Pico.m.z80_reset) {\r
+ if ((PicoIn.opt & POPT_EN_Z80) && !Pico.m.z80_reset) {\r
pprof_start(m68k);\r
PicoSyncZ80(SekCyclesDone());\r
pprof_end_sub(m68k);\r
{\r
if (d)\r
{\r
- if ((PicoOpt&POPT_EN_Z80) && Pico.m.z80Run) {\r
+ if ((PicoIn.opt & POPT_EN_Z80) && Pico.m.z80Run) {\r
pprof_start(m68k);\r
PicoSyncZ80(SekCyclesDone());\r
pprof_end_sub(m68k);\r
return;\r
}\r
if ((a & 0x6000) == 0x4000) { // FM Sound\r
- if (PicoOpt & POPT_EN_FM)\r
- emustatus |= ym2612_write_local(a&3, d&0xff, 0)&1;\r
+ if (PicoIn.opt & POPT_EN_FM)\r
+ Pico.m.status |= ym2612_write_local(a & 3, d & 0xff, 0) & 1;\r
return;\r
}\r
// TODO: probably other VDP access too? Maybe more mirrors?\r
goto end;\r
}\r
\r
- if (PicoOpt & POPT_EN_32X) {\r
- d = PicoRead8_32x(a);\r
- goto end;\r
- }\r
+ d = PicoRead8_32x(a);\r
\r
- d = m68k_unmapped_read8(a);\r
end:\r
return d;\r
}\r
goto end;\r
}\r
\r
- if (PicoOpt & POPT_EN_32X) {\r
- d = PicoRead16_32x(a);\r
- goto end;\r
- }\r
+ d = PicoRead16_32x(a);\r
\r
- d = m68k_unmapped_read16(a);\r
end:\r
return d;\r
}\r
Pico.m.sram_reg |= (u8)(d & 3);\r
return;\r
}\r
- if (PicoOpt & POPT_EN_32X) {\r
- PicoWrite8_32x(a, d);\r
- return;\r
- }\r
-\r
- m68k_unmapped_write8(a, d);\r
+ PicoWrite8_32x(a, d);\r
}\r
\r
void PicoWrite16_io(u32 a, u32 d)\r
Pico.m.sram_reg |= (u8)(d & 3);\r
return;\r
}\r
- if (PicoOpt & POPT_EN_32X) {\r
- PicoWrite16_32x(a, d);\r
- return;\r
- }\r
- m68k_unmapped_write16(a, d);\r
+ PicoWrite16_32x(a, d);\r
}\r
\r
#endif // _ASM_MEMORY_C\r
ym2612.OPN.ST.address = d;\r
ym2612.addr_A1 = 0;\r
#ifdef __GP2X__\r
- if (PicoOpt & POPT_EXT_FM) YM2612Write_940(a, d, -1);\r
+ if (PicoIn.opt & POPT_EXT_FM) YM2612Write_940(a, d, -1);\r
#endif\r
return 0;\r
\r
\r
if ((d ^ old_mode) & 0xc0) {\r
#ifdef __GP2X__\r
- if (PicoOpt & POPT_EXT_FM) return YM2612Write_940(a, d, get_scanline(is_from_z80));\r
+ if (PicoIn.opt & POPT_EXT_FM) return YM2612Write_940(a, d, get_scanline(is_from_z80));\r
#endif\r
return 1;\r
}\r
PsndDacLine = scanline;\r
}\r
#ifdef __GP2X__\r
- if (PicoOpt & POPT_EXT_FM) YM2612Write_940(a, d, scanline);\r
+ if (PicoIn.opt & POPT_EXT_FM) YM2612Write_940(a, d, scanline);\r
#endif\r
return 0;\r
}\r
ym2612.OPN.ST.address = d;\r
ym2612.addr_A1 = 1;\r
#ifdef __GP2X__\r
- if (PicoOpt & POPT_EXT_FM) YM2612Write_940(a, d, -1);\r
+ if (PicoIn.opt & POPT_EXT_FM) YM2612Write_940(a, d, -1);\r
#endif\r
return 0;\r
\r
}\r
\r
#ifdef __GP2X__\r
- if (PicoOpt & POPT_EXT_FM)\r
+ if (PicoIn.opt & POPT_EXT_FM)\r
return YM2612Write_940(a, d, get_scanline(is_from_z80));\r
#endif\r
return YM2612Write_(a, d);\r
elprintf(EL_YMTIMER, "save: timer b %i/%i", tbt >> 16, tbc);\r
\r
#ifdef __GP2X__\r
- if (PicoOpt & POPT_EXT_FM)\r
+ if (PicoIn.opt & POPT_EXT_FM)\r
YM2612PicoStateSave2_940(tat, tbt);\r
else\r
#endif\r
}\r
\r
#ifdef __GP2X__\r
- if (PicoOpt & POPT_EXT_FM)\r
+ if (PicoIn.opt & POPT_EXT_FM)\r
ret = YM2612PicoStateLoad2_940(&tat, &tbt);\r
else\r
#endif\r
\r
static void z80_md_ym2612_write(unsigned int a, unsigned char data)\r
{\r
- if (PicoOpt & POPT_EN_FM)\r
- emustatus |= ym2612_write_local(a, data, 1) & 1;\r
+ if (PicoIn.opt & POPT_EN_FM)\r
+ Pico.m.status |= ym2612_write_local(a, data, 1) & 1;\r
}\r
\r
static void z80_md_vdp_br_write(unsigned int a, unsigned char data)\r
m_read8_not_io:\r
and r2, r0, #0xfc00\r
cmp r2, #0x1000\r
- bne m_read8_not_brq\r
+ bne PicoRead8_32x\r
\r
ldr r3, =Pico\r
mov r1, r0\r
orr r0, r0, r2\r
bx lr\r
\r
-m_read8_not_brq:\r
- ldr r2, =PicoOpt\r
- ldr r2, [r2]\r
- tst r2, #POPT_EN_32X\r
- bne PicoRead8_32x\r
- mov r0, #0\r
- bx lr\r
-\r
@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r
\r
PicoRead16_sram: @ u32 a, u32 d\r
m_read16_not_io:\r
and r2, r0, #0xfc00\r
cmp r2, #0x1000\r
- bne m_read16_not_brq\r
+ bne PicoRead16_32x\r
\r
ldr r3, =Pico\r
and r2, r0, #0xff00\r
orr r0, r0, r2, lsl #8\r
bx lr\r
\r
-m_read16_not_brq:\r
- ldr r2, =PicoOpt\r
- ldr r2, [r2]\r
- tst r2, #POPT_EN_32X\r
- bne PicoRead16_32x\r
- mov r0, #0\r
- bx lr\r
-\r
@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r
\r
PicoWrite8_io: @ u32 a, u32 d\r
eor r2, r0, #0xa10000\r
eor r2, r2, #0x003000\r
eors r2, r2, #0x0000f1\r
- bne m_write8_not_sreg\r
+ bne PicoWrite8_32x\r
ldr r3, =Pico\r
ldrb r2, [r3, #OFS_Pico_m_sram_reg]\r
and r1, r1, #(SRR_MAPPED|SRR_READONLY)\r
strb r2, [r3, #OFS_Pico_m_sram_reg]\r
bx lr\r
\r
-m_write8_not_sreg:\r
- ldr r2, =PicoOpt\r
- ldr r2, [r2]\r
- tst r2, #POPT_EN_32X\r
- bne PicoWrite8_32x\r
- bx lr\r
-\r
@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r
\r
PicoWrite16_io: @ u32 a, u32 d\r
eor r2, r0, #0xa10000\r
eor r2, r2, #0x003000\r
eors r2, r2, #0x0000f0\r
- bne m_write16_not_sreg\r
+ bne PicoWrite16_32x\r
ldr r3, =Pico\r
ldrb r2, [r3, #OFS_Pico_m_sram_reg]\r
and r1, r1, #(SRR_MAPPED|SRR_READONLY)\r
strb r2, [r3, #OFS_Pico_m_sram_reg]\r
bx lr\r
\r
-m_write16_not_sreg:\r
- ldr r2, =PicoOpt\r
- ldr r2, [r2]\r
- tst r2, #POPT_EN_32X\r
- bne PicoWrite16_32x\r
- bx lr\r
-\r
.pool\r
\r
@ vim:filetype=armasm\r
{
unsigned char *pd = Pico.est.DrawLineDest;
- if (!(PicoOpt & POPT_DIS_32C_BORDER))
+ if (!(PicoIn.opt & POPT_DIS_32C_BORDER))
pd += 32;
memcpy(pd, Pico.est.HighCol + 8, 256);
/* Initialize the result */
result->addr = result->data = result->comp = 0;
- if(!(PicoAHW & PAHW_SMS))
+ if(!(PicoIn.AHW & PAHW_SMS))
{
//If Genesis
PicoPatches[i].data_old = *(unsigned short *)(Pico.rom + addr);
else
{
- if(!(PicoAHW & PAHW_SMS))
+ if(!(PicoIn.AHW & PAHW_SMS))
PicoPatches[i].data_old = (unsigned short) m68k_read16(addr);
else
;// wrong: PicoPatches[i].data_old = (unsigned char) PicoRead8_z80(addr);
{
if (PicoPatches[i].active)
{
- if (!(PicoAHW & PAHW_SMS))
+ if (!(PicoIn.AHW & PAHW_SMS))
*(unsigned short *)(Pico.rom + addr) = PicoPatches[i].data;
else if (!PicoPatches[i].comp || PicoPatches[i].comp == *(char *)(Pico.rom + addr))
*(char *)(Pico.rom + addr) = (char) PicoPatches[i].data;
if (PicoPatches[u].addr == addr) break;
if (u == i)
{
- if (!(PicoAHW & PAHW_SMS))
+ if (!(PicoIn.AHW & PAHW_SMS))
*(unsigned short *)(Pico.rom + addr) = PicoPatches[i].data_old;
else
*(char *)(Pico.rom + addr) = (char) PicoPatches[i].data_old;
{
if (PicoPatches[i].active)
{
- if (!(PicoAHW & PAHW_SMS))
+ if (!(PicoIn.AHW & PAHW_SMS))
m68k_write16(addr,PicoPatches[i].data);
else
;// wrong: PicoWrite8_z80(addr,PicoPatches[i].data);
if (PicoPatches[u].addr == addr) break;
if (u == i)
{
- if (!(PicoAHW & PAHW_SMS))
+ if (!(PicoIn.AHW & PAHW_SMS))
m68k_write16(PicoPatches[i].addr,PicoPatches[i].data_old);
else
;// wrong: PicoWrite8_z80(PicoPatches[i].addr,PicoPatches[i].data_old);
\r
struct Pico Pico;\r
struct PicoMem PicoMem;\r
-int PicoOpt; \r
-int PicoSkipFrame; // skip rendering frame?\r
-int PicoPad[2]; // Joypads, format is MXYZ SACB RLDU\r
-int PicoPadInt[2]; // internal copy\r
-int PicoAHW; // active addon hardware: PAHW_*\r
-int PicoQuirks; // game-specific quirks\r
-int PicoRegionOverride; // override the region detection 0: Auto, 1: Japan NTSC, 2: Japan PAL, 4: US, 8: Europe\r
-int PicoAutoRgnOrder;\r
-\r
-int emustatus; // rapid_ym2612, multi_ym_updates\r
+PicoInterface PicoIn;\r
\r
void (*PicoWriteSound)(int len) = NULL; // called at the best time to send sound buffer (PsndOut) to hardware\r
void (*PicoResetHook)(void) = NULL;\r
// Blank space for state:\r
memset(&Pico,0,sizeof(Pico));\r
memset(&PicoMem,0,sizeof(PicoMem));\r
- memset(&PicoPad,0,sizeof(PicoPad));\r
- memset(&PicoPadInt,0,sizeof(PicoPadInt));\r
+ memset(&PicoIn.pad,0,sizeof(PicoIn.pad));\r
+ memset(&PicoIn.padInt,0,sizeof(PicoIn.padInt));\r
\r
Pico.est.Pico = &Pico;\r
Pico.est.PicoMem_vram = PicoMem.vram;\r
Pico.est.PicoMem_cram = PicoMem.cram;\r
- Pico.est.PicoOpt = &PicoOpt;\r
+ Pico.est.PicoOpt = &PicoIn.opt;\r
\r
// Init CPUs:\r
SekInit();\r
// to be called once on emu exit\r
void PicoExit(void)\r
{\r
- if (PicoAHW & PAHW_MCD)\r
+ if (PicoIn.AHW & PAHW_MCD)\r
PicoExitMCD();\r
PicoCartUnload();\r
z80_exit();\r
Pico.video.reg[0xc] = 0x81;\r
Pico.video.reg[0xf] = 0x02;\r
\r
- if (PicoAHW & PAHW_MCD)\r
+ if (PicoIn.AHW & PAHW_MCD)\r
PicoPowerMCD();\r
\r
- if (PicoOpt & POPT_EN_32X)\r
+ if (PicoIn.opt & POPT_EN_32X)\r
PicoPower32x();\r
\r
PicoReset();\r
int support=0, hw=0, i;\r
unsigned char pal=0;\r
\r
- if (PicoRegionOverride)\r
+ if (PicoIn.regionOverride)\r
{\r
- support = PicoRegionOverride;\r
+ support = PicoIn.regionOverride;\r
}\r
else\r
{\r
}\r
\r
// auto detection order override\r
- if (PicoAutoRgnOrder) {\r
- if (((PicoAutoRgnOrder>>0)&0xf) & support) support = (PicoAutoRgnOrder>>0)&0xf;\r
- else if (((PicoAutoRgnOrder>>4)&0xf) & support) support = (PicoAutoRgnOrder>>4)&0xf;\r
- else if (((PicoAutoRgnOrder>>8)&0xf) & support) support = (PicoAutoRgnOrder>>8)&0xf;\r
+ if (PicoIn.autoRgnOrder) {\r
+ if (((PicoIn.autoRgnOrder>>0)&0xf) & support) support = (PicoIn.autoRgnOrder>>0)&0xf;\r
+ else if (((PicoIn.autoRgnOrder>>4)&0xf) & support) support = (PicoIn.autoRgnOrder>>4)&0xf;\r
+ else if (((PicoIn.autoRgnOrder>>8)&0xf) & support) support = (PicoIn.autoRgnOrder>>8)&0xf;\r
}\r
\r
// Try to pick the best hardware value for English/50hz:\r
return 1;\r
\r
#if defined(CPU_CMP_R) || defined(CPU_CMP_W) || defined(DRC_CMP)\r
- PicoOpt |= POPT_DIS_VDP_FIFO|POPT_DIS_IDLE_DET;\r
+ PicoIn.opt |= POPT_DIS_VDP_FIFO|POPT_DIS_IDLE_DET;\r
#endif\r
\r
/* must call now, so that banking is reset, and correct vectors get fetched */\r
if (PicoResetHook)\r
PicoResetHook();\r
\r
- memset(&PicoPadInt,0,sizeof(PicoPadInt));\r
- emustatus = 0;\r
+ memset(&PicoIn.padInt, 0, sizeof(PicoIn.padInt));\r
\r
- if (PicoAHW & PAHW_SMS) {\r
+ if (PicoIn.AHW & PAHW_SMS) {\r
PicoResetMS();\r
return 0;\r
}\r
// ..but do not reset SekCycle* to not desync with addons\r
\r
// s68k doesn't have the TAS quirk, so we just globally set normal TAS handler in MCD mode (used by Batman games).\r
- SekSetRealTAS(PicoAHW & PAHW_MCD);\r
+ SekSetRealTAS(PicoIn.AHW & PAHW_MCD);\r
\r
Pico.m.dirtyPal = 1;\r
\r
PsndReset(); // pal must be known here\r
\r
// create an empty "dma" to cause 68k exec start at random frame location\r
- if (Pico.m.dma_xfers == 0 && !(PicoOpt & POPT_DIS_VDP_FIFO))\r
+ if (Pico.m.dma_xfers == 0 && !(PicoIn.opt & POPT_DIS_VDP_FIFO))\r
Pico.m.dma_xfers = rand() & 0x1fff;\r
\r
SekFinishIdleDet();\r
\r
- if (PicoAHW & PAHW_MCD) {\r
+ if (PicoIn.AHW & PAHW_MCD) {\r
PicoResetMCD();\r
return 0;\r
}\r
\r
// reinit, so that checksum checks pass\r
- if (!(PicoOpt & POPT_DIS_IDLE_DET))\r
+ if (!(PicoIn.opt & POPT_DIS_IDLE_DET))\r
SekInitIdleDet();\r
\r
- if (PicoOpt & POPT_EN_32X)\r
+ if (PicoIn.opt & POPT_EN_32X)\r
PicoReset32x();\r
\r
// reset sram state; enable sram access by default if it doesn't overlap with ROM\r
// flush config changes before emu loop starts\r
void PicoLoopPrepare(void)\r
{\r
- if (PicoRegionOverride)\r
+ if (PicoIn.regionOverride)\r
// force setting possibly changed..\r
- Pico.m.pal = (PicoRegionOverride == 2 || PicoRegionOverride == 8) ? 1 : 0;\r
+ Pico.m.pal = (PicoIn.regionOverride == 2 || PicoIn.regionOverride == 8) ? 1 : 0;\r
\r
Pico.m.dirtyPal = 1;\r
rendstatus_old = -1;\r
\r
Pico.m.frame_count++;\r
\r
- if (PicoAHW & PAHW_SMS) {\r
+ if (PicoIn.AHW & PAHW_SMS) {\r
PicoFrameMS();\r
goto end;\r
}\r
\r
- if (PicoAHW & PAHW_32X) {\r
+ if (PicoIn.AHW & PAHW_32X) {\r
PicoFrame32x(); // also does MCD+32X\r
goto end;\r
}\r
\r
- if (PicoAHW & PAHW_MCD) {\r
+ if (PicoIn.AHW & PAHW_MCD) {\r
PicoFrameMCD();\r
goto end;\r
}\r
\r
void PicoFrameDrawOnly(void)\r
{\r
- if (!(PicoAHW & PAHW_SMS)) {\r
+ if (!(PicoIn.AHW & PAHW_SMS)) {\r
PicoFrameStart();\r
PicoDrawSync(223, 0);\r
} else {\r
#define POPT_DIS_IDLE_DET (1<<19)\r
#define POPT_EN_32X (1<<20)\r
#define POPT_EN_PWM (1<<21)\r
-extern int PicoOpt; // bitfield\r
\r
#define PAHW_MCD (1<<0)\r
#define PAHW_32X (1<<1)\r
#define PAHW_SVP (1<<2)\r
#define PAHW_PICO (1<<3)\r
#define PAHW_SMS (1<<4)\r
-extern int PicoAHW; // Pico active hw\r
\r
#define PQUIRK_FORCE_6BTN (1<<0)\r
-extern int PicoQuirks;\r
\r
-extern int PicoSkipFrame; // skip rendering frame, but still do sound (if enabled) and emulation stuff\r
-extern int PicoRegionOverride; // override the region detection 0: auto, 1: Japan NTSC, 2: Japan PAL, 4: US, 8: Europe\r
-extern int PicoAutoRgnOrder; // packed priority list of regions, for example 0x148 means this detection order: EUR, USA, JAP\r
-extern int PicoSVPCycles;\r
+// the emulator is configured and some status is reported\r
+// through this global state (not saved in savestates)\r
+typedef struct\r
+{\r
+ unsigned int opt; // POPT_* bitfield\r
+\r
+ unsigned short pad[2]; // Joypads, format is MXYZ SACB RLDU\r
+ unsigned short padInt[2]; // internal copy\r
+ unsigned short AHW; // active addon hardware: PAHW_* bitfield\r
+\r
+ unsigned short skipFrame; // skip rendering frame, but still do sound (if enabled) and emulation stuff\r
+ unsigned short regionOverride; // override the region detection 0: auto, 1: Japan NTSC, 2: Japan PAL, 4: US, 8: Europe\r
+ unsigned short autoRgnOrder; // packed priority list of regions, for example 0x148 means this detection order: EUR, USA, JAP\r
+\r
+ unsigned short quirks; // game-specific quirks: PQUIRK_*\r
+} PicoInterface;\r
+\r
+extern PicoInterface PicoIn;\r
+\r
void PicoInit(void);\r
void PicoExit(void);\r
void PicoPower(void);\r
void PicoLoopPrepare(void);\r
void PicoFrame(void);\r
void PicoFrameDrawOnly(void);\r
-extern int PicoPad[2]; // Joypads, format is MXYZ SACB RLDU\r
extern void (*PicoWriteSound)(int bytes); // called once per frame at the best time to send sound buffer (PsndOut) to hardware\r
extern void (*PicoMessage)(const char *msg); // callback to output text message from emu\r
typedef enum { PI_ROM, PI_ISPAL, PI_IS40_CELL, PI_IS240_LINES } pint_t;\r
{
case 0x01: d = PicoPicohw.r1; break;
case 0x03:
- d = PicoPad[0]&0x1f; // d-pad
- d |= (PicoPad[0]&0x20) << 2; // pen push -> C
+ d = PicoIn.pad[0]&0x1f; // d-pad
+ d |= (PicoIn.pad[0]&0x20) << 2; // pen push -> C
d = ~d;
break;
PicoLineHook = PicoLinePico;
PicoResetHook = PicoResetPico;
- PicoAHW = PAHW_PICO;
+ PicoIn.AHW = PAHW_PICO;
memset(&PicoPicohw, 0, sizeof(PicoPicohw));
PicoPicohw.pen_pos[0] = 0x03c + 320/2;
PicoPicohw.pen_pos[1] = 0x200 + 240/2;
pevt_log_m68k_o(EVT_FRAME_START);
- if ((PicoOpt&POPT_ALT_RENDERER) && !PicoSkipFrame && (pv->reg[1]&0x40)) { // fast rend., display enabled
+ if ((PicoIn.opt&POPT_ALT_RENDERER) && !PicoIn.skipFrame && (pv->reg[1]&0x40)) { // fast rend., display enabled
// draw a frame just after vblank in alternative render mode
// yes, this will cause 1 frame lag, but this is inaccurate mode anyway.
PicoFrameFull();
#endif
skip = 1;
}
- else skip=PicoSkipFrame;
+ else skip=PicoIn.skipFrame;
Pico.t.m68c_frame_start = Pico.t.m68c_aim;
pv->v_counter = Pico.m.scanline = 0;
}
// decide if we draw this line
- if (!skip && (PicoOpt & POPT_ALT_RENDERER))
+ if (!skip && (PicoIn.opt & POPT_ALT_RENDERER))
{
// find the right moment for frame renderer, when display is no longer blanked
if ((pv->reg[1]&0x40) || y > 100) {
{
cycles = SekCyclesDone();
- if (Pico.m.z80Run && !Pico.m.z80_reset && (PicoOpt&POPT_EN_Z80))
+ if (Pico.m.z80Run && !Pico.m.z80_reset && (PicoIn.opt&POPT_EN_Z80))
PicoSyncZ80(cycles);
#ifdef PICO_CD
- if (PicoAHW & PAHW_MCD)
+ if (PicoIn.AHW & PAHW_MCD)
pcd_sync_s68k(cycles, 0);
#endif
#ifdef PICO_32X
pv->lwrite_cnt = 0;
Pico.video.status |= SR_EMPT;
- memcpy(PicoPadInt, PicoPad, sizeof(PicoPadInt));
+ memcpy(PicoIn.padInt, PicoIn.pad, sizeof(PicoIn.padInt));
PAD_DELAY();
// Last H-Int (normally):
}
cycles = SekCyclesDone();
- if (Pico.m.z80Run && !Pico.m.z80_reset && (PicoOpt&POPT_EN_Z80)) {
+ if (Pico.m.z80Run && !Pico.m.z80_reset && (PicoIn.opt&POPT_EN_Z80)) {
PicoSyncZ80(cycles);
elprintf(EL_INTS, "zint");
z80_int();
}
#ifdef PICO_CD
- if (PicoAHW & PAHW_MCD)
+ if (PicoIn.AHW & PAHW_MCD)
pcd_sync_s68k(cycles, 0);
#endif
#ifdef PICO_32X
// sync cpus
cycles = SekCyclesDone();
- if (Pico.m.z80Run && !Pico.m.z80_reset && (PicoOpt&POPT_EN_Z80))
+ if (Pico.m.z80Run && !Pico.m.z80_reset && (PicoIn.opt&POPT_EN_Z80))
PicoSyncZ80(cycles);
if (PsndOut && ym2612.dacen && PsndDacLine < lines)
PsndDoDAC(lines - 1);
PsndDoPSG(lines - 1);
#ifdef PICO_CD
- if (PicoAHW & PAHW_MCD)
+ if (PicoIn.AHW & PAHW_MCD)
pcd_sync_s68k(cycles, 0);
#endif
#ifdef PICO_32X
unsigned char eeprom_cycle; // EEPROM cycle number\r
unsigned char eeprom_slave; // EEPROM slave word for X24C02 and better SRAMs\r
unsigned char eeprom_status;\r
- unsigned char pad2;\r
+ unsigned char status; // rapid_ym2612, multi_ym_updates\r
unsigned short dma_xfers; // 18\r
unsigned char eeprom_wb[2]; // EEPROM latch/write buffer\r
unsigned int frame_count; // 1c for movies and idle det\r
struct Pico *Pico;\r
void *PicoMem_vram;\r
void *PicoMem_cram;\r
- int *PicoOpt;\r
+ unsigned int *PicoOpt;\r
unsigned char *Draw2FB;\r
unsigned short HighPal[0x100];\r
};\r
// pico.c\r
extern struct Pico Pico;\r
extern struct PicoMem PicoMem;\r
-extern int PicoPadInt[2];\r
-extern int emustatus;\r
extern void (*PicoResetHook)(void);\r
extern void (*PicoLineHook)(void);\r
PICO_INTERNAL int CheckDMA(void);\r
(*dst & 0xc1ff) == 0x0038 || // move.x ($xxxx.w), dX\r
(*dst & 0xf13f) == 0xb038) // cmp.x ($xxxx.w), dX\r
return 1;\r
- if (PicoAHW & (PAHW_MCD|PAHW_32X))\r
+ if (PicoIn.AHW & (PAHW_MCD|PAHW_32X))\r
break;\r
// with no addons, there should be no need to wait\r
// for byte change anywhere\r
return 1;\r
break;\r
case 12:\r
- if (PicoAHW & (PAHW_MCD|PAHW_32X))\r
+ if (PicoIn.AHW & (PAHW_MCD|PAHW_32X))\r
break;\r
if ( (*dst & 0xf1f8) == 0x3010 && // move.w (aX), dX\r
(dst[1]&0xf100) == 0x0000 && // arithmetic\r
break;
case 0xc0: /* I/O port A and B */
- d = ~((PicoPad[0] & 0x3f) | (PicoPad[1] << 6));
+ d = ~((PicoIn.pad[0] & 0x3f) | (PicoIn.pad[1] << 6));
break;
case 0xc1: /* I/O port B and miscellaneous */
d = (Pico.ms.io_ctl & 0x80) | ((Pico.ms.io_ctl << 1) & 0x40) | 0x30;
- d |= ~(PicoPad[1] >> 2) & 0x0f;
+ d |= ~(PicoIn.pad[1] >> 2) & 0x0f;
break;
}
case 0x40:
case 0x41:
- if (PicoOpt & POPT_EN_PSG)
+ if (PicoIn.opt & POPT_EN_PSG)
SN76496Write(d);
break;
int lines = is_pal ? 313 : 262;
int cycles_line = is_pal ? 58020 : 58293; /* (226.6 : 227.7) * 256 */
int cycles_done = 0, cycles_aim = 0;
- int skip = PicoSkipFrame;
+ int skip = PicoIn.skipFrame;
int lines_vis = 192;
int hint; // Hint counter
int nmi;
PsndStartFrame();
- nmi = (PicoPad[0] >> 7) & 1;
+ nmi = (PicoIn.pad[0] >> 7) & 1;
if (!Pico.ms.nmi_state && nmi)
z80_nmi();
Pico.ms.nmi_state = nmi;
PsndClear();\r
\r
// set mixer\r
- PsndMix_32_to_16l = (PicoOpt & POPT_EN_STEREO) ? mix_32_to_16l_stereo : mix_32_to_16_mono;\r
+ PsndMix_32_to_16l = (PicoIn.opt & POPT_EN_STEREO) ? mix_32_to_16l_stereo : mix_32_to_16_mono;\r
\r
- if (PicoAHW & PAHW_PICO)\r
+ if (PicoIn.AHW & PAHW_PICO)\r
PicoReratePico();\r
}\r
\r
}\r
\r
PsndDacLine = PsndPsgLine = 0;\r
- emustatus &= ~1;\r
+ Pico.m.status &= ~1;\r
dac_info[224] = PsndLen_use;\r
}\r
\r
if (!PsndOut)\r
return;\r
\r
- if (PicoOpt & POPT_EN_STEREO) {\r
+ if (PicoIn.opt & POPT_EN_STEREO) {\r
short *d = PsndOut + pos*2;\r
for (; len > 0; len--, d+=2) *d += dout;\r
} else {\r
\r
PsndPsgLine = line_to + 1;\r
\r
- if (!PsndOut || !(PicoOpt & POPT_EN_PSG))\r
+ if (!PsndOut || !(PicoIn.opt & POPT_EN_PSG))\r
return;\r
\r
- if (PicoOpt & POPT_EN_STEREO) {\r
+ if (PicoIn.opt & POPT_EN_STEREO) {\r
stereo = 1;\r
pos <<= 1;\r
}\r
{\r
int len = PsndLen;\r
if (PsndLen_exc_add) len++;\r
- if (PicoOpt & POPT_EN_STEREO)\r
+ if (PicoIn.opt & POPT_EN_STEREO)\r
memset32((int *) PsndOut, 0, len); // assume PsndOut to be aligned\r
else {\r
short *out = PsndOut;\r
{\r
int buf32_updated = 0;\r
int *buf32 = PsndBuffer+offset;\r
- int stereo = (PicoOpt & 8) >> 3;\r
+ int stereo = (PicoIn.opt & 8) >> 3;\r
\r
offset <<= stereo;\r
\r
pprof_start(sound);\r
\r
- if (PicoAHW & PAHW_PICO) {\r
+ if (PicoIn.AHW & PAHW_PICO) {\r
PicoPicoPCMUpdate(PsndOut+offset, length, stereo);\r
return length;\r
}\r
\r
// Add in the stereo FM buffer\r
- if (PicoOpt & POPT_EN_FM) {\r
+ if (PicoIn.opt & POPT_EN_FM) {\r
buf32_updated = YM2612UpdateOne(buf32, length, stereo, 1);\r
} else\r
memset32(buf32, 0, length<<stereo);\r
(void)buf32_updated;\r
\r
// CD: PCM sound\r
- if (PicoAHW & PAHW_MCD) {\r
+ if (PicoIn.AHW & PAHW_MCD) {\r
pcd_pcm_update(buf32, length, stereo);\r
//buf32_updated = 1;\r
}\r
\r
// CD: CDDA audio\r
// CD mode, cdda enabled, not data track, CDC is reading\r
- if ((PicoAHW & PAHW_MCD) && (PicoOpt & POPT_EN_MCD_CDDA)\r
+ if ((PicoIn.AHW & PAHW_MCD) && (PicoIn.opt & POPT_EN_MCD_CDDA)\r
&& Pico_mcd->cdda_stream != NULL\r
&& !(Pico_mcd->s68k_regs[0x36] & 1))\r
{\r
cdda_raw_update(buf32, length);\r
}\r
\r
- if ((PicoAHW & PAHW_32X) && (PicoOpt & POPT_EN_PWM))\r
+ if ((PicoIn.AHW & PAHW_32X) && (PicoIn.opt & POPT_EN_PWM))\r
p32x_pwm_update(buf32, length, stereo);\r
\r
// convert + limit to normal 16bit output\r
\r
if (y == 224)\r
{\r
- if (emustatus & 2)\r
+ if (Pico.m.status & 2)\r
curr_pos += PsndRender(curr_pos, PsndLen-PsndLen/2);\r
else curr_pos = PsndRender(0, PsndLen_use);\r
- if (emustatus & 1)\r
- emustatus |= 2;\r
- else emustatus &= ~2;\r
+ if (Pico.m.status & 1)\r
+ Pico.m.status |= 2;\r
+ else Pico.m.status &= ~2;\r
if (PicoWriteSound)\r
- PicoWriteSound(curr_pos * ((PicoOpt & POPT_EN_STEREO) ? 4 : 2));\r
+ PicoWriteSound(curr_pos * ((PicoIn.opt & POPT_EN_STEREO) ? 4 : 2));\r
// clear sound buffer\r
PsndClear();\r
PsndDacLine = 224;\r
dac_info[224] = 0;\r
}\r
- else if (emustatus & 3) {\r
- emustatus|= 2;\r
- emustatus&=~1;\r
+ else if (Pico.m.status & 3) {\r
+ Pico.m.status |= 2;\r
+ Pico.m.status &= ~1;\r
curr_pos = PsndRender(0, PsndLen/2);\r
}\r
}\r
\r
PICO_INTERNAL void PsndGetSamplesMS(void)\r
{\r
- int stereo = (PicoOpt & 8) >> 3;\r
+ int stereo = (PicoIn.opt & 8) >> 3;\r
int length = PsndLen_use;\r
\r
// PSG\r
- if (PicoOpt & POPT_EN_PSG)\r
+ if (PicoIn.opt & POPT_EN_PSG)\r
SN76496Update(PsndOut, length, stereo);\r
\r
// upmix to "stereo" if needed\r
}\r
\r
if (PicoWriteSound != NULL)\r
- PicoWriteSound(length * ((PicoOpt & POPT_EN_STEREO) ? 4 : 2));\r
+ PicoWriteSound(length * ((PicoIn.opt & POPT_EN_STEREO) ? 4 : 2));\r
PsndClear();\r
}\r
\r
#else\r
/* GP2X specific */\r
#include "../../platform/gp2x/940ctl.h"\r
-extern int PicoOpt;\r
+extern int PicoIn.opt;\r
#define YM2612Init(baseclock,rate) { \\r
- if (PicoOpt&0x200) YM2612Init_940(baseclock, rate); \\r
+ if (PicoIn.opt&0x200) YM2612Init_940(baseclock, rate); \\r
else YM2612Init_(baseclock, rate); \\r
}\r
#define YM2612ResetChip() { \\r
- if (PicoOpt&0x200) YM2612ResetChip_940(); \\r
+ if (PicoIn.opt&0x200) YM2612ResetChip_940(); \\r
else YM2612ResetChip_(); \\r
}\r
#define YM2612UpdateOne(buffer,length,stereo,is_buf_empty) \\r
- (PicoOpt&0x200) ? YM2612UpdateOne_940(buffer, length, stereo, is_buf_empty) : \\r
+ (PicoIn.opt&0x200) ? YM2612UpdateOne_940(buffer, length, stereo, is_buf_empty) : \\r
YM2612UpdateOne_(buffer, length, stereo, is_buf_empty);\r
#define YM2612PicoStateLoad() { \\r
- if (PicoOpt&0x200) YM2612PicoStateLoad_940(); \\r
+ if (PicoIn.opt&0x200) YM2612PicoStateLoad_940(); \\r
else YM2612PicoStateLoad_(); \\r
}\r
#endif /* __GP2X__ */\r
areaWrite("PicoSEXT", 1, 8, file);\r
areaWrite(&ver, 1, 4, file);\r
\r
- if (!(PicoAHW & PAHW_SMS)) {\r
+ if (!(PicoIn.AHW & PAHW_SMS)) {\r
memset(buff, 0, sizeof(buff));\r
SekPackCpu(buff, 0);\r
CHECKED_WRITE_BUFF(CHUNK_M68K, buff);\r
CHECKED_WRITE_BUFF(CHUNK_Z80, buff_z80);\r
CHECKED_WRITE(CHUNK_PSG, 28*4, sn76496_regs);\r
\r
- if (PicoAHW & PAHW_MCD)\r
+ if (PicoIn.AHW & PAHW_MCD)\r
{\r
buf2 = malloc(CHUNK_LIMIT_W);\r
if (buf2 == NULL)\r
}\r
\r
#ifndef NO_32X\r
- if (PicoAHW & PAHW_32X)\r
+ if (PicoIn.AHW & PAHW_32X)\r
{\r
unsigned char cpubuff[SH2_STATE_SIZE];\r
\r
CHECKED_READ(1, &chunk);\r
CHECKED_READ(4, &len);\r
if (len < 0 || len > 1024*512) R_ERROR_RETURN("bad length");\r
- if (CHUNK_S68K <= chunk && chunk <= CHUNK_MISC_CD && !(PicoAHW & PAHW_MCD))\r
+ if (CHUNK_S68K <= chunk && chunk <= CHUNK_MISC_CD && !(PicoIn.AHW & PAHW_MCD))\r
R_ERROR_RETURN("cd chunk in non CD state?");\r
- if (CHUNK_32X_FIRST <= chunk && chunk <= CHUNK_32X_LAST && !(PicoAHW & PAHW_32X))\r
+ if (CHUNK_32X_FIRST <= chunk && chunk <= CHUNK_32X_LAST && !(PicoIn.AHW & PAHW_32X))\r
Pico32xStartup();\r
\r
switch (chunk)\r
}\r
\r
readend:\r
- if (PicoAHW & PAHW_SMS)\r
+ if (PicoIn.AHW & PAHW_SMS)\r
PicoStateLoadedMS();\r
\r
- if (PicoAHW & PAHW_32X)\r
+ if (PicoIn.AHW & PAHW_32X)\r
Pico32xStateLoaded(1);\r
\r
if (PicoLoadStateHook != NULL)\r
PicoLoadStateHook();\r
\r
// must unpack 68k and z80 after banks are set up\r
- if (!(PicoAHW & PAHW_SMS))\r
+ if (!(PicoIn.AHW & PAHW_SMS))\r
SekUnpackCpu(buff_m68k, 0);\r
- if (PicoAHW & PAHW_MCD)\r
+ if (PicoIn.AHW & PAHW_MCD)\r
SekUnpackCpu(buff_s68k, 1);\r
\r
z80_unpack(buff_z80);\r
\r
// due to dep from 68k cycles..\r
Pico.t.m68c_aim = Pico.t.m68c_cnt;\r
- if (PicoAHW & PAHW_32X)\r
+ if (PicoIn.AHW & PAHW_32X)\r
Pico32xStateLoaded(0);\r
- if (PicoAHW & PAHW_MCD)\r
+ if (PicoIn.AHW & PAHW_MCD)\r
{\r
SekCycleAimS68k = SekCycleCntS68k;\r
pcd_state_loaded();\r
int ver, len, found = 0, to_find = 4;\r
char buff[8];\r
\r
- if (PicoAHW & PAHW_32X)\r
+ if (PicoIn.AHW & PAHW_32X)\r
to_find += 2;\r
\r
g_read_offs = 0;\r
CHECKED_READ(1, buff);\r
CHECKED_READ(4, &len);\r
if (len < 0 || len > 1024*512) R_ERROR_RETURN("bad length");\r
- if (buff[0] > CHUNK_FM && buff[0] <= CHUNK_MISC_CD && !(PicoAHW & PAHW_MCD))\r
+ if (buff[0] > CHUNK_FM && buff[0] <= CHUNK_MISC_CD && !(PicoIn.AHW & PAHW_MCD))\r
R_ERROR_RETURN("cd chunk in non CD state?");\r
\r
switch (buff[0])\r
memcpy(&t->video, &Pico.video, sizeof(Pico.video));\r
\r
#ifndef NO_32X\r
- if (PicoAHW & PAHW_32X) {\r
+ if (PicoIn.AHW & PAHW_32X) {\r
memcpy(&t->t32x.p32x, &Pico32x, sizeof(Pico32x));\r
memcpy(t->t32x.dram, Pico32xMem->dram, sizeof(Pico32xMem->dram));\r
memcpy(t->t32x.pal, Pico32xMem->pal, sizeof(Pico32xMem->pal));\r
Pico.m.dirtyPal = 1;\r
\r
#ifndef NO_32X\r
- if (PicoAHW & PAHW_32X) {\r
+ if (PicoIn.AHW & PAHW_32X) {\r
memcpy(&Pico32x, &t->t32x.p32x, sizeof(Pico32x));\r
memcpy(Pico32xMem->dram, t->t32x.dram, sizeof(Pico32xMem->dram));\r
memcpy(Pico32xMem->pal, t->t32x.pal, sizeof(Pico32xMem->pal));\r
base = (u16 *)PicoMem.ram;\r
mask = 0xffff;\r
}\r
- else if (PicoAHW & PAHW_MCD)\r
+ else if (PicoIn.AHW & PAHW_MCD)\r
{\r
u8 r3 = Pico_mcd->s68k_regs[3];\r
elprintf(EL_VDPDMA, "DmaSlow CD, r3=%02x", r3);\r
\r
static void DrawSync(int blank_on)\r
{\r
- if (Pico.m.scanline < 224 && !(PicoOpt & POPT_ALT_RENDERER) &&\r
- !PicoSkipFrame && Pico.est.DrawScanline <= Pico.m.scanline) {\r
+ if (Pico.m.scanline < 224 && !(PicoIn.opt & POPT_ALT_RENDERER) &&\r
+ !PicoIn.skipFrame && Pico.est.DrawScanline <= Pico.m.scanline) {\r
//elprintf(EL_ANOMALY, "sync");\r
PicoDrawSync(Pico.m.scanline, blank_on);\r
}\r
pvid->pending=0;\r
}\r
\r
- if (!(pvid->status & SR_VB) && !(PicoOpt&POPT_DIS_VDP_FIFO))\r
+ if (!(pvid->status & SR_VB) && !(PicoIn.opt&POPT_DIS_VDP_FIFO))\r
{\r
int use = pvid->type == 1 ? 2 : 1;\r
pvid->lwrite_cnt -= use;\r
*/
#ifdef FAST_Z80SP
// drZ80 is locked in single bank
- drz80_sp_base = (PicoAHW & PAHW_SMS) ? 0xc000 : 0x0000;
+ drz80_sp_base = (PicoIn.AHW & PAHW_SMS) ? 0xc000 : 0x0000;
drZ80.Z80SP_BASE = z80_read_map[drz80_sp_base >> Z80_MEM_SHIFT] << 1;
#endif
- if (PicoAHW & PAHW_SMS)
+ if (PicoIn.AHW & PAHW_SMS)
drZ80.Z80SP = drZ80.Z80SP_BASE + 0xdff0; // simulate BIOS
// XXX: since we use direct SP pointer, it might make sense to force it to RAM,
// but we'll rely on built-in stack protection for now
#endif
#ifdef _USE_CZ80
Cz80_Reset(&CZ80);
- if (PicoAHW & PAHW_SMS)
+ if (PicoIn.AHW & PAHW_SMS)
Cz80_Set_Reg(&CZ80, CZ80_SP, 0xdff0);
#endif
}
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;
{
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;
ret = emu_read_config(cd_fname, 0);\r
if (!ret) emu_read_config(NULL, 0);\r
\r
- if (PicoRegionOverride) {\r
- *region = PicoRegionOverride;\r
+ if (PicoIn.regionOverride) {\r
+ *region = PicoIn.regionOverride;\r
lprintf("override region to %s\n", *region != 4 ?\r
(*region == 8 ? "EU" : "JAP") : "USA");\r
}\r
static char id_string[3+0xe*3+0x3*3+0x30*3+3];\r
int pos, swab = 1;\r
\r
- if (PicoAHW & PAHW_MCD) {\r
+ if (PicoIn.AHW & PAHW_MCD) {\r
strcpy(id_string, "CD|");\r
swab = 0;\r
}\r
- else if (PicoAHW & PAHW_SMS)\r
+ else if (PicoIn.AHW & PAHW_SMS)\r
strcpy(id_string, "MS|");\r
else strcpy(id_string, "MD|");\r
pos = 3;\r
\r
- if (!(PicoAHW & PAHW_SMS)) {\r
+ if (!(PicoIn.AHW & PAHW_SMS)) {\r
pos += extract_text(id_string + pos, media_id_header + 0x80, 0x0e, swab); // serial\r
id_string[pos] = '|'; pos++;\r
pos += extract_text(id_string + pos, media_id_header + 0xf0, 0x03, swab); // region\r
// buffer must be at least 150 byte long\r
void emu_get_game_name(char *str150)\r
{\r
- int ret, swab = (PicoAHW & PAHW_MCD) ? 0 : 1;\r
+ int ret, swab = (PicoIn.AHW & PAHW_MCD) ? 0 : 1;\r
char *s, *d;\r
\r
ret = extract_text(str150, media_id_header + 0x50, 0x30, swab); // overseas name\r
const char *sys_name, *tv_standard, *extra = "";\r
int fps;\r
\r
- if (PicoAHW & PAHW_SMS) {\r
+ if (PicoIn.AHW & PAHW_SMS) {\r
sys_name = "Master System";\r
#ifdef NO_SMS\r
extra = " [no support]";\r
#endif\r
- } else if (PicoAHW & PAHW_PICO) {\r
+ } else if (PicoIn.AHW & PAHW_PICO) {\r
sys_name = "Pico";\r
- } else if ((PicoAHW & (PAHW_32X|PAHW_MCD)) == (PAHW_32X|PAHW_MCD)) {\r
+ } else if ((PicoIn.AHW & (PAHW_32X|PAHW_MCD)) == (PAHW_32X|PAHW_MCD)) {\r
sys_name = "32X + Mega CD";\r
if ((Pico.m.hardware & 0xc0) == 0x80)\r
sys_name = "32X + Sega CD";\r
- } else if (PicoAHW & PAHW_MCD) {\r
+ } else if (PicoIn.AHW & PAHW_MCD) {\r
sys_name = "Mega CD";\r
if ((Pico.m.hardware & 0xc0) == 0x80)\r
sys_name = "Sega CD";\r
- } else if (PicoAHW & PAHW_32X) {\r
+ } else if (PicoIn.AHW & PAHW_32X) {\r
sys_name = "32X";\r
} else {\r
sys_name = "MegaDrive";\r
}\r
\r
// make quirks visible in UI\r
- if (PicoQuirks & PQUIRK_FORCE_6BTN)\r
+ if (PicoIn.quirks & PQUIRK_FORCE_6BTN)\r
currentConfig.input_dev0 = PICO_INPUT_PAD_6BTN;\r
\r
menu_romload_end();\r
PicoSetInputDevice(0, indev);\r
PicoSetInputDevice(1, indev);\r
\r
- PicoOpt |= POPT_DIS_VDP_FIFO; // no VDP fifo timing\r
+ PicoIn.opt |= POPT_DIS_VDP_FIFO; // no VDP fifo timing\r
if (movie_data[0xF] >= 'A') {\r
if (movie_data[0x16] & 0x80) {\r
- PicoRegionOverride = 8;\r
+ PicoIn.regionOverride = 8;\r
} else {\r
- PicoRegionOverride = 4;\r
+ PicoIn.regionOverride = 4;\r
}\r
PicoReset();\r
// TODO: bits 6 & 5\r
else\r
{\r
system_announce();\r
- PicoOpt &= ~POPT_DIS_VDP_FIFO;\r
+ PicoIn.opt &= ~POPT_DIS_VDP_FIFO;\r
}\r
\r
strncpy(rom_fname_loaded, rom_fname, sizeof(rom_fname_loaded)-1);\r
void emu_set_defconfig(void)\r
{\r
memcpy(¤tConfig, &defaultConfig, sizeof(currentConfig));\r
- PicoOpt = currentConfig.s_PicoOpt;\r
+ PicoIn.opt = currentConfig.s_PicoOpt;\r
PsndRate = currentConfig.s_PsndRate;\r
- PicoRegionOverride = currentConfig.s_PicoRegion;\r
- PicoAutoRgnOrder = currentConfig.s_PicoAutoRgnOrder;\r
+ PicoIn.regionOverride = currentConfig.s_PicoRegion;\r
+ PicoIn.autoRgnOrder = currentConfig.s_PicoAutoRgnOrder;\r
}\r
\r
int emu_read_config(const char *rom_fname, int no_defaults)\r
lprintf("END OF MOVIE.\n");\r
} else {\r
// MXYZ SACB RLDU\r
- PicoPad[0] = ~movie_data[offs] & 0x8f; // ! SCBA RLDU\r
- if(!(movie_data[offs] & 0x10)) PicoPad[0] |= 0x40; // C\r
- if(!(movie_data[offs] & 0x20)) PicoPad[0] |= 0x10; // A\r
- if(!(movie_data[offs] & 0x40)) PicoPad[0] |= 0x20; // B\r
- PicoPad[1] = ~movie_data[offs+1] & 0x8f; // ! SCBA RLDU\r
- if(!(movie_data[offs+1] & 0x10)) PicoPad[1] |= 0x40; // C\r
- if(!(movie_data[offs+1] & 0x20)) PicoPad[1] |= 0x10; // A\r
- if(!(movie_data[offs+1] & 0x40)) PicoPad[1] |= 0x20; // B\r
- PicoPad[0] |= (~movie_data[offs+2] & 0x0A) << 8; // ! MZYX\r
- if(!(movie_data[offs+2] & 0x01)) PicoPad[0] |= 0x0400; // X\r
- if(!(movie_data[offs+2] & 0x04)) PicoPad[0] |= 0x0100; // Z\r
- PicoPad[1] |= (~movie_data[offs+2] & 0xA0) << 4; // ! MZYX\r
- if(!(movie_data[offs+2] & 0x10)) PicoPad[1] |= 0x0400; // X\r
- if(!(movie_data[offs+2] & 0x40)) PicoPad[1] |= 0x0100; // Z\r
+ PicoIn.pad[0] = ~movie_data[offs] & 0x8f; // ! SCBA RLDU\r
+ if(!(movie_data[offs] & 0x10)) PicoIn.pad[0] |= 0x40; // C\r
+ if(!(movie_data[offs] & 0x20)) PicoIn.pad[0] |= 0x10; // A\r
+ if(!(movie_data[offs] & 0x40)) PicoIn.pad[0] |= 0x20; // B\r
+ PicoIn.pad[1] = ~movie_data[offs+1] & 0x8f; // ! SCBA RLDU\r
+ if(!(movie_data[offs+1] & 0x10)) PicoIn.pad[1] |= 0x40; // C\r
+ if(!(movie_data[offs+1] & 0x20)) PicoIn.pad[1] |= 0x10; // A\r
+ if(!(movie_data[offs+1] & 0x40)) PicoIn.pad[1] |= 0x20; // B\r
+ PicoIn.pad[0] |= (~movie_data[offs+2] & 0x0A) << 8; // ! MZYX\r
+ if(!(movie_data[offs+2] & 0x01)) PicoIn.pad[0] |= 0x0400; // X\r
+ if(!(movie_data[offs+2] & 0x04)) PicoIn.pad[0] |= 0x0100; // Z\r
+ PicoIn.pad[1] |= (~movie_data[offs+2] & 0xA0) << 4; // ! MZYX\r
+ if(!(movie_data[offs+2] & 0x10)) PicoIn.pad[1] |= 0x0400; // X\r
+ if(!(movie_data[offs+2] & 0x40)) PicoIn.pad[1] |= 0x0100; // Z\r
}\r
}\r
\r
\r
if (is_sram)\r
{\r
- strcpy(ext, (PicoAHW & PAHW_MCD) ? ".brm" : ".srm");\r
+ strcpy(ext, (PicoIn.AHW & PAHW_MCD) ? ".brm" : ".srm");\r
romfname_ext(saveFname, sizeof(static_buff),\r
- (PicoAHW & PAHW_MCD) ? "brm"PATH_SEP : "srm"PATH_SEP, ext);\r
+ (PicoIn.AHW & PAHW_MCD) ? "brm"PATH_SEP : "srm"PATH_SEP, ext);\r
if (!load)\r
return saveFname;\r
\r
int sram_size;\r
unsigned char *sram_data;\r
int truncate = 1;\r
- if (PicoAHW & PAHW_MCD)\r
+ if (PicoIn.AHW & PAHW_MCD)\r
{\r
- if (PicoOpt & POPT_EN_MCD_RAMCART) {\r
+ if (PicoIn.opt & POPT_EN_MCD_RAMCART) {\r
sram_size = 0x12000;\r
sram_data = Pico.sv.data;\r
if (sram_data)\r
ret = fread(sram_data, 1, sram_size, sramFile);\r
ret = ret > 0 ? 0 : -1;\r
fclose(sramFile);\r
- if ((PicoAHW & PAHW_MCD) && (PicoOpt&POPT_EN_MCD_RAMCART))\r
+ if ((PicoIn.AHW & PAHW_MCD) && (PicoIn.opt&POPT_EN_MCD_RAMCART))\r
memcpy(Pico_mcd->bram, sram_data, 0x2000);\r
} else {\r
// sram save needs some special processing\r
PsndRerate(1);\r
is_on = 0;\r
// mainly to unbreak pcm\r
- if (PicoAHW & PAHW_MCD)\r
+ if (PicoIn.AHW & PAHW_MCD)\r
pcd_state_loaded();\r
}\r
}\r
return;\r
\r
/* handle other input modes */\r
- if (PicoPad[0] & 1) pico_pen_y--;\r
- if (PicoPad[0] & 2) pico_pen_y++;\r
- if (PicoPad[0] & 4) pico_pen_x--;\r
- if (PicoPad[0] & 8) pico_pen_x++;\r
- PicoPad[0] &= ~0x0f; // release UDLR\r
+ if (PicoIn.pad[0] & 1) pico_pen_y--;\r
+ if (PicoIn.pad[0] & 2) pico_pen_y++;\r
+ if (PicoIn.pad[0] & 4) pico_pen_x--;\r
+ if (PicoIn.pad[0] & 8) pico_pen_x++;\r
+ PicoIn.pad[0] &= ~0x0f; // release UDLR\r
\r
lim_x = (Pico.video.reg[12]&1) ? 319 : 255;\r
if (pico_pen_y < 8)\r
PicoPicohw.pen_pos[1] = pico_inp_mode == 1 ? (0x2f8 + pico_pen_y) : (0x1fc + pico_pen_y);\r
}\r
\r
-static void do_turbo(int *pad, int acts)\r
+static void do_turbo(unsigned short *pad, int acts)\r
{\r
static int turbo_pad = 0;\r
static unsigned char turbo_cnt[3] = { 0, 0, 0 };\r
pl_actions[0] = actions[IN_BINDTYPE_PLAYER12];\r
pl_actions[1] = actions[IN_BINDTYPE_PLAYER12] >> 16;\r
\r
- PicoPad[0] = pl_actions[0] & 0xfff;\r
- PicoPad[1] = pl_actions[1] & 0xfff;\r
+ PicoIn.pad[0] = pl_actions[0] & 0xfff;\r
+ PicoIn.pad[1] = pl_actions[1] & 0xfff;\r
\r
if (pl_actions[0] & 0x7000)\r
- do_turbo(&PicoPad[0], pl_actions[0]);\r
+ do_turbo(&PicoIn.pad[0], pl_actions[0]);\r
if (pl_actions[1] & 0x7000)\r
- do_turbo(&PicoPad[1], pl_actions[1]);\r
+ do_turbo(&PicoIn.pad[1], pl_actions[1]);\r
\r
events = actions[IN_BINDTYPE_EMU] & PEV_MASK;\r
\r
\r
events &= ~prev_events;\r
\r
- if (PicoAHW == PAHW_PICO)\r
+ if (PicoIn.AHW == PAHW_PICO)\r
run_events_pico(events);\r
if (events)\r
run_events_ui(events);\r
\r
void emu_cmn_forced_frame(int no_scale, int do_emu)\r
{\r
- int po_old = PicoOpt;\r
+ int po_old = PicoIn.opt;\r
\r
memset32(g_screen_ptr, 0, g_screen_width * g_screen_height * 2 / 4);\r
\r
- PicoOpt &= ~POPT_ALT_RENDERER;\r
- PicoOpt |= POPT_ACC_SPRITES;\r
+ PicoIn.opt &= ~POPT_ALT_RENDERER;\r
+ PicoIn.opt |= POPT_ACC_SPRITES;\r
if (!no_scale)\r
- PicoOpt |= POPT_EN_SOFTSCALE;\r
+ PicoIn.opt |= POPT_EN_SOFTSCALE;\r
\r
PicoDrawSetOutFormat(PDF_RGB555, 1);\r
Pico.m.dirtyPal = 1;\r
else\r
PicoFrameDrawOnly();\r
\r
- PicoOpt = po_old;\r
+ PicoIn.opt = po_old;\r
}\r
\r
void emu_init(void)\r
\r
if (currentConfig.EmuOpt & EOPT_EN_SOUND)\r
{\r
- int is_stereo = (PicoOpt & POPT_EN_STEREO) ? 1 : 0;\r
+ int is_stereo = (PicoIn.opt & POPT_EN_STEREO) ? 1 : 0;\r
\r
PsndRerate(Pico.m.frame_count ? 1 : 0);\r
\r
emu_update_input();\r
if (skip) {\r
int do_audio = diff > -target_frametime_x3 * 2;\r
- PicoSkipFrame = do_audio ? 1 : 2;\r
+ PicoIn.skipFrame = do_audio ? 1 : 2;\r
PicoFrame();\r
- PicoSkipFrame = 0;\r
+ PicoIn.skipFrame = 0;\r
}\r
else {\r
PicoFrame();\r
// -------------- key config --------------
-// PicoPad[] format: MXYZ SACB RLDU
+// PicoIn.pad[] format: MXYZ SACB RLDU
me_bind_action me_ctrl_actions[] =
{
{ "UP ", 0x0001 },
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,
};
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,
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,
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];
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;
}
}
{
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;
}
{
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;
} 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]);
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;
}
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())
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);
/* 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,
};
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);
{
int emu_opt = currentConfig.EmuOpt;
- if (PicoOpt&0x10)
+ if (PicoIn.opt&0x10)
{
int lines_flags = 224;
// 8bit fast renderer
vidConvCpyRGB565(localPal, Pico.cram, 0x40);
}
// a hack for VR
- if (PicoAHW & PAHW_SVP)
+ if (PicoIn.AHW & PAHW_SVP)
memset32((int *)(Pico.est.Draw2FB+328*8+328*223), 0xe0e0e0e0, 328);
if (!(Pico.video.reg[12]&1)) lines_flags|=0x10000;
if (currentConfig.EmuOpt&0x4000)
if (emu_opt & 2) osd_text(OSD_FPS_X, h, fps);
}
- if ((emu_opt & 0x400) && (PicoAHW & PAHW_MCD))
+ if ((emu_opt & 0x400) && (PicoIn.AHW & PAHW_MCD))
cd_leds();
}
{
giz_screen = fb_lock(1);
- if (PicoOpt&0x10) {
+ if (PicoIn.opt&0x10) {
} else if (currentConfig.EmuOpt&0x80) {
PicoDrawSetOutFormat(PDF_RGB555, 0);
PicoDrawSetCallbacks(EmuScanBegin16, NULL);
PicoDrawSetOutFormat(PDF_NONE, 0);
PicoDrawSetCallbacks(EmuScanBegin8, NULL);
}
- if ((PicoOpt&0x10) || !(currentConfig.EmuOpt&0x80)) {
+ if ((PicoIn.opt&0x10) || !(currentConfig.EmuOpt&0x80)) {
// setup pal for 8-bit modes
localPal[0xc0] = 0x0600;
localPal[0xd0] = 0xc000;
static void SkipFrame(void)
{
- PicoSkipFrame=1;
+ PicoIn.skipFrame=1;
PicoFrame();
- PicoSkipFrame=0;
+ PicoIn.skipFrame=0;
}
/* forced frame to front buffer */
void pemu_forced_frame(int no_scale, int do_emu)
{
- int po_old = PicoOpt;
+ int po_old = PicoIn.opt;
int eo_old = currentConfig.EmuOpt;
- PicoOpt &= ~0x10;
- PicoOpt |= POPT_ACC_SPRITES;
+ PicoIn.opt &= ~0x10;
+ PicoIn.opt |= POPT_ACC_SPRITES;
if (!no_scale)
- PicoOpt |= POPT_EN_SOFTSCALE;
+ PicoIn.opt |= POPT_EN_SOFTSCALE;
currentConfig.EmuOpt |= 0x80;
if (giz_screen == NULL)
fb_unlock();
giz_screen = NULL;
- PicoOpt = po_old;
+ PicoIn.opt = po_old;
currentConfig.EmuOpt = eo_old;
}
}
if (which & 0x0400) // switch renderer
{
- if (PicoOpt&0x10) { PicoOpt&=~0x10; currentConfig.EmuOpt |= 0x80; }
- else { PicoOpt|= 0x10; currentConfig.EmuOpt &= ~0x80; }
+ if (PicoIn.opt&0x10) { PicoIn.opt&=~0x10; currentConfig.EmuOpt |= 0x80; }
+ else { PicoIn.opt|= 0x10; currentConfig.EmuOpt &= ~0x80; }
vidResetMode();
- if (PicoOpt&0x10) {
+ if (PicoIn.opt&0x10) {
strcpy(noticeMsg, " 8bit fast renderer");
} else if (currentConfig.EmuOpt&0x80) {
strcpy(noticeMsg, "16bit accurate renderer");
keys &= CONFIGURABLE_KEYS;
- PicoPad[0] = allActions[0] & 0xfff;
- PicoPad[1] = allActions[1] & 0xfff;
+ PicoIn.pad[0] = allActions[0] & 0xfff;
+ PicoIn.pad[1] = allActions[1] & 0xfff;
- if (allActions[0] & 0x7000) emu_DoTurbo(&PicoPad[0], allActions[0]);
- if (allActions[1] & 0x7000) emu_DoTurbo(&PicoPad[1], allActions[1]);
+ if (allActions[0] & 0x7000) emu_DoTurbo(&PicoIn.pad[0], allActions[0]);
+ if (allActions[1] & 0x7000) emu_DoTurbo(&PicoIn.pad[1], allActions[1]);
events = (allActions[0] | allActions[1]) >> 16;
// make sure we are in correct mode
vidResetMode();
- if (currentConfig.scaling) PicoOpt|=0x4000;
- else PicoOpt&=~0x4000;
+ if (currentConfig.scaling) PicoIn.opt|=0x4000;
+ else PicoIn.opt&=~0x4000;
Pico.m.dirtyPal = 1;
oldmodes = ((Pico.video.reg[12]&1)<<2) ^ 0xc;
reset_timing = 1;
// prepare CD buffer
- if (PicoAHW & PAHW_MCD) PicoCDBufferInit();
+ if (PicoIn.AHW & PAHW_MCD) PicoCDBufferInit();
// prepare sound stuff
PsndOut = NULL;
if (currentConfig.EmuOpt & 4)
{
int ret, snd_excess_add, stereo;
- if (PsndRate != PsndRate_old || (PicoOpt&0x0b) != (PicoOpt_old&0x0b) || Pico.m.pal != pal_old) {
+ if (PsndRate != PsndRate_old || (PicoIn.opt&0x0b) != (PicoOpt_old&0x0b) || Pico.m.pal != pal_old) {
PsndRerate(Pico.m.frame_count ? 1 : 0);
}
- stereo=(PicoOpt&8)>>3;
+ stereo=(PicoIn.opt&8)>>3;
snd_excess_add = ((PsndRate - PsndLen*target_fps)<<16) / target_fps;
snd_cbuf_samples = (PsndRate<<stereo) * 16 / target_fps;
lprintf("starting audio: %i len: %i (ex: %04x) stereo: %i, pal: %i\n",
PsndOut = snd_cbuff + snd_cbuf_samples / 2; // start writing at the middle
snd_all_samples = 0;
PsndRate_old = PsndRate;
- PicoOpt_old = PicoOpt;
+ PicoOpt_old = PicoIn.opt;
pal_old = Pico.m.pal;
}
}
audio_skew = snd_all_samples*2 - FrameworkAudio_BufferPos();
if (PsndRate == 22050) co = 10;
if (PsndRate > 22050) co = 11;
- if (PicoOpt&8) shift++;
+ if (PicoIn.opt&8) shift++;
if (audio_skew < 0) {
adj = -((-audio_skew) >> shift);
if (audio_skew > -(6<<co)) adj>>=1;
}
- if (PicoAHW & PAHW_MCD) PicoCDBufferFree();
+ if (PicoIn.AHW & PAHW_MCD) PicoCDBufferFree();
if (PsndOut != NULL) {
PsndOut = snd_cbuff = NULL;
}\r
\r
if (file) {\r
- if (PicoAHW & 1) {\r
+ if (PicoIn.AHW & 1) {\r
PicoCdLoadStateGfx(file);\r
} else {\r
areaSeek(file, 0x10020, SEEK_SET); // skip header and RAM in state file\r
{ "Player 1", MB_NONE, MA_CTRL_PLAYER1, NULL, 0, 0, 0, 1, 0 },\r
{ "Player 2", MB_NONE, MA_CTRL_PLAYER2, NULL, 0, 0, 0, 1, 0 },\r
{ "Emulator controls", MB_NONE, MA_CTRL_EMU, NULL, 0, 0, 0, 1, 0 },\r
- { "6 button pad", MB_ONOFF, MA_OPT_6BUTTON_PAD, &PicoOpt, 0x020, 0, 0, 1, 1 },\r
+ { "6 button pad", MB_ONOFF, MA_OPT_6BUTTON_PAD, &PicoIn.opt, 0x020, 0, 0, 1, 1 },\r
{ "Turbo rate", MB_RANGE, MA_CTRL_TURBO_RATE, ¤tConfig.turbo_rate, 0, 1, 30, 1, 1 },\r
{ "Done", MB_NONE, MA_CTRL_DONE, NULL, 0, 0, 0, 1, 0 },\r
};\r
if (inp & PBTN_UP ) { menu_sel--; if (menu_sel < 0) menu_sel = menu_sel_max; }\r
if (inp & PBTN_DOWN) { menu_sel++; if (menu_sel > menu_sel_max) menu_sel = 0; }\r
if (inp & PBTN_PLAY) {\r
- int is_6button = PicoOpt & 0x020;\r
+ int is_6button = PicoIn.opt & 0x020;\r
switch (selected_id) {\r
case MA_CTRL_PLAYER1: key_config_loop(me_ctrl_actions, is_6button ? 15 : 11, 0); return;\r
case MA_CTRL_PLAYER2: key_config_loop(me_ctrl_actions, is_6button ? 15 : 11, 1); return;\r
{ NULL, MB_NONE, MA_CDOPT_TESTBIOS_EUR, NULL, 0, 0, 0, 1, 0 },\r
{ NULL, MB_NONE, MA_CDOPT_TESTBIOS_JAP, NULL, 0, 0, 0, 1, 0 },\r
{ "CD LEDs", MB_ONOFF, MA_CDOPT_LEDS, ¤tConfig.EmuOpt, 0x0400, 0, 0, 1, 1 },\r
- { "CDDA audio", MB_ONOFF, MA_CDOPT_CDDA, &PicoOpt, 0x0800, 0, 0, 1, 1 },\r
- { "PCM audio", MB_ONOFF, MA_CDOPT_PCM, &PicoOpt, 0x0400, 0, 0, 1, 1 },\r
+ { "CDDA audio", MB_ONOFF, MA_CDOPT_CDDA, &PicoIn.opt, 0x0800, 0, 0, 1, 1 },\r
+ { "PCM audio", MB_ONOFF, MA_CDOPT_PCM, &PicoIn.opt, 0x0400, 0, 0, 1, 1 },\r
{ NULL, MB_NONE, MA_CDOPT_READAHEAD, NULL, 0, 0, 0, 1, 1 },\r
- { "SaveRAM cart", MB_ONOFF, MA_CDOPT_SAVERAM, &PicoOpt, 0x8000, 0, 0, 1, 1 },\r
- { "Scale/Rot. fx (slow)", MB_ONOFF, MA_CDOPT_SCALEROT_CHIP,&PicoOpt, 0x1000, 0, 0, 1, 1 },\r
- { "Better sync (slow)", MB_ONOFF, MA_CDOPT_BETTER_SYNC, &PicoOpt, 0x2000, 0, 0, 1, 1 },\r
+ { "SaveRAM cart", MB_ONOFF, MA_CDOPT_SAVERAM, &PicoIn.opt, 0x8000, 0, 0, 1, 1 },\r
+ { "Scale/Rot. fx (slow)", MB_ONOFF, MA_CDOPT_SCALEROT_CHIP,&PicoIn.opt, 0x1000, 0, 0, 1, 1 },\r
+ { "Better sync (slow)", MB_ONOFF, MA_CDOPT_BETTER_SYNC, &PicoIn.opt, 0x2000, 0, 0, 1, 1 },\r
{ "done", MB_NONE, MA_CDOPT_DONE, NULL, 0, 0, 0, 1, 0 },\r
};\r
\r
\r
menu_entry opt2_entries[] =\r
{\r
- { "Disable sprite limit", MB_ONOFF, MA_OPT2_NO_SPRITE_LIM, &PicoOpt, 0x40000, 0, 0, 1, 1 },\r
- { "Emulate Z80", MB_ONOFF, MA_OPT2_ENABLE_Z80, &PicoOpt, 0x00004, 0, 0, 1, 1 },\r
- { "Emulate YM2612 (FM)", MB_ONOFF, MA_OPT2_ENABLE_YM2612, &PicoOpt, 0x00001, 0, 0, 1, 1 },\r
- { "Emulate SN76496 (PSG)", MB_ONOFF, MA_OPT2_ENABLE_SN76496,&PicoOpt, 0x00002, 0, 0, 1, 1 },\r
+ { "Disable sprite limit", MB_ONOFF, MA_OPT2_NO_SPRITE_LIM, &PicoIn.opt, 0x40000, 0, 0, 1, 1 },\r
+ { "Emulate Z80", MB_ONOFF, MA_OPT2_ENABLE_Z80, &PicoIn.opt, 0x00004, 0, 0, 1, 1 },\r
+ { "Emulate YM2612 (FM)", MB_ONOFF, MA_OPT2_ENABLE_YM2612, &PicoIn.opt, 0x00001, 0, 0, 1, 1 },\r
+ { "Emulate SN76496 (PSG)", MB_ONOFF, MA_OPT2_ENABLE_SN76496,&PicoIn.opt, 0x00002, 0, 0, 1, 1 },\r
{ "Double buffering", MB_ONOFF, MA_OPT2_DBLBUFF, ¤tConfig.EmuOpt, 0x8000, 0, 0, 1, 1 },\r
{ "Wait for V-sync (slow)", MB_ONOFF, MA_OPT2_VSYNC, ¤tConfig.EmuOpt, 0x2000, 0, 0, 1, 1 },\r
{ "gzip savestates", MB_ONOFF, MA_OPT2_GZIP_STATES, ¤tConfig.EmuOpt, 0x0008, 0, 0, 1, 1 },\r
{ "Don't save last used ROM", MB_ONOFF, MA_OPT2_NO_LAST_ROM, ¤tConfig.EmuOpt, 0x0020, 0, 0, 1, 1 },\r
- { "SVP dynarec", MB_ONOFF, MA_OPT2_SVP_DYNAREC, &PicoOpt, 0x20000, 0, 0, 1, 1 },\r
- { "Disable idle loop patching",MB_ONOFF, MA_OPT2_NO_IDLE_LOOPS, &PicoOpt, 0x80000, 0, 0, 1, 1 },\r
+ { "SVP dynarec", MB_ONOFF, MA_OPT2_SVP_DYNAREC, &PicoIn.opt, 0x20000, 0, 0, 1, 1 },\r
+ { "Disable idle loop patching",MB_ONOFF, MA_OPT2_NO_IDLE_LOOPS, &PicoIn.opt, 0x80000, 0, 0, 1, 1 },\r
{ "done", MB_NONE, MA_OPT2_DONE, NULL, 0, 0, 0, 1, 0 },\r
};\r
\r
menu_entry opt_entries[] =\r
{\r
{ NULL, MB_NONE, MA_OPT_RENDERER, NULL, 0, 0, 0, 1, 1 },\r
- { "Accurate sprites", MB_ONOFF, MA_OPT_ACC_SPRITES, &PicoOpt, 0x080, 0, 0, 0, 1 },\r
+ { "Accurate sprites", MB_ONOFF, MA_OPT_ACC_SPRITES, &PicoIn.opt, 0x080, 0, 0, 0, 1 },\r
{ "Scanline mode (faster)", MB_ONOFF, MA_OPT_INTERLACED, ¤tConfig.EmuOpt, 0x4000, 0, 0, 1, 1 },\r
{ "Scale low res mode", MB_ONOFF, MA_OPT_SCALING, ¤tConfig.scaling, 0x0001, 0, 3, 1, 1 },\r
{ "Show FPS", MB_ONOFF, MA_OPT_SHOW_FPS, ¤tConfig.EmuOpt, 0x0002, 0, 0, 1, 1 },\r
switch (entry->id)\r
{\r
case MA_OPT_RENDERER:\r
- if (PicoOpt&0x10)\r
+ if (PicoIn.opt&0x10)\r
str = " 8bit fast";\r
else if (currentConfig.EmuOpt&0x80)\r
str = "16bit accurate";\r
text_out16(x, y, "Frameskip %s", str24);\r
break;\r
case MA_OPT_SOUND_QUALITY:\r
- str = (PicoOpt&0x08)?"stereo":"mono";\r
+ str = (PicoIn.opt&0x08)?"stereo":"mono";\r
text_out16(x, y, "Sound Quality: %5iHz %s", PsndRate, str);\r
break;\r
case MA_OPT_REGION:\r
- text_out16(x, y, "Region: %s", me_region_name(PicoRegionOverride, PicoAutoRgnOrder));\r
+ text_out16(x, y, "Region: %s", me_region_name(PicoIn.regionOverride, PicoIn.autoRgnOrder));\r
break;\r
case MA_OPT_CONFIRM_STATES:\r
switch ((currentConfig.EmuOpt >> 9) & 5) {\r
static int rgn_orders[] = { 0x148, 0x184, 0x814, 0x418, 0x841, 0x481 };\r
int i;\r
if (right) {\r
- if (!PicoRegionOverride) {\r
+ if (!PicoIn.regionOverride) {\r
for (i = 0; i < 6; i++)\r
- if (rgn_orders[i] == PicoAutoRgnOrder) break;\r
- if (i < 5) PicoAutoRgnOrder = rgn_orders[i+1];\r
- else PicoRegionOverride=1;\r
+ if (rgn_orders[i] == PicoIn.autoRgnOrder) break;\r
+ if (i < 5) PicoIn.autoRgnOrder = rgn_orders[i+1];\r
+ else PicoIn.regionOverride=1;\r
}\r
- else PicoRegionOverride<<=1;\r
- if (PicoRegionOverride > 8) PicoRegionOverride = 8;\r
+ else PicoIn.regionOverride<<=1;\r
+ if (PicoIn.regionOverride > 8) PicoIn.regionOverride = 8;\r
} else {\r
- if (!PicoRegionOverride) {\r
+ if (!PicoIn.regionOverride) {\r
for (i = 0; i < 6; i++)\r
- if (rgn_orders[i] == PicoAutoRgnOrder) break;\r
- if (i > 0) PicoAutoRgnOrder = rgn_orders[i-1];\r
+ if (rgn_orders[i] == PicoIn.autoRgnOrder) break;\r
+ if (i > 0) PicoIn.autoRgnOrder = rgn_orders[i-1];\r
}\r
- else PicoRegionOverride>>=1;\r
+ else PicoIn.regionOverride>>=1;\r
}\r
}\r
\r
static void menu_options_save(void)\r
{\r
- if (PicoRegionOverride) {\r
+ if (PicoIn.regionOverride) {\r
// force setting possibly changed..\r
- Pico.m.pal = (PicoRegionOverride == 2 || PicoRegionOverride == 8) ? 1 : 0;\r
+ Pico.m.pal = (PicoIn.regionOverride == 2 || PicoIn.regionOverride == 8) ? 1 : 0;\r
}\r
- if (!(PicoOpt & 0x20)) {\r
+ if (!(PicoIn.opt & 0x20)) {\r
// unbind XYZ MODE, just in case\r
unbind_action(0xf00);\r
}\r
switch (selected_id) {\r
case MA_OPT_RENDERER:\r
if (inp & PBTN_LEFT) {\r
- if ((PicoOpt&0x10) || !(currentConfig.EmuOpt &0x80)) {\r
- PicoOpt&= ~0x10;\r
+ if ((PicoIn.opt&0x10) || !(currentConfig.EmuOpt &0x80)) {\r
+ PicoIn.opt&= ~0x10;\r
currentConfig.EmuOpt |= 0x80;\r
}\r
} else {\r
- if (!(PicoOpt&0x10) || (currentConfig.EmuOpt &0x80)) {\r
- PicoOpt|= 0x10;\r
+ if (!(PicoIn.opt&0x10) || (currentConfig.EmuOpt &0x80)) {\r
+ PicoIn.opt|= 0x10;\r
currentConfig.EmuOpt &= ~0x80;\r
}\r
}\r
break;\r
case MA_OPT_SOUND_QUALITY:\r
if ((inp & PBTN_RIGHT) && PsndRate == 44100 &&\r
- !(PicoOpt&0x08))\r
+ !(PicoIn.opt&0x08))\r
{\r
PsndRate = 11025;\r
- PicoOpt |= 8;\r
+ PicoIn.opt |= 8;\r
} else if ((inp & PBTN_LEFT) && PsndRate == 11025 &&\r
- (PicoOpt&0x08) && !(PicoAHW&1))\r
+ (PicoIn.opt&0x08) && !(PicoIn.AHW&1))\r
{\r
PsndRate = 44100;\r
- PicoOpt &= ~8;\r
+ PicoIn.opt &= ~8;\r
} else\r
PsndRate = sndrate_prevnext(PsndRate, inp & PBTN_RIGHT);\r
break;\r
\r
int mp3dec_decode(FILE *f, int *file_pos, int file_len)\r
{\r
- if (!(PicoOpt & POPT_EXT_FM)) {\r
+ if (!(PicoIn.opt & POPT_EXT_FM)) {\r
//mp3_update_local(buffer, length, stereo);\r
return 0;\r
}\r
\r
int mp3dec_start(FILE *f, int fpos_start)\r
{\r
- if (!(PicoOpt & POPT_EXT_FM)) {\r
+ if (!(PicoIn.opt & POPT_EXT_FM)) {\r
//mp3_start_play_local(f, pos);\r
return -1;\r
}\r
void pemu_validate_config(void)\r
{\r
if (gp2x_dev_id != GP2X_DEV_GP2X)\r
- PicoOpt &= ~POPT_EXT_FM;\r
+ PicoIn.opt &= ~POPT_EXT_FM;\r
if (gp2x_dev_id != GP2X_DEV_WIZ)\r
currentConfig.EmuOpt &= ~EOPT_WIZ_TEAR_FIX;\r
\r
\r
static int get_renderer(void)\r
{\r
- if (PicoAHW & PAHW_32X)\r
+ if (PicoIn.AHW & PAHW_32X)\r
return currentConfig.renderer32x;\r
else\r
return currentConfig.renderer;\r
static void change_renderer(int diff)\r
{\r
int *r;\r
- if (PicoAHW & PAHW_32X)\r
+ if (PicoIn.AHW & PAHW_32X)\r
r = ¤tConfig.renderer32x;\r
else\r
r = ¤tConfig.renderer;\r
*r += diff;\r
\r
// 8bpp fast is not there (yet?)\r
- if ((PicoAHW & PAHW_SMS) && *r == RT_8BIT_FAST)\r
+ if ((PicoIn.AHW & PAHW_SMS) && *r == RT_8BIT_FAST)\r
(*r)++;\r
\r
if (*r >= RT_COUNT)\r
}\r
\r
#define is_16bit_mode() \\r
- (get_renderer() == RT_16BIT || (PicoAHW & PAHW_32X))\r
+ (get_renderer() == RT_16BIT || (PicoIn.AHW & PAHW_32X))\r
\r
static void (*osd_text)(int x, int y, const char *text);\r
\r
\r
x = pico_pen_x + PICO_PEN_ADJUST_X;\r
y = pico_pen_y + PICO_PEN_ADJUST_Y;\r
- if (!(Pico.video.reg[12]&1) && !(PicoOpt & POPT_DIS_32C_BORDER))\r
+ if (!(Pico.video.reg[12]&1) && !(PicoIn.opt & POPT_DIS_32C_BORDER))\r
x += 32;\r
\r
if (currentConfig.EmuOpt & EOPT_WIZ_TEAR_FIX) {\r
if ((num & 3) != 3)\r
return 0;\r
rotated_blit16(g_screen_ptr, rot_buff, num + 1,\r
- !(Pico.video.reg[12] & 1) && !(PicoOpt & POPT_EN_SOFTSCALE));\r
+ !(Pico.video.reg[12] & 1) && !(PicoIn.opt & POPT_EN_SOFTSCALE));\r
return 0;\r
}\r
\r
int emu_opt = currentConfig.EmuOpt;\r
int ret;\r
\r
- if (PicoAHW & PAHW_32X)\r
+ if (PicoIn.AHW & PAHW_32X)\r
; // nothing to do\r
else if (get_renderer() == RT_8BIT_FAST)\r
{\r
gp2x_video_setpalette(localPal, ret);\r
}\r
// a hack for VR\r
- if (PicoAHW & PAHW_SVP)\r
+ if (PicoIn.AHW & PAHW_SVP)\r
memset32((int *)(Pico.est.Draw2FB+328*8+328*223), 0xe0e0e0e0, 328);\r
// do actual copy\r
vidcpyM2(g_screen_ptr, Pico.est.Draw2FB+328*8,\r
- !(Pico.video.reg[12] & 1), !(PicoOpt & POPT_DIS_32C_BORDER));\r
+ !(Pico.video.reg[12] & 1), !(PicoIn.opt & POPT_DIS_32C_BORDER));\r
}\r
else if (get_renderer() == RT_8BIT_ACC)\r
{\r
osd_text(4, osd_y, notice);\r
if (emu_opt & EOPT_SHOW_FPS)\r
osd_text(osd_fps_x, osd_y, fps);\r
- if ((PicoAHW & PAHW_MCD) && (emu_opt & EOPT_EN_CD_LEDS))\r
+ if ((PicoIn.AHW & PAHW_MCD) && (emu_opt & EOPT_EN_CD_LEDS))\r
draw_cd_leds();\r
- if (PicoAHW & PAHW_PICO)\r
+ if (PicoIn.AHW & PAHW_PICO)\r
draw_pico_ptr();\r
}\r
\r
int gp2x_mode = 16;\r
int renderer = get_renderer();\r
\r
- PicoOpt &= ~POPT_ALT_RENDERER;\r
+ PicoIn.opt &= ~POPT_ALT_RENDERER;\r
emu_scan_begin = NULL;\r
emu_scan_end = NULL;\r
\r
gp2x_mode = 8;\r
break;\r
case RT_8BIT_FAST:\r
- PicoOpt |= POPT_ALT_RENDERER;\r
+ PicoIn.opt |= POPT_ALT_RENDERER;\r
PicoDrawSetOutFormat(PDF_NONE, 0);\r
vidcpyM2 = vidcpy_m2;\r
gp2x_mode = 8;\r
break;\r
}\r
\r
- if (PicoAHW & PAHW_32X) {\r
+ if (PicoIn.AHW & PAHW_32X) {\r
// Wiz 16bit is an exception, uses line rendering due to rotation mess\r
if (renderer == RT_16BIT && (currentConfig.EmuOpt & EOPT_WIZ_TEAR_FIX)) {\r
PicoDrawSetOutFormat(PDF_RGB555, 1);\r
}\r
\r
if (currentConfig.EmuOpt & EOPT_WIZ_TEAR_FIX) {\r
- if ((PicoAHW & PAHW_32X) || renderer == RT_16BIT) {\r
+ if ((PicoIn.AHW & PAHW_32X) || renderer == RT_16BIT) {\r
emu_scan_begin = EmuScanBegin16_rot;\r
emu_scan_end = EmuScanEnd16_rot;\r
}\r
\r
Pico.m.dirtyPal = 1;\r
\r
- PicoOpt &= ~POPT_EN_SOFTSCALE;\r
+ PicoIn.opt &= ~POPT_EN_SOFTSCALE;\r
if (currentConfig.scaling == EOPT_SCALE_SW)\r
- PicoOpt |= POPT_EN_SOFTSCALE;\r
+ PicoIn.opt |= POPT_EN_SOFTSCALE;\r
\r
// palette converters for 8bit modes\r
- make_local_pal = (PicoAHW & PAHW_SMS) ? make_local_pal_sms : make_local_pal_md;\r
+ make_local_pal = (PicoIn.AHW & PAHW_SMS) ? make_local_pal_sms : make_local_pal_md;\r
}\r
\r
void emu_video_mode_change(int start_line, int line_count, int is_32cols)\r
osd_y = 232;\r
\r
/* set up hwscaling here */\r
- PicoOpt &= ~POPT_DIS_32C_BORDER;\r
+ PicoIn.opt &= ~POPT_DIS_32C_BORDER;\r
if (is_32cols && currentConfig.scaling == EOPT_SCALE_HW) {\r
scalex = 256;\r
- PicoOpt |= POPT_DIS_32C_BORDER;\r
+ PicoIn.opt |= POPT_DIS_32C_BORDER;\r
osd_fps_x = OSD_FPS_X - 64;\r
}\r
\r
vid_reset_mode();\r
rendstatus_old = -1;\r
\r
- if (PicoAHW & PAHW_32X)\r
+ if (PicoIn.AHW & PAHW_32X)\r
emu_status_msg(renderer_names32x[get_renderer()]);\r
else\r
emu_status_msg(renderer_names[get_renderer()]);\r
if (ret > 35000)\r
{\r
if (pdown_frames++ > 5)\r
- PicoPad[0] |= 0x20;\r
+ PicoIn.pad[0] |= 0x20;\r
\r
pico_pen_x = px;\r
pico_pen_y = py;\r
gp2x_soc_t soc;\r
\r
soc = soc_detect();\r
- if ((PicoOpt & POPT_EN_STEREO) && soc == SOCID_MMSP2)\r
+ if ((PicoIn.opt & POPT_EN_STEREO) && soc == SOCID_MMSP2)\r
need_low_volume = 1;\r
\r
if (has_changed)\r
mee_onoff ("Vsync", MA_OPT2_VSYNC, currentConfig.EmuOpt, EOPT_VSYNC),
#define MENU_OPTIONS_ADV \
- mee_onoff ("Use second CPU for sound", MA_OPT_ARM940_SOUND, PicoOpt, POPT_EXT_FM), \
+ mee_onoff ("Use second CPU for sound", MA_OPT_ARM940_SOUND, PicoIn.opt, POPT_EXT_FM), \
static menu_entry e_menu_adv_options[];
switch(type)
{
case RETRO_MEMORY_SAVE_RAM:
- if (PicoAHW & PAHW_MCD)
+ if (PicoIn.AHW & PAHW_MCD)
data = Pico_mcd->bram;
else
data = Pico.sv.data;
break;
case RETRO_MEMORY_SYSTEM_RAM:
- if (PicoAHW & PAHW_SMS)
+ if (PicoIn.AHW & PAHW_SMS)
data = PicoMem.zram;
else
data = PicoMem.ram;
switch(type)
{
case RETRO_MEMORY_SAVE_RAM:
- if (PicoAHW & PAHW_MCD)
+ if (PicoIn.AHW & PAHW_MCD)
// bram
return 0x2000;
return (sum != 0) ? Pico.sv.size : 0;
case RETRO_MEMORY_SYSTEM_RAM:
- if (PicoAHW & PAHW_SMS)
+ if (PicoIn.AHW & PAHW_SMS)
return 0x2000;
else
return sizeof(PicoMem.ram);
var.key = "picodrive_sprlim";
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) {
if (strcmp(var.value, "enabled") == 0)
- PicoOpt |= POPT_DIS_SPRITE_LIM;
+ PicoIn.opt |= POPT_DIS_SPRITE_LIM;
else
- PicoOpt &= ~POPT_DIS_SPRITE_LIM;
+ PicoIn.opt &= ~POPT_DIS_SPRITE_LIM;
}
var.value = NULL;
var.key = "picodrive_ramcart";
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) {
if (strcmp(var.value, "enabled") == 0)
- PicoOpt |= POPT_EN_MCD_RAMCART;
+ PicoIn.opt |= POPT_EN_MCD_RAMCART;
else
- PicoOpt &= ~POPT_EN_MCD_RAMCART;
+ PicoIn.opt &= ~POPT_EN_MCD_RAMCART;
}
- OldPicoRegionOverride = PicoRegionOverride;
+ OldPicoRegionOverride = PicoIn.regionOverride;
var.value = NULL;
var.key = "picodrive_region";
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) {
if (strcmp(var.value, "Auto") == 0)
- PicoRegionOverride = 0;
+ PicoIn.regionOverride = 0;
else if (strcmp(var.value, "Japan NTSC") == 0)
- PicoRegionOverride = 1;
+ PicoIn.regionOverride = 1;
else if (strcmp(var.value, "Japan PAL") == 0)
- PicoRegionOverride = 2;
+ PicoIn.regionOverride = 2;
else if (strcmp(var.value, "US") == 0)
- PicoRegionOverride = 4;
+ PicoIn.regionOverride = 4;
else if (strcmp(var.value, "Europe") == 0)
- PicoRegionOverride = 8;
+ PicoIn.regionOverride = 8;
}
// Update region, fps and sound flags if needed
- if (Pico.rom && PicoRegionOverride != OldPicoRegionOverride)
+ if (Pico.rom && PicoIn.regionOverride != OldPicoRegionOverride)
{
PicoDetectRegion();
PicoLoopPrepare();
var.key = "picodrive_drc";
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) {
if (strcmp(var.value, "enabled") == 0)
- PicoOpt |= POPT_EN_DRC;
+ PicoIn.opt |= POPT_EN_DRC;
else
- PicoOpt &= ~POPT_EN_DRC;
+ PicoIn.opt &= ~POPT_EN_DRC;
}
#endif
#ifdef _3DS
if(!ctr_svchack_successful)
- PicoOpt &= ~POPT_EN_DRC;
+ PicoIn.opt &= ~POPT_EN_DRC;
#endif
}
input_poll_cb();
- PicoPad[0] = PicoPad[1] = 0;
+ PicoIn.pad[0] = PicoIn.pad[1] = 0;
for (pad = 0; pad < 2; pad++)
for (i = 0; i < RETRO_PICO_MAP_LEN; i++)
if (input_state_cb(pad, RETRO_DEVICE_JOYPAD, 0, i))
- PicoPad[pad] |= retro_pico_map[i];
+ PicoIn.pad[pad] |= retro_pico_map[i];
PicoPatchApply();
PicoFrame();
sceBlock = getVMBlock();
#endif
- PicoOpt = POPT_EN_STEREO|POPT_EN_FM|POPT_EN_PSG|POPT_EN_Z80
+ PicoIn.opt = POPT_EN_STEREO|POPT_EN_FM|POPT_EN_PSG|POPT_EN_Z80
| POPT_EN_MCD_PCM|POPT_EN_MCD_CDDA|POPT_EN_MCD_GFX
| POPT_EN_32X|POPT_EN_PWM
| POPT_ACC_SPRITES|POPT_DIS_32C_BORDER;
#ifdef _3DS
if (ctr_svchack_successful)
#endif
- PicoOpt |= POPT_EN_DRC;
+ PicoIn.opt |= POPT_EN_DRC;
#endif
PsndRate = 44100;
- PicoAutoRgnOrder = 0x184; // US, EU, JP
+ PicoIn.autoRgnOrder = 0x184; // US, EU, JP
vout_width = 320;
vout_height = 240;
\r
void pemu_validate_config(void)\r
{\r
- extern int PicoOpt;\r
-// PicoOpt &= ~POPT_EXT_FM;\r
#ifndef __arm__\r
- PicoOpt &= ~POPT_EN_DRC;\r
+ PicoIn.opt &= ~POPT_EN_DRC;\r
#endif\r
}\r
\r
\r
void pemu_finalize_frame(const char *fps, const char *notice)\r
{\r
- if (currentConfig.renderer != RT_16BIT && !(PicoAHW & PAHW_32X)) {\r
+ if (currentConfig.renderer != RT_16BIT && !(PicoIn.AHW & PAHW_32X)) {\r
unsigned short *pd = (unsigned short *)g_screen_ptr + 8 * g_screen_width;\r
unsigned char *ps = Pico.est.Draw2FB + 328*8 + 8;\r
unsigned short *pal = Pico.est.HighPal;\r
if (currentConfig.EmuOpt & EOPT_SHOW_FPS)\r
emu_osd_text16(g_screen_width - 60, g_screen_height - 8, fps);\r
}\r
- if ((PicoAHW & PAHW_MCD) && (currentConfig.EmuOpt & EOPT_EN_CD_LEDS))\r
+ if ((PicoIn.AHW & PAHW_MCD) && (currentConfig.EmuOpt & EOPT_EN_CD_LEDS))\r
draw_cd_leds();\r
}\r
\r
{\r
switch (currentConfig.renderer) {\r
case RT_16BIT:\r
- PicoOpt &= ~POPT_ALT_RENDERER;\r
+ PicoIn.opt &= ~POPT_ALT_RENDERER;\r
PicoDrawSetOutFormat(PDF_RGB555, 0);\r
PicoDrawSetOutBuf(g_screen_ptr, g_screen_width * 2);\r
break;\r
case RT_8BIT_ACC:\r
- PicoOpt &= ~POPT_ALT_RENDERER;\r
+ PicoIn.opt &= ~POPT_ALT_RENDERER;\r
PicoDrawSetOutFormat(PDF_8BIT, 0);\r
PicoDrawSetOutBuf(Pico.est.Draw2FB + 8, 328);\r
break;\r
case RT_8BIT_FAST:\r
- PicoOpt |= POPT_ALT_RENDERER;\r
+ PicoIn.opt |= POPT_ALT_RENDERER;\r
PicoDrawSetOutFormat(PDF_NONE, 0);\r
break;\r
}\r
\r
- if (PicoAHW & PAHW_32X)\r
+ if (PicoIn.AHW & PAHW_32X)\r
PicoDrawSetOutBuf(g_screen_ptr, g_screen_width * 2);\r
}\r
\r
emu_osd_text16(2, g_osd_y, notice);\r
if (fps && fps[0] && (currentConfig.EmuOpt & EOPT_SHOW_FPS))\r
emu_osd_text16(g_osd_fps_x, g_osd_y, fps);\r
- if ((PicoAHW & PAHW_MCD) && (currentConfig.EmuOpt & EOPT_EN_CD_LEDS))\r
+ if ((PicoIn.AHW & PAHW_MCD) && (currentConfig.EmuOpt & EOPT_EN_CD_LEDS))\r
draw_cd_leds();\r
}\r
\r
blit_16bit_mode = 0;
}
- if ((PicoOpt&0x10) && Pico.m.dirtyPal)
+ if ((PicoIn.opt&0x10) && Pico.m.dirtyPal)
do_pal_update(0, 0);
sceKernelDcacheWritebackAll();
/* called after rendering is done, but frame emulation is not finished */
void blit1(void)
{
- if (PicoOpt&0x10)
+ if (PicoIn.opt&0x10)
{
int i;
unsigned char *pd;
memset32((int *)pd, 0xe0e0e0e0, 320/4);
}
- if (PicoAHW & PAHW_PICO)
+ if (PicoIn.AHW & PAHW_PICO)
draw_pico_ptr();
blitscreen_clut();
//dbg_text();
- if ((emu_opt & 0x400) && (PicoAHW & PAHW_MCD))
+ if ((emu_opt & 0x400) && (PicoIn.AHW & PAHW_MCD))
cd_leds();
if (currentConfig.EmuOpt & 0x2000) { // want vsync
samples_made = samples_done = 0;
- if (PsndRate != PsndRate_old || (PicoOpt&0x0b) != (PicoOpt_old&0x0b) || Pico.m.pal != pal_old) {
+ if (PsndRate != PsndRate_old || (PicoIn.opt&0x0b) != (PicoOpt_old&0x0b) || Pico.m.pal != pal_old) {
PsndRerate(Pico.m.frame_count ? 1 : 0);
}
- stereo=(PicoOpt&8)>>3;
+ stereo=(PicoIn.opt&8)>>3;
samples_block = Pico.m.pal ? SOUND_BLOCK_SIZE_PAL : SOUND_BLOCK_SIZE_NTSC;
if (PsndRate <= 22050) samples_block /= 2;
samples_made = samples_block; // send 1 empty block first..
PsndOut = sndBuffer;
PsndRate_old = PsndRate;
- PicoOpt_old = PicoOpt;
+ PicoOpt_old = PicoIn.opt;
pal_old = Pico.m.pal;
}
}
static void SkipFrame(void)
{
- PicoSkipFrame=1;
+ PicoIn.skipFrame=1;
PicoFrame();
- PicoSkipFrame=0;
+ PicoIn.skipFrame=0;
}
void pemu_forced_frame(int no_scale, int do_emu)
{
- int po_old = PicoOpt;
+ int po_old = PicoIn.opt;
int eo_old = currentConfig.EmuOpt;
- 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;
currentConfig.EmuOpt |= 0x80;
vidResetMode();
blit1();
sceGuSync(0,0);
- PicoOpt = po_old;
+ PicoIn.opt = po_old;
currentConfig.EmuOpt = eo_old;
}
if (pico_inp_mode != 0)
{
- PicoPad[0] &= ~0x0f; // release UDLR
+ PicoIn.pad[0] &= ~0x0f; // release UDLR
if (keys & PBTN_UP) { pico_pen_y--; if (pico_pen_y < 8) pico_pen_y = 8; }
if (keys & PBTN_DOWN) { pico_pen_y++; if (pico_pen_y > 224-PICO_PEN_ADJUST_Y) pico_pen_y = 224-PICO_PEN_ADJUST_Y; }
if (keys & PBTN_LEFT) { pico_pen_x--; if (pico_pen_x < 0) pico_pen_x = 0; }
}
if (which & 0x0400) // switch renderer
{
- if (PicoOpt&0x10) { PicoOpt&=~0x10; currentConfig.EmuOpt |= 0x80; }
- else { PicoOpt|= 0x10; currentConfig.EmuOpt &= ~0x80; }
+ if (PicoIn.opt&0x10) { PicoIn.opt&=~0x10; currentConfig.EmuOpt |= 0x80; }
+ else { PicoIn.opt|= 0x10; currentConfig.EmuOpt &= ~0x80; }
vidResetMode();
- if (PicoOpt & POPT_ALT_RENDERER)
+ if (PicoIn.opt & POPT_ALT_RENDERER)
emu_status_msg("fast renderer");
else if (currentConfig.EmuOpt&0x80)
emu_status_msg("accurate renderer");
keys &= CONFIGURABLE_KEYS;
- PicoPad[0] = allActions[0] & 0xfff;
- PicoPad[1] = allActions[1] & 0xfff;
+ PicoIn.pad[0] = allActions[0] & 0xfff;
+ PicoIn.pad[1] = allActions[1] & 0xfff;
- if (allActions[0] & 0x7000) emu_DoTurbo(&PicoPad[0], allActions[0]);
- if (allActions[1] & 0x7000) emu_DoTurbo(&PicoPad[1], allActions[1]);
+ if (allActions[0] & 0x7000) emu_DoTurbo(&PicoIn.pad[0], allActions[0]);
+ if (allActions[1] & 0x7000) emu_DoTurbo(&PicoIn.pad[1], allActions[1]);
events = (allActions[0] | allActions[1]) >> 16;
events &= ~prevEvents;
- if (PicoAHW == PAHW_PICO)
+ if (PicoIn.AHW == PAHW_PICO)
RunEventsPico(events, keys);
if (events) RunEvents(events);
if (movie_data) emu_updateMovie();
target_frametime = Pico.m.pal ? (1000000<<8)/50 : (1000000<<8)/60+1;
reset_timing = 1;
- if (PicoAHW & PAHW_MCD) {
+ if (PicoIn.AHW & PAHW_MCD) {
// prepare CD buffer
PicoCDBufferInit();
// mp3...
updateKeys();
- if (!(PicoOpt&0x10))
+ if (!(PicoIn.opt&0x10))
EmuScanPrepare();
PicoFrame();
emu_set_fastforward(0);
- if (PicoAHW & PAHW_MCD) PicoCDBufferFree();
+ if (PicoIn.AHW & PAHW_MCD) PicoCDBufferFree();
if (PsndOut != NULL) {
pemu_sound_stop();
void emu_HandleResume(void)
{
- if (!(PicoAHW & PAHW_MCD)) return;
+ if (!(PicoIn.AHW & PAHW_MCD)) return;
// reopen first CD track
if (Pico_mcd->TOC.Tracks[0].F != NULL)
}
if (file) {
- if (PicoAHW & PAHW_MCD) {
+ if (PicoIn.AHW & PAHW_MCD) {
PicoCdLoadStateGfx(file);
} else {
areaSeek(file, 0x10020, SEEK_SET); // skip header and RAM in state file
{ "Player 1", MB_NONE, MA_CTRL_PLAYER1, NULL, 0, 0, 0, 1, 0 },
{ "Player 2", MB_NONE, MA_CTRL_PLAYER2, NULL, 0, 0, 0, 1, 0 },
{ "Emulator controls", MB_NONE, MA_CTRL_EMU, NULL, 0, 0, 0, 1, 0 },
- { "6 button pad", MB_ONOFF, MA_OPT_6BUTTON_PAD, &PicoOpt, 0x020, 0, 0, 1, 1 },
+ { "6 button pad", MB_ONOFF, MA_OPT_6BUTTON_PAD, &PicoIn.opt, 0x020, 0, 0, 1, 1 },
{ "Turbo rate", MB_RANGE, MA_CTRL_TURBO_RATE, ¤tConfig.turbo_rate, 0, 1, 30, 1, 1 },
{ "Done", MB_NONE, MA_CTRL_DONE, NULL, 0, 0, 0, 1, 0 },
};
if (inp & PBTN_UP ) { menu_sel--; if (menu_sel < 0) menu_sel = menu_sel_max; }
if (inp & PBTN_DOWN) { menu_sel++; if (menu_sel > menu_sel_max) menu_sel = 0; }
if (inp & PBTN_CIRCLE) {
- int is_6button = PicoOpt & POPT_6BTN_PAD;
+ int is_6button = PicoIn.opt & POPT_6BTN_PAD;
switch (selected_id) {
case MA_CTRL_PLAYER1: key_config_loop(me_ctrl_actions, is_6button ? 15 : 11, 0); return;
case MA_CTRL_PLAYER2: key_config_loop(me_ctrl_actions, is_6button ? 15 : 11, 1); return;
{ NULL, MB_NONE, MA_CDOPT_TESTBIOS_EUR, NULL, 0, 0, 0, 1, 0 },
{ NULL, MB_NONE, MA_CDOPT_TESTBIOS_JAP, NULL, 0, 0, 0, 1, 0 },
{ "CD LEDs", MB_ONOFF, MA_CDOPT_LEDS, ¤tConfig.EmuOpt, 0x0400, 0, 0, 1, 1 },
- { "CDDA audio", MB_ONOFF, MA_CDOPT_CDDA, &PicoOpt, 0x0800, 0, 0, 1, 1 },
- { "PCM audio", MB_ONOFF, MA_CDOPT_PCM, &PicoOpt, 0x0400, 0, 0, 1, 1 },
+ { "CDDA audio", MB_ONOFF, MA_CDOPT_CDDA, &PicoIn.opt, 0x0800, 0, 0, 1, 1 },
+ { "PCM audio", MB_ONOFF, MA_CDOPT_PCM, &PicoIn.opt, 0x0400, 0, 0, 1, 1 },
{ NULL, MB_NONE, MA_CDOPT_READAHEAD, NULL, 0, 0, 0, 1, 1 },
- { "SaveRAM cart", MB_ONOFF, MA_CDOPT_SAVERAM, &PicoOpt, 0x8000, 0, 0, 1, 1 },
- { "Scale/Rot. fx (slow)", MB_ONOFF, MA_CDOPT_SCALEROT_CHIP,&PicoOpt, 0x1000, 0, 0, 1, 1 },
- { "Better sync (slow)", MB_ONOFF, MA_CDOPT_BETTER_SYNC, &PicoOpt, 0x2000, 0, 0, 1, 1 },
+ { "SaveRAM cart", MB_ONOFF, MA_CDOPT_SAVERAM, &PicoIn.opt, 0x8000, 0, 0, 1, 1 },
+ { "Scale/Rot. fx (slow)", MB_ONOFF, MA_CDOPT_SCALEROT_CHIP,&PicoIn.opt, 0x1000, 0, 0, 1, 1 },
+ { "Better sync (slow)", MB_ONOFF, MA_CDOPT_BETTER_SYNC, &PicoIn.opt, 0x2000, 0, 0, 1, 1 },
{ "done", MB_NONE, MA_CDOPT_DONE, NULL, 0, 0, 0, 1, 0 },
};
menu_entry opt2_entries[] =
{
- { "Disable sprite limit", MB_ONOFF, MA_OPT2_NO_SPRITE_LIM, &PicoOpt, 0x40000, 0, 0, 1, 1 },
- { "Emulate Z80", MB_ONOFF, MA_OPT2_ENABLE_Z80, &PicoOpt, 0x00004, 0, 0, 1, 1 },
- { "Emulate YM2612 (FM)", MB_ONOFF, MA_OPT2_ENABLE_YM2612, &PicoOpt, 0x00001, 0, 0, 1, 1 },
- { "Emulate SN76496 (PSG)", MB_ONOFF, MA_OPT2_ENABLE_SN76496, &PicoOpt, 0x00002, 0, 0, 1, 1 },
+ { "Disable sprite limit", MB_ONOFF, MA_OPT2_NO_SPRITE_LIM, &PicoIn.opt, 0x40000, 0, 0, 1, 1 },
+ { "Emulate Z80", MB_ONOFF, MA_OPT2_ENABLE_Z80, &PicoIn.opt, 0x00004, 0, 0, 1, 1 },
+ { "Emulate YM2612 (FM)", MB_ONOFF, MA_OPT2_ENABLE_YM2612, &PicoIn.opt, 0x00001, 0, 0, 1, 1 },
+ { "Emulate SN76496 (PSG)", MB_ONOFF, MA_OPT2_ENABLE_SN76496, &PicoIn.opt, 0x00002, 0, 0, 1, 1 },
{ "gzip savestates", MB_ONOFF, MA_OPT2_GZIP_STATES, ¤tConfig.EmuOpt, 0x00008, 0, 0, 1, 1 },
{ "Don't save last used ROM", MB_ONOFF, MA_OPT2_NO_LAST_ROM, ¤tConfig.EmuOpt, 0x00020, 0, 0, 1, 1 },
{ "Status line in main menu", MB_ONOFF, MA_OPT2_STATUS_LINE, ¤tConfig.EmuOpt, 0x20000, 0, 0, 1, 1 },
- { "Disable idle loop patching",MB_ONOFF, MA_OPT2_NO_IDLE_LOOPS, &PicoOpt, 0x80000, 0, 0, 1, 1 },
+ { "Disable idle loop patching",MB_ONOFF, MA_OPT2_NO_IDLE_LOOPS, &PicoIn.opt, 0x80000, 0, 0, 1, 1 },
{ "Disable frame limiter", MB_ONOFF, MA_OPT2_NO_FRAME_LIMIT, ¤tConfig.EmuOpt, 0x40000, 0, 0, 1, 1 },
{ "done", MB_NONE, MA_OPT2_DONE, NULL, 0, 0, 0, 1, 0 },
};
menu_entry opt_entries[] =
{
{ NULL, MB_NONE, MA_OPT_RENDERER, NULL, 0, 0, 0, 1, 1 },
- { "Accurate sprites", MB_ONOFF, MA_OPT_ACC_SPRITES, &PicoOpt, 0x080, 0, 0, 0, 1 },
+ { "Accurate sprites", MB_ONOFF, MA_OPT_ACC_SPRITES, &PicoIn.opt, 0x080, 0, 0, 0, 1 },
{ "Show FPS", MB_ONOFF, MA_OPT_SHOW_FPS, ¤tConfig.EmuOpt, 0x0002, 0, 0, 1, 1 },
{ NULL, MB_RANGE, MA_OPT_FRAMESKIP, ¤tConfig.Frameskip, 0, -1, 16, 1, 1 },
{ "Enable sound", MB_ONOFF, MA_OPT_ENABLE_SOUND, ¤tConfig.EmuOpt, 0x0004, 0, 0, 1, 1 },
switch (entry->id)
{
case MA_OPT_RENDERER:
- if (PicoOpt & 0x10)
+ if (PicoIn.opt & 0x10)
str = "fast";
else if (currentConfig.EmuOpt & 0x80)
str = "accurate";
text_out16(x, y, "Frameskip %s", str24);
break;
case MA_OPT_SOUND_QUALITY:
- str = (PicoOpt&0x08)?"stereo":"mono";
+ str = (PicoIn.opt&0x08)?"stereo":"mono";
text_out16(x, y, "Sound Quality: %5iHz %s", PsndRate, str);
break;
case MA_OPT_REGION:
- text_out16(x, y, "Region: %s", me_region_name(PicoRegionOverride, PicoAutoRgnOrder));
+ text_out16(x, y, "Region: %s", me_region_name(PicoIn.regionOverride, PicoIn.autoRgnOrder));
break;
case MA_OPT_CONFIRM_STATES:
switch ((currentConfig.EmuOpt >> 9) & 5) {
static int rgn_orders[] = { 0x148, 0x184, 0x814, 0x418, 0x841, 0x481 };
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;
+ else 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;
+ else PicoIn.regionOverride>>=1;
}
}
static void menu_options_save(void)
{
- if (PicoRegionOverride) {
+ if (PicoIn.regionOverride) {
// force setting possibly changed..
- Pico.m.pal = (PicoRegionOverride == 2 || PicoRegionOverride == 8) ? 1 : 0;
+ Pico.m.pal = (PicoIn.regionOverride == 2 || PicoIn.regionOverride == 8) ? 1 : 0;
}
- if (!(PicoOpt & POPT_6BTN_PAD)) {
+ if (!(PicoIn.opt & POPT_6BTN_PAD)) {
// unbind XYZ MODE, just in case
unbind_action(0xf00);
}
if (!me_process(opt_entries, OPT_ENTRY_COUNT, selected_id, (inp&PBTN_RIGHT) ? 1 : 0)) {
switch (selected_id) {
case MA_OPT_RENDERER:
- if ((PicoOpt & 0x10) || !(currentConfig.EmuOpt & 0x80)) {
- PicoOpt &= ~0x10;
+ if ((PicoIn.opt & 0x10) || !(currentConfig.EmuOpt & 0x80)) {
+ PicoIn.opt &= ~0x10;
currentConfig.EmuOpt |= 0x80;
} else {
- PicoOpt |= 0x10;
+ PicoIn.opt |= 0x10;
currentConfig.EmuOpt &= ~0x80;
}
break;
unsigned int offs1024 = 0;
int cdda_on;
- cdda_on = (PicoAHW & PAHW_MCD) && (PicoOpt&0x800) && !(Pico_mcd->s68k_regs[0x36] & 1) &&
+ cdda_on = (PicoIn.AHW & PAHW_MCD) && (PicoIn.opt&0x800) && !(Pico_mcd->s68k_regs[0x36] & 1) &&
(Pico_mcd->scd.Status_CDC & 1) && mp3_handle >= 0;
if (cdda_on) {
static void PrepareForROM(void)\r
{\r
unsigned char *rom_data = NULL;\r
- int i, ret, show = PicoAHW & PAHW_PICO;\r
+ int i, ret, show = PicoIn.AHW & PAHW_PICO;\r
\r
PicoGetInternal(PI_ROM, (pint_ret_t *) &rom_data);\r
EnableMenuItem(mmain, 2, MF_BYPOSITION|(show ? MF_ENABLED : MF_GRAYED));\r
static void update_sound(int len)
{
/* avoid writing audio when lagging behind to prevent audio lag */
- if (PicoSkipFrame != 2)
+ if (PicoIn.skipFrame != 2)
DSoundUpdate(sndbuff, (currentConfig.EmuOpt & EOPT_NO_FRMLIMIT) ? 0 : 1);
}
{
PsndRerate(0);
- ret = DSoundInit(FrameWnd, PsndRate, (PicoOpt & POPT_EN_STEREO) ? 1 : 0, PsndLen);
+ ret = DSoundInit(FrameWnd, PsndRate, (PicoIn.opt & POPT_EN_STEREO) ? 1 : 0, PsndLen);
if (ret != 0) {
lprintf("dsound init failed\n");
return;
DUMP_EST(f, Pico);
DUMP_EST(f, PicoMem_vram);
DUMP_EST(f, PicoMem_cram);
- DUMP_EST(f, PicoOpt);
+ DUMP_EST(f, PicoIn.opt);
DUMP_EST(f, Draw2FB);
DUMP_EST(f, HighPal);
DUMP_PMEM(f, vram);