Beispiel #1
0
void ApuDA()
{
   // MOVW dp,YA
   S9xAPUSetByteZ(IAPU.Registers.YA.B.A, OP1);
   S9xAPUSetByteZ(IAPU.Registers.YA.B.Y, OP1 + 1);
   IAPU.PC += 2;
}
Beispiel #2
0
void Apu8F()
{
   // MOV dp,#00
   uint8_t Work8 = OP1;
   S9xAPUSetByteZ(Work8, OP2);
   IAPU.PC += 3;
}
Beispiel #3
0
void Apu4B()
{
   // LSR dp
   uint8_t Work8 = S9xAPUGetByteZ(OP1);
   LSR(Work8);
   S9xAPUSetByteZ(Work8, OP1);
   IAPU.PC += 2;
}
void Apu39()
{
   // AND (X),(Y)
   uint8 Work8 = S9xAPUGetByteZ(IAPU.X) & S9xAPUGetByteZ(IAPU.YA.B.Y);
   APUSetZN8(Work8);
   S9xAPUSetByteZ(Work8, IAPU.X);
   IAPU.PC++;
}
Beispiel #5
0
void Apu7B()
{
   // ROR dp+X
   uint8_t Work8 = S9xAPUGetByteZ(OP1 + IAPU.Registers.X);
   ROR(Work8);
   S9xAPUSetByteZ(Work8, OP1 + IAPU.Registers.X);
   IAPU.PC += 2;
}
void Apu5B()
{
   // LSR dp+X
   uint8 Work8 = S9xAPUGetByteZ(OP1 + IAPU.X);
   LSR(Work8);
   S9xAPUSetByteZ(Work8, OP1 + IAPU.X);
   IAPU.PC += 2;
}
void Apu19()
{
   // OR (X),(Y)
   uint8 Work8 = S9xAPUGetByteZ(IAPU.X) | S9xAPUGetByteZ(IAPU.YA.B.Y);
   APUSetZN8(Work8);
   S9xAPUSetByteZ(Work8, IAPU.X);
   IAPU.PC++;
}
Beispiel #8
0
void Apu0B()
{
   // ASL dp
   uint8_t Work8 = S9xAPUGetByteZ(OP1);
   ASL(Work8);
   S9xAPUSetByteZ(Work8, OP1);
   IAPU.PC += 2;
}
void Apu3B()
{
   // ROL dp+X
   uint8 Work8 = S9xAPUGetByteZ(OP1 + IAPU.X);
   ROL(Work8);
   S9xAPUSetByteZ(Work8, OP1 + IAPU.X);
   IAPU.PC += 2;
}
void Apu2B()
{
   // ROL dp
   uint8 Work8 = S9xAPUGetByteZ(OP1);
   ROL(Work8);
   S9xAPUSetByteZ(Work8, OP1);
   IAPU.PC += 2;
}
Beispiel #11
0
void Apu6B()
{
   // ROR dp
   uint8_t Work8 = S9xAPUGetByteZ(OP1);
   ROR(Work8);
   S9xAPUSetByteZ(Work8, OP1);
   IAPU.PC += 2;
}
Beispiel #12
0
void Apu1B()
{
   // ASL dp+X
   uint8_t Work8 = S9xAPUGetByteZ(OP1 + IAPU.Registers.X);
   ASL(Work8);
   S9xAPUSetByteZ(Work8, OP1 + IAPU.Registers.X);
   IAPU.PC += 2;
}
Beispiel #13
0
void Apu59()
{
   // EOR (X),(Y)
   uint8_t Work8 = S9xAPUGetByteZ(IAPU.Registers.X) ^ S9xAPUGetByteZ(
                    IAPU.Registers.YA.B.Y);
   APUSetZN8(Work8);
   S9xAPUSetByteZ(Work8, IAPU.Registers.X);
   IAPU.PC++;
}
Beispiel #14
0
void Apu18()
{
   // OR dp,#00
   uint8_t Work8 = OP1;
   Work8 |= S9xAPUGetByteZ(OP2);
   S9xAPUSetByteZ(Work8, OP2);
   APUSetZN8(Work8);
   IAPU.PC += 3;
}
void Apu58()
{
   // EOR dp,#00
   uint8 Work8 = OP1;
   Work8 ^= S9xAPUGetByteZ(OP2);
   S9xAPUSetByteZ(Work8, OP2);
   APUSetZN8(Work8);
   IAPU.PC += 3;
}
void Apu49()
{
   // EOR dp(dest),dp(src)
   uint8 Work8 = S9xAPUGetByteZ(OP1);
   Work8 ^= S9xAPUGetByteZ(OP2);
   S9xAPUSetByteZ(Work8, OP2);
   APUSetZN8(Work8);
   IAPU.PC += 3;
}
Beispiel #17
0
void Apu99()
{
   // ADC (X),(Y)
   uint8_t W1 = S9xAPUGetByteZ(IAPU.Registers.X);
   uint8_t Work8 = S9xAPUGetByteZ(IAPU.Registers.YA.B.Y);
   ADC(W1, Work8);
   S9xAPUSetByteZ(W1, IAPU.Registers.X);
   IAPU.PC++;
}
Beispiel #18
0
void Apu38()
{
   // AND dp,#00
   uint8_t Work8 = OP1;
   Work8 &= S9xAPUGetByteZ(OP2);
   S9xAPUSetByteZ(Work8, OP2);
   APUSetZN8(Work8);
   IAPU.PC += 3;
}
Beispiel #19
0
void Apu98()
{
   // ADC dp,#00
   uint8_t Work8 = OP1;
   uint8_t W1 = S9xAPUGetByteZ(OP2);
   ADC(W1, Work8);
   S9xAPUSetByteZ(W1, OP2);
   IAPU.PC += 3;
}
Beispiel #20
0
void Apu09()
{
   // OR dp(dest),dp(src)
   uint8_t Work8 = S9xAPUGetByteZ(OP1);
   Work8 |= S9xAPUGetByteZ(OP2);
   S9xAPUSetByteZ(Work8, OP2);
   APUSetZN8(Work8);
   IAPU.PC += 3;
}
Beispiel #21
0
void Apu89()
{
   // ADC dp(dest),dp(src)
   uint8_t Work8 = S9xAPUGetByteZ(OP1);
   uint8_t W1 = S9xAPUGetByteZ(OP2);
   ADC(W1, Work8);
   S9xAPUSetByteZ(W1, OP2);
   IAPU.PC += 3;
}
Beispiel #22
0
void Apu3A()
{
   // INCW dp
   uint16_t Work16 = S9xAPUGetByteZ(OP1) + (S9xAPUGetByteZ(OP1 + 1) << 8);
   Work16++;
   S9xAPUSetByteZ((uint8_t) Work16, OP1);
   S9xAPUSetByteZ(Work16 >> 8, OP1 + 1);
   APUSetZN16(Work16);
   IAPU.PC += 2;
}
void Apu1A()
{
   // DECW dp
   uint16 Work16 = S9xAPUGetByteZ(OP1) + (S9xAPUGetByteZ(OP1 + 1) << 8);
   Work16--;
   S9xAPUSetByteZ((uint8) Work16, OP1);
   S9xAPUSetByteZ(Work16 >> 8, OP1 + 1);
   APUSetZN16(Work16);
   IAPU.PC += 2;
}
Beispiel #24
0
void Apu9B()
{
   // DEC dp+X
   uint8_t Work8 = S9xAPUGetByteZ(OP1 + IAPU.Registers.X) - 1;
   S9xAPUSetByteZ(Work8, OP1 + IAPU.Registers.X);
   APUSetZN8(Work8);

#ifdef SPC700_SHUTDOWN
   IAPU.WaitCounter++;
#endif

   IAPU.PC += 2;
}
Beispiel #25
0
void Apu8B()
{
   // DEC dp
   uint8_t Work8 = S9xAPUGetByteZ(OP1) - 1;
   S9xAPUSetByteZ(Work8, OP1);
   APUSetZN8(Work8);

#ifdef SPC700_SHUTDOWN
   IAPU.WaitCounter++;
#endif

   IAPU.PC += 2;
}
void ApuBB()
{
   // INC dp+X
   uint8 Work8 = S9xAPUGetByteZ(OP1 + IAPU.X) + 1;
   S9xAPUSetByteZ(Work8, OP1 + IAPU.X);
   APUSetZN8(Work8);

#ifdef SPC700_SHUTDOWN
   IAPU.WaitCounter++;
#endif

   IAPU.PC += 2;
}
Beispiel #27
0
void Apu6E()
{
   // DBNZ dp,rel
   uint8_t Work8 = OP1;
   Relative2();
   uint8_t W1 = S9xAPUGetByteZ(Work8) - 1;
   S9xAPUSetByteZ(W1, Work8);
   if (W1 != 0)
   {
      IAPU.PC = IAPU.RAM + (uint16_t) Int16;
      APU.Cycles += IAPU.TwoCycles;
   }
   else
      IAPU.PC += 3;
}