static int do_print(struct pdb_cpu *cpu, const char *args)
{
- int i;
elprintf(EL_STATUS, "cpu %d (%s)", cpu->id, cpu->name);
+#ifndef NO_32X
if (cpu->type == PDBCT_SH2) {
SH2 *sh2 = cpu->context;
+ int i;
printf("PC,SR %08x, %03x\n", sh2->pc, sh2->sr & 0x3ff);
for (i = 0; i < 16/2; i++)
printf("R%d,%2d %08x,%08x\n", i, i + 8, sh2->r[i], sh2->r[i + 8]);
Pico32x.sh2irq_mask[sh2->is_slave]);
printf("cycles %d/%d (%d)\n", sh2->cycles_done, sh2->cycles_aim, (signed int)sh2->sr >> 12);
}
+#endif
return CMDRET_DONE;
}
struct Pico32x Pico32x;
SH2 sh2s[2];
-int p32x_msh2_multiplier = MSH2_MULTI_DEFAULT;
-int p32x_ssh2_multiplier = SSH2_MULTI_DEFAULT;
-
static int REGPARM(2) sh2_irq_cb(SH2 *sh2, int level)
{
if (sh2->pending_irl > sh2->pending_int_irq) {
char *PDebug32x(void)
{
+#ifndef NO_32X
char *dstrp = dstr;
unsigned short *r;
int i;
sprintf(dstrp, "gb,vb %08x,%08x %08x,%08x\n", sh2_gbr(0), sh2_vbr(0), sh2_gbr(1), sh2_vbr(1)); MVP;
sprintf(dstrp, "IRQs/mask: %02x/%02x %02x/%02x\n",
Pico32x.sh2irqi[0], Pico32x.sh2irq_mask[0], Pico32x.sh2irqi[1], Pico32x.sh2irq_mask[1]); MVP;
+#else
+ dstr[0] = 0;
+#endif
return dstr;
}
dump_ram_noswab(Pico_mcd->bram, "dumps/bram.bin");
}
+#ifndef NO_32X
if (PicoAHW & PAHW_32X)
{
dump_ram(Pico32xMem->sdram, "dumps/sdram.bin");
dump_ram(Pico32xMem->data_array[0], "dumps/data_array0.bin");
dump_ram(Pico32xMem->data_array[1], "dumps/data_array1.bin");
}
+#endif
}
void PDebugZ80Frame(void)
elprintf(EL_YMTIMER, "load: %i/%i, timer_b_next_oflow %i", tbt>>16, tbc>>16, timer_b_next_oflow >> 8);\r
}\r
\r
+#if defined(NO_32X) && defined(_ASM_MEMORY_C)\r
+// referenced by asm code\r
+u32 PicoRead8_32x(u32 a) { return 0; }\r
+u32 PicoRead16_32x(u32 a) { return 0; }\r
+void PicoWrite8_32x(u32 a, u32 d) {}\r
+void PicoWrite16_32x(u32 a, u32 d) {}\r
+#endif\r
+\r
// -----------------------------------------------------------------\r
// z80 memhandlers\r
\r
int emustatus; // rapid_ym2612, multi_ym_updates\r
int scanlines_total;\r
\r
+int p32x_msh2_multiplier = MSH2_MULTI_DEFAULT;\r
+int p32x_ssh2_multiplier = SSH2_MULTI_DEFAULT;\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
void (*PicoLineHook)(void) = NULL;\r
extern void (*PicoMCDcloseTray)(void);\r
extern int PicoCDBuffers;\r
\r
-// Pico/Pico.c\r
+// pico.c\r
#define XPCM_BUFFER_SIZE (320+160)\r
typedef struct\r
{\r
extern unsigned short *PicoCramHigh; // pointer to CRAM buff (0x40 shorts), converted to native device color (works only with 16bit for now)\r
extern void (*PicoPrepareCram)(); // prepares PicoCramHigh for renderer to use\r
\r
-// 32x/32x.c\r
+// pico.c (32x)\r
// multipliers against 68k clock\r
extern int p32x_msh2_multiplier;\r
extern int p32x_ssh2_multiplier;\r
extern int PsndDacLine;\r
\r
// sms.c\r
+#ifndef NO_SMS\r
void PicoPowerMS(void);\r
void PicoResetMS(void);\r
void PicoMemSetupMS(void);\r
void PicoStateLoadedMS(void);\r
void PicoFrameMS(void);\r
void PicoFrameDrawOnlyMS(void);\r
+#else\r
+#define PicoPowerMS()\r
+#define PicoResetMS()\r
+#define PicoMemSetupMS()\r
+#define PicoStateLoadedMS()\r
+#define PicoFrameMS()\r
+#define PicoFrameDrawOnlyMS()\r
+#endif\r
\r
// 32x/32x.c\r
+#ifndef NO_32X\r
extern struct Pico32x Pico32x;\r
void Pico32xInit(void);\r
void PicoPower32x(void);\r
void p32x_timers_do(int line_call);\r
void p32x_timers_recalc(void);\r
extern int pwm_frame_smp_cnt;\r
+#else\r
+#define Pico32xInit()\r
+#define PicoPower32x()\r
+#define PicoReset32x()\r
+#define PicoFrame32x()\r
+#define PicoUnload32x()\r
+#define Pico32xStateLoaded()\r
+#define PicoDraw32xSetFrameMode(...)\r
+#define FinalizeLine32xRGB555 NULL\r
+#define p32x_pwm_update(...)\r
+#define p32x_timers_recalc()\r
+#endif\r
\r
/* avoid dependency on newer glibc */\r
static __inline int isspace_(int c)\r
wram_2M_to_1M(Pico_mcd->word_ram2M);\r
}\r
\r
+#ifndef NO_32X\r
if (PicoAHW & PAHW_32X)\r
{\r
unsigned char cpubuff[SH2_STATE_SIZE];\r
CHECKED_WRITE_BUFF(CHUNK_DRAM, Pico32xMem->dram);\r
CHECKED_WRITE_BUFF(CHUNK_32XPAL, Pico32xMem->pal);\r
}\r
+#endif\r
\r
if (carthw_chunks != NULL)\r
{\r
case CHUNK_MISC_CD: CHECKED_READ_BUFF(Pico_mcd->m); break;\r
\r
// 32x stuff\r
+#ifndef NO_32X\r
case CHUNK_MSH2:\r
CHECKED_READ_BUFF(buff_sh2);\r
sh2_unpack(&sh2s[0], buff_sh2);\r
case CHUNK_SDRAM: CHECKED_READ_BUFF(Pico32xMem->sdram); break;\r
case CHUNK_DRAM: CHECKED_READ_BUFF(Pico32xMem->dram); break;\r
case CHUNK_32XPAL: CHECKED_READ_BUFF(Pico32xMem->pal); break;\r
-\r
+#endif\r
default:\r
if (carthw_chunks != NULL)\r
{\r
case CHUNK_VSRAM: CHECKED_READ_BUFF(Pico.vsram); found++; break;\r
case CHUNK_VIDEO: CHECKED_READ_BUFF(Pico.video); found++; break;\r
\r
+#ifndef NO_32X\r
case CHUNK_DRAM:\r
if (Pico32xMem != NULL)\r
CHECKED_READ_BUFF(Pico32xMem->dram);\r
case CHUNK_32XSYS:\r
CHECKED_READ_BUFF(Pico32x);\r
break;\r
-\r
+#endif\r
default:\r
areaSeek(file, len, SEEK_CUR);\r
break;\r
memcpy(t->vsram, Pico.vsram, sizeof(Pico.vsram));\r
memcpy(&t->video, &Pico.video, sizeof(Pico.video));\r
\r
+#ifndef NO_32X\r
if (PicoAHW & 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
}\r
+#endif\r
\r
return t;\r
}\r
memcpy(&Pico.video, &t->video, sizeof(Pico.video));\r
Pico.m.dirtyPal = 1;\r
\r
+#ifndef NO_32X\r
if (PicoAHW & 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
Pico32x.dirty_pal = 1;\r
}\r
+#endif\r
}\r
\r
// vim:shiftwidth=2:expandtab\r
# === Pico core ===
# Pico
OBJS += pico/state.o pico/cart.o pico/memory.o pico/pico.o pico/sek.o pico/z80if.o \
- pico/videoport.o pico/draw2.o pico/draw.o pico/mode4.o pico/sms.o \
+ pico/videoport.o pico/draw2.o pico/draw.o pico/mode4.o \
pico/misc.o pico/eeprom.o pico/patch.o pico/debug.o
+# SMS
+ifneq "$(no_sms)" "1"
+OBJS += pico/sms.o
+else
+DEFINES += NO_SMS
+endif
# CD
OBJS += pico/cd/pico.o pico/cd/memory.o pico/cd/sek.o pico/cd/LC89510.o \
pico/cd/cd_sys.o pico/cd/cd_file.o pico/cd/cue.o pico/cd/gfx_cd.o \
pico/cd/misc.o pico/cd/pcm.o pico/cd/buffering.o
# 32X
+ifneq "$(no_32x)" "1"
OBJS += pico/32x/32x.o pico/32x/memory.o pico/32x/draw.o pico/32x/pwm.o
+else
+DEFINES += NO_32X
+endif
# Pico
OBJS += pico/pico/pico.o pico/pico/memory.o pico/pico/xpcm.o
# carthw
endif
# --- SH2 ---
-OBJS += cpu/sh2/sh2.o
OBJS += cpu/drc/cmn.o
+ifneq "$(no_32x)" "1"
+OBJS += cpu/sh2/sh2.o
#
ifeq "$(use_sh2drc)" "1"
DEFINES += DRC_SH2
DEFINES += DRC_DEBUG_INTERP
use_sh2mame = 1
endif
-endif
+endif # use_sh2drc
#
ifeq "$(use_sh2mame)" "1"
OBJS += cpu/sh2/mame/sh2pico.o
endif
+endif # !no_32x
DIRS += platform platform/common pico pico/cd pico/pico pico/32x pico/sound pico/carthw/svp \
\r
static void system_announce(void)\r
{\r
- const char *sys_name, *tv_standard;\r
+ const char *sys_name, *tv_standard, *extra = "";\r
int fps;\r
\r
if (PicoAHW & PAHW_SMS) {\r
sys_name = "Master System";\r
+#ifdef NO_SMS\r
+ extra = " [no support]";\r
+#endif\r
} else if (PicoAHW & PAHW_PICO) {\r
sys_name = "Pico";\r
} else if (PicoAHW & PAHW_MCD) {\r
tv_standard = Pico.m.pal ? "PAL" : "NTSC";\r
fps = Pico.m.pal ? 50 : 60;\r
\r
- emu_status_msg("%s %s / %dFPS", tv_standard, sys_name, fps);\r
+ emu_status_msg("%s %s / %dFPS%s", tv_standard, sys_name, fps, extra);\r
}\r
\r
// note: this function might mangle rom_fname\r