Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1.  
  2. // This file is part of the Cyclone 68000 Emulator
  3.  
  4. // Copyright (c) 2004,2011 FinalDave (emudave (at) gmail.com)
  5. // Copyright (c) 2005-2011 GraÅžvydas "notaz" Ignotas (notasas (at) gmail.com)
  6.  
  7. // This code is licensed under the GNU General Public License version 2.0 and the MAME License.
  8. // You can choose the license that has the most advantages for you.
  9.  
  10. // SVN repository can be found at http://code.google.com/p/cyclone68000/
  11.  
  12.  
  13. #include <stdio.h>
  14. #include <stdarg.h>
  15. #include <stdlib.h>
  16. #include <string.h>
  17.  
  18. #ifndef CONFIG_FILE
  19. #define CONFIG_FILE "config.h"
  20. #endif
  21. #include CONFIG_FILE
  22.  
  23. // Disa.c
  24. #include "Disa/Disa.h"
  25.  
  26. // Ea.cpp
  27. extern int earead_check_addrerr;
  28. extern int eawrite_check_addrerr;
  29. extern int g_jmp_cycle_table[];
  30. extern int g_jsr_cycle_table[];
  31. extern int g_lea_cycle_table[];
  32. extern int g_pea_cycle_table[];
  33. extern int g_movem_cycle_table[];
  34. int Ea_add_ns(int *tab, int ea); // add nonstandard EA cycles
  35. int EaCalc(int a,int mask,int ea,int size,int top=0,int sign_extend=1); // 6
  36. int EaRead(int a,int v,int ea,int size,int mask,int top=0,int sign_extend=1); // 7
  37. int EaCalcRead(int r_ea,int r,int ea,int size,int mask,int sign_extend=1); // 6
  38. int EaCalcReadNoSE(int r_ea,int r,int ea,int size,int mask);
  39. int EaCanRead(int ea,int size);
  40. int EaWrite(int a,int v,int ea,int size,int mask,int top=0,int sign_extend_ea=1);
  41. int EaCanWrite(int ea);
  42. int EaAn(int ea);
  43.  
  44. // Main.cpp
  45. extern int *CyJump;   // Jump table
  46. extern int  ms;       // If non-zero, output in Microsoft ARMASM format
  47. extern const char * const Narm[4]; // Normal ARM Extensions for operand sizes 0,1,2
  48. extern const char * const Sarm[4]; // Sign-extend ARM Extensions for operand sizes 0,1,2
  49. extern int  Cycles;   // Current cycles for opcode
  50. extern int  pc_dirty; // something changed PC during processing
  51. extern int  arm_op_count; // for stats
  52. void ot(const char *format, ...);
  53. void ltorg();
  54. int MemHandler(int type,int size,int addrreg=0,int need_addrerr_check=1);
  55. void FlushPC(void);
  56.  
  57. // OpAny.cpp
  58. extern int g_op;
  59. extern int opend_op_changes_cycles, opend_check_interrupt, opend_check_trace;
  60. int OpGetFlags(int subtract,int xbit,int sprecialz=0);
  61. void OpUse(int op,int use);
  62. void OpStart(int op,int sea=0,int tea=0,int op_changes_cycles=0,int supervisor_check=0);
  63. void OpEnd(int sea=0,int tea=0);
  64. int OpBase(int op,int size,int sepa=0);
  65. void OpAny(int op);
  66.  
  67. //----------------------
  68. // OpArith.cpp
  69. int OpArith(int op);
  70. int OpLea(int op);
  71. int OpAddq(int op);
  72. int OpArithReg(int op);
  73. int OpMul(int op);
  74. int OpAbcd(int op);
  75. int OpNbcd(int op);
  76. int OpAritha(int op);
  77. int OpAddx(int op);
  78. int OpCmpEor(int op);
  79. int OpCmpm(int op);
  80. int OpChk(int op);
  81. int GetXBit(int subtract);
  82.  
  83. // OpBranch.cpp
  84. void OpPush32();
  85. void OpPushSr(int high);
  86. int OpTrap(int op);
  87. int OpLink(int op);
  88. int OpUnlk(int op);
  89. int Op4E70(int op);
  90. int OpJsr(int op);
  91. int OpBranch(int op);
  92. int OpDbra(int op);
  93.  
  94. // OpLogic.cpp
  95. int OpBtstReg(int op);
  96. int OpBtstImm(int op);
  97. int OpNeg(int op);
  98. int OpSwap(int op);
  99. int OpTst(int op);
  100. int OpExt(int op);
  101. int OpSet(int op);
  102. int OpAsr(int op);
  103. int OpAsrEa(int op);
  104. int OpTas(int op, int gen_special=0);
  105.  
  106. // OpMove.cpp
  107. int OpMove(int op);
  108. int OpLea(int op);
  109. void OpFlagsToReg(int high);
  110. void OpRegToFlags(int high,int srh_reg=0);
  111. int OpMoveSr(int op);
  112. int OpArithSr(int op);
  113. int OpPea(int op);
  114. int OpMovem(int op);
  115. int OpMoveq(int op);
  116. int OpMoveUsp(int op);
  117. int OpExg(int op);
  118. int OpMovep(int op);
  119. int OpStopReset(int op);
  120. void SuperEnd(void);
  121. void SuperChange(int op,int srh_reg=-1);
  122.  
  123.