cd: switch to CD controller code from genplus
[picodrive.git] / pico / cd / sek.c
index 789bb18..d491490 100644 (file)
@@ -1,11 +1,16 @@
-// (c) Copyright 2007 notaz, All rights reserved.
-
+/*
+ * PicoDrive
+ * (C) notaz, 2007
+ *
+ * This work is licensed under the terms of MAME license.
+ * See COPYING file in the top-level directory.
+ */
 
 #include "../pico_int.h"
 
 
-int SekCycleCntS68k=0; // cycles done in this frame
-int SekCycleAimS68k=0; // cycle aim
+unsigned int SekCycleCntS68k;
+unsigned int SekCycleAimS68k;
 
 
 /* context */
@@ -52,10 +57,7 @@ static void SekResetAckS68k(void)
 
 static int SekUnrecognizedOpcodeS68k(void)
 {
-  unsigned int pc, op;
-  pc = SekPcS68k;
-  op = PicoCpuCS68k.read16(pc);
-  elprintf(EL_ANOMALY, "Unrecognized Opcode %04x @ %06x", op, pc);
+  elprintf(EL_ANOMALY, "Unrecognized Opcode @ %06x", SekPcS68k);
   //exit(1);
   return 0;
 }
@@ -187,3 +189,17 @@ PICO_INTERNAL int SekInterruptS68k(int irq)
   return 0;
 }
 
+void SekInterruptClearS68k(int irq)
+{
+  int level_new = new_irq_level(irq);
+
+#ifdef EMU_C68K
+  PicoCpuCS68k.irq = level_new;
+#endif
+#ifdef EMU_M68K
+  CPU_INT_LEVEL = level_new << 8;
+#endif
+#ifdef EMU_F68K
+  PicoCpuFS68k.interrupts[0] = level_new;
+#endif
+}