Brak opisu

language.h 24KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099
  1. #ifndef SCRIPT_LANG_H_
  2. #define SCRIPT_LANG_H_
  3. #include <config/core.h>
  4. #include <script/movement.h>
  5. #include <script/mugshot.h>
  6. #include <script/battlescreen.h>
  7. #include <script_constant.h> /*TODO: REMOVE ONCE THIS IS DEALT WITH*/
  8. @@ Costum Specials
  9. .equ SP_BATCHMAPTILE, 0x7
  10. @@ Compare operands
  11. .equ B_LT, 0x0
  12. .equ B_EQ, 0x1
  13. .equ B_GT, 0x2
  14. .equ B_LE, 0x3
  15. .equ B_GE, 0x4
  16. .equ B_NE, 0x5
  17. @@ Important flags
  18. .equ FLAG_PKMN_MENU, 0x828
  19. .equ FLAG_POKDEX, 0x829
  20. .equ FLAG_RUNNING_SHOES, 0x82F
  21. .equ FLAG_ORDEN_1, 0x820
  22. .equ FLAG_ORDEN_2, 0x821
  23. .equ FLAG_ORDEN_3, 0x822
  24. .equ FLAG_ORDEN_4, 0x823
  25. .equ FLAG_ORDEN_5, 0x824
  26. .equ FLAG_ORDEN_6, 0x825
  27. .equ FLAG_ORDEN_7, 0x826
  28. .equ FLAG_ORDEN_8, 0x827
  29. @@ LED NAMES
  30. .equ LED_CARUN_CITY_LINKS, 0x1
  31. .equ LED_ROUTE_2, 0x2
  32. .equ LED_ROUTE_3, 0x3
  33. .equ LED_URBANIA_CITY_LINKS, 0x4
  34. .equ LED_ROUTE_5, 0x5
  35. .equ LED_ROUTE_6, 0x6
  36. .equ LED_CARUN_CITY_RECHTS, 0x7
  37. .equ LED_URBANIA_CITY_RECHTS, 0x8
  38. @@ Flag operands
  39. .equ B_T, 0x0
  40. .equ B_F, 0x1
  41. @@ callstd alias
  42. .equ ITEM_OBTAIN, 0x0
  43. .equ ITEM_FIND, 0x1
  44. .equ MSG_FACE, 0x2
  45. .equ MSG_SIGN, 0x3
  46. .equ MSG_KEYOPEN, 0x4
  47. .equ MSG_YES_NO, 0x5
  48. .equ MSG_STD, 0x6
  49. @@ Definition
  50. .equ MUGFACE_LEFT, 0x0
  51. .equ MUGFACE_RIGHT, 0x1
  52. @@ Effect
  53. .equ EFFECT_NORMAL, 0x0
  54. .equ EFFECT_GREY, 0x1
  55. .equ EFFECT_SERPIA, 0x2
  56. @@@@@@@@@@@@@@@@@ Macro
  57. @@ Custom commands
  58. .macro batchmaptilefromto batchmaptile_tiles_from:req batchmaptile_tiles_to:req batchmaptile_kollision_from:req batchmaptile_kollision_to:req
  59. setvar 0x8000 \batchmaptile_tiles_from
  60. setvar 0x8001 \batchmaptile_tiles_to
  61. setvar 0x8002 \batchmaptile_kollision_from
  62. setvar 0x8003 \batchmaptile_kollision_to
  63. setvar 0x5006 SP_BATCHMAPTILE
  64. special 0x68
  65. .endm
  66. .macro batchmaptiletofrom batchmaptile_tiles_from:req batchmaptile_tiles_to:req batchmaptile_kollision_from:req batchmaptile_kollision_to:req
  67. setvar 0x8001 \batchmaptile_tiles_from
  68. setvar 0x8002 \batchmaptile_tiles_to
  69. setvar 0x8003 \batchmaptile_kollision_from
  70. setvar 0x8002 \batchmaptile_kollision_to
  71. setvar 0x5006 SP_BATCHMAPTILE
  72. special 0x68
  73. .endm
  74. .macro sethiddenflags
  75. call sethiddenflagsall
  76. .endm
  77. .macro seteffect seteffect_effect_id:req
  78. writebytetooffset \seteffect_effect_id 0x02036E28
  79. .endm
  80. .macro setecutscene
  81. writebytetooffset 0x80 0x4000044
  82. writebytetooffset 0x20 0x4000045
  83. .endm
  84. .macro clearcutscene
  85. writebytetooffset 0xFF 0x4000044
  86. writebytetooffset 0x00 0x4000045
  87. .endm
  88. .macro pokemsg pokemsg_string:req pokemsg_callstd:req pokemsg_ID:req
  89. checksound
  90. cry \pokemsg_ID 0x0
  91. showpokepic \pokemsg_ID 0x0 0x5
  92. loadpointer 0x0 \pokemsg_string
  93. callstd \pokemsg_callstd
  94. hidepokepic
  95. waitcry
  96. .endm
  97. .macro beben earthquake_horri:req earthquake_tiles:req earthquake_sec:req earthquake_vert:req
  98. setvar 0x8004 \earthquake_horri
  99. setvar 0x8005 \earthquake_tiles
  100. setvar 0x8006 \earthquake_sec
  101. setvar 0x8007 \earthquake_vert
  102. special 0x136
  103. .endm
  104. .macro lookbattle lookbattle_id:req lookbattle_before:req lookbattle_after:req
  105. trainerbattle 0x0 \lookbattle_id 0x0 \lookbattle_before \lookbattle_after
  106. .endm
  107. .macro gymbattle gymbattle_id:req gymbattle_before:req gymbattle_after:req gymbattle_later:req
  108. trainerbattle 0x1 \gymbattle_id 0x0 \gymbattle_before \gymbattle_after \gymbattle_later
  109. .endm
  110. .macro betweenbattle betweenbattle_id:req betweenbattle_before:req betweenbattle_after:req betweenbattle_between:req
  111. trainerbattle 0x2 \betweenbattle_id 0x0 \betweenbattle_before \betweenbattle_after \betweenbattle_between
  112. .endm
  113. .macro scriptbattle scriptbattle_id:req scriptbattle_after:req
  114. trainerbattle 0x3 \scriptbattle_id 0x0 \scriptbattle_after
  115. .endm
  116. .macro doublebattle doublebattle_id:req doublebattle_before:req doublebattle_after:req doublebattle_onepoke:req
  117. trainerbattle 0x4 \doublebattle_id 0x0 \doublebattle_before \doublebattle_after \doublebattle_onepoke
  118. .endm
  119. .macro doublegymbattle doublegymbattle_id:req doublegymbattle_before:req doublegymbattle_after:req doublegymbattle_later:req doublegymbattle_onepoke:req
  120. trainerbattle 0x8 \doublegymbattle_id 0x0 \doublegymbattle_before \doublegymbattle_after \doublegymbattle_later \doublegymbattle_onepoke
  121. .endm
  122. .macro winlosebattle winlosebattle_id:req winlosebattle_win:req winlosebattle_lose:req
  123. trainerbattle 0x9 \winlosebattle_id 0x3 \winlosebattle_win \winlosebattle_lose
  124. .endm
  125. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  126. @@@ @@@
  127. @@@ special version of the trainerbattle command to be caught by the custom handler @@@
  128. @@@ if the player is spotted and spotscript_flag is set, spotscript_ptr_true is executed @@@
  129. @@@ if the player is spotted and spotscript_flag is not set, spotscript_ptr_false is executed @@@
  130. @@@ if the player talks to an npc who has this as its first command, it is ignored @@@
  131. @@@ THIS COMMAND WORKS IF AND ONLY IF THE TRAINER BIT IS SET ON THE NPC TEMPLATE @@@
  132. @@@ @@@
  133. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  134. .macro spotscript spotscript_flag:req spotscript_ptr_true:req spotscript_ptr_false:req
  135. .byte 0x5C, 0xFF
  136. .hword \spotscript_flag
  137. .hword 0xFFFF
  138. .word \spotscript_ptr_true
  139. .word \spotscript_ptr_false
  140. .endm
  141. .macro msgbox msgbox_textpointer:req msgbox_callstd:req
  142. loadpointer 0x0 \msgbox_textpointer
  143. callstd \msgbox_callstd
  144. .endm
  145. .macro giveitem giveitem_item:req giveitem_quantity:req giveitem_messagetyp:req
  146. copyvarifnotzero 0x8000 \giveitem_item
  147. copyvarifnotzero 0x8001 \giveitem_quantity
  148. setvar 0x5006 10
  149. special 0x68
  150. callstd \giveitem_messagetyp
  151. setvar 0x5006 11
  152. special 0x68
  153. .endm
  154. .macro giveitem2 giveitem2_item:req giveitem2_quantity:req giveitem2_song:req
  155. copyvarifnotzero 0x8000 \giveitem2_item
  156. copyvarifnotzero 0x8001 \giveitem2_quantity
  157. copyvarifnotzero 0x8002 \giveitem2_song
  158. callstd 0x9
  159. .endm
  160. .macro wildbattle wildbattle_spezies:req wildbattle_level:req wildbattle_item:req
  161. setwildbattle \wildbattle_spezies \wildbattle_level \wildbattle_item
  162. dowildbattle
  163. .endm
  164. .macro wildbattle2 wildbattle2_spezies:req wildbattle2_level:req wildbattle2_item:req wildbattle2_battlestyle:req
  165. setwildbattle \wildbattle2_spezies \wildbattle2_level \wildbattle2_item
  166. special 0x137
  167. waitstate
  168. .endm
  169. .macro wildbattlemusic wildbattlemusic_spezies:req wildbattlemusic_level:req wildbattlemusic_item:req wildbattlemusic_music:req
  170. setwildbattle \wildbattlemusic_spezies \wildbattlemusic_level \wildbattlemusic_item
  171. special 0x138
  172. playsong \wildbattlemusic_music 0x0
  173. .endm
  174. .macro costumtrainerbattlemusic costumtrainerbattlemusic_id:req
  175. special 0x3B
  176. playsong \costumtrainerbattlemusic_id 0x0
  177. .endm
  178. .macro colorflicker colorflicker_farbbyte:req
  179. setvar 0x8000 \colorflicker_farbbyte
  180. setvar 0x5006 0x8
  181. special 0x68
  182. .endm
  183. .macro mugmsg mugmsg_textpointer:req mugmsg_callstd:req mugmsg_sprite:req mugmsg_facing:req
  184. .if \mugmsg_facing==MUGFACE_LEFT
  185. setvar MUGHSOT_1_TABLE \mugmsg_sprite | 0x8000
  186. setvar MUGSHOT_1_X 0x16
  187. setvar MUGSHOT_1_Y 0x60
  188. .endif
  189. .if \mugmsg_facing==MUGFACE_RIGHT
  190. setvar MUGHSOT_1_TABLE \mugmsg_sprite
  191. setvar MUGSHOT_1_X 0xD0
  192. setvar MUGSHOT_1_Y 0x60
  193. .endif
  194. msgbox \mugmsg_textpointer \mugmsg_callstd
  195. setvar MUGHSOT_1_TABLE 0x0
  196. .endm
  197. .macro mugrival mugrival_textpointer:req mugrival_callstd:req mugrival_facing:req mugrival_emot=0
  198. setvar 0x8000 \mugrival_emot
  199. .if \mugrival_facing==MUGFACE_LEFT
  200. call scr_mugrival_left
  201. .endif
  202. .if \mugrival_facing==MUGFACE_RIGHT
  203. call scr_mugrival_right
  204. .endif
  205. msgbox \mugrival_textpointer \mugrival_callstd
  206. setvar MUGHSOT_1_TABLE 0x0
  207. .endm
  208. .macro transparenzon
  209. clearflag FLAG_ACTIVATE
  210. .endm
  211. .macro transparenzoff
  212. setflag FLAG_ACTIVATE
  213. .endm
  214. .macro battlescreen battlescreen_grass:req battlescreen_sea:req
  215. setvar BATTLE_NORMAL_VAR \battlescreen_grass
  216. setvar BATTLE_SEA_VAR \battlescreen_sea
  217. .endm
  218. .macro cameramove cameramove_xpos:req cameramove_ypos:req
  219. setvar CAMERA_VAR_X \cameramove_xpos
  220. setvar CAMERA_VAR_Y \cameramove_ypos
  221. setvar CALLASM_VAR 0x1
  222. special 0x68
  223. .endm
  224. .macro walkingscript walkingscript_value:req
  225. setvar WALK_SCRIPT_VAR \walkingscript_value
  226. .endm
  227. .macro walkingscripton
  228. setflag FLAG_WALK_SCRIPT
  229. .endm
  230. .macro walkingscriptoff
  231. clearflag FLAG_WALK_SCRIPT
  232. .endm
  233. .macro writemusikon
  234. setflag FLAG_SKIP_BATTLE_MUSIC
  235. .endm
  236. .macro writemusikoff
  237. clearflag FLAG_SKIP_BATTLE_MUSIC
  238. .endm
  239. @@ Index commands
  240. .macro nop
  241. .byte 0x0
  242. .endm
  243. .macro nop1
  244. .byte 0x1
  245. .endm
  246. .macro end
  247. .byte 0x2
  248. .endm
  249. .macro return
  250. .byte 0x3
  251. .endm
  252. .macro call call_address:req
  253. .byte 0x4
  254. .word \call_address
  255. .endm
  256. .macro goto goto_address:req
  257. .byte 0x5
  258. .word \goto_address
  259. .endm
  260. .macro gotoif if1_value:req if1_pointer:req
  261. .byte 0x6
  262. .byte \if1_value
  263. .word \if1_pointer
  264. .endm
  265. .macro callif if2_value:req if2_pointer:req
  266. .byte 0x7
  267. .byte \if2_value
  268. .word \if2_pointer
  269. .endm
  270. .macro callstd callstd_call:req
  271. .byte 0x9
  272. .byte \callstd_call
  273. .endm
  274. .macro killscript
  275. .byte 0xD
  276. .endm
  277. .macro loadpointer loadpointer_bank:req loadpointer_pointer:req
  278. .byte 0xF
  279. .byte \loadpointer_bank
  280. .word \loadpointer_pointer
  281. .endm
  282. .macro writebytetooffset writebytetooffset_bank:req writebytetooffset_location:req
  283. .byte 0x11
  284. .byte \writebytetooffset_bank
  285. .word \writebytetooffset_location
  286. .endm
  287. .macro setvar setvar_variable:req setvar_value:req
  288. .byte 0x16
  289. .hword \setvar_variable
  290. .hword \setvar_value
  291. .endm
  292. .macro addvar addvar_variable:req addvar_value:req
  293. .byte 0x17
  294. .hword \addvar_variable
  295. .hword \addvar_value
  296. .endm
  297. .macro subvar subvar_variable:req subvar_value:req
  298. .byte 0x18
  299. .hword \subvar_variable
  300. .hword \subvar_value
  301. .endm
  302. .macro copyvar copyvar_variableADestin:req copyvar_variableBSource:req
  303. .byte 0x19
  304. .hword \copyvar_variableADestin
  305. .hword \copyvar_variableBSource
  306. .endm
  307. .macro copyvarifnotzero copyvarifnotzero_variableADestin:req copyvarifnotzero_variableBSource:req
  308. .byte 0x1A
  309. .hword \copyvarifnotzero_variableADestin
  310. .hword \copyvarifnotzero_variableBSource
  311. .endm
  312. .macro compare compare_variable:req compare_value:req
  313. .byte 0x21
  314. .hword \compare_variable
  315. .hword \compare_value
  316. .endm
  317. .macro comparevars comparevars_variableA:req comparevars_variableB:req
  318. .byte 0x22
  319. .hword \comparevars_variableA
  320. .hword \comparevars_variableB
  321. .endm
  322. .macro callasm callasm_address:req
  323. .byte 0x23
  324. .word \callasm_address
  325. .endm
  326. .macro special special_number:req
  327. .byte 0x25
  328. .hword \special_number
  329. .endm
  330. .macro special2 special2_variable:req special2_number:req
  331. .byte 0x26
  332. .hword \special2_variable
  333. .hword \special2_number
  334. .endm
  335. .macro waitstate
  336. .byte 0x27
  337. .endm
  338. .macro pause pause_delay:req
  339. .byte 0x28
  340. .hword \pause_delay
  341. .endm
  342. .macro setflag setflag_flag:req
  343. .byte 0x29
  344. .hword \setflag_flag
  345. .endm
  346. .macro clearflag clearflag_flag:req
  347. .byte 0x2A
  348. .hword \clearflag_flag
  349. .endm
  350. .macro checkflag checkflag_flag:req
  351. .byte 0x2B
  352. .hword \checkflag_flag
  353. .endm
  354. .macro resetvars
  355. .byte 0x2E
  356. .endm
  357. .macro sound sound_song:req
  358. .byte 0x2F
  359. .hword \sound_song
  360. .endm
  361. .macro checksound
  362. .byte 0x30
  363. .endm
  364. .macro fanfare fanfare_song:req
  365. .byte 0x31
  366. .hword \fanfare_song
  367. .endm
  368. .macro waitfanfare
  369. .byte 0x32
  370. .endm
  371. .macro playsong playsong_song:req playsong_value:req
  372. .byte 0x33
  373. .hword \playsong_song
  374. .byte \playsong_value
  375. .endm
  376. .macro playsong2 playsong2_song:req
  377. .byte 0x34
  378. .hword \playsong2_song
  379. .endm
  380. .macro songfadedefault
  381. .byte 0x35
  382. .endm
  383. .macro fadesong fadesong_song:req
  384. .byte 0x36
  385. .hword \fadesong_song
  386. .endm
  387. .macro fadeout fadeout_volume:req
  388. .byte 0x37
  389. .byte \fadeout_volume
  390. .endm
  391. .macro fadein fadein_volume:req
  392. .byte 0x38
  393. .byte \fadein_volume
  394. .endm
  395. .macro warp warp_bank:req warp_map:req warp_exit:req warp_x:req warp_y:req
  396. .byte 0x39
  397. .byte \warp_bank
  398. .byte \warp_map
  399. .byte \warp_exit
  400. .hword \warp_x
  401. .hword \warp_y
  402. .endm
  403. .macro warpmuted warpmuted_bank:req warpmuted_map:req warpmuted_exit:req warpmuted_x:req warpmuted_y:req
  404. .byte 0x3A
  405. .byte \warpmuted_bank
  406. .byte \warpmuted_map
  407. .byte \warpmuted_exit
  408. .hword \warpmuted_x
  409. .hword \warpmuted_y
  410. .endm
  411. .macro warpwalk warpwalk_bank:req warpwalk_map:req warpwalk_exit:req warpwalk_x:req warpwalk_y:req
  412. .byte 0x3B
  413. .byte \warpwalk_bank
  414. .byte \warpwalk_map
  415. .byte \warpwalk_exit
  416. .hword \warpwalk_x
  417. .hword \warpwalk_y
  418. .endm
  419. .macro warphole warphole_bank:req warphole_map:req
  420. .byte 0x3C
  421. .byte \warphole_bank
  422. .byte \warphole_map
  423. .endm
  424. .macro warpteleport warpteleport_bank:req warpteleport_map:req warpteleport_exit:req warpteleport_x:req warpteleport_y:req
  425. .byte 0x3D
  426. .byte \warpteleport_bank
  427. .byte \warpteleport_map
  428. .byte \warpteleport_exit
  429. .hword \warpteleport_x
  430. .hword \warpteleport_y
  431. .endm
  432. .macro setwarpplace setwarpplace_bank:req setwarpplace_map:req setwarpplace_exit:req setwarpplace_x:req setwarpplace_y:req
  433. .byte 0x3F
  434. .byte \setwarpplace_bank
  435. .byte \setwarpplace_map
  436. .byte \setwarpplace_exit
  437. .hword \setwarpplace_x
  438. .hword \setwarpplace_y
  439. .endm
  440. .macro getplayerpos getplayerpos_variableX:req getplayerpos_variableY:req
  441. .byte 0x42
  442. .hword \getplayerpos_variableX
  443. .hword \getplayerpos_variableY
  444. .endm
  445. .macro countpokemon
  446. .byte 0x43
  447. .endm
  448. .macro additem additem_item:req additem_quantity:req
  449. .byte 0x44
  450. .hword \additem_item
  451. .hword \additem_quantity
  452. .endm
  453. .macro removeitem removeitem_item:req removeitem_quantity:req
  454. .byte 0x45
  455. .hword \removeitem_item
  456. .hword \removeitem_quantity
  457. .endm
  458. .macro checkitemroom checkitemroom_item:req checkitemroom_quantity:req
  459. .byte 0x46
  460. .hword \checkitemroom_item
  461. .hword \checkitemroom_quantity
  462. .endm
  463. .macro checkitem checkitem_item:req checkitem_quantity:req
  464. .byte 0x47
  465. .hword \checkitem_item
  466. .hword \checkitem_quantity
  467. .endm
  468. .macro checkitemtype checkitemtype_item:req
  469. .byte 0x48
  470. .hword \checkitemtype_item
  471. .endm
  472. .macro addpcitem addpcitem_item:req addpcitem_quantity:req
  473. .byte 0x49
  474. .hword \addpcitem_item
  475. .hword \addpcitem_quantity
  476. .endm
  477. .macro checkpcitem checkpcitem_item:req checkpcitem_quantity:req
  478. .byte 0x4A
  479. .hword \checkpcitem_item
  480. .hword \checkpcitem_quantity
  481. .endm
  482. .macro applymovement applymovement_people:req applymovement_movedata:req
  483. .byte 0x4F
  484. .hword \applymovement_people
  485. .word \applymovement_movedata
  486. .endm
  487. .macro applymovementpos applymovementpos_people:req applymovementpos_movedata:req applymovementpos_x:req applymovementpos_y:req
  488. .byte 0x50
  489. .hword \applymovementpos_people
  490. .word \applymovementpos_movedata
  491. .byte \applymovementpos_x
  492. .byte \applymovementpos_y
  493. .endm
  494. .macro waitmovement waitmovement_people:req
  495. .byte 0x51
  496. .hword \waitmovement_people
  497. .endm
  498. .macro waitmovementpos waitmovementpos_people:req waitmovementpos_x:req waitmovementpos_y:req
  499. .byte 0x52
  500. .hword \waitmovementpos_people
  501. .byte \waitmovementpos_x
  502. .byte \waitmovementpos_y
  503. .endm
  504. .macro hidesprite hidesprite_people:req
  505. .byte 0x53
  506. .hword \hidesprite_people
  507. .endm
  508. .macro hidespritepos hidesprite_people:req hidespritepos_x:req hidespritepos_y:req
  509. .byte 0x54
  510. .hword \hidespritepos_people
  511. .byte \hidespritepos_x
  512. .byte \hidespritepos_y
  513. .endm
  514. .macro showsprite showsprite_people:req
  515. .byte 0x55
  516. .hword \showsprite_people
  517. .endm
  518. .macro showspritepos showspritepos_people:req showspritepos_x:req showspritepos_y:req
  519. .byte 0x56
  520. .hword \showspritepos_people
  521. .byte \showspritepos_x
  522. .byte \showspritepos_y
  523. .endm
  524. .macro movesprite movesprite_people:req movesprite_x:req movesprite_y:req
  525. .byte 0x57
  526. .hword \movesprite_people
  527. .hword \movesprite_x
  528. .hword \movesprite_y
  529. .endm
  530. .macro spritevisible spritevisible_people:req spritevisible_bank:req spritevisible_map:req
  531. .byte 0x58
  532. .hword \spritevisible_people
  533. .byte \spritevisible_bank
  534. .byte \spritevisible_map
  535. .endm
  536. .macro spriteinvisible spriteinvisible_people:req spriteinvisible_bank:req spriteinvisible_map:req
  537. .byte 0x59
  538. .hword \spriteinvisible_people
  539. .byte \spriteinvisible_bank
  540. .byte \spriteinvisible_map
  541. .endm
  542. .macro faceplayer
  543. .byte 0x5A
  544. .endm
  545. .macro spriteface spriteface_people:req spriteface_facing:req
  546. .byte 0x5B
  547. .hword \spriteface_people
  548. .byte \spriteface_facing
  549. .endm
  550. .macro trainerbattle trainerbattle_kind:req trainerbattle_id:req trainerbattle_value:req trainerbattle_before:req trainerbattle_after trainerbattle_later trainerbattle_onepoke
  551. .byte 0x5C
  552. .byte \trainerbattle_kind
  553. .hword \trainerbattle_id
  554. .hword \trainerbattle_value
  555. .word \trainerbattle_before
  556. .word \trainerbattle_after
  557. .word \trainerbattle_later
  558. .word \trainerbattle_onepoke
  559. .endm
  560. .macro repeattrainerbattle
  561. .byte 0x5D
  562. .endm
  563. .macro endtrainerbattle
  564. .byte 0x5E
  565. .endm
  566. .macro endtrainerbattle2
  567. .byte 0x5E
  568. .endm
  569. .macro checktrainerflag checktrainerflag_flag:req
  570. .byte 0x60
  571. .hword \checktrainerflag_flag
  572. .endm
  573. .macro settrainerflag settrainerflag_flag:req
  574. .byte 0x61
  575. .hword \settrainerflag_flag
  576. .endm
  577. .macro cleartrainerflag cleartrainerflag_flag:req
  578. .byte 0x62
  579. .hword \cleartrainerflag_flag
  580. .endm
  581. .macro movesprite2 movesprite2_people:req movesprite2_x:req movesprite2_y:req
  582. .byte 0x63
  583. .hword \movesprite2_people
  584. .hword \movesprite2_x
  585. .hword \movesprite2_y
  586. .endm
  587. .macro moveoffscreen moveoffscreen_people:req
  588. .byte 0x64
  589. .hword \moveoffscreen_people
  590. .endm
  591. .macro spritebehave spritebehave_people:req spritebehave_facing:req
  592. .byte 0x65
  593. .hword \spritebehave_people
  594. .byte \spritebehave_facing
  595. .endm
  596. .macro waitmsg
  597. .byte 0x66
  598. .endm
  599. .macro preparemsg preparemsg_text:req
  600. .byte 0x67
  601. .word \preparemsg_text
  602. .endm
  603. .macro closeonkeypress
  604. .byte 0x68
  605. .endm
  606. .macro lockall
  607. .byte 0x69
  608. .endm
  609. .macro lock
  610. .byte 0x6A
  611. .endm
  612. .macro releaseall
  613. .byte 0x6B
  614. .endm
  615. .macro release
  616. .byte 0x6C
  617. .endm
  618. .macro waitkeypress
  619. .byte 0x6D
  620. .endm
  621. .macro yesnobox yesnobox_x:req yesnobox_y:req
  622. .byte 0x6E
  623. .byte \yesnobox_x
  624. .byte \yesnobox_y
  625. .endm
  626. .macro multichoice multichoice_x:req multichoice_y:req multichoice_choiceList:req multichoice_determines:req
  627. .byte 0x6F
  628. .byte \multichoice_x
  629. .byte \multichoice_y
  630. .byte \multichoice_choiceList
  631. .byte \multichoice_determines
  632. .endm
  633. .macro multichoice2 multichoice2_x:req multichoice2_y:req multichoice2_choiceList:req multichoice2_defaultchoice:req multichoice2_determines:req
  634. .byte 0x70
  635. .byte \multichoice2_x
  636. .byte \multichoice2_y
  637. .byte \multichoice2_choiceList
  638. .byte \multichoice2_defaultchoice
  639. .byte \multichoice2_determines
  640. .endm
  641. .macro multichoice3 multichoice3_x:req multichoice3_y:req multichoice3_choiceList:req multichoice3_numberofchoices:req multichoice3_determines:req
  642. .byte 0x71
  643. .byte \multichoice3_x
  644. .byte \multichoice3_y
  645. .byte \multichoice3_choiceList
  646. .byte \multichoice3_numberofchoices
  647. .byte \multichoice3_determines
  648. .endm
  649. .macro showpokepic showpokepic_spezies:req showpokepic_x:req showpokepic_y:req
  650. .byte 0x75
  651. .hword \showpokepic_spezies
  652. .byte \showpokepic_x
  653. .byte \showpokepic_y
  654. .endm
  655. .macro hidepokepic
  656. .byte 0x76
  657. .endm
  658. .macro braile braile_data:req
  659. .byte 0x78
  660. .word \braile_data
  661. .endm
  662. .macro givepokemon givepokemon_spezies:req givepokemon_level:req givepokemon_item:req
  663. .byte 0x79
  664. .hword \givepokemon_spezies
  665. .byte \givepokemon_level
  666. .hword \givepokemon_item
  667. .word 0x0
  668. .word 0x0
  669. .byte 0x0
  670. .endm
  671. .macro giveegg giveegg_spezies:req
  672. .byte 0x7A
  673. .hword \giveegg_spezies
  674. .endm
  675. .macro setpokemonmove setpokemonmove_partyslot:req setpokemonmove_moveslot:req setpokemonmove_move:req
  676. .byte 0x7B
  677. .byte \setpokemonmove_partyslot
  678. .byte \setpokemonmove_moveslot
  679. .hword \setpokemonmove_move
  680. .endm
  681. .macro checkattack checkattack_move:req
  682. .byte 0x7C
  683. .hword \checkattack_move
  684. .endm
  685. .macro bufferpokemon bufferpokemon_buffernumber:req bufferpokemon_spezies:req
  686. .byte 0x7D
  687. .byte \bufferpokemon_buffernumber
  688. .hword \bufferpokemon_spezies
  689. .endm
  690. .macro bufferfirstpokemon bufferfirstpokemon_buffernumber:req
  691. .byte 0x7E
  692. .byte \bufferfirstpokemon_buffernumber
  693. .endm
  694. .macro bufferpartypokemon bufferpartypokemon_buffernumber:req bufferpartypokemon_spezies:req
  695. .byte 0x7F
  696. .byte \bufferpartypokemon_buffernumber
  697. .hword \bufferpartypokemon_spezies
  698. .endm
  699. .macro bufferitem bufferitem_buffernumber:req bufferitem_item:req
  700. .byte 0x80
  701. .byte \bufferitem_buffernumber
  702. .hword \bufferitem_item
  703. .endm
  704. .macro bufferattack bufferattack_buffernumber:req bufferattack_attack:req
  705. .byte 0x82
  706. .byte \bufferattack_buffernumber
  707. .hword \bufferattack_attack
  708. .endm
  709. .macro buffernumber buffernumber_buffernumber:req buffernumber_variable:req
  710. .byte 0x83
  711. .byte \buffernumber_buffernumber
  712. .hword \buffernumber_variable
  713. .endm
  714. .macro bufferstd bufferstd_buffernumber:req bufferstd_variable:req
  715. .byte 0x84
  716. .byte \bufferstd_buffernumber
  717. .hword \bufferstd_variable
  718. .endm
  719. .macro bufferstring bufferstring_buffernumber:req bufferstring_string:req
  720. .byte 0x85
  721. .byte \bufferstring_buffernumber
  722. .word \bufferstring_string
  723. .endm
  724. .macro pokemart pokemart_list:req
  725. .byte 0x86
  726. .word \pokemart_list
  727. .endm
  728. .macro pokemart3 pokemart_list_three:req
  729. .byte 0x86
  730. .word \pokemart_list_three
  731. .endm
  732. .macro random random_possiblities:req
  733. .byte 0x8F
  734. .hword \random_possiblities
  735. .endm
  736. .macro givemoney givemoney_quantity:req givemoney_command:req
  737. .byte 0x90
  738. .word \givemoney_quantity
  739. .byte \givemoney_command
  740. .endm
  741. .macro paymoney paymoney_quantity:req paymoney_command:req
  742. .byte 0x91
  743. .word \paymoney_quantity
  744. .byte \paymoney_command
  745. .endm
  746. .macro checkmoney checkmoney_quantity:req checkmoney_command:req
  747. .byte 0x92
  748. .word \checkmoney_quantity
  749. .byte \checkmoney_command
  750. .endm
  751. .macro showmoney showmoney_x:req showmoney_y:req showmoney_value:req
  752. .byte 0x93
  753. .byte \showmoney_x
  754. .byte \showmoney_y
  755. .byte \showmoney_value
  756. .endm
  757. .macro hidemoney hidemoney_x:req hidemoney_y:req
  758. .byte 0x94
  759. .byte \hidemoney_x
  760. .byte \hidemoney_y
  761. .endm
  762. .macro updatemoney updatemoney_x:req updatemoney_y:req updatemoney_value:req
  763. .byte 0x95
  764. .byte \updatemoney_x
  765. .byte \updatemoney_y
  766. .byte \updatemoney_value
  767. .endm
  768. .macro fadescreen fadescreen_effect:req
  769. .byte 0x97
  770. .byte \fadescreen_effect
  771. .endm
  772. .macro fadescreendelay fadescreendelay_effect:req fadescreendelay_delay:req
  773. .byte 0x98
  774. .byte \fadescreendelay_effect
  775. .byte \fadescreendelay_delay
  776. .endm
  777. .macro darken darken_flashsize:req
  778. .byte 0x99
  779. .hword \darken_flashsize
  780. .endm
  781. .macro lighten lighten_flashsize:req
  782. .byte 0x9A
  783. .hword \lighten_flashsize
  784. .endm
  785. .macro doanimation doanimation_animation:req
  786. .byte 0x9C
  787. .hword \doanimation_animation
  788. .endm
  789. .macro setanimation setanimation_animation:req setanimation_variable:req
  790. .byte 0x9D
  791. .byte \setanimation_animation
  792. .hword \setanimation_variable
  793. .endm
  794. .macro checkanimation checkanimation_animation:req
  795. .byte 0x9E
  796. .hword \checkanimation_animation
  797. .endm
  798. .macro sethealingplace shp_bank:req shp_map:req shp_x:req shp_y:req
  799. setvar HEALING_BANK_MAP_VAR \shp_map << 8 | \shp_bank
  800. setvar HEALING_X_VAR \shp_x
  801. setvar HEALING_Y_VAR \shp_y
  802. .endm
  803. .macro checkgender
  804. .byte 0xA0
  805. .endm
  806. .macro cry cry_spezies:req cry_effect:req
  807. .byte 0xA1
  808. .hword \cry_spezies
  809. .hword \cry_effect
  810. .endm
  811. .macro setmaptile setmaptile_x:req setmaptile_y:req setmaptile_tile:req setmaptile_attribut:req
  812. .byte 0xA2
  813. .hword \setmaptile_x
  814. .hword \setmaptile_y
  815. .hword \setmaptile_tile
  816. .hword \setmaptile_attribut
  817. .endm
  818. .macro resetweather
  819. .byte 0xA3
  820. .endm
  821. .macro setweather setweather_weather:req
  822. .byte 0xA4
  823. .hword \setweather_weather
  824. .endm
  825. .macro doweather
  826. .byte 0xA5
  827. .endm
  828. .macro setmapfooter setmapfooter_footer:req
  829. .byte 0xA7
  830. .hword \setmapfooter_footer
  831. .endm
  832. .macro spritelevelup spritelevelup_people:req spritelevelup_bank:req spritelevelup_map:req
  833. .byte 0xA8
  834. .hword \spritelevelup_people
  835. .byte \spritelevelup_bank
  836. .byte \spritelevelup_map
  837. .byte 0x0
  838. .endm
  839. .macro restorespritelevel restorespritelevel_people:req restorespritelevel_bank:req restorespritelevel_map:req
  840. .byte 0xA9
  841. .hword \restorespritelevel_people
  842. .byte \restorespritelevel_bank
  843. .byte \restorespritelevel_map
  844. .endm
  845. .macro createsprite createsprite_sprite:req createsprite_id:req createsprite_x:req createsprite_y:req createsprite_behaviour:req createsprite_facing:req
  846. .byte 0xAA
  847. .byte \createsprite_sprite
  848. .byte \createsprite_id
  849. .hword \createsprite_x
  850. .hword \createsprite_y
  851. .byte \createsprite_behaviour
  852. .byte \createsprite_facing
  853. .endm
  854. .macro spriteface2 spriteface2_people:req spriteface2_facing:req
  855. .byte 0xAB
  856. .hword \spriteface2_people
  857. .byte \spriteface2_facing
  858. .endm
  859. .macro setdooropened setdooropened_x:req setdooropened_y:req
  860. .byte 0xAC
  861. .hword \setdooropened_x
  862. .hword \setdooropened_y
  863. .endm
  864. .macro setdoorclosed setdoorclosed_x:req setdoorclosed_y:req
  865. .byte 0xAD
  866. .hword \setdoorclosed_x
  867. .hword \setdoorclosed_y
  868. .endm
  869. .macro doorchange
  870. .byte 0xAE
  871. .endm
  872. .macro setdooropened2 setdooropened2_x:req setdooropened2_y:req
  873. .byte 0xAF
  874. .hword \setdooropened2_x
  875. .hword \setdooropened2_y
  876. .endm
  877. .macro setdoorclosed2 setdoorclosed2_x:req setdoorclosed2_y:req
  878. .byte 0xB0
  879. .hword \setdoorclosed2_x
  880. .hword \setdoorclosed2_y
  881. .endm
  882. .macro setwildbattle setwildbattle_spezies:req setwildbattle_level:req setwildbattle_item:req
  883. .byte 0xB6
  884. .hword \setwildbattle_spezies
  885. .byte \setwildbattle_level
  886. .hword \setwildbattle_item
  887. .endm
  888. .macro dowildbattle
  889. .byte 0xB7
  890. .endm
  891. .macro savincrementkey attr:req
  892. .byte 0xC3
  893. .byte \attr
  894. .endm
  895. .macro waitcry
  896. .byte 0xC5
  897. .endm
  898. .macro setworldmapflag setworldmapflag_flag:req
  899. .byte 0xD0
  900. .hword \setworldmapflag_flag
  901. .endm
  902. .macro bufferitems bufferitems_buffernumber:req bufferitems_item:req bufferitems_quantity:req
  903. .byte 0xD4
  904. .byte \bufferitems_buffernumber
  905. .hword \bufferitems_item
  906. .hword \bufferitems_quantity
  907. .endm
  908. #endif