convert SCR_OP to enum, make pattern more lenient

This commit is contained in:
cawtds 2025-11-25 16:11:47 +01:00
parent 976a88bca5
commit 95353565c2
2 changed files with 241 additions and 234 deletions

View File

@ -4,235 +4,238 @@
#ifndef GUARD_SCR_CMD_CONSTANTS_H
#define GUARD_SCR_CMD_CONSTANTS_H
#define SCR_OP_NOP 0x00
#define SCR_OP_NOP1 0x01
#define SCR_OP_END 0x02
#define SCR_OP_RETURN 0x03
#define SCR_OP_CALL 0x04
#define SCR_OP_GOTO 0x05
#define SCR_OP_GOTO_IF 0x06
#define SCR_OP_CALL_IF 0x07
#define SCR_OP_GOTO_STD 0x08
#define SCR_OP_CALL_STD 0x09
#define SCR_OP_GOTO_STD_IF 0x0a
#define SCR_OP_CALL_STD_IF 0x0b
#define SCR_OP_RETURNRAM 0x0c
#define SCR_OP_ENDRAM 0x0d
#define SCR_OP_SETMYSTERYEVENTSTATUS 0x0e
#define SCR_OP_LOAD_WORD 0x0f
#define SCR_OP_LOAD_BYTE 0x10
#define SCR_OP_SETPTR 0x11
#define SCR_OP_LOADBYTEFROMPTR 0x12
#define SCR_OP_SETPTRBYTE 0x13
#define SCR_OP_COPYLOCAL 0x14
#define SCR_OP_COPYBYTE 0x15
#define SCR_OP_SETVAR 0x16
#define SCR_OP_ADDVAR 0x17
#define SCR_OP_SUBVAR 0x18
#define SCR_OP_COPYVAR 0x19
#define SCR_OP_SETORCOPYVAR 0x1a
#define SCR_OP_COMPARE_LOCAL_TO_LOCAL 0x1b
#define SCR_OP_COMPARE_LOCAL_TO_VALUE 0x1c
#define SCR_OP_COMPARE_LOCAL_TO_PTR 0x1d
#define SCR_OP_COMPARE_PTR_TO_LOCAL 0x1e
#define SCR_OP_COMPARE_PTR_TO_VALUE 0x1f
#define SCR_OP_COMPARE_PTR_TO_PTR 0x20
#define SCR_OP_COMPARE_VAR_TO_VALUE 0x21
#define SCR_OP_COMPARE_VAR_TO_VAR 0x22
#define SCR_OP_CALLNATIVE 0x23
#define SCR_OP_GOTONATIVE 0x24
#define SCR_OP_SPECIAL 0x25
#define SCR_OP_SPECIALVAR 0x26
#define SCR_OP_WAITSTATE 0x27
#define SCR_OP_DELAY 0x28
#define SCR_OP_SETFLAG 0x29
#define SCR_OP_CLEARFLAG 0x2a
#define SCR_OP_CHECKFLAG 0x2b
#define SCR_OP_INITCLOCK 0x2c
#define SCR_OP_DOTIMEBASEDEVENTS 0x2d
#define SCR_OP_GETTIME 0x2e
#define SCR_OP_PLAYSE 0x2f
#define SCR_OP_WAITSE 0x30
#define SCR_OP_PLAYFANFARE 0x31
#define SCR_OP_WAITFANFARE 0x32
#define SCR_OP_PLAYBGM 0x33
#define SCR_OP_SAVEBGM 0x34
#define SCR_OP_FADEDEFAULTBGM 0x35
#define SCR_OP_FADENEWBGM 0x36
#define SCR_OP_FADEOUTBGM 0x37
#define SCR_OP_FADEINBGM 0x38
#define SCR_OP_WARP 0x39
#define SCR_OP_WARPSILENT 0x3a
#define SCR_OP_WARPDOOR 0x3b
#define SCR_OP_WARPHOLE 0x3c
#define SCR_OP_WARPTELEPORT 0x3d
#define SCR_OP_SETWARP 0x3e
#define SCR_OP_SETDYNAMICWARP 0x3f
#define SCR_OP_SETDIVEWARP 0x40
#define SCR_OP_SETHOLEWARP 0x41
#define SCR_OP_GETPLAYERXY 0x42
#define SCR_OP_GETPARTYSIZE 0x43
#define SCR_OP_ADDITEM 0x44
#define SCR_OP_REMOVEITEM 0x45
#define SCR_OP_CHECKITEMSPACE 0x46
#define SCR_OP_CHECKITEM 0x47
#define SCR_OP_CHECKITEMTYPE 0x48
#define SCR_OP_ADDPCITEM 0x49
#define SCR_OP_CHECKPCITEM 0x4a
#define SCR_OP_ADDDECORATION 0x4b
#define SCR_OP_REMOVEDECORATION 0x4c
#define SCR_OP_CHECKDECOR 0x4d
#define SCR_OP_CHECKDECORSPACE 0x4e
#define SCR_OP_APPLYMOVEMENT 0x4f
#define SCR_OP_APPLYMOVEMENTAT 0x50
#define SCR_OP_WAITMOVEMENT 0x51
#define SCR_OP_WAITMOVEMENTAT 0x52
#define SCR_OP_REMOVEOBJECT 0x53
#define SCR_OP_REMOVEOBJECTAT 0x54
#define SCR_OP_ADDOBJECT 0x55
#define SCR_OP_ADDOBJECTAT 0x56
#define SCR_OP_SETOBJECTXY 0x57
#define SCR_OP_SHOWOBJECTAT 0x58
#define SCR_OP_HIDEOBJECTAT 0x59
#define SCR_OP_FACEPLAYER 0x5a
#define SCR_OP_TURNOBJECT 0x5b
#define SCR_OP_TRAINERBATTLE 0x5c
#define SCR_OP_DOTRAINERBATTLE 0x5d
#define SCR_OP_GOTOPOSTBATTLESCRIPT 0x5e
#define SCR_OP_GOTOBEATENSCRIPT 0x5f
#define SCR_OP_CHECKTRAINERFLAG 0x60
#define SCR_OP_SETTRAINERFLAG 0x61
#define SCR_OP_CLEARTRAINERFLAG 0x62
#define SCR_OP_SETOBJECTXYPERM 0x63
#define SCR_OP_COPYOBJECTXYTOPERM 0x64
#define SCR_OP_SETOBJECTMOVEMENTTYPE 0x65
#define SCR_OP_WAITMESSAGE 0x66
#define SCR_OP_MESSAGE 0x67
#define SCR_OP_CLOSEMESSAGE 0x68
#define SCR_OP_LOCKALL 0x69
#define SCR_OP_LOCK 0x6a
#define SCR_OP_RELEASEALL 0x6b
#define SCR_OP_RELEASE 0x6c
#define SCR_OP_WAITBUTTONPRESS 0x6d
#define SCR_OP_YESNOBOX 0x6e
#define SCR_OP_MULTICHOICE 0x6f
#define SCR_OP_MULTICHOICEDEFAULT 0x70
#define SCR_OP_MULTICHOICEGRID 0x71
#define SCR_OP_DRAWBOX 0x72
#define SCR_OP_ERASEBOX 0x73
#define SCR_OP_DRAWBOXTEXT 0x74
#define SCR_OP_SHOWMONPIC 0x75
#define SCR_OP_HIDEMONPIC 0x76
#define SCR_OP_SHOWCONTESTPAINTING 0x77
#define SCR_OP_BRAILLEMESSAGE 0x78
#define SCR_OP_GIVEMON 0x79
#define SCR_OP_GIVEEGG 0x7a
#define SCR_OP_SETMONMOVE 0x7b
#define SCR_OP_CHECKFIELDMOVE 0x7c
#define SCR_OP_BUFFERSPECIESNAME 0x7d
#define SCR_OP_BUFFERLEADMONSPECIESNAME 0x7e
#define SCR_OP_BUFFERPARTYMONNICK 0x7f
#define SCR_OP_BUFFERITEMNAME 0x80
#define SCR_OP_BUFFERDECORATIONNAME 0x81
#define SCR_OP_BUFFERMOVENAME 0x82
#define SCR_OP_BUFFERNUMBERSTRING 0x83
#define SCR_OP_BUFFERSTDSTRING 0x84
#define SCR_OP_BUFFERSTRING 0x85
#define SCR_OP_POKEMART 0x86
#define SCR_OP_POKEMARTDECORATION 0x87
#define SCR_OP_POKEMARTDECORATION2 0x88
#define SCR_OP_PLAYSLOTMACHINE 0x89
#define SCR_OP_SETBERRYTREE 0x8a
#define SCR_OP_CHOOSECONTESTMON 0x8b
#define SCR_OP_STARTCONTEST 0x8c
#define SCR_OP_SHOWCONTESTRESULTS 0x8d
#define SCR_OP_CONTESTLINKTRANSFER 0x8e
#define SCR_OP_RANDOM 0x8f
#define SCR_OP_ADDMONEY 0x90
#define SCR_OP_REMOVEMONEY 0x91
#define SCR_OP_CHECKMONEY 0x92
#define SCR_OP_SHOWMONEYBOX 0x93
#define SCR_OP_HIDEMONEYBOX 0x94
#define SCR_OP_UPDATEMONEYBOX 0x95
#define SCR_OP_GETPOKENEWSACTIVE 0x96
#define SCR_OP_FADESCREEN 0x97
#define SCR_OP_FADESCREENSPEED 0x98
#define SCR_OP_SETFLASHLEVEL 0x99
#define SCR_OP_ANIMATEFLASH 0x9a
#define SCR_OP_MESSAGEAUTOSCROLL 0x9b
#define SCR_OP_DOFIELDEFFECT 0x9c
#define SCR_OP_SETFIELDEFFECTARGUMENT 0x9d
#define SCR_OP_WAITFIELDEFFECT 0x9e
#define SCR_OP_SETRESPAWN 0x9f
#define SCR_OP_CHECKPLAYERGENDER 0xa0
#define SCR_OP_PLAYMONCRY 0xa1
#define SCR_OP_SETMETATILE 0xa2
#define SCR_OP_RESETWEATHER 0xa3
#define SCR_OP_SETWEATHER 0xa4
#define SCR_OP_DOWEATHER 0xa5
#define SCR_OP_SETSTEPCALLBACK 0xa6
#define SCR_OP_SETMAPLAYOUTINDEX 0xa7
#define SCR_OP_SETOBJECTSUBPRIORITY 0xa8
#define SCR_OP_RESETOBJECTSUBPRIORITY 0xa9
#define SCR_OP_CREATEVOBJECT 0xaa
#define SCR_OP_TURNVOBJECT 0xab
#define SCR_OP_OPENDOOR 0xac
#define SCR_OP_CLOSEDOOR 0xad
#define SCR_OP_WAITDOORANIM 0xae
#define SCR_OP_SETDOOROPEN 0xaf
#define SCR_OP_SETDOORCLOSED 0xb0
#define SCR_OP_ADDELEVMENUITEM 0xb1
#define SCR_OP_SHOWELEVMENU 0xb2
#define SCR_OP_CHECKCOINS 0xb3
#define SCR_OP_ADDCOINS 0xb4
#define SCR_OP_REMOVECOINS 0xb5
#define SCR_OP_SETWILDBATTLE 0xb6
#define SCR_OP_DOWILDBATTLE 0xb7
#define SCR_OP_SETVADDRESS 0xb8
#define SCR_OP_VGOTO 0xb9
#define SCR_OP_VCALL 0xba
#define SCR_OP_VGOTO_IF 0xbb
#define SCR_OP_VCALL_IF 0xbc
#define SCR_OP_VMESSAGE 0xbd
#define SCR_OP_VBUFFERMESSAGE 0xbe
#define SCR_OP_VBUFFERSTRING 0xbf
#define SCR_OP_SHOWCOINSBOX 0xc0
#define SCR_OP_HIDECOINSBOX 0xc1
#define SCR_OP_UPDATECOINSBOX 0xc2
#define SCR_OP_INCREMENTGAMESTAT 0xc3
#define SCR_OP_SETESCAPEWARP 0xc4
#define SCR_OP_WAITMONCRY 0xc5
#define SCR_OP_BUFFERBOXNAME 0xc6
#define SCR_OP_TEXTCOLOR 0xc7
#define SCR_OP_LOADHELP 0xc8
#define SCR_OP_UNLOADHELP 0xc9
#define SCR_OP_SIGNMSG 0xca
#define SCR_OP_NORMALMSG 0xcb
#define SCR_OP_COMPAREHIDDENVAR 0xcc
#define SCR_OP_SETMODERNFATEFULENCOUNTER 0xcd
#define SCR_OP_CHECKMODERNFATEFULENCOUNTER 0xce
#define SCR_OP_TRYWONDERCARDSCRIPT 0xcf
#define SCR_OP_SETWORLDMAPFLAG 0xd0
#define SCR_OP_WARPSPINENTER 0xd1
#define SCR_OP_SETMONMETLOCATION 0xd2
#define SCR_OP_MOVEROTATINGTILEOBJECTS 0xd3
#define SCR_OP_TURNROTATINGTILEOBJECTS 0xd4
#define SCR_OP_INITROTATINGTILEPUZZLE 0xd5
#define SCR_OP_FREEROTATINGTILEPUZZLE 0xd6
#define SCR_OP_WARPMOSSDEEPGYM 0xd7
#define SCR_OP_SELECTAPPROACHINGTRAINER 0xd8
#define SCR_OP_LOCKFORTRAINER 0xd9
#define SCR_OP_CLOSEBRAILLEMESSAGE 0xda
#define SCR_OP_MESSAGEINSTANT 0xdb
#define SCR_OP_FADESCREENSWAPBUFFERS 0xdc
#define SCR_OP_BUFFERTRAINERCLASSNAME 0xdd
#define SCR_OP_BUFFERTRAINERNAME 0xde
#define SCR_OP_POKENAVCALL 0xdf
#define SCR_OP_WARPWHITEFADE 0xe0
#define SCR_OP_BUFFERCONTESTNAME 0xe1
#define SCR_OP_BUFFERITEMNAMEPLURAL 0xe2
#define SCR_OP_DYNMULTICHOICE 0xe3
#define SCR_OP_DYNMULTIPUSH 0xe4
#define SCR_OP_HIDEFOLLOWER 0xe5
enum ScrOp
{
SCR_OP_NOP = 0x0,
SCR_OP_NOP1 = 0x1,
SCR_OP_END = 0x2,
SCR_OP_RETURN = 0x3,
SCR_OP_CALL = 0x4,
SCR_OP_GOTO = 0x5,
SCR_OP_GOTO_IF = 0x6,
SCR_OP_CALL_IF = 0x7,
SCR_OP_GOTO_STD = 0x8,
SCR_OP_CALL_STD = 0x9,
SCR_OP_GOTO_STD_IF = 0xA,
SCR_OP_CALL_STD_IF = 0xB,
SCR_OP_RETURNRAM = 0xC,
SCR_OP_ENDRAM = 0xD,
SCR_OP_SETMYSTERYEVENTSTATUS = 0xE,
SCR_OP_LOAD_WORD = 0xF,
SCR_OP_LOAD_BYTE = 0x10,
SCR_OP_SETPTR = 0x11,
SCR_OP_LOADBYTEFROMPTR = 0x12,
SCR_OP_SETPTRBYTE = 0x13,
SCR_OP_COPYLOCAL = 0x14,
SCR_OP_COPYBYTE = 0x15,
SCR_OP_SETVAR = 0x16,
SCR_OP_ADDVAR = 0x17,
SCR_OP_SUBVAR = 0x18,
SCR_OP_COPYVAR = 0x19,
SCR_OP_SETORCOPYVAR = 0x1A,
SCR_OP_COMPARE_LOCAL_TO_LOCAL = 0x1B,
SCR_OP_COMPARE_LOCAL_TO_VALUE = 0x1C,
SCR_OP_COMPARE_LOCAL_TO_PTR = 0x1D,
SCR_OP_COMPARE_PTR_TO_LOCAL = 0x1E,
SCR_OP_COMPARE_PTR_TO_VALUE = 0x1F,
SCR_OP_COMPARE_PTR_TO_PTR = 0x20,
SCR_OP_COMPARE_VAR_TO_VALUE = 0x21,
SCR_OP_COMPARE_VAR_TO_VAR = 0x22,
SCR_OP_CALLNATIVE = 0x23,
SCR_OP_GOTONATIVE = 0x24,
SCR_OP_SPECIAL = 0x25,
SCR_OP_SPECIALVAR = 0x26,
SCR_OP_WAITSTATE = 0x27,
SCR_OP_DELAY = 0x28,
SCR_OP_SETFLAG = 0x29,
SCR_OP_CLEARFLAG = 0x2A,
SCR_OP_CHECKFLAG = 0x2B,
SCR_OP_INITCLOCK = 0x2C,
SCR_OP_DOTIMEBASEDEVENTS = 0x2D,
SCR_OP_GETTIME = 0x2E,
SCR_OP_PLAYSE = 0x2F,
SCR_OP_WAITSE = 0x30,
SCR_OP_PLAYFANFARE = 0x31,
SCR_OP_WAITFANFARE = 0x32,
SCR_OP_PLAYBGM = 0x33,
SCR_OP_SAVEBGM = 0x34,
SCR_OP_FADEDEFAULTBGM = 0x35,
SCR_OP_FADENEWBGM = 0x36,
SCR_OP_FADEOUTBGM = 0x37,
SCR_OP_FADEINBGM = 0x38,
SCR_OP_WARP = 0x39,
SCR_OP_WARPSILENT = 0x3A,
SCR_OP_WARPDOOR = 0x3B,
SCR_OP_WARPHOLE = 0x3C,
SCR_OP_WARPTELEPORT = 0x3D,
SCR_OP_SETWARP = 0x3E,
SCR_OP_SETDYNAMICWARP = 0x3F,
SCR_OP_SETDIVEWARP = 0x40,
SCR_OP_SETHOLEWARP = 0x41,
SCR_OP_GETPLAYERXY = 0x42,
SCR_OP_GETPARTYSIZE = 0x43,
SCR_OP_ADDITEM = 0x44,
SCR_OP_REMOVEITEM = 0x45,
SCR_OP_CHECKITEMSPACE = 0x46,
SCR_OP_CHECKITEM = 0x47,
SCR_OP_CHECKITEMTYPE = 0x48,
SCR_OP_ADDPCITEM = 0x49,
SCR_OP_CHECKPCITEM = 0x4A,
SCR_OP_ADDDECORATION = 0x4B,
SCR_OP_REMOVEDECORATION = 0x4C,
SCR_OP_CHECKDECOR = 0x4D,
SCR_OP_CHECKDECORSPACE = 0x4E,
SCR_OP_APPLYMOVEMENT = 0x4F,
SCR_OP_APPLYMOVEMENTAT = 0x50,
SCR_OP_WAITMOVEMENT = 0x51,
SCR_OP_WAITMOVEMENTAT = 0x52,
SCR_OP_REMOVEOBJECT = 0x53,
SCR_OP_REMOVEOBJECTAT = 0x54,
SCR_OP_ADDOBJECT = 0x55,
SCR_OP_ADDOBJECTAT = 0x56,
SCR_OP_SETOBJECTXY = 0x57,
SCR_OP_SHOWOBJECTAT = 0x58,
SCR_OP_HIDEOBJECTAT = 0x59,
SCR_OP_FACEPLAYER = 0x5A,
SCR_OP_TURNOBJECT = 0x5B,
SCR_OP_TRAINERBATTLE = 0x5C,
SCR_OP_DOTRAINERBATTLE = 0x5D,
SCR_OP_GOTOPOSTBATTLESCRIPT = 0x5E,
SCR_OP_GOTOBEATENSCRIPT = 0x5F,
SCR_OP_CHECKTRAINERFLAG = 0x60,
SCR_OP_SETTRAINERFLAG = 0x61,
SCR_OP_CLEARTRAINERFLAG = 0x62,
SCR_OP_SETOBJECTXYPERM = 0x63,
SCR_OP_COPYOBJECTXYTOPERM = 0x64,
SCR_OP_SETOBJECTMOVEMENTTYPE = 0x65,
SCR_OP_WAITMESSAGE = 0x66,
SCR_OP_MESSAGE = 0x67,
SCR_OP_CLOSEMESSAGE = 0x68,
SCR_OP_LOCKALL = 0x69,
SCR_OP_LOCK = 0x6A,
SCR_OP_RELEASEALL = 0x6B,
SCR_OP_RELEASE = 0x6C,
SCR_OP_WAITBUTTONPRESS = 0x6D,
SCR_OP_YESNOBOX = 0x6E,
SCR_OP_MULTICHOICE = 0x6F,
SCR_OP_MULTICHOICEDEFAULT = 0x70,
SCR_OP_MULTICHOICEGRID = 0x71,
SCR_OP_DRAWBOX = 0x72,
SCR_OP_ERASEBOX = 0x73,
SCR_OP_DRAWBOXTEXT = 0x74,
SCR_OP_SHOWMONPIC = 0x75,
SCR_OP_HIDEMONPIC = 0x76,
SCR_OP_SHOWCONTESTPAINTING = 0x77,
SCR_OP_BRAILLEMESSAGE = 0x78,
SCR_OP_GIVEMON = 0x79,
SCR_OP_GIVEEGG = 0x7A,
SCR_OP_SETMONMOVE = 0x7B,
SCR_OP_CHECKFIELDMOVE = 0x7C,
SCR_OP_BUFFERSPECIESNAME = 0x7D,
SCR_OP_BUFFERLEADMONSPECIESNAME = 0x7E,
SCR_OP_BUFFERPARTYMONNICK = 0x7F,
SCR_OP_BUFFERITEMNAME = 0x80,
SCR_OP_BUFFERDECORATIONNAME = 0x81,
SCR_OP_BUFFERMOVENAME = 0x82,
SCR_OP_BUFFERNUMBERSTRING = 0x83,
SCR_OP_BUFFERSTDSTRING = 0x84,
SCR_OP_BUFFERSTRING = 0x85,
SCR_OP_POKEMART = 0x86,
SCR_OP_POKEMARTDECORATION = 0x87,
SCR_OP_POKEMARTDECORATION2 = 0x88,
SCR_OP_PLAYSLOTMACHINE = 0x89,
SCR_OP_SETBERRYTREE = 0x8A,
SCR_OP_CHOOSECONTESTMON = 0x8B,
SCR_OP_STARTCONTEST = 0x8C,
SCR_OP_SHOWCONTESTRESULTS = 0x8D,
SCR_OP_CONTESTLINKTRANSFER = 0x8E,
SCR_OP_RANDOM = 0x8F,
SCR_OP_ADDMONEY = 0x90,
SCR_OP_REMOVEMONEY = 0x91,
SCR_OP_CHECKMONEY = 0x92,
SCR_OP_SHOWMONEYBOX = 0x93,
SCR_OP_HIDEMONEYBOX = 0x94,
SCR_OP_UPDATEMONEYBOX = 0x95,
SCR_OP_GETPOKENEWSACTIVE = 0x96,
SCR_OP_FADESCREEN = 0x97,
SCR_OP_FADESCREENSPEED = 0x98,
SCR_OP_SETFLASHLEVEL = 0x99,
SCR_OP_ANIMATEFLASH = 0x9A,
SCR_OP_MESSAGEAUTOSCROLL = 0x9B,
SCR_OP_DOFIELDEFFECT = 0x9C,
SCR_OP_SETFIELDEFFECTARGUMENT = 0x9D,
SCR_OP_WAITFIELDEFFECT = 0x9E,
SCR_OP_SETRESPAWN = 0x9F,
SCR_OP_CHECKPLAYERGENDER = 0xA0,
SCR_OP_PLAYMONCRY = 0xA1,
SCR_OP_SETMETATILE = 0xA2,
SCR_OP_RESETWEATHER = 0xA3,
SCR_OP_SETWEATHER = 0xA4,
SCR_OP_DOWEATHER = 0xA5,
SCR_OP_SETSTEPCALLBACK = 0xA6,
SCR_OP_SETMAPLAYOUTINDEX = 0xA7,
SCR_OP_SETOBJECTSUBPRIORITY = 0xA8,
SCR_OP_RESETOBJECTSUBPRIORITY = 0xA9,
SCR_OP_CREATEVOBJECT = 0xAA,
SCR_OP_TURNVOBJECT = 0xAB,
SCR_OP_OPENDOOR = 0xAC,
SCR_OP_CLOSEDOOR = 0xAD,
SCR_OP_WAITDOORANIM = 0xAE,
SCR_OP_SETDOOROPEN = 0xAF,
SCR_OP_SETDOORCLOSED = 0xB0,
SCR_OP_ADDELEVMENUITEM = 0xB1,
SCR_OP_SHOWELEVMENU = 0xB2,
SCR_OP_CHECKCOINS = 0xB3,
SCR_OP_ADDCOINS = 0xB4,
SCR_OP_REMOVECOINS = 0xB5,
SCR_OP_SETWILDBATTLE = 0xB6,
SCR_OP_DOWILDBATTLE = 0xB7,
SCR_OP_SETVADDRESS = 0xB8,
SCR_OP_VGOTO = 0xB9,
SCR_OP_VCALL = 0xBA,
SCR_OP_VGOTO_IF = 0xBB,
SCR_OP_VCALL_IF = 0xBC,
SCR_OP_VMESSAGE = 0xBD,
SCR_OP_VBUFFERMESSAGE = 0xBE,
SCR_OP_VBUFFERSTRING = 0xBF,
SCR_OP_SHOWCOINSBOX = 0xC0,
SCR_OP_HIDECOINSBOX = 0xC1,
SCR_OP_UPDATECOINSBOX = 0xC2,
SCR_OP_INCREMENTGAMESTAT = 0xC3,
SCR_OP_SETESCAPEWARP = 0xC4,
SCR_OP_WAITMONCRY = 0xC5,
SCR_OP_BUFFERBOXNAME = 0xC6,
SCR_OP_TEXTCOLOR = 0xC7,
SCR_OP_LOADHELP = 0xC8,
SCR_OP_UNLOADHELP = 0xC9,
SCR_OP_SIGNMSG = 0xCA,
SCR_OP_NORMALMSG = 0xCB,
SCR_OP_COMPAREHIDDENVAR = 0xCC,
SCR_OP_SETMODERNFATEFULENCOUNTER = 0xCD,
SCR_OP_CHECKMODERNFATEFULENCOUNTER = 0xCE,
SCR_OP_TRYWONDERCARDSCRIPT = 0xCF,
SCR_OP_SETWORLDMAPFLAG = 0xD0,
SCR_OP_WARPSPINENTER = 0xD1,
SCR_OP_SETMONMETLOCATION = 0xD2,
SCR_OP_MOVEROTATINGTILEOBJECTS = 0xD3,
SCR_OP_TURNROTATINGTILEOBJECTS = 0xD4,
SCR_OP_INITROTATINGTILEPUZZLE = 0xD5,
SCR_OP_FREEROTATINGTILEPUZZLE = 0xD6,
SCR_OP_WARPMOSSDEEPGYM = 0xD7,
SCR_OP_SELECTAPPROACHINGTRAINER = 0xD8,
SCR_OP_LOCKFORTRAINER = 0xD9,
SCR_OP_CLOSEBRAILLEMESSAGE = 0xDA,
SCR_OP_MESSAGEINSTANT = 0xDB,
SCR_OP_FADESCREENSWAPBUFFERS = 0xDC,
SCR_OP_BUFFERTRAINERCLASSNAME = 0xDD,
SCR_OP_BUFFERTRAINERNAME = 0xDE,
SCR_OP_POKENAVCALL = 0xDF,
SCR_OP_WARPWHITEFADE = 0xE0,
SCR_OP_BUFFERCONTESTNAME = 0xE1,
SCR_OP_BUFFERITEMNAMEPLURAL = 0xE2,
SCR_OP_DYNMULTICHOICE = 0xE3,
SCR_OP_DYNMULTIPUSH = 0xE4,
SCR_OP_HIDEFOLLOWER = 0xE5,
};
#endif // GUARD_SCR_CMD_CONSTANTS_H

View File

@ -1,6 +1,6 @@
import re
SCR_CMD_PAT = re.compile(r"\tscript_cmd_table_entry (\w+)\s+\w+,\s+[\w=]+\s+@( 0x[0-9a-f]+)")
SCR_CMD_PAT = re.compile(r"^[ \t]*script_cmd_table_entry\s+(SCR_OP_\w+).*?ScrCmd_.*")
def main():
output = [
@ -9,14 +9,18 @@ def main():
"//",
"#ifndef GUARD_SCR_CMD_CONSTANTS_H",
"#define GUARD_SCR_CMD_CONSTANTS_H\n",
"enum ScrOp",
"{"
]
with open("data/script_cmd_table.inc", "r") as f:
ctr = 0
for line in f.readlines():
if match := re.match(SCR_CMD_PAT, line):
new_line = "#define " + match.group(1) + match.group(2)
if match := re.search(SCR_CMD_PAT, line):
new_line = " " + match.group(1) + f" = 0x{ctr:X},"
output.append(new_line)
ctr += 1
output.append("};")
output.append("\n#endif // GUARD_SCR_CMD_CONSTANTS_H\n")
with open("include/constants/script_commands.h", "w+") as f:
f.write('\n'.join(output))