\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)(int count) = NULL;\r
+void (*PicoLineHook)(void) = NULL;\r
\r
// to be called once on emu init\r
void PicoInit(void)\r
}\r
\r
\r
-// TODO: rm from asm too\r
+// TODO: rm from Sek.c+asm too\r
int idle_hit_counter = 0;\r
\r
void PicoFrame(void)\r
dstrp+=strlen(dstrp);\r
sprintf(dstrp, "display_disable: %i, M3: %i, palette: %i, ?, hints: %i\n", bit(r,0), bit(r,1), bit(r,2), bit(r,4));\r
dstrp+=strlen(dstrp);\r
- sprintf(dstrp, "mode set 2: %02x\n", (r=reg[1])); dstrp+=strlen(dstrp);\r
+ sprintf(dstrp, "mode set 2: %02x hcnt: %i\n", (r=reg[1]), pv->reg[10]); dstrp+=strlen(dstrp);\r
sprintf(dstrp, "SMS/gen: %i, pal: %i, dma: %i, vints: %i, disp: %i, TMS: %i\n", bit(r,2), bit(r,3), bit(r,4),\r
bit(r,5), bit(r,6), bit(r,7)); dstrp+=strlen(dstrp);\r
sprintf(dstrp, "mode set 3: %02x\n", (r=reg[0xB])); dstrp+=strlen(dstrp);\r
PicoPicoPCMRerate(rate);
}
-static void PicoLinePico(int count)
+static void PicoLinePico(void)
{
- PicoPicohw.line_counter += count;
+ PicoPicohw.line_counter++;
#if 1
if ((PicoPicohw.r12 & 0x4003) && PicoPicohw.line_counter - prev_line_cnt_irq3 > 200) {
if (PicoPicohw.fifo_bytes > 0)
{
- PicoPicohw.fifo_line_bytes += fifo_bytes_line * count;
+ PicoPicohw.fifo_line_bytes += fifo_bytes_line;
if (PicoPicohw.fifo_line_bytes >= (1<<16)) {
PicoPicohw.fifo_bytes -= PicoPicohw.fifo_line_bytes >> 16;
PicoPicohw.fifo_line_bytes &= 0xffff;
#ifdef PICO_CD
update_chips();
#else
- if (PicoLineHook) PicoLineHook(1);
+ if (PicoLineHook) PicoLineHook();
#endif
}
#ifdef PICO_CD
update_chips();
#else
- if (PicoLineHook) PicoLineHook(1);
+ if (PicoLineHook) PicoLineHook();
#endif
// PAL line count might actually be 313 according to Steve Snake, but that would complicate things.
#ifdef PICO_CD
update_chips();
#else
- if (PicoLineHook) PicoLineHook(1);
+ if (PicoLineHook) PicoLineHook();
#endif
}
extern struct PicoSRAM SRam;\r
extern int emustatus;\r
extern void (*PicoResetHook)(void);\r
-extern void (*PicoLineHook)(int count);\r
+extern void (*PicoLineHook)(void);\r
PICO_INTERNAL int CheckDMA(void);\r
PICO_INTERNAL void PicoDetectRegion(void);\r
PICO_INTERNAL void PicoSyncZ80(int m68k_cycles_done);\r
switch (bytes)\r
{\r
case 4:\r
- if ( (*dst & 0xfff8) == 0x4a10 || // tst.b ($aX) // where should be no need to wait\r
- (*dst & 0xfff8) == 0x4a28 || // tst.b ($xxxx,a0) // for byte change anywhere\r
- (*dst & 0xff3f) == 0x4a38 || // tst.x ($xxxx.w), tas ($xxxx.w)\r
+ if ( (*dst & 0xfff8) == 0x4a10 || // tst.b ($aX) // there should be no need to wait\r
+ (*dst & 0xfff8) == 0x4a28 || // tst.b ($xxxx,a0) // for byte change anywhere\r
+ (*dst & 0xff3f) == 0x4a38 || // tst.x ($xxxx.w); tas ($xxxx.w)\r
(*dst & 0xc1ff) == 0x0038 || // move.x ($xxxx.w), dX\r
(*dst & 0xf13f) == 0xb038) // cmp.x ($xxxx.w), dX\r
return 1;\r
break;\r
case 6:\r
- if ( ((dst[1] & 0xe0) == 0xe0 && ( // RAM\r
- *dst == 0x4a39 || // tst.b ($xxxxxxxx)\r
- *dst == 0x4a79 || // tst.w ($xxxxxxxx)\r
- *dst == 0x4ab9)) || // tst.l ($xxxxxxxx)\r
- *dst == 0x0838) // btst $X, ($xxxx.w) [6 byte op]\r
+ if ( ((dst[1] & 0xe0) == 0xe0 && ( // RAM and\r
+ *dst == 0x4a39 || // tst.b ($xxxxxxxx)\r
+ *dst == 0x4a79 || // tst.w ($xxxxxxxx)\r
+ *dst == 0x4ab9 || // tst.l ($xxxxxxxx)\r
+ (*dst & 0xc1ff) == 0x0039 || // move.x ($xxxxxxxx), dX\r
+ (*dst & 0xf13f) == 0xb039))||// cmp.x ($xxxxxxxx), dX\r
+ *dst == 0x0838 || // btst $X, ($xxxx.w) [6 byte op]\r
+ (*dst & 0xffbf) == 0x0c38) // cmpi.{b,w} $X, ($xxxx.w)\r
return 1;\r
break;\r
case 8:\r
- if ( (dst[2] & 0xe0) == 0xe0 && ( // RAM\r
- *dst == 0x0839 || // btst $X, ($xxxxxxxx.w) [8 byte op]\r
- (*dst & 0xffbf) == 0x0c39)) // cmpi.{b,w} $X, ($xxxxxxxx)\r
+ if ( ((dst[2] & 0xe0) == 0xe0 && ( // RAM and\r
+ *dst == 0x0839 || // btst $X, ($xxxxxxxx.w) [8 byte op]\r
+ (*dst & 0xffbf) == 0x0c39))||// cmpi.{b,w} $X, ($xxxxxxxx)\r
+ *dst == 0x0cb8) // cmpi.l $X, ($xxxx.w)\r
return 1;\r
break;\r
case 12:\r
if ((*dst & 0xf1f8) == 0x3010 && // move.w (aX), dX\r
- (dst[1]&0xf100) == 0x0000 && // arithmetic\r
- (dst[3]&0xf100) == 0x0000) // arithmetic\r
+ (dst[1]&0xf100) == 0x0000 && // arithmetic\r
+ (dst[3]&0xf100) == 0x0000) // arithmetic\r
return 1;\r
break;\r
}\r
#endif\r
pc &= ~0xff000000;\r
elprintf(EL_IDLE, "idle: patch %06x %04x %04x #%i", pc, oldop, newop, idledet_count);\r
- if (pc > Pico.romsize) {\r
+ if (pc > Pico.romsize && !(PicoAHW & PAHW_SVP)) {\r
if (++idledet_bads > 128) return 2; // remove detector\r
return 1; // don't patch\r
}\r
idledet_addrs = tmp;\r
}\r
\r
- idledet_addrs[idledet_count++] = pc;\r
+ if (pc < Pico.romsize)\r
+ idledet_addrs[idledet_count++] = pc;\r
+\r
return 0;\r
}\r
\r