diff --git a/asm/macros/event.inc b/asm/macros/event.inc index b91ac682107c..37264a8cb0e6 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -1,52 +1,54 @@ + .include "data/script_cmd_table.inc" + @ Does nothing. .macro nop - .byte 0x00 + .byte SCR_OP_NOP .endm @ Does nothing. .macro nop1 - .byte 0x01 + .byte SCR_OP_NOP1 .endm @ Terminates script execution. .macro end - .byte 0x02 + .byte SCR_OP_END .endm @ Jumps back to after the last-executed call statement, and continues script execution from there. .macro return - .byte 0x03 + .byte SCR_OP_RETURN .endm @ Jumps to destination and continues script execution from there. The location of the calling script is remembered and can be returned to later. .macro call destination:req - .byte 0x04 + .byte SCR_OP_CALL .4byte \destination .endm @ Jumps to destination and continues script execution from there. .macro goto destination:req - .byte 0x05 + .byte SCR_OP_GOTO .4byte \destination .endm @ If the result of the last comparison matches condition (see Comparison operators), jumps to destination and continues script execution from there. .macro goto_if condition:req, destination:req - .byte 0x06 + .byte SCR_OP_GOTO_IF .byte \condition .4byte \destination .endm @ If the result of the last comparison matches condition (see Comparison operators), calls destination. .macro call_if condition:req, destination:req - .byte 0x07 + .byte SCR_OP_CALL_IF .byte \condition .4byte \destination .endm @ Jumps to the script in gStdScripts at index function. .macro gotostd function:req - .byte 0x08 + .byte SCR_OP_GOTO_STD .byte \function .endm @@ -58,120 +60,120 @@ @ Calls the script in gStdScripts at index function. .macro callstd function:req - .byte 0x09 + .byte SCR_OP_CALL_STD .byte \function .endm @ If the result of the last comparison matches condition (see Comparison operators), jumps to the script in gStdScripts at index function. .macro gotostd_if condition:req, function:req - .byte 0x0a + .byte SCR_OP_GOTO_STD_IF .byte \condition .byte \function .endm @ If the result of the last comparison matches condition (see Comparison operators), calls the script in gStdScripts at index function. .macro callstd_if condition:req, function:req - .byte 0x0b + .byte SCR_OP_CALL_STD_IF .byte \condition .byte \function .endm @ Equivalent to the 'return' command for a RAM script. .macro returnram - .byte 0x0c + .byte SCR_OP_RETURNRAM .endm @ Equivalent to the 'end' command for a RAM script. .macro endram - .byte 0x0d + .byte SCR_OP_ENDRAM .endm @ Sets the Mystery Event script status (MEVENT_STATUS_*). .macro setmysteryeventstatus value:req - .byte 0x0e + .byte SCR_OP_SETMYSTERYEVENTSTATUS .byte \value .endm @ Sets the value at the specified script data index to a fixed 4-byte value. .macro loadword destIndex:req, value:req - .byte 0x0f + .byte SCR_OP_LOAD_WORD .byte \destIndex .4byte \value .endm @ Sets the value at the specified script data index to a fixed byte value. .macro loadbyte destIndex:req, value:req - .byte 0x10 + .byte SCR_OP_LOAD_BYTE .byte \destIndex .byte \value .endm @ Sets the value at the specified pointer. .macro setptr value:req, ptr:req - .byte 0x11 + .byte SCR_OP_SETPTR .byte \value .4byte \ptr .endm @ Sets the value at the specified script data index to the value at pointer 'source'. .macro loadbytefromptr destIndex:req, source:req - .byte 0x12 + .byte SCR_OP_LOADBYTEFROMPTR .byte \destIndex .4byte \source .endm @ Sets the value at pointer 'destination' to the contents of the script data at 'srcIndex'. .macro setptrbyte srcIndex:req, destination:req - .byte 0x13 + .byte SCR_OP_SETPTRBYTE .byte \srcIndex .4byte \destination .endm @ Copies the contents of the script data from one index to another. .macro copylocal destIndex:req, srcIndex:req - .byte 0x14 + .byte SCR_OP_COPYLOCAL .byte \destIndex .byte \srcIndex .endm @ Copies the byte at source to destination, replacing whatever byte was previously there. .macro copybyte destination:req, source:req - .byte 0x15 + .byte SCR_OP_COPYBYTE .4byte \destination .4byte \source .endm @ Changes the value of destination to value. .macro setvar destination:req, value:req - .byte 0x16 + .byte SCR_OP_SETVAR .2byte \destination .2byte \value .endm @ Changes the value of destination by adding value to it. Overflow is not prevented (0xFFFF + 1 = 0x0000). .macro addvar destination:req, value:req - .byte 0x17 + .byte SCR_OP_ADDVAR .2byte \destination .2byte \value .endm @ Changes the value of destination by subtracting value to it. Overflow is not prevented (0x0000 - 1 = 0xFFFF). .macro subvar destination:req, value:req - .byte 0x18 + .byte SCR_OP_SUBVAR .2byte \destination .2byte \value .endm @ Copies the value of source into destination. .macro copyvar destination:req, source:req - .byte 0x19 + .byte SCR_OP_COPYVAR .2byte \destination .2byte \source .endm @ If source is not a variable, then this function acts like setvar. Otherwise, it acts like copyvar. .macro setorcopyvar destination:req, source:req - .byte 0x1a + .byte SCR_OP_SETORCOPYVAR .2byte \destination .2byte \source .endm @@ -179,7 +181,7 @@ @ Compares the values of the script data at indexes 'local1' and 'local2'. @ The result is stored in comparisonResult to be acted on by goto_if / call_if .macro compare_local_to_local local1:req, local2:req - .byte 0x1b + .byte SCR_OP_COMPARE_LOCAL_TO_LOCAL .byte \local1 .byte \local2 .endm @@ -187,7 +189,7 @@ @ Compares the value of the script data at index 'local' to a fixed value. @ The result is stored in comparisonResult to be acted on by goto_if / call_if .macro compare_local_to_value local:req, value:req - .byte 0x1c + .byte SCR_OP_COMPARE_LOCAL_TO_VALUE .byte \local .byte \value .endm @@ -195,7 +197,7 @@ @ Compares the value of the script data at index 'local' to the value at 'ptr' @ The result is stored in comparisonResult to be acted on by goto_if / call_if .macro compare_local_to_ptr local:req, ptr:req - .byte 0x1d + .byte SCR_OP_COMPARE_LOCAL_TO_PTR .byte \local .4byte \ptr .endm @@ -203,7 +205,7 @@ @ Compares the value at 'ptr' to the value of the script data at index 'local'. @ The result is stored in comparisonResult to be acted on by goto_if / call_if .macro compare_ptr_to_local ptr:req, local:req - .byte 0x1e + .byte SCR_OP_COMPARE_PTR_TO_LOCAL .4byte \ptr .byte \local .endm @@ -211,7 +213,7 @@ @ Compares the value at 'ptr' to a fixed value. @ The result is stored in comparisonResult to be acted on by goto_if / call_if .macro compare_ptr_to_value ptr:req, value:req - .byte 0x1f + .byte SCR_OP_COMPARE_PTR_TO_VALUE .4byte \ptr .byte \value .endm @@ -219,7 +221,7 @@ @ Compares the value at 'ptr1' to the value at 'ptr2'. @ The result is stored in comparisonResult to be acted on by goto_if / call_if .macro compare_ptr_to_ptr ptr1:req, ptr2:req - .byte 0x20 + .byte SCR_OP_COMPARE_PTR_TO_PTR .4byte \ptr1 .4byte \ptr2 .endm @@ -227,7 +229,7 @@ @ Compares the value of 'var' to a fixed value. @ The result is stored in comparisonResult to be acted on by goto_if / call_if .macro compare_var_to_value var:req, value:req - .byte 0x21 + .byte SCR_OP_COMPARE_VAR_TO_VALUE .2byte \var .2byte \value .endm @@ -235,7 +237,7 @@ @ Compares the value of 'var1' to the value of 'var2'. @ The result is stored in comparisonResult to be acted on by goto_if / call_if .macro compare_var_to_var var1:req, var2:req - .byte 0x22 + .byte SCR_OP_COMPARE_VAR_TO_VAR .2byte \var1 .2byte \var2 .endm @@ -252,26 +254,26 @@ @ Calls the native C function stored at func. .macro callnative func:req - .byte 0x23 + .byte SCR_OP_CALLNATIVE .4byte \func .endm @ Replaces the script with the function stored at func. Execution returns to the bytecode script when func returns TRUE. .macro gotonative func:req - .byte 0x24 + .byte SCR_OP_GOTONATIVE .4byte \func .endm @ Calls a function listed in the table in data/specials.inc. .macro special function:req - .byte 0x25 + .byte SCR_OP_SPECIAL .2byte SPECIAL_\function .endm @ Calls a function listed in the table in data/specials.inc. @ That function's output (if any) will be written to the variable specified by 'output'. .macro specialvar output:req, function:req - .byte 0x26 + .byte SCR_OP_SPECIALVAR .2byte \output .2byte SPECIAL_\function .endm @@ -279,77 +281,77 @@ @ Blocks script execution until a command or C code manually unblocks it. Generally used with specific @ commands and specials. Calling ScriptContext_Enable for instance will allow execution to continue. .macro waitstate - .byte 0x27 + .byte SCR_OP_WAITSTATE .endm @ Blocks script execution for frames. (Pokemon Emerald runs at just shy of 60 frames per second.) .macro delay frames:req - .byte 0x28 + .byte SCR_OP_DELAY .2byte \frames .endm @ Sets flag to TRUE. .macro setflag flag:req - .byte 0x29 + .byte SCR_OP_SETFLAG .2byte \flag .endm @ Sets flag to FALSE. .macro clearflag flag:req - .byte 0x2a + .byte SCR_OP_CLEARFLAG .2byte \flag .endm @ Compares flag to TRUE and stores the result in comparisonResult to be used by goto_if, etc @ See additional _if_unset and _if_set macros .macro checkflag flag:req - .byte 0x2b + .byte SCR_OP_CHECKFLAG .2byte \flag .endm @ Initializes the RTC`s local time offset to the given hour and minute. .macro initclock hour:req, minute:req - .byte 0x2c + .byte SCR_OP_INITCLOCK .2byte \hour .2byte \minute .endm @ Updates local time using the RTC and runs time based events. .macro dotimebasedevents - .byte 0x2d + .byte SCR_OP_DOTIMEBASEDEVENTS .endm @ Sets the values of variables VAR_0x8000, VAR_0x8001, and VAR_0x8002 to the current hour, minute, and second. .macro gettime - .byte 0x2e + .byte SCR_OP_GETTIME .endm @ Plays the specified sound. Only one sound may play at a time, with newer ones interrupting older ones. .macro playse song:req - .byte 0x2f + .byte SCR_OP_PLAYSE .2byte \song .endm @ Blocks script execution until the currently-playing sound (triggered by playse) finishes playing. .macro waitse - .byte 0x30 + .byte SCR_OP_WAITSE .endm @ Plays the fanfare specified by the song number. If the specified song is not a fanfare it will instead play the first song in sFanfares. .macro playfanfare song:req - .byte 0x31 + .byte SCR_OP_PLAYFANFARE .2byte \song .endm @ Blocks script execution until all currently-playing fanfares finish. .macro waitfanfare - .byte 0x32 + .byte SCR_OP_WAITFANFARE .endm @ Plays the specified song. If save_song is TRUE, the @ specified song will be saved as if savebgm was called with it. .macro playbgm song:req, save_song:req - .byte 0x33 + .byte SCR_OP_PLAYBGM .2byte \song .byte \save_song .endm @@ -357,30 +359,30 @@ @ Saves the specified song to be played later. Saved music may be played when Overworld_PlaySpecialMapMusic is called. This occurs on @ exiting most warps. .macro savebgm song:req - .byte 0x34 + .byte SCR_OP_SAVEBGM .2byte \song .endm @ Crossfades the currently-playing song into the map's default song. .macro fadedefaultbgm - .byte 0x35 + .byte SCR_OP_FADEDEFAULTBGM .endm @ Crossfades the currently-playing song into the specified song. .macro fadenewbgm song:req - .byte 0x36 + .byte SCR_OP_FADENEWBGM .2byte \song .endm @ Fades out the currently-playing song. .macro fadeoutbgm speed:req - .byte 0x37 + .byte SCR_OP_FADEOUTBGM .byte \speed .endm @ Fades the previously-playing song back in. .macro fadeinbgm speed:req - .byte 0x38 + .byte SCR_OP_FADEINBGM .byte \speed .endm @@ -424,7 +426,7 @@ @ Warp commands can be given either the id of which warp location to go to on the destination map @ or a pair of x/y coordinates to go to directly on the destination map. .macro warp map:req, a, b, c - .byte 0x39 + .byte SCR_OP_WARP formatwarp \map, \a, \b, \c .endm @@ -432,7 +434,7 @@ @ Warp commands can be given either the id of which warp location to go to on the destination map @ or a pair of x/y coordinates to go to directly on the destination map. .macro warpsilent map:req, a, b, c - .byte 0x3a + .byte SCR_OP_WARPSILENT formatwarp \map, \a, \b, \c .endm @@ -440,7 +442,7 @@ @ Warp commands can be given either the id of which warp location to go to on the destination map @ or a pair of x/y coordinates to go to directly on the destination map. .macro warpdoor map:req, a, b, c - .byte 0x3b + .byte SCR_OP_WARPDOOR formatwarp \map, \a, \b, \c .endm @@ -448,7 +450,7 @@ @ use the map set by setholewarp. In either case the target coordinates on the destination map will be the @ player's current position. .macro warphole map:req - .byte 0x3c + .byte SCR_OP_WARPHOLE map \map .endm @@ -457,7 +459,7 @@ @ Warp commands can be given either the id of which warp location to go to on the destination map @ or a pair of x/y coordinates to go to directly on the destination map. .macro warpteleport map:req, a, b, c - .byte 0x3d + .byte SCR_OP_WARPTELEPORT formatwarp \map, \a, \b, \c .endm @@ -465,7 +467,7 @@ @ Warp commands can be given either the id of which warp location to go to on the destination map @ or a pair of x/y coordinates to go to directly on the destination map. .macro setwarp map:req, a, b, c - .byte 0x3e + .byte SCR_OP_SETWARP formatwarp \map, \a, \b, \c .endm @@ -473,7 +475,7 @@ @ Warp commands can be given either the id of which warp location to go to on the destination map @ or a pair of x/y coordinates to go to directly on the destination map. .macro setdynamicwarp map:req, a, b, c - .byte 0x3f + .byte SCR_OP_SETDYNAMICWARP formatwarp \map, \a, \b, \c .endm @@ -483,7 +485,7 @@ @ Warp commands can be given either the id of which warp location to go to on the destination map @ or a pair of x/y coordinates to go to directly on the destination map. .macro setdivewarp map:req, a, b, c - .byte 0x40 + .byte SCR_OP_SETDIVEWARP formatwarp \map, \a, \b, \c .endm @@ -494,26 +496,26 @@ @ Warp commands can be given either the id of which warp location to go to on the destination map @ or a pair of x/y coordinates to go to directly on the destination map. .macro setholewarp map:req, a=0, b=0, c - .byte 0x41 + .byte SCR_OP_SETHOLEWARP formatwarp \map, \a, \b, \c .endm @ Retrieves the player's zero-indexed x- and y-coordinates in the map, and stores them in the specified variables. .macro getplayerxy x:req, y:req - .byte 0x42 + .byte SCR_OP_GETPLAYERXY .2byte \x .2byte \y .endm @ Retrieves the number of Pokemon in the player's party, and stores that number in VAR_RESULT. .macro getpartysize - .byte 0x43 + .byte SCR_OP_GETPARTYSIZE .endm @ Attempts to add quantity of the specified item to the player's Bag. If the player has enough room, the item will @ be added and VAR_RESULT will be set to TRUE; otherwise, VAR_RESULT is set to FALSE. .macro additem itemId:req, quantity=1 - .byte 0x44 + .byte SCR_OP_ADDITEM .2byte \itemId .2byte \quantity .endm @@ -521,7 +523,7 @@ @ Removes quantity of the specified item from the player's Bag. If the player has fewer than 'quantity' in their bag @ then none will be removed and VAR_RESULT will be set to FALSE. Otherwise it will be set to TRUE. .macro removeitem itemId:req, quantity=1 - .byte 0x45 + .byte SCR_OP_REMOVEITEM .2byte \itemId .2byte \quantity .endm @@ -529,7 +531,7 @@ @ Checks if the player has enough space in their Bag to hold quantity more of the specified item. Sets VAR_RESULT to @ TRUE if there is room, or FALSE is there is no room. .macro checkitemspace itemId:req, quantity=1 - .byte 0x46 + .byte SCR_OP_CHECKITEMSPACE .2byte \itemId .2byte \quantity .endm @@ -537,7 +539,7 @@ @ Checks if the player has quantity or more of the specified item in their Bag. Sets VAR_RESULT to TRUE if the player has @ enough of the item, or FALSE if they have fewer than quantity of the item. .macro checkitem itemId:req, quantity=1 - .byte 0x47 + .byte SCR_OP_CHECKITEM .2byte \itemId .2byte \quantity .endm @@ -545,58 +547,58 @@ @ Checks which Bag pocket the specified item belongs in, and writes the pocket value (POCKET_*) to VAR_RESULT. @ This is used to show the name of the proper Bag pocket when the player receives an item via callstd. .macro checkitemtype itemId:req - .byte 0x48 + .byte SCR_OP_CHECKITEMTYPE .2byte \itemId .endm @ Adds quantity of the specified item to the player's PC. .macro addpcitem itemId:req, quantity=1 - .byte 0x49 + .byte SCR_OP_ADDPCITEM .2byte \itemId .2byte \quantity .endm @ Checks for quantity of the specified item in the player's PC. .macro checkpcitem itemId:req, quantity=1 - .byte 0x4a + .byte SCR_OP_CHECKPCITEM .2byte \itemId .2byte \quantity .endm @ Adds a decoration to the player's PC. .macro adddecoration decoration:req - .byte 0x4b + .byte SCR_OP_ADDDECORATION .2byte \decoration .endm @ Removes a decoration from the player's PC. .macro removedecoration decoration:req - .byte 0x4c + .byte SCR_OP_REMOVEDECORATION .2byte \decoration .endm @ Checks for decoration in the player's PC. .macro checkdecor decoration:req - .byte 0x4d + .byte SCR_OP_CHECKDECOR .2byte \decoration .endm @ Checks if the player has enough space in their PC to hold the decoration. @ Sets VAR_RESULT to TRUE if there is room, or FALSE is there is no room. .macro checkdecorspace decoration:req - .byte 0x4e + .byte SCR_OP_CHECKDECORSPACE .2byte \decoration .endm @ Applies the movement data at movements to the specified (localId) object. If no map is specified, then the current map is used. .macro applymovement localId:req, movements:req, map .ifb \map - .byte 0x4f + .byte SCR_OP_APPLYMOVEMENT .2byte \localId .4byte \movements .else @ Really only useful if the object has followed from one map to another (e.g. Wally during the catching event). - .byte 0x50 + .byte SCR_OP_APPLYMOVEMENTAT .2byte \localId .4byte \movements map \map @@ -609,10 +611,10 @@ @ If no map is specified, then the current map is used. .macro waitmovement localId:req, map .ifb \map - .byte 0x51 + .byte SCR_OP_WAITMOVEMENT .2byte \localId .else - .byte 0x52 + .byte SCR_OP_WAITMOVEMENTAT .2byte \localId map \map .endif @@ -623,10 +625,10 @@ @ If no map is specified, then the current map is used. .macro removeobject localId:req, map .ifb \map - .byte 0x53 + .byte SCR_OP_REMOVEOBJECT .2byte \localId .else - .byte 0x54 + .byte SCR_OP_REMOVEOBJECTAT .2byte \localId map \map .endif @@ -637,10 +639,10 @@ @ If no map is specified, then the current map is used. .macro addobject localId:req, map .ifb \map - .byte 0x55 + .byte SCR_OP_ADDOBJECT .2byte \localId .else - .byte 0x56 + .byte SCR_OP_ADDOBJECTAT .2byte \localId map \map .endif @@ -648,7 +650,7 @@ @ Sets the specified (localId) object's position on the current map. .macro setobjectxy localId:req, x:req, y:req - .byte 0x57 + .byte SCR_OP_SETOBJECTXY .2byte \localId .2byte \x .2byte \y @@ -656,33 +658,33 @@ @ Sets the specified object's invisibility to FALSE. .macro showobjectat localId:req, map:req - .byte 0x58 + .byte SCR_OP_SHOWOBJECTAT .2byte \localId map \map .endm @ Sets the specified object's invisibility to TRUE. .macro hideobjectat localId:req, map:req - .byte 0x59 + .byte SCR_OP_HIDEOBJECTAT .2byte \localId map \map .endm @ Turns the currently selected object (if there is one) to face the player. .macro faceplayer - .byte 0x5a + .byte SCR_OP_FACEPLAYER .endm @ Turns the specified object in the specified direction. .macro turnobject localId:req, direction:req - .byte 0x5b + .byte SCR_OP_TURNOBJECT .2byte \localId .byte \direction .endm @ Configures the arguments for a trainer battle, then jumps to the appropriate script in scripts/trainer_battle.inc .macro trainerbattle type:req, trainer:req, local_id:req, pointer1:req, pointer2, pointer3, pointer4 - .byte 0x5c + .byte SCR_OP_TRAINERBATTLE .byte \type .2byte \trainer .2byte \local_id @@ -780,41 +782,41 @@ @ Starts a trainer battle using the battle information stored in RAM (usually by the scripts in trainer_battle.inc, which @ are run by trainerbattle), and blocks script execution until the battle finishes. .macro dotrainerbattle - .byte 0x5d + .byte SCR_OP_DOTRAINERBATTLE .endm @ Goes to address after the trainerbattle command (called by the battle functions, see battle_setup.c) .macro gotopostbattlescript - .byte 0x5e + .byte SCR_OP_GOTOPOSTBATTLESCRIPT .endm @ Goes to address specified in the trainerbattle command (called by the battle functions, see battle_setup.c) .macro gotobeatenscript - .byte 0x5f + .byte SCR_OP_GOTOBEATENSCRIPT .endm @ Checks if the trainer has been defeated by the player (by comparing the flag 'trainer + TRAINER_FLAGS_START' to TRUE). .macro checktrainerflag trainer:req - .byte 0x60 + .byte SCR_OP_CHECKTRAINERFLAG .2byte \trainer .endm @ Sets the trainer flag (trainer + TRAINER_FLAGS_START) to TRUE (defeated). .macro settrainerflag trainer:req - .byte 0x61 + .byte SCR_OP_SETTRAINERFLAG .2byte \trainer .endm @ Sets the trainer flag (trainer + TRAINER_FLAGS_START) to FALSE (not defeated). .macro cleartrainerflag trainer:req - .byte 0x62 + .byte SCR_OP_CLEARTRAINERFLAG .2byte \trainer .endm @ Sets the coordinates of an object's template, so that if the sprite goes off screen @ it'll still be there when it comes back on screen. .macro setobjectxyperm localId:req, x:req, y:req - .byte 0x63 + .byte SCR_OP_SETOBJECTXYPERM .2byte \localId .2byte \x .2byte \y @@ -823,13 +825,13 @@ @ Copies a live object event's xy position to its template, so that if the sprite goes off screen @ it'll still be there when it comes back on screen. .macro copyobjectxytoperm localId:req - .byte 0x64 + .byte SCR_OP_COPYOBJECTXYTOPERM .2byte \localId .endm @ Sets the movement type (MOVEMENT_TYPE_*) for an object's template. .macro setobjectmovementtype localId:req, movementType:req - .byte 0x65 + .byte SCR_OP_SETOBJECTMOVEMENTTYPE .2byte \localId .byte \movementType .endm @@ -837,51 +839,51 @@ @ If a standard message box (or its text) is being drawn on-screen, this command blocks script execution until the @ box and its text have been fully drawn. .macro waitmessage - .byte 0x66 + .byte SCR_OP_WAITMESSAGE .endm @ Starts displaying a standard message box containing the specified text. If text is a pointer, then the string at @ that offset will be loaded and used. If text is NULL, then the value of script data 0 will be treated as @ a pointer to the text. The 'loadword 0' in msgbox sets this value, for instance. .macro message text:req - .byte 0x67 + .byte SCR_OP_MESSAGE .4byte \text .endm @ Closes the current message box. .macro closemessage - .byte 0x68 + .byte SCR_OP_CLOSEMESSAGE .endm @ Freezes all objects immediately except the player. The player is frozen once their movement is finished. .macro lockall - .byte 0x69 + .byte SCR_OP_LOCKALL .endm @ Freezes all objects immediately except the player and the selected object. The player and selected object are frozen once their movement is finished. .macro lock - .byte 0x6a + .byte SCR_OP_LOCK .endm @ Resumes normal movement for all objects on-screen, and closes any standard message boxes that are still open. .macro releaseall - .byte 0x6b + .byte SCR_OP_RELEASEALL .endm @ Resumes normal movement for the selected object (if there is one) and the player. Also closes any standard message boxes that are still open. .macro release - .byte 0x6c + .byte SCR_OP_RELEASE .endm @ Blocks script execution until the player presses the A or B button. .macro waitbuttonpress - .byte 0x6d + .byte SCR_OP_WAITBUTTONPRESS .endm @ Displays a YES/NO multichoice box at the specified coordinates, and blocks script execution until the user makes a selection. @ Their selection is stored in VAR_RESULT as NO (0) or YES (1). Pressing B is equivalent to answering NO .macro yesnobox x:req, y:req - .byte 0x6e + .byte SCR_OP_YESNOBOX .byte \x .byte \y .endm @@ -890,7 +892,7 @@ @ Lists of options are predefined (sMultichoiceLists) and the one to be used is specified with multichoiceId. @ If ignoreBPress is set to a non-zero value, then the user will not be allowed to back out of the multichoice with the B button. .macro multichoice x:req, y:req, multichoiceId:req, ignoreBPress:req - .byte 0x6f + .byte SCR_OP_MULTICHOICE .byte \x .byte \y .byte \multichoiceId @@ -902,7 +904,7 @@ @ The default argument determines the initial position of the cursor when the box is first opened; it is zero-indexed, and if it is too large, it is treated as 0. @ If ignoreBPress is set to a non-zero value, then the user will not be allowed to back out of the multichoice with the B button. .macro multichoicedefault x:req, y:req, multichoiceId:req, default:req, ignoreBPress:req - .byte 0x70 + .byte SCR_OP_MULTICHOICEDEFAULT .byte \x .byte \y .byte \multichoiceId @@ -915,7 +917,7 @@ @ The per_row argument determines how many list items will be shown on a single row of the box. @ If ignoreBPress is set to a non-zero value, then the user will not be allowed to back out of the multichoice with the B button. .macro multichoicegrid x:req, y:req, multichoiceId:req, per_row:req, ignoreBPress:req - .byte 0x71 + .byte SCR_OP_MULTICHOICEGRID .byte \x .byte \y .byte \multichoiceId @@ -925,12 +927,12 @@ @ Nopped in Emerald. .macro drawbox - .byte 0x72 + .byte SCR_OP_DRAWBOX .endm @ Nopped in Emerald, but still consumes parameters. .macro erasebox left:req, top:req, right:req, bottom:req - .byte 0x73 + .byte SCR_OP_ERASEBOX .byte \left .byte \top .byte \right @@ -939,7 +941,7 @@ @ Nopped in Emerald, but still consumes parameters. .macro drawboxtext left:req, top:req, multichoiceId:req, ignoreBPress:req - .byte 0x74 + .byte SCR_OP_DRAWBOXTEXT .byte \left .byte \top .byte \multichoiceId @@ -948,7 +950,7 @@ @ Displays a box containing the front sprite for the specified Pokemon species. .macro showmonpic species:req, x:req, y:req - .byte 0x75 + .byte SCR_OP_SHOWMONPIC .2byte \species .byte \x .byte \y @@ -956,12 +958,12 @@ @ Hides the box displayed by showmonpic. .macro hidemonpic - .byte 0x76 + .byte SCR_OP_HIDEMONPIC .endm @ Draws an image of the winner of the contest. winnerId is any CONTEST_WINNER_* constant. .macro showcontestpainting winnerId:req - .byte 0x77 + .byte SCR_OP_SHOWCONTESTPAINTING .byte \winnerId .endm @@ -969,7 +971,7 @@ @ to convert text to braille, and be preceded by brailleformat. The brailleformat data is skipped over (in RS, these @ bytes determined the box's size and position, but in Emerald these are calculated automatically). .macro braillemessage text:req - .byte 0x78 + .byte SCR_OP_BRAILLEMESSAGE .4byte \text .endm @@ -987,7 +989,7 @@ @ Gives the player a Pokémon of the specified species and level, holding the specified item. The trailing 0s are unused parameters. @ VAR_RESULT will be set to MON_GIVEN_TO_PARTY, MON_GIVEN_TO_PC, or MON_CANT_GIVE depending on the outcome. .macro givemon species:req, level:req, item=ITEM_NONE - .byte 0x79 + .byte SCR_OP_GIVEMON .2byte \species .byte \level .2byte \item @@ -999,7 +1001,7 @@ @ Gives the player an Egg of the specified species. @ VAR_RESULT will be set to MON_GIVEN_TO_PARTY, MON_GIVEN_TO_PC, or MON_CANT_GIVE depending on the outcome. .macro giveegg species:req - .byte 0x7a + .byte SCR_OP_GIVEEGG .2byte \species .endm @@ -1007,7 +1009,7 @@ @ If a value greater than PARTY_SIZE is given for partyIndex it will use the last Pokémon in the party instead. @ Note that this means in vanilla a value equal to PARTY_SIZE for partyIndex will go out of bounds. .macro setmonmove partyIndex:req, slot:req, move:req - .byte 0x7b + .byte SCR_OP_SETMONMOVE .byte \partyIndex .byte \slot .2byte \move @@ -1017,7 +1019,7 @@ @ (zero-indexed) slot number of the first Pokemon that knows the move. If not, VAR_RESULT is set to PARTY_SIZE. @ VAR_0x8004 is also set to this Pokemon's species. .macro checkpartymove move:req - .byte 0x7c + .byte SCR_OP_CHECKPARTYMOVE .2byte \move .endm @@ -1039,21 +1041,21 @@ @ Writes the name of the given Pokemon species to the specified buffer. .macro bufferspeciesname stringVarId:req, species:req - .byte 0x7d + .byte SCR_OP_BUFFERSPECIESNAME stringvar \stringVarId .2byte \species .endm @ Writes the name of the species of the first Pokemon in the player's party to the specified buffer. .macro bufferleadmonspeciesname stringVarId:req - .byte 0x7e + .byte SCR_OP_BUFFERLEADMONSPECIESNAME stringvar \stringVarId .endm @ Writes the nickname of the Pokemon in 'slot' (zero-indexed) of the player's party to the specified buffer. @ If an empty or invalid slot is specified, ten spaces ("") are written to the buffer. .macro bufferpartymonnick stringVarId:req, slot:req - .byte 0x7f + .byte SCR_OP_BUFFERPARTYMONNICK stringvar \stringVarId .2byte \slot .endm @@ -1061,42 +1063,42 @@ @ Writes the name of the specified item to the specified buffer. If itemId is >= ITEMS_COUNT, @ then the name of ITEM_NONE ("????????") is buffered instead. .macro bufferitemname stringVarId:req, item:req - .byte 0x80 + .byte SCR_OP_BUFFERITEMNAME stringvar \stringVarId .2byte \item .endm @ Writes the name of the specified decoration to the specified buffer. .macro bufferdecorationname stringVarId:req, decoration:req - .byte 0x81 + .byte SCR_OP_BUFFERDECORATIONNAME stringvar \stringVarId .2byte \decoration .endm @ Writes the name of the specified move to the specified buffer. .macro buffermovename stringVarId:req, move:req - .byte 0x82 + .byte SCR_OP_BUFFERMOVENAME stringvar \stringVarId .2byte \move .endm @ Converts the value of input to a decimal string, and writes that string to the specified buffer. .macro buffernumberstring stringVarId:req, input:req - .byte 0x83 + .byte SCR_OP_BUFFERNUMBERSTRING stringvar \stringVarId .2byte \input .endm @ Writes the given standard string (STDSTRING_*) to the specified buffer. Invalid std string ids are not handled. .macro bufferstdstring stringVarId:req, index:req - .byte 0x84 + .byte SCR_OP_BUFFERSTDSTRING stringvar \stringVarId .2byte \index .endm @ Copies the string at the given pointer to the specified buffer. .macro bufferstring stringVarId:req, text:req - .byte 0x85 + .byte SCR_OP_BUFFERSTRING stringvar \stringVarId .4byte \text .endm @@ -1104,33 +1106,33 @@ @ Opens the Pokemart system, offering the specified products for sale. @ Products should be a list of .2byte item values preceded by an .align 2 .macro pokemart products:req - .byte 0x86 + .byte SCR_OP_POKEMART .4byte \products .endm @ Opens the Pokemart system and treats the list of items as decorations. @ Products should be a list of .2byte decoration values preceded by an .align 2 .macro pokemartdecoration products:req - .byte 0x87 + .byte SCR_OP_POKEMARTDECORATION .4byte \products .endm @ Identical to pokemartdecoration, but with slight changes to the clerk dialogue. See uses of MART_TYPE_DECOR2. .macro pokemartdecoration2 products:req - .byte 0x88 + .byte SCR_OP_POKEMARTDECORATION2 .4byte \products .endm @ Starts up the slot machine minigame. id is a SLOT_MACHINE_* value that influences probabilities of certain reel outcomes. .macro playslotmachine id:req - .byte 0x89 + .byte SCR_OP_PLAYSLOTMACHINE .2byte \id .endm @ Sets a berry tree's berry and growth stage. treeId is any BERRY_TREE_* constant (an index into berryTrees in SaveBlock1), @ berry is any ITEM_TO_BERRY(ITEM_BERRY_NAME) value, and growthStage is any BERRY_STAGE_* constant. .macro setberrytree treeId:req, berry:req, growthStage:req - .byte 0x8a + .byte SCR_OP_SETBERRYTREE .byte \treeId .byte \berry .byte \growthStage @@ -1138,34 +1140,34 @@ @ Opens the party menu to select a Pokemon for a contest. .macro choosecontestmon - .byte 0x8b + .byte SCR_OP_CHOOSECONTESTMON .endm @ Starts the appeals round of a contest. .macro startcontest - .byte 0x8c + .byte SCR_OP_STARTCONTEST .endm @ Shows the results screen of a contest. .macro showcontestresults - .byte 0x8d + .byte SCR_OP_SHOWCONTESTRESULTS .endm @ Starts communication to initialize a link contest. .macro contestlinktransfer - .byte 0x8e + .byte SCR_OP_CONTESTLINKTRANSFER .endm @ Stores a random integer between 0 and limit (exclusive of limit) in VAR_RESULT. .macro random limit:req - .byte 0x8f + .byte SCR_OP_RANDOM .2byte \limit .endm @ Adds value to the player's money. If adding 'value' money would exceed MAX_MONEY, the player's money is set to MAX_MONEY. @ If 'disable' is set to anything but 0 then this command does nothing. .macro addmoney value:req, disable=0 - .byte 0x90 + .byte SCR_OP_ADDMONEY .4byte \value .byte \disable .endm @@ -1173,7 +1175,7 @@ @ Subtracts value from the player's money. If the player has less than 'value' money, their money is set to 0. @ If 'disable' is set to anything but 0 then this command does nothing. .macro removemoney value:req, disable=0 - .byte 0x91 + .byte SCR_OP_REMOVEMONEY .4byte \value .byte \disable .endm @@ -1181,7 +1183,7 @@ @ Checks if the player has money >= value. VAR_RESULT is set to TRUE if the player has enough money, or FALSE if they do not. @ If 'disable' is set to anything but 0 then this command does nothing. .macro checkmoney value:req, disable=0 - .byte 0x92 + .byte SCR_OP_CHECKMONEY .4byte \value .byte \disable .endm @@ -1189,7 +1191,7 @@ @ Creates a window showing how much money the player has. @ If 'disable' is set to anything but 0 then this command does nothing. .macro showmoneybox x:req, y:req, disable=0 - .byte 0x93 + .byte SCR_OP_SHOWMONEYBOX .byte \x .byte \y .byte \disable @@ -1197,7 +1199,7 @@ @ Destroys the window created by showmoneybox. Consumption of the x and y arguments was dummied out. .macro hidemoneybox - .byte 0x94 + .byte SCR_OP_HIDEMONEYBOX .byte 0 @ \x .byte 0 @ \y .endm @@ -1205,7 +1207,7 @@ @ Updates the window created by showmoneybox. Consumption of the x and y arguments was dummied out. @ If 'disable' is set to anything but 0 then this command does nothing. .macro updatemoneybox disable=0 - .byte 0x95 + .byte SCR_OP_UPDATEMONEYBOX .byte 0 @ \x .byte 0 @ \y .byte \disable @@ -1213,19 +1215,19 @@ @ Gets whether the effects of the specified PokeNews program are active. newsKind is a POKENEWS_* constant. .macro getpokenewsactive newsKind:req - .byte 0x96 + .byte SCR_OP_GETPOKENEWSACTIVE .2byte \newsKind .endm @ Fades the screen to and from black and white. Modes are FADE_(TO/FROM)_(WHITE/BLACK) .macro fadescreen mode:req - .byte 0x97 + .byte SCR_OP_FADESCREEN .byte \mode .endm @ Fades the screen to and from black and white. Modes are FADE_(TO/FROM)_(WHITE/BLACK) .macro fadescreenspeed mode:req, speed:req - .byte 0x98 + .byte SCR_OP_FADESCREENSPEED .byte \mode .byte \speed .endm @@ -1233,64 +1235,64 @@ @ Sets the flash level. A level of 0 is fully bright, a level of 1 is the largest flash radius, a level @ of 7 is the smallest flash radius, a level of 8 is fully black. .macro setflashlevel level:req - .byte 0x99 + .byte SCR_OP_SETFLASHLEVEL .2byte \level .endm @ Animates the flash radius from its current size to the size it would be at the specified level. @ Note that this does not actually change the current flash level. It's typically used just before a setflashlevel. .macro animateflash level:req - .byte 0x9a + .byte SCR_OP_ANIMATEFLASH .byte \level .endm @ Automatically scrolls through the message without player input and at a fixed speed. .macro messageautoscroll text:req - .byte 0x9b + .byte SCR_OP_MESSAGEAUTOSCROLL .4byte \text .endm @ Executes the specified field effect animation (FLDEFF_*). .macro dofieldeffect animation:req - .byte 0x9c + .byte SCR_OP_DOFIELDEFFECT .2byte \animation .endm @ Sets the field effect argument at index 'argNum' to 'value.' .macro setfieldeffectargument argNum:req, value:req - .byte 0x9d + .byte SCR_OP_SETFIELDEFFECTARGUMENT .byte \argNum .2byte \value .endm @ Blocks script execution until all playing field effect animations complete. .macro waitfieldeffect animation:req - .byte 0x9e + .byte SCR_OP_WAITFIELDEFFECT .2byte \animation .endm @ Sets which healing location (HEAL_LOCATION_*) the player will return to if all of the Pokemon in their party faint. .macro setrespawn heallocation:req - .byte 0x9f + .byte SCR_OP_SETRESPAWN .2byte \heallocation .endm @ Checks the player's gender. Stores the result (MALE (0) or FEMALE (1)) in VAR_RESULT. .macro checkplayergender - .byte 0xa0 + .byte SCR_OP_CHECKPLAYERGENDER .endm @ Plays the cry of the given species. Mode is any CRY_MODE_* constant. @ You can use waitmoncry to block script execution until the cry finishes. .macro playmoncry species:req, mode:req - .byte 0xa1 + .byte SCR_OP_PLAYMONCRY .2byte \species .2byte \mode .endm @ Set the metatile at (x, y) on the current map to the given metatile and impassability. .macro setmetatile x:req, y:req, metatileId:req, impassable:req - .byte 0xa2 + .byte SCR_OP_SETMETATILE .2byte \x .2byte \y .2byte \metatileId @@ -1299,37 +1301,37 @@ @ Queues a weather change to the default weather for the map. .macro resetweather - .byte 0xa3 + .byte SCR_OP_RESETWEATHER .endm @ Queues a weather change to type weather. .macro setweather type:req - .byte 0xa4 + .byte SCR_OP_SETWEATHER .2byte \type .endm @ Executes the weather change queued with resetweather or setweather. The current weather will smoothly fade into the queued weather. .macro doweather - .byte 0xa5 + .byte SCR_OP_DOWEATHER .endm @ Enables the overworld task specified by stepCbId (STEP_CB_*). Only 1 can be active at a time. See src/field_tasks.c for more. .macro setstepcallback stepCbId:req - .byte 0xa6 + .byte SCR_OP_SETSTEPCALLBACK .byte \stepCbId .endm @ Sets the current map layout to the one specified by index (LAYOUT_*). @ This should be done before the layout is loaded, typically in the ON_TRANSITION map script. .macro setmaplayoutindex index:req - .byte 0xa7 + .byte SCR_OP_SETMAPLAYOUTINDEX .2byte \index .endm @ Sets the specified object's sprite's subpriority, and sets fixedPriority to TRUE. @ Only used to hide the player and Briney behind the boat. .macro setobjectsubpriority localId:req, map:req, subpriority:req - .byte 0xa8 + .byte SCR_OP_SETOBJECTSUBPRIORITY .2byte \localId map \map .byte \subpriority @@ -1337,7 +1339,7 @@ @ Sets the specified object's fixedPriority to FALSE. Does not change the subpriority field. .macro resetobjectsubpriority localId:req, map:req - .byte 0xa9 + .byte SCR_OP_RESETOBJECTSUBPRIORITY .2byte \localId map \map .endm @@ -1346,7 +1348,7 @@ @ the object event limit (e.g. Contest / Battle Dome audiences and Union Room group members). @ The specified id can be used to refer to the sprite again later with turnvobject. .macro createvobject graphicsId:req, id:req, x:req, y:req, elevation=3, direction=DIR_SOUTH - .byte 0xaa + .byte SCR_OP_CREATEVOBJECT .byte \graphicsId .byte \id .2byte \x @@ -1357,47 +1359,47 @@ @ Turns a sprite created with createvobject. .macro turnvobject id:req, direction:req - .byte 0xab + .byte SCR_OP_TURNVOBJECT .byte \id .byte \direction .endm @ Opens the door metatile at (x, y) with an animation. .macro opendoor x:req, y:req - .byte 0xac + .byte SCR_OP_OPENDOOR .2byte \x .2byte \y .endm @ Closes the door metatile at (x, y) with an animation. .macro closedoor x:req, y:req - .byte 0xad + .byte SCR_OP_CLOSEDOOR .2byte \x .2byte \y .endm @ Waits for the door animation started with opendoor or closedoor to finish. .macro waitdooranim - .byte 0xae + .byte SCR_OP_WAITDOORANIM .endm @ Sets the door metatile at (x, y) to be open without an animation. .macro setdooropen x:req, y:req - .byte 0xaf + .byte SCR_OP_SETDOOROPEN .2byte \x .2byte \y .endm @ Sets the door metatile at (x, y) to be closed without an animation. .macro setdoorclosed x:req, y:req - .byte 0xb0 + .byte SCR_OP_SETDOORCLOSED .2byte \x .2byte \y .endm @ Consumes its parameters and does nothing. It is implemented but unused in Ruby/Sapphire. .macro addelevmenuitem a:req, b:req, c:req, d:req - .byte 0xb1 + .byte SCR_OP_ADDELEVMENUITEM .byte \a .2byte \b .2byte \c @@ -1406,19 +1408,19 @@ @ Does nothing. It is implemented but unused in Ruby/Sapphire. .macro showelevmenu - .byte 0xb2 + .byte SCR_OP_SHOWELEVMENU .endm @ Gets the number of coins the player has and stores it in the variable 'out'. .macro checkcoins out:req - .byte 0xb3 + .byte SCR_OP_CHECKCOINS .2byte \out .endm @ Gives 'count' coins to the player, up to a total of MAX_COINS. @ If the player already has MAX_COINS then VAR_RESULT is set to TRUE, otherwise it is set to FALSE. .macro addcoins count:req - .byte 0xb4 + .byte SCR_OP_ADDCOINS .2byte \count .endm @@ -1426,14 +1428,14 @@ @ If the player has fewer than 'count' coins then no coins are taken and VAR_RESULT is set to TRUE. @ Otherwise VAR_RESULT is set to FALSE. .macro removecoins count:req - .byte 0xb5 + .byte SCR_OP_REMOVECOINS .2byte \count .endm @ Prepares to start a wild battle against a 'species' at 'level' holding 'item'. Running this command will not affect @ normal wild battles. You start the prepared battle with dowildbattle. .macro setwildbattle species:req, level:req, item=ITEM_NONE - .byte 0xb6 + .byte SCR_OP_SETWILDBATTLE .2byte \species .byte \level .2byte \item @@ -1441,84 +1443,84 @@ @ Starts a wild battle against the Pokemon generated by setwildbattle. Blocks script execution until the battle finishes. .macro dowildbattle - .byte 0xb7 + .byte SCR_OP_DOWILDBATTLE .endm @ Sets a relative address to be used by the other vcommands as part of a Mystery Gift script. .macro setvaddress pointer:req - .byte 0xb8 + .byte SCR_OP_SETVADDRESS .4byte \pointer .endm @ Equivalent to goto using the relative address set by setvaddress. .macro vgoto destination:req - .byte 0xb9 + .byte SCR_OP_VGOTO .4byte \destination .endm @ Equivalent to call using the relative address set by setvaddress. .macro vcall destination:req - .byte 0xba + .byte SCR_OP_VCALL .4byte \destination .endm @ Equivalent to goto_if using the relative address set by setvaddress. .macro vgoto_if condition:req, destination:req - .byte 0xbb + .byte SCR_OP_VGOTO_IF .byte \condition .4byte \destination .endm @ Equivalent to call_if using the relative address set by setvaddress. .macro vcall_if condition:req, destination:req - .byte 0xbc + .byte SCR_OP_VCALL_IF .byte \condition .4byte \destination .endm @ Equivalent to message using the relative address set by setvaddress. .macro vmessage text:req - .byte 0xbd + .byte SCR_OP_VMESSAGE .4byte \text .endm @ Expands the given text at the pointer (- the relative address set by setvaddress) into gStringVar4 .macro vbuffermessage text:req - .byte 0xbe + .byte SCR_OP_VBUFFERMESSAGE .4byte \text .endm @ Equivalent to bufferstring using the relative address set by setvaddress. .macro vbufferstring stringVarIndex:req, text:req - .byte 0xbf + .byte SCR_OP_VBUFFERSTRING stringvar \stringVarIndex .4byte \text .endm @ Create a window showing how many Coins the player has. .macro showcoinsbox x:req, y:req - .byte 0xc0 + .byte SCR_OP_SHOWCOINSBOX .byte \x .byte \y .endm @ Destroys the window created by showcoins. It consumes its arguments but doesn't use them. .macro hidecoinsbox x:req, y:req - .byte 0xc1 + .byte SCR_OP_HIDECOINSBOX .byte \x .byte \y .endm @ Updates the window created by showcoins. It consumes its arguments but doesn't use them. .macro updatecoinsbox x:req, y:req - .byte 0xc2 + .byte SCR_OP_UPDATECOINSBOX .byte \x .byte \y .endm @ Increases the value of the specified game stat by 1. The maximum value of a stat is 0xFFFFFF. See include/constants/game_stat.h .macro incrementgamestat stat:req - .byte 0xc3 + .byte SCR_OP_INCREMENTGAMESTAT .byte \stat .endm @@ -1526,78 +1528,78 @@ @ Warp commands can be given either the id of which warp location to go to on the destination map @ or a pair of x/y coordinates to go to directly on the destination map. .macro setescapewarp map:req, a, b, c - .byte 0xc4 + .byte SCR_OP_SETESCAPEWARP formatwarp \map, \a, \b, \c .endm @ Blocks script execution until cry finishes. .macro waitmoncry - .byte 0xc5 + .byte SCR_OP_WAITMONCRY .endm @ Writes the name of the specified PC box to the specified buffer. .macro bufferboxname stringVarId:req, box:req - .byte 0xc6 + .byte SCR_OP_BUFFERBOXNAME stringvar \stringVarId .2byte \box .endm @ Used only in FireRed/LeafGreen, does nothing in Emerald. .macro textcolor color:req - .byte 0xc7 + .byte SCR_OP_TEXTCOLOR .byte \color .endm @ Used only in FireRed/LeafGreen, does nothing in Emerald. .macro loadhelp text:req - .byte 0xc8 + .byte SCR_OP_LOADHELP .4byte \text .endm @ Used only in FireRed/LeafGreen, does nothing in Emerald. .macro unloadhelp - .byte 0xc9 + .byte SCR_OP_UNLOADHELP .endm @ Used only in FireRed/LeafGreen, does nothing in Emerald. .macro signmsg - .byte 0xca + .byte SCR_OP_SIGNMSG .endm @ Used only in FireRed/LeafGreen, does nothing in Emerald. .macro normalmsg - .byte 0xcb + .byte SCR_OP_NORMALMSG .endm @ Used only in FireRed/LeafGreen, does nothing in Emerald. .macro comparehiddenvar a:req, value:req - .byte 0xcc + .byte SCR_OP_COMPAREHIDDENVAR .byte \a .4byte \value .endm @ Sets the modernFatefulEncounter bit for the Pokemon in the specified slot of the player's party. .macro setmodernfatefulencounter slot:req - .byte 0xcd + .byte SCR_OP_SETMODERNFATEFULENCOUNTER .2byte \slot .endm @ Checks if the modernFatefulEncounter bit is set for the Pokemon in the specified slot of the player's party. If it isn't set, @ VAR_RESULT is TRUE. If the bit is set (or if the specified slot is empty or invalid), VAR_RESULT is FALSE. .macro checkmodernfatefulencounter slot:req - .byte 0xce + .byte SCR_OP_CHECKMODERNFATEFULENCOUNTER .2byte \slot .endm @ Jumps to the ram script saved from a Wonder Card. If there is no valid saved Wonder Card or if the @ ram script is invalid then this does nothing. .macro trywondercardscript - .byte 0xcf + .byte SCR_OP_TRYWONDERCARDSCRIPT .endm @ Used only in FireRed/LeafGreen, does nothing in Emerald. .macro setworldmapflag worldmapflag:req - .byte 0xd0 + .byte SCR_OP_SETWORLDMAPFLAG .2byte \worldmapflag .endm @@ -1606,13 +1608,13 @@ @ Warp commands can be given either the id of which warp location to go to on the destination map @ or a pair of x/y coordinates to go to directly on the destination map. .macro warpspinenter map:req, a, b, c - .byte 0xd1 + .byte SCR_OP_WARPSPINENTER formatwarp \map, \a, \b, \c .endm @ Changes the location where the player caught the Pokemon in the specified slot of their party. .macro setmonmetlocation slot:req, location:req - .byte 0xd2 + .byte SCR_OP_SETMONMETLOCATION .2byte \slot .byte \location .endm @@ -1620,26 +1622,26 @@ @ For the rotating tile puzzles in Mossdeep Gym / Trick House Room 7. Moves the objects one rotation @ on the colored puzzle specified by puzzleNumber. .macro moverotatingtileobjects puzzleNumber:req - .byte 0xd3 + .byte SCR_OP_MOVEROTATINGTILEOBJECTS .2byte \puzzleNumber .endm @ For the rotating tile puzzles in Mossdeep Gym / Trick House Room 7. Updates the facing direction of all objects on the puzzle tiles .macro turnrotatingtileobjects - .byte 0xd4 + .byte SCR_OP_TURNROTATINGTILEOBJECTS .endm @ For the rotating tile puzzles in Mossdeep Gym / Trick House Room 7. Allocates memory for the puzzle objects. @ isTrickHouse is needed to determine which of the two maps the puzzle is on, in order to know where in the tileset @ the puzzle tiles start (TRUE for Trick House Room, FALSE for Mossdeep Gym). .macro initrotatingtilepuzzle isTrickHouse:req - .byte 0xd5 + .byte SCR_OP_INITROTATINGTILEPUZZLE .2byte \isTrickHouse .endm @ For the rotating tile puzzles in Mossdeep Gym / Trick House Room 7. Frees the memory allocated for the puzzle objects. .macro freerotatingtilepuzzle - .byte 0xd6 + .byte SCR_OP_FREEROTATINGTILEPUZZLE .endm @ Warp used by the teleport tiles in the Mossdeep Gym. Plays SE_WARP_IN and does a simple fade transition. @@ -1647,44 +1649,44 @@ @ Warp commands can be given either the id of which warp location to go to on the destination map @ or a pair of x/y coordinates to go to directly on the destination map. .macro warpmossdeepgym map:req, a, b, c - .byte 0xd7 + .byte SCR_OP_WARPMOSSDEEPGYM formatwarp \map, \a, \b, \c .endm @ Sets the selected object to the id of the currently approaching trainer. .macro selectapproachingtrainer - .byte 0xd8 + .byte SCR_OP_SELECTAPPROACHINGTRAINER .endm @ Freezes all objects immediately except the player and the approaching trainers. @ The player and trainers are frozen once their movement is finished. .macro lockfortrainer - .byte 0xd9 + .byte SCR_OP_LOCKFORTRAINER .endm @ Destroys the window created by braillemessage. .macro closebraillemessage - .byte 0xda + .byte SCR_OP_CLOSEBRAILLEMESSAGE .endm @ Prints and draws the message all at once rather than character by character. @ Does not wait for player input to continue. .macro messageinstant text:req - .byte 0xdb + .byte SCR_OP_MESSAGEINSTANT .4byte \text .endm @ Equivalent to fadescreen but copies gPlttBufferUnfaded to gPaletteDecompressionBuffer on the fade out @ and the reverse on the fade in, in effect saving gPlttBufferUnfaded to restore it. .macro fadescreenswapbuffers mode:req - .byte 0xdc + .byte SCR_OP_FADESCREENSWAPBUFFERS .byte \mode .endm @ Buffers the specified trainer's class name to the given string var. @ If the trainer id is >= TRAINERS_COUNT it will be treated as TRAINER_NONE. .macro buffertrainerclassname stringVarId:req, trainerId:req - .byte 0xdd + .byte SCR_OP_BUFFERTRAINERCLASSNAME stringvar \stringVarId .2byte \trainerId .endm @@ -1692,14 +1694,14 @@ @ Buffers the specified trainer's name to the given string var. @ If the trainer id is >= TRAINERS_COUNT it will be treated as TRAINER_NONE. .macro buffertrainername stringVarId:req, trainerId:req - .byte 0xde + .byte SCR_OP_BUFFERTRAINERNAME stringvar \stringVarId .2byte \trainerId .endm @ Starts a Pokenav call with the given text. .macro pokenavcall text:req - .byte 0xdf + .byte SCR_OP_POKENAVCALL .4byte \text .endm @@ -1707,14 +1709,14 @@ @ Warp commands can be given either the id of which warp location to go to on the destination map @ or a pair of x/y coordinates to go to directly on the destination map. .macro warpwhitefade map:req, a, b, c - .byte 0xe0 + .byte SCR_OP_WARPWHITEFADE formatwarp \map, \a, \b, \c .endm @ Buffers the name of the contest category to the buffer. @ For example a category of CONTEST_CATEGORY_COOL will buffer the string "COOLNESS CONTEST". .macro buffercontestname stringVarId:req, category:req - .byte 0xe1 + .byte SCR_OP_BUFFERCONTESTNAME stringvar \stringVarId .2byte \category .endm @@ -1723,7 +1725,7 @@ @ and if the quantity is 2 or more, the buffered string will be pluralized ("IES" or "S" appended). @ If the specified item is >= ITEMS_COUNT then the name of ITEM_NONE ("????????") is buffered instead. .macro bufferitemnameplural stringVarId:req, item:req, quantity:req - .byte 0xe2 + .byte SCR_OP_BUFFERITEMNAMEPLURAL stringvar \stringVarId .2byte \item .2byte \quantity diff --git a/data/event_scripts.s b/data/event_scripts.s index e8fb9dcbd18c..ed85ed65fb66 100644 --- a/data/event_scripts.s +++ b/data/event_scripts.s @@ -60,6 +60,7 @@ .section script_data, "aw", %progbits + .set ALLOCATE_SCRIPT_CMD_TABLE, 1 .include "data/script_cmd_table.inc" gSpecialVars:: diff --git a/data/script_cmd_table.inc b/data/script_cmd_table.inc index e73a39a5dd87..895a0c648b05 100644 --- a/data/script_cmd_table.inc +++ b/data/script_cmd_table.inc @@ -1,232 +1,249 @@ + .ifndef SCRIPT_CMD_TABLE_ENTRY_MACRO + .set SCRIPT_CMD_TABLE_ENTRY_MACRO, 1 + .macro script_cmd_table_entry constant:req value:req + .ifndef ALLOCATE_SCRIPT_CMD_TABLE + enum \constant + .else + .4byte \value + .endif + .endm + .endif + + + enum_start + .ifdef ALLOCATE_SCRIPT_CMD_TABLE .align 2 gScriptCmdTable:: - .4byte ScrCmd_nop @ 0x00 - .4byte ScrCmd_nop1 @ 0x01 - .4byte ScrCmd_end @ 0x02 - .4byte ScrCmd_return @ 0x03 - .4byte ScrCmd_call @ 0x04 - .4byte ScrCmd_goto @ 0x05 - .4byte ScrCmd_goto_if @ 0x06 - .4byte ScrCmd_call_if @ 0x07 - .4byte ScrCmd_gotostd @ 0x08 - .4byte ScrCmd_callstd @ 0x09 - .4byte ScrCmd_gotostd_if @ 0x0a - .4byte ScrCmd_callstd_if @ 0x0b - .4byte ScrCmd_returnram @ 0x0c - .4byte ScrCmd_endram @ 0x0d - .4byte ScrCmd_setmysteryeventstatus @ 0x0e - .4byte ScrCmd_loadword @ 0x0f - .4byte ScrCmd_loadbyte @ 0x10 - .4byte ScrCmd_setptr @ 0x11 - .4byte ScrCmd_loadbytefromptr @ 0x12 - .4byte ScrCmd_setptrbyte @ 0x13 - .4byte ScrCmd_copylocal @ 0x14 - .4byte ScrCmd_copybyte @ 0x15 - .4byte ScrCmd_setvar @ 0x16 - .4byte ScrCmd_addvar @ 0x17 - .4byte ScrCmd_subvar @ 0x18 - .4byte ScrCmd_copyvar @ 0x19 - .4byte ScrCmd_setorcopyvar @ 0x1a - .4byte ScrCmd_compare_local_to_local @ 0x1b - .4byte ScrCmd_compare_local_to_value @ 0x1c - .4byte ScrCmd_compare_local_to_ptr @ 0x1d - .4byte ScrCmd_compare_ptr_to_local @ 0x1e - .4byte ScrCmd_compare_ptr_to_value @ 0x1f - .4byte ScrCmd_compare_ptr_to_ptr @ 0x20 - .4byte ScrCmd_compare_var_to_value @ 0x21 - .4byte ScrCmd_compare_var_to_var @ 0x22 - .4byte ScrCmd_callnative @ 0x23 - .4byte ScrCmd_gotonative @ 0x24 - .4byte ScrCmd_special @ 0x25 - .4byte ScrCmd_specialvar @ 0x26 - .4byte ScrCmd_waitstate @ 0x27 - .4byte ScrCmd_delay @ 0x28 - .4byte ScrCmd_setflag @ 0x29 - .4byte ScrCmd_clearflag @ 0x2a - .4byte ScrCmd_checkflag @ 0x2b - .4byte ScrCmd_initclock @ 0x2c - .4byte ScrCmd_dotimebasedevents @ 0x2d - .4byte ScrCmd_gettime @ 0x2e - .4byte ScrCmd_playse @ 0x2f - .4byte ScrCmd_waitse @ 0x30 - .4byte ScrCmd_playfanfare @ 0x31 - .4byte ScrCmd_waitfanfare @ 0x32 - .4byte ScrCmd_playbgm @ 0x33 - .4byte ScrCmd_savebgm @ 0x34 - .4byte ScrCmd_fadedefaultbgm @ 0x35 - .4byte ScrCmd_fadenewbgm @ 0x36 - .4byte ScrCmd_fadeoutbgm @ 0x37 - .4byte ScrCmd_fadeinbgm @ 0x38 - .4byte ScrCmd_warp @ 0x39 - .4byte ScrCmd_warpsilent @ 0x3a - .4byte ScrCmd_warpdoor @ 0x3b - .4byte ScrCmd_warphole @ 0x3c - .4byte ScrCmd_warpteleport @ 0x3d - .4byte ScrCmd_setwarp @ 0x3e - .4byte ScrCmd_setdynamicwarp @ 0x3f - .4byte ScrCmd_setdivewarp @ 0x40 - .4byte ScrCmd_setholewarp @ 0x41 - .4byte ScrCmd_getplayerxy @ 0x42 - .4byte ScrCmd_getpartysize @ 0x43 - .4byte ScrCmd_additem @ 0x44 - .4byte ScrCmd_removeitem @ 0x45 - .4byte ScrCmd_checkitemspace @ 0x46 - .4byte ScrCmd_checkitem @ 0x47 - .4byte ScrCmd_checkitemtype @ 0x48 - .4byte ScrCmd_addpcitem @ 0x49 - .4byte ScrCmd_checkpcitem @ 0x4a - .4byte ScrCmd_adddecoration @ 0x4b - .4byte ScrCmd_removedecoration @ 0x4c - .4byte ScrCmd_checkdecor @ 0x4d - .4byte ScrCmd_checkdecorspace @ 0x4e - .4byte ScrCmd_applymovement @ 0x4f - .4byte ScrCmd_applymovementat @ 0x50 - .4byte ScrCmd_waitmovement @ 0x51 - .4byte ScrCmd_waitmovementat @ 0x52 - .4byte ScrCmd_removeobject @ 0x53 - .4byte ScrCmd_removeobjectat @ 0x54 - .4byte ScrCmd_addobject @ 0x55 - .4byte ScrCmd_addobjectat @ 0x56 - .4byte ScrCmd_setobjectxy @ 0x57 - .4byte ScrCmd_showobjectat @ 0x58 - .4byte ScrCmd_hideobjectat @ 0x59 - .4byte ScrCmd_faceplayer @ 0x5a - .4byte ScrCmd_turnobject @ 0x5b - .4byte ScrCmd_trainerbattle @ 0x5c - .4byte ScrCmd_dotrainerbattle @ 0x5d - .4byte ScrCmd_gotopostbattlescript @ 0x5e - .4byte ScrCmd_gotobeatenscript @ 0x5f - .4byte ScrCmd_checktrainerflag @ 0x60 - .4byte ScrCmd_settrainerflag @ 0x61 - .4byte ScrCmd_cleartrainerflag @ 0x62 - .4byte ScrCmd_setobjectxyperm @ 0x63 - .4byte ScrCmd_copyobjectxytoperm @ 0x64 - .4byte ScrCmd_setobjectmovementtype @ 0x65 - .4byte ScrCmd_waitmessage @ 0x66 - .4byte ScrCmd_message @ 0x67 - .4byte ScrCmd_closemessage @ 0x68 - .4byte ScrCmd_lockall @ 0x69 - .4byte ScrCmd_lock @ 0x6a - .4byte ScrCmd_releaseall @ 0x6b - .4byte ScrCmd_release @ 0x6c - .4byte ScrCmd_waitbuttonpress @ 0x6d - .4byte ScrCmd_yesnobox @ 0x6e - .4byte ScrCmd_multichoice @ 0x6f - .4byte ScrCmd_multichoicedefault @ 0x70 - .4byte ScrCmd_multichoicegrid @ 0x71 - .4byte ScrCmd_drawbox @ 0x72 - .4byte ScrCmd_erasebox @ 0x73 - .4byte ScrCmd_drawboxtext @ 0x74 - .4byte ScrCmd_showmonpic @ 0x75 - .4byte ScrCmd_hidemonpic @ 0x76 - .4byte ScrCmd_showcontestpainting @ 0x77 - .4byte ScrCmd_braillemessage @ 0x78 - .4byte ScrCmd_givemon @ 0x79 - .4byte ScrCmd_giveegg @ 0x7a - .4byte ScrCmd_setmonmove @ 0x7b - .4byte ScrCmd_checkpartymove @ 0x7c - .4byte ScrCmd_bufferspeciesname @ 0x7d - .4byte ScrCmd_bufferleadmonspeciesname @ 0x7e - .4byte ScrCmd_bufferpartymonnick @ 0x7f - .4byte ScrCmd_bufferitemname @ 0x80 - .4byte ScrCmd_bufferdecorationname @ 0x81 - .4byte ScrCmd_buffermovename @ 0x82 - .4byte ScrCmd_buffernumberstring @ 0x83 - .4byte ScrCmd_bufferstdstring @ 0x84 - .4byte ScrCmd_bufferstring @ 0x85 - .4byte ScrCmd_pokemart @ 0x86 - .4byte ScrCmd_pokemartdecoration @ 0x87 - .4byte ScrCmd_pokemartdecoration2 @ 0x88 - .4byte ScrCmd_playslotmachine @ 0x89 - .4byte ScrCmd_setberrytree @ 0x8a - .4byte ScrCmd_choosecontestmon @ 0x8b - .4byte ScrCmd_startcontest @ 0x8c - .4byte ScrCmd_showcontestresults @ 0x8d - .4byte ScrCmd_contestlinktransfer @ 0x8e - .4byte ScrCmd_random @ 0x8f - .4byte ScrCmd_addmoney @ 0x90 - .4byte ScrCmd_removemoney @ 0x91 - .4byte ScrCmd_checkmoney @ 0x92 - .4byte ScrCmd_showmoneybox @ 0x93 - .4byte ScrCmd_hidemoneybox @ 0x94 - .4byte ScrCmd_updatemoneybox @ 0x95 - .4byte ScrCmd_getpokenewsactive @ 0x96 - .4byte ScrCmd_fadescreen @ 0x97 - .4byte ScrCmd_fadescreenspeed @ 0x98 - .4byte ScrCmd_setflashlevel @ 0x99 - .4byte ScrCmd_animateflash @ 0x9a - .4byte ScrCmd_messageautoscroll @ 0x9b - .4byte ScrCmd_dofieldeffect @ 0x9c - .4byte ScrCmd_setfieldeffectargument @ 0x9d - .4byte ScrCmd_waitfieldeffect @ 0x9e - .4byte ScrCmd_setrespawn @ 0x9f - .4byte ScrCmd_checkplayergender @ 0xa0 - .4byte ScrCmd_playmoncry @ 0xa1 - .4byte ScrCmd_setmetatile @ 0xa2 - .4byte ScrCmd_resetweather @ 0xa3 - .4byte ScrCmd_setweather @ 0xa4 - .4byte ScrCmd_doweather @ 0xa5 - .4byte ScrCmd_setstepcallback @ 0xa6 - .4byte ScrCmd_setmaplayoutindex @ 0xa7 - .4byte ScrCmd_setobjectsubpriority @ 0xa8 - .4byte ScrCmd_resetobjectsubpriority @ 0xa9 - .4byte ScrCmd_createvobject @ 0xaa - .4byte ScrCmd_turnvobject @ 0xab - .4byte ScrCmd_opendoor @ 0xac - .4byte ScrCmd_closedoor @ 0xad - .4byte ScrCmd_waitdooranim @ 0xae - .4byte ScrCmd_setdooropen @ 0xaf - .4byte ScrCmd_setdoorclosed @ 0xb0 - .4byte ScrCmd_addelevmenuitem @ 0xb1 - .4byte ScrCmd_showelevmenu @ 0xb2 - .4byte ScrCmd_checkcoins @ 0xb3 - .4byte ScrCmd_addcoins @ 0xb4 - .4byte ScrCmd_removecoins @ 0xb5 - .4byte ScrCmd_setwildbattle @ 0xb6 - .4byte ScrCmd_dowildbattle @ 0xb7 - .4byte ScrCmd_setvaddress @ 0xb8 - .4byte ScrCmd_vgoto @ 0xb9 - .4byte ScrCmd_vcall @ 0xba - .4byte ScrCmd_vgoto_if @ 0xbb - .4byte ScrCmd_vcall_if @ 0xbc - .4byte ScrCmd_vmessage @ 0xbd - .4byte ScrCmd_vbuffermessage @ 0xbe - .4byte ScrCmd_vbufferstring @ 0xbf - .4byte ScrCmd_showcoinsbox @ 0xc0 - .4byte ScrCmd_hidecoinsbox @ 0xc1 - .4byte ScrCmd_updatecoinsbox @ 0xc2 - .4byte ScrCmd_incrementgamestat @ 0xc3 - .4byte ScrCmd_setescapewarp @ 0xc4 - .4byte ScrCmd_waitmoncry @ 0xc5 - .4byte ScrCmd_bufferboxname @ 0xc6 - .4byte ScrCmd_nop1 @ 0xc7 - .4byte ScrCmd_nop1 @ 0xc8 - .4byte ScrCmd_nop1 @ 0xc9 - .4byte ScrCmd_nop1 @ 0xca - .4byte ScrCmd_nop1 @ 0xcb - .4byte ScrCmd_nop1 @ 0xcc - .4byte ScrCmd_setmodernfatefulencounter @ 0xcd - .4byte ScrCmd_checkmodernfatefulencounter @ 0xce - .4byte ScrCmd_trywondercardscript @ 0xcf - .4byte ScrCmd_nop1 @ 0xd0 - .4byte ScrCmd_warpspinenter @ 0xd1 - .4byte ScrCmd_setmonmetlocation @ 0xd2 - .4byte ScrCmd_moverotatingtileobjects @ 0xd3 - .4byte ScrCmd_turnrotatingtileobjects @ 0xd4 - .4byte ScrCmd_initrotatingtilepuzzle @ 0xd5 - .4byte ScrCmd_freerotatingtilepuzzle @ 0xd6 - .4byte ScrCmd_warpmossdeepgym @ 0xd7 - .4byte ScrCmd_selectapproachingtrainer @ 0xd8 - .4byte ScrCmd_lockfortrainer @ 0xd9 - .4byte ScrCmd_closebraillemessage @ 0xda - .4byte ScrCmd_messageinstant @ 0xdb - .4byte ScrCmd_fadescreenswapbuffers @ 0xdc - .4byte ScrCmd_buffertrainerclassname @ 0xdd - .4byte ScrCmd_buffertrainername @ 0xde - .4byte ScrCmd_pokenavcall @ 0xdf - .4byte ScrCmd_warpwhitefade @ 0xe0 - .4byte ScrCmd_buffercontestname @ 0xe1 - .4byte ScrCmd_bufferitemnameplural @ 0xe2 + .endif + script_cmd_table_entry SCR_OP_NOP ScrCmd_nop @ 0x00 + script_cmd_table_entry SCR_OP_NOP1 ScrCmd_nop1 @ 0x01 + script_cmd_table_entry SCR_OP_END ScrCmd_end @ 0x02 + script_cmd_table_entry SCR_OP_RETURN ScrCmd_return @ 0x03 + script_cmd_table_entry SCR_OP_CALL ScrCmd_call @ 0x04 + script_cmd_table_entry SCR_OP_GOTO ScrCmd_goto @ 0x05 + script_cmd_table_entry SCR_OP_GOTO_IF ScrCmd_goto_if @ 0x06 + script_cmd_table_entry SCR_OP_CALL_IF ScrCmd_call_if @ 0x07 + script_cmd_table_entry SCR_OP_GOTO_STD ScrCmd_gotostd @ 0x08 + script_cmd_table_entry SCR_OP_CALL_STD ScrCmd_callstd @ 0x09 + script_cmd_table_entry SCR_OP_GOTO_STD_IF ScrCmd_gotostd_if @ 0x0a + script_cmd_table_entry SCR_OP_CALL_STD_IF ScrCmd_callstd_if @ 0x0b + script_cmd_table_entry SCR_OP_RETURNRAM ScrCmd_returnram @ 0x0c + script_cmd_table_entry SCR_OP_ENDRAM ScrCmd_endram @ 0x0d + script_cmd_table_entry SCR_OP_SETMYSTERYEVENTSTATUS ScrCmd_setmysteryeventstatus @ 0x0e + script_cmd_table_entry SCR_OP_LOAD_WORD ScrCmd_loadword @ 0x0f + script_cmd_table_entry SCR_OP_LOAD_BYTE ScrCmd_loadbyte @ 0x10 + script_cmd_table_entry SCR_OP_SETPTR ScrCmd_setptr @ 0x11 + script_cmd_table_entry SCR_OP_LOADBYTEFROMPTR ScrCmd_loadbytefromptr @ 0x12 + script_cmd_table_entry SCR_OP_SETPTRBYTE ScrCmd_setptrbyte @ 0x13 + script_cmd_table_entry SCR_OP_COPYLOCAL ScrCmd_copylocal @ 0x14 + script_cmd_table_entry SCR_OP_COPYBYTE ScrCmd_copybyte @ 0x15 + script_cmd_table_entry SCR_OP_SETVAR ScrCmd_setvar @ 0x16 + script_cmd_table_entry SCR_OP_ADDVAR ScrCmd_addvar @ 0x17 + script_cmd_table_entry SCR_OP_SUBVAR ScrCmd_subvar @ 0x18 + script_cmd_table_entry SCR_OP_COPYVAR ScrCmd_copyvar @ 0x19 + script_cmd_table_entry SCR_OP_SETORCOPYVAR ScrCmd_setorcopyvar @ 0x1a + script_cmd_table_entry SCR_OP_COMPARE_LOCAL_TO_LOCAL ScrCmd_compare_local_to_local @ 0x1b + script_cmd_table_entry SCR_OP_COMPARE_LOCAL_TO_VALUE ScrCmd_compare_local_to_value @ 0x1c + script_cmd_table_entry SCR_OP_COMPARE_LOCAL_TO_PTR ScrCmd_compare_local_to_ptr @ 0x1d + script_cmd_table_entry SCR_OP_COMPARE_PTR_TO_LOCAL ScrCmd_compare_ptr_to_local @ 0x1e + script_cmd_table_entry SCR_OP_COMPARE_PTR_TO_VALUE ScrCmd_compare_ptr_to_value @ 0x1f + script_cmd_table_entry SCR_OP_COMPARE_PTR_TO_PTR ScrCmd_compare_ptr_to_ptr @ 0x20 + script_cmd_table_entry SCR_OP_COMPARE_VAR_TO_VALUE ScrCmd_compare_var_to_value @ 0x21 + script_cmd_table_entry SCR_OP_COMPARE_VAR_TO_VAR ScrCmd_compare_var_to_var @ 0x22 + script_cmd_table_entry SCR_OP_CALLNATIVE ScrCmd_callnative @ 0x23 + script_cmd_table_entry SCR_OP_GOTONATIVE ScrCmd_gotonative @ 0x24 + script_cmd_table_entry SCR_OP_SPECIAL ScrCmd_special @ 0x25 + script_cmd_table_entry SCR_OP_SPECIALVAR ScrCmd_specialvar @ 0x26 + script_cmd_table_entry SCR_OP_WAITSTATE ScrCmd_waitstate @ 0x27 + script_cmd_table_entry SCR_OP_DELAY ScrCmd_delay @ 0x28 + script_cmd_table_entry SCR_OP_SETFLAG ScrCmd_setflag @ 0x29 + script_cmd_table_entry SCR_OP_CLEARFLAG ScrCmd_clearflag @ 0x2a + script_cmd_table_entry SCR_OP_CHECKFLAG ScrCmd_checkflag @ 0x2b + script_cmd_table_entry SCR_OP_INITCLOCK ScrCmd_initclock @ 0x2c + script_cmd_table_entry SCR_OP_DOTIMEBASEDEVENTS ScrCmd_dotimebasedevents @ 0x2d + script_cmd_table_entry SCR_OP_GETTIME ScrCmd_gettime @ 0x2e + script_cmd_table_entry SCR_OP_PLAYSE ScrCmd_playse @ 0x2f + script_cmd_table_entry SCR_OP_WAITSE ScrCmd_waitse @ 0x30 + script_cmd_table_entry SCR_OP_PLAYFANFARE ScrCmd_playfanfare @ 0x31 + script_cmd_table_entry SCR_OP_WAITFANFARE ScrCmd_waitfanfare @ 0x32 + script_cmd_table_entry SCR_OP_PLAYBGM ScrCmd_playbgm @ 0x33 + script_cmd_table_entry SCR_OP_SAVEBGM ScrCmd_savebgm @ 0x34 + script_cmd_table_entry SCR_OP_FADEDEFAULTBGM ScrCmd_fadedefaultbgm @ 0x35 + script_cmd_table_entry SCR_OP_FADENEWBGM ScrCmd_fadenewbgm @ 0x36 + script_cmd_table_entry SCR_OP_FADEOUTBGM ScrCmd_fadeoutbgm @ 0x37 + script_cmd_table_entry SCR_OP_FADEINBGM ScrCmd_fadeinbgm @ 0x38 + script_cmd_table_entry SCR_OP_WARP ScrCmd_warp @ 0x39 + script_cmd_table_entry SCR_OP_WARPSILENT ScrCmd_warpsilent @ 0x3a + script_cmd_table_entry SCR_OP_WARPDOOR ScrCmd_warpdoor @ 0x3b + script_cmd_table_entry SCR_OP_WARPHOLE ScrCmd_warphole @ 0x3c + script_cmd_table_entry SCR_OP_WARPTELEPORT ScrCmd_warpteleport @ 0x3d + script_cmd_table_entry SCR_OP_SETWARP ScrCmd_setwarp @ 0x3e + script_cmd_table_entry SCR_OP_SETDYNAMICWARP ScrCmd_setdynamicwarp @ 0x3f + script_cmd_table_entry SCR_OP_SETDIVEWARP ScrCmd_setdivewarp @ 0x40 + script_cmd_table_entry SCR_OP_SETHOLEWARP ScrCmd_setholewarp @ 0x41 + script_cmd_table_entry SCR_OP_GETPLAYERXY ScrCmd_getplayerxy @ 0x42 + script_cmd_table_entry SCR_OP_GETPARTYSIZE ScrCmd_getpartysize @ 0x43 + script_cmd_table_entry SCR_OP_ADDITEM ScrCmd_additem @ 0x44 + script_cmd_table_entry SCR_OP_REMOVEITEM ScrCmd_removeitem @ 0x45 + script_cmd_table_entry SCR_OP_CHECKITEMSPACE ScrCmd_checkitemspace @ 0x46 + script_cmd_table_entry SCR_OP_CHECKITEM ScrCmd_checkitem @ 0x47 + script_cmd_table_entry SCR_OP_CHECKITEMTYPE ScrCmd_checkitemtype @ 0x48 + script_cmd_table_entry SCR_OP_ADDPCITEM ScrCmd_addpcitem @ 0x49 + script_cmd_table_entry SCR_OP_CHECKPCITEM ScrCmd_checkpcitem @ 0x4a + script_cmd_table_entry SCR_OP_ADDDECORATION ScrCmd_adddecoration @ 0x4b + script_cmd_table_entry SCR_OP_REMOVEDECORATION ScrCmd_removedecoration @ 0x4c + script_cmd_table_entry SCR_OP_CHECKDECOR ScrCmd_checkdecor @ 0x4d + script_cmd_table_entry SCR_OP_CHECKDECORSPACE ScrCmd_checkdecorspace @ 0x4e + script_cmd_table_entry SCR_OP_APPLYMOVEMENT ScrCmd_applymovement @ 0x4f + script_cmd_table_entry SCR_OP_APPLYMOVEMENTAT ScrCmd_applymovementat @ 0x50 + script_cmd_table_entry SCR_OP_WAITMOVEMENT ScrCmd_waitmovement @ 0x51 + script_cmd_table_entry SCR_OP_WAITMOVEMENTAT ScrCmd_waitmovementat @ 0x52 + script_cmd_table_entry SCR_OP_REMOVEOBJECT ScrCmd_removeobject @ 0x53 + script_cmd_table_entry SCR_OP_REMOVEOBJECTAT ScrCmd_removeobjectat @ 0x54 + script_cmd_table_entry SCR_OP_ADDOBJECT ScrCmd_addobject @ 0x55 + script_cmd_table_entry SCR_OP_ADDOBJECTAT ScrCmd_addobjectat @ 0x56 + script_cmd_table_entry SCR_OP_SETOBJECTXY ScrCmd_setobjectxy @ 0x57 + script_cmd_table_entry SCR_OP_SHOWOBJECTAT ScrCmd_showobjectat @ 0x58 + script_cmd_table_entry SCR_OP_HIDEOBJECTAT ScrCmd_hideobjectat @ 0x59 + script_cmd_table_entry SCR_OP_FACEPLAYER ScrCmd_faceplayer @ 0x5a + script_cmd_table_entry SCR_OP_TURNOBJECT ScrCmd_turnobject @ 0x5b + script_cmd_table_entry SCR_OP_TRAINERBATTLE ScrCmd_trainerbattle @ 0x5c + script_cmd_table_entry SCR_OP_DOTRAINERBATTLE ScrCmd_dotrainerbattle @ 0x5d + script_cmd_table_entry SCR_OP_GOTOPOSTBATTLESCRIPT ScrCmd_gotopostbattlescript @ 0x5e + script_cmd_table_entry SCR_OP_GOTOBEATENSCRIPT ScrCmd_gotobeatenscript @ 0x5f + script_cmd_table_entry SCR_OP_CHECKTRAINERFLAG ScrCmd_checktrainerflag @ 0x60 + script_cmd_table_entry SCR_OP_SETTRAINERFLAG ScrCmd_settrainerflag @ 0x61 + script_cmd_table_entry SCR_OP_CLEARTRAINERFLAG ScrCmd_cleartrainerflag @ 0x62 + script_cmd_table_entry SCR_OP_SETOBJECTXYPERM ScrCmd_setobjectxyperm @ 0x63 + script_cmd_table_entry SCR_OP_COPYOBJECTXYTOPERM ScrCmd_copyobjectxytoperm @ 0x64 + script_cmd_table_entry SCR_OP_SETOBJECTMOVEMENTTYPE ScrCmd_setobjectmovementtype @ 0x65 + script_cmd_table_entry SCR_OP_WAITMESSAGE ScrCmd_waitmessage @ 0x66 + script_cmd_table_entry SCR_OP_MESSAGE ScrCmd_message @ 0x67 + script_cmd_table_entry SCR_OP_CLOSEMESSAGE ScrCmd_closemessage @ 0x68 + script_cmd_table_entry SCR_OP_LOCKALL ScrCmd_lockall @ 0x69 + script_cmd_table_entry SCR_OP_LOCK ScrCmd_lock @ 0x6a + script_cmd_table_entry SCR_OP_RELEASEALL ScrCmd_releaseall @ 0x6b + script_cmd_table_entry SCR_OP_RELEASE ScrCmd_release @ 0x6c + script_cmd_table_entry SCR_OP_WAITBUTTONPRESS ScrCmd_waitbuttonpress @ 0x6d + script_cmd_table_entry SCR_OP_YESNOBOX ScrCmd_yesnobox @ 0x6e + script_cmd_table_entry SCR_OP_MULTICHOICE ScrCmd_multichoice @ 0x6f + script_cmd_table_entry SCR_OP_MULTICHOICEDEFAULT ScrCmd_multichoicedefault @ 0x70 + script_cmd_table_entry SCR_OP_MULTICHOICEGRID ScrCmd_multichoicegrid @ 0x71 + script_cmd_table_entry SCR_OP_DRAWBOX ScrCmd_drawbox @ 0x72 + script_cmd_table_entry SCR_OP_ERASEBOX ScrCmd_erasebox @ 0x73 + script_cmd_table_entry SCR_OP_DRAWBOXTEXT ScrCmd_drawboxtext @ 0x74 + script_cmd_table_entry SCR_OP_SHOWMONPIC ScrCmd_showmonpic @ 0x75 + script_cmd_table_entry SCR_OP_HIDEMONPIC ScrCmd_hidemonpic @ 0x76 + script_cmd_table_entry SCR_OP_SHOWCONTESTPAINTING ScrCmd_showcontestpainting @ 0x77 + script_cmd_table_entry SCR_OP_BRAILLEMESSAGE ScrCmd_braillemessage @ 0x78 + script_cmd_table_entry SCR_OP_GIVEMON ScrCmd_givemon @ 0x79 + script_cmd_table_entry SCR_OP_GIVEEGG ScrCmd_giveegg @ 0x7a + script_cmd_table_entry SCR_OP_SETMONMOVE ScrCmd_setmonmove @ 0x7b + script_cmd_table_entry SCR_OP_CHECKPARTYMOVE ScrCmd_checkpartymove @ 0x7c + script_cmd_table_entry SCR_OP_BUFFERSPECIESNAME ScrCmd_bufferspeciesname @ 0x7d + script_cmd_table_entry SCR_OP_BUFFERLEADMONSPECIESNAME ScrCmd_bufferleadmonspeciesname @ 0x7e + script_cmd_table_entry SCR_OP_BUFFERPARTYMONNICK ScrCmd_bufferpartymonnick @ 0x7f + script_cmd_table_entry SCR_OP_BUFFERITEMNAME ScrCmd_bufferitemname @ 0x80 + script_cmd_table_entry SCR_OP_BUFFERDECORATIONNAME ScrCmd_bufferdecorationname @ 0x81 + script_cmd_table_entry SCR_OP_BUFFERMOVENAME ScrCmd_buffermovename @ 0x82 + script_cmd_table_entry SCR_OP_BUFFERNUMBERSTRING ScrCmd_buffernumberstring @ 0x83 + script_cmd_table_entry SCR_OP_BUFFERSTDSTRING ScrCmd_bufferstdstring @ 0x84 + script_cmd_table_entry SCR_OP_BUFFERSTRING ScrCmd_bufferstring @ 0x85 + script_cmd_table_entry SCR_OP_POKEMART ScrCmd_pokemart @ 0x86 + script_cmd_table_entry SCR_OP_POKEMARTDECORATION ScrCmd_pokemartdecoration @ 0x87 + script_cmd_table_entry SCR_OP_POKEMARTDECORATION2 ScrCmd_pokemartdecoration2 @ 0x88 + script_cmd_table_entry SCR_OP_PLAYSLOTMACHINE ScrCmd_playslotmachine @ 0x89 + script_cmd_table_entry SCR_OP_SETBERRYTREE ScrCmd_setberrytree @ 0x8a + script_cmd_table_entry SCR_OP_CHOOSECONTESTMON ScrCmd_choosecontestmon @ 0x8b + script_cmd_table_entry SCR_OP_STARTCONTEST ScrCmd_startcontest @ 0x8c + script_cmd_table_entry SCR_OP_SHOWCONTESTRESULTS ScrCmd_showcontestresults @ 0x8d + script_cmd_table_entry SCR_OP_CONTESTLINKTRANSFER ScrCmd_contestlinktransfer @ 0x8e + script_cmd_table_entry SCR_OP_RANDOM ScrCmd_random @ 0x8f + script_cmd_table_entry SCR_OP_ADDMONEY ScrCmd_addmoney @ 0x90 + script_cmd_table_entry SCR_OP_REMOVEMONEY ScrCmd_removemoney @ 0x91 + script_cmd_table_entry SCR_OP_CHECKMONEY ScrCmd_checkmoney @ 0x92 + script_cmd_table_entry SCR_OP_SHOWMONEYBOX ScrCmd_showmoneybox @ 0x93 + script_cmd_table_entry SCR_OP_HIDEMONEYBOX ScrCmd_hidemoneybox @ 0x94 + script_cmd_table_entry SCR_OP_UPDATEMONEYBOX ScrCmd_updatemoneybox @ 0x95 + script_cmd_table_entry SCR_OP_GETPOKENEWSACTIVE ScrCmd_getpokenewsactive @ 0x96 + script_cmd_table_entry SCR_OP_FADESCREEN ScrCmd_fadescreen @ 0x97 + script_cmd_table_entry SCR_OP_FADESCREENSPEED ScrCmd_fadescreenspeed @ 0x98 + script_cmd_table_entry SCR_OP_SETFLASHLEVEL ScrCmd_setflashlevel @ 0x99 + script_cmd_table_entry SCR_OP_ANIMATEFLASH ScrCmd_animateflash @ 0x9a + script_cmd_table_entry SCR_OP_MESSAGEAUTOSCROLL ScrCmd_messageautoscroll @ 0x9b + script_cmd_table_entry SCR_OP_DOFIELDEFFECT ScrCmd_dofieldeffect @ 0x9c + script_cmd_table_entry SCR_OP_SETFIELDEFFECTARGUMENT ScrCmd_setfieldeffectargument @ 0x9d + script_cmd_table_entry SCR_OP_WAITFIELDEFFECT ScrCmd_waitfieldeffect @ 0x9e + script_cmd_table_entry SCR_OP_SETRESPAWN ScrCmd_setrespawn @ 0x9f + script_cmd_table_entry SCR_OP_CHECKPLAYERGENDER ScrCmd_checkplayergender @ 0xa0 + script_cmd_table_entry SCR_OP_PLAYMONCRY ScrCmd_playmoncry @ 0xa1 + script_cmd_table_entry SCR_OP_SETMETATILE ScrCmd_setmetatile @ 0xa2 + script_cmd_table_entry SCR_OP_RESETWEATHER ScrCmd_resetweather @ 0xa3 + script_cmd_table_entry SCR_OP_SETWEATHER ScrCmd_setweather @ 0xa4 + script_cmd_table_entry SCR_OP_DOWEATHER ScrCmd_doweather @ 0xa5 + script_cmd_table_entry SCR_OP_SETSTEPCALLBACK ScrCmd_setstepcallback @ 0xa6 + script_cmd_table_entry SCR_OP_SETMAPLAYOUTINDEX ScrCmd_setmaplayoutindex @ 0xa7 + script_cmd_table_entry SCR_OP_SETOBJECTSUBPRIORITY ScrCmd_setobjectsubpriority @ 0xa8 + script_cmd_table_entry SCR_OP_RESETOBJECTSUBPRIORITY ScrCmd_resetobjectsubpriority @ 0xa9 + script_cmd_table_entry SCR_OP_CREATEVOBJECT ScrCmd_createvobject @ 0xaa + script_cmd_table_entry SCR_OP_TURNVOBJECT ScrCmd_turnvobject @ 0xab + script_cmd_table_entry SCR_OP_OPENDOOR ScrCmd_opendoor @ 0xac + script_cmd_table_entry SCR_OP_CLOSEDOOR ScrCmd_closedoor @ 0xad + script_cmd_table_entry SCR_OP_WAITDOORANIM ScrCmd_waitdooranim @ 0xae + script_cmd_table_entry SCR_OP_SETDOOROPEN ScrCmd_setdooropen @ 0xaf + script_cmd_table_entry SCR_OP_SETDOORCLOSED ScrCmd_setdoorclosed @ 0xb0 + script_cmd_table_entry SCR_OP_ADDELEVMENUITEM ScrCmd_addelevmenuitem @ 0xb1 + script_cmd_table_entry SCR_OP_SHOWELEVMENU ScrCmd_showelevmenu @ 0xb2 + script_cmd_table_entry SCR_OP_CHECKCOINS ScrCmd_checkcoins @ 0xb3 + script_cmd_table_entry SCR_OP_ADDCOINS ScrCmd_addcoins @ 0xb4 + script_cmd_table_entry SCR_OP_REMOVECOINS ScrCmd_removecoins @ 0xb5 + script_cmd_table_entry SCR_OP_SETWILDBATTLE ScrCmd_setwildbattle @ 0xb6 + script_cmd_table_entry SCR_OP_DOWILDBATTLE ScrCmd_dowildbattle @ 0xb7 + script_cmd_table_entry SCR_OP_SETVADDRESS ScrCmd_setvaddress @ 0xb8 + script_cmd_table_entry SCR_OP_VGOTO ScrCmd_vgoto @ 0xb9 + script_cmd_table_entry SCR_OP_VCALL ScrCmd_vcall @ 0xba + script_cmd_table_entry SCR_OP_VGOTO_IF ScrCmd_vgoto_if @ 0xbb + script_cmd_table_entry SCR_OP_VCALL_IF ScrCmd_vcall_if @ 0xbc + script_cmd_table_entry SCR_OP_VMESSAGE ScrCmd_vmessage @ 0xbd + script_cmd_table_entry SCR_OP_VBUFFERMESSAGE ScrCmd_vbuffermessage @ 0xbe + script_cmd_table_entry SCR_OP_VBUFFERSTRING ScrCmd_vbufferstring @ 0xbf + script_cmd_table_entry SCR_OP_SHOWCOINSBOX ScrCmd_showcoinsbox @ 0xc0 + script_cmd_table_entry SCR_OP_HIDECOINSBOX ScrCmd_hidecoinsbox @ 0xc1 + script_cmd_table_entry SCR_OP_UPDATECOINSBOX ScrCmd_updatecoinsbox @ 0xc2 + script_cmd_table_entry SCR_OP_INCREMENTGAMESTAT ScrCmd_incrementgamestat @ 0xc3 + script_cmd_table_entry SCR_OP_SETESCAPEWARP ScrCmd_setescapewarp @ 0xc4 + script_cmd_table_entry SCR_OP_WAITMONCRY ScrCmd_waitmoncry @ 0xc5 + script_cmd_table_entry SCR_OP_BUFFERBOXNAME ScrCmd_bufferboxname @ 0xc6 + script_cmd_table_entry SCR_OP_TEXTCOLOR ScrCmd_nop1 @ 0xc7 + script_cmd_table_entry SCR_OP_LOADHELP ScrCmd_nop1 @ 0xc8 + script_cmd_table_entry SCR_OP_UNLOADHELP ScrCmd_nop1 @ 0xc9 + script_cmd_table_entry SCR_OP_SIGNMSG ScrCmd_nop1 @ 0xca + script_cmd_table_entry SCR_OP_NORMALMSG ScrCmd_nop1 @ 0xcb + script_cmd_table_entry SCR_OP_COMPAREHIDDENVAR ScrCmd_nop1 @ 0xcc + script_cmd_table_entry SCR_OP_SETMODERNFATEFULENCOUNTER ScrCmd_setmodernfatefulencounter @ 0xcd + script_cmd_table_entry SCR_OP_CHECKMODERNFATEFULENCOUNTER ScrCmd_checkmodernfatefulencounter @ 0xce + script_cmd_table_entry SCR_OP_TRYWONDERCARDSCRIPT ScrCmd_trywondercardscript @ 0xcf + script_cmd_table_entry SCR_OP_SETWORLDMAPFLAG ScrCmd_nop1 @ 0xd0 + script_cmd_table_entry SCR_OP_WARPSPINENTER ScrCmd_warpspinenter @ 0xd1 + script_cmd_table_entry SCR_OP_SETMONMETLOCATION ScrCmd_setmonmetlocation @ 0xd2 + script_cmd_table_entry SCR_OP_MOVEROTATINGTILEOBJECTS ScrCmd_moverotatingtileobjects @ 0xd3 + script_cmd_table_entry SCR_OP_TURNROTATINGTILEOBJECTS ScrCmd_turnrotatingtileobjects @ 0xd4 + script_cmd_table_entry SCR_OP_INITROTATINGTILEPUZZLE ScrCmd_initrotatingtilepuzzle @ 0xd5 + script_cmd_table_entry SCR_OP_FREEROTATINGTILEPUZZLE ScrCmd_freerotatingtilepuzzle @ 0xd6 + script_cmd_table_entry SCR_OP_WARPMOSSDEEPGYM ScrCmd_warpmossdeepgym @ 0xd7 + script_cmd_table_entry SCR_OP_SELECTAPPROACHINGTRAINER ScrCmd_selectapproachingtrainer @ 0xd8 + script_cmd_table_entry SCR_OP_LOCKFORTRAINER ScrCmd_lockfortrainer @ 0xd9 + script_cmd_table_entry SCR_OP_CLOSEBRAILLEMESSAGE ScrCmd_closebraillemessage @ 0xda + script_cmd_table_entry SCR_OP_MESSAGEINSTANT ScrCmd_messageinstant @ 0xdb + script_cmd_table_entry SCR_OP_FADESCREENSWAPBUFFERS ScrCmd_fadescreenswapbuffers @ 0xdc + script_cmd_table_entry SCR_OP_BUFFERTRAINERCLASSNAME ScrCmd_buffertrainerclassname @ 0xdd + script_cmd_table_entry SCR_OP_BUFFERTRAINERNAME ScrCmd_buffertrainername @ 0xde + script_cmd_table_entry SCR_OP_POKENAVCALL ScrCmd_pokenavcall @ 0xdf + script_cmd_table_entry SCR_OP_WARPWHITEFADE ScrCmd_warpwhitefade @ 0xe0 + script_cmd_table_entry SCR_OP_BUFFERCONTESTNAME ScrCmd_buffercontestname @ 0xe1 + script_cmd_table_entry SCR_OP_BUFFERITEMNAMEPLURAL ScrCmd_bufferitemnameplural @ 0xe2 + .ifdef ALLOCATE_SCRIPT_CMD_TABLE gScriptCmdTableEnd:: .4byte ScrCmd_nop + .endif