deal with some strict aliasing issues
[picodrive.git] / pico / cd / pico.c
index 383949c..2b65295 100644 (file)
@@ -1,5 +1,10 @@
-// (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"
 #include "../sound/ym2612.h"
@@ -38,7 +43,7 @@ PICO_INTERNAL int PicoResetMCD(void)
   memset(&Pico_mcd->pcm, 0, sizeof(Pico_mcd->pcm));
   memset(&Pico_mcd->m, 0, sizeof(Pico_mcd->m));
 
-  *(unsigned int *)(Pico_mcd->bios + 0x70) = 0xffffffff; // reset hint vector (simplest way to implement reg6)
+  memset(Pico_mcd->bios + 0x70, 0xff, 4); // reset hint vector (simplest way to implement reg6)
   Pico_mcd->m.state_flags |= 1; // s68k reset pending
   Pico_mcd->s68k_regs[3] = 1; // 2M word RAM mode with m68k access after reset
 
@@ -63,30 +68,6 @@ PICO_INTERNAL int PicoResetMCD(void)
   return 0;
 }
 
-static __inline void SekRunM68k(int cyc)
-{
-  int cyc_do;
-
-  pprof_start(m68k);
-
-  SekCycleAim+=cyc;
-  if ((cyc_do=SekCycleAim-SekCycleCnt) <= 0) return;
-#if defined(EMU_CORE_DEBUG)
-  SekCycleCnt+=CM_compareRun(cyc_do, 0);
-#elif defined(EMU_C68K)
-  PicoCpuCM68k.cycles=cyc_do;
-  CycloneRun(&PicoCpuCM68k);
-  SekCycleCnt+=cyc_do-PicoCpuCM68k.cycles;
-#elif defined(EMU_M68K)
-  m68k_set_context(&PicoCpuMM68k);
-  SekCycleCnt+=m68k_execute(cyc_do);
-#elif defined(EMU_F68K)
-  g_m68kcontext=&PicoCpuFM68k;
-  SekCycleCnt+=fm68k_emulate(cyc_do, 0, 0);
-#endif
-  pprof_end(m68k);
-}
-
 static __inline void SekRunS68k(int cyc)
 {
   int cyc_do;
@@ -101,9 +82,11 @@ static __inline void SekRunS68k(int cyc)
 #elif defined(EMU_M68K)
   m68k_set_context(&PicoCpuMS68k);
   SekCycleCntS68k+=m68k_execute(cyc_do);
+  m68k_set_context(&PicoCpuMM68k);
 #elif defined(EMU_F68K)
   g_m68kcontext=&PicoCpuFS68k;
   SekCycleCntS68k+=fm68k_emulate(cyc_do, 0, 0);
+  g_m68kcontext=&PicoCpuFM68k;
 #endif
 }