From 12bfbd5a063c4d911e4254f23c0abcee709d6be0 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Thu, 28 Feb 2019 07:21:43 +0000 Subject: [PATCH] CON: Macro-ize CON keyword tokens in gamedef.h and gameexec.cpp Most of this patch is by pogokeen. git-svn-id: https://svn.eduke32.com/eduke32@7357 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/gamedef.h | 1064 ++++++++--------- source/duke3d/src/gameexec.cpp | 1967 ++++++++++++++++---------------- 2 files changed, 1524 insertions(+), 1507 deletions(-) diff --git a/source/duke3d/src/gamedef.h b/source/duke3d/src/gamedef.h index d3b5bedc0..eb2e567d9 100644 --- a/source/duke3d/src/gamedef.h +++ b/source/duke3d/src/gamedef.h @@ -845,538 +845,548 @@ enum IterationTypes_t }; // most keywords have opcodes but some opcodes don't have keywords -enum ScriptKeywords_t -{ - CON_IFVARA_GLOBAL, - CON_IFVARAE_GLOBAL, - CON_IFVARAND_GLOBAL, - CON_IFVARB_GLOBAL, - CON_IFVARBE_GLOBAL, - CON_IFVARBOTH_GLOBAL, - CON_IFVARE_GLOBAL, - CON_IFVAREITHER_GLOBAL, - CON_IFVARG_GLOBAL, - CON_IFVARGE_GLOBAL, - CON_IFVARL_GLOBAL, - CON_IFVARLE_GLOBAL, - CON_IFVARN_GLOBAL, - CON_IFVAROR_GLOBAL, - CON_IFVARXOR_GLOBAL, - - CON_ADDVAR_GLOBAL, - CON_ANDVAR_GLOBAL, - CON_DIVVAR_GLOBAL, - CON_MODVAR_GLOBAL, - CON_MULVAR_GLOBAL, - CON_ORVAR_GLOBAL, - CON_RANDVAR_GLOBAL, - CON_SETVAR_GLOBAL, - CON_SHIFTVARL_GLOBAL, - CON_SHIFTVARR_GLOBAL, - CON_SUBVAR_GLOBAL, - CON_WHILEVARL_GLOBAL, - CON_WHILEVARN_GLOBAL, - CON_XORVAR_GLOBAL, - -#ifdef INCOMPLETE_STRUCT_ACCESS - CON_IFVARA_PLAYER, - CON_IFVARAE_PLAYER, - CON_IFVARAND_PLAYER, - CON_IFVARB_PLAYER, - CON_IFVARBE_PLAYER, - CON_IFVARBOTH_PLAYER, - CON_IFVARE_PLAYER, - CON_IFVAREITHER_PLAYER, - CON_IFVARG_PLAYER, - CON_IFVARGE_PLAYER, - CON_IFVARL_PLAYER, - CON_IFVARLE_PLAYER, - CON_IFVARN_PLAYER, - CON_IFVAROR_PLAYER, - CON_IFVARXOR_PLAYER, - - CON_ADDVAR_PLAYER, - CON_ANDVAR_PLAYER, - CON_DIVVAR_PLAYER, - CON_MODVAR_PLAYER, - CON_MULVAR_PLAYER, - CON_ORVAR_PLAYER, - CON_RANDVAR_PLAYER, - CON_SETVAR_PLAYER, - CON_SHIFTVARL_PLAYER, - CON_SHIFTVARR_PLAYER, - CON_SUBVAR_PLAYER, - CON_WHILEVARL_PLAYER, - CON_WHILEVARN_PLAYER, - CON_XORVAR_PLAYER, - - CON_IFVARA_ACTOR, - CON_IFVARAE_ACTOR, - CON_IFVARAND_ACTOR, - CON_IFVARB_ACTOR, - CON_IFVARBE_ACTOR, - CON_IFVARBOTH_ACTOR, - CON_IFVARE_ACTOR, - CON_IFVAREITHER_ACTOR, - CON_IFVARG_ACTOR, - CON_IFVARGE_ACTOR, - CON_IFVARL_ACTOR, - CON_IFVARLE_ACTOR, - CON_IFVARN_ACTOR, - CON_IFVAROR_ACTOR, - CON_IFVARXOR_ACTOR, - - CON_ADDVAR_ACTOR, - CON_ANDVAR_ACTOR, - CON_DIVVAR_ACTOR, - CON_MODVAR_ACTOR, - CON_MULVAR_ACTOR, - CON_ORVAR_ACTOR, - CON_RANDVAR_ACTOR, - CON_SETVAR_ACTOR, - CON_SHIFTVARL_ACTOR, - CON_SHIFTVARR_ACTOR, - CON_SUBVAR_ACTOR, - CON_WHILEVARL_ACTOR, - CON_WHILEVARN_ACTOR, - CON_XORVAR_ACTOR, -#endif - - CON_IFVARVARA, - CON_IFVARVARAE, - CON_IFVARVARAND, - CON_IFVARVARB, - CON_IFVARVARBE, - CON_IFVARVARBOTH, - CON_IFVARVARE, - CON_IFVARVAREITHER, - CON_IFVARVARG, - CON_IFVARVARGE, - CON_IFVARVARL, - CON_IFVARVARLE, - CON_IFVARVARN, - CON_IFVARVAROR, - CON_IFVARVARXOR, - - CON_ADDVARVAR, - CON_ANDVARVAR, - CON_DIVVARVAR, - CON_MODVARVAR, - CON_MULVARVAR, - CON_ORVARVAR, - CON_RANDVARVAR, - CON_SETVARVAR, - CON_SHIFTVARVARL, - CON_SHIFTVARVARR, - CON_SUBVARVAR, - CON_WHILEVARVARL, - CON_WHILEVARVARN, - CON_XORVARVAR, - - CON_IFVARA, - CON_IFVARAE, - CON_IFVARAND, - CON_IFVARB, - CON_IFVARBE, - CON_IFVARBOTH, - CON_IFVARE, - CON_IFVAREITHER, - CON_IFVARG, - CON_IFVARGE, - CON_IFVARL, - CON_IFVARLE, - CON_IFVARN, - CON_IFVAROR, - CON_IFVARXOR, - - CON_ADDVAR, - CON_ANDVAR, - CON_DIVVAR, - CON_MODVAR, - CON_MULVAR, - CON_ORVAR, - CON_RANDVAR, - CON_SETVAR, - CON_SHIFTVARL, - CON_SHIFTVARR, - CON_SUBVAR, - CON_WHILEVARL, - CON_WHILEVARN, - CON_XORVAR, - - CON_ELSE, - CON_ENDA, - CON_ENDEVENT, - CON_ENDS, - CON_ENDSWITCH, - CON_LEFTBRACE, - CON_RIGHTBRACE, - CON_STATE, - - CON_SETACTOR, - CON_SETACTORSTRUCT, - CON_SETACTORVAR, - CON_SETARRAY, - CON_SETPLAYER, - CON_SETPLAYERVAR, - CON_SETPROJECTILE, - CON_SETSECTOR, - CON_SETSPRITEEXT, - CON_SETSPRITESTRUCT, - CON_SETTHISPROJECTILE, - CON_SETTSPR, - CON_SETUSERDEF, - CON_SETWALL, - - CON_GETACTOR, - CON_GETACTORSTRUCT, - CON_GETACTORVAR, - CON_GETANGLE, - CON_GETPLAYER, - CON_GETPLAYERVAR, - CON_GETPROJECTILE, - CON_GETSECTOR, - CON_GETSPRITEEXT, - CON_GETSPRITESTRUCT, - CON_GETTSPR, - CON_GETUSERDEF, - CON_GETWALL, - - CON_ACTION, - CON_ACTIVATEBYSECTOR, - CON_ACTIVATECHEAT, - CON_ACTORSOUND, - CON_ADDAMMO, - CON_ADDINVENTORY, - CON_ADDKILLS, - CON_ADDLOGVAR, - CON_ADDPHEALTH, - CON_ADDSTRENGTH, - CON_ADDWEAPON, - CON_AI, - CON_ANGOFF, - CON_BREAK, - CON_CACTOR, - CON_CALCHYPOTENUSE, - CON_CANSEE, - CON_CANSEESPR, - CON_CHANGESPRITESECT, - CON_CHANGESPRITESTAT, - CON_CHECKACTIVATORMOTION, - CON_CHECKAVAILINVEN, - CON_CHECKAVAILWEAPON, - CON_CLAMP, - CON_CLEARMAPSTATE, - CON_CLIPDIST, - CON_CLIPMOVE, - CON_CLIPMOVENOSLIDE, - CON_CMENU, - CON_COPY, - CON_COS, - CON_COUNT, - CON_CSTAT, - CON_CSTATOR, - CON_DEBRIS, - CON_DEBUG, - CON_DIGITALNUMBER, - CON_DIGITALNUMBERZ, - CON_DISPLAYRAND, - CON_DIST, - CON_DIVR, - CON_DIVRU, - CON_DIVSCALE, - CON_DISPLAYRANDVAR, - CON_DISPLAYRANDVARVAR, - CON_DRAGPOINT, - CON_DRAWLINE256, - CON_DRAWLINERGB, - CON_ECHO, - CON_ENDOFGAME, - CON_ENDOFLEVEL, - CON_EQSPAWN, - CON_ESHOOT, - CON_ESPAWN, - CON_EZSHOOT, - CON_FALL, - CON_FINDNEARACTOR, - CON_FINDNEARACTOR3D, - CON_FINDNEARACTORZ, - CON_FINDNEARSPRITE, - CON_FINDNEARSPRITE3D, - CON_FINDNEARSPRITEZ, - CON_FINDOTHERPLAYER, - CON_FINDPLAYER, - CON_FLASH, - CON_FOR, - CON_GAMETEXT, - CON_GAMETEXTZ, - CON_GETACTORANGLE, - CON_GETANGLETOTARGET, - CON_GETARRAYSIZE, - CON_GETCEILZOFSLOPE, - CON_GETCLOSESTCOL, - CON_GETCURRADDRESS, - CON_GETFLORZOFSLOPE, - CON_GETINCANGLE, - CON_GETINPUT, - CON_GETKEYNAME, - CON_GETLASTPAL, - CON_GETMUSICPOSITION, - CON_GETPLAYERANGLE, - CON_GETPNAME, - CON_GETTEXTURECEILING, - CON_GETTEXTUREFLOOR, - CON_GETTHISPROJECTILE, - CON_GETTICKS, - CON_GETTILEDATA, - CON_GETTIMEDATE, - CON_GETZRANGE, - CON_GLOBALSOUND, - CON_GMAXAMMO, - CON_GUNIQHUDID, - CON_GUTS, - CON_HEADSPRITESECT, - CON_HEADSPRITESTAT, - CON_HITRADIUS, - CON_HITSCAN, - CON_IFACTION, - CON_IFACTIONCOUNT, - CON_IFACTOR, - CON_IFACTORNOTSTAYPUT, - CON_IFACTORSOUND, - CON_IFAI, - CON_IFANGDIFFL, - CON_IFAWAYFROMWALL, - CON_IFBULLETNEAR, - CON_IFCANSEE, - CON_IFCANSEETARGET, - CON_IFCANSHOOTTARGET, - CON_IFCEILINGDISTL, - CON_IFCLIENT, - CON_IFCOUNT, - CON_IFCUTSCENE, - CON_IFDEAD, - CON_IFFLOORDISTL, - CON_IFGAPZL, - CON_IFGOTWEAPONCE, - CON_IFHITSPACE, - CON_IFHITWEAPON, - CON_IFINOUTERSPACE, - CON_IFINSPACE, - CON_IFINWATER, - CON_IFMOVE, - CON_IFMULTIPLAYER, - CON_IFNOSOUNDS, - CON_IFNOTMOVING, - CON_IFONWATER, - CON_IFOUTSIDE, - CON_IFP, - CON_IFPDISTG, - CON_IFPDISTL, - CON_IFPHEALTHL, - CON_IFPINVENTORY, - CON_IFPLAYBACKON, - CON_IFPLAYERSL, - CON_IFRESPAWN, - CON_IFRND, - CON_IFSERVER, - CON_IFSOUND, - CON_IFSPAWNEDBY, - CON_IFSPRITEPAL, - CON_IFSQUISHED, - CON_IFSTRENGTH, - CON_IFWASWEAPON, - CON_INITTIMER, - CON_INSERTSPRITEQ, - CON_INV, - CON_JUMP, - CON_KILLIT, - CON_KLABS, - CON_LDIST, - CON_LINEINTERSECT, - CON_LOADMAPSTATE, - CON_LOCKPLAYER, - CON_LOTSOFGLASS, - CON_MAIL, - CON_MIKESND, - CON_MINITEXT, - CON_MONEY, - CON_MOVE, - CON_MOVESECTOR, - CON_MOVESPRITE, - CON_MULSCALE, - CON_MYOS, - CON_MYOSPAL, - CON_MYOSPALX, - CON_MYOSX, - CON_NEARTAG, - CON_NEXTSECTORNEIGHBORZ, - CON_NEXTSPRITESECT, - CON_NEXTSPRITESTAT, - CON_NULLOP, - CON_OPERATE, - CON_OPERATEACTIVATORS, - CON_OPERATEMASTERSWITCHES, - CON_OPERATERESPAWNS, - CON_OPERATESECTORS, - CON_PALFROM, - CON_PAPER, - CON_PKICK, - CON_PRELOADTRACKSLOTFORSWAP, - CON_PREVSPRITESECT, - CON_PREVSPRITESTAT, - CON_PSTOMP, - CON_QGETSYSSTR, - CON_QSPAWN, - CON_QSPRINTF, - CON_QSTRCAT, - CON_QSTRCMP, - CON_QSTRCPY, - CON_QSTRDIM, - CON_QSTRLEN, - CON_QSTRNCAT, - CON_QSUBSTR, - CON_QUAKE, - CON_QUOTE, - CON_RAYINTERSECT, - CON_READARRAYFROMFILE, - CON_READGAMEVAR, - CON_REDEFINEQUOTE, - CON_RESETACTIONCOUNT, - CON_RESETCOUNT, - CON_RESETPLAYER, - CON_RESETPLAYERFLAGS, - CON_RESIZEARRAY, - CON_RESPAWNHITAG, - CON_RETURN, - CON_ROTATEPOINT, - CON_ROTATESPRITE, - CON_ROTATESPRITE16, - CON_ROTATESPRITEA, - CON_SAVE, - CON_SAVEGAMEVAR, - CON_SAVEMAPSTATE, - CON_SAVENN, - CON_SCALEVAR, - CON_SCREENPAL, - CON_SCREENSOUND, - CON_SCREENTEXT, - CON_SECTCLEARINTERPOLATION, - CON_SECTGETHITAG, - CON_SECTGETLOTAG, - CON_SECTOROFWALL, - CON_SECTSETINTERPOLATION, - CON_SETACTORANGLE, - CON_SETACTORSOUNDPITCH, - CON_SETASPECT, - CON_SETGAMEPALETTE, - CON_SETINPUT, - CON_SETMUSICPOSITION, - CON_SETPLAYERANGLE, - CON_SETSPRITE, - CON_SETTILEDATA, - CON_SHOOT, - CON_SHOWVIEW, - CON_SHOWVIEWQ16, - CON_SHOWVIEWQ16UNBIASED, - CON_SHOWVIEWUNBIASED, - CON_SIN, - CON_SIZEAT, - CON_SIZETO, - CON_SLEEPTIME, - CON_SMAXAMMO, - CON_SOUND, - CON_SOUNDONCE, - CON_SPAWN, - CON_SPAWNCEILINGGLASS, - CON_SPAWNWALLGLASS, - CON_SPAWNWALLSTAINEDGLASS, - CON_SPGETHITAG, - CON_SPGETLOTAG, - CON_SPRITEFLAGS, - CON_SPRITEPAL, - CON_SQRT, - CON_SSP, - CON_STARTCUTSCENE, - CON_STARTLEVEL, - CON_STARTSCREEN, - CON_STARTTRACK, - CON_STARTTRACKSLOT, - CON_STOPACTORSOUND, - CON_STOPALLMUSIC, - CON_STOPALLSOUNDS, - CON_STOPSOUND, - CON_STRENGTH, - CON_SWAPARRAYS, - CON_SWAPTRACKSLOT, - CON_SWITCH, - CON_TIME, - CON_TIP, - CON_TOSSWEAPON, - CON_UPDATESECTOR, - CON_UPDATESECTORZ, - CON_USERQUOTE, - CON_WACKPLAYER, - CON_WRITEARRAYTOFILE, - CON_ZSHOOT, - - CON_OPCODE_END, +#define TRANSFORM_SCRIPT_KEYWORDS_LIST(TRANSFORM, DELIMITER) \ + \ + TRANSFORM(CON_IFVARA_GLOBAL) DELIMITER \ + TRANSFORM(CON_IFVARAE_GLOBAL) DELIMITER \ + TRANSFORM(CON_IFVARAND_GLOBAL) DELIMITER \ + TRANSFORM(CON_IFVARB_GLOBAL) DELIMITER \ + TRANSFORM(CON_IFVARBE_GLOBAL) DELIMITER \ + TRANSFORM(CON_IFVARBOTH_GLOBAL) DELIMITER \ + TRANSFORM(CON_IFVARE_GLOBAL) DELIMITER \ + TRANSFORM(CON_IFVAREITHER_GLOBAL) DELIMITER \ + TRANSFORM(CON_IFVARG_GLOBAL) DELIMITER \ + TRANSFORM(CON_IFVARGE_GLOBAL) DELIMITER \ + TRANSFORM(CON_IFVARL_GLOBAL) DELIMITER \ + TRANSFORM(CON_IFVARLE_GLOBAL) DELIMITER \ + TRANSFORM(CON_IFVARN_GLOBAL) DELIMITER \ + TRANSFORM(CON_IFVAROR_GLOBAL) DELIMITER \ + TRANSFORM(CON_IFVARXOR_GLOBAL) DELIMITER \ + \ + TRANSFORM(CON_ADDVAR_GLOBAL) DELIMITER \ + TRANSFORM(CON_ANDVAR_GLOBAL) DELIMITER \ + TRANSFORM(CON_DIVVAR_GLOBAL) DELIMITER \ + TRANSFORM(CON_MODVAR_GLOBAL) DELIMITER \ + TRANSFORM(CON_MULVAR_GLOBAL) DELIMITER \ + TRANSFORM(CON_ORVAR_GLOBAL) DELIMITER \ + TRANSFORM(CON_RANDVAR_GLOBAL) DELIMITER \ + TRANSFORM(CON_SETVAR_GLOBAL) DELIMITER \ + TRANSFORM(CON_SHIFTVARL_GLOBAL) DELIMITER \ + TRANSFORM(CON_SHIFTVARR_GLOBAL) DELIMITER \ + TRANSFORM(CON_SUBVAR_GLOBAL) DELIMITER \ + TRANSFORM(CON_WHILEVARL_GLOBAL) DELIMITER \ + TRANSFORM(CON_WHILEVARN_GLOBAL) DELIMITER \ + TRANSFORM(CON_XORVAR_GLOBAL) DELIMITER \ + \ + /* INCOMPLETE_STRUCT_ACCESS + TRANSFORM(CON_IFVARA_PLAYER) DELIMITER \ + TRANSFORM(CON_IFVARAE_PLAYER) DELIMITER \ + TRANSFORM(CON_IFVARAND_PLAYER) DELIMITER \ + TRANSFORM(CON_IFVARB_PLAYER) DELIMITER \ + TRANSFORM(CON_IFVARBE_PLAYER) DELIMITER \ + TRANSFORM(CON_IFVARBOTH_PLAYER) DELIMITER \ + TRANSFORM(CON_IFVARE_PLAYER) DELIMITER \ + TRANSFORM(CON_IFVAREITHER_PLAYER) DELIMITER \ + TRANSFORM(CON_IFVARG_PLAYER) DELIMITER \ + TRANSFORM(CON_IFVARGE_PLAYER) DELIMITER \ + TRANSFORM(CON_IFVARL_PLAYER) DELIMITER \ + TRANSFORM(CON_IFVARLE_PLAYER) DELIMITER \ + TRANSFORM(CON_IFVARN_PLAYER) DELIMITER \ + TRANSFORM(CON_IFVAROR_PLAYER) DELIMITER \ + TRANSFORM(CON_IFVARXOR_PLAYER) DELIMITER \ + \ + TRANSFORM(CON_ADDVAR_PLAYER) DELIMITER \ + TRANSFORM(CON_ANDVAR_PLAYER) DELIMITER \ + TRANSFORM(CON_DIVVAR_PLAYER) DELIMITER \ + TRANSFORM(CON_MODVAR_PLAYER) DELIMITER \ + TRANSFORM(CON_MULVAR_PLAYER) DELIMITER \ + TRANSFORM(CON_ORVAR_PLAYER) DELIMITER \ + TRANSFORM(CON_RANDVAR_PLAYER) DELIMITER \ + TRANSFORM(CON_SETVAR_PLAYER) DELIMITER \ + TRANSFORM(CON_SHIFTVARL_PLAYER) DELIMITER \ + TRANSFORM(CON_SHIFTVARR_PLAYER) DELIMITER \ + TRANSFORM(CON_SUBVAR_PLAYER) DELIMITER \ + TRANSFORM(CON_WHILEVARL_PLAYER) DELIMITER \ + TRANSFORM(CON_WHILEVARN_PLAYER) DELIMITER \ + TRANSFORM(CON_XORVAR_PLAYER) DELIMITER \ + \ + TRANSFORM(CON_IFVARA_ACTOR) DELIMITER \ + TRANSFORM(CON_IFVARAE_ACTOR) DELIMITER \ + TRANSFORM(CON_IFVARAND_ACTOR) DELIMITER \ + TRANSFORM(CON_IFVARB_ACTOR) DELIMITER \ + TRANSFORM(CON_IFVARBE_ACTOR) DELIMITER \ + TRANSFORM(CON_IFVARBOTH_ACTOR) DELIMITER \ + TRANSFORM(CON_IFVARE_ACTOR) DELIMITER \ + TRANSFORM(CON_IFVAREITHER_ACTOR) DELIMITER \ + TRANSFORM(CON_IFVARG_ACTOR) DELIMITER \ + TRANSFORM(CON_IFVARGE_ACTOR) DELIMITER \ + TRANSFORM(CON_IFVARL_ACTOR) DELIMITER \ + TRANSFORM(CON_IFVARLE_ACTOR) DELIMITER \ + TRANSFORM(CON_IFVARN_ACTOR) DELIMITER \ + TRANSFORM(CON_IFVAROR_ACTOR) DELIMITER \ + TRANSFORM(CON_IFVARXOR_ACTOR) DELIMITER \ + \ + TRANSFORM(CON_ADDVAR_ACTOR) DELIMITER \ + TRANSFORM(CON_ANDVAR_ACTOR) DELIMITER \ + TRANSFORM(CON_DIVVAR_ACTOR) DELIMITER \ + TRANSFORM(CON_MODVAR_ACTOR) DELIMITER \ + TRANSFORM(CON_MULVAR_ACTOR) DELIMITER \ + TRANSFORM(CON_ORVAR_ACTOR) DELIMITER \ + TRANSFORM(CON_RANDVAR_ACTOR) DELIMITER \ + TRANSFORM(CON_SETVAR_ACTOR) DELIMITER \ + TRANSFORM(CON_SHIFTVARL_ACTOR) DELIMITER \ + TRANSFORM(CON_SHIFTVARR_ACTOR) DELIMITER \ + TRANSFORM(CON_SUBVAR_ACTOR) DELIMITER \ + TRANSFORM(CON_WHILEVARL_ACTOR) DELIMITER \ + TRANSFORM(CON_WHILEVARN_ACTOR) DELIMITER \ + TRANSFORM(CON_XORVAR_ACTOR) DELIMITER \ + */ \ + \ + TRANSFORM(CON_IFVARVARA) DELIMITER \ + TRANSFORM(CON_IFVARVARAE) DELIMITER \ + TRANSFORM(CON_IFVARVARAND) DELIMITER \ + TRANSFORM(CON_IFVARVARB) DELIMITER \ + TRANSFORM(CON_IFVARVARBE) DELIMITER \ + TRANSFORM(CON_IFVARVARBOTH) DELIMITER \ + TRANSFORM(CON_IFVARVARE) DELIMITER \ + TRANSFORM(CON_IFVARVAREITHER) DELIMITER \ + TRANSFORM(CON_IFVARVARG) DELIMITER \ + TRANSFORM(CON_IFVARVARGE) DELIMITER \ + TRANSFORM(CON_IFVARVARL) DELIMITER \ + TRANSFORM(CON_IFVARVARLE) DELIMITER \ + TRANSFORM(CON_IFVARVARN) DELIMITER \ + TRANSFORM(CON_IFVARVAROR) DELIMITER \ + TRANSFORM(CON_IFVARVARXOR) DELIMITER \ + \ + TRANSFORM(CON_ADDVARVAR) DELIMITER \ + TRANSFORM(CON_ANDVARVAR) DELIMITER \ + TRANSFORM(CON_DIVVARVAR) DELIMITER \ + TRANSFORM(CON_MODVARVAR) DELIMITER \ + TRANSFORM(CON_MULVARVAR) DELIMITER \ + TRANSFORM(CON_ORVARVAR) DELIMITER \ + TRANSFORM(CON_RANDVARVAR) DELIMITER \ + TRANSFORM(CON_SETVARVAR) DELIMITER \ + TRANSFORM(CON_SHIFTVARVARL) DELIMITER \ + TRANSFORM(CON_SHIFTVARVARR) DELIMITER \ + TRANSFORM(CON_SUBVARVAR) DELIMITER \ + TRANSFORM(CON_WHILEVARVARL) DELIMITER \ + TRANSFORM(CON_WHILEVARVARN) DELIMITER \ + TRANSFORM(CON_XORVARVAR) DELIMITER \ + \ + TRANSFORM(CON_IFVARA) DELIMITER \ + TRANSFORM(CON_IFVARAE) DELIMITER \ + TRANSFORM(CON_IFVARAND) DELIMITER \ + TRANSFORM(CON_IFVARB) DELIMITER \ + TRANSFORM(CON_IFVARBE) DELIMITER \ + TRANSFORM(CON_IFVARBOTH) DELIMITER \ + TRANSFORM(CON_IFVARE) DELIMITER \ + TRANSFORM(CON_IFVAREITHER) DELIMITER \ + TRANSFORM(CON_IFVARG) DELIMITER \ + TRANSFORM(CON_IFVARGE) DELIMITER \ + TRANSFORM(CON_IFVARL) DELIMITER \ + TRANSFORM(CON_IFVARLE) DELIMITER \ + TRANSFORM(CON_IFVARN) DELIMITER \ + TRANSFORM(CON_IFVAROR) DELIMITER \ + TRANSFORM(CON_IFVARXOR) DELIMITER \ + \ + TRANSFORM(CON_ADDVAR) DELIMITER \ + TRANSFORM(CON_ANDVAR) DELIMITER \ + TRANSFORM(CON_DIVVAR) DELIMITER \ + TRANSFORM(CON_MODVAR) DELIMITER \ + TRANSFORM(CON_MULVAR) DELIMITER \ + TRANSFORM(CON_ORVAR) DELIMITER \ + TRANSFORM(CON_RANDVAR) DELIMITER \ + TRANSFORM(CON_SETVAR) DELIMITER \ + TRANSFORM(CON_SHIFTVARL) DELIMITER \ + TRANSFORM(CON_SHIFTVARR) DELIMITER \ + TRANSFORM(CON_SUBVAR) DELIMITER \ + TRANSFORM(CON_WHILEVARL) DELIMITER \ + TRANSFORM(CON_WHILEVARN) DELIMITER \ + TRANSFORM(CON_XORVAR) DELIMITER \ + \ + TRANSFORM(CON_ELSE) DELIMITER \ + TRANSFORM(CON_ENDA) DELIMITER \ + TRANSFORM(CON_ENDEVENT) DELIMITER \ + TRANSFORM(CON_ENDS) DELIMITER \ + TRANSFORM(CON_ENDSWITCH) DELIMITER \ + TRANSFORM(CON_LEFTBRACE) DELIMITER \ + TRANSFORM(CON_RIGHTBRACE) DELIMITER \ + TRANSFORM(CON_STATE) DELIMITER \ + \ + TRANSFORM(CON_SETACTOR) DELIMITER \ + TRANSFORM(CON_SETACTORSTRUCT) DELIMITER \ + TRANSFORM(CON_SETACTORVAR) DELIMITER \ + TRANSFORM(CON_SETARRAY) DELIMITER \ + TRANSFORM(CON_SETPLAYER) DELIMITER \ + TRANSFORM(CON_SETPLAYERVAR) DELIMITER \ + TRANSFORM(CON_SETPROJECTILE) DELIMITER \ + TRANSFORM(CON_SETSECTOR) DELIMITER \ + TRANSFORM(CON_SETSPRITEEXT) DELIMITER \ + TRANSFORM(CON_SETSPRITESTRUCT) DELIMITER \ + TRANSFORM(CON_SETTHISPROJECTILE) DELIMITER \ + TRANSFORM(CON_SETTSPR) DELIMITER \ + TRANSFORM(CON_SETUSERDEF) DELIMITER \ + TRANSFORM(CON_SETWALL) DELIMITER \ + \ + TRANSFORM(CON_GETACTOR) DELIMITER \ + TRANSFORM(CON_GETACTORSTRUCT) DELIMITER \ + TRANSFORM(CON_GETACTORVAR) DELIMITER \ + TRANSFORM(CON_GETANGLE) DELIMITER \ + TRANSFORM(CON_GETPLAYER) DELIMITER \ + TRANSFORM(CON_GETPLAYERVAR) DELIMITER \ + TRANSFORM(CON_GETPROJECTILE) DELIMITER \ + TRANSFORM(CON_GETSECTOR) DELIMITER \ + TRANSFORM(CON_GETSPRITEEXT) DELIMITER \ + TRANSFORM(CON_GETSPRITESTRUCT) DELIMITER \ + TRANSFORM(CON_GETTSPR) DELIMITER \ + TRANSFORM(CON_GETUSERDEF) DELIMITER \ + TRANSFORM(CON_GETWALL) DELIMITER \ + \ + TRANSFORM(CON_ACTION) DELIMITER \ + TRANSFORM(CON_ACTIVATEBYSECTOR) DELIMITER \ + TRANSFORM(CON_ACTIVATECHEAT) DELIMITER \ + TRANSFORM(CON_ACTORSOUND) DELIMITER \ + TRANSFORM(CON_ADDAMMO) DELIMITER \ + TRANSFORM(CON_ADDINVENTORY) DELIMITER \ + TRANSFORM(CON_ADDKILLS) DELIMITER \ + TRANSFORM(CON_ADDLOGVAR) DELIMITER \ + TRANSFORM(CON_ADDPHEALTH) DELIMITER \ + TRANSFORM(CON_ADDSTRENGTH) DELIMITER \ + TRANSFORM(CON_ADDWEAPON) DELIMITER \ + TRANSFORM(CON_AI) DELIMITER \ + TRANSFORM(CON_ANGOFF) DELIMITER \ + TRANSFORM(CON_BREAK) DELIMITER \ + TRANSFORM(CON_CACTOR) DELIMITER \ + TRANSFORM(CON_CALCHYPOTENUSE) DELIMITER \ + TRANSFORM(CON_CANSEE) DELIMITER \ + TRANSFORM(CON_CANSEESPR) DELIMITER \ + TRANSFORM(CON_CHANGESPRITESECT) DELIMITER \ + TRANSFORM(CON_CHANGESPRITESTAT) DELIMITER \ + TRANSFORM(CON_CHECKACTIVATORMOTION) DELIMITER \ + TRANSFORM(CON_CHECKAVAILINVEN) DELIMITER \ + TRANSFORM(CON_CHECKAVAILWEAPON) DELIMITER \ + TRANSFORM(CON_CLAMP) DELIMITER \ + TRANSFORM(CON_CLEARMAPSTATE) DELIMITER \ + TRANSFORM(CON_CLIPDIST) DELIMITER \ + TRANSFORM(CON_CLIPMOVE) DELIMITER \ + TRANSFORM(CON_CLIPMOVENOSLIDE) DELIMITER \ + TRANSFORM(CON_CMENU) DELIMITER \ + TRANSFORM(CON_COPY) DELIMITER \ + TRANSFORM(CON_COS) DELIMITER \ + TRANSFORM(CON_COUNT) DELIMITER \ + TRANSFORM(CON_CSTAT) DELIMITER \ + TRANSFORM(CON_CSTATOR) DELIMITER \ + TRANSFORM(CON_DEBRIS) DELIMITER \ + TRANSFORM(CON_DEBUG) DELIMITER \ + TRANSFORM(CON_DIGITALNUMBER) DELIMITER \ + TRANSFORM(CON_DIGITALNUMBERZ) DELIMITER \ + TRANSFORM(CON_DISPLAYRAND) DELIMITER \ + TRANSFORM(CON_DIST) DELIMITER \ + TRANSFORM(CON_DIVR) DELIMITER \ + TRANSFORM(CON_DIVRU) DELIMITER \ + TRANSFORM(CON_DIVSCALE) DELIMITER \ + TRANSFORM(CON_DISPLAYRANDVAR) DELIMITER \ + TRANSFORM(CON_DISPLAYRANDVARVAR) DELIMITER \ + TRANSFORM(CON_DRAGPOINT) DELIMITER \ + TRANSFORM(CON_DRAWLINE256) DELIMITER \ + TRANSFORM(CON_DRAWLINERGB) DELIMITER \ + TRANSFORM(CON_ECHO) DELIMITER \ + TRANSFORM(CON_ENDOFGAME) DELIMITER \ + TRANSFORM(CON_ENDOFLEVEL) DELIMITER \ + TRANSFORM(CON_EQSPAWN) DELIMITER \ + TRANSFORM(CON_ESHOOT) DELIMITER \ + TRANSFORM(CON_ESPAWN) DELIMITER \ + TRANSFORM(CON_EZSHOOT) DELIMITER \ + TRANSFORM(CON_FALL) DELIMITER \ + TRANSFORM(CON_FINDNEARACTOR) DELIMITER \ + TRANSFORM(CON_FINDNEARACTOR3D) DELIMITER \ + TRANSFORM(CON_FINDNEARACTORZ) DELIMITER \ + TRANSFORM(CON_FINDNEARSPRITE) DELIMITER \ + TRANSFORM(CON_FINDNEARSPRITE3D) DELIMITER \ + TRANSFORM(CON_FINDNEARSPRITEZ) DELIMITER \ + TRANSFORM(CON_FINDOTHERPLAYER) DELIMITER \ + TRANSFORM(CON_FINDPLAYER) DELIMITER \ + TRANSFORM(CON_FLASH) DELIMITER \ + TRANSFORM(CON_FOR) DELIMITER \ + TRANSFORM(CON_GAMETEXT) DELIMITER \ + TRANSFORM(CON_GAMETEXTZ) DELIMITER \ + TRANSFORM(CON_GETACTORANGLE) DELIMITER \ + TRANSFORM(CON_GETANGLETOTARGET) DELIMITER \ + TRANSFORM(CON_GETARRAYSIZE) DELIMITER \ + TRANSFORM(CON_GETCEILZOFSLOPE) DELIMITER \ + TRANSFORM(CON_GETCLOSESTCOL) DELIMITER \ + TRANSFORM(CON_GETCURRADDRESS) DELIMITER \ + TRANSFORM(CON_GETFLORZOFSLOPE) DELIMITER \ + TRANSFORM(CON_GETINCANGLE) DELIMITER \ + TRANSFORM(CON_GETINPUT) DELIMITER \ + TRANSFORM(CON_GETKEYNAME) DELIMITER \ + TRANSFORM(CON_GETLASTPAL) DELIMITER \ + TRANSFORM(CON_GETMUSICPOSITION) DELIMITER \ + TRANSFORM(CON_GETPLAYERANGLE) DELIMITER \ + TRANSFORM(CON_GETPNAME) DELIMITER \ + TRANSFORM(CON_GETTEXTURECEILING) DELIMITER \ + TRANSFORM(CON_GETTEXTUREFLOOR) DELIMITER \ + TRANSFORM(CON_GETTHISPROJECTILE) DELIMITER \ + TRANSFORM(CON_GETTICKS) DELIMITER \ + TRANSFORM(CON_GETTILEDATA) DELIMITER \ + TRANSFORM(CON_GETTIMEDATE) DELIMITER \ + TRANSFORM(CON_GETZRANGE) DELIMITER \ + TRANSFORM(CON_GLOBALSOUND) DELIMITER \ + TRANSFORM(CON_GMAXAMMO) DELIMITER \ + TRANSFORM(CON_GUNIQHUDID) DELIMITER \ + TRANSFORM(CON_GUTS) DELIMITER \ + TRANSFORM(CON_HEADSPRITESECT) DELIMITER \ + TRANSFORM(CON_HEADSPRITESTAT) DELIMITER \ + TRANSFORM(CON_HITRADIUS) DELIMITER \ + TRANSFORM(CON_HITSCAN) DELIMITER \ + TRANSFORM(CON_IFACTION) DELIMITER \ + TRANSFORM(CON_IFACTIONCOUNT) DELIMITER \ + TRANSFORM(CON_IFACTOR) DELIMITER \ + TRANSFORM(CON_IFACTORNOTSTAYPUT) DELIMITER \ + TRANSFORM(CON_IFACTORSOUND) DELIMITER \ + TRANSFORM(CON_IFAI) DELIMITER \ + TRANSFORM(CON_IFANGDIFFL) DELIMITER \ + TRANSFORM(CON_IFAWAYFROMWALL) DELIMITER \ + TRANSFORM(CON_IFBULLETNEAR) DELIMITER \ + TRANSFORM(CON_IFCANSEE) DELIMITER \ + TRANSFORM(CON_IFCANSEETARGET) DELIMITER \ + TRANSFORM(CON_IFCANSHOOTTARGET) DELIMITER \ + TRANSFORM(CON_IFCEILINGDISTL) DELIMITER \ + TRANSFORM(CON_IFCLIENT) DELIMITER \ + TRANSFORM(CON_IFCOUNT) DELIMITER \ + TRANSFORM(CON_IFCUTSCENE) DELIMITER \ + TRANSFORM(CON_IFDEAD) DELIMITER \ + TRANSFORM(CON_IFFLOORDISTL) DELIMITER \ + TRANSFORM(CON_IFGAPZL) DELIMITER \ + TRANSFORM(CON_IFGOTWEAPONCE) DELIMITER \ + TRANSFORM(CON_IFHITSPACE) DELIMITER \ + TRANSFORM(CON_IFHITWEAPON) DELIMITER \ + TRANSFORM(CON_IFINOUTERSPACE) DELIMITER \ + TRANSFORM(CON_IFINSPACE) DELIMITER \ + TRANSFORM(CON_IFINWATER) DELIMITER \ + TRANSFORM(CON_IFMOVE) DELIMITER \ + TRANSFORM(CON_IFMULTIPLAYER) DELIMITER \ + TRANSFORM(CON_IFNOSOUNDS) DELIMITER \ + TRANSFORM(CON_IFNOTMOVING) DELIMITER \ + TRANSFORM(CON_IFONWATER) DELIMITER \ + TRANSFORM(CON_IFOUTSIDE) DELIMITER \ + TRANSFORM(CON_IFP) DELIMITER \ + TRANSFORM(CON_IFPDISTG) DELIMITER \ + TRANSFORM(CON_IFPDISTL) DELIMITER \ + TRANSFORM(CON_IFPHEALTHL) DELIMITER \ + TRANSFORM(CON_IFPINVENTORY) DELIMITER \ + TRANSFORM(CON_IFPLAYBACKON) DELIMITER \ + TRANSFORM(CON_IFPLAYERSL) DELIMITER \ + TRANSFORM(CON_IFRESPAWN) DELIMITER \ + TRANSFORM(CON_IFRND) DELIMITER \ + TRANSFORM(CON_IFSERVER) DELIMITER \ + TRANSFORM(CON_IFSOUND) DELIMITER \ + TRANSFORM(CON_IFSPAWNEDBY) DELIMITER \ + TRANSFORM(CON_IFSPRITEPAL) DELIMITER \ + TRANSFORM(CON_IFSQUISHED) DELIMITER \ + TRANSFORM(CON_IFSTRENGTH) DELIMITER \ + TRANSFORM(CON_IFWASWEAPON) DELIMITER \ + TRANSFORM(CON_INITTIMER) DELIMITER \ + TRANSFORM(CON_INSERTSPRITEQ) DELIMITER \ + TRANSFORM(CON_INV) DELIMITER \ + TRANSFORM(CON_JUMP) DELIMITER \ + TRANSFORM(CON_KILLIT) DELIMITER \ + TRANSFORM(CON_KLABS) DELIMITER \ + TRANSFORM(CON_LDIST) DELIMITER \ + TRANSFORM(CON_LINEINTERSECT) DELIMITER \ + TRANSFORM(CON_LOADMAPSTATE) DELIMITER \ + TRANSFORM(CON_LOCKPLAYER) DELIMITER \ + TRANSFORM(CON_LOTSOFGLASS) DELIMITER \ + TRANSFORM(CON_MAIL) DELIMITER \ + TRANSFORM(CON_MIKESND) DELIMITER \ + TRANSFORM(CON_MINITEXT) DELIMITER \ + TRANSFORM(CON_MONEY) DELIMITER \ + TRANSFORM(CON_MOVE) DELIMITER \ + TRANSFORM(CON_MOVESECTOR) DELIMITER \ + TRANSFORM(CON_MOVESPRITE) DELIMITER \ + TRANSFORM(CON_MULSCALE) DELIMITER \ + TRANSFORM(CON_MYOS) DELIMITER \ + TRANSFORM(CON_MYOSPAL) DELIMITER \ + TRANSFORM(CON_MYOSPALX) DELIMITER \ + TRANSFORM(CON_MYOSX) DELIMITER \ + TRANSFORM(CON_NEARTAG) DELIMITER \ + TRANSFORM(CON_NEXTSECTORNEIGHBORZ) DELIMITER \ + TRANSFORM(CON_NEXTSPRITESECT) DELIMITER \ + TRANSFORM(CON_NEXTSPRITESTAT) DELIMITER \ + TRANSFORM(CON_NULLOP) DELIMITER \ + TRANSFORM(CON_OPERATE) DELIMITER \ + TRANSFORM(CON_OPERATEACTIVATORS) DELIMITER \ + TRANSFORM(CON_OPERATEMASTERSWITCHES) DELIMITER \ + TRANSFORM(CON_OPERATERESPAWNS) DELIMITER \ + TRANSFORM(CON_OPERATESECTORS) DELIMITER \ + TRANSFORM(CON_PALFROM) DELIMITER \ + TRANSFORM(CON_PAPER) DELIMITER \ + TRANSFORM(CON_PKICK) DELIMITER \ + TRANSFORM(CON_PRELOADTRACKSLOTFORSWAP) DELIMITER \ + TRANSFORM(CON_PREVSPRITESECT) DELIMITER \ + TRANSFORM(CON_PREVSPRITESTAT) DELIMITER \ + TRANSFORM(CON_PSTOMP) DELIMITER \ + TRANSFORM(CON_QGETSYSSTR) DELIMITER \ + TRANSFORM(CON_QSPAWN) DELIMITER \ + TRANSFORM(CON_QSPRINTF) DELIMITER \ + TRANSFORM(CON_QSTRCAT) DELIMITER \ + TRANSFORM(CON_QSTRCMP) DELIMITER \ + TRANSFORM(CON_QSTRCPY) DELIMITER \ + TRANSFORM(CON_QSTRDIM) DELIMITER \ + TRANSFORM(CON_QSTRLEN) DELIMITER \ + TRANSFORM(CON_QSTRNCAT) DELIMITER \ + TRANSFORM(CON_QSUBSTR) DELIMITER \ + TRANSFORM(CON_QUAKE) DELIMITER \ + TRANSFORM(CON_QUOTE) DELIMITER \ + TRANSFORM(CON_RAYINTERSECT) DELIMITER \ + TRANSFORM(CON_READARRAYFROMFILE) DELIMITER \ + TRANSFORM(CON_READGAMEVAR) DELIMITER \ + TRANSFORM(CON_REDEFINEQUOTE) DELIMITER \ + TRANSFORM(CON_RESETACTIONCOUNT) DELIMITER \ + TRANSFORM(CON_RESETCOUNT) DELIMITER \ + TRANSFORM(CON_RESETPLAYER) DELIMITER \ + TRANSFORM(CON_RESETPLAYERFLAGS) DELIMITER \ + TRANSFORM(CON_RESIZEARRAY) DELIMITER \ + TRANSFORM(CON_RESPAWNHITAG) DELIMITER \ + TRANSFORM(CON_RETURN) DELIMITER \ + TRANSFORM(CON_ROTATEPOINT) DELIMITER \ + TRANSFORM(CON_ROTATESPRITE) DELIMITER \ + TRANSFORM(CON_ROTATESPRITE16) DELIMITER \ + TRANSFORM(CON_ROTATESPRITEA) DELIMITER \ + TRANSFORM(CON_SAVE) DELIMITER \ + TRANSFORM(CON_SAVEGAMEVAR) DELIMITER \ + TRANSFORM(CON_SAVEMAPSTATE) DELIMITER \ + TRANSFORM(CON_SAVENN) DELIMITER \ + TRANSFORM(CON_SCALEVAR) DELIMITER \ + TRANSFORM(CON_SCREENPAL) DELIMITER \ + TRANSFORM(CON_SCREENSOUND) DELIMITER \ + TRANSFORM(CON_SCREENTEXT) DELIMITER \ + TRANSFORM(CON_SECTCLEARINTERPOLATION) DELIMITER \ + TRANSFORM(CON_SECTGETHITAG) DELIMITER \ + TRANSFORM(CON_SECTGETLOTAG) DELIMITER \ + TRANSFORM(CON_SECTOROFWALL) DELIMITER \ + TRANSFORM(CON_SECTSETINTERPOLATION) DELIMITER \ + TRANSFORM(CON_SETACTORANGLE) DELIMITER \ + TRANSFORM(CON_SETACTORSOUNDPITCH) DELIMITER \ + TRANSFORM(CON_SETASPECT) DELIMITER \ + TRANSFORM(CON_SETGAMEPALETTE) DELIMITER \ + TRANSFORM(CON_SETINPUT) DELIMITER \ + TRANSFORM(CON_SETMUSICPOSITION) DELIMITER \ + TRANSFORM(CON_SETPLAYERANGLE) DELIMITER \ + TRANSFORM(CON_SETSPRITE) DELIMITER \ + TRANSFORM(CON_SETTILEDATA) DELIMITER \ + TRANSFORM(CON_SHOOT) DELIMITER \ + TRANSFORM(CON_SHOWVIEW) DELIMITER \ + TRANSFORM(CON_SHOWVIEWQ16) DELIMITER \ + TRANSFORM(CON_SHOWVIEWQ16UNBIASED) DELIMITER \ + TRANSFORM(CON_SHOWVIEWUNBIASED) DELIMITER \ + TRANSFORM(CON_SIN) DELIMITER \ + TRANSFORM(CON_SIZEAT) DELIMITER \ + TRANSFORM(CON_SIZETO) DELIMITER \ + TRANSFORM(CON_SLEEPTIME) DELIMITER \ + TRANSFORM(CON_SMAXAMMO) DELIMITER \ + TRANSFORM(CON_SOUND) DELIMITER \ + TRANSFORM(CON_SOUNDONCE) DELIMITER \ + TRANSFORM(CON_SPAWN) DELIMITER \ + TRANSFORM(CON_SPAWNCEILINGGLASS) DELIMITER \ + TRANSFORM(CON_SPAWNWALLGLASS) DELIMITER \ + TRANSFORM(CON_SPAWNWALLSTAINEDGLASS) DELIMITER \ + TRANSFORM(CON_SPGETHITAG) DELIMITER \ + TRANSFORM(CON_SPGETLOTAG) DELIMITER \ + TRANSFORM(CON_SPRITEFLAGS) DELIMITER \ + TRANSFORM(CON_SPRITEPAL) DELIMITER \ + TRANSFORM(CON_SQRT) DELIMITER \ + TRANSFORM(CON_SSP) DELIMITER \ + TRANSFORM(CON_STARTCUTSCENE) DELIMITER \ + TRANSFORM(CON_STARTLEVEL) DELIMITER \ + TRANSFORM(CON_STARTSCREEN) DELIMITER \ + TRANSFORM(CON_STARTTRACK) DELIMITER \ + TRANSFORM(CON_STARTTRACKSLOT) DELIMITER \ + TRANSFORM(CON_STOPACTORSOUND) DELIMITER \ + TRANSFORM(CON_STOPALLMUSIC) DELIMITER \ + TRANSFORM(CON_STOPALLSOUNDS) DELIMITER \ + TRANSFORM(CON_STOPSOUND) DELIMITER \ + TRANSFORM(CON_STRENGTH) DELIMITER \ + TRANSFORM(CON_SWAPARRAYS) DELIMITER \ + TRANSFORM(CON_SWAPTRACKSLOT) DELIMITER \ + TRANSFORM(CON_SWITCH) DELIMITER \ + TRANSFORM(CON_TIME) DELIMITER \ + TRANSFORM(CON_TIP) DELIMITER \ + TRANSFORM(CON_TOSSWEAPON) DELIMITER \ + TRANSFORM(CON_UPDATESECTOR) DELIMITER \ + TRANSFORM(CON_UPDATESECTORZ) DELIMITER \ + TRANSFORM(CON_USERQUOTE) DELIMITER \ + TRANSFORM(CON_WACKPLAYER) DELIMITER \ + TRANSFORM(CON_WRITEARRAYTOFILE) DELIMITER \ + TRANSFORM(CON_ZSHOOT) DELIMITER \ + \ + TRANSFORM(CON_OPCODE_END) // these are the keywords that don't have instructions written into the bytecode - CON_ACTIVATE, - CON_ACTOR, - CON_APPENDEVENT, - CON_BETANAME, - CON_CASE, - CON_CHEATKEYS, - CON_DAMAGEEVENTTILE, - CON_DAMAGEEVENTTILERANGE, - CON_DEFAULT, - CON_DEFINE, - CON_DEFINECHEAT, - CON_DEFINEGAMEFUNCNAME, - CON_DEFINEGAMETYPE, - CON_DEFINELEVELNAME, - CON_DEFINEPROJECTILE, - CON_DEFINEQUOTE, - CON_DEFINESKILLNAME, - CON_DEFINESOUND, - CON_DEFINEVOLUMEFLAGS, - CON_DEFINEVOLUMENAME, - CON_DEFSTATE, - CON_DYNAMICREMAP, - CON_DYNAMICSOUNDREMAP, - CON_ENHANCED, - CON_EVENTLOADACTOR, - CON_GAMEARRAY, - CON_GAMESTARTUP, - CON_GAMEVAR, - CON_INCLUDE, - CON_INCLUDEDEFAULT, - CON_MUSIC, - CON_ONEVENT, - CON_PRECACHE, - CON_SCRIPTSIZE, - CON_SETCFGNAME, - CON_SETDEFNAME, - CON_SETGAMENAME, - CON_SHADETO, - CON_SPRITENOPAL, - CON_SPRITENOSHADE, - CON_SPRITENVG, - CON_SPRITESHADOW, - CON_UNDEFINECHEAT, - CON_UNDEFINEGAMEFUNC, - CON_UNDEFINELEVEL, - CON_UNDEFINESKILL, - CON_UNDEFINEVOLUME, - CON_USERACTOR, - - CON_END -}; +#define TRANSFORM_SCRIPT_ONLY_KEYWORDS_LIST(TRANSFORM, DELIMITER) \ + TRANSFORM(CON_ACTIVATE) DELIMITER \ + TRANSFORM(CON_ACTOR) DELIMITER \ + TRANSFORM(CON_APPENDEVENT) DELIMITER \ + TRANSFORM(CON_BETANAME) DELIMITER \ + TRANSFORM(CON_CASE) DELIMITER \ + TRANSFORM(CON_CHEATKEYS) DELIMITER \ + TRANSFORM(CON_DAMAGEEVENTTILE) DELIMITER \ + TRANSFORM(CON_DAMAGEEVENTTILERANGE) DELIMITER \ + TRANSFORM(CON_DEFAULT) DELIMITER \ + TRANSFORM(CON_DEFINE) DELIMITER \ + TRANSFORM(CON_DEFINECHEAT) DELIMITER \ + TRANSFORM(CON_DEFINEGAMEFUNCNAME) DELIMITER \ + TRANSFORM(CON_DEFINEGAMETYPE) DELIMITER \ + TRANSFORM(CON_DEFINELEVELNAME) DELIMITER \ + TRANSFORM(CON_DEFINEPROJECTILE) DELIMITER \ + TRANSFORM(CON_DEFINEQUOTE) DELIMITER \ + TRANSFORM(CON_DEFINESKILLNAME) DELIMITER \ + TRANSFORM(CON_DEFINESOUND) DELIMITER \ + TRANSFORM(CON_DEFINEVOLUMEFLAGS) DELIMITER \ + TRANSFORM(CON_DEFINEVOLUMENAME) DELIMITER \ + TRANSFORM(CON_DEFSTATE) DELIMITER \ + TRANSFORM(CON_DYNAMICREMAP) DELIMITER \ + TRANSFORM(CON_DYNAMICSOUNDREMAP) DELIMITER \ + TRANSFORM(CON_ENHANCED) DELIMITER \ + TRANSFORM(CON_EVENTLOADACTOR) DELIMITER \ + TRANSFORM(CON_GAMEARRAY) DELIMITER \ + TRANSFORM(CON_GAMESTARTUP) DELIMITER \ + TRANSFORM(CON_GAMEVAR) DELIMITER \ + TRANSFORM(CON_INCLUDE) DELIMITER \ + TRANSFORM(CON_INCLUDEDEFAULT) DELIMITER \ + TRANSFORM(CON_MUSIC) DELIMITER \ + TRANSFORM(CON_ONEVENT) DELIMITER \ + TRANSFORM(CON_PRECACHE) DELIMITER \ + TRANSFORM(CON_SCRIPTSIZE) DELIMITER \ + TRANSFORM(CON_SETCFGNAME) DELIMITER \ + TRANSFORM(CON_SETDEFNAME) DELIMITER \ + TRANSFORM(CON_SETGAMENAME) DELIMITER \ + TRANSFORM(CON_SHADETO) DELIMITER \ + TRANSFORM(CON_SPRITENOPAL) DELIMITER \ + TRANSFORM(CON_SPRITENOSHADE) DELIMITER \ + TRANSFORM(CON_SPRITENVG) DELIMITER \ + TRANSFORM(CON_SPRITESHADOW) DELIMITER \ + TRANSFORM(CON_UNDEFINECHEAT) DELIMITER \ + TRANSFORM(CON_UNDEFINEGAMEFUNC) DELIMITER \ + TRANSFORM(CON_UNDEFINELEVEL) DELIMITER \ + TRANSFORM(CON_UNDEFINESKILL) DELIMITER \ + TRANSFORM(CON_UNDEFINEVOLUME) DELIMITER \ + TRANSFORM(CON_USERACTOR) DELIMITER \ + \ + TRANSFORM(CON_END) // KEEPINSYNC with the keyword list in lunatic/con_lang.lua +#define ENUM_TRANSFORM(ENUM_CONST) ENUM_CONST +#define COMMA , +enum ScriptKeywords_t +{ + TRANSFORM_SCRIPT_KEYWORDS_LIST(ENUM_TRANSFORM, COMMA), + TRANSFORM_SCRIPT_ONLY_KEYWORDS_LIST(ENUM_TRANSFORM, COMMA) +}; +#undef ENUM_TRANSFORM +#undef COMMA + #endif #ifdef __cplusplus diff --git a/source/duke3d/src/gameexec.cpp b/source/duke3d/src/gameexec.cpp index 8bd87cf53..5d1873414 100644 --- a/source/duke3d/src/gameexec.cpp +++ b/source/duke3d/src/gameexec.cpp @@ -1265,6 +1265,11 @@ void Screen_Play(void) } \ } +# define vInstruction(KEYWORDID) case KEYWORDID +# define dispatch(INSTRUCTION) continue; +# define eval(INSTRUCTION) switch(INSTRUCTION) +# define vmErrorCase default + GAMEEXEC_STATIC void VM_Execute(native_t const poop) { native_t loop = poop; @@ -1293,385 +1298,385 @@ next_instruction: insptr++, loop--; continue; } - else switch (tw) + else eval(tw) { - case CON_IFVARE_GLOBAL: + vInstruction(CON_IFVARE_GLOBAL): insptr++; tw = aGameVars[*insptr++].global; VM_CONDITIONAL(tw == *insptr); - continue; - case CON_IFVARN_GLOBAL: + dispatch(tw); + vInstruction(CON_IFVARN_GLOBAL): insptr++; tw = aGameVars[*insptr++].global; VM_CONDITIONAL(tw != *insptr); - continue; - case CON_IFVARAND_GLOBAL: + dispatch(tw); + vInstruction(CON_IFVARAND_GLOBAL): insptr++; tw = aGameVars[*insptr++].global; VM_CONDITIONAL(tw & *insptr); - continue; - case CON_IFVAROR_GLOBAL: + dispatch(tw); + vInstruction(CON_IFVAROR_GLOBAL): insptr++; tw = aGameVars[*insptr++].global; VM_CONDITIONAL(tw | *insptr); - continue; - case CON_IFVARXOR_GLOBAL: + dispatch(tw); + vInstruction(CON_IFVARXOR_GLOBAL): insptr++; tw = aGameVars[*insptr++].global; VM_CONDITIONAL(tw ^ *insptr); - continue; - case CON_IFVAREITHER_GLOBAL: + dispatch(tw); + vInstruction(CON_IFVAREITHER_GLOBAL): insptr++; tw = aGameVars[*insptr++].global; VM_CONDITIONAL(tw || *insptr); - continue; - case CON_IFVARBOTH_GLOBAL: + dispatch(tw); + vInstruction(CON_IFVARBOTH_GLOBAL): insptr++; tw = aGameVars[*insptr++].global; VM_CONDITIONAL(tw && *insptr); - continue; - case CON_IFVARG_GLOBAL: + dispatch(tw); + vInstruction(CON_IFVARG_GLOBAL): insptr++; tw = aGameVars[*insptr++].global; VM_CONDITIONAL(tw > *insptr); - continue; - case CON_IFVARGE_GLOBAL: + dispatch(tw); + vInstruction(CON_IFVARGE_GLOBAL): insptr++; tw = aGameVars[*insptr++].global; VM_CONDITIONAL(tw >= *insptr); - continue; - case CON_IFVARL_GLOBAL: + dispatch(tw); + vInstruction(CON_IFVARL_GLOBAL): insptr++; tw = aGameVars[*insptr++].global; VM_CONDITIONAL(tw < *insptr); - continue; - case CON_IFVARLE_GLOBAL: + dispatch(tw); + vInstruction(CON_IFVARLE_GLOBAL): insptr++; tw = aGameVars[*insptr++].global; VM_CONDITIONAL(tw <= *insptr); - continue; - case CON_IFVARA_GLOBAL: + dispatch(tw); + vInstruction(CON_IFVARA_GLOBAL): insptr++; tw = aGameVars[*insptr++].global; VM_CONDITIONAL((uint32_t)tw > (uint32_t)*insptr); - continue; - case CON_IFVARAE_GLOBAL: + dispatch(tw); + vInstruction(CON_IFVARAE_GLOBAL): insptr++; tw = aGameVars[*insptr++].global; VM_CONDITIONAL((uint32_t)tw >= (uint32_t)*insptr); - continue; - case CON_IFVARB_GLOBAL: + dispatch(tw); + vInstruction(CON_IFVARB_GLOBAL): insptr++; tw = aGameVars[*insptr++].global; VM_CONDITIONAL((uint32_t)tw < (uint32_t)*insptr); - continue; - case CON_IFVARBE_GLOBAL: + dispatch(tw); + vInstruction(CON_IFVARBE_GLOBAL): insptr++; tw = aGameVars[*insptr++].global; VM_CONDITIONAL((uint32_t)tw <= (uint32_t)*insptr); - continue; + dispatch(tw); - case CON_SETVAR_GLOBAL: + vInstruction(CON_SETVAR_GLOBAL): insptr++; aGameVars[*insptr].global = insptr[1]; insptr += 2; - continue; - case CON_ADDVAR_GLOBAL: + dispatch(tw); + vInstruction(CON_ADDVAR_GLOBAL): insptr++; aGameVars[*insptr].global += insptr[1]; insptr += 2; - continue; - case CON_SUBVAR_GLOBAL: + dispatch(tw); + vInstruction(CON_SUBVAR_GLOBAL): insptr++; aGameVars[*insptr].global -= insptr[1]; insptr += 2; - continue; - case CON_MULVAR_GLOBAL: + dispatch(tw); + vInstruction(CON_MULVAR_GLOBAL): insptr++; aGameVars[*insptr].global *= insptr[1]; insptr += 2; - continue; - case CON_ANDVAR_GLOBAL: + dispatch(tw); + vInstruction(CON_ANDVAR_GLOBAL): insptr++; aGameVars[*insptr].global &= insptr[1]; insptr += 2; - continue; - case CON_XORVAR_GLOBAL: + dispatch(tw); + vInstruction(CON_XORVAR_GLOBAL): insptr++; aGameVars[*insptr].global ^= insptr[1]; insptr += 2; - continue; - case CON_ORVAR_GLOBAL: + dispatch(tw); + vInstruction(CON_ORVAR_GLOBAL): insptr++; aGameVars[*insptr].global |= insptr[1]; insptr += 2; - continue; - case CON_SHIFTVARL_GLOBAL: + dispatch(tw); + vInstruction(CON_SHIFTVARL_GLOBAL): insptr++; aGameVars[*insptr].global <<= insptr[1]; insptr += 2; - continue; - case CON_SHIFTVARR_GLOBAL: + dispatch(tw); + vInstruction(CON_SHIFTVARR_GLOBAL): insptr++; aGameVars[*insptr].global >>= insptr[1]; insptr += 2; - continue; - case CON_STATE: + dispatch(tw); + vInstruction(CON_STATE): { auto tempscrptr = &insptr[2]; insptr = (intptr_t *)insptr[1]; VM_Execute(1); insptr = tempscrptr; } - continue; + dispatch(tw); #ifdef INCOMPLETE_STRUCT_ACCESS - case CON_IFVARE_ACTOR: + vInstruction(CON_IFVARE_ACTOR): insptr++; tw = aGameVars[*insptr++].pValues[vm.spriteNum & (MAXSPRITES-1)]; VM_CONDITIONAL(tw == *insptr); - continue; - case CON_IFVARN_ACTOR: + dispatch(tw); + vInstruction(CON_IFVARN_ACTOR): insptr++; tw = aGameVars[*insptr++].pValues[vm.spriteNum & (MAXSPRITES-1)]; VM_CONDITIONAL(tw != *insptr); - continue; - case CON_IFVARAND_ACTOR: + dispatch(tw); + vInstruction(CON_IFVARAND_ACTOR): insptr++; tw = aGameVars[*insptr++].pValues[vm.spriteNum & (MAXSPRITES-1)]; VM_CONDITIONAL(tw & *insptr); - continue; - case CON_IFVAROR_ACTOR: + dispatch(tw); + vInstruction(CON_IFVAROR_ACTOR): insptr++; tw = aGameVars[*insptr++].pValues[vm.spriteNum & (MAXSPRITES-1)]; VM_CONDITIONAL(tw | *insptr); - continue; - case CON_IFVARXOR_ACTOR: + dispatch(tw); + vInstruction(CON_IFVARXOR_ACTOR): insptr++; tw = aGameVars[*insptr++].pValues[vm.spriteNum & (MAXSPRITES-1)]; VM_CONDITIONAL(tw ^ *insptr); - continue; - case CON_IFVAREITHER_ACTOR: + dispatch(tw); + vInstruction(CON_IFVAREITHER_ACTOR): insptr++; tw = aGameVars[*insptr++].pValues[vm.spriteNum & (MAXSPRITES-1)]; VM_CONDITIONAL(tw || *insptr); - continue; - case CON_IFVARBOTH_ACTOR: + dispatch(tw); + vInstruction(CON_IFVARBOTH_ACTOR): insptr++; tw = aGameVars[*insptr++].pValues[vm.spriteNum & (MAXSPRITES-1)]; VM_CONDITIONAL(tw && *insptr); - continue; - case CON_IFVARG_ACTOR: + dispatch(tw); + vInstruction(CON_IFVARG_ACTOR): insptr++; tw = aGameVars[*insptr++].pValues[vm.spriteNum & (MAXSPRITES-1)]; VM_CONDITIONAL(tw > *insptr); - continue; - case CON_IFVARGE_ACTOR: + dispatch(tw); + vInstruction(CON_IFVARGE_ACTOR): insptr++; tw = aGameVars[*insptr++].pValues[vm.spriteNum & (MAXSPRITES-1)]; VM_CONDITIONAL(tw >= *insptr); - continue; - case CON_IFVARL_ACTOR: + dispatch(tw); + vInstruction(CON_IFVARL_ACTOR): insptr++; tw = aGameVars[*insptr++].pValues[vm.spriteNum & (MAXSPRITES-1)]; VM_CONDITIONAL(tw < *insptr); - continue; - case CON_IFVARLE_ACTOR: + dispatch(tw); + vInstruction(CON_IFVARLE_ACTOR): insptr++; tw = aGameVars[*insptr++].pValues[vm.spriteNum & (MAXSPRITES-1)]; VM_CONDITIONAL(tw <= *insptr); - continue; - case CON_IFVARA_ACTOR: + dispatch(tw); + vInstruction(CON_IFVARA_ACTOR): insptr++; tw = aGameVars[*insptr++].pValues[vm.spriteNum & (MAXSPRITES-1)]; VM_CONDITIONAL((uint32_t)tw > (uint32_t)*insptr); - continue; - case CON_IFVARAE_ACTOR: + dispatch(tw); + vInstruction(CON_IFVARAE_ACTOR): insptr++; tw = aGameVars[*insptr++].pValues[vm.spriteNum & (MAXSPRITES-1)]; VM_CONDITIONAL((uint32_t)tw >= (uint32_t)*insptr); - continue; - case CON_IFVARB_ACTOR: + dispatch(tw); + vInstruction(CON_IFVARB_ACTOR): insptr++; tw = aGameVars[*insptr++].pValues[vm.spriteNum & (MAXSPRITES-1)]; VM_CONDITIONAL((uint32_t)tw < (uint32_t)*insptr); - continue; - case CON_IFVARBE_ACTOR: + dispatch(tw); + vInstruction(CON_IFVARBE_ACTOR): insptr++; tw = aGameVars[*insptr++].pValues[vm.spriteNum & (MAXSPRITES-1)]; VM_CONDITIONAL((uint32_t)tw <= (uint32_t)*insptr); - continue; + dispatch(tw); - case CON_SETVAR_ACTOR: + vInstruction(CON_SETVAR_ACTOR): insptr++; aGameVars[*insptr].pValues[vm.spriteNum & (MAXSPRITES-1)] = insptr[1]; insptr += 2; - continue; - case CON_ADDVAR_ACTOR: + dispatch(tw); + vInstruction(CON_ADDVAR_ACTOR): insptr++; aGameVars[*insptr].pValues[vm.spriteNum & (MAXSPRITES-1)] += insptr[1]; insptr += 2; - continue; - case CON_SUBVAR_ACTOR: + dispatch(tw); + vInstruction(CON_SUBVAR_ACTOR): insptr++; aGameVars[*insptr].pValues[vm.spriteNum & (MAXSPRITES-1)] -= insptr[1]; insptr += 2; - continue; - case CON_MULVAR_ACTOR: + dispatch(tw); + vInstruction(CON_MULVAR_ACTOR): insptr++; aGameVars[*insptr].pValues[vm.spriteNum & (MAXSPRITES-1)] *= insptr[1]; insptr += 2; - continue; - case CON_ANDVAR_ACTOR: + dispatch(tw); + vInstruction(CON_ANDVAR_ACTOR): insptr++; aGameVars[*insptr].pValues[vm.spriteNum & (MAXSPRITES-1)] &= insptr[1]; insptr += 2; - continue; - case CON_XORVAR_ACTOR: + dispatch(tw); + vInstruction(CON_XORVAR_ACTOR): insptr++; aGameVars[*insptr].pValues[vm.spriteNum & (MAXSPRITES-1)] ^= insptr[1]; insptr += 2; - continue; - case CON_ORVAR_ACTOR: + dispatch(tw); + vInstruction(CON_ORVAR_ACTOR): insptr++; aGameVars[*insptr].pValues[vm.spriteNum & (MAXSPRITES-1)] |= insptr[1]; insptr += 2; - continue; - case CON_SHIFTVARL_ACTOR: + dispatch(tw); + vInstruction(CON_SHIFTVARL_ACTOR): insptr++; aGameVars[*insptr].pValues[vm.spriteNum & (MAXSPRITES-1)] <<= insptr[1]; insptr += 2; - continue; - case CON_SHIFTVARR_ACTOR: + dispatch(tw); + vInstruction(CON_SHIFTVARR_ACTOR): insptr++; aGameVars[*insptr].pValues[vm.spriteNum & (MAXSPRITES-1)] >>= insptr[1]; insptr += 2; - continue; + dispatch(tw); - case CON_IFVARE_PLAYER: + vInstruction(CON_IFVARE_PLAYER): insptr++; tw = aGameVars[*insptr++].pValues[vm.playerNum & (MAXPLAYERS-1)]; VM_CONDITIONAL(tw == *insptr); - continue; - case CON_IFVARN_PLAYER: + dispatch(tw); + vInstruction(CON_IFVARN_PLAYER): insptr++; tw = aGameVars[*insptr++].pValues[vm.playerNum & (MAXPLAYERS-1)]; VM_CONDITIONAL(tw != *insptr); - continue; - case CON_IFVARAND_PLAYER: + dispatch(tw); + vInstruction(CON_IFVARAND_PLAYER): insptr++; tw = aGameVars[*insptr++].pValues[vm.playerNum & (MAXPLAYERS-1)]; VM_CONDITIONAL(tw & *insptr); - continue; - case CON_IFVAROR_PLAYER: + dispatch(tw); + vInstruction(CON_IFVAROR_PLAYER): insptr++; tw = aGameVars[*insptr++].pValues[vm.playerNum & (MAXPLAYERS-1)]; VM_CONDITIONAL(tw | *insptr); - continue; - case CON_IFVARXOR_PLAYER: + dispatch(tw); + vInstruction(CON_IFVARXOR_PLAYER): insptr++; tw = aGameVars[*insptr++].pValues[vm.playerNum & (MAXPLAYERS-1)]; VM_CONDITIONAL(tw ^ *insptr); - continue; - case CON_IFVAREITHER_PLAYER: + dispatch(tw); + vInstruction(CON_IFVAREITHER_PLAYER): insptr++; tw = aGameVars[*insptr++].pValues[vm.playerNum & (MAXPLAYERS-1)]; VM_CONDITIONAL(tw || *insptr); - continue; - case CON_IFVARBOTH_PLAYER: + dispatch(tw); + vInstruction(CON_IFVARBOTH_PLAYER): insptr++; tw = aGameVars[*insptr++].pValues[vm.playerNum & (MAXPLAYERS-1)]; VM_CONDITIONAL(tw && *insptr); - continue; - case CON_IFVARG_PLAYER: + dispatch(tw); + vInstruction(CON_IFVARG_PLAYER): insptr++; tw = aGameVars[*insptr++].pValues[vm.playerNum & (MAXPLAYERS-1)]; VM_CONDITIONAL(tw > *insptr); - continue; - case CON_IFVARGE_PLAYER: + dispatch(tw); + vInstruction(CON_IFVARGE_PLAYER): insptr++; tw = aGameVars[*insptr++].pValues[vm.playerNum & (MAXPLAYERS-1)]; VM_CONDITIONAL(tw >= *insptr); - continue; - case CON_IFVARL_PLAYER: + dispatch(tw); + vInstruction(CON_IFVARL_PLAYER): insptr++; tw = aGameVars[*insptr++].pValues[vm.playerNum & (MAXPLAYERS-1)]; VM_CONDITIONAL(tw < *insptr); - continue; - case CON_IFVARLE_PLAYER: + dispatch(tw); + vInstruction(CON_IFVARLE_PLAYER): insptr++; tw = aGameVars[*insptr++].pValues[vm.playerNum & (MAXPLAYERS-1)]; VM_CONDITIONAL(tw <= *insptr); - continue; - case CON_IFVARA_PLAYER: + dispatch(tw); + vInstruction(CON_IFVARA_PLAYER): insptr++; tw = aGameVars[*insptr++].pValues[vm.playerNum & (MAXPLAYERS-1)]; VM_CONDITIONAL((uint32_t)tw > (uint32_t)*insptr); - continue; - case CON_IFVARAE_PLAYER: + dispatch(tw); + vInstruction(CON_IFVARAE_PLAYER): insptr++; tw = aGameVars[*insptr++].pValues[vm.playerNum & (MAXPLAYERS-1)]; VM_CONDITIONAL((uint32_t)tw >= (uint32_t)*insptr); - continue; - case CON_IFVARB_PLAYER: + dispatch(tw); + vInstruction(CON_IFVARB_PLAYER): insptr++; tw = aGameVars[*insptr++].pValues[vm.playerNum & (MAXPLAYERS-1)]; VM_CONDITIONAL((uint32_t)tw < (uint32_t)*insptr); - continue; - case CON_IFVARBE_PLAYER: + dispatch(tw); + vInstruction(CON_IFVARBE_PLAYER): insptr++; tw = aGameVars[*insptr++].pValues[vm.playerNum & (MAXPLAYERS-1)]; VM_CONDITIONAL((uint32_t)tw <= (uint32_t)*insptr); - continue; + dispatch(tw); - case CON_SETVAR_PLAYER: + vInstruction(CON_SETVAR_PLAYER): insptr++; aGameVars[*insptr].pValues[vm.playerNum & (MAXPLAYERS-1)] = insptr[1]; insptr += 2; - continue; - case CON_ADDVAR_PLAYER: + dispatch(tw); + vInstruction(CON_ADDVAR_PLAYER): insptr++; aGameVars[*insptr].pValues[vm.playerNum & (MAXPLAYERS-1)] += insptr[1]; insptr += 2; - continue; - case CON_SUBVAR_PLAYER: + dispatch(tw); + vInstruction(CON_SUBVAR_PLAYER): insptr++; aGameVars[*insptr].pValues[vm.playerNum & (MAXPLAYERS-1)] -= insptr[1]; insptr += 2; - continue; - case CON_MULVAR_PLAYER: + dispatch(tw); + vInstruction(CON_MULVAR_PLAYER): insptr++; aGameVars[*insptr].pValues[vm.playerNum & (MAXPLAYERS-1)] *= insptr[1]; insptr += 2; - continue; - case CON_ANDVAR_PLAYER: + dispatch(tw); + vInstruction(CON_ANDVAR_PLAYER): insptr++; aGameVars[*insptr].pValues[vm.playerNum & (MAXPLAYERS-1)] &= insptr[1]; insptr += 2; - continue; - case CON_XORVAR_PLAYER: + dispatch(tw); + vInstruction(CON_XORVAR_PLAYER): insptr++; aGameVars[*insptr].pValues[vm.playerNum & (MAXPLAYERS-1)] ^= insptr[1]; insptr += 2; - continue; - case CON_ORVAR_PLAYER: + dispatch(tw); + vInstruction(CON_ORVAR_PLAYER): insptr++; aGameVars[*insptr].pValues[vm.playerNum & (MAXPLAYERS-1)] |= insptr[1]; insptr += 2; - continue; - case CON_SHIFTVARL_PLAYER: + dispatch(tw); + vInstruction(CON_SHIFTVARL_PLAYER): insptr++; aGameVars[*insptr].pValues[vm.playerNum & (MAXPLAYERS-1)] <<= insptr[1]; insptr += 2; - continue; - case CON_SHIFTVARR_PLAYER: + dispatch(tw); + vInstruction(CON_SHIFTVARR_PLAYER): insptr++; aGameVars[*insptr].pValues[vm.playerNum & (MAXPLAYERS-1)] >>= insptr[1]; insptr += 2; - continue; + dispatch(tw); #endif - case CON_WHILEVARN_GLOBAL: + vInstruction(CON_WHILEVARN_GLOBAL): { auto const savedinsptr = &insptr[2]; do @@ -1680,10 +1685,10 @@ next_instruction: tw = (aGameVars[insptr[-1]].global != *insptr); VM_CONDITIONAL(tw); } while (tw); - continue; + dispatch(tw); } - case CON_WHILEVARL_GLOBAL: + vInstruction(CON_WHILEVARL_GLOBAL): { auto const savedinsptr = &insptr[2]; do @@ -1692,11 +1697,11 @@ next_instruction: tw = (aGameVars[insptr[-1]].global < *insptr); VM_CONDITIONAL(tw); } while (tw); - continue; + dispatch(tw); } #ifdef INCOMPLETE_STRUCT_ACCESS - case CON_WHILEVARN_ACTOR: + vInstruction(CON_WHILEVARN_ACTOR): { auto const savedinsptr = &insptr[2]; auto &v = aGameVars[savedinsptr[-1]].pValues[vm.spriteNum & (MAXSPRITES-1)]; @@ -1707,10 +1712,10 @@ next_instruction: VM_CONDITIONAL(tw); } while (tw); - continue; + dispatch(tw); } - case CON_WHILEVARL_ACTOR: + vInstruction(CON_WHILEVARL_ACTOR): { auto const savedinsptr = &insptr[2]; auto &v = aGameVars[savedinsptr[-1]].pValues[vm.spriteNum & (MAXSPRITES-1)]; @@ -1721,10 +1726,10 @@ next_instruction: VM_CONDITIONAL(tw); } while (tw); - continue; + dispatch(tw); } - case CON_WHILEVARN_PLAYER: + vInstruction(CON_WHILEVARN_PLAYER): { auto const savedinsptr = &insptr[2]; auto &v = aGameVars[savedinsptr[-1]].pValues[vm.playerNum & (MAXPLAYERS-1)]; @@ -1735,10 +1740,10 @@ next_instruction: VM_CONDITIONAL(tw); } while (tw); - continue; + dispatch(tw); } - case CON_WHILEVARL_PLAYER: + vInstruction(CON_WHILEVARL_PLAYER): { auto const savedinsptr = &insptr[2]; auto &v = aGameVars[savedinsptr[-1]].pValues[vm.playerNum & (MAXPLAYERS-1)]; @@ -1749,111 +1754,111 @@ next_instruction: VM_CONDITIONAL(tw); } while (tw); - continue; + dispatch(tw); } #endif - case CON_MODVAR_GLOBAL: + vInstruction(CON_MODVAR_GLOBAL): insptr++; aGameVars[*insptr].global %= insptr[1]; insptr += 2; - continue; + dispatch(tw); #ifdef INCOMPLETE_STRUCT_ACCESS - case CON_MODVAR_ACTOR: + vInstruction(CON_MODVAR_ACTOR): insptr++; aGameVars[*insptr].pValues[vm.spriteNum & (MAXSPRITES-1)] %= insptr[1]; insptr += 2; - continue; - case CON_MODVAR_PLAYER: + dispatch(tw); + vInstruction(CON_MODVAR_PLAYER): insptr++; aGameVars[*insptr].pValues[vm.playerNum & (MAXPLAYERS-1)] %= insptr[1]; insptr += 2; - continue; + dispatch(tw); #endif - case CON_IFVARAND: + vInstruction(CON_IFVARAND): insptr++; tw = Gv_GetVarX(*insptr++); VM_CONDITIONAL(tw & *insptr); - continue; + dispatch(tw); - case CON_IFVAROR: + vInstruction(CON_IFVAROR): insptr++; tw = Gv_GetVarX(*insptr++); VM_CONDITIONAL(tw | *insptr); - continue; + dispatch(tw); - case CON_IFVARXOR: + vInstruction(CON_IFVARXOR): insptr++; tw = Gv_GetVarX(*insptr++); VM_CONDITIONAL(tw ^ *insptr); - continue; + dispatch(tw); - case CON_IFVAREITHER: + vInstruction(CON_IFVAREITHER): insptr++; tw = Gv_GetVarX(*insptr++); VM_CONDITIONAL(tw || *insptr); - continue; + dispatch(tw); - case CON_IFVARBOTH: + vInstruction(CON_IFVARBOTH): insptr++; tw = Gv_GetVarX(*insptr++); VM_CONDITIONAL(tw && *insptr); - continue; + dispatch(tw); - case CON_IFRND: + vInstruction(CON_IFRND): VM_CONDITIONAL(rnd(*(++insptr))); - continue; + dispatch(tw); - case CON_IFVARG: + vInstruction(CON_IFVARG): insptr++; tw = Gv_GetVarX(*insptr++); VM_CONDITIONAL(tw > *insptr); - continue; + dispatch(tw); - case CON_IFVARGE: + vInstruction(CON_IFVARGE): insptr++; tw = Gv_GetVarX(*insptr++); VM_CONDITIONAL(tw >= *insptr); - continue; + dispatch(tw); - case CON_IFVARL: + vInstruction(CON_IFVARL): insptr++; tw = Gv_GetVarX(*insptr++); VM_CONDITIONAL(tw < *insptr); - continue; + dispatch(tw); - case CON_IFVARLE: + vInstruction(CON_IFVARLE): insptr++; tw = Gv_GetVarX(*insptr++); VM_CONDITIONAL(tw <= *insptr); - continue; + dispatch(tw); - case CON_IFVARA: + vInstruction(CON_IFVARA): insptr++; tw = Gv_GetVarX(*insptr++); VM_CONDITIONAL((uint32_t)tw > (uint32_t)*insptr); - continue; + dispatch(tw); - case CON_IFVARAE: + vInstruction(CON_IFVARAE): insptr++; tw = Gv_GetVarX(*insptr++); VM_CONDITIONAL((uint32_t)tw >= (uint32_t)*insptr); - continue; + dispatch(tw); - case CON_IFVARB: + vInstruction(CON_IFVARB): insptr++; tw = Gv_GetVarX(*insptr++); VM_CONDITIONAL((uint32_t)tw < (uint32_t)*insptr); - continue; + dispatch(tw); - case CON_IFVARBE: + vInstruction(CON_IFVARBE): insptr++; tw = Gv_GetVarX(*insptr++); VM_CONDITIONAL((uint32_t)tw <= (uint32_t)*insptr); - continue; + dispatch(tw); - case CON_SETVARVAR: + vInstruction(CON_SETVARVAR): insptr++; { tw = *insptr++; @@ -1864,85 +1869,85 @@ next_instruction: else Gv_SetVarX(tw, nValue); } - continue; + dispatch(tw); - case CON_ADDVARVAR: + vInstruction(CON_ADDVARVAR): insptr++; tw = *insptr++; Gv_AddVar(tw, Gv_GetVarX(*insptr++)); - continue; + dispatch(tw); - case CON_SUBVARVAR: + vInstruction(CON_SUBVARVAR): insptr++; tw = *insptr++; Gv_SubVar(tw, Gv_GetVarX(*insptr++)); - continue; + dispatch(tw); - case CON_ANDVARVAR: + vInstruction(CON_ANDVARVAR): insptr++; tw = *insptr++; Gv_AndVar(tw, Gv_GetVarX(*insptr++)); - continue; + dispatch(tw); - case CON_XORVARVAR: + vInstruction(CON_XORVARVAR): insptr++; tw = *insptr++; Gv_XorVar(tw, Gv_GetVarX(*insptr++)); - continue; + dispatch(tw); - case CON_ORVARVAR: + vInstruction(CON_ORVARVAR): insptr++; tw = *insptr++; Gv_OrVar(tw, Gv_GetVarX(*insptr++)); - continue; + dispatch(tw); - case CON_SHIFTVARVARL: + vInstruction(CON_SHIFTVARVARL): insptr++; tw = *insptr++; Gv_ShiftVarL(tw, Gv_GetVarX(*insptr++)); - continue; + dispatch(tw); - case CON_SHIFTVARVARR: + vInstruction(CON_SHIFTVARVARR): insptr++; tw = *insptr++; Gv_ShiftVarR(tw, Gv_GetVarX(*insptr++)); - continue; + dispatch(tw); - case CON_MULVARVAR: + vInstruction(CON_MULVARVAR): insptr++; tw = *insptr++; Gv_MulVar(tw, Gv_GetVarX(*insptr++)); - continue; + dispatch(tw); - case CON_DIVVAR_GLOBAL: + vInstruction(CON_DIVVAR_GLOBAL): insptr++; aGameVars[*insptr].global = tabledivide32(aGameVars[*insptr].global, insptr[1]); insptr += 2; - continue; + dispatch(tw); #ifdef INCOMPLETE_STRUCT_ACCESS - case CON_DIVVAR_PLAYER: + vInstruction(CON_DIVVAR_PLAYER): { insptr++; auto &v = aGameVars[*insptr].pValues[vm.playerNum & (MAXPLAYERS - 1)]; v = tabledivide32(v, insptr[1]); insptr += 2; - continue; + dispatch(tw); } - case CON_DIVVAR_ACTOR: + vInstruction(CON_DIVVAR_ACTOR): { insptr++; auto &v = aGameVars[*insptr].pValues[vm.spriteNum & (MAXSPRITES - 1)]; v = tabledivide32(v, insptr[1]); insptr += 2; - continue; + dispatch(tw); } #endif - case CON_DIVVARVAR: + vInstruction(CON_DIVVARVAR): insptr++; { tw = *insptr++; @@ -1952,146 +1957,146 @@ next_instruction: if (EDUKE32_PREDICT_FALSE(!nValue)) { CON_CRITICALERRPRINTF("divide by zero!\n"); - continue; + dispatch(tw); } Gv_DivVar(tw, nValue); - continue; + dispatch(tw); } - case CON_IFVARE: + vInstruction(CON_IFVARE): insptr++; tw = Gv_GetVarX(*insptr++); VM_CONDITIONAL(tw == *insptr); - continue; + dispatch(tw); - case CON_IFVARN: + vInstruction(CON_IFVARN): insptr++; tw = Gv_GetVarX(*insptr++); VM_CONDITIONAL(tw != *insptr); - continue; + dispatch(tw); - case CON_IFVARVARE: + vInstruction(CON_IFVARVARE): insptr++; tw = Gv_GetVarX(*insptr++); tw = (tw == Gv_GetVarX(*insptr++)); insptr--; VM_CONDITIONAL(tw); - continue; + dispatch(tw); - case CON_IFVARVARN: + vInstruction(CON_IFVARVARN): insptr++; tw = Gv_GetVarX(*insptr++); tw = (tw != Gv_GetVarX(*insptr++)); insptr--; VM_CONDITIONAL(tw); - continue; + dispatch(tw); - case CON_IFVARVARG: + vInstruction(CON_IFVARVARG): insptr++; tw = Gv_GetVarX(*insptr++); tw = (tw > Gv_GetVarX(*insptr++)); insptr--; VM_CONDITIONAL(tw); - continue; + dispatch(tw); - case CON_IFVARVARGE: + vInstruction(CON_IFVARVARGE): insptr++; tw = Gv_GetVarX(*insptr++); tw = (tw >= Gv_GetVarX(*insptr++)); insptr--; VM_CONDITIONAL(tw); - continue; + dispatch(tw); - case CON_IFVARVARL: + vInstruction(CON_IFVARVARL): insptr++; tw = Gv_GetVarX(*insptr++); tw = (tw < Gv_GetVarX(*insptr++)); insptr--; VM_CONDITIONAL(tw); - continue; + dispatch(tw); - case CON_IFVARVARLE: + vInstruction(CON_IFVARVARLE): insptr++; tw = Gv_GetVarX(*insptr++); tw = (tw <= Gv_GetVarX(*insptr++)); insptr--; VM_CONDITIONAL(tw); - continue; + dispatch(tw); - case CON_IFVARVARA: + vInstruction(CON_IFVARVARA): insptr++; tw = Gv_GetVarX(*insptr++); tw = ((uint32_t)tw > (uint32_t)Gv_GetVarX(*insptr++)); insptr--; VM_CONDITIONAL(tw); - continue; + dispatch(tw); - case CON_IFVARVARAE: + vInstruction(CON_IFVARVARAE): insptr++; tw = Gv_GetVarX(*insptr++); tw = ((uint32_t)tw >= (uint32_t)Gv_GetVarX(*insptr++)); insptr--; VM_CONDITIONAL(tw); - continue; + dispatch(tw); - case CON_IFVARVARB: + vInstruction(CON_IFVARVARB): insptr++; tw = Gv_GetVarX(*insptr++); tw = ((uint32_t)tw < (uint32_t)Gv_GetVarX(*insptr++)); insptr--; VM_CONDITIONAL(tw); - continue; + dispatch(tw); - case CON_IFVARVARBE: + vInstruction(CON_IFVARVARBE): insptr++; tw = Gv_GetVarX(*insptr++); tw = ((uint32_t)tw <= (uint32_t)Gv_GetVarX(*insptr++)); insptr--; VM_CONDITIONAL(tw); - continue; + dispatch(tw); - case CON_IFVARVARAND: + vInstruction(CON_IFVARVARAND): insptr++; tw = Gv_GetVarX(*insptr++); tw &= Gv_GetVarX(*insptr++); insptr--; VM_CONDITIONAL(tw); - continue; + dispatch(tw); - case CON_IFVARVAROR: + vInstruction(CON_IFVARVAROR): insptr++; tw = Gv_GetVarX(*insptr++); tw |= Gv_GetVarX(*insptr++); insptr--; VM_CONDITIONAL(tw); - continue; + dispatch(tw); - case CON_IFVARVARXOR: + vInstruction(CON_IFVARVARXOR): insptr++; tw = Gv_GetVarX(*insptr++); tw ^= Gv_GetVarX(*insptr++); insptr--; VM_CONDITIONAL(tw); - continue; + dispatch(tw); - case CON_IFVARVAREITHER: + vInstruction(CON_IFVARVAREITHER): insptr++; tw = Gv_GetVarX(*insptr++); tw = (Gv_GetVarX(*insptr++) || tw); insptr--; VM_CONDITIONAL(tw); - continue; + dispatch(tw); - case CON_IFVARVARBOTH: + vInstruction(CON_IFVARVARBOTH): insptr++; tw = Gv_GetVarX(*insptr++); tw = (Gv_GetVarX(*insptr++) && tw); insptr--; VM_CONDITIONAL(tw); - continue; + dispatch(tw); - case CON_WHILEVARN: + vInstruction(CON_WHILEVARN): { auto const savedinsptr = &insptr[2]; do @@ -2100,10 +2105,10 @@ next_instruction: tw = (Gv_GetVarX(insptr[-1]) != *insptr); VM_CONDITIONAL(tw); } while (tw); - continue; + dispatch(tw); } - case CON_WHILEVARVARN: + vInstruction(CON_WHILEVARVARN): { auto const savedinsptr = &insptr[2]; do @@ -2114,10 +2119,10 @@ next_instruction: insptr--; VM_CONDITIONAL(tw); } while (tw); - continue; + dispatch(tw); } - case CON_WHILEVARL: + vInstruction(CON_WHILEVARL): { auto const savedinsptr = &insptr[2]; do @@ -2126,10 +2131,10 @@ next_instruction: tw = (Gv_GetVarX(insptr[-1]) < *insptr); VM_CONDITIONAL(tw); } while (tw); - continue; + dispatch(tw); } - case CON_WHILEVARVARL: + vInstruction(CON_WHILEVARVARL): { auto const savedinsptr = &insptr[2]; do @@ -2140,76 +2145,76 @@ next_instruction: insptr--; VM_CONDITIONAL(tw); } while (tw); - continue; + dispatch(tw); } - case CON_SETVAR: + vInstruction(CON_SETVAR): insptr++; Gv_SetVarX(*insptr, insptr[1]); insptr += 2; - continue; + dispatch(tw); - case CON_ADDVAR: + vInstruction(CON_ADDVAR): insptr++; Gv_AddVar(*insptr, insptr[1]); insptr += 2; - continue; + dispatch(tw); - case CON_SUBVAR: + vInstruction(CON_SUBVAR): insptr++; Gv_SubVar(*insptr, insptr[1]); insptr += 2; - continue; + dispatch(tw); - case CON_MULVAR: + vInstruction(CON_MULVAR): insptr++; Gv_MulVar(*insptr, insptr[1]); insptr += 2; - continue; + dispatch(tw); - case CON_DIVVAR: + vInstruction(CON_DIVVAR): insptr++; Gv_DivVar(*insptr, insptr[1]); insptr += 2; - continue; + dispatch(tw); - case CON_ANDVAR: + vInstruction(CON_ANDVAR): insptr++; Gv_AndVar(*insptr, insptr[1]); insptr += 2; - continue; + dispatch(tw); - case CON_XORVAR: + vInstruction(CON_XORVAR): insptr++; Gv_XorVar(*insptr, insptr[1]); insptr += 2; - continue; + dispatch(tw); - case CON_ORVAR: + vInstruction(CON_ORVAR): insptr++; Gv_OrVar(*insptr, insptr[1]); insptr += 2; - continue; + dispatch(tw); - case CON_SHIFTVARL: + vInstruction(CON_SHIFTVARL): insptr++; Gv_ShiftVarL(*insptr, insptr[1]); insptr += 2; - continue; + dispatch(tw); - case CON_SHIFTVARR: + vInstruction(CON_SHIFTVARR): insptr++; Gv_ShiftVarR(*insptr, insptr[1]); insptr += 2; - continue; + dispatch(tw); - case CON_MODVAR: + vInstruction(CON_MODVAR): insptr++; Gv_ModVar(*insptr, insptr[1]); insptr += 2; - continue; + dispatch(tw); - case CON_MODVARVAR: + vInstruction(CON_MODVARVAR): insptr++; { tw = *insptr++; @@ -2219,46 +2224,46 @@ next_instruction: if (EDUKE32_PREDICT_FALSE(!nValue)) { CON_CRITICALERRPRINTF("mod by zero!\n"); - continue; + dispatch(tw); } Gv_ModVar(tw, nValue); - continue; + dispatch(tw); } - case CON_RANDVAR: + vInstruction(CON_RANDVAR): insptr++; Gv_SetVarX(*insptr, mulscale16(krand(), insptr[1] + 1)); insptr += 2; - continue; + dispatch(tw); - case CON_RANDVAR_GLOBAL: + vInstruction(CON_RANDVAR_GLOBAL): insptr++; aGameVars[*insptr].global = mulscale16(krand(), insptr[1] + 1); insptr += 2; - continue; + dispatch(tw); #ifdef INCOMPLETE_STRUCT_ACCESS - case CON_RANDVAR_PLAYER: + vInstruction(CON_RANDVAR_PLAYER): insptr++; aGameVars[*insptr].pValues[vm.playerNum & (MAXPLAYERS-1)] = mulscale16(krand(), insptr[1] + 1); insptr += 2; - continue; + dispatch(tw); - case CON_RANDVAR_ACTOR: + vInstruction(CON_RANDVAR_ACTOR): insptr++; aGameVars[*insptr].pValues[vm.spriteNum & (MAXSPRITES-1)] = mulscale16(krand(), insptr[1] + 1); insptr += 2; - continue; + dispatch(tw); #endif - case CON_RANDVARVAR: + vInstruction(CON_RANDVARVAR): insptr++; tw = *insptr++; Gv_SetVarX(tw, mulscale16(krand(), Gv_GetVarX(*insptr++) + 1)); - continue; + dispatch(tw); - case CON_SETPLAYER: + vInstruction(CON_SETPLAYER): insptr++; { int const playerNum = (*insptr++ != g_thisActorVarID) ? Gv_GetVarX(insptr[-1]) : vm.playerNum; @@ -2266,10 +2271,10 @@ next_instruction: int const lParm2 = (PlayerLabels[labelNum].flags & LABEL_HASPARM2) ? Gv_GetVarX(*insptr++) : 0; VM_SetPlayer(playerNum, labelNum, lParm2, Gv_GetVarX(*insptr++)); - continue; + dispatch(tw); } - case CON_GETPLAYER: + vInstruction(CON_GETPLAYER): insptr++; { int const playerNum = (*insptr++ != g_thisActorVarID) ? Gv_GetVarX(insptr[-1]) : vm.playerNum; @@ -2277,9 +2282,9 @@ next_instruction: int const lParm2 = (PlayerLabels[labelNum].flags & LABEL_HASPARM2) ? Gv_GetVarX(*insptr++) : 0; Gv_SetVarX(*insptr++, VM_GetPlayer(playerNum, labelNum, lParm2)); - continue; + dispatch(tw); } - case CON_SETWALL: + vInstruction(CON_SETWALL): insptr++; { tw = *insptr++; @@ -2292,15 +2297,15 @@ next_instruction: if (wallLabel.offset == -1 || wallLabel.flags & LABEL_WRITEFUNC) { VM_SetWall(wallNum, labelNum, newValue); - continue; + dispatch(tw); } VM_SetStruct(wallLabel.flags, (intptr_t *)((char *)&wall[wallNum] + wallLabel.offset), newValue); - continue; + dispatch(tw); } - case CON_GETWALL: + vInstruction(CON_GETWALL): insptr++; { tw = *insptr++; @@ -2314,11 +2319,11 @@ next_instruction: ? VM_GetStruct(wallLabel.flags, (intptr_t *)((char *)&wall[wallNum] + wallLabel.offset)) : VM_GetWall(wallNum, labelNum)); - continue; + dispatch(tw); } - case CON_SETACTORVAR: - case CON_GETACTORVAR: + vInstruction(CON_SETACTORVAR): + vInstruction(CON_GETACTORVAR): insptr++; { int const lSprite = Gv_GetVarX(*insptr++); @@ -2328,7 +2333,7 @@ next_instruction: if (EDUKE32_PREDICT_FALSE((unsigned)lSprite >= MAXSPRITES)) { CON_ERRPRINTF("invalid sprite %d\n", lSprite); - continue; + dispatch(tw); } if (tw == CON_SETACTORVAR) @@ -2336,11 +2341,11 @@ next_instruction: else Gv_SetVarX(lVar2, Gv_GetVar(lVar1, lSprite, vm.playerNum)); - continue; + dispatch(tw); } - case CON_SETPLAYERVAR: - case CON_GETPLAYERVAR: + vInstruction(CON_SETPLAYERVAR): + vInstruction(CON_GETPLAYERVAR): insptr++; { int const playerNum = (*insptr++ != g_thisActorVarID) ? Gv_GetVarX(insptr[-1]) : vm.playerNum; @@ -2350,7 +2355,7 @@ next_instruction: if (EDUKE32_PREDICT_FALSE((unsigned)playerNum >= (unsigned)g_mostConcurrentPlayers)) { CON_ERRPRINTF("invalid player %d\n", playerNum); - continue; + dispatch(tw); } if (tw == CON_SETPLAYERVAR) @@ -2358,10 +2363,10 @@ next_instruction: else Gv_SetVarX(lVar2, Gv_GetVar(lVar1, vm.spriteNum, playerNum)); - continue; + dispatch(tw); } - case CON_SETACTOR: + vInstruction(CON_SETACTOR): insptr++; { int const spriteNum = (*insptr++ != g_thisActorVarID) ? Gv_GetVarX(insptr[-1]) : vm.spriteNum; @@ -2373,14 +2378,14 @@ next_instruction: || (actorLabel.flags & LABEL_HASPARM2 && (unsigned)lParm2 >= (unsigned)actorLabel.maxParm2))) { CON_ERRPRINTF("%s[%d] invalid for sprite %d\n", actorLabel.name, lParm2, spriteNum); - continue; + dispatch(tw); } VM_SetSprite(spriteNum, labelNum, lParm2, Gv_GetVarX(*insptr++)); - continue; + dispatch(tw); } - case CON_GETACTOR: + vInstruction(CON_GETACTOR): insptr++; { int const spriteNum = (*insptr++ != g_thisActorVarID) ? Gv_GetVarX(insptr[-1]) : vm.spriteNum; @@ -2392,14 +2397,14 @@ next_instruction: || (actorLabel.flags & LABEL_HASPARM2 && (unsigned)lParm2 >= (unsigned)actorLabel.maxParm2))) { CON_ERRPRINTF("%s[%d] invalid for sprite %d\n", actorLabel.name, lParm2, spriteNum); - continue; + dispatch(tw); } Gv_SetVarX(*insptr++, VM_GetSprite(spriteNum, labelNum, lParm2)); - continue; + dispatch(tw); } - case CON_SETACTORSTRUCT: + vInstruction(CON_SETACTORSTRUCT): insptr++; { int const spriteNum = (*insptr++ != g_thisActorVarID) ? Gv_GetVarX(insptr[-1]) : vm.spriteNum; @@ -2409,14 +2414,14 @@ next_instruction: if (EDUKE32_PREDICT_FALSE((unsigned)spriteNum >= MAXSPRITES)) { CON_ERRPRINTF("invalid sprite %d\n", spriteNum); - continue; + dispatch(tw); } VM_SetStruct(actorLabel.flags, (intptr_t *)((char *)&actor[spriteNum] + actorLabel.offset), Gv_GetVarX(*insptr++)); - continue; + dispatch(tw); } - case CON_GETACTORSTRUCT: + vInstruction(CON_GETACTORSTRUCT): insptr++; { int const spriteNum = (*insptr++ != g_thisActorVarID) ? Gv_GetVarX(insptr[-1]) : vm.spriteNum; @@ -2426,14 +2431,14 @@ next_instruction: if (EDUKE32_PREDICT_FALSE((unsigned)spriteNum >= MAXSPRITES)) { CON_ERRPRINTF("invalid sprite %d\n", spriteNum); - continue; + dispatch(tw); } Gv_SetVarX(*insptr++, VM_GetStruct(actorLabel.flags, (intptr_t *)((char *)&actor[spriteNum] + actorLabel.offset))); - continue; + dispatch(tw); } - case CON_SETSPRITESTRUCT: + vInstruction(CON_SETSPRITESTRUCT): insptr++; { int const spriteNum = (*insptr++ != g_thisActorVarID) ? Gv_GetVarX(insptr[-1]) : vm.spriteNum; @@ -2443,14 +2448,14 @@ next_instruction: if (EDUKE32_PREDICT_FALSE((unsigned)spriteNum >= MAXSPRITES)) { CON_ERRPRINTF("invalid sprite %d\n", spriteNum); - continue; + dispatch(tw); } VM_SetStruct(spriteLabel.flags, (intptr_t *)((char *)&sprite[spriteNum] + spriteLabel.offset), Gv_GetVarX(*insptr++)); - continue; + dispatch(tw); } - case CON_GETSPRITESTRUCT: + vInstruction(CON_GETSPRITESTRUCT): insptr++; { int const spriteNum = (*insptr++ != g_thisActorVarID) ? Gv_GetVarX(insptr[-1]) : vm.spriteNum; @@ -2460,13 +2465,13 @@ next_instruction: if (EDUKE32_PREDICT_FALSE((unsigned)spriteNum >= MAXSPRITES)) { CON_ERRPRINTF("invalid sprite %d\n", spriteNum); - continue; + dispatch(tw); } Gv_SetVarX(*insptr++, VM_GetStruct(spriteLabel.flags, (intptr_t *)((char *)&sprite[spriteNum] + spriteLabel.offset))); - continue; + dispatch(tw); } - case CON_SETSPRITEEXT: + vInstruction(CON_SETSPRITEEXT): insptr++; { int const spriteNum = (*insptr++ != g_thisActorVarID) ? Gv_GetVarX(insptr[-1]) : vm.spriteNum; @@ -2476,14 +2481,14 @@ next_instruction: if (EDUKE32_PREDICT_FALSE((unsigned)spriteNum >= MAXSPRITES)) { CON_ERRPRINTF("invalid sprite %d\n", spriteNum); - continue; + dispatch(tw); } VM_SetStruct(spriteExtLabel.flags, (intptr_t *)((char *)&spriteext[spriteNum] + spriteExtLabel.offset), Gv_GetVarX(*insptr++)); - continue; + dispatch(tw); } - case CON_GETSPRITEEXT: + vInstruction(CON_GETSPRITEEXT): insptr++; { int const spriteNum = (*insptr++ != g_thisActorVarID) ? Gv_GetVarX(insptr[-1]) : vm.spriteNum; @@ -2493,14 +2498,14 @@ next_instruction: if (EDUKE32_PREDICT_FALSE((unsigned)spriteNum >= MAXSPRITES)) { CON_ERRPRINTF("invalid sprite %d\n", spriteNum); - continue; + dispatch(tw); } Gv_SetVarX(*insptr++, VM_GetStruct(spriteExtLabel.flags, (intptr_t *)((char *)&spriteext[spriteNum] + spriteExtLabel.offset))); - continue; + dispatch(tw); } - case CON_SETTSPR: + vInstruction(CON_SETTSPR): insptr++; { int const spriteNum = (*insptr++ != g_thisActorVarID) ? Gv_GetVarX(insptr[-1]) : vm.spriteNum; @@ -2508,10 +2513,10 @@ next_instruction: auto const &tsprLabel = TsprLabels[labelNum]; VM_SetStruct(tsprLabel.flags, (intptr_t *)((char *)spriteext[spriteNum].tspr + tsprLabel.offset), Gv_GetVarX(*insptr++)); - continue; + dispatch(tw); } - case CON_GETTSPR: + vInstruction(CON_GETTSPR): insptr++; { int const spriteNum = (*insptr++ != g_thisActorVarID) ? Gv_GetVarX(insptr[-1]) : vm.spriteNum; @@ -2519,10 +2524,10 @@ next_instruction: auto const &tsprLabel = TsprLabels[labelNum]; Gv_SetVarX(*insptr++, VM_GetStruct(tsprLabel.flags, (intptr_t *)((char *)spriteext[spriteNum].tspr + tsprLabel.offset))); - continue; + dispatch(tw); } - case CON_SETSECTOR: + vInstruction(CON_SETSECTOR): insptr++; { int const sectNum = (*insptr++ != g_thisActorVarID) ? Gv_GetVarX(insptr[-1]) : sprite[vm.spriteNum].sectnum; @@ -2533,14 +2538,14 @@ next_instruction: if (sectLabel.offset == -1 || sectLabel.flags & LABEL_WRITEFUNC) { VM_SetSector(sectNum, labelNum, newValue); - continue; + dispatch(tw); } VM_SetStruct(sectLabel.flags, (intptr_t *)((char *)§or[sectNum] + sectLabel.offset), newValue); - continue; + dispatch(tw); } - case CON_GETSECTOR: + vInstruction(CON_GETSECTOR): insptr++; { int const sectNum = (*insptr++ != g_thisActorVarID) ? Gv_GetVarX(insptr[-1]) : sprite[vm.spriteNum].sectnum; @@ -2551,23 +2556,25 @@ next_instruction: (sectLabel.offset != -1 && (sectLabel.flags & LABEL_READFUNC) != LABEL_READFUNC) ? VM_GetStruct(sectLabel.flags, (intptr_t *)((char *)§or[sectNum] + sectLabel.offset)) : VM_GetSector(sectNum, labelNum)); - continue; + dispatch(tw); } - case CON_RETURN: vm.flags |= VM_RETURN; fallthrough__; - case CON_ENDSWITCH: - case CON_ENDA: - case CON_BREAK: - case CON_ENDS: - case CON_ENDEVENT: return; + vInstruction(CON_RETURN): + vm.flags |= VM_RETURN; + fallthrough__; + vInstruction(CON_ENDSWITCH): + vInstruction(CON_ENDA): + vInstruction(CON_BREAK): + vInstruction(CON_ENDS): + vInstruction(CON_ENDEVENT): return; - case CON_JUMP: // this is used for event chaining + vInstruction(CON_JUMP): // this is used for event chaining insptr++; tw = Gv_GetVarX(*insptr++); insptr = (intptr_t *)(tw + apScript); - continue; + dispatch(tw); - case CON_SWITCH: + vInstruction(CON_SWITCH): insptr++; { // command format: @@ -2617,10 +2624,10 @@ next_instruction: matched: insptr = (intptr_t *)(endOffset + (intptr_t)&apScript[0]); - continue; + dispatch(tw); } - case CON_FOR: // special-purpose iteration + vInstruction(CON_FOR): // special-purpose iteration insptr++; { int const returnVar = *insptr++; @@ -2773,19 +2780,19 @@ badindex: } insptr = pEnd; } - continue; + dispatch(tw); - case CON_REDEFINEQUOTE: + vInstruction(CON_REDEFINEQUOTE): insptr++; { int const strIndex = *insptr++; int const XstrIndex = *insptr++; Bstrcpy(apStrings[strIndex], apXStrings[XstrIndex]); - continue; + dispatch(tw); } - case CON_GETTHISPROJECTILE: + vInstruction(CON_GETTHISPROJECTILE): insptr++; { tw = *insptr++; @@ -2793,10 +2800,10 @@ badindex: int const labelNum = *insptr++; Gv_SetVarX(*insptr++, VM_GetActiveProjectile(spriteNum, labelNum)); - continue; + dispatch(tw); } - case CON_SETTHISPROJECTILE: + vInstruction(CON_SETTHISPROJECTILE): insptr++; { tw = *insptr++; @@ -2804,10 +2811,10 @@ badindex: int const labelNum = *insptr++; VM_SetActiveProjectile(spriteNum, labelNum, Gv_GetVarX(*insptr++)); - continue; + dispatch(tw); } - case CON_IFCANSHOOTTARGET: + vInstruction(CON_IFCANSHOOTTARGET): { if (vm.playerDist > 1024) { @@ -2816,7 +2823,7 @@ badindex: if ((tw = A_CheckHitSprite(vm.spriteNum, &temphit)) == (1 << 30)) { VM_CONDITIONAL(1); - continue; + dispatch(tw); } int dist = 768; @@ -2832,7 +2839,7 @@ badindex: if (x >= 0 && sprite[x].picnum == vm.pSprite->picnum) \ { \ VM_CONDITIONAL(0); \ - continue; \ + dispatch(tw); \ } #define CHECK2(x) \ do \ @@ -2856,162 +2863,162 @@ badindex: { CHECK(temphit); VM_CONDITIONAL(1); - continue; + dispatch(tw); } } } } VM_CONDITIONAL(1); } - continue; + dispatch(tw); #undef CHECK #undef CHECK2 - case CON_IFCANSEETARGET: + vInstruction(CON_IFCANSEETARGET): tw = cansee(vm.pSprite->x, vm.pSprite->y, vm.pSprite->z - ((krand() & 41) << 8), vm.pSprite->sectnum, p.pos.x, p.pos.y, p.pos.z /*-((krand()&41)<<8)*/, sprite[p.i].sectnum); VM_CONDITIONAL(tw); if (tw) vm.pActor->timetosleep = SLEEPTIME; - continue; + dispatch(tw); - case CON_IFACTION: + vInstruction(CON_IFACTION): VM_CONDITIONAL(AC_ACTION_ID(vm.pData) == *(++insptr)); - continue; + dispatch(tw); - case CON_IFACTIONCOUNT: + vInstruction(CON_IFACTIONCOUNT): VM_CONDITIONAL(AC_ACTION_COUNT(vm.pData) >= *(++insptr)); - continue; + dispatch(tw); - case CON_IFACTOR: + vInstruction(CON_IFACTOR): VM_CONDITIONAL(vm.pSprite->picnum == *(++insptr)); - continue; + dispatch(tw); - case CON_IFACTORNOTSTAYPUT: + vInstruction(CON_IFACTORNOTSTAYPUT): VM_CONDITIONAL(vm.pActor->stayput == -1); - continue; + dispatch(tw); - case CON_IFAI: + vInstruction(CON_IFAI): VM_CONDITIONAL(AC_AI_ID(vm.pData) == *(++insptr)); - continue; + dispatch(tw); - case CON_IFBULLETNEAR: + vInstruction(CON_IFBULLETNEAR): VM_CONDITIONAL(A_Dodge(vm.pSprite) == 1); - continue; + dispatch(tw); - case CON_IFCEILINGDISTL: + vInstruction(CON_IFCEILINGDISTL): VM_CONDITIONAL((vm.pSprite->z - vm.pActor->ceilingz) <= (*(++insptr) << 8)); - continue; + dispatch(tw); - case CON_IFCLIENT: + vInstruction(CON_IFCLIENT): VM_CONDITIONAL(g_netClient != NULL); - continue; + dispatch(tw); - case CON_IFCOUNT: + vInstruction(CON_IFCOUNT): VM_CONDITIONAL(AC_COUNT(vm.pData) >= *(++insptr)); - continue; + dispatch(tw); - case CON_IFDEAD: + vInstruction(CON_IFDEAD): VM_CONDITIONAL(vm.pSprite->extra <= 0); - continue; + dispatch(tw); - case CON_IFFLOORDISTL: + vInstruction(CON_IFFLOORDISTL): VM_CONDITIONAL((vm.pActor->floorz - vm.pSprite->z) <= (*(++insptr) << 8)); - continue; + dispatch(tw); - case CON_IFGAPZL: + vInstruction(CON_IFGAPZL): VM_CONDITIONAL(((vm.pActor->floorz - vm.pActor->ceilingz) >> 8) < *(++insptr)); - continue; + dispatch(tw); - case CON_IFHITSPACE: + vInstruction(CON_IFHITSPACE): VM_CONDITIONAL(TEST_SYNC_KEY(g_player[vm.playerNum].inputBits->bits, SK_OPEN)); - continue; + dispatch(tw); - case CON_IFHITWEAPON: + vInstruction(CON_IFHITWEAPON): VM_CONDITIONAL(A_IncurDamage(vm.spriteNum) >= 0); - continue; + dispatch(tw); - case CON_IFINSPACE: + vInstruction(CON_IFINSPACE): VM_CONDITIONAL(G_CheckForSpaceCeiling(vm.pSprite->sectnum)); - continue; + dispatch(tw); - case CON_IFINWATER: + vInstruction(CON_IFINWATER): VM_CONDITIONAL(sector[vm.pSprite->sectnum].lotag == ST_2_UNDERWATER); - continue; + dispatch(tw); - case CON_IFONWATER: + vInstruction(CON_IFONWATER): VM_CONDITIONAL(sector[vm.pSprite->sectnum].lotag == ST_1_ABOVE_WATER && klabs(vm.pSprite->z - sector[vm.pSprite->sectnum].floorz) < ZOFFSET5); - continue; + dispatch(tw); - case CON_IFMOVE: + vInstruction(CON_IFMOVE): VM_CONDITIONAL(AC_MOVE_ID(vm.pData) == *(++insptr)); - continue; + dispatch(tw); - case CON_IFMULTIPLAYER: + vInstruction(CON_IFMULTIPLAYER): VM_CONDITIONAL((g_netServer || g_netClient || ud.multimode > 1)); - continue; + dispatch(tw); - case CON_IFOUTSIDE: + vInstruction(CON_IFOUTSIDE): VM_CONDITIONAL(sector[vm.pSprite->sectnum].ceilingstat & 1); - continue; + dispatch(tw); - case CON_IFPLAYBACKON: + vInstruction(CON_IFPLAYBACKON): VM_CONDITIONAL(0); - continue; + dispatch(tw); - case CON_IFPLAYERSL: + vInstruction(CON_IFPLAYERSL): VM_CONDITIONAL(numplayers < *(++insptr)); - continue; + dispatch(tw); - case CON_IFSERVER: + vInstruction(CON_IFSERVER): VM_CONDITIONAL(g_netServer != NULL); - continue; + dispatch(tw); - case CON_IFSQUISHED: + vInstruction(CON_IFSQUISHED): VM_CONDITIONAL(VM_CheckSquished()); - continue; + dispatch(tw); - case CON_IFSTRENGTH: + vInstruction(CON_IFSTRENGTH): VM_CONDITIONAL(vm.pSprite->extra <= *(++insptr)); - continue; + dispatch(tw); - case CON_IFSPAWNEDBY: - case CON_IFWASWEAPON: + vInstruction(CON_IFSPAWNEDBY): + vInstruction(CON_IFWASWEAPON): VM_CONDITIONAL(vm.pActor->picnum == *(++insptr)); - continue; + dispatch(tw); - case CON_IFPDISTL: + vInstruction(CON_IFPDISTL): VM_CONDITIONAL(vm.playerDist < *(++insptr)); if (vm.playerDist > MAXSLEEPDIST && vm.pActor->timetosleep == 0) vm.pActor->timetosleep = SLEEPTIME; - continue; + dispatch(tw); - case CON_IFPDISTG: + vInstruction(CON_IFPDISTG): VM_CONDITIONAL(vm.playerDist > *(++insptr)); if (vm.playerDist > MAXSLEEPDIST && vm.pActor->timetosleep == 0) vm.pActor->timetosleep = SLEEPTIME; - continue; + dispatch(tw); - case CON_IFRESPAWN: + vInstruction(CON_IFRESPAWN): if (A_CheckEnemySprite(vm.pSprite)) VM_CONDITIONAL(ud.respawn_monsters) else if (A_CheckInventorySprite(vm.pSprite)) VM_CONDITIONAL(ud.respawn_inventory) else VM_CONDITIONAL(ud.respawn_items) - continue; + dispatch(tw); - case CON_IFINOUTERSPACE: + vInstruction(CON_IFINOUTERSPACE): VM_CONDITIONAL(G_CheckForSpaceFloor(vm.pSprite->sectnum)); - continue; + dispatch(tw); - case CON_IFNOTMOVING: + vInstruction(CON_IFNOTMOVING): VM_CONDITIONAL((vm.pActor->movflag & 49152) > 16384); - continue; + dispatch(tw); - case CON_IFCANSEE: + vInstruction(CON_IFCANSEE): { auto pSprite = (uspritetype *)&sprite[p.i]; @@ -3056,10 +3063,10 @@ badindex: vm.pActor->timetosleep = SLEEPTIME; VM_CONDITIONAL(tw); - continue; + dispatch(tw); } - case CON_AI: + vInstruction(CON_AI): insptr++; // Following changed to use pointersizes AC_AI_ID(vm.pData) = *insptr++; // Ai @@ -3078,26 +3085,26 @@ badindex: if (!A_CheckEnemySprite(vm.pSprite) || vm.pSprite->extra > 0) // hack if (vm.pSprite->hitag & random_angle) vm.pSprite->ang = krand() & 2047; - continue; + dispatch(tw); - case CON_ACTION: + vInstruction(CON_ACTION): insptr++; AC_ACTION_COUNT(vm.pData) = 0; AC_CURFRAME(vm.pData) = 0; AC_ACTION_ID(vm.pData) = *insptr++; - continue; + dispatch(tw); - case CON_ADDSTRENGTH: + vInstruction(CON_ADDSTRENGTH): insptr++; vm.pSprite->extra += *insptr++; - continue; + dispatch(tw); - case CON_STRENGTH: + vInstruction(CON_STRENGTH): insptr++; vm.pSprite->extra = *insptr++; - continue; + dispatch(tw); - case CON_IFGOTWEAPONCE: + vInstruction(CON_IFGOTWEAPONCE): insptr++; if ((g_gametypeFlags[ud.coop] & GAMETYPE_WEAPSTAY) && (g_netServer || ud.multimode > 1)) @@ -3110,19 +3117,19 @@ badindex: break; VM_CONDITIONAL(j < p.weapreccnt && vm.pSprite->owner == vm.spriteNum); - continue; + dispatch(tw); } else if (p.weapreccnt < MAX_WEAPONS) { p.weaprecs[p.weapreccnt++] = vm.pSprite->picnum; VM_CONDITIONAL(vm.pSprite->owner == vm.spriteNum); - continue; + dispatch(tw); } } VM_CONDITIONAL(0); - continue; + dispatch(tw); - case CON_GETLASTPAL: + vInstruction(CON_GETLASTPAL): insptr++; if (vm.pSprite->picnum == APLAYER) vm.pSprite->pal = g_player[P_GetP(vm.pSprite)].ps->palookup; @@ -3133,26 +3140,26 @@ badindex: vm.pSprite->pal = vm.pActor->tempang; } vm.pActor->tempang = 0; - continue; + dispatch(tw); - case CON_TOSSWEAPON: + vInstruction(CON_TOSSWEAPON): insptr++; // NOTE: assumes that current actor is APLAYER P_DropWeapon(P_GetP(vm.pSprite)); - continue; + dispatch(tw); - case CON_MIKESND: + vInstruction(CON_MIKESND): insptr++; if (EDUKE32_PREDICT_FALSE(((unsigned)vm.pSprite->yvel >= MAXSOUNDS))) { CON_ERRPRINTF("invalid sound %d\n", vm.pUSprite->yvel); - continue; + dispatch(tw); } if (!S_CheckSoundPlaying(vm.pSprite->yvel)) A_PlaySound(vm.pSprite->yvel, vm.spriteNum); - continue; + dispatch(tw); - case CON_PKICK: + vInstruction(CON_PKICK): insptr++; if ((g_netServer || ud.multimode > 1) && vm.pSprite->picnum == APLAYER) @@ -3162,9 +3169,9 @@ badindex: } else if (vm.pSprite->picnum != APLAYER && p.quick_kick == 0) p.quick_kick = 14; - continue; + dispatch(tw); - case CON_SIZETO: + vInstruction(CON_SIZETO): insptr++; tw = (*insptr++ - vm.pSprite->xrepeat) << 1; @@ -3180,15 +3187,15 @@ badindex: insptr++; - continue; + dispatch(tw); - case CON_SIZEAT: + vInstruction(CON_SIZEAT): insptr++; vm.pSprite->xrepeat = (uint8_t)*insptr++; vm.pSprite->yrepeat = (uint8_t)*insptr++; - continue; + dispatch(tw); - case CON_IFACTORSOUND: + vInstruction(CON_IFACTORSOUND): insptr++; { int const spriteNum = Gv_GetVarX(*insptr++); @@ -3197,25 +3204,25 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)soundNum >= MAXSOUNDS)) { CON_ERRPRINTF("invalid sound %d\n", soundNum); - continue; + dispatch(tw); } insptr--; VM_CONDITIONAL(A_CheckSoundPlaying(spriteNum, soundNum)); } - continue; + dispatch(tw); - case CON_IFSOUND: + vInstruction(CON_IFSOUND): if (EDUKE32_PREDICT_FALSE((unsigned)*(++insptr) >= MAXSOUNDS)) { CON_ERRPRINTF("invalid sound %d\n", (int32_t)*insptr); - continue; + dispatch(tw); } VM_CONDITIONAL(S_CheckSoundPlaying(*insptr)); // VM_DoConditional(SoundOwner[*insptr][0].ow == vm.spriteNum); - continue; + dispatch(tw); - case CON_STOPACTORSOUND: + vInstruction(CON_STOPACTORSOUND): insptr++; { int const spriteNum = Gv_GetVarX(*insptr++); @@ -3224,16 +3231,16 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)soundNum >= MAXSOUNDS)) { CON_ERRPRINTF("invalid sound %d\n", soundNum); - continue; + dispatch(tw); } if (A_CheckSoundPlaying(spriteNum, soundNum)) S_StopEnvSound(soundNum, spriteNum); - continue; + dispatch(tw); } - case CON_ACTORSOUND: + vInstruction(CON_ACTORSOUND): insptr++; { int const spriteNum = (*insptr++ != g_thisActorVarID) ? Gv_GetVarX(insptr[-1]) : vm.spriteNum; @@ -3242,15 +3249,15 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)soundNum >= MAXSOUNDS)) { CON_ERRPRINTF("invalid sound %d\n", soundNum); - continue; + dispatch(tw); } A_PlaySound(soundNum, spriteNum); - continue; + dispatch(tw); } - case CON_SETACTORSOUNDPITCH: + vInstruction(CON_SETACTORSOUNDPITCH): insptr++; { int const spriteNum = Gv_GetVarX(*insptr++); @@ -3260,27 +3267,27 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)soundNum >= MAXSOUNDS)) { CON_ERRPRINTF("invalid sound %d\n", soundNum); - continue; + dispatch(tw); } S_ChangeSoundPitch(soundNum, spriteNum, newPitch); - continue; + dispatch(tw); } - case CON_TIP: + vInstruction(CON_TIP): insptr++; p.tipincs = GAMETICSPERSEC; - continue; + dispatch(tw); - case CON_FALL: + vInstruction(CON_FALL): insptr++; VM_Fall(vm.spriteNum, vm.pSprite); - continue; + dispatch(tw); - case CON_NULLOP: insptr++; continue; + vInstruction(CON_NULLOP): insptr++; dispatch(tw); - case CON_ADDAMMO: + vInstruction(CON_ADDAMMO): insptr++; { int const weaponNum = *insptr++; @@ -3288,45 +3295,45 @@ badindex: VM_AddAmmo(&p, weaponNum, addAmount); - continue; + dispatch(tw); } - case CON_MONEY: + vInstruction(CON_MONEY): insptr++; A_SpawnMultiple(vm.spriteNum, MONEY, *insptr++); - continue; + dispatch(tw); - case CON_MAIL: + vInstruction(CON_MAIL): insptr++; A_SpawnMultiple(vm.spriteNum, MAIL, *insptr++); - continue; + dispatch(tw); - case CON_SLEEPTIME: + vInstruction(CON_SLEEPTIME): insptr++; vm.pActor->timetosleep = (int16_t)*insptr++; - continue; + dispatch(tw); - case CON_PAPER: + vInstruction(CON_PAPER): insptr++; A_SpawnMultiple(vm.spriteNum, PAPER, *insptr++); - continue; + dispatch(tw); - case CON_ADDKILLS: + vInstruction(CON_ADDKILLS): insptr++; P_AddKills(&p, *insptr++); vm.pActor->stayput = -1; - continue; + dispatch(tw); - case CON_LOTSOFGLASS: + vInstruction(CON_LOTSOFGLASS): insptr++; #ifndef EDUKE32_STANDALONE A_SpawnGlass(vm.spriteNum, *insptr++); #else insptr++; #endif - continue; + dispatch(tw); - case CON_SPAWNWALLGLASS: + vInstruction(CON_SPAWNWALLGLASS): insptr++; { #ifndef EDUKE32_STANDALONE @@ -3338,9 +3345,9 @@ badindex: Gv_GetVarX(*insptr++); #endif } - continue; + dispatch(tw); - case CON_SPAWNWALLSTAINEDGLASS: + vInstruction(CON_SPAWNWALLSTAINEDGLASS): insptr++; { #ifndef EDUKE32_STANDALONE @@ -3352,9 +3359,9 @@ badindex: Gv_GetVarX(*insptr++); #endif } - continue; + dispatch(tw); - case CON_SPAWNCEILINGGLASS: + vInstruction(CON_SPAWNCEILINGGLASS): insptr++; { #ifndef EDUKE32_STANDALONE @@ -3366,27 +3373,27 @@ badindex: Gv_GetVarX(*insptr++); #endif } - continue; + dispatch(tw); - case CON_KILLIT: + vInstruction(CON_KILLIT): insptr++; vm.flags |= VM_KILL; return; - case CON_DEBUG: + vInstruction(CON_DEBUG): insptr++; buildprint(*insptr++, "\n"); - continue; + dispatch(tw); - case CON_ENDOFGAME: - case CON_ENDOFLEVEL: + vInstruction(CON_ENDOFGAME): + vInstruction(CON_ENDOFLEVEL): insptr++; p.timebeforeexit = *insptr++; p.customexitsound = -1; ud.eog = 1; - continue; + dispatch(tw); - case CON_ADDPHEALTH: + vInstruction(CON_ADDPHEALTH): insptr++; { @@ -3409,7 +3416,7 @@ badindex: if (newHealth > p.max_player_health && *insptr > 0) { insptr++; - continue; + dispatch(tw); } else { @@ -3439,36 +3446,36 @@ badindex: } insptr++; - continue; + dispatch(tw); - case CON_MOVE: + vInstruction(CON_MOVE): insptr++; AC_COUNT(vm.pData) = 0; AC_MOVE_ID(vm.pData) = *insptr++; vm.pSprite->hitag = *insptr++; if (A_CheckEnemySprite(vm.pSprite) && vm.pSprite->extra <= 0) // hack - continue; + dispatch(tw); if (vm.pSprite->hitag & random_angle) vm.pSprite->ang = krand() & 2047; - continue; + dispatch(tw); - case CON_ADDWEAPON: + vInstruction(CON_ADDWEAPON): insptr++; { int const weaponNum = Gv_GetVarX(*insptr++); VM_AddWeapon(&p, weaponNum, Gv_GetVarX(*insptr++)); - continue; + dispatch(tw); } - case CON_SETASPECT: + vInstruction(CON_SETASPECT): insptr++; { int const xRange = Gv_GetVarX(*insptr++); renderSetAspect(xRange, Gv_GetVarX(*insptr++)); - continue; + dispatch(tw); } - case CON_SSP: + vInstruction(CON_SSP): insptr++; { int const spriteNum = Gv_GetVarX(*insptr++); @@ -3477,13 +3484,13 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)spriteNum >= MAXSPRITES)) { CON_ERRPRINTF("invalid sprite %d\n", spriteNum); - continue; + dispatch(tw); } A_SetSprite(spriteNum, clipType); - continue; + dispatch(tw); } - case CON_ACTIVATEBYSECTOR: + vInstruction(CON_ACTIVATEBYSECTOR): insptr++; { int const sectNum = Gv_GetVarX(*insptr++); @@ -3492,13 +3499,13 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)sectNum >= (unsigned)numsectors)) { CON_ERRPRINTF("invalid sector %d\n", sectNum); - continue; + dispatch(tw); } G_ActivateBySector(sectNum, spriteNum); - continue; + dispatch(tw); } - case CON_OPERATESECTORS: + vInstruction(CON_OPERATESECTORS): insptr++; { int const sectNum = Gv_GetVarX(*insptr++); @@ -3507,13 +3514,13 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)sectNum >= (unsigned)numsectors)) { CON_ERRPRINTF("invalid sector %d\n", sectNum); - continue; + dispatch(tw); } G_OperateSectors(sectNum, spriteNum); - continue; + dispatch(tw); } - case CON_OPERATEACTIVATORS: + vInstruction(CON_OPERATEACTIVATORS): insptr++; { int const nTag = Gv_GetVarX(*insptr++); @@ -3522,14 +3529,14 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)playerNum >= (unsigned)g_mostConcurrentPlayers)) { CON_ERRPRINTF("invalid player %d\n", playerNum); - continue; + dispatch(tw); } G_OperateActivators(nTag, playerNum); - continue; + dispatch(tw); } - case CON_CANSEESPR: + vInstruction(CON_CANSEESPR): insptr++; { int const nSprite1 = Gv_GetVarX(*insptr++); @@ -3538,37 +3545,37 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)nSprite1 >= MAXSPRITES || (unsigned)nSprite2 >= MAXSPRITES)) { CON_ERRPRINTF("invalid sprite %d\n", (unsigned)nSprite1 >= MAXSPRITES ? nSprite1 : nSprite2); - continue; + dispatch(tw); } int const nResult = cansee(sprite[nSprite1].x, sprite[nSprite1].y, sprite[nSprite1].z, sprite[nSprite1].sectnum, sprite[nSprite2].x, sprite[nSprite2].y, sprite[nSprite2].z, sprite[nSprite2].sectnum); Gv_SetVarX(*insptr++, nResult); - continue; + dispatch(tw); } - case CON_OPERATERESPAWNS: + vInstruction(CON_OPERATERESPAWNS): insptr++; G_OperateRespawns(Gv_GetVarX(*insptr++)); - continue; + dispatch(tw); - case CON_OPERATEMASTERSWITCHES: + vInstruction(CON_OPERATEMASTERSWITCHES): insptr++; G_OperateMasterSwitches(Gv_GetVarX(*insptr++)); - continue; + dispatch(tw); - case CON_CHECKACTIVATORMOTION: + vInstruction(CON_CHECKACTIVATORMOTION): insptr++; aGameVars[g_returnVarID].global = G_CheckActivatorMotion(Gv_GetVarX(*insptr++)); - continue; + dispatch(tw); - case CON_INSERTSPRITEQ: + vInstruction(CON_INSERTSPRITEQ): insptr++; A_AddToDeleteQueue(vm.spriteNum); - continue; + dispatch(tw); - case CON_QSTRLEN: + vInstruction(CON_QSTRLEN): insptr++; { int const gameVar = *insptr++; @@ -3577,14 +3584,14 @@ badindex: if (EDUKE32_PREDICT_FALSE(apStrings[quoteNum] == NULL)) { CON_ERRPRINTF("null quote %d\n", quoteNum); - continue; + dispatch(tw); } Gv_SetVarX(gameVar, Bstrlen(apStrings[quoteNum])); - continue; + dispatch(tw); } - case CON_QSTRDIM: + vInstruction(CON_QSTRDIM): insptr++; { int const widthVar = *insptr++; @@ -3614,10 +3621,10 @@ badindex: Gv_SetVarX(widthVar, dim.x); Gv_SetVarX(heightVar, dim.y); } - continue; + dispatch(tw); } - case CON_HEADSPRITESTAT: + vInstruction(CON_HEADSPRITESTAT): insptr++; { int const gameVar = *insptr++; @@ -3626,14 +3633,14 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)statNum > MAXSTATUS)) { CON_ERRPRINTF("invalid status list %d\n", statNum); - continue; + dispatch(tw); } Gv_SetVarX(gameVar, headspritestat[statNum]); - continue; + dispatch(tw); } - case CON_PREVSPRITESTAT: + vInstruction(CON_PREVSPRITESTAT): insptr++; { int const gameVar = *insptr++; @@ -3642,14 +3649,14 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)spriteNum >= MAXSPRITES)) { CON_ERRPRINTF("invalid sprite %d\n", spriteNum); - continue; + dispatch(tw); } Gv_SetVarX(gameVar, prevspritestat[spriteNum]); - continue; + dispatch(tw); } - case CON_NEXTSPRITESTAT: + vInstruction(CON_NEXTSPRITESTAT): insptr++; { int const gameVar = *insptr++; @@ -3658,14 +3665,14 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)spriteNum >= MAXSPRITES)) { CON_ERRPRINTF("invalid sprite %d\n", spriteNum); - continue; + dispatch(tw); } Gv_SetVarX(gameVar, nextspritestat[spriteNum]); - continue; + dispatch(tw); } - case CON_HEADSPRITESECT: + vInstruction(CON_HEADSPRITESECT): insptr++; { int const gameVar = *insptr++; @@ -3674,14 +3681,14 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)sectNum >= (unsigned)numsectors)) { CON_ERRPRINTF("invalid sector %d\n", sectNum); - continue; + dispatch(tw); } Gv_SetVarX(gameVar, headspritesect[sectNum]); - continue; + dispatch(tw); } - case CON_PREVSPRITESECT: + vInstruction(CON_PREVSPRITESECT): insptr++; { int const gameVar = *insptr++; @@ -3690,14 +3697,14 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)spriteNum >= MAXSPRITES)) { CON_ERRPRINTF("invalid sprite %d\n", spriteNum); - continue; + dispatch(tw); } Gv_SetVarX(gameVar, prevspritesect[spriteNum]); - continue; + dispatch(tw); } - case CON_NEXTSPRITESECT: + vInstruction(CON_NEXTSPRITESECT): insptr++; { int const gameVar = *insptr++; @@ -3706,14 +3713,14 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)spriteNum >= MAXSPRITES)) { CON_ERRPRINTF("invalid sprite %d\n", spriteNum); - continue; + dispatch(tw); } Gv_SetVarX(gameVar, nextspritesect[spriteNum]); - continue; + dispatch(tw); } - case CON_GETKEYNAME: + vInstruction(CON_GETKEYNAME): insptr++; { int const quoteIndex = Gv_GetVarX(*insptr++); @@ -3723,12 +3730,12 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)quoteIndex >= MAXQUOTES || apStrings[quoteIndex] == NULL)) { CON_ERRPRINTF("invalid quote %d\n", quoteIndex); - continue; + dispatch(tw); } else if (EDUKE32_PREDICT_FALSE((unsigned)gameFunc >= NUMGAMEFUNCTIONS)) { CON_ERRPRINTF("invalid function %d\n", gameFunc); - continue; + dispatch(tw); } else { @@ -3746,10 +3753,10 @@ badindex: if (*tempbuf) Bstrcpy(apStrings[quoteIndex], tempbuf); - continue; + dispatch(tw); } - case CON_QSUBSTR: + vInstruction(CON_QSUBSTR): insptr++; { struct @@ -3763,19 +3770,19 @@ badindex: || apStrings[v.inputQuote] == NULL)) { CON_ERRPRINTF("invalid quote %d\n", apStrings[v.outputQuote] ? v.inputQuote : v.outputQuote); - continue; + dispatch(tw); } if (EDUKE32_PREDICT_FALSE((unsigned)v.quotePos >= MAXQUOTELEN)) { CON_ERRPRINTF("invalid position %d\n", v.quotePos); - continue; + dispatch(tw); } if (EDUKE32_PREDICT_FALSE(v.quoteLength < 0)) { CON_ERRPRINTF("invalid length %d\n", v.quoteLength); - continue; + dispatch(tw); } char * pOutput = apStrings[v.outputQuote]; @@ -3790,10 +3797,10 @@ badindex: } *pOutput = '\0'; - continue; + dispatch(tw); } - case CON_QSTRCMP: + vInstruction(CON_QSTRCMP): insptr++; { int const quote1 = Gv_GetVarX(*insptr++); @@ -3803,18 +3810,18 @@ badindex: if (EDUKE32_PREDICT_FALSE(apStrings[quote1] == NULL || apStrings[quote2] == NULL)) { CON_ERRPRINTF("null quote %d\n", apStrings[quote1] ? quote2 : quote1); - continue; + dispatch(tw); } Gv_SetVarX(gameVar, strcmp(apStrings[quote1], apStrings[quote2])); - continue; + dispatch(tw); } - case CON_GETPNAME: - case CON_QSTRNCAT: - case CON_QSTRCAT: - case CON_QSTRCPY: - case CON_QGETSYSSTR: + vInstruction(CON_GETPNAME): + vInstruction(CON_QSTRNCAT): + vInstruction(CON_QSTRCAT): + vInstruction(CON_QSTRCPY): + vInstruction(CON_QGETSYSSTR): insptr++; { int const q = Gv_GetVarX(*insptr++); @@ -3844,7 +3851,7 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)q >= MAXQUOTES || apStrings[q] == NULL)) { CON_ERRPRINTF("invalid quote %d\n", q); - continue; + dispatch(tw); } switch (j) { @@ -3857,7 +3864,7 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)levelNum >= ARRAY_SIZE(g_mapInfo))) { CON_ERRPRINTF("out of bounds map number (vol=%d, lev=%d)\n", ud.volume_number, ud.level_number); - continue; + dispatch(tw); } pName = j == STR_MAPNAME ? g_mapInfo[levelNum].name : g_mapInfo[levelNum].filename; @@ -3866,7 +3873,7 @@ badindex: { CON_ERRPRINTF("attempted access to %s of non-existent map (vol=%d, lev=%d)", j == STR_MAPNAME ? "name" : "file name", ud.volume_number, ud.level_number); - continue; + dispatch(tw); } Bstrcpy(apStrings[q], j == STR_MAPNAME ? g_mapInfo[levelNum].name : g_mapInfo[levelNum].filename); @@ -3876,7 +3883,7 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)vm.playerNum >= (unsigned)g_mostConcurrentPlayers)) { CON_ERRPRINTF("invalid player %d\n", vm.playerNum); - continue; + dispatch(tw); } Bstrcpy(apStrings[q], g_player[vm.playerNum].user_name); break; @@ -3889,7 +3896,7 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)ud.volume_number >= MAXVOLUMES)) { CON_ERRPRINTF("invalid volume %d\n", ud.volume_number); - continue; + dispatch(tw); } Bstrcpy(apStrings[q], g_volumeNames[ud.volume_number]); break; @@ -3898,7 +3905,7 @@ badindex: case STR_DESIGNERTIME: Bstrcpy(apStrings[q], G_PrintDesignerTime()); break; case STR_BESTTIME: Bstrcpy(apStrings[q], G_PrintBestTime()); break; case STR_USERMAPFILENAME: Bstrcpy(apStrings[q], boardfilename); break; - default: CON_ERRPRINTF("invalid string index %d or %d\n", q, j); continue; + default: CON_ERRPRINTF("invalid string index %d or %d\n", q, j); dispatch(tw); } break; case CON_QSTRCAT: @@ -3920,12 +3927,12 @@ badindex: default: nullquote: CON_ERRPRINTF("invalid quote %d\n", apStrings[q] ? j : q); - continue; + dispatch(tw); } - continue; + dispatch(tw); } - case CON_CHANGESPRITESECT: + vInstruction(CON_CHANGESPRITESECT): insptr++; { int const spriteNum = Gv_GetVarX(*insptr++); @@ -3934,17 +3941,17 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)spriteNum >= MAXSPRITES || (unsigned)sectNum >= MAXSECTORS)) { CON_ERRPRINTF("invalid parameters: %d, %d\n", spriteNum, sectNum); - continue; + dispatch(tw); } if (sprite[spriteNum].sectnum == sectNum) - continue; + dispatch(tw); changespritesect(spriteNum, sectNum); - continue; + dispatch(tw); } - case CON_CHANGESPRITESTAT: + vInstruction(CON_CHANGESPRITESTAT): insptr++; { int const spriteNum = Gv_GetVarX(*insptr++); @@ -3953,11 +3960,11 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)spriteNum >= MAXSPRITES || (unsigned)statNum >= MAXSECTORS)) { CON_ERRPRINTF("invalid parameters: %d, %d\n", spriteNum, statNum); - continue; + dispatch(tw); } if (sprite[spriteNum].statnum == statNum) - continue; + dispatch(tw); /* initialize actor data when changing to an actor statnum because there's usually garbage left over from being handled as a hard coded object */ @@ -3990,10 +3997,10 @@ badindex: } changespritestat(spriteNum, statNum); - continue; + dispatch(tw); } - case CON_STARTLEVEL: + vInstruction(CON_STARTLEVEL): insptr++; // skip command { // from 'level' cheat in game.c (about line 6250) @@ -4003,7 +4010,7 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)volumeNum >= MAXVOLUMES || (unsigned)levelNum >= MAXLEVELS)) { CON_ERRPRINTF("invalid parameters: %d, %d\n", volumeNum, levelNum); - continue; + dispatch(tw); } ud.m_volume_number = ud.volume_number = volumeNum; @@ -4016,13 +4023,13 @@ badindex: ud.display_bonus_screen = 0; } // MODE_RESTART; - continue; + dispatch(tw); } - case CON_MYOSX: - case CON_MYOSPALX: - case CON_MYOS: - case CON_MYOSPAL: + vInstruction(CON_MYOSX): + vInstruction(CON_MYOSPALX): + vInstruction(CON_MYOS): + vInstruction(CON_MYOSPAL): insptr++; { struct @@ -4039,15 +4046,15 @@ badindex: case CON_MYOSX: VM_DrawTileSmall(v.pos.x, v.pos.y, v.tilenum, v.shade, v.orientation); break; case CON_MYOSPALX: VM_DrawTilePalSmall(v.pos.x, v.pos.y, v.tilenum, v.shade, v.orientation, Gv_GetVarX(*insptr++)); break; } - continue; + dispatch(tw); } - case CON_DISPLAYRAND: + vInstruction(CON_DISPLAYRAND): insptr++; Gv_SetVarX(*insptr++, system_15bit_rand()); - continue; + dispatch(tw); - case CON_DRAGPOINT: + vInstruction(CON_DRAGPOINT): insptr++; { int const wallNum = Gv_GetVarX(*insptr++); @@ -4057,15 +4064,15 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)wallNum >= (unsigned)numwalls)) { CON_ERRPRINTF("invalid wall %d\n", wallNum); - continue; + dispatch(tw); } dragpoint(wallNum, n.x, n.y, 0); - continue; + dispatch(tw); } - case CON_LDIST: - case CON_DIST: + vInstruction(CON_LDIST): + vInstruction(CON_DIST): insptr++; { int const out = *insptr++; @@ -4075,26 +4082,26 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)in.x >= MAXSPRITES || (unsigned)in.y >= MAXSPRITES)) { CON_ERRPRINTF("invalid sprite %d, %d\n", in.x, in.y); - continue; + dispatch(tw); } Gv_SetVarX(out, (tw == CON_LDIST ? ldist : dist)(&sprite[in.x], &sprite[in.y])); - continue; + dispatch(tw); } - case CON_GETANGLE: - case CON_GETINCANGLE: + vInstruction(CON_GETANGLE): + vInstruction(CON_GETINCANGLE): insptr++; { int const out = *insptr++; vec2_t in; Gv_FillWithVars(in); Gv_SetVarX(out, (tw == CON_GETANGLE ? getangle : G_GetAngleDelta)(in.x, in.y)); - continue; + dispatch(tw); } - case CON_MULSCALE: - case CON_DIVSCALE: + vInstruction(CON_MULSCALE): + vInstruction(CON_DIVSCALE): insptr++; { int const out = *insptr++; @@ -4106,43 +4113,43 @@ badindex: else Gv_SetVarX(out, divscale(in.x, in.y, in.z)); - continue; + dispatch(tw); } - case CON_SCALEVAR: + vInstruction(CON_SCALEVAR): insptr++; { int const out = *insptr++; vec3_t in; Gv_FillWithVars(in); Gv_SetVarX(out, scale(in.x, in.y, in.z)); - continue; + dispatch(tw); } - case CON_INITTIMER: + vInstruction(CON_INITTIMER): insptr++; G_InitTimer(Gv_GetVarX(*insptr++)); - continue; + dispatch(tw); - case CON_NEXTSECTORNEIGHBORZ: + vInstruction(CON_NEXTSECTORNEIGHBORZ): insptr++; { int32_t params[4]; Gv_FillWithVars(params); aGameVars[g_returnVarID].global = nextsectorneighborz(params[0], params[1], params[2], params[3]); } - continue; + dispatch(tw); - case CON_MOVESECTOR: + vInstruction(CON_MOVESECTOR): insptr++; A_MoveSector(Gv_GetVarX(*insptr++)); - continue; + dispatch(tw); - case CON_TIME: insptr += 2; continue; + vInstruction(CON_TIME): insptr += 2; dispatch(tw); - case CON_ESPAWN: - case CON_EQSPAWN: - case CON_QSPAWN: + vInstruction(CON_ESPAWN): + vInstruction(CON_EQSPAWN): + vInstruction(CON_QSPAWN): insptr++; { int const tileNum = Gv_GetVarX(*insptr++); @@ -4150,7 +4157,7 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)vm.pSprite->sectnum >= (unsigned)numsectors)) { CON_ERRPRINTF("invalid sector %d\n", vm.pUSprite->sectnum); - continue; + dispatch(tw); } int const spriteNum = A_Spawn(vm.spriteNum, tileNum); @@ -4167,11 +4174,11 @@ badindex: A_AddToDeleteQueue(spriteNum); break; } - continue; + dispatch(tw); } - case CON_SHOOT: - case CON_ESHOOT: + vInstruction(CON_SHOOT): + vInstruction(CON_ESHOOT): insptr++; { int j = Gv_GetVarX(*insptr++); @@ -4179,7 +4186,7 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)vm.pSprite->sectnum >= (unsigned)numsectors)) { CON_ERRPRINTF("invalid sector %d\n", vm.pUSprite->sectnum); - continue; + dispatch(tw); } j = A_Shoot(vm.spriteNum, j); @@ -4187,11 +4194,11 @@ badindex: if (tw == CON_ESHOOT) aGameVars[g_returnVarID].global = j; - continue; + dispatch(tw); } - case CON_EZSHOOT: - case CON_ZSHOOT: + vInstruction(CON_EZSHOOT): + vInstruction(CON_ZSHOOT): insptr++; { int const zvel = (int16_t)Gv_GetVarX(*insptr++); @@ -4200,7 +4207,7 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)vm.pSprite->sectnum >= (unsigned)numsectors)) { CON_ERRPRINTF("invalid sector %d\n", vm.pUSprite->sectnum); - continue; + dispatch(tw); } j = A_ShootWithZvel(vm.spriteNum, j, zvel); @@ -4208,19 +4215,19 @@ badindex: if (tw == CON_EZSHOOT) aGameVars[g_returnVarID].global = j; - continue; + dispatch(tw); } - case CON_CMENU: + vInstruction(CON_CMENU): insptr++; Menu_Change(Gv_GetVarX(*insptr++)); - continue; + dispatch(tw); - case CON_SOUND: - case CON_STOPSOUND: - case CON_SOUNDONCE: - case CON_GLOBALSOUND: - case CON_SCREENSOUND: + vInstruction(CON_SOUND): + vInstruction(CON_STOPSOUND): + vInstruction(CON_SOUNDONCE): + vInstruction(CON_GLOBALSOUND): + vInstruction(CON_SCREENSOUND): insptr++; { int const soundNum = Gv_GetVarX(*insptr++); @@ -4228,7 +4235,7 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)soundNum >= MAXSOUNDS)) { CON_ERRPRINTF("invalid sound %d\n", soundNum); - continue; + dispatch(tw); } switch (tw) @@ -4239,19 +4246,19 @@ badindex: fallthrough__; case CON_SOUND: A_PlaySound((int16_t)soundNum, vm.spriteNum); } - continue; - case CON_GLOBALSOUND: A_PlaySound((int16_t)soundNum, g_player[screenpeek].ps->i); continue; + dispatch(tw); + case CON_GLOBALSOUND: A_PlaySound((int16_t)soundNum, g_player[screenpeek].ps->i); dispatch(tw); case CON_STOPSOUND: if (S_CheckSoundPlaying(soundNum)) S_StopSound((int16_t)soundNum); - continue; - case CON_SCREENSOUND: S_PlaySound(soundNum); continue; + dispatch(tw); + case CON_SCREENSOUND: S_PlaySound(soundNum); dispatch(tw); } } - continue; + dispatch(tw); - case CON_STARTCUTSCENE: - case CON_IFCUTSCENE: + vInstruction(CON_STARTCUTSCENE): + vInstruction(CON_IFCUTSCENE): insptr++; { int const nQuote = Gv_GetVarX(*insptr++); @@ -4259,30 +4266,30 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)nQuote >= MAXQUOTES || apStrings[nQuote] == NULL)) { CON_ERRPRINTF("invalid quote %d for anim!\n", nQuote); - continue; + dispatch(tw); } if (tw == CON_IFCUTSCENE) { insptr--; VM_CONDITIONAL(g_animPtr == Anim_Find(apStrings[nQuote])); - continue; + dispatch(tw); } tw = p.palette; I_ClearAllInput(); Anim_Play(apStrings[nQuote]); P_SetGamePalette(&p, tw, 2 + 16); - continue; + dispatch(tw); } - case CON_STARTSCREEN: + vInstruction(CON_STARTSCREEN): insptr++; I_ClearAllInput(); Screen_Play(); - continue; + dispatch(tw); - case CON_GUNIQHUDID: + vInstruction(CON_GUNIQHUDID): insptr++; { tw = Gv_GetVarX(*insptr++); @@ -4291,18 +4298,18 @@ badindex: else guniqhudid = tw; - continue; + dispatch(tw); } - case CON_SAVEGAMEVAR: - case CON_READGAMEVAR: + vInstruction(CON_SAVEGAMEVAR): + vInstruction(CON_READGAMEVAR): { int32_t nValue = 0; insptr++; if (ud.config.scripthandle < 0) { insptr++; - continue; + dispatch(tw); } switch (tw) { @@ -4315,13 +4322,13 @@ badindex: Gv_SetVarX(*insptr++, nValue); break; } - continue; + dispatch(tw); } - case CON_SHOWVIEW: - case CON_SHOWVIEWUNBIASED: - case CON_SHOWVIEWQ16: - case CON_SHOWVIEWQ16UNBIASED: + vInstruction(CON_SHOWVIEW): + vInstruction(CON_SHOWVIEWUNBIASED): + vInstruction(CON_SHOWVIEWQ16): + vInstruction(CON_SHOWVIEWQ16UNBIASED): insptr++; { struct @@ -4335,13 +4342,13 @@ badindex: if (EDUKE32_PREDICT_FALSE(v.scrn[0].x < 0 || v.scrn[0].y < 0 || v.scrn[1].x >= 320 || v.scrn[1].y >= 200)) { CON_ERRPRINTF("incorrect coordinates\n"); - continue; + dispatch(tw); } if (EDUKE32_PREDICT_FALSE((unsigned)v.params[2] >= (unsigned)numsectors)) { CON_ERRPRINTF("invalid sector %d\n", v.params[2]); - continue; + dispatch(tw); } if (tw != CON_SHOWVIEWQ16 && tw != CON_SHOWVIEWQ16UNBIASED) @@ -4353,12 +4360,12 @@ badindex: G_ShowView(v.vec, v.params[0], v.params[1], v.params[2], v.scrn[0].x, v.scrn[0].y, v.scrn[1].x, v.scrn[1].y, (tw != CON_SHOWVIEW && tw != CON_SHOWVIEWQ16)); - continue; + dispatch(tw); } - case CON_ROTATESPRITEA: - case CON_ROTATESPRITE16: - case CON_ROTATESPRITE: + vInstruction(CON_ROTATESPRITEA): + vInstruction(CON_ROTATESPRITE16): + vInstruction(CON_ROTATESPRITE): insptr++; { struct @@ -4382,7 +4389,7 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)v.tilenum >= MAXTILES)) { CON_ERRPRINTF("invalid tilenum %d\n", v.tilenum); - continue; + dispatch(tw); } int32_t blendidx = 0; @@ -4391,11 +4398,11 @@ badindex: rotatesprite_(v.pos.x, v.pos.y, v.pos.z, v.ang, v.tilenum, v.shade, v.pal, 2 | (v.orientation & (ROTATESPRITE_MAX - 1)), alpha, blendidx, bound[0].x, bound[0].y, bound[1].x, bound[1].y); - continue; + dispatch(tw); } - case CON_GAMETEXT: - case CON_GAMETEXTZ: + vInstruction(CON_GAMETEXT): + vInstruction(CON_GAMETEXTZ): insptr++; { struct @@ -4412,22 +4419,22 @@ badindex: if (EDUKE32_PREDICT_FALSE(v.tilenum < 0 || v.tilenum + 127 >= MAXTILES)) { CON_ERRPRINTF("invalid base tilenum %d\n", v.tilenum); - continue; + dispatch(tw); } if (EDUKE32_PREDICT_FALSE((unsigned)v.nQuote >= MAXQUOTES || apStrings[v.nQuote] == NULL)) { CON_ERRPRINTF("invalid quote %d\n", v.nQuote); - continue; + dispatch(tw); } G_PrintGameText(v.tilenum, v.pos.x >> 1, v.pos.y, apStrings[v.nQuote], v.shade, v.pal, v.orientation & (ROTATESPRITE_MAX - 1), v.bound[0].x, v.bound[0].y, v.bound[1].x, v.bound[1].y, z, 0); - continue; + dispatch(tw); } - case CON_DIGITALNUMBER: - case CON_DIGITALNUMBERZ: + vInstruction(CON_DIGITALNUMBER): + vInstruction(CON_DIGITALNUMBERZ): insptr++; { struct @@ -4445,15 +4452,15 @@ badindex: if (EDUKE32_PREDICT_FALSE(v.tilenum < 0 || v.tilenum + 9 >= MAXTILES)) { CON_ERRPRINTF("invalid base tilenum %d\n", v.tilenum); - continue; + dispatch(tw); } G_DrawTXDigiNumZ(v.tilenum, v.pos.x, v.pos.y, v.nQuote, v.shade, v.pal, v.orientation & (ROTATESPRITE_MAX - 1), v.bound[0].x, v.bound[0].y, v.bound[1].x, v.bound[1].y, nZoom); - continue; + dispatch(tw); } - case CON_MINITEXT: + vInstruction(CON_MINITEXT): insptr++; { struct @@ -4466,14 +4473,14 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)v.nQuote >= MAXQUOTES || apStrings[v.nQuote] == NULL)) { CON_ERRPRINTF("invalid quote %d\n", v.nQuote); - continue; + dispatch(tw); } minitextshade(v.pos.x, v.pos.y, apStrings[v.nQuote], v.shade, v.pal, 2 + 8 + 16); - continue; + dispatch(tw); } - case CON_SCREENTEXT: + vInstruction(CON_SCREENTEXT): insptr++; { struct @@ -4490,22 +4497,22 @@ badindex: if (EDUKE32_PREDICT_FALSE(v.tilenum < 0 || v.tilenum + 127 >= MAXTILES)) { CON_ERRPRINTF("invalid base tilenum %d\n", v.tilenum); - continue; + dispatch(tw); } if (EDUKE32_PREDICT_FALSE((unsigned)v.nQuote >= MAXQUOTES || apStrings[v.nQuote] == NULL)) { CON_ERRPRINTF("invalid quote %d\n", v.nQuote); - continue; + dispatch(tw); } G_ScreenText(v.tilenum, v.v.x, v.v.y, v.v.z, v.blockangle, v.charangle, apStrings[v.nQuote], v.shade, v.pal, 2 | (v.orientation & (ROTATESPRITE_MAX - 1)), v.alpha, v.spacing.x, v.spacing.y, v.between.x, v.between.y, v.nFlags, v.bound[0].x, v.bound[0].y, v.bound[1].x, v.bound[1].y); - continue; + dispatch(tw); } - case CON_GETZRANGE: + vInstruction(CON_GETZRANGE): insptr++; { struct @@ -4529,7 +4536,7 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)v.sectNum >= (unsigned)numsectors)) { CON_ERRPRINTF("invalid sector %d\n", v.sectNum); - continue; + dispatch(tw); } int32_t ceilz, ceilhit, florz, florhit; @@ -4540,11 +4547,11 @@ badindex: Gv_SetVarX(florzvar, florz); Gv_SetVarX(florhitvar, florhit); - continue; + dispatch(tw); } - case CON_SECTSETINTERPOLATION: - case CON_SECTCLEARINTERPOLATION: + vInstruction(CON_SECTSETINTERPOLATION): + vInstruction(CON_SECTCLEARINTERPOLATION): insptr++; { int const sectnum = Gv_GetVarX(*insptr++); @@ -4552,7 +4559,7 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)sectnum >= (unsigned)numsectors)) { CON_ERRPRINTF("invalid sector %d\n", sectnum); - continue; + dispatch(tw); } if (tw == CON_SECTSETINTERPOLATION) @@ -4560,10 +4567,10 @@ badindex: else Sect_ClearInterpolation(sectnum); - continue; + dispatch(tw); } - case CON_CALCHYPOTENUSE: + vInstruction(CON_CALCHYPOTENUSE): insptr++; { int32_t returnVar = *insptr++; @@ -4572,11 +4579,11 @@ badindex: int64_t const hypsq = (int64_t)da.x * da.x + (int64_t)da.y * da.y; Gv_SetVarX(returnVar, (hypsq > (int64_t)INT32_MAX) ? (int32_t)sqrt((double)hypsq) : ksqrt((uint32_t)hypsq)); - continue; + dispatch(tw); } - case CON_LINEINTERSECT: - case CON_RAYINTERSECT: + vInstruction(CON_LINEINTERSECT): + vInstruction(CON_RAYINTERSECT): insptr++; { struct @@ -4605,11 +4612,11 @@ badindex: Gv_SetVarX(intzvar, in.z); } - continue; + dispatch(tw); } - case CON_CLIPMOVE: - case CON_CLIPMOVENOSLIDE: + vInstruction(CON_CLIPMOVE): + vInstruction(CON_CLIPMOVENOSLIDE): insptr++; { typedef struct @@ -4641,7 +4648,7 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)sectNum >= (unsigned)numsectors)) { CON_ERRPRINTF("invalid sector %d\n", sectNum); - continue; + dispatch(tw); } Gv_SetVarX( @@ -4651,10 +4658,10 @@ badindex: Gv_SetVarX(xReturn, v.vec3.x); Gv_SetVarX(yReturn, v.vec3.y); - continue; + dispatch(tw); } - case CON_HITSCAN: + vInstruction(CON_HITSCAN): insptr++; { struct @@ -4676,7 +4683,7 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)v.sectnum >= (unsigned)numsectors)) { CON_ERRPRINTF("invalid sector %d\n", v.sectnum); - continue; + dispatch(tw); } hitdata_t hit; @@ -4688,10 +4695,10 @@ badindex: Gv_SetVarX(xReturn, hit.pos.x); Gv_SetVarX(yReturn, hit.pos.y); Gv_SetVarX(zReturn, hit.pos.z); - continue; + dispatch(tw); } - case CON_CANSEE: + vInstruction(CON_CANSEE): insptr++; { struct @@ -4708,14 +4715,14 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)v.firstSector >= (unsigned)numsectors || (unsigned)v.secondSector >= (unsigned)numsectors)) { CON_ERRPRINTF("invalid sector %d\n", (unsigned)v.firstSector >= (unsigned)numsectors ? v.firstSector : v.secondSector); - continue; + dispatch(tw); } Gv_SetVarX(returnVar, cansee(v.vec1.x, v.vec1.y, v.vec1.z, v.firstSector, v.vec2.x, v.vec2.y, v.vec2.z, v.secondSector)); - continue; + dispatch(tw); } - case CON_ROTATEPOINT: + vInstruction(CON_ROTATEPOINT): insptr++; { struct @@ -4733,10 +4740,10 @@ badindex: Gv_SetVarX(xReturn, result.x); Gv_SetVarX(yReturn, result.y); - continue; + dispatch(tw); } - case CON_NEARTAG: + vInstruction(CON_NEARTAG): insptr++; { // neartag(int32_t x, int32_t y, int32_t z, short sectnum, short ang, //Starting position & angle @@ -4768,7 +4775,7 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)v.sectNum >= (unsigned)numsectors)) { CON_ERRPRINTF("Invalid sector %d\n", v.sectNum); - continue; + dispatch(tw); } int16_t neartagsector, neartagwall, neartagsprite; @@ -4781,10 +4788,10 @@ badindex: Gv_SetVarX(wallReturn, neartagwall); Gv_SetVarX(spriteReturn, neartagsprite); Gv_SetVarX(distReturn, neartaghitdist); - continue; + dispatch(tw); } - case CON_GETTIMEDATE: + vInstruction(CON_GETTIMEDATE): insptr++; { int32_t values[8]; @@ -4793,10 +4800,10 @@ badindex: for (int value : values) Gv_SetVarX(*insptr++, value); - continue; + dispatch(tw); } - case CON_MOVESPRITE: + vInstruction(CON_MOVESPRITE): insptr++; { struct @@ -4810,14 +4817,14 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)v.spriteNum >= MAXSPRITES)) { CON_ERRPRINTF("invalid sprite %d\n", v.spriteNum); - continue; + dispatch(tw); } Gv_SetVarX(*insptr++, A_MoveSprite(v.spriteNum, &v.vect, v.clipType)); - continue; + dispatch(tw); } - case CON_SETSPRITE: + vInstruction(CON_SETSPRITE): insptr++; { struct @@ -4830,14 +4837,14 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)v.spriteNum >= MAXSPRITES)) { CON_ERRPRINTF("invalid sprite %d\n", v.spriteNum); - continue; + dispatch(tw); } setsprite(v.spriteNum, &v.vect); - continue; + dispatch(tw); } - case CON_GETFLORZOFSLOPE: - case CON_GETCEILZOFSLOPE: + vInstruction(CON_GETFLORZOFSLOPE): + vInstruction(CON_GETCEILZOFSLOPE): insptr++; { struct @@ -4850,13 +4857,13 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)v.sectNum >= (unsigned)numsectors)) { CON_ERRPRINTF("invalid sector %d\n", v.sectNum); - continue; + dispatch(tw); } Gv_SetVarX(*insptr++, (tw == CON_GETFLORZOFSLOPE ? getflorzofslope : getceilzofslope)(v.sectNum, v.vect.x, v.vect.y)); - continue; + dispatch(tw); } - case CON_UPDATESECTOR: + vInstruction(CON_UPDATESECTOR): insptr++; { vec2_t vect = { 0, 0 }; @@ -4867,10 +4874,10 @@ badindex: updatesector(vect.x, vect.y, §Num); Gv_SetVarX(returnVar, sectNum); - continue; + dispatch(tw); } - case CON_UPDATESECTORZ: + vInstruction(CON_UPDATESECTORZ): insptr++; { vec3_t vect = { 0, 0, 0 }; @@ -4881,25 +4888,25 @@ badindex: updatesectorz(vect.x, vect.y, vect.z, §Num); Gv_SetVarX(returnVar, sectNum); - continue; + dispatch(tw); } - case CON_SPAWN: + vInstruction(CON_SPAWN): insptr++; if ((unsigned)vm.pSprite->sectnum >= MAXSECTORS) { CON_ERRPRINTF("invalid sector %d\n", vm.pUSprite->sectnum); - continue; + dispatch(tw); } A_Spawn(vm.spriteNum, *insptr++); - continue; + dispatch(tw); - case CON_RESETACTIONCOUNT: + vInstruction(CON_RESETACTIONCOUNT): insptr++; AC_ACTION_COUNT(vm.pData) = 0; - continue; + dispatch(tw); - case CON_DEBRIS: + vInstruction(CON_DEBRIS): insptr++; { #ifndef EDUKE32_STANDALONE @@ -4923,36 +4930,36 @@ badindex: #endif insptr++; } - continue; + dispatch(tw); - case CON_COUNT: + vInstruction(CON_COUNT): insptr++; AC_COUNT(vm.pData) = (int16_t)*insptr++; - continue; + dispatch(tw); - case CON_CSTATOR: + vInstruction(CON_CSTATOR): insptr++; vm.pSprite->cstat |= (int16_t)*insptr++; - continue; + dispatch(tw); - case CON_CLIPDIST: + vInstruction(CON_CLIPDIST): insptr++; vm.pSprite->clipdist = (int16_t)*insptr++; - continue; + dispatch(tw); - case CON_CSTAT: + vInstruction(CON_CSTAT): insptr++; vm.pSprite->cstat = (int16_t)*insptr++; - continue; + dispatch(tw); - case CON_SAVENN: - case CON_SAVE: + vInstruction(CON_SAVENN): + vInstruction(CON_SAVE): insptr++; { int32_t const requestedSlot = *insptr++; if ((unsigned)requestedSlot >= 10) - continue; + dispatch(tw); // check if we need to make a new file if (strcmp(g_lastautosave.path, g_lastusersave.path) == 0 || requestedSlot != g_lastAutoSaveArbitraryID) @@ -4972,48 +4979,48 @@ badindex: g_saveRequested = true; - continue; + dispatch(tw); } - case CON_QUAKE: + vInstruction(CON_QUAKE): insptr++; g_earthquakeTime = Gv_GetVarX(*insptr++); A_PlaySound(EARTHQUAKE, g_player[screenpeek].ps->i); - continue; + dispatch(tw); - case CON_RESETPLAYER: + vInstruction(CON_RESETPLAYER): insptr++; vm.flags = VM_ResetPlayer(vm.playerNum, vm.flags, 0); - continue; + dispatch(tw); - case CON_RESETPLAYERFLAGS: + vInstruction(CON_RESETPLAYERFLAGS): insptr++; vm.flags = VM_ResetPlayer(vm.playerNum, vm.flags, Gv_GetVarX(*insptr++)); - continue; + dispatch(tw); - case CON_RESETCOUNT: + vInstruction(CON_RESETCOUNT): insptr++; AC_COUNT(vm.pData) = 0; - continue; + dispatch(tw); - case CON_ADDINVENTORY: + vInstruction(CON_ADDINVENTORY): insptr += 2; VM_AddInventory(&p, insptr[-1], *insptr); insptr++; - continue; + dispatch(tw); - case CON_HITRADIUS: + vInstruction(CON_HITRADIUS): insptr++; { int32_t params[5]; Gv_FillWithVars(params); A_RadiusDamage(vm.spriteNum, params[0], params[1], params[2], params[3], params[4]); } - continue; + dispatch(tw); - case CON_IFP: + vInstruction(CON_IFP): { int const moveFlags = *(++insptr); int nResult = 0; @@ -5051,62 +5058,62 @@ badindex: } VM_CONDITIONAL(nResult); } - continue; + dispatch(tw); - case CON_GUTS: + vInstruction(CON_GUTS): #ifndef EDUKE32_STANDALONE A_DoGuts(vm.spriteNum, insptr[1], insptr[2]); #endif insptr += 3; - continue; + dispatch(tw); - case CON_WACKPLAYER: + vInstruction(CON_WACKPLAYER): insptr++; P_ForceAngle(&p); - continue; + dispatch(tw); - case CON_FLASH: + vInstruction(CON_FLASH): insptr++; sprite[vm.spriteNum].shade = -127; p.visibility = -127; - continue; + dispatch(tw); - case CON_SAVEMAPSTATE: + vInstruction(CON_SAVEMAPSTATE): G_SaveMapState(); insptr++; - continue; + dispatch(tw); - case CON_LOADMAPSTATE: + vInstruction(CON_LOADMAPSTATE): G_RestoreMapState(); insptr++; - continue; + dispatch(tw); - case CON_CLEARMAPSTATE: + vInstruction(CON_CLEARMAPSTATE): insptr++; { int const levelNum = Gv_GetVarX(*insptr++); if (EDUKE32_PREDICT_FALSE((unsigned)levelNum >= MAXVOLUMES * MAXLEVELS)) { CON_ERRPRINTF("invalid map number %d\n", levelNum); - continue; + dispatch(tw); } G_FreeMapState(levelNum); } - continue; + dispatch(tw); - case CON_STOPALLSOUNDS: + vInstruction(CON_STOPALLSOUNDS): insptr++; if (screenpeek == vm.playerNum) FX_StopAllSounds(); - continue; + dispatch(tw); - case CON_STOPALLMUSIC: + vInstruction(CON_STOPALLMUSIC): insptr++; S_StopMusic(); - continue; + dispatch(tw); - case CON_OPERATE: + vInstruction(CON_OPERATE): insptr++; if (sector[vm.pSprite->sectnum].lotag == 0) { @@ -5130,27 +5137,27 @@ badindex: G_OperateSectors(foundSect, vm.spriteNum); } } - continue; + dispatch(tw); - case CON_SPRITEPAL: + vInstruction(CON_SPRITEPAL): insptr++; if (vm.pSprite->picnum != APLAYER) vm.pActor->tempang = vm.pSprite->pal; vm.pSprite->pal = *insptr++; - continue; + dispatch(tw); - case CON_CACTOR: + vInstruction(CON_CACTOR): insptr++; vm.pSprite->picnum = *insptr++; - continue; + dispatch(tw); - case CON_PALFROM: + vInstruction(CON_PALFROM): insptr++; if (EDUKE32_PREDICT_FALSE((unsigned)vm.playerNum >= (unsigned)g_mostConcurrentPlayers)) { CON_ERRPRINTF("invalid player %d\n", vm.playerNum); - continue; + dispatch(tw); } else { @@ -5158,24 +5165,24 @@ badindex: insptr += 4; P_PalFrom(&p, pal.f, pal.r, pal.g, pal.b); } - continue; + dispatch(tw); - case CON_SCREENPAL: + vInstruction(CON_SCREENPAL): insptr++; { int32_t params[4]; Gv_FillWithVars(params); videoFadePalette(params[0], params[1], params[2], params[3]); } - continue; + dispatch(tw); - case CON_SECTOROFWALL: + vInstruction(CON_SECTOROFWALL): insptr++; tw = *insptr++; Gv_SetVarX(tw, sectorofwall(Gv_GetVarX(*insptr++))); - continue; + dispatch(tw); - case CON_QSPRINTF: + vInstruction(CON_QSPRINTF): insptr++; { int const outputQuote = Gv_GetVarX(*insptr++); @@ -5184,7 +5191,7 @@ badindex: if (EDUKE32_PREDICT_FALSE(apStrings[inputQuote] == NULL || apStrings[outputQuote] == NULL)) { CON_ERRPRINTF("null quote %d\n", apStrings[inputQuote] ? outputQuote : inputQuote); - continue; + dispatch(tw); } auto &inBuf = apStrings[inputQuote]; @@ -5263,10 +5270,10 @@ badindex: finish_qsprintf: outBuf[outputPos] = '\0'; Bstrncpyz(apStrings[outputQuote], outBuf, MAXQUOTELEN); - continue; + dispatch(tw); } - case CON_ADDLOGVAR: + vInstruction(CON_ADDLOGVAR): insptr++; { int32_t m = 1; @@ -5297,12 +5304,12 @@ badindex: { initprintf(OSDTEXT_GREEN "CONLOGVAR: L=%d %s[%d] =%d\n", g_errorLineNum, aGameArrays[lVarID].szLabel, index, (int32_t)(m * Gv_GetArrayValue(lVarID, index))); - continue; + dispatch(tw); } else { CON_ERRPRINTF("invalid array index\n"); - continue; + dispatch(tw); } } else if (*insptr & (MAXGAMEVARS << 3)) @@ -5317,10 +5324,10 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)index >= MAXSPRITES - 1)) { CON_ERRPRINTF("invalid array index\n"); - continue; + dispatch(tw); } initprintf(OSDTEXT_GREEN "CONLOGVAR: L=%d %d %d\n", g_errorLineNum, index, Gv_GetVar(*insptr++, index, vm.playerNum)); - continue; + dispatch(tw); } } else if (EDUKE32_PREDICT_TRUE(*insptr & GV_FLAG_NEGATIVE)) @@ -5332,7 +5339,7 @@ badindex: { // invalid varID CON_ERRPRINTF("invalid variable\n"); - continue; // out of switch + dispatch(tw); // out of switch } } Bsprintf(tempbuf, "CONLOGVAR: L=%d %s ", g_errorLineNum, aGameVars[lVarID].szLabel); @@ -5359,22 +5366,22 @@ badindex: Bstrcat(tempbuf, szBuf); initprintf(OSDTEXT_GREEN "%s", tempbuf); insptr++; - continue; + dispatch(tw); } - case CON_SQRT: + vInstruction(CON_SQRT): insptr++; { // syntax sqrt int const sqrtval = ksqrt((uint32_t)Gv_GetVarX(*insptr++)); Gv_SetVarX(*insptr++, sqrtval); - continue; + dispatch(tw); } - case CON_FINDNEARACTOR: - case CON_FINDNEARSPRITE: - case CON_FINDNEARACTOR3D: - case CON_FINDNEARSPRITE3D: + vInstruction(CON_FINDNEARACTOR): + vInstruction(CON_FINDNEARSPRITE): + vInstruction(CON_FINDNEARACTOR3D): + vInstruction(CON_FINDNEARSPRITE3D): insptr++; { // syntax findnearactorvar @@ -5414,7 +5421,7 @@ badindex: break; } while (findStatnum--); Gv_SetVarX(returnVar, foundSprite); - continue; + dispatch(tw); } do @@ -5437,11 +5444,11 @@ badindex: break; } while (findStatnum--); Gv_SetVarX(returnVar, foundSprite); - continue; + dispatch(tw); } - case CON_FINDNEARACTORZ: - case CON_FINDNEARSPRITEZ: + vInstruction(CON_FINDNEARACTORZ): + vInstruction(CON_FINDNEARSPRITEZ): insptr++; { // syntax findnearactorvar @@ -5462,7 +5469,7 @@ badindex: int spriteNum = headspritestat[tw == CON_FINDNEARACTORZ ? STAT_ACTOR : findStatnum]; // all sprites if (spriteNum == -1) - continue; + dispatch(tw); do { if (sprite[spriteNum].picnum == findPicnum && spriteNum != vm.spriteNum) @@ -5485,124 +5492,124 @@ badindex: } while (findStatnum--); Gv_SetVarX(returnVar, foundSprite); - continue; + dispatch(tw); } - case CON_FINDPLAYER: + vInstruction(CON_FINDPLAYER): { int32_t tw; insptr++; aGameVars[g_returnVarID].global = A_FindPlayer(&sprite[vm.spriteNum], &tw); Gv_SetVarX(*insptr++, tw); - continue; + dispatch(tw); } - case CON_FINDOTHERPLAYER: + vInstruction(CON_FINDOTHERPLAYER): { int32_t tw; insptr++; aGameVars[g_returnVarID].global = P_FindOtherPlayer(vm.playerNum, &tw); Gv_SetVarX(*insptr++, tw); - continue; + dispatch(tw); } - case CON_GETINPUT: + vInstruction(CON_GETINPUT): insptr++; { int const playerNum = (*insptr++ != g_thisActorVarID) ? Gv_GetVarX(insptr[-1]) : vm.playerNum; int const labelNum = *insptr++; Gv_SetVarX(*insptr++, VM_GetPlayerInput(playerNum, labelNum)); - continue; + dispatch(tw); } - case CON_SETINPUT: + vInstruction(CON_SETINPUT): insptr++; { int const playerNum = (*insptr++ != g_thisActorVarID) ? Gv_GetVarX(insptr[-1]) : vm.playerNum; int const labelNum = *insptr++; VM_SetPlayerInput(playerNum, labelNum, Gv_GetVarX(*insptr++)); - continue; + dispatch(tw); } - case CON_GETUSERDEF: + vInstruction(CON_GETUSERDEF): insptr++; { int const labelNum = *insptr++; int const lParm2 = (UserdefsLabels[labelNum].flags & LABEL_HASPARM2) ? Gv_GetVarX(*insptr++) : 0; Gv_SetVarX(*insptr++, VM_GetUserdef(labelNum, lParm2)); - continue; + dispatch(tw); } - case CON_GETTILEDATA: + vInstruction(CON_GETTILEDATA): insptr++; { int const tileNum = (*insptr++ != g_thisActorVarID) ? Gv_GetVarX(insptr[-1]) : vm.pSprite->picnum; int const labelNum = *insptr++; Gv_SetVarX(*insptr++, VM_GetTileData(tileNum, labelNum)); - continue; + dispatch(tw); } - case CON_SETTILEDATA: + vInstruction(CON_SETTILEDATA): insptr++; { int const tileNum = (*insptr++ != g_thisActorVarID) ? Gv_GetVarX(insptr[-1]) : vm.pSprite->picnum; int const labelNum = *insptr++; VM_SetTileData(tileNum, labelNum, Gv_GetVarX(*insptr++)); - continue; + dispatch(tw); } - case CON_SETUSERDEF: + vInstruction(CON_SETUSERDEF): insptr++; { int const labelNum = *insptr++; int const lParm2 = (UserdefsLabels[labelNum].flags & LABEL_HASPARM2) ? Gv_GetVarX(*insptr++) : 0; VM_SetUserdef(labelNum, lParm2, Gv_GetVarX(*insptr++)); - continue; + dispatch(tw); } - case CON_GETPROJECTILE: + vInstruction(CON_GETPROJECTILE): insptr++; { tw = Gv_GetVarX(*insptr++); int const labelNum = *insptr++; Gv_SetVarX(*insptr++, VM_GetProjectile(tw, labelNum)); - continue; + dispatch(tw); } - case CON_SETPROJECTILE: + vInstruction(CON_SETPROJECTILE): insptr++; { tw = Gv_GetVarX(*insptr++); int const labelNum = *insptr++; VM_SetProjectile(tw, labelNum, Gv_GetVarX(*insptr++)); - continue; + dispatch(tw); } - case CON_GETANGLETOTARGET: + vInstruction(CON_GETANGLETOTARGET): insptr++; // vm.pActor->lastvx and lastvy are last known location of target. Gv_SetVarX(*insptr++, getangle(vm.pActor->lastv.x - vm.pSprite->x, vm.pActor->lastv.y - vm.pSprite->y)); - continue; + dispatch(tw); - case CON_ANGOFF: + vInstruction(CON_ANGOFF): insptr++; spriteext[vm.spriteNum].angoff = Gv_GetVarX(*insptr++); - continue; + dispatch(tw); - case CON_LOCKPLAYER: + vInstruction(CON_LOCKPLAYER): insptr++; p.transporter_hold = Gv_GetVarX(*insptr++); - continue; + dispatch(tw); - case CON_CHECKAVAILWEAPON: - case CON_CHECKAVAILINVEN: + vInstruction(CON_CHECKAVAILWEAPON): + vInstruction(CON_CHECKAVAILINVEN): { insptr++; int const playerNum = (*insptr++ != g_thisActorVarID) ? Gv_GetVarX(*insptr) : vm.playerNum; @@ -5610,7 +5617,7 @@ badindex: if (EDUKE32_PREDICT_FALSE((unsigned)playerNum >= (unsigned)g_mostConcurrentPlayers)) { CON_ERRPRINTF("invalid player %d\n", (int)playerNum); - continue; + dispatch(tw); } if (tw == CON_CHECKAVAILWEAPON) @@ -5618,38 +5625,38 @@ badindex: else P_SelectNextInvItem(g_player[playerNum].ps); - continue; + dispatch(tw); } - case CON_GETPLAYERANGLE: + vInstruction(CON_GETPLAYERANGLE): insptr++; Gv_SetVarX(*insptr++, fix16_to_int(p.q16ang)); - continue; + dispatch(tw); - case CON_GETACTORANGLE: + vInstruction(CON_GETACTORANGLE): insptr++; Gv_SetVarX(*insptr++, vm.pSprite->ang); - continue; + dispatch(tw); - case CON_SETPLAYERANGLE: + vInstruction(CON_SETPLAYERANGLE): insptr++; p.q16ang = fix16_from_int(Gv_GetVarX(*insptr++) & 2047); - continue; + dispatch(tw); - case CON_SETACTORANGLE: + vInstruction(CON_SETACTORANGLE): insptr++; vm.pSprite->ang = Gv_GetVarX(*insptr++) & 2047; - continue; + dispatch(tw); - case CON_KLABS: + vInstruction(CON_KLABS): if ((aGameVars[insptr[1]].flags & (GAMEVAR_USER_MASK | GAMEVAR_PTR_MASK)) == 0) aGameVars[insptr[1]].global = klabs(aGameVars[insptr[1]].global); else Gv_SetVarX(insptr[1], klabs(Gv_GetVarX(insptr[1]))); insptr += 2; - continue; + dispatch(tw); - case CON_SETARRAY: + vInstruction(CON_SETARRAY): insptr++; { tw = *insptr++; @@ -5663,7 +5670,7 @@ badindex: "sprite %d (%d), player %d\n", (int)tw, vm.spriteNum, TrackerCast(sprite[vm.spriteNum].picnum), vm.playerNum); vm.flags |= VM_RETURN; - continue; + dispatch(tw); } auto &arr = aGameArrays[tw]; @@ -5672,7 +5679,7 @@ badindex: { OSD_Printf(OSD_ERROR "Tried to set value in read-only array `%s'", arr.szLabel); vm.flags |= VM_RETURN; - continue; + dispatch(tw); } switch (arr.flags & GAMEARRAY_TYPE_MASK) @@ -5691,10 +5698,10 @@ badindex: } } - continue; + dispatch(tw); } - case CON_READARRAYFROMFILE: + vInstruction(CON_READARRAYFROMFILE): insptr++; { int const arrayNum = *insptr++; @@ -5703,13 +5710,13 @@ badindex: if (EDUKE32_PREDICT_FALSE(apStrings[quoteFilename] == NULL)) { CON_ERRPRINTF("null quote %d\n", quoteFilename); - continue; + dispatch(tw); } int kFile = kopen4loadfrommod(apStrings[quoteFilename], 0); if (kFile < 0) - continue; + dispatch(tw); size_t const filelength = kfilelength(kFile); size_t const numElements = Gv_GetArrayCountFromFile(arrayNum, filelength); @@ -5764,10 +5771,10 @@ badindex: } kclose(kFile); - continue; + dispatch(tw); } - case CON_WRITEARRAYTOFILE: + vInstruction(CON_WRITEARRAYTOFILE): insptr++; { int const arrayNum = *insptr++; @@ -5776,7 +5783,7 @@ badindex: if (EDUKE32_PREDICT_FALSE(apStrings[quoteFilename] == NULL)) { CON_ERRPRINTF("null quote %d\n", quoteFilename); - continue; + dispatch(tw); } char temp[BMAX_PATH]; @@ -5784,7 +5791,7 @@ badindex: if (EDUKE32_PREDICT_FALSE(G_ModDirSnprintf(temp, sizeof(temp), "%s", apStrings[quoteFilename]))) { CON_ERRPRINTF("file name too long\n"); - continue; + dispatch(tw); } FILE *const fil = Bfopen(temp, "wb"); @@ -5792,7 +5799,7 @@ badindex: if (EDUKE32_PREDICT_FALSE(fil == NULL)) { CON_ERRPRINTF("couldn't open file \"%s\"\n", temp); - continue; + dispatch(tw); } switch (aGameArrays[arrayNum].flags & GAMEARRAY_SIZE_MASK) @@ -5816,16 +5823,16 @@ badindex: } Bfclose(fil); - continue; + dispatch(tw); } - case CON_GETARRAYSIZE: + vInstruction(CON_GETARRAYSIZE): insptr++; tw = *insptr++; Gv_SetVarX(*insptr++, (aGameArrays[tw].flags & GAMEARRAY_VARSIZE) ? Gv_GetVarX(aGameArrays[tw].size) : aGameArrays[tw].size); - continue; + dispatch(tw); - case CON_RESIZEARRAY: + vInstruction(CON_RESIZEARRAY): insptr++; { tw = *insptr++; @@ -5836,7 +5843,7 @@ badindex: int const oldSize = arr.size; if (newSize == oldSize || newSize < 0) - continue; + dispatch(tw); #if 0 OSD_Printf(OSDTEXT_GREEN "CON_RESIZEARRAY: resizing array %s from %d to %d\n", array.szLabel, array.size, newSize); @@ -5846,7 +5853,7 @@ badindex: Baligned_free(arr.pValues); arr.pValues = nullptr; arr.size = 0; - continue; + dispatch(tw); } size_t const oldBytes = Gv_GetArrayAllocSizeForCount(tw, oldSize); @@ -5866,10 +5873,10 @@ badindex: Baligned_free(oldArray); - continue; + dispatch(tw); } - case CON_COPY: + vInstruction(CON_COPY): insptr++; { int const srcArray = *insptr++; @@ -5885,7 +5892,7 @@ badindex: int const destArraySize = (dest.flags & GAMEARRAY_VARSIZE) ? Gv_GetVarX(dest.size) : dest.size; if (EDUKE32_PREDICT_FALSE(srcArrayIndex > srcArraySize || destArrayIndex > destArraySize)) - continue; + dispatch(tw); if ((srcArrayIndex + numElements) > srcArraySize) numElements = srcArraySize - srcArrayIndex; @@ -5904,7 +5911,7 @@ badindex: { Bmemcpy(dest.pValues + destArrayIndex, src.pValues + srcArrayIndex, numElements * Gv_GetArrayElementSize(srcArray)); - continue; + dispatch(tw); } switch (dest.flags & GAMEARRAY_TYPE_MASK) @@ -5956,10 +5963,10 @@ badindex: break; } - continue; + dispatch(tw); } - case CON_SWAPARRAYS: + vInstruction(CON_SWAPARRAYS): insptr++; { auto &array1 = aGameArrays[*insptr++]; @@ -5968,34 +5975,34 @@ badindex: swap(&array1.size, &array2.size); swap(&array1.pValues, &array2.pValues); - continue; + dispatch(tw); } - case CON_DISPLAYRANDVAR: + vInstruction(CON_DISPLAYRANDVAR): insptr++; Gv_SetVarX(*insptr, mulscale15(system_15bit_rand(), insptr[1] + 1)); insptr += 2; - continue; + dispatch(tw); - case CON_CLAMP: + vInstruction(CON_CLAMP): insptr++; { tw = *insptr++; int const min = Gv_GetVarX(*insptr++); Gv_SetVarX(tw, clamp2(Gv_GetVarX(tw), min, Gv_GetVarX(*insptr++))); } - continue; + dispatch(tw); - case CON_GETCLOSESTCOL: + vInstruction(CON_GETCLOSESTCOL): insptr++; { tw = *insptr++; int32_t const rgb = Gv_GetVarX(*insptr++); Gv_SetVarX(tw, getclosestcol_lim(rgb & 0xFF, (rgb >> 8) & 0xFF, (rgb >> 16) & 0xFF, Gv_GetVarX(*insptr++))); } - continue; + dispatch(tw); - case CON_DRAWLINE256: + vInstruction(CON_DRAWLINE256): insptr++; { struct @@ -6008,9 +6015,9 @@ badindex: renderDrawLine(v.pos[0].x, v.pos[0].y, v.pos[1].x, v.pos[1].y, v.index); } - continue; + dispatch(tw); - case CON_DRAWLINERGB: + vInstruction(CON_DRAWLINERGB): insptr++; { struct @@ -6026,46 +6033,46 @@ badindex: drawlinergb(v.pos[0].x, v.pos[0].y, v.pos[1].x, v.pos[1].y, p); } - continue; + dispatch(tw); - case CON_INV: + vInstruction(CON_INV): if ((aGameVars[insptr[1]].flags & (GAMEVAR_USER_MASK | GAMEVAR_PTR_MASK)) == 0) aGameVars[insptr[1]].global = -aGameVars[insptr[1]].global; else Gv_SetVarX(insptr[1], -Gv_GetVarX(insptr[1])); insptr += 2; - continue; + dispatch(tw); - case CON_DISPLAYRANDVARVAR: + vInstruction(CON_DISPLAYRANDVARVAR): insptr++; tw = *insptr++; Gv_SetVarX(tw, mulscale15(system_15bit_rand(), Gv_GetVarX(*insptr++) + 1)); - continue; + dispatch(tw); - case CON_GMAXAMMO: + vInstruction(CON_GMAXAMMO): insptr++; tw = Gv_GetVarX(*insptr++); if (EDUKE32_PREDICT_FALSE((unsigned)tw >= MAX_WEAPONS)) { CON_ERRPRINTF("invalid weapon %d\n", (int)tw); - continue; + dispatch(tw); } Gv_SetVarX(*insptr++, p.max_ammo_amount[tw]); - continue; + dispatch(tw); - case CON_SMAXAMMO: + vInstruction(CON_SMAXAMMO): insptr++; tw = Gv_GetVarX(*insptr++); if (EDUKE32_PREDICT_FALSE((unsigned)tw >= MAX_WEAPONS)) { CON_ERRPRINTF("invalid weapon %d\n", (int)tw); - continue; + dispatch(tw); } p.max_ammo_amount[tw] = Gv_GetVarX(*insptr++); - continue; + dispatch(tw); - case CON_DIVR: // div round to nearest + vInstruction(CON_DIVR): // div round to nearest insptr++; { tw = *insptr++; @@ -6076,14 +6083,14 @@ badindex: if (EDUKE32_PREDICT_FALSE(!divisor)) { CON_CRITICALERRPRINTF("divide by zero!\n"); - continue; + dispatch(tw); } Gv_SetVarX(tw, tabledivide32((dividend + ksgn(dividend) * klabs(divisor / 2)), divisor)); - continue; + dispatch(tw); } - case CON_DIVRU: // div round away from zero + vInstruction(CON_DIVRU): // div round away from zero insptr++; { tw = *insptr++; @@ -6094,121 +6101,121 @@ badindex: if (EDUKE32_PREDICT_FALSE(!divisor)) { CON_CRITICALERRPRINTF("divide by zero!\n"); - continue; + dispatch(tw); } Gv_SetVarX(tw, tabledivide32((dividend + ksgn(dividend) * klabs(divisor) + 1), divisor)); - continue; + dispatch(tw); } - case CON_SIN: + vInstruction(CON_SIN): insptr++; tw = *insptr++; Gv_SetVarX(tw, sintable[Gv_GetVarX(*insptr++) & 2047]); - continue; + dispatch(tw); - case CON_COS: + vInstruction(CON_COS): insptr++; tw = *insptr++; Gv_SetVarX(tw, sintable[(Gv_GetVarX(*insptr++) + 512) & 2047]); - continue; + dispatch(tw); - case CON_SPGETLOTAG: + vInstruction(CON_SPGETLOTAG): insptr++; aGameVars[g_lotagVarID].global = vm.pSprite->lotag; - continue; + dispatch(tw); - case CON_SPGETHITAG: + vInstruction(CON_SPGETHITAG): insptr++; aGameVars[g_hitagVarID].global = vm.pSprite->hitag; - continue; + dispatch(tw); - case CON_SECTGETLOTAG: + vInstruction(CON_SECTGETLOTAG): insptr++; aGameVars[g_lotagVarID].global = sector[vm.pSprite->sectnum].lotag; - continue; + dispatch(tw); - case CON_SECTGETHITAG: + vInstruction(CON_SECTGETHITAG): insptr++; aGameVars[g_hitagVarID].global = sector[vm.pSprite->sectnum].hitag; - continue; + dispatch(tw); - case CON_GETTEXTUREFLOOR: + vInstruction(CON_GETTEXTUREFLOOR): insptr++; aGameVars[g_textureVarID].global = sector[vm.pSprite->sectnum].floorpicnum; - continue; + dispatch(tw); - case CON_STARTTRACK: + vInstruction(CON_STARTTRACK): insptr++; G_StartTrackSlotWrap(ud.volume_number, Gv_GetVarX(*(insptr++))); - continue; + dispatch(tw); - case CON_STARTTRACKSLOT: + vInstruction(CON_STARTTRACKSLOT): insptr++; { int const volumeNum = Gv_GetVarX(*(insptr++)); int const levelNum = Gv_GetVarX(*(insptr++)); G_StartTrackSlotWrap(volumeNum == -1 ? MAXVOLUMES : volumeNum, levelNum); } - continue; + dispatch(tw); - case CON_SWAPTRACKSLOT: + vInstruction(CON_SWAPTRACKSLOT): insptr++; { int const volumeNum = Gv_GetVarX(*(insptr++)); int const levelNum = Gv_GetVarX(*(insptr++)); if (volumeNum == ud.music_episode && levelNum == ud.music_level) - continue; + dispatch(tw); // This is the best ASS can do right now. Better implementation pending. int32_t position = S_GetMusicPosition(); if (!G_StartTrackSlotWrap(volumeNum == -1 ? MAXVOLUMES : volumeNum, levelNum)) S_SetMusicPosition(position); } - continue; + dispatch(tw); - case CON_PRELOADTRACKSLOTFORSWAP: + vInstruction(CON_PRELOADTRACKSLOTFORSWAP): // ASS can't even handle this command right now. insptr++; Gv_GetVarX(*(insptr++)); Gv_GetVarX(*(insptr++)); - continue; + dispatch(tw); - case CON_SETMUSICPOSITION: + vInstruction(CON_SETMUSICPOSITION): insptr++; Gv_GetVarX(*(insptr++)); - continue; - case CON_GETMUSICPOSITION: insptr += 2; continue; + dispatch(tw); + vInstruction(CON_GETMUSICPOSITION): insptr += 2; dispatch(tw); - case CON_ACTIVATECHEAT: + vInstruction(CON_ACTIVATECHEAT): insptr++; tw = Gv_GetVarX(*(insptr++)); if (EDUKE32_PREDICT_FALSE(numplayers != 1 || !(g_player[myconnectindex].ps->gm & MODE_GAME))) { CON_ERRPRINTF("not in a single-player game.\n"); - continue; + dispatch(tw); } osdcmd_cheatsinfo_stat.cheatnum = tw; - continue; + dispatch(tw); - case CON_SETGAMEPALETTE: + vInstruction(CON_SETGAMEPALETTE): insptr++; P_SetGamePalette(&p, Gv_GetVarX(*(insptr++)), 2 + 16); - continue; + dispatch(tw); - case CON_GETTEXTURECEILING: + vInstruction(CON_GETTEXTURECEILING): insptr++; aGameVars[g_textureVarID].global = sector[vm.pSprite->sectnum].ceilingpicnum; - continue; + dispatch(tw); - case CON_IFPHEALTHL: + vInstruction(CON_IFPHEALTHL): insptr++; VM_CONDITIONAL(sprite[p.i].extra < *insptr); - continue; + dispatch(tw); - case CON_IFPINVENTORY: + vInstruction(CON_IFPINVENTORY): insptr++; switch (*insptr++) @@ -6231,13 +6238,13 @@ badindex: } break; default: tw = 0; CON_ERRPRINTF("invalid inventory item %d\n", (int32_t) * (insptr - 1)); - continue; + dispatch(tw); } VM_CONDITIONAL(tw); - continue; + dispatch(tw); - case CON_PSTOMP: + vInstruction(CON_PSTOMP): insptr++; if (p.knee_incs == 0 && sprite[p.i].xrepeat >= 40) if (cansee(vm.pSprite->x, vm.pSprite->y, vm.pSprite->z - ZOFFSET6, vm.pSprite->sectnum, p.pos.x, p.pos.y, @@ -6260,9 +6267,9 @@ badindex: p.knee_incs = 1; } } - continue; + dispatch(tw); - case CON_IFAWAYFROMWALL: + vInstruction(CON_IFAWAYFROMWALL): { int16_t otherSectnum = vm.pSprite->sectnum; tw = 0; @@ -6289,47 +6296,47 @@ badindex: #undef IFAWAYDIST } - continue; + dispatch(tw); - case CON_QUOTE: + vInstruction(CON_QUOTE): insptr++; if (EDUKE32_PREDICT_FALSE((unsigned)vm.playerNum >= MAXPLAYERS)) { CON_ERRPRINTF("invalid player %d\n", vm.playerNum); - continue; + dispatch(tw); } P_DoQuote(*(insptr++) | MAXQUOTES, &p); - continue; + dispatch(tw); - case CON_USERQUOTE: + vInstruction(CON_USERQUOTE): insptr++; tw = Gv_GetVarX(*insptr++); if (EDUKE32_PREDICT_FALSE((unsigned)tw >= MAXQUOTES || apStrings[tw] == NULL)) { CON_ERRPRINTF("invalid quote %d\n", (int)tw); - continue; + dispatch(tw); } G_AddUserQuote(apStrings[tw]); - continue; + dispatch(tw); - case CON_ECHO: + vInstruction(CON_ECHO): insptr++; tw = Gv_GetVarX(*insptr++); if (EDUKE32_PREDICT_FALSE((unsigned)tw >= MAXQUOTES || apStrings[tw] == NULL)) { CON_ERRPRINTF("invalid quote %d\n", (int)tw); - continue; + dispatch(tw); } OSD_Printf("%s\n", apStrings[tw]); - continue; + dispatch(tw); - case CON_RESPAWNHITAG: + vInstruction(CON_RESPAWNHITAG): insptr++; switch (DYNAMICTILEMAP(vm.pSprite->picnum)) { @@ -6356,38 +6363,38 @@ badindex: G_OperateRespawns(vm.pSprite->hitag); break; } - continue; + dispatch(tw); - case CON_IFSPRITEPAL: + vInstruction(CON_IFSPRITEPAL): insptr++; VM_CONDITIONAL(vm.pSprite->pal == *insptr); - continue; + dispatch(tw); - case CON_IFANGDIFFL: + vInstruction(CON_IFANGDIFFL): insptr++; tw = klabs(G_GetAngleDelta(fix16_to_int(p.q16ang), vm.pSprite->ang)); VM_CONDITIONAL(tw <= *insptr); - continue; + dispatch(tw); - case CON_IFNOSOUNDS: VM_CONDITIONAL(!A_CheckAnySoundPlaying(vm.spriteNum)); continue; + vInstruction(CON_IFNOSOUNDS): VM_CONDITIONAL(!A_CheckAnySoundPlaying(vm.spriteNum)); dispatch(tw); - case CON_SPRITEFLAGS: + vInstruction(CON_SPRITEFLAGS): insptr++; vm.pActor->flags = Gv_GetVarX(*insptr++); - continue; + dispatch(tw); - case CON_GETTICKS: + vInstruction(CON_GETTICKS): insptr++; Gv_SetVarX(*insptr++, timerGetTicks()); - continue; + dispatch(tw); - case CON_GETCURRADDRESS: + vInstruction(CON_GETCURRADDRESS): insptr++; tw = *insptr++; Gv_SetVarX(tw, (intptr_t)(insptr - apScript)); - continue; + dispatch(tw); - default: // you aren't supposed to be here! + vmErrorCase: // you're not supposed to be here VM_ScriptInfo(insptr, 64); debug_break(); G_GameExit("An error has occurred in the " APPNAME " virtual machine.\n\n"