Example #1
0
void asm_S9xOpcode_NMI(void)
{
#ifdef __debug_c_nmi__
   printf("nmi\n");
#endif
   // S9xUnpackStatus(); // not needed

   if (!CheckEmulation())
   {
      PushB(Registers.PB);
      PushW(CPU.PC - CPU.PCBase);
      // S9xPackStatus ();
      PushB(Registers.PL);
      ClearDecimal();
      SetIRQ();

      Registers.PB = 0;
      // c = 0; // unused
#ifdef USE_SA1
      if (Settings.SA1 && (Memory.FillRAM [0x2209] & 0x20))
         S9xSetPCBase(Memory.FillRAM [0x220c] |
                      (Memory.FillRAM [0x220d] << 8));
      else
#endif
         S9xSetPCBase(S9xGetWord(0xFFEA));
#ifdef VAR_CYCLES
      CPU.Cycles += TWO_CYCLES;
#else
      CPU.Cycles += 8;
#endif
   }
   else
   {
      PushW(CPU.PC - CPU.PCBase);
      // S9xPackStatus (); // not needed
      PushB(Registers.PL);
      ClearDecimal();
      SetIRQ();

      Registers.PB = 0;
      // ICPU.ShiftedPB = 0; // unused
#ifdef USE_SA1
      if (Settings.SA1 && (Memory.FillRAM [0x2209] & 0x20))
         S9xSetPCBase(Memory.FillRAM [0x220c] |
                      (Memory.FillRAM [0x220d] << 8));
      else
#endif
         S9xSetPCBase(S9xGetWord(0xFFFA));
#ifdef VAR_CYCLES
      CPU.Cycles += ONE_CYCLE;
#else
      CPU.Cycles += 6;
#endif
   }

   // S9xPackStatus(); // not needed
}
void Apu3F()  // CALL absolute
{
   Absolute();
   // 0xB6f for Star Fox 2
   PushW((IAPU.PC + 3 - IAPU.RAM));
   IAPU.PC = IAPU.RAM + IAPU.Address;
}
Example #3
0
static void TCall()
{
	ot("  sub   r0,spc_pc,spc_ram\n");
	PushW();
	ot("  ldr   r0,[context,#iapu_extraram]\n");
	ot("  ldrh  r0,[r0,#0x%x]\n", (15-(opcode>>4))<<1);
	ot("  add   spc_pc,spc_ram,r0\n");
}
void Apu0F()
{
   // BRK

#if 0
   STOP("BRK");
#else
   PushW((IAPU.PC + 1 - IAPU.RAM));
   S9xAPUPackStatus();
   Push(IAPU.P);
   APUSetBreak();
   APUClearInterrupt();
   // XXX:Where is the BRK vector ???
   IAPU.PC = IAPU.RAM + APU.ExtraRAM[0x20] + (APU.ExtraRAM[0x21] << 8);
#endif
}
void Apu4F()  // PCALL $XX
{
   uint8 Work8 = OP1;
   PushW((IAPU.PC + 2 - IAPU.RAM));
   IAPU.PC = IAPU.RAM + 0xff00 + Work8;
}