VM.h
上传用户:hukai_2010
上传日期:2016-03-25
资源大小:6300k
文件大小:4k
源码类别:

GDI/图象编程

开发平台:

Visual C++

  1. //    Open Mugen is a redevelopment of Elecbyte's M.U.G.E.N wich will be 100% compatible to it
  2. //    Copyright (C) 2004  Sahin Vardar
  3. //
  4. //    If you know bugs or have a wish on Open Muegn or (money/girls/a car) for me ;-)
  5. //    Feel free and email me: sahin_v@hotmail.com  ICQ:317502935
  6. //    Web: http://openmugen.sourceforge.net/
  7. //    --------------------------------------------------------------------------
  8. //
  9. //    This program is free software; you can redistribute it and/or modify
  10. //    it under the terms of the GNU General Public License as published by
  11. //    the Free Software Foundation; either version 2 of the License, or
  12. //    (at your option) any later version.
  13. //
  14. //    This program is distributed in the hope that it will be useful,
  15. //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17. //    GNU General Public License for more details.
  18. //    You should have received a copy of the GNU General Public License
  19. //    along with this program; if not, write to the Free Software
  20. //    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21. #ifndef VM_H
  22. #define VM_H
  23. #define NUMFUNCT 140
  24. class CVirtualMachine
  25. {
  26. CPlayer *m_pPlayer1,*m_pPlayer2;
  27. public:
  28. CVirtualMachine();
  29. ~CVirtualMachine();
  30. float Execute(INSTRUCTION *pInst);
  31. void PushValue();
  32. void PopValue();
  33. void AddOP();
  34. void SubOP();
  35. void DivOP();
  36. void MulOP();
  37. void EqualOP();
  38. void NotEqual();
  39. void Less();
  40. void Greater();
  41. void LessEqual();
  42. void GreaterEqual();
  43. void InterValOP1();
  44. void InterValOP2();
  45. void InterValOP3();
  46. void InterValOP4();
  47. void InterValOP5();
  48. void InterValOP6();
  49. void InterValOP7();
  50. void InterValOP8();
  51. void LogNot();
  52. void LogAnd();
  53. void LogOr();
  54. void LogXor();
  55. void Not();
  56. void And();
  57. void Or();
  58. void Xor();
  59. void Square();
  60. void Abs();
  61. void Neg();
  62. void Acos();
  63. void Alive();
  64. void Anim();
  65. void AnimElem();
  66. void AnimeElemNo();
  67. void AnimeElemTime();
  68. void AnimExist();
  69. void AnimTime();
  70. void Asin();
  71. void Atan();
  72. void AuthorName();
  73. void BackEdgeBodyDist();
  74. void BackEdgeDist();
  75. void CanRecover();
  76. void Ceil();
  77. void Command();
  78. void Const();
  79. void Cos();
  80. void Ctrl();
  81. void DrawGame();
  82. void Exp();
  83. void Facing();
  84. void Floor();
  85. void FrontEdgeBodyDist();
  86. void FrontEdgeDist();
  87. void FVar();
  88. void GameTime();
  89. void GetHitVar();
  90. void HitCount();
  91. //void HitDefAttr()
  92. void HitFall();
  93. void HitOver();
  94. void HitPauseTime();
  95. void HitShakeOver();
  96. void HitVel();
  97. void PlayerIdent();
  98. void IfElse();
  99. void InGuardDist();
  100. void IsHelper();
  101. void IsHomeTeam();
  102. void Life();
  103. void LifeMax();
  104. void LogN();
  105. void Log();
  106. void Lose();
  107. void MatchNo();
  108. void MatchOver();
  109. void MoveContact();
  110. void MoveGuarded();
  111. void MoveHit();
  112. void MoveType();
  113. void MoveReversed();
  114. void Name();
  115. void NumEnemy();
  116. void NumExplod();
  117. void NumHelper();
  118. void NumPartner();
  119. void NumProj();
  120. void NumProjID();
  121. void NumTarget();
  122. void P2BodyDist();
  123. void P2Dist();
  124. void P2Life();
  125. void P2MoveType();
  126. void P2Name();
  127. void P2StateNo();
  128. void P2StateType();
  129. void P3Name();
  130. void P4Name();
  131. void PalNo();
  132. void ParentDist();
  133. void Pi();
  134. void PlayerIDExist();
  135. void PrevStateNo();
  136. void Pos();
  137. void Power();
  138. void PowerMax();
  139. void ProjCancelTime();
  140. void Random();
  141. void RootDist();
  142. void RoundNo();
  143. void RoundsExisted();
  144. void RoundState();
  145. void ScreenPos();
  146. void SelfAnimExist();
  147. void Sin();
  148. void StateNo();
  149. void StateType();
  150. void SysFVar();
  151. void SysVar();
  152. void Tan();
  153. void TeamMode();
  154. void TeamSide();
  155. void TicksPerSecond();
  156. void Time();
  157. void UniqHitCount();
  158. void Var();
  159. void Vel();
  160. void Win();
  161. void ProjContact();
  162. void ProjContactTime();
  163. void ProjGuarded();
  164. void ProjGuardedTime();
  165. void NOP(){};
  166. void MODOP();
  167. //helper functions
  168. void Save();
  169. void Restore();
  170. void InitFunctTable();
  171. void SetPlayers(CPlayer *p1,CPlayer *p2);
  172. //variables
  173. CStack m_Stack;
  174. int nCurrentIns;
  175. INSTRUCTION *pCurrentIns;
  176. Stacktype m_pop;
  177. float temp1,temp2,temp3;
  178. float nSave;
  179. //pointer to player
  180. void *m_p1;
  181. void *m_p2;
  182. typedef void (CVirtualMachine::*pt2Member)();
  183. pt2Member pFuncTable[NUMFUNCT];
  184. };
  185. #endif