ff9mapkit 1.0.0b3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. ff9mapkit/__init__.py +18 -0
  2. ff9mapkit/__main__.py +36 -0
  3. ff9mapkit/_animdb.py +2994 -0
  4. ff9mapkit/_animdb_all.py +14125 -0
  5. ff9mapkit/_fieldtable.py +1516 -0
  6. ff9mapkit/_fieldtext.py +845 -0
  7. ff9mapkit/_held_poses.py +44 -0
  8. ff9mapkit/_itemdb.py +65 -0
  9. ff9mapkit/_modeldb.py +725 -0
  10. ff9mapkit/_narrowmap_data.py +10 -0
  11. ff9mapkit/_npcparams.py +634 -0
  12. ff9mapkit/_regen_animdb.py +72 -0
  13. ff9mapkit/_regen_animdb_all.py +66 -0
  14. ff9mapkit/_regen_fieldtable.py +95 -0
  15. ff9mapkit/_regen_fieldtext.py +66 -0
  16. ff9mapkit/_regen_modeldb.py +67 -0
  17. ff9mapkit/_regen_npcparams.py +123 -0
  18. ff9mapkit/_regen_scenedb.py +57 -0
  19. ff9mapkit/_scenedb.py +869 -0
  20. ff9mapkit/abilities.py +225 -0
  21. ff9mapkit/animations.py +120 -0
  22. ff9mapkit/archetypes.py +218 -0
  23. ff9mapkit/areatitle.py +76 -0
  24. ff9mapkit/battle/__init__.py +21 -0
  25. ff9mapkit/battle/abilityfeatures.py +294 -0
  26. ff9mapkit/battle/actiondelta.py +441 -0
  27. ff9mapkit/battle/aiauthor.py +305 -0
  28. ff9mapkit/battle/ailint.py +140 -0
  29. ff9mapkit/battle/aipatch.py +175 -0
  30. ff9mapkit/battle/battleai.py +148 -0
  31. ff9mapkit/battle/battlecsv.py +390 -0
  32. ff9mapkit/battle/battlepatch.py +395 -0
  33. ff9mapkit/battle/build.py +558 -0
  34. ff9mapkit/battle/camera_codec.py +332 -0
  35. ff9mapkit/battle/camera_data.py +128 -0
  36. ff9mapkit/battle/characterdelta.py +789 -0
  37. ff9mapkit/battle/event_data.py +72 -0
  38. ff9mapkit/battle/extract.py +540 -0
  39. ff9mapkit/battle/fbx.py +223 -0
  40. ff9mapkit/battle/reskin.py +149 -0
  41. ff9mapkit/battle/scene_codec.py +314 -0
  42. ff9mapkit/battle/scene_data.py +369 -0
  43. ff9mapkit/battle/scenelint.py +125 -0
  44. ff9mapkit/battle/seqasm.py +131 -0
  45. ff9mapkit/battle/seqauthor.py +220 -0
  46. ff9mapkit/battle/seqcodec.py +300 -0
  47. ff9mapkit/battle/seqdis.py +106 -0
  48. ff9mapkit/battle/seqpatch.py +137 -0
  49. ff9mapkit/battle_bgm.py +133 -0
  50. ff9mapkit/binutils.py +60 -0
  51. ff9mapkit/build.py +5445 -0
  52. ff9mapkit/campaign.py +1276 -0
  53. ff9mapkit/catalog.py +316 -0
  54. ff9mapkit/chain.py +358 -0
  55. ff9mapkit/cli.py +3114 -0
  56. ff9mapkit/config.py +360 -0
  57. ff9mapkit/content/__init__.py +13 -0
  58. ff9mapkit/content/areatitle.py +36 -0
  59. ff9mapkit/content/ate.py +118 -0
  60. ff9mapkit/content/camera.py +123 -0
  61. ff9mapkit/content/chest.py +186 -0
  62. ff9mapkit/content/choice.py +163 -0
  63. ff9mapkit/content/conductor.py +217 -0
  64. ff9mapkit/content/cutscene.py +290 -0
  65. ff9mapkit/content/encounter.py +41 -0
  66. ff9mapkit/content/entry_settle.py +50 -0
  67. ff9mapkit/content/equipment.py +93 -0
  68. ff9mapkit/content/event.py +191 -0
  69. ff9mapkit/content/gateway.py +101 -0
  70. ff9mapkit/content/inventory.py +59 -0
  71. ff9mapkit/content/itemdata.py +644 -0
  72. ff9mapkit/content/itemtext.py +168 -0
  73. ff9mapkit/content/jump.py +114 -0
  74. ff9mapkit/content/ladder.py +633 -0
  75. ff9mapkit/content/movement.py +53 -0
  76. ff9mapkit/content/music.py +97 -0
  77. ff9mapkit/content/npc.py +348 -0
  78. ff9mapkit/content/object.py +340 -0
  79. ff9mapkit/content/onentry.py +135 -0
  80. ff9mapkit/content/party.py +111 -0
  81. ff9mapkit/content/pathfind.py +138 -0
  82. ff9mapkit/content/platform.py +314 -0
  83. ff9mapkit/content/player.py +168 -0
  84. ff9mapkit/content/prop.py +75 -0
  85. ff9mapkit/content/region.py +340 -0
  86. ff9mapkit/content/reinit.py +59 -0
  87. ff9mapkit/content/savepoint.py +90 -0
  88. ff9mapkit/content/shop.py +178 -0
  89. ff9mapkit/content/sps_trigger.py +66 -0
  90. ff9mapkit/content/startup.py +71 -0
  91. ff9mapkit/content/synthesis.py +106 -0
  92. ff9mapkit/content/text.py +183 -0
  93. ff9mapkit/content/textcarry.py +290 -0
  94. ff9mapkit/content/verbatim.py +86 -0
  95. ff9mapkit/content/walkmesh_hotfix.py +38 -0
  96. ff9mapkit/data/__init__.py +48 -0
  97. ff9mapkit/data/_regen_provenance.py +142 -0
  98. ff9mapkit/data/provenance/blank.es.patch +1 -0
  99. ff9mapkit/data/provenance/blank.fr.patch +1 -0
  100. ff9mapkit/data/provenance/blank.gr.patch +1 -0
  101. ff9mapkit/data/provenance/blank.it.patch +1 -0
  102. ff9mapkit/data/provenance/blank.jp.patch +1 -0
  103. ff9mapkit/data/provenance/blank.uk.patch +1 -0
  104. ff9mapkit/data/provenance/blank.us.patch +1 -0
  105. ff9mapkit/data/provenance/manifest.json +65 -0
  106. ff9mapkit/data/provenance/region_template.patch +1 -0
  107. ff9mapkit/data/reference_arcs.toml +89 -0
  108. ff9mapkit/data/region_catalog.toml +593 -0
  109. ff9mapkit/deploystack.py +358 -0
  110. ff9mapkit/dialogue.py +803 -0
  111. ff9mapkit/eb/__init__.py +12 -0
  112. ff9mapkit/eb/_exprtable.py +59 -0
  113. ff9mapkit/eb/_membertable.py +38 -0
  114. ff9mapkit/eb/_optables.py +537 -0
  115. ff9mapkit/eb/_regen_optables.py +76 -0
  116. ff9mapkit/eb/cmdasm.py +323 -0
  117. ff9mapkit/eb/disasm.py +332 -0
  118. ff9mapkit/eb/edit.py +439 -0
  119. ff9mapkit/eb/exprasm.py +158 -0
  120. ff9mapkit/eb/model.py +178 -0
  121. ff9mapkit/eb/opcodes.py +463 -0
  122. ff9mapkit/eblint.py +177 -0
  123. ff9mapkit/editor/__init__.py +20 -0
  124. ff9mapkit/editor/app.py +950 -0
  125. ff9mapkit/editor/battle_forms.py +240 -0
  126. ff9mapkit/editor/breadcrumb.py +89 -0
  127. ff9mapkit/editor/dialogs.py +116 -0
  128. ff9mapkit/editor/feedback.py +208 -0
  129. ff9mapkit/editor/forms.py +632 -0
  130. ff9mapkit/editor/graphview.py +350 -0
  131. ff9mapkit/editor/jobs.py +342 -0
  132. ff9mapkit/editor/model.py +243 -0
  133. ff9mapkit/editor/picker.py +120 -0
  134. ff9mapkit/editor/theme.py +212 -0
  135. ff9mapkit/eventscan.py +1441 -0
  136. ff9mapkit/extract.py +2279 -0
  137. ff9mapkit/flags.py +693 -0
  138. ff9mapkit/forkreport.py +1383 -0
  139. ff9mapkit/hub.py +477 -0
  140. ff9mapkit/idgated.py +101 -0
  141. ff9mapkit/infohub.py +580 -0
  142. ff9mapkit/items.py +63 -0
  143. ff9mapkit/itemstats.py +346 -0
  144. ff9mapkit/journey.py +1902 -0
  145. ff9mapkit/keyitems.py +93 -0
  146. ff9mapkit/logic_add.py +632 -0
  147. ff9mapkit/logic_edit.py +728 -0
  148. ff9mapkit/logic_map.py +526 -0
  149. ff9mapkit/pack.py +175 -0
  150. ff9mapkit/playerswap.py +231 -0
  151. ff9mapkit/prop_archetypes.py +228 -0
  152. ff9mapkit/provision.py +282 -0
  153. ff9mapkit/refarc.py +825 -0
  154. ff9mapkit/save.py +337 -0
  155. ff9mapkit/save_items.py +1673 -0
  156. ff9mapkit/scene/__init__.py +11 -0
  157. ff9mapkit/scene/arena.py +63 -0
  158. ff9mapkit/scene/bgart.py +140 -0
  159. ff9mapkit/scene/bgi.py +732 -0
  160. ff9mapkit/scene/bgs.py +174 -0
  161. ff9mapkit/scene/bgx.py +185 -0
  162. ff9mapkit/scene/cam.py +345 -0
  163. ff9mapkit/scene/guide.py +311 -0
  164. ff9mapkit/scene/paint.py +506 -0
  165. ff9mapkit/scene/placeholder.py +107 -0
  166. ff9mapkit/sjbinary.py +285 -0
  167. ff9mapkit/sps/__init__.py +17 -0
  168. ff9mapkit/sps/author.py +294 -0
  169. ff9mapkit/sps/catalog.py +88 -0
  170. ff9mapkit/sps/codec.py +264 -0
  171. ff9mapkit/sps/edit.py +184 -0
  172. ff9mapkit/sps/lint.py +58 -0
  173. ff9mapkit/sps/render.py +116 -0
  174. ff9mapkit/sps/templates.py +47 -0
  175. ff9mapkit/sps/texture.py +131 -0
  176. ff9mapkit/walkmesh_hotfixes.py +163 -0
  177. ff9mapkit/workspace/__init__.py +18 -0
  178. ff9mapkit/workspace/battledoc.py +985 -0
  179. ff9mapkit/workspace/builddoc.py +607 -0
  180. ff9mapkit/workspace/forms_qt.py +586 -0
  181. ff9mapkit/workspace/importdoc.py +665 -0
  182. ff9mapkit/workspace/mapview.py +131 -0
  183. ff9mapkit/workspace/palette.py +85 -0
  184. ff9mapkit/workspace/savedoc.py +664 -0
  185. ff9mapkit/workspace/shell.py +6907 -0
  186. ff9mapkit/workspace/style.py +105 -0
  187. ff9mapkit/workspace/tuningdialog.py +223 -0
  188. ff9mapkit-1.0.0b3.dist-info/METADATA +155 -0
  189. ff9mapkit-1.0.0b3.dist-info/RECORD +193 -0
  190. ff9mapkit-1.0.0b3.dist-info/WHEEL +5 -0
  191. ff9mapkit-1.0.0b3.dist-info/entry_points.txt +5 -0
  192. ff9mapkit-1.0.0b3.dist-info/licenses/LICENSE +31 -0
  193. ff9mapkit-1.0.0b3.dist-info/top_level.txt +1 -0
@@ -0,0 +1,12 @@
1
+ """The FF9 field event-script (``.eb``) library.
2
+
3
+ model - EbScript: byte-exact parsed view (round-trip is identity)
4
+ disasm - instruction decoder (Instr) over the baked opcode tables
5
+ edit - structural edits: insert_bytes, append_entry, nop_range, locators, jump safety
6
+ opcodes - byte encoders for the opcodes the kit emits
7
+ """
8
+
9
+ from . import disasm, edit, model, opcodes
10
+ from .model import EbScript, Entry, Func
11
+
12
+ __all__ = ["model", "disasm", "edit", "opcodes", "EbScript", "Entry", "Func"]
@@ -0,0 +1,59 @@
1
+ """The `.eb` EXPRESSION sub-language vocabulary -- the `op_binary` operator table + the variable-token encoding.
2
+
3
+ Committed, hand-transcribed from the open-source Memoria ``EBin.cs`` (the ``op_binary`` / ``VariableSource`` /
4
+ ``VariableType`` enums -- names/values only, provenance-clean). The disassembler's ``read_expr`` decodes an
5
+ expression's token stream but labels each operator ``opXX``; this table turns those into the real mnemonics
6
+ (``B_CURHP``, ``B_LT``, ``B_PLUS``, ``B_SYSVAR`` …) and decodes a ``0xC0+`` variable token into its
7
+ ``source.type[index]`` form -- which is what makes an enemy-AI script (or any field script) READABLE.
8
+
9
+ A var token byte (>= 0xC0, the ``B_VAR`` base) encodes (``EBin.expr_varSpec`` / ``getVarOperation``):
10
+ bit7,6 = 1 (the 0xC0 base) · bit5 = long-index (a 2-byte index follows, else 1) · bits 4-2 = VariableType ·
11
+ bits 1-0 = VariableSource (only 0-3 -- Global/Map/Instance/Null; the higher sources Object/System/Member come
12
+ from their own tokens B_OBJSPECA/B_SYSLIST/B_MEMBER). e.g. ``0xC4`` = Global + Bit (a story-flag read, the
13
+ kit's GLOB_BOOL); ``0xC5`` = Map + Bit (the transient MAP_BOOL twin).
14
+ """
15
+ from __future__ import annotations
16
+
17
+ # op_binary (EBin.cs): the expression operator token -> mnemonic. 0-127; 0x29/0x5F/0x78-0x7E are the operators
18
+ # that read inline operand bytes (handled by read_expr), the rest are pure stack operators.
19
+ EXPR_OP_NAMES = {
20
+ 0: "B_PAD0", 1: "B_PAD1", 2: "B_PAD2", 3: "B_PAD3",
21
+ 4: "B_POST_PLUS", 5: "B_POST_MINUS", 6: "B_PRE_PLUS", 7: "B_PRE_MINUS",
22
+ 8: "B_POST_PLUS_A", 9: "B_POST_MINUS_A", 10: "B_PRE_PLUS_A", 11: "B_PRE_MINUS_A",
23
+ 12: "B_SINGLE_PLUS", 13: "B_SINGLE_MINUS", 14: "B_NOT", 15: "B_NOT_E", 16: "B_COMP",
24
+ 17: "B_MULT", 18: "B_DIV", 19: "B_REM", 20: "B_PLUS", 21: "B_MINUS",
25
+ 22: "B_SHIFT_LEFT", 23: "B_SHIFT_RIGHT", 24: "B_LT", 25: "B_GT", 26: "B_LE", 27: "B_GE",
26
+ 28: "B_LT_E", 29: "B_GT_E", 30: "B_LE_E", 31: "B_GE_E", 32: "B_EQ", 33: "B_NE", 34: "B_EQ_E", 35: "B_NE_E",
27
+ 36: "B_AND", 37: "B_XOR", 38: "B_OR", 39: "B_ANDAND", 40: "B_OROR", 41: "B_MEMBER", 42: "B_COUNT",
28
+ 43: "B_PICK", 44: "B_LET", 45: "B_LET_A", 46: "B_LET_E", 47: "B_MULT_LET", 48: "B_DIV_LET", 49: "B_REM_LET",
29
+ 50: "B_PLUS_LET", 51: "B_MINUS_LET", 52: "B_SHIFT_LEFT_LET", 53: "B_SHIFT_RIGHT_LET",
30
+ 54: "B_MULT_LET_A", 55: "B_DIV_LET_A", 56: "B_REM_LET_A", 57: "B_PLUS_LET_A", 58: "B_MINUS_LET_A",
31
+ 59: "B_SHIFT_LEFT_LET_A", 60: "B_SHIFT_RIGHT_LET_A", 61: "B_AND_LET", 62: "B_XOR_LET", 63: "B_OR_LET",
32
+ 64: "B_AND_LET_A", 65: "B_XOR_LET_A", 66: "B_OR_LET_A", 67: "B_AND_LET_E", 68: "B_XOR_LET_E", 69: "B_OR_LET_E",
33
+ 70: "B_CAST8", 71: "B_CAST8U", 72: "B_CAST16", 73: "B_CAST16U", 74: "B_CAST_LIST", 75: "B_LMAX", 76: "B_LMIN",
34
+ 77: "B_SELECT", 78: "B_OBJSPEC", 79: "B_KEYON", 80: "B_SIN2", 81: "B_COS2",
35
+ 82: "B_CURHP", 83: "B_MAXHP", 84: "B_AND_E", 85: "B_NAND_E", 86: "B_XOR_E", 87: "B_OR_E",
36
+ 88: "B_KEYOFF", 89: "B_KEY", 90: "B_KEYON2", 91: "B_KEYOFF2", 92: "B_KEY2",
37
+ 93: "B_ANGLE", 94: "B_DISTANCE", 95: "B_PTR", 96: "B_ANGLEA", 97: "B_DISTANCEA", 98: "B_SIN", 99: "B_COS",
38
+ 100: "B_HAVE_ITEM", 101: "B_BAFRAME", 102: "B_ANGLE2", 103: "pad67", 104: "pad68", 105: "pad69",
39
+ 106: "B_FRAME", 107: "B_PARTYCHK", 108: "B_SPS", 109: "B_PARTYADD", 110: "B_CURMP", 111: "B_MAXMP",
40
+ 112: "B_BGIID", 113: "B_BGIFLOOR", 120: "B_OBJSPECA", 121: "B_SYSLIST", 122: "B_SYSVAR",
41
+ 123: "B_pad7b", 124: "B_PAD4", 125: "B_CONST", 126: "B_CONST4", 127: "B_EXPR_END",
42
+ }
43
+
44
+ # VariableSource / VariableType (EBin.cs). The var-token decode uses source 0-3 (the only ones the 0xC0 token
45
+ # encodes); 4-7 are reached via dedicated tokens and listed for completeness.
46
+ VAR_SOURCE = {0: "Global", 1: "Map", 2: "Instance", 3: "Null", 4: "Object", 5: "System", 6: "Member", 7: "Int26"}
47
+ VAR_TYPE = {0: "SBit", 1: "Bit", 2: "Int24", 3: "UInt24", 4: "SByte", 5: "Byte", 6: "Int16", 7: "UInt16"}
48
+
49
+
50
+ def expr_op_name(token: int) -> str:
51
+ """Mnemonic for an expression operator token (or ``opXX`` if it isn't a defined op_binary value)."""
52
+ return EXPR_OP_NAMES.get(token, f"op{token:02X}")
53
+
54
+
55
+ def decode_var(token: int, index: int) -> str:
56
+ """A ``0xC0+`` variable token + its decoded index -> ``Source.Type[index]`` (e.g. ``Global.Bit[8512]``)."""
57
+ src = VAR_SOURCE.get(token & 3, f"src{token & 3}")
58
+ typ = VAR_TYPE.get((token >> 2) & 7, f"t{(token >> 2) & 7}")
59
+ return f"{src}.{typ}[{index}]"
@@ -0,0 +1,38 @@
1
+ """Battle-AI ``B_MEMBER(N)`` selector -> field-name table (the read/write members of a battle unit).
2
+
3
+ In a battle ``.eb`` AI expression, ``B_SYSLIST[u] B_MEMBER(N)`` reads member ``N`` of battle unit ``u``
4
+ (``B_SYSLIST[1]`` = the acting unit / SELF, ``B_SYSLIST[0]`` = the target). ``N`` is NOT a byte offset -- it is a
5
+ SWITCH-CASE selector in Memoria's ``btl_scrp.GetCharacterData(BTL_DATA, id)`` (and the symmetric
6
+ ``SetCharacterData``, so ``B_MEMBER(N) <expr> B_LET_A`` WRITES it). This table maps the selectors to readable
7
+ names so the disassembler can annotate ``B_MEMBER(36)`` as ``cur.hp`` and an author can write ``B_MEMBER(cur.hp)``.
8
+
9
+ Provenance-clean: only the case numbers + field NAMES (transcribed from the open-source ``btl_scrp.cs`` switch),
10
+ no SE bytes. Distinct from the op_binary ``B_CURHP``/``B_MAXHP`` tokens (``_exprtable``), which read a PARTY slot
11
+ via ``GetPlayer`` -- NOT the acting unit's own battle HP. See memory ``project-ff9-battle-ai-members``.
12
+ """
13
+ from __future__ import annotations
14
+
15
+ # selector (GetCharacterData case id) -> canonical name. Only the READABLE cases are listed (a few selectors are
16
+ # write-only -- e.g. 55/56 model-scale -- and return a default when read; omitted to avoid implying a read).
17
+ MEMBER_NAMES: dict[int, str] = {
18
+ 35: "max.hp", 36: "cur.hp", 37: "max.mp", 38: "cur.mp", 39: "max.at", 40: "cur.at", 41: "level",
19
+ 42: "status.invalid.hi", 43: "status.invalid.lo", 44: "status.permanent.hi", 45: "status.permanent.lo",
20
+ 46: "status.cur.hi", 47: "status.cur.lo",
21
+ 48: "elem.invalid", 49: "elem.absorb", 50: "elem.half", 51: "elem.weak",
22
+ 52: "target", 53: "disappear", 57: "geo_id", 58: "mesh", 64: "row", 65: "line_no",
23
+ 72: "str", 73: "mgc", 74: "phys_def", 75: "phys_evade", 76: "mag_def", 77: "mag_evade",
24
+ 112: "motion", 114: "cur_attack",
25
+ 140: "pos.x", 141: "pos.ny", 142: "pos.z", 146: "exp", 147: "gil", 148: "trance", 149: "t_gauge",
26
+ }
27
+
28
+ _NAME_TO_SELECTOR: dict[str, int] = {n: s for s, n in MEMBER_NAMES.items()}
29
+
30
+
31
+ def member_name(selector: int) -> str | None:
32
+ """The field name for a ``B_MEMBER`` selector (e.g. 36 -> ``cur.hp``), or None if not a known readable member."""
33
+ return MEMBER_NAMES.get(selector)
34
+
35
+
36
+ def member_selector(name: str) -> int | None:
37
+ """The ``B_MEMBER`` selector for a field name (e.g. ``cur.hp`` -> 36), or None if the name is unknown."""
38
+ return _NAME_TO_SELECTOR.get(name)
@@ -0,0 +1,537 @@
1
+ """Auto-generated FF9 event-script opcode tables (snapshot of Memoria source).
2
+
3
+ DO NOT EDIT BY HAND. Regenerate with: python -m ff9mapkit.eb._regen_optables
4
+ Source: Memoria Assembly-CSharp/Global/Event/Engine/EventEngineUtils.cs (opArgCount, opArgSize)
5
+ and EventEngine.DoEventCode.cs (opcode names).
6
+
7
+ OP_ARG_COUNT[op] : number of operands. Negative => variable (count read from the stream).
8
+ OP_ARG_SIZE[op] : per-operand byte width (None where unused / variable).
9
+ OP_NAMES[op] : human-readable mnemonic (cosmetic; missing entries fall back to op_XX).
10
+ """
11
+
12
+ OP_ARG_COUNT = [
13
+ 0, 1, 1, 1, 0, 1, -1, 2, 2, 2, 0, -1, 0, -1, 0, 0, 3, 0, 3, 0,
14
+ 3, 0, 2, 0, 2, 0, 2, 1, 1, 2, 5, 3, 3, 1, 1, 2, 1, 0, 1, 1,
15
+ 4, -1, 2, 1, 0, 0, 0, 2, 0, 0, 2, 1, 1, 1, 1, 2, 1, 2, 2, 1,
16
+ 5, 2, 1, 2, 1, 0, 0, 1, 0, 0, 0, 1, 2, 2, 2, 3, 3, 1, 0, 1,
17
+ 0, 2, 1, 0, 1, 1, 2, 1, 3, 4, 4, 2, 4, 4, 3, 2, 2, 2, 2, 3,
18
+ 2, 3, 2, 2, 1, 1, 0, 3, 0, 0, 0, 4, 2, 3, 1, 0, 0, 2, 2, 2,
19
+ 0, 0, 1, 1, 2, 1, 1, 0, 0, 2, 2, 1, 0, 1, 4, 2, 4, 4, 2, 2,
20
+ 3, 1, 0, 4, 0, 1, 7, 1, 3, 4, 4, 1, 1, 1, 2, 2, 0, 0, 0, 4,
21
+ 0, 3, 3, 4, 0, 2, 1, 1, 1, 1, 0, 0, 1, 4, 1, 0, 1, 0, 2, 5,
22
+ 1, 1, 1, 0, 0, 2, 2, 3, 1, 2, 1, 3, 2, 2, 2, 2, 2, 2, 3, 4,
23
+ 5, 5, 2, 2, 1, 1, 1, 1, 1, 0, 0, 0, 3, 0, 0, 1, 2, 2, 5, 2,
24
+ 0, 1, 2, 1, 0, 0, 4, 1, 5, 1, 2, 2, 3, 0, 0, 0, 6, 3, 0, 1,
25
+ 0, 2, 2, 2, 2, 0, 1, 1, 3, 3, 1, 1, 2, 2, 5, 0, 2, 2, 2, 2,
26
+ 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 3, 3, 2,
27
+ ]
28
+
29
+ OP_ARG_SIZE = [
30
+ None,
31
+ [2],
32
+ [2],
33
+ [2],
34
+ None,
35
+ [0],
36
+ [2, 2, 2],
37
+ [1, 1],
38
+ [1, 1],
39
+ [1, 1],
40
+ None,
41
+ [2, 2, 2],
42
+ None,
43
+ None,
44
+ None,
45
+ None,
46
+ [1, 1, 1],
47
+ None,
48
+ [1, 1, 1],
49
+ None,
50
+ [1, 1, 1],
51
+ None,
52
+ [1, 1],
53
+ None,
54
+ [1, 1],
55
+ None,
56
+ [1, 1],
57
+ [1],
58
+ [1],
59
+ [2, 2],
60
+ [1, 2, 2, 2, 2],
61
+ [1, 1, 2],
62
+ [1, 1, 2],
63
+ [1],
64
+ [1],
65
+ [2, 2],
66
+ [1],
67
+ None,
68
+ [1],
69
+ [1],
70
+ [1, 1, 1, 1],
71
+ [4],
72
+ [1, 2],
73
+ [2],
74
+ None,
75
+ None,
76
+ None,
77
+ [2, 1],
78
+ None,
79
+ None,
80
+ [1, 1],
81
+ [2],
82
+ [2],
83
+ [2],
84
+ [1],
85
+ [1, 1],
86
+ [1],
87
+ [1, 1],
88
+ [1, 1],
89
+ [1],
90
+ [1, 2, 2, 2, 2],
91
+ [1, 1],
92
+ [1],
93
+ [1, 1],
94
+ [2],
95
+ None,
96
+ None,
97
+ [1],
98
+ None,
99
+ None,
100
+ None,
101
+ [1],
102
+ [2, 1],
103
+ [2, 1],
104
+ [1, 2],
105
+ [1, 1, 1],
106
+ [1, 1, 1],
107
+ [1],
108
+ None,
109
+ [1],
110
+ None,
111
+ [1, 1],
112
+ [2],
113
+ None,
114
+ [1],
115
+ [1],
116
+ [1, 1],
117
+ [1],
118
+ [2, 2, 2],
119
+ [1, 1, 1, 1],
120
+ [1, 2, 2, 2],
121
+ [1, 1],
122
+ [1, 1, 2, 2],
123
+ [1, 1, 2, 2],
124
+ [1, 2, 2],
125
+ [1, 1],
126
+ [1, 1],
127
+ [1, 2],
128
+ [1, 1],
129
+ [1, 1, 1],
130
+ [1, 1],
131
+ [1, 1, 1],
132
+ [1, 2],
133
+ [1, 1],
134
+ [1],
135
+ [2],
136
+ None,
137
+ [1, 1, 1],
138
+ None,
139
+ None,
140
+ None,
141
+ [2, 2, 1, 1],
142
+ [1, 1],
143
+ [1, 1, 1],
144
+ [2],
145
+ None,
146
+ None,
147
+ [1, 1],
148
+ [2, 2],
149
+ [2, 2],
150
+ None,
151
+ None,
152
+ [2],
153
+ [2],
154
+ [2, 1],
155
+ [1],
156
+ [1],
157
+ None,
158
+ None,
159
+ [1, 1],
160
+ [2, 2],
161
+ [1],
162
+ None,
163
+ [1],
164
+ [1, 1, 1, 1],
165
+ [1, 1],
166
+ [1, 2, 2, 2],
167
+ [2, 2, 2, 1],
168
+ [1, 1],
169
+ [1, 1],
170
+ [1, 1, 2],
171
+ [1],
172
+ None,
173
+ [1, 1, 1, 1],
174
+ None,
175
+ [1],
176
+ [1, 2, 1, 1, 1, 1, 1],
177
+ [1],
178
+ [2, 1, 1],
179
+ [1, 1, 1, 2],
180
+ [1, 1, 1, 2],
181
+ [1],
182
+ [1],
183
+ [1],
184
+ [2, 1],
185
+ [2, 2],
186
+ None,
187
+ None,
188
+ None,
189
+ [1, 1, 1, 1],
190
+ None,
191
+ [2, 2, 2],
192
+ [2, 2, 2],
193
+ [1, 1, 1, 1],
194
+ None,
195
+ [2, 2],
196
+ [1],
197
+ [1],
198
+ [1],
199
+ [1],
200
+ None,
201
+ None,
202
+ [2],
203
+ [1, 2, 2, 2],
204
+ [2],
205
+ None,
206
+ [2],
207
+ None,
208
+ [1, 2],
209
+ [1, 1, 2, 2, 2],
210
+ [2],
211
+ [1],
212
+ [2],
213
+ None,
214
+ None,
215
+ [1, 2],
216
+ [1, 2],
217
+ [1, 1, 1],
218
+ [1],
219
+ [1, 2],
220
+ [1],
221
+ [1, 2, 2],
222
+ [1, 1],
223
+ [1, 1],
224
+ [1, 1],
225
+ [1, 1],
226
+ [1, 2],
227
+ [2, 2],
228
+ [2, 2, 3],
229
+ [2, 2, 3, 1],
230
+ [2, 2, 3, 1, 1],
231
+ [1, 2, 2, 2, 2],
232
+ [1, 1],
233
+ [1, 1],
234
+ [2],
235
+ [2],
236
+ [3],
237
+ [3],
238
+ [2],
239
+ None,
240
+ None,
241
+ None,
242
+ [2, 2, 2],
243
+ None,
244
+ None,
245
+ [1],
246
+ [1, 1],
247
+ [1, 1],
248
+ [1, 1, 1, 2, 2],
249
+ [1, 1],
250
+ None,
251
+ [1],
252
+ [1, 2],
253
+ [1],
254
+ None,
255
+ None,
256
+ [2, 2, 2, 1],
257
+ [1],
258
+ [1, 1, 2, 2, 1],
259
+ [1],
260
+ [1, 1],
261
+ [1, 1],
262
+ [2, 2, 2],
263
+ None,
264
+ None,
265
+ None,
266
+ [1, 1, 1, 1, 1, 1],
267
+ [1, 2, 2],
268
+ None,
269
+ [1],
270
+ None,
271
+ [1, 2],
272
+ [1, 2],
273
+ [1, 1],
274
+ [1, 1],
275
+ None,
276
+ [1],
277
+ [1],
278
+ [1, 1, 1],
279
+ [1, 1, 1],
280
+ [2],
281
+ [1],
282
+ [1, 1],
283
+ [1, 2],
284
+ [1, 1, 1, 1, 1],
285
+ None,
286
+ [1, 1],
287
+ [1, 1],
288
+ [1, 1],
289
+ [1, 1],
290
+ [1, 1],
291
+ [1, 2],
292
+ [1, 1],
293
+ [1, 2, 2],
294
+ [1, 1],
295
+ [1, 1],
296
+ [1, 1],
297
+ [1, 1],
298
+ [1, 1],
299
+ [1, 2],
300
+ [1, 1],
301
+ [1, 1, 1],
302
+ [1, 1, 1],
303
+ [1, 1],
304
+ ]
305
+
306
+ OP_NAMES = {
307
+ 0x00: 'NOTHING',
308
+ 0x07: 'InitCode',
309
+ 0x08: 'InitRegion',
310
+ 0x09: 'InitObject',
311
+ 0x10: 'RunScriptAsync',
312
+ 0x12: 'RunScript',
313
+ 0x14: 'RunScriptSync',
314
+ 0x16: 'RunScriptObjectAsync',
315
+ 0x18: 'RunScriptObject',
316
+ 0x1A: 'RunScriptObjectSync',
317
+ 0x1B: 'ContinueBattleMusic',
318
+ 0x1D: 'CreateObject',
319
+ 0x1E: 'SetCameraBounds',
320
+ 0x1F: 'WindowSync',
321
+ 0x20: 'WindowAsync',
322
+ 0x21: 'CloseWindow',
323
+ 0x23: 'Walk',
324
+ 0x24: 'WalkTowardObject',
325
+ 0x25: 'InitWalk',
326
+ 0x26: 'SetWalkSpeed',
327
+ 0x27: 'SetTriangleFlagMask',
328
+ 0x28: 'Cinematic',
329
+ 0x29: 'SetRegion',
330
+ 0x2A: 'Battle',
331
+ 0x2B: 'Field',
332
+ 0x2C: 'DefinePlayerCharacter',
333
+ 0x2D: 'DisableMove',
334
+ 0x2E: 'EnableMove',
335
+ 0x2F: 'SetModel',
336
+ 0x33: 'SetStandAnimation',
337
+ 0x34: 'SetWalkAnimation',
338
+ 0x36: 'TurnInstant',
339
+ 0x37: 'SetPitchAngle',
340
+ 0x38: 'Attack',
341
+ 0x39: 'ShowObject',
342
+ 0x3A: 'HideObject',
343
+ 0x3B: 'SetObjectIndex',
344
+ 0x3C: 'SetRandomBattles',
345
+ 0x3D: 'SetAnimationInOut',
346
+ 0x3E: 'SetAnimationSpeed',
347
+ 0x3F: 'SetAnimationFlags',
348
+ 0x40: 'RunAnimation',
349
+ 0x41: 'WaitAnimation',
350
+ 0x42: 'StopAnimation',
351
+ 0x43: 'RunSharedScript',
352
+ 0x44: 'WaitSharedScript',
353
+ 0x45: 'StopSharedScript',
354
+ 0x47: 'EnableHeadFocus',
355
+ 0x48: 'AddItem',
356
+ 0x49: 'RemoveItem',
357
+ 0x4A: 'RunBattleCode',
358
+ 0x4B: 'SetObjectLogicalSize',
359
+ 0x4C: 'AttachObject',
360
+ 0x4D: 'DetachObject',
361
+ 0x4E: '0x4E',
362
+ 0x4F: '0x4F',
363
+ 0x50: 'WaitTurn',
364
+ 0x51: 'TurnTowardObject',
365
+ 0x52: 'SetInactiveAnimation',
366
+ 0x53: 'PreventWindowInit',
367
+ 0x54: 'WaitWindow',
368
+ 0x55: 'SetWalkTurnSpeed',
369
+ 0x56: 'TimedTurn',
370
+ 0x57: 'SetRandomBattleFrequency',
371
+ 0x59: 'SetTileColor',
372
+ 0x5A: 'SetTilePositionEx',
373
+ 0x5B: 'ShowTile',
374
+ 0x5C: 'MoveTileLoop',
375
+ 0x5D: 'MoveTile',
376
+ 0x5E: 'SetTilePosition',
377
+ 0x5F: 'RunTileAnimation',
378
+ 0x60: 'ActivateTileAnimation',
379
+ 0x61: 'SetTileAnimationSpeed',
380
+ 0x62: 'SetRow',
381
+ 0x63: 'SetTileAnimationPause',
382
+ 0x64: 'SetTileAnimationFlags',
383
+ 0x65: 'RunTileAnimationEx',
384
+ 0x66: 'SetTextVariable',
385
+ 0x67: 'SetControlDirection',
386
+ 0x68: 'Bubble',
387
+ 0x69: 'ChangeTimerTime',
388
+ 0x6A: 'DisableRun',
389
+ 0x6B: 'SetBackgroundColor',
390
+ 0x6F: 'MoveCamera',
391
+ 0x70: 'ReleaseCamera',
392
+ 0x71: 'EnableCameraServices',
393
+ 0x72: 'SetCameraFollowHeight',
394
+ 0x73: 'EnableCameraFollow',
395
+ 0x74: 'DisableCameraFollow',
396
+ 0x75: 'Menu',
397
+ 0x76: 'DrawRegionStart',
398
+ 0x77: 'DrawRegionSetLast',
399
+ 0x78: 'DrawRegionPushNew',
400
+ 0x79: '0x79',
401
+ 0x7A: 'SetLeftAnimation',
402
+ 0x7B: 'SetRightAnimation',
403
+ 0x7C: 'EnableDialogChoices',
404
+ 0x7D: 'RunTimer',
405
+ 0x7E: 'SetFieldCamera',
406
+ 0x7F: 'EnableShadow',
407
+ 0x80: 'DisableShadow',
408
+ 0x81: 'SetShadowSize',
409
+ 0x82: 'SetShadowOffset',
410
+ 0x83: 'LockShadowRotation',
411
+ 0x84: 'UnlockShadowRotation',
412
+ 0x85: 'SetShadowAmplifier',
413
+ 0x86: 'SetAnimationStandSpeed',
414
+ 0x87: 'TurnInstantEx',
415
+ 0x88: 'RunModelCode',
416
+ 0x89: 'SetSoundPosition',
417
+ 0x8A: 'SetSoundObjectPosition',
418
+ 0x8B: 'SetHeadFocusMask',
419
+ 0x8C: 'BattleEx',
420
+ 0x8D: 'ShowTimer',
421
+ 0x8E: 'RaiseWindows',
422
+ 0x8F: 'SetModelColor',
423
+ 0x90: 'DisableInactiveAnimation',
424
+ 0x91: 'FollowFocus',
425
+ 0x92: 'AttachTile',
426
+ 0x93: 'SetObjectFlags',
427
+ 0x94: 'SetJumpAnimation',
428
+ 0x95: 'WindowSyncEx',
429
+ 0x96: 'WindowAsyncEx',
430
+ 0x97: 'ReturnEntryFunctions',
431
+ 0x98: 'MakeAnimationLoop',
432
+ 0x99: 'SetTurnSpeed',
433
+ 0x9A: 'EnablePathTriangle',
434
+ 0x9B: 'TurnTowardPosition',
435
+ 0x9C: 'RunJumpAnimation',
436
+ 0x9D: 'RunLandAnimation',
437
+ 0x9E: 'ExitField',
438
+ 0x9F: 'SetObjectSize',
439
+ 0xA0: 'WalkToExit',
440
+ 0xA1: 'MoveInstantXZY',
441
+ 0xA2: 'WalkXZY',
442
+ 0xA4: 'CalculateExitPosition',
443
+ 0xA5: 'Slide',
444
+ 0xA6: 'SetRunSpeedLimit',
445
+ 0xA7: 'Turn',
446
+ 0xA8: 'SetPathing',
447
+ 0xA9: 'CalculateScreenPosition',
448
+ 0xAA: 'EnableMenu',
449
+ 0xAB: 'DisableMenu',
450
+ 0xAC: 'ChangeDisc',
451
+ 0xAD: 'MoveInstantXZYEx',
452
+ 0xAE: 'TetraMaster',
453
+ 0xAF: 'DeleteAllCards',
454
+ 0xB0: 'SetFieldName',
455
+ 0xB1: 'ResetFieldName',
456
+ 0xB2: 'Party',
457
+ 0xB3: 'RunSPSCode',
458
+ 0xB4: 'SetPartyReserve',
459
+ 0xB5: 'PretendToBe',
460
+ 0xB6: 'WorldMap',
461
+ 0xB7: '0xB7',
462
+ 0xB8: '0xB8',
463
+ 0xB9: 'AddControllerMask',
464
+ 0xBA: 'RemoveControllerMask',
465
+ 0xBB: 'TimedTurnEx',
466
+ 0xBC: 'WaitTurnEx',
467
+ 0xBD: 'RunAnimationEx',
468
+ 0xBE: 'WaitAnimationEx',
469
+ 0xBF: 'MoveInstantEx',
470
+ 0xC0: 'EnableTextureAnimation',
471
+ 0xC1: 'RunTextureAnimation',
472
+ 0xC2: 'StopTextureAnimation',
473
+ 0xC3: 'SetTileCamera',
474
+ 0xC4: 'RunWorldCode',
475
+ 0xC5: 'RunSoundCode',
476
+ 0xC6: 'RunSoundCode1',
477
+ 0xC7: 'RunSoundCode2',
478
+ 0xC8: 'RunSoundCode3',
479
+ 0xC9: 'SetupTileLoopingWindow',
480
+ 0xCA: 'ResetTileAnimation',
481
+ 0xCB: 'EnablePath',
482
+ 0xCC: 'AddCharacterAttribute',
483
+ 0xCD: 'RemoveCharacterAttribute',
484
+ 0xCE: 'AddGi',
485
+ 0xCF: 'RemoveGi',
486
+ 0xD0: 'BattleDialog',
487
+ 0xD4: 'AttachObjectOffset',
488
+ 0xD5: 'HideAllObjects',
489
+ 0xD6: 'ShowAllObjects',
490
+ 0xD7: 'ATE',
491
+ 0xD8: 'SetWeather',
492
+ 0xD9: 'CureStatus',
493
+ 0xDA: 'RunSPSCodeSimple',
494
+ 0xDB: 'EnableVictoryPose',
495
+ 0xDC: 'Jump',
496
+ 0xDD: 'RemoveParty',
497
+ 0xDE: 'SetName',
498
+ 0xE0: 'AddFrog',
499
+ 0xE1: 'TerminateBattle',
500
+ 0xE2: 'SetupJump',
501
+ 0xE3: 'SetDialogProgression',
502
+ 0xE4: 'MoveTileLoopWithOffset',
503
+ 0xE5: 'AttackSpecial',
504
+ 0xE6: 'SetTileLoopType',
505
+ 0xE7: 'SetTileAnimationFrame',
506
+ 0xE8: 'SideWalkXZY',
507
+ 0xE9: 'UpdatePartyUID',
508
+ 0xEA: 'CalculateScreenOrigin',
509
+ 0xEB: 'CloseAllWindows',
510
+ 0xEC: 'FadeFilter',
511
+ 0xED: 'SetTileLoopAlpha',
512
+ 0xEE: 'EnableInactiveAnimation',
513
+ 0xEF: 'ShowHereIcon',
514
+ 0xF0: 'EnableRun',
515
+ 0xF1: 'SetHP',
516
+ 0xF2: 'SetMP',
517
+ 0xF3: 'UnlearnAbility',
518
+ 0xF4: 'LearnAbility',
519
+ 0xF5: 'GameOver',
520
+ 0xF6: 'VibrateController',
521
+ 0xF7: 'ActivateVibration',
522
+ 0xF8: 'RunVibrationTrack',
523
+ 0xF9: 'ActivateVibrationTrack',
524
+ 0xFA: 'SetVibrationSpeed',
525
+ 0xFB: 'SetVibrationFlags',
526
+ 0xFC: 'SetVibrationRange',
527
+ 0xFD: 'PreloadField',
528
+ 0xFE: 'SetCharacterData',
529
+ 0x102: '0x102',
530
+ 0x103: '0x103',
531
+ 0x104: '0x104',
532
+ 0x105: '0x105',
533
+ 0x106: '0x106',
534
+ 0x107: '0x107',
535
+ 0x108: '0x108',
536
+ 0x10A: '0x10A',
537
+ }