Пример #1
0
//
// BinaryTokenPPACS::make_tokens
//
void BinaryTokenPPACS::make_tokens
(ObjectVector const &objects, std::vector<BinaryTokenPPACS> *instructions)
{
   static ObjectExpression::Pointer const fracbits =
      ObjectExpression::CreateValueINT(16, SourcePosition::builtin());

   static std::vector<std::string> const nolabels;

   std::vector<ObjectExpression::Pointer> args;

   ObjectVector::const_iterator object;
   for (object = objects.begin(); object != objects.end(); ++object)
   {
   SourcePosition const &pos = object->pos;

   std::vector<std::string> const *labels = &object->labels;

   switch (object->code)
   {
   BINTOKACS_TOKENS_MAP_ALL();
   BINTOKACS_TOKENS_TRAN_ALL();

   //
   // Operators
   //
   CASE_REMAP(ADD_AUTO_I,   ADD_AUTO);
   CASE_REMAP(ADD_AUTO_U,   ADD_AUTO);
   CASE_REMAP(ADD_AUTO_X,   ADD_AUTO);
   CASE_REMAP(ADD_PTR_I,    ADD_PTR);
   CASE_REMAP(ADD_PTR_U,    ADD_PTR);
   CASE_REMAP(ADD_PTR_X,    ADD_PTR);
   CASE_REMAP(ADD_STATIC_I, ADD_STATIC);
   CASE_REMAP(ADD_STATIC_U, ADD_STATIC);
   CASE_REMAP(ADD_STATIC_X, ADD_STATIC);

   CASE_REMAP(AND_AUTO_I,   AND_AUTO);
   CASE_REMAP(AND_AUTO_U,   AND_AUTO);
   CASE_REMAP(AND_AUTO_X,   AND_AUTO);
   CASE_REMAP(AND_PTR_I,    AND_PTR);
   CASE_REMAP(AND_PTR_U,    AND_PTR);
   CASE_REMAP(AND_PTR_X,    AND_PTR);
   CASE_REMAP(AND_STATIC_I, AND_STATIC);
   CASE_REMAP(AND_STATIC_U, AND_STATIC);
   CASE_REMAP(AND_STATIC_X, AND_STATIC);

   CASE_REMAP(DEC_AUTO_I,   DEC_AUTO);
   CASE_REMAP(DEC_AUTO_U,   DEC_AUTO);
   CASE_REMAP(DEC_PTR_I,    DEC_PTR);
   CASE_REMAP(DEC_PTR_U,    DEC_PTR);
   CASE_REMAP(DEC_STATIC_I, DEC_STATIC);
   CASE_REMAP(DEC_STATIC_U, DEC_STATIC);

   CASE_REMAP(DIV_STK_X,    DIV_STK_X);
   CASE_REMAP(DIV_AUTO_I,   DIV_AUTO);
   CASE_REMAP(DIV_PTR_I,    DIV_PTR);
   CASE_REMAP(DIV_STATIC_I, DIV_STATIC);

   CASE_REMAP(INC_AUTO_I,   INC_AUTO);
   CASE_REMAP(INC_AUTO_U,   INC_AUTO);
   CASE_REMAP(INC_PTR_I,    INC_PTR);
   CASE_REMAP(INC_PTR_U,    INC_PTR);
   CASE_REMAP(INC_STATIC_I, INC_STATIC);
   CASE_REMAP(INC_STATIC_U, INC_STATIC);

   CASE_REMAP(IOR_AUTO_I,   IOR_AUTO);
   CASE_REMAP(IOR_AUTO_U,   IOR_AUTO);
   CASE_REMAP(IOR_AUTO_X,   IOR_AUTO);
   CASE_REMAP(IOR_PTR_I,    IOR_PTR);
   CASE_REMAP(IOR_PTR_U,    IOR_PTR);
   CASE_REMAP(IOR_PTR_X,    IOR_PTR);
   CASE_REMAP(IOR_STATIC_I, IOR_STATIC);
   CASE_REMAP(IOR_STATIC_U, IOR_STATIC);
   CASE_REMAP(IOR_STATIC_X, IOR_STATIC);

   CASE_REMAP(LSH_AUTO_I,   LSH_AUTO);
   CASE_REMAP(LSH_AUTO_U,   LSH_AUTO);
   CASE_REMAP(LSH_AUTO_X,   LSH_AUTO);
   CASE_REMAP(LSH_PTR_I,    LSH_PTR);
   CASE_REMAP(LSH_PTR_U,    LSH_PTR);
   CASE_REMAP(LSH_PTR_X,    LSH_PTR);
   CASE_REMAP(LSH_STATIC_I, LSH_STATIC);
   CASE_REMAP(LSH_STATIC_U, LSH_STATIC);
   CASE_REMAP(LSH_STATIC_X, LSH_STATIC);

   CASE_REMAP(MOD_AUTO_I,   MOD_AUTO);
   CASE_REMAP(MOD_AUTO_X,   MOD_AUTO);
   CASE_REMAP(MOD_PTR_I,    MOD_PTR);
   CASE_REMAP(MOD_PTR_X,    MOD_PTR);
   CASE_REMAP(MOD_STATIC_I, MOD_STATIC);
   CASE_REMAP(MOD_STATIC_X, MOD_STATIC);

   CASE_REMAP(MUL_STK_X,    MUL_STK_X);
   CASE_REMAP(MUL_AUTO_I,   MUL_AUTO);
   CASE_REMAP(MUL_AUTO_U,   MUL_AUTO);
   CASE_REMAP(MUL_PTR_I,    MUL_PTR);
   CASE_REMAP(MUL_PTR_U,    MUL_PTR);
   CASE_REMAP(MUL_STATIC_I, MUL_STATIC);
   CASE_REMAP(MUL_STATIC_U, MUL_STATIC);

   CASE_REMAP(RSH_AUTO_I,   RSH_AUTO);
   CASE_REMAP(RSH_AUTO_X,   RSH_AUTO);
   CASE_REMAP(RSH_PTR_I,    RSH_PTR);
   CASE_REMAP(RSH_PTR_X,    RSH_PTR);
   CASE_REMAP(RSH_STATIC_I, RSH_STATIC);
   CASE_REMAP(RSH_STATIC_X, RSH_STATIC);

   CASE_REMAP(SUB_AUTO_I,   SUB_AUTO);
   CASE_REMAP(SUB_AUTO_U,   SUB_AUTO);
   CASE_REMAP(SUB_AUTO_X,   SUB_AUTO);
   CASE_REMAP(SUB_PTR_I,    SUB_PTR);
   CASE_REMAP(SUB_PTR_U,    SUB_PTR);
   CASE_REMAP(SUB_PTR_X,    SUB_PTR);
   CASE_REMAP(SUB_STATIC_I, SUB_STATIC);
   CASE_REMAP(SUB_STATIC_U, SUB_STATIC);
   CASE_REMAP(SUB_STATIC_X, SUB_STATIC);

   CASE_REMAP(XOR_AUTO_I,   XOR_AUTO);
   CASE_REMAP(XOR_AUTO_U,   XOR_AUTO);
   CASE_REMAP(XOR_AUTO_X,   XOR_AUTO);
   CASE_REMAP(XOR_PTR_I,    XOR_PTR);
   CASE_REMAP(XOR_PTR_U,    XOR_PTR);
   CASE_REMAP(XOR_PTR_X,    XOR_PTR);
   CASE_REMAP(XOR_STATIC_I, XOR_STATIC);
   CASE_REMAP(XOR_STATIC_U, XOR_STATIC);
   CASE_REMAP(XOR_STATIC_X, XOR_STATIC);

   //
   // Jumps
   //
   CASE_REMAP(JMP, JMP);

   //
   // Variable Address
   //
   CASE_REMAP(GET_AUTPTR_IMM, GET_AUTPTR_IMM);

   CASE_REMAP(ADD_AUTPTR, ADD_AUTPTR);
   case OCODE_ADD_AUTPTR_IMM:
      PUSH_TOKEN_ARGS1(BCODE_GET_IMM, 1);
      PUSH_TOKEN(BCODE_ADD_AUTPTR);
      break;

   CASE_REMAP(SUB_AUTPTR, SUB_AUTPTR);
   case OCODE_SUB_AUTPTR_IMM:
      PUSH_TOKEN_ARGS1(BCODE_GET_IMM, 1);
      PUSH_TOKEN(BCODE_SUB_AUTPTR);
      break;

   //
   // Variable Get
   //
   CASE_REMAP(GET_STATIC, GET_STATIC);
   CASE_REMAP(GET_AUTO,   GET_AUTO);
   CASE_REMAP(GET_PTR,    GET_PTR);
   CASE_REMAP(GET_TEMP,   GET_AUTO);

   //
   // Variable Set
   //
   CASE_REMAP(SET_STATIC, SET_STATIC);
   CASE_REMAP(SET_AUTO,   SET_AUTO);
   CASE_REMAP(SET_PTR,    SET_PTR);
   CASE_REMAP(SET_TEMP,   SET_AUTO);

   //
   // ACS Extensions
   //
   CASE_MAP_ACSE(MID_GET);
   CASE_MAP_ACSE(MID_SET);

   //
   // ACS Printing
   //
   CASE_MAP_ACSP(END_ERROR);
   CASE_MAP_ACSP(END_LOG);
   CASE_REMAP_ACSP(NUM_DEC_X, NUM_DEC_X);

   case OCODE_NONE:
   default:
      Error_P("unknown OCODE: %s", make_string(object->code));
   }
   }
}
Пример #2
0
//
// BinaryTokenZDACS::make_tokens
//
void BinaryTokenZDACS::make_tokens
(ObjectVector const &objects, std::vector<BinaryTokenZDACS> *instructions)
{
   static ObjectExpression::Pointer const fracbits =
      ObjectExpression::CreateValueINT(16, SourcePosition::builtin());

   static ObjectExpression::Pointer const indexAddr =
      ObjectExpression::CreateValueINT(option_addr_array, SourcePosition::builtin());

   static ObjectExpression::Reference const indexAuto =
      ObjectExpression::CreateValueINT(option_auto_array, SourcePosition::builtin());

   static ObjectExpression::Reference const indexRet1 =
      ObjectExpression::CreateValueINT(-1, SourcePosition::builtin());

   static ObjectExpression::Pointer const indexStack =
      ObjectExpression::CreateValueINT(option_addr_stack, SourcePosition::builtin());

   static ObjectExpression::Reference const func_GetChar =
      ObjectExpression::CreateValueUNS(15, SourcePosition::builtin());
   static ObjectExpression::Reference const func_GetCharArgs =
      ObjectExpression::CreateValueUNS(2, SourcePosition::builtin());

   static ObjectExpression::Reference const func_Getptr =
      ObjectExpression::CreateValueSymbol("__Getptr", SourcePosition::builtin());
   static ObjectExpression::Reference const func_Setptr =
      ObjectExpression::CreateValueSymbol("__Setptr", SourcePosition::builtin());

   static ObjectExpression::Reference const func_Udiv =
      ObjectExpression::CreateValueSymbol("__Udiv", SourcePosition::builtin());
   static ObjectExpression::Reference const func_Ursh =
      ObjectExpression::CreateValueSymbol("__Ursh", SourcePosition::builtin());

   static std::vector<std::string> const nolabels;

   std::vector<ObjectExpression::Pointer> args;

   ObjectVector::const_iterator object;
   for (object = objects.begin(); object != objects.end(); ++object)
   {
   SourcePosition const &pos = object->pos;

   std::vector<std::string> const *labels = &object->labels;

   switch (object->code)
   {
   BINTOKACS_TOKENS_MAP_ALL();
   BINTOKACS_TOKENS_TRAN_ALL();

   // Operators
   CASE_ADDR_BINOP(ADD, _I,);
   CASE_ADDR_BINOP(ADD, _U,);
   CASE_ADDR_BINOP(ADD, _X,);
   CASE_REMAP_REGS(ADD, _I,);
   CASE_REMAP_REGS(ADD, _U,);
   CASE_REMAP_REGS(ADD, _X,);

   CASE_ADDR_BINOP(AND, _I,);
   CASE_ADDR_BINOP(AND, _U,);
   CASE_ADDR_BINOP(AND, _X,);
   CASE_REMAP_REG2(AND, _I,);
   CASE_REMAP_REG2(AND, _U,);
   CASE_REMAP_REG2(AND, _X,);

   CASE_ADDR_UNAOP(DEC, _I,);
   CASE_ADDR_UNAOP(DEC, _U,);
   CASE_REMAP_REGS(DEC, _I,);
   CASE_REMAP_REGS(DEC, _U,);

   CASE_REMAP(DIV_STK_X, DIV_STK_X);
   CASE_ADDR_BINOP(DIV, _I,);
   CASE_REMAP_REGS(DIV, _I,);

   case OCODE_DIV_STK_U:
      args.push_back(func_Udiv);
      PUSH_TOKEN(BCODE_JMP_CAL_IMM);
      break;

   CASE_ADDR_UNAOP(INC, _I,);
   CASE_ADDR_UNAOP(INC, _U,);
   CASE_REMAP_REGS(INC, _I,);
   CASE_REMAP_REGS(INC, _U,);

   CASE_ADDR_BINOP(IOR, _I,);
   CASE_ADDR_BINOP(IOR, _U,);
   CASE_ADDR_BINOP(IOR, _X,);
   CASE_REMAP_REG2(IOR, _I,);
   CASE_REMAP_REG2(IOR, _U,);
   CASE_REMAP_REG2(IOR, _X,);

   CASE_ADDR_BINOP(LSH, _I,);
   CASE_ADDR_BINOP(LSH, _U,);
   CASE_ADDR_BINOP(LSH, _X,);
   CASE_REMAP_REG2(LSH, _I,);
   CASE_REMAP_REG2(LSH, _U,);
   CASE_REMAP_REG2(LSH, _X,);

   CASE_ADDR_BINOP(MOD, _I,);
   CASE_ADDR_BINOP(MOD, _X,);
   CASE_REMAP_REGS(MOD, _I,);
   CASE_REMAP_REGS(MOD, _X,);

   case OCODE_MOD_STK_U:
      args.push_back(func_Udiv);
      PUSH_TOKEN(BCODE_JMP_CAL_NIL_IMM);
      args.push_back(indexRet1);
      PUSH_TOKEN(BCODE_GET_IMM);
      args.push_back(indexAuto);
      PUSH_TOKEN(BCODE_GET_WLDARR);
      break;

   CASE_REMAP(MUL_STK_X, MUL_STK_X);
   CASE_ADDR_BINOP(MUL, _I,);
   CASE_ADDR_BINOP(MUL, _U,);
   CASE_REMAP_REGS(MUL, _I,);
   CASE_REMAP_REGS(MUL, _U,);

   CASE_ADDR_BINOP(RSH, _I,);
   CASE_ADDR_BINOP(RSH, _X,);
   CASE_REMAP_REG2(RSH, _I,);
   CASE_REMAP_REG2(RSH, _X,);

   case OCODE_RSH_STK_U:
      args.push_back(func_Ursh);
      PUSH_TOKEN(BCODE_JMP_CAL_IMM);
      break;

   CASE_ADDR_BINOP(SUB, _I,);
   CASE_ADDR_BINOP(SUB, _U,);
   CASE_ADDR_BINOP(SUB, _X,);
   CASE_REMAP_REGS(SUB, _I,);
   CASE_REMAP_REGS(SUB, _U,);
   CASE_REMAP_REGS(SUB, _X,);

   CASE_ADDR_BINOP(XOR, _I,);
   CASE_ADDR_BINOP(XOR, _U,);
   CASE_ADDR_BINOP(XOR, _X,);
   CASE_REMAP_REG2(XOR, _I,);
   CASE_REMAP_REG2(XOR, _U,);
   CASE_REMAP_REG2(XOR, _X,);

   CASE_REMAP(INV_STK_I, INV_STK);
   CASE_REMAP(INV_STK_U, INV_STK);
   CASE_REMAP(INV_STK_X, INV_STK);

   // Jumps
   CASE_REMAP(JMP,             JMP);
   case OCODE_JMP_TAB:
      if((args = object->args).size() % 2)
         Error_P("uneven OCODE_JMP_TAB");
      PUSH_TOKEN(BCODE_JMP_TAB);
      break;
   CASE_REMAP(JMP_CAL,         JMP_CAL);
   CASE_REMAP(JMP_CAL_IMM,     JMP_CAL_IMM);
   case OCODE_JMP_CAL_NIL:
      PUSH_TOKEN(BCODE_JMP_CAL);
      PUSH_TOKEN(BCODE_STK_DROP);
      break;
   CASE_REMAP(JMP_CAL_NIL_IMM, JMP_CAL_NIL_IMM);
   CASE_REMAP(JMP_RET,         JMP_RET);
   CASE_REMAP(JMP_RET_NIL,     JMP_RET_NIL);

   // Stack-ops.
   CASE_REMAP(STK_COPY, STK_COPY);
   CASE_REMAP(STK_SWAP, STK_SWAP);

   // Trigonometry
   CASE_REMAP(TRIG_COS_X, TRIG_COS);
   CASE_REMAP(TRIG_SIN_X, TRIG_SIN);

   // Variable Address
   case OCODE_GET_AUTPTR:
      args.push_back(indexStack);
      PUSH_TOKEN(BCODE_GET_WLDREG);
      break;

   case OCODE_GET_AUTPTR_IMM:
      args.push_back(indexStack);
      PUSH_TOKEN(BCODE_GET_WLDREG);
      PUSH_TOKEN_ADD_ARG0();
      break;

   case OCODE_SET_AUTPTR_IMM:
      PUSH_TOKEN_ARGS1(BCODE_GET_IMM, 1);
   case OCODE_SET_AUTPTR:
      args.push_back(indexStack);
      PUSH_TOKEN(BCODE_SET_WLDREG);
      break;

   case OCODE_ADD_AUTPTR_IMM:
      PUSH_TOKEN_ARGS1(BCODE_GET_IMM, 1);
   case OCODE_ADD_AUTPTR:
      args.push_back(indexStack);
      PUSH_TOKEN(BCODE_ADD_WLDREG);
      break;

   case OCODE_SUB_AUTPTR_IMM:
      PUSH_TOKEN_ARGS1(BCODE_GET_IMM, 1);
   case OCODE_SUB_AUTPTR:
      args.push_back(indexStack);
      PUSH_TOKEN(BCODE_SUB_WLDREG);
      break;

   // Variable Get
   case OCODE_GET_FUNCP:
      // Don't tag nullptr.
      if(object->getArg(0)->resolveUNS())
      {
         PUSH_TOKEN_ARGS1(BCODE_GET_FUNCP, 1);
      }
      else
      {
         PUSH_TOKEN_ARGS1(BCODE_GET_IMM, 1);
      }
      break;

   case OCODE_GET_STRING:
      PUSH_TOKEN_ARGS1(BCODE_GET_IMM, 1);
      // Don't tag nullptr.
      if(option_string_tag && object->getArg(0)->resolveUNS())
         PUSH_TOKEN(BCODE_STRING_TAG);
      break;

   case OCODE_GET_FARPTR:
      PUSH_TOKEN_ADD_ARG0();
      args.push_back(func_Getptr);
      PUSH_TOKEN(BCODE_JMP_CAL_IMM);
      break;

   case OCODE_GET_STRPTR:
      PUSH_TOKEN_ADD_ARG0();
      args.push_back(func_GetCharArgs);
      args.push_back(func_GetChar);
      PUSH_TOKEN(BCODE_NATIVE);
      break;

   CASE_ADDR_UNAOP(GET,,);
   CASE_REMAP_REGS(GET,,);

   // Variable Set
   case OCODE_SET_FARPTR:
      PUSH_TOKEN_ADD_ARG0();
      args.push_back(func_Setptr);
      PUSH_TOKEN(BCODE_JMP_CAL_NIL_IMM);
      break;

   CASE_ADDR_BINOP(SET,,);
   CASE_REMAP_REGS(SET,,);
   CASE_REMAP(SET_SCRRET, SET_SCRRET);

   // Miscellaneous
   CASE_REMAP(NATIVE, NATIVE);

   // ACS

   // ACS Common Extensions

   // ACS Extensions
   CASE_MAP_ACSE(GAME_EXEC);
   CASE_MAP_ACSE(GAME_EXEC_IMM);
   CASE_MAP_ACSE(GAME_GET_CVAR);
   CASE_MAP_ACSE(GAME_GET_INVASIONSTATE);
   CASE_MAP_ACSE(GAME_GET_INVASIONWAVE);
   CASE_MAP_ACSE(GAME_GET_LEVELINFO);
   CASE_MAP_ACSE(GAME_GET_TEAMINFO_PLAYERCOUNT_BLUE);
   CASE_MAP_ACSE(GAME_GET_TEAMINFO_PLAYERCOUNT_RED);
   CASE_MAP_ACSE(GAME_GET_TEAMINFO_SCORE_BLUE);
   CASE_MAP_ACSE(GAME_GET_TEAMINFO_SCORE_RED);
   CASE_MAP_ACSE(GAME_GET_THINGCOUNT_STR);
   CASE_MAP_ACSE(GAME_GET_TYPE_ONEFLAGCTF);
   CASE_MAP_ACSE(GAME_GET_TYPE_SINGLEPLAYER);
   CASE_MAP_ACSE(GAME_REPLACETEXTURES);
   CASE_MAP_ACSE(GAME_SET_AIRCONTROL);
   CASE_MAP_ACSE(GAME_SET_AIRCONTROL_IMM);
   CASE_MAP_ACSE(GAME_SET_GRAVITY);
   CASE_MAP_ACSE(GAME_SET_GRAVITY_IMM);
   CASE_MAP_ACSE(GAME_SET_LEVEL);
   CASE_MAP_ACSE(GAME_SET_MUSIC);
   CASE_MAP_ACSE(GAME_SET_MUSIC_IMM);
   CASE_MAP_ACSE(GAME_SET_MUSICLOCAL);
   CASE_MAP_ACSE(GAME_SET_MUSICLOCAL_IMM);
   CASE_MAP_ACSE(GAME_SET_MUSICST);
   CASE_MAP_ACSE(GAME_SET_SKY);
   CASE_MAP_ACSE(LINE_GET_OFFSETY);
   CASE_MAP_ACSE(LTAG_SET_BLOCKMONSTER);
   CASE_MAP_ACSE(MISC_PLAYMOVIE);
   CASE_MAP_ACSE(MTAG_ADD_INVENTORY);
   CASE_MAP_ACSE(MTAG_CHK_TEXTURE_CEILING);
   CASE_MAP_ACSE(MTAG_CHK_TEXTURE_FLOOR);
   CASE_MAP_ACSE(MTAG_CLR_INVENTORY);
   CASE_MAP_ACSE(MTAG_DAMAGE);
   CASE_MAP_ACSE(MTAG_GET);
   CASE_MAP_ACSE(MTAG_GET_ANGLE);
   CASE_MAP_ACSE(MTAG_GET_CEILINGZ);
   CASE_MAP_ACSE(MTAG_GET_CLASSIFICATION);
   CASE_MAP_ACSE(MTAG_GET_FLOORZ);
   CASE_MAP_ACSE(MTAG_GET_INVENTORY);
   CASE_MAP_ACSE(MTAG_GET_LIGHTLEVEL);
   CASE_MAP_ACSE(MTAG_GET_PITCH);
   CASE_MAP_ACSE(MTAG_GET_X);
   CASE_MAP_ACSE(MTAG_GET_Y);
   CASE_MAP_ACSE(MTAG_GET_Z);
   CASE_MAP_ACSE(MTAG_MORPH);
   CASE_MAP_ACSE(MTAG_SET);
   CASE_MAP_ACSE(MTAG_SET_ANGLE);
   CASE_MAP_ACSE(MTAG_SET_CAMERATEXTURE);
   CASE_MAP_ACSE(MTAG_SET_MARINESPRITE);
   CASE_MAP_ACSE(MTAG_SET_MARINEWEAPON);
   CASE_MAP_ACSE(MTAG_SET_PITCH);
   CASE_MAP_ACSE(MTAG_SET_SPECIAL);
   CASE_MAP_ACSE(MTAG_SET_STATE);
   CASE_MAP_ACSE(MTAG_SET_XYZ);
   CASE_MAP_ACSE(MTAG_SUB_INVENTORY);
   CASE_MAP_ACSE(MTAG_UNMORPH);
   CASE_MAP_ACSE(MTAG_USEINVENTORY);
   CASE_MAP_ACSE(PLAYER_GET_CAMERA);
   CASE_MAP_ACSE(PLAYER_GET_CLASS);
   CASE_MAP_ACSE(PLAYER_GET_INFO);
   CASE_MAP_ACSE(PLAYER_GET_INGAME);
   CASE_MAP_ACSE(PLAYER_GET_INPUT);
   CASE_MAP_ACSE(PLAYER_GET_ISBOT);
   CASE_MAP_ACSE(SCREEN_FADE_RANGE);
   CASE_MAP_ACSE(SCREEN_FADE_START);
   CASE_MAP_ACSE(SCREEN_FADE_STOP);
   CASE_MAP_ACSE(SCREEN_GET_HEIGHT);
   CASE_MAP_ACSE(SCREEN_GET_WIDTH);
   CASE_MAP_ACSE(SCREEN_SET_HUDSIZE);
   CASE_MAP_ACSE(SOUND_AMBIENTLOCAL);
   CASE_MAP_ACSE(SOUND_THING);
   CASE_MAP_ACSE(SPAWN_POINT);
   CASE_MAP_ACSE(SPAWN_POINT_IMM);
   CASE_MAP_ACSE(SPAWN_PROJECTILE_SID);
   CASE_MAP_ACSE(SPAWN_PROJECTILE_STR);
   CASE_MAP_ACSE(SPAWN_SPOT_ANGLE);
   CASE_MAP_ACSE(SPAWN_SPOT_ANGLE_IMM);
   CASE_MAP_ACSE(SPAWN_SPOT);
   CASE_MAP_ACSE(SPECIAL_EXEC5_RETN1);
   CASE_MAP_ACSE(STAG_DAMAGE);
   CASE_MAP_ACSE(STAG_GET_LIGHTLEVEL);
   CASE_MAP_ACSE(STAG_GET_THINGCOUNT_SID);
   CASE_MAP_ACSE(STAG_GET_THINGCOUNT_STR);
   CASE_MAP_ACSE(STAG_GET_Z_CEILING);
   CASE_MAP_ACSE(STAG_GET_Z_FLOOR);
   CASE_MAP_ACSE(STAG_SET_TRIGGER_CEILING);
   CASE_MAP_ACSE(STAG_SET_TRIGGER_FLOOR);
   CASE_MAP_ACSE(STRING_COPY_GLOBALRANGE);
   CASE_MAP_ACSE(STRING_COPY_MAPRANGE);
   CASE_MAP_ACSE(STRING_COPY_WORLDRANGE);
   CASE_MAP_ACSE(STRING_GET_LENGTH);
   CASE_MAP_ACSE(THING_ADD_INVENTORY);
   CASE_MAP_ACSE(THING_ADD_INVENTORY_IMM);
   CASE_MAP_ACSE(THING_CHK_WEAPON);
   CASE_MAP_ACSE(THING_CLR_INVENTORY);
   CASE_MAP_ACSE(THING_GET_AMMOCAP);
   CASE_MAP_ACSE(THING_GET_ARMOR);
   CASE_MAP_ACSE(THING_GET_FRAGS);
   CASE_MAP_ACSE(THING_GET_HEALTH);
   CASE_MAP_ACSE(THING_GET_INVENTORY);
   CASE_MAP_ACSE(THING_GET_INVENTORY_IMM);
   CASE_MAP_ACSE(THING_GET_MTAG);
   CASE_MAP_ACSE(THING_GET_PLAYERNUMBER);
   CASE_MAP_ACSE(THING_GET_SIGIL);
   CASE_MAP_ACSE(THING_GET_TEAM);
   CASE_MAP_ACSE(THING_SET_AMMOCAP);
   CASE_MAP_ACSE(THING_SET_MUGSHOT);
   CASE_MAP_ACSE(THING_SET_WEAPON);
   CASE_MAP_ACSE(THING_SUB_INVENTORY);
   CASE_MAP_ACSE(THING_SUB_INVENTORY_IMM);
   CASE_MAP_ACSE(THING_USEINVENTORY);
   CASE_MAP_ACSE(TRANSLATION_DESAT);
   CASE_MAP_ACSE(TRANSLATION_END);
   CASE_MAP_ACSE(TRANSLATION_PALETTE);
   CASE_MAP_ACSE(TRANSLATION_RGB);
   CASE_MAP_ACSE(TRANSLATION_START);
   CASE_MAP_ACSE(TRIG_VECTORANGLE);
   CASE_MAP_ACSE(WAIT_SNAM);

   // ACS Printing
   CASE_MAP_ACSP(END_HUD);
   CASE_MAP_ACSP(END_HUD_BOLD);
   CASE_MAP_ACSP(END_LOG);
   CASE_MAP_ACSP(END_OPT);
   CASE_MAP_ACSP(END_STR);
   CASE_MAP_ACSP(KEYBIND);
   CASE_REMAP_ACSP(NUM_BIN_U, NUM_BIN);
   CASE_REMAP_ACSP(NUM_DEC_X, NUM_DEC_X);
   CASE_REMAP_ACSP(NUM_HEX_U, NUM_HEX);
   CASE_MAP_ACSP(PLAYER_NAME);
   CASE_MAP_ACSP(SET_FONT);
   CASE_MAP_ACSP(SET_FONT_IMM);
   CASE_MAP_ACSP(START_OPT);
   CASE_MAP_ACSP(STR_GBLARR);
   CASE_MAP_ACSP(STR_GBLRNG);
   CASE_MAP_ACSP(STR_LOCALIZED);
   CASE_MAP_ACSP(STR_MAPARR);
   CASE_MAP_ACSP(STR_MAPRNG);
   CASE_MAP_ACSP(STR_WLDARR);
   CASE_MAP_ACSP(STR_WLDRNG);

   case OCODE_NONE:
   default:
      Error_P("unknown OCODE: %s", make_string(object->code));
   }
   }
}