ff3:ff3us:doc:asm:codes:event_codes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
ff3:ff3us:doc:asm:codes:event_codes [2016/04/03 08:34]
m06 created
ff3:ff3us:doc:asm:codes:event_codes [2021/06/14 03:10] (current)
rycona [Character and Party Actions (77-90)]
Line 1: Line 1:
-===== Event Commands =====+====== Event Commands ======
  
  
-==== Character Action Queue ====+===== Character Action Queues (00-34) ====
 + 
 +The action queue will consist of [[ff3:ff3us:doc:asm:codes:movement_codes|movement actions]]. 
 + 
 +Character Numbers (xx): 
 +  * $00-$0F: Player Characters (Terra, Locke, Cyan ...) 
 +  * $10-$2F: NPC'
 +  * $30: Camera 
 +  * $31-$34: Party Characters 
 <code> <code>
-xx nn                       xx = Character Number, nn = Number of actions to perform (including the final end command) +xx nn    xx = Character Number, nn = Number of actions to perform (including the final end command) 
-                            If nn & 0x80, the next action will not take place until this and any before it are complete.+         If nn & 0x80, the next action will not take place until this and any before it are complete.
 </code> </code>
  
-The action queue will consist of [[ff3:ff3us:doc:asm:movement_codes |movement actions]]. 
  
-==== General Actions ====+===== General Actions (35-FF) =====
  
-Jump table will be at ''C0/98C4''.+Jump table will be at ''C0/98C4'' 
 + 
 +==== Character Actions (35-47) ====
  
 <code> <code>
-35 xx                   $C09C44      +35 xx                   $C09C44     Pauses execution until object xx's queue is complete 
-36 xx                   $C09C6F+36 xx                   $C09C6F     Disable ability to pass through objects for character XX
 37 xx yy                $C09C8F     Assign graphic set yy to object xx 37 xx yy                $C09C8F     Assign graphic set yy to object xx
 38                      $C09D0E     Hold screen--does not scroll when character moves 38                      $C09D0E     Hold screen--does not scroll when character moves
 39                      $C09D16     Free screen--does scroll when character moves 39                      $C09D16     Free screen--does scroll when character moves
-3A                      $C09D1E +3A                      $C09D1E     Enable player to move while event commands execute 
-3B                      $C09D2E+3B                      $C09D2E     Position player in a "ready-to-go" stance
 3C c1 c2 c3 c4          $C09D6D     Put characters c1-4 in the party 3C c1 c2 c3 c4          $C09D6D     Put characters c1-4 in the party
 3D xx                   $C09E3C     Create object xx 3D xx                   $C09E3C     Create object xx
Line 35: Line 45:
 45                      $C09CE2     Refresh objects 45                      $C09CE2     Refresh objects
 46 xx                   $C09CEA     Make xx the current party 46 xx                   $C09CEA     Make xx the current party
-47                      $C09D03     +47                      $C09D03     Make character in slot 0 the lead character 
 +</code> 
 +==== Dialogue (48-4B) ==== 
 +<code>
 48 xxxx                 $C0A475     Display dialogue message xxxx, continue executing commands 48 xxxx                 $C0A475     Display dialogue message xxxx, continue executing commands
 49                      $C0A4A6     If dialogue window is up, wait for keypress then dismiss 49                      $C0A4A6     If dialogue window is up, wait for keypress then dismiss
-4A                      $C0A4B0+4A                      $C0A4B0     Wait for keypress
 4B xxxx                 $C0A4BC     Display dialogue message xxxx, halt execution until gone 4B xxxx                 $C0A4BC     Display dialogue message xxxx, halt execution until gone
                                     If xxxx & 0x4000, only the text will be shown (no dialogue window)                                     If xxxx & 0x4000, only the text will be shown (no dialogue window)
                                     If xxxx & 0x8000, the text will be shown at the bottom of the screen                                     If xxxx & 0x8000, the text will be shown at the bottom of the screen
-4C xx yy                $C0A591+                                    (note these flags apply to both command 48 and 4B) 
 +</code> 
 +==== Invoke Battle (4C-4F) ==== 
 +<code> 
 +4C xx bb                $C0A591     Center screen on party and invoke battle, enemy set xx, background bb
 4D xx bb                $C0A578     Battle Enemy Set xx, Background Scenery bb 4D xx bb                $C0A578     Battle Enemy Set xx, Background Scenery bb
-                                    bb: +4E                      $C0A4F9     Invoke random battleused for dungeons/townsetc 
-                                    00: Grass                       10: Inside of Train Car                 20: Owzer's House                   30: AirshipWoB, right +4F                      $C0A5F3     Exit current location 
-                                    01: Brown Forest                11: Blue/Purple Cave                    21: Running on Train Tracks         31: -- +</code> 
-                                    02: Desert                      12: Icy Field                           22: Bridge near Sealed Gate         32: -- +==== Screen Actions (50-65) ==== 
-                                    03: Green Forest                13: Bright Town                         23: Underwater                      33: Statue 1 +<code>
-                                    04: Building                    14: Factory                             24: Zozo                            34: Statue 2 +
-                                    05: World of Ruin               15: Floating Island                     25: AirshipWoB, centered          35: Statue 3 +
-                                    06: The Veldt                   16: Kefka's Domain                      26: Tomb                            36: Kefka's Background +
-                                    07: Falling through the Clouds  17: Opera Stage                         27: Doma                            37: Tentacles +
-                                    08: Dark Town                   18: Opera House Rafters                 28: Kefka's Domain                  3F: Narshe +
-                                    09: Grey Cave                   19: Flaming House                       29: Airship, WoR, right +
-                                    0A: Brown Cave                  1A: Castle                              2A: Red Cave +
-                                    0B: Mountain Top                1B: Magitek Research Facility wTubes  2B: Light Building +
-                                    0C: Mountain Cave               1C: Colloseum                           2C: Riding Car out of MagResFac +
-                                    0D: Raft on a River             1D: Magitek Research Facility           2D: Fanatics' Tower +
-                                    0E: Imperial Base               1E: Village                             2E: Cyan's Dream World +
-                                    0F: On Top of Train Car         1F: Waterfall                           2F: Desert +
-4E                      $C0A4F9 +
-4F                      $C0A5F3+
 50 xx                   $C0A5FD     Tint screen (cumulative) (takes 32 executions at intensity 15 to saturate) 50 xx                   $C0A5FD     Tint screen (cumulative) (takes 32 executions at intensity 15 to saturate)
 51 ooorgbii pb pe       $C0A640     Modify BG color range from [pb, pe] 51 ooorgbii pb pe       $C0A640     Modify BG color range from [pb, pe]
Line 69: Line 72:
 52 xx                   $C0A686     Tint characters (cumulative) 52 xx                   $C0A686     Tint characters (cumulative)
 53 ooorgbii pb pe       $C0A6C5     Modify OBJ color range [pb, pe] 53 ooorgbii pb pe       $C0A6C5     Modify OBJ color range [pb, pe]
-54                      $C0A784+54                      $C0A784     End effects of commands for modified color components and screen flashes
 55 ci                   $C0A795     Flash screen with color component(s) c, intensity i 55 ci                   $C0A795     Flash screen with color component(s) c, intensity i
 56 ci                   $C0A7BA     Increase color component(s) c, intensity i 56 ci                   $C0A7BA     Increase color component(s) c, intensity i
Line 82: Line 85:
 5A _x                   $C0A817     Fade the screen at speed x 5A _x                   $C0A817     Fade the screen at speed x
 5B                      $C0A826 5B                      $C0A826
-5C                      $C0A82D+5C                      $C0A82D     Pause execution until fade in or fade out is complete
 5D xx yy                $C0A838     Scroll BG0, speed xx x yy (00 --> 7F left/up, 80 <-- FF right/down) 5D xx yy                $C0A838     Scroll BG0, speed xx x yy (00 --> 7F left/up, 80 <-- FF right/down)
 5E xx yy                $C0A8CE     Scroll BG1, speed xx x yy (00 --> 7F left/up, 80 <-- FF right/down) 5E xx yy                $C0A8CE     Scroll BG1, speed xx x yy (00 --> 7F left/up, 80 <-- FF right/down)
Line 89: Line 92:
 61 _c pb pe             $C0AA3D     Colorize color range [pb, pe] to color c 61 _c pb pe             $C0AA3D     Colorize color range [pb, pe] to color c
 62 xx                   $C0AACB     Mosaic screen with speed xx (lower == slower) 62 xx                   $C0AACB     Mosaic screen with speed xx (lower == slower)
-63 xx                   $C0AADB +63 xx                   $C0AADB     Create spotlight effect with radius xx 
-64 xx yy                $C0AAE9 +64 xx yy                $C0AAE9      
-65 xx yy                $C0AB09 +65 xx yy                $C0AB09      
-6A nnnn xx yy ff        $C0AB47     Loads map nnnn, positions party at (xx, yy)+</code> 
 +==== Map Actions (6A-76) ==== 
 +<code> 
 +6A nnnn xx yy ff        $C0AB47     Loads map nnnn, positions party at (xx, yy) after fade out
                                     ff:                                     ff:
                                     01:     Party is in airship                                     01:     Party is in airship
                                     02:     Party is on Chocobo                                     02:     Party is on Chocobo
-6B nnnn xx yy ff        $C0AB55     Loads map nnnn, positions party at (xx, yy) +6B nnnn xx yy ff        $C0AB55     Loads map nnnn, positions party at (xx, yy) instantly 
-6C xxxx yyyy zz         $C0AC0B+6C xxxx xx yy ff        $C0AC0B     Set parent map to xxxx, parent coordinates to (xx, yy)
 70 xx yy                $C0A881     Scroll BG0 70 xx yy                $C0A881     Scroll BG0
 71 xx yy                $C0A917     Scroll BG1 71 xx yy                $C0A917     Scroll BG1
Line 104: Line 110:
 74 xx yy rr cc data...  $C0AC62     Copy data of size rr*cc to current map's BG0 at (xx, yy) 74 xx yy rr cc data...  $C0AC62     Copy data of size rr*cc to current map's BG0 at (xx, yy)
 75                      $C0AC1F     Refresh background after map has been changed 75                      $C0AC1F     Refresh background after map has been changed
 +</code>
 +==== Character and Party Actions (77-90) ====
 +<code>
 77 xx                   $C09F32     Restore character xx HP and MP to full 77 xx                   $C09F32     Restore character xx HP and MP to full
-78 xx                   $C09C7F +78 xx                   $C09C7F     Enable ability to pass through other objects for object xx 
-79 xx yy zz             $C0A36A+79 xx nnnn              $C0A36A     Place party xx on map nnnn
 7A xx aaaaaa            $C0A42A     Modify entity event--call $aaaaaa+$CA0000 when triggered 7A xx aaaaaa            $C0A42A     Modify entity event--call $aaaaaa+$CA0000 when triggered
-7B                      $C0A441 +7B                      $C0A441     Restore backup party to active status 
-7C xx                   $C0A455+7C xx                   $C0A455     Enable activation of event for object xx on collision
 7D xx                   $C0A465 7D xx                   $C0A465
 7E xx yy                $C0A39A     Move the characters to (xx, yy) on the current map 7E xx yy                $C0A39A     Move the characters to (xx, yy) on the current map
Line 115: Line 124:
 80 xx                   $C0ACF0     Add item xx from inventory 80 xx                   $C0ACF0     Add item xx from inventory
 81 xx                   $C0AD2D     Remove item xx from inventory 81 xx                   $C0AD2D     Remove item xx from inventory
-82                      $C0A570+82                      $C0A570     
 84 xxxx                 $C0AD50     Give xxxx amount of GP to party 84 xxxx                 $C0AD50     Give xxxx amount of GP to party
 85 xxxx                 $C0AD7F     Take xxxx amount of GP from party 85 xxxx                 $C0AD7F     Take xxxx amount of GP from party
Line 140: Line 149:
 8F                      $C0AFF8     Unlock all of Cyan's SwordTechs 8F                      $C0AFF8     Unlock all of Cyan's SwordTechs
 90                      $C0B002     Grant Sabin the Bum Rush 90                      $C0B002     Grant Sabin the Bum Rush
 +</code>
 +==== Wait/Pause (91-95) ====
 +<code>
 91                      $C0B23F     Pause for 1/4 second 91                      $C0B23F     Pause for 1/4 second
 92                      $C0B249     Pause for 1/2 second 92                      $C0B249     Pause for 1/2 second
Line 145: Line 157:
 94                      $C0B25D     Pause for 1 second 94                      $C0B25D     Pause for 1 second
 95                      $C0B267     Pause for 2 seconds 95                      $C0B267     Pause for 2 seconds
 +</code>
 +==== Menus, Timers and Cinematics (96-aF) ====
 +<code>
 96                      $C0A7F0     Refresh screen after a menu or battle 96                      $C0A7F0     Refresh screen after a menu or battle
 97                      $C0A7FD     Fade screen to black 97                      $C0A7FD     Fade screen to black
Line 153: Line 168:
 9C xx                   $C0B08C 9C xx                   $C0B08C
 9D                      $C0B09C     Invoke Party Order screen (from final battle) 9D                      $C0B09C     Invoke Party Order screen (from final battle)
-A0 xx yy zz aa bb       $C0B0E0 +A0 xx xx yy yy zz       $C0B0E0     Set timer to XXXX jiffies, jump to YYYY on expiration, flags ZZ (includes index, etc.) 
-A1 xx                   $C0B10E +A1 xx                   $C0B10E     Reset timer XX 
-A2                      $C0B130 +A2                      $C0B130      
-A6                      $C0BA09 +A6                      $C0BA09      
-A7 xx                   $C0BA14+A7 xx                   $C0BA14     
 A8                      $C0BA51     Show Floating Island soaring into the sky A8                      $C0BA51     Show Floating Island soaring into the sky
 A9                      $C0B966     Show title screen A9                      $C0B966     Show title screen
 AA                      $C0B992     Show intro with Magitek Armor walking through snowfields AA                      $C0B992     Show intro with Magitek Armor walking through snowfields
 AB                      $C0B91B     Invoke game loading screen AB                      $C0B91B     Invoke game loading screen
-AC                      $C0B95E+AC                      $C0B95E     
 AD                      $C0BA69     Show world getting torn apart AD                      $C0BA69     Show world getting torn apart
 AE                      $C0B9C5     Show train car ride out of the Magitek Factory AE                      $C0B9C5     Show train car ride out of the Magitek Factory
 AF                      $C0A503     Invoke random Coliseum battle AF                      $C0A503     Invoke random Coliseum battle
 +</code>
 +==== Execution (B0-BF) ====
 +<code>
 B0 xx                   $C0B138     Repeat the the following commands (until B1 is encountered) xx times B0 xx                   $C0B138     Repeat the the following commands (until B1 is encountered) xx times
 B1                      $C0B145     End block of commands to repeat B1                      $C0B145     End block of commands to repeat
Line 185: Line 203:
                                     "c" represents the bit to test in CaseWord; if set, the jump will occur                                     "c" represents the bit to test in CaseWord; if set, the jump will occur
 BF                      $C0B9E7     Show airship scene from the ending BF                      $C0B9E7     Show airship scene from the ending
 +</code>
 +
 +====  Conditionals (C0-CF) ====
 +<code>
 +If MSB of bit to test is 0, the bit will be compared to 0, else it will be compared to 1.
 +[In a nutshell, if(tx & 0x8000) -> if(*tx); if(!(tx & 0x8000)) -> if(!(*tx))]
 +If result of all comparisons is true, jump will occur; otherwise, execution will occur at the next command.
 +Each condition to test (the bit value) is 2 bytes--the address to jump to is 3 bytes, and is added to $CA0000.
  
-C0-CF Conditionals: 
-    If MSB of bit to test is 0, the bit will be compared to 0, else it will be compared to 1. 
-    [In a nutshell, if(tx & 0x8000) -> if(*tx); if(!(tx & 0x8000)) -> if(!(*tx))] 
-    If result of all comparisons is true, jump will occur; otherwise, execution will occur at the next command. 
-    Each condition to test (the bit value) is 2 bytes--the address to jump to is 3 bytes, and is added to $CA0000. 
 C0-C7: $C0B2C8, C8-CF: $C0B32D C0-C7: $C0B2C8, C8-CF: $C0B32D
  
Line 209: Line 230:
 CE t1 t2 t3 t4 t5 t6 t7 addr        if(t1 && t2 && t3 && t4 && t5 && t6 && t7) jump; else continue; CE t1 t2 t3 t4 t5 t6 t7 addr        if(t1 && t2 && t3 && t4 && t5 && t6 && t7) jump; else continue;
 CF t1 t2 t3 t4 t5 t6 t7 t8 addr     if(t1 && t2 && t3 && t4 && t5 && t6 && t7 && t8) jump; else continue; CF t1 t2 t3 t4 t5 t6 t7 t8 addr     if(t1 && t2 && t3 && t4 && t5 && t6 && t7 && t8) jump; else continue;
 +</code>
  
 +==== Event Bits (D0-EF) ====
 +
 +<code>
 D0 xx                   $C0B593     Set event bit $0xx D0 xx                   $C0B593     Set event bit $0xx
 D1 xx                   $C0B5CF     Clear event bit $0xx D1 xx                   $C0B5CF     Clear event bit $0xx
Line 239: Line 264:
                                     Else If event word xx < yyyy then CaseWord = $0004                                     Else If event word xx < yyyy then CaseWord = $0004
 EF xx yy                $C0B7AA EF xx yy                $C0B7AA
 +</code>
 +
 +==== Sound / Music (F0-FC) ====
 +
 +<code>
 F0 xx                   $C0B780     Play song xx F0 xx                   $C0B780     Play song xx
 F1 xx yy                $C0B7D4     Fade in song xx with speed yy (higher == slower) F1 xx yy                $C0B7D4     Fade in song xx with speed yy (higher == slower)
 F2 xx                   $C0B811     Fade out current song with speed xx (higher == slower) F2 xx                   $C0B811     Fade out current song with speed xx (higher == slower)
-F3 xx                   $C0B827+F3 xx                   $C0B827     Continue song that was previously paused, xx is unknown
 F4 xx                   $C0B854     Play sound effect xx F4 xx                   $C0B854     Play sound effect xx
 F5 xx yy zz             $C0B85E F5 xx yy zz             $C0B85E
-F6 xx yy zz             $C0B889+F6 xx yy zz             $C0B889     Stop sound effect xx
 F7                      $C0B8A1 F7                      $C0B8A1
 F8                      $C0B8AF F8                      $C0B8AF
 F9 xx                   $C0B8BA F9 xx                   $C0B8BA
-FA                      $C0B8C7+FA                      $C0B8C7     Stop temporarily played song 
 +</code> 
 +==== End Script (FD-FF) ==== 
 +<code> 
 +FD                      $C0B8D2     NOP
 FE                      $C0B8D7     Return FE                      $C0B8D7     Return
 +</code>
 +
 +==== Unused General Actions ====
 +The following is a list of unused pointers from the general actions jump table ($C0/98C4).
 +<code>
 +C0/9926: 1A B9 (act. 66: ** NOT USED **)
 +C0/9928: 1A B9 (act. 67: ** NOT USED **)
 +C0/992A: 1A B9 (act. 68: ** NOT USED **)
 +C0/992C: 1A B9 (act. 69: ** NOT USED **)
 +
 +C0/9934: 1A B9 (act. 6D: ** NOT USED **)
 +C0/9936: 1A B9 (act. 6E: ** NOT USED **)
 +C0/9938: 1A B9 (act. 6F: ** NOT USED **)
 +
 +C0/9946: 1A B9 (act. 76: ** NOT USED **)
 +
 +C0/9960: 1A B9 (act. 83: ** NOT USED **)
 +
 +C0/9996: 1A B9 (act. 9E: ** NOT USED **)
 +C0/9998: 1A B9 (act. 9F: ** NOT USED **)
 +
 +C0/99A0: 1A B9 (act. A3: ** NOT USED **)
 +C0/99A2: 1A B9 (act. A4: ** NOT USED **)
 +C0/99A4: 1A B9 (act. A5: ** NOT USED **)
 +
 +C0/9A24: 1A B9 (act. E5: ** NOT USED **)
 +C0/9A26: 1A B9 (act. E6: ** NOT USED **)
 +
 +C0/9A32: 1A B9 (act. EC: ** NOT USED **)
 +C0/9A34: 1A B9 (act. ED: ** NOT USED **)
 +C0/9A36: 1A B9 (act. EE: ** NOT USED **)
 +
 +C0/9A52: 1A B9 (act. FC: ** NOT USED **)
 +C0/9A58: 1A B9 (act. FF: ** NOT USED **)
 </code> </code>
  • ff3/ff3us/doc/asm/codes/event_codes.1459672473.txt.gz
  • Last modified: 5 years ago
  • (external edit)