コード例 #1
0
void
S9xMainLoop(void)
{
#ifndef ASMCPU
   if (Settings.APUEnabled == 1)
   {
#ifdef USE_SA1
      if (Settings.SA1)
         S9xMainLoop_SA1_APU();
      else
#endif
         S9xMainLoop_NoSA1_APU();
   }
   else
   {
#ifdef USE_SA1
      if (Settings.SA1)
         S9xMainLoop_SA1_NoAPU();
      else
#endif
         S9xMainLoop_NoSA1_NoAPU();
   }
#else
#ifdef ASM_SPC700
   if (Settings.asmspc700)
      asmMainLoop_spcAsm(&CPU);
   else
#endif
      asmMainLoop_spcC(&CPU);
#endif
   Registers.PC = CPU.PC - CPU.PCBase;

#ifndef ASMCPU
   S9xPackStatus();
#endif

   S9xAPUPackStatus();


   //if (CPU.Flags & SCAN_KEYS_FLAG)
   // {
   CPU.Flags &= ~SCAN_KEYS_FLAG;
   //}

   if (CPU.BRKTriggered && Settings.SuperFX && !CPU.TriedInterleavedMode2)
   {
      CPU.TriedInterleavedMode2 = TRUE;
      CPU.BRKTriggered = FALSE;
      S9xDeinterleaveMode2();
   }
}
コード例 #2
0
void S9xMainLoop (void)
{
	START_PROFILE_FUNC (S9xMainLoop);
	//CPUPack.Setting_SA1=Settings.SA1;
	if (Settings.APUEnabled) {
		if (Settings.SA1) S9xMainLoop_SA1_APU();
		else {
			S9xMainLoop_NoSA1_APU();
		}				
	} else {
		if (Settings.SA1) S9xMainLoop_SA1_NoAPU();
		else S9xMainLoop_NoSA1_NoAPU();
	}
	
#ifndef ME_SOUND	
	if (cpu_glob_cycles>=0x00000000) {		
			APU_EXECUTE2 ();
	}		
#endif	
	
  CPUPack.Registers.PC = CPUPack.CPU.PC - CPUPack.CPU.PCBase;
    
  S9xPackStatus ();
      
  if (CPUPack.CPU.Flags & SCAN_KEYS_FLAG) {
    FINISH_PROFILE_FUNC (S9xMainLoop);
    S9xSyncSpeed ();
    CPUPack.CPU.Flags &= ~SCAN_KEYS_FLAG;
  }
  if (CPUPack.CPU.BRKTriggered && Settings.SuperFX && !CPUPack.CPU.TriedInterleavedMode2) {
    CPUPack.CPU.TriedInterleavedMode2 = TRUE;
    CPUPack.CPU.BRKTriggered = FALSE;
    S9xDeinterleaveMode2 ();
  }

  /*(APURegistersUncached.PC) = (IAPUuncached.PC) - (IAPUuncached.RAM);
  S9xAPUPackStatusUncached ();*/
}