コード例 #1
0
ファイル: OpAny.cpp プロジェクト: notaz/cyclone68000
void OpAny(int op)
{
  memset(OpData,0x33,sizeof(OpData));
  OpData[0]=(unsigned char)(op>>8);
  OpData[1]=(unsigned char)op;
  g_op=op;

  if ((op&0xf100)==0x0000) OpArith(op);    // +
  if ((op&0xc000)==0x0000) OpMove(op);     // +
  if ((op&0xf5bf)==0x003c) OpArithSr(op);  // + Ori/Andi/Eori $nnnn,sr
  if ((op&0xf100)==0x0100) OpBtstReg(op);  // +
  if ((op&0xf138)==0x0108) OpMovep(op);    // +
  if ((op&0xff00)==0x0800) OpBtstImm(op);  // +
  if ((op&0xf900)==0x4000) OpNeg(op);      // +
  if ((op&0xf140)==0x4100) OpChk(op);      // +
  if ((op&0xf1c0)==0x41c0) OpLea(op);      // +
  if ((op&0xf9c0)==0x40c0) OpMoveSr(op);   // +
  if ((op&0xffc0)==0x4800) OpNbcd(op);     // +
  if ((op&0xfff8)==0x4840) OpSwap(op);     // +
  if ((op&0xffc0)==0x4840) OpPea(op);      // +
  if ((op&0xffb8)==0x4880) OpExt(op);      // +
  if ((op&0xfb80)==0x4880) OpMovem(op);    // +
  if ((op&0xff00)==0x4a00) OpTst(op);      // +
  if ((op&0xffc0)==0x4ac0) OpTas(op);      // +
  if ((op&0xfff0)==0x4e40) OpTrap(op);     // +
  if ((op&0xfff8)==0x4e50) OpLink(op);     // +
  if ((op&0xfff8)==0x4e58) OpUnlk(op);     // +
  if ((op&0xfff0)==0x4e60) OpMoveUsp(op);  // +
  if ((op&0xfff8)==0x4e70) Op4E70(op);     // + Reset/Rts etc
  if ((op&0xfffd)==0x4e70) OpStopReset(op);// +
  if ((op&0xff80)==0x4e80) OpJsr(op);      // +
  if ((op&0xf000)==0x5000) OpAddq(op);     // +
  if ((op&0xf0c0)==0x50c0) OpSet(op);      // +
  if ((op&0xf0f8)==0x50c8) OpDbra(op);     // +
  if ((op&0xf000)==0x6000) OpBranch(op);   // +
  if ((op&0xf100)==0x7000) OpMoveq(op);    // +
  if ((op&0xa000)==0x8000) OpArithReg(op); // + Or/Sub/And/Add
  if ((op&0xb1f0)==0x8100) OpAbcd(op);     // +
  if ((op&0xb0c0)==0x80c0) OpMul(op);      // +
  if ((op&0x90c0)==0x90c0) OpAritha(op);   // +
  if ((op&0xb130)==0x9100) OpAddx(op);     // +
  if ((op&0xf000)==0xb000) OpCmpEor(op);   // +
  if ((op&0xf138)==0xb108) OpCmpm(op);     // +
  if ((op&0xf130)==0xc100) OpExg(op);      // +
  if ((op&0xf000)==0xe000) OpAsr(op);      // + Asr/l/Ror/l etc
  if ((op&0xf8c0)==0xe0c0) OpAsrEa(op);    // +

  if (op==0xffff)
  {
    SuperEnd();
  }
}
コード例 #2
0
ファイル: OpLogic.cpp プロジェクト: FMB54/piplay-modified
int OpTas(int op, int gen_special)
{
  int ea=0;
  int use=0;

  ea=op&0x003f;

  // See if we can do this opcode:
  if (EaCanWrite(ea)==0 || EaAn(ea)) return 1;

  use=OpBase(op,0);
  if (op!=use) { OpUse(op,use); return 0; } // Use existing handler

  if (!gen_special) OpStart(op,ea);
  else
    ot("Op%.4x_%s\n", op, ms?"":":");

  Cycles=4;
  if(ea>=8) Cycles+=10;

  EaCalc (11,0x003f,ea,0,1);
  EaRead (11,     1,ea,0,0x003f,1);

  ot("  adds r1,r1,#0 ;@ Defines NZ, clears CV\n");
  OpGetFlags(0,0);
  ot("\n");

#if CYCLONE_FOR_GENESIS
  // the original Sega hardware ignores write-back phase (to memory only)
  if (ea < 0x10 || gen_special) {
#endif
    ot("  orr r1,r1,#0x80000000 ;@ set bit7\n");

    EaWrite(11,     1,ea,0,0x003f,1);
#if CYCLONE_FOR_GENESIS
  }
#endif

  OpEnd(ea);

#if (CYCLONE_FOR_GENESIS == 2)
  if (!gen_special && ea >= 0x10) {
    OpTas(op, 1);
  }
#endif

  return 0;
}