Advertisement
ZoriaRPG

DD_Function_Question

Dec 27th, 2016
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 6.35 KB | None | 0 0
  1.  //int GetScreenD(game, int,int)
  2.     {
  3.         int id = memberids["GetScreenD"];
  4.         int label = lt.functionToLabel(id);
  5.         vector<Opcode *> code;
  6.         //Set up the register to use ? Why is this never popped?
  7.         Opcode *first = new OPopRegister(new VarArgument(INDEX2));
  8.         first->setLabel(label);
  9.         //Push the return address to the stack?
  10.         code.push_back(first);
  11.         //Push the parameters?
  12.         code.push_back(new OPopRegister(new VarArgument(INDEX)));
  13.         //What is being ushed and popped to NUL here?
  14.         code.push_back(new OPopRegister(new VarArgument(NUL)));
  15.         //I think this is where we're actually setting the return register, so what was the above?
  16.         code.push_back(new OSetRegister(new VarArgument(EXP1), new VarArgument(SDDD)));
  17.         //I think this is where we are actually  storing the inputs (int, int)
  18.         code.push_back(new OPopRegister(new VarArgument(EXP2)));
  19.         //Butnot popping the last one?
  20.         code.push_back(new OGotoRegister(new VarArgument(EXP2)));
  21.         rval[label] = code;
  22.         //Which of these is the 'this' pointer?
  23.     }
  24.  
  25.  //void SetScreenD(game, int,int,int)
  26.     {
  27.         int id = memberids["SetScreenD"];
  28.         int label = lt.functionToLabel(id);
  29.         vector<Opcode *> code;
  30.         //pop off the params
  31.         Opcode *first = new OPopRegister(new VarArgument(SFTEMP));  //Why SFTEMP?
  32.         first->setLabel(label);
  33.         code.push_back(first);
  34.         code.push_back(new OPopRegister(new VarArgument(INDEX2)));
  35.         code.push_back(new OPopRegister(new VarArgument(INDEX)));
  36.         //pop pointer, and ignore it
  37.         code.push_back(new OPopRegister(new VarArgument(NUL)));
  38.         code.push_back(new OSetRegister(new VarArgument(SDDD), new VarArgument(SFTEMP)));  //Why SFTEMP?
  39.         code.push_back(new OPopRegister(new VarArgument(EXP2)));
  40.         code.push_back(new OGotoRegister(new VarArgument(EXP2)));
  41.         rval[label] = code;
  42.     }
  43.       //int GetScreenD(game, int,int)
  44.     {
  45.         int id = memberids["GetScreenD"];
  46.         int label = lt.functionToLabel(id);
  47.         vector<Opcode *> code;
  48.         //pop off the params
  49.         Opcode *first = new OPopRegister(new VarArgument(INDEX2));
  50.         first->setLabel(label);
  51.         code.push_back(first);
  52.         code.push_back(new OPopRegister(new VarArgument(INDEX)));
  53.         //pop pointer, and ignore it
  54.         code.push_back(new OPopRegister(new VarArgument(NUL)));
  55.         code.push_back(new OSetRegister(new VarArgument(EXP1), new VarArgument(SDDD)));
  56.         code.push_back(new OPopRegister(new VarArgument(EXP2)));
  57.         code.push_back(new OGotoRegister(new VarArgument(EXP2)));
  58.         rval[label] = code;
  59.     }
  60.     //The above uses SFTEMP, but the below does almost the same thing, and does now. What
  61.     //precisely is SFTEMP used to do?
  62.    
  63.     //int GetComboCSet(int,int,int)
  64.     {
  65.         int id = memberids["GetComboCSet"];
  66.         int label = lt.functionToLabel(id);
  67.         vector<Opcode *> code;
  68.         //pop off the params
  69.         Opcode *first = new OPopRegister(new VarArgument(INDEX));
  70.         first->setLabel(label);
  71.         code.push_back(first);
  72.         code.push_back(new OPopRegister(new VarArgument(EXP1)));
  73.         code.push_back(new OPopRegister(new VarArgument(INDEX2)));
  74.         //pop pointer, and ignore it
  75.         code.push_back(new OPopRegister(new VarArgument(NUL)));
  76.         code.push_back(new OSetRegister(new VarArgument(EXP1), new VarArgument(COMBOCDM)));
  77.         code.push_back(new OPopRegister(new VarArgument(EXP2)));
  78.         code.push_back(new OGotoRegister(new VarArgument(EXP2)));
  79.         rval[label] = code;
  80.     }
  81.     //void SetComboCSet(int,int,int,int)
  82.     {
  83.         int id = memberids["SetComboCSet"];
  84.         int label = lt.functionToLabel(id);
  85.         vector<Opcode *> code;
  86.         //pop off the params
  87.         Opcode *first = new OPopRegister(new VarArgument(EXP2));
  88.         first->setLabel(label);
  89.         code.push_back(first);
  90.         code.push_back(new OPopRegister(new VarArgument(INDEX)));
  91.         code.push_back(new OPopRegister(new VarArgument(EXP1)));
  92.         code.push_back(new OPopRegister(new VarArgument(INDEX2)));
  93.         //pop pointer, and ignore it
  94.         code.push_back(new OPopRegister(new VarArgument(NUL)));
  95.         code.push_back(new OSetRegister(new VarArgument(COMBOCDM), new VarArgument(EXP2)));
  96.         code.push_back(new OPopRegister(new VarArgument(EXP2)));
  97.         code.push_back(new OGotoRegister(new VarArgument(EXP2)));
  98.         rval[label] = code;
  99.     }
  100.    
  101.    
  102.     //This uses an opcode. It takes two params, and returns one.
  103.    
  104.       //void PlayEnhancedMusic(game, int, int)
  105.     {
  106.         int id = memberids["PlayEnhancedMusic"];
  107.         int label = lt.functionToLabel(id);
  108.         vector<Opcode *> code;
  109.         //pop off the params
  110.         Opcode *first = new OPopRegister(new VarArgument(EXP1));
  111.         first->setLabel(label);
  112.         code.push_back(first);
  113.         code.push_back(new OPopRegister(new VarArgument(EXP2)));
  114.         //pop pointer, and ignore it
  115.         code.push_back(new OPopRegister(new VarArgument(NUL)));
  116.         code.push_back(new OPlayEnhancedMusic(new VarArgument(EXP2), new VarArgument(EXP1)));
  117.         code.push_back(new OPopRegister(new VarArgument(EXP2)));
  118.         code.push_back(new OGotoRegister(new VarArgument(EXP2)));
  119.         rval[label] = code;
  120.     }
  121.     //whereas rhis takes three params, and returns one, but does not use a specific opcode.
  122.     //It uses OSetReister, instead of a binary opcode. I presume this is because it takes three params?
  123.    
  124.       //int GetComboType(int,int,int)
  125.     {
  126.         int id = memberids["GetComboType"];
  127.         int label = lt.functionToLabel(id);
  128.         vector<Opcode *> code;
  129.         //pop off the params
  130.         Opcode *first = new OPopRegister(new VarArgument(INDEX));
  131.         first->setLabel(label);
  132.         code.push_back(first);
  133.         code.push_back(new OPopRegister(new VarArgument(EXP1)));
  134.         code.push_back(new OPopRegister(new VarArgument(INDEX2)));
  135.         //pop pointer, and ignore it
  136.         code.push_back(new OPopRegister(new VarArgument(NUL)));
  137.         code.push_back(new OSetRegister(new VarArgument(EXP1), new VarArgument(COMBOTDM)));
  138.         code.push_back(new OPopRegister(new VarArgument(EXP2)));
  139.         code.push_back(new OGotoRegister(new VarArgument(EXP2)));
  140.         rval[label] = code;
  141.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement