forked from Zeturic/bpre-wonder-trade
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpokescript.s
executable file
·1304 lines (1075 loc) · 18.4 KB
/
pokescript.s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
.macro nop
.byte 0x00
.endmacro
.macro nop1
.byte 0x01
.endmacro
.macro end
.byte 0x02
.endmacro
.macro return
.byte 0x03
.endmacro
.macro call, p0
.byte 0x04
.word p0
.endmacro
.macro goto, p1
.byte 0x05
.word p1
.endmacro
.macro gotoif, p2, p3
.byte 0x06
.byte p2
.word p3
.endmacro
.macro callif, p4, p5
.byte 0x07
.byte p4
.word p5
.endmacro
.macro gotostd, p6
.byte 0x08
.byte p6
.endmacro
.macro callstd, p7
.byte 0x09
.byte p7
.endmacro
.macro gotostdif, p8, p9
.byte 0x0A
.byte p8
.byte p9
.endmacro
.macro callstdif, p10, p11
.byte 0x0B
.byte p10
.byte p11
.endmacro
.macro jumpram
.byte 0x0C
.endmacro
.macro killscript
.byte 0x0D
.endmacro
.macro setbyte, p12
.byte 0x0E
.byte p12
.endmacro
.macro loadpointer, p13, p14
.byte 0x0F
.byte p13
.word p14
.endmacro
.macro setbyte2, p15, p16
.byte 0x10
.byte p15
.byte p16
.endmacro
.macro writebytetooffset, p17, p18
.byte 0x11
.byte p17
.word p18
.endmacro
.macro loadbytefrompointer, p19, p20
.byte 0x12
.byte p19
.word p20
.endmacro
.macro setfarbyte, p21, p22
.byte 0x13
.byte p21
.word p22
.endmacro
.macro copyscriptbanks, p23, p24
.byte 0x14
.byte p23
.byte p24
.endmacro
.macro copybyte, p25, p26
.byte 0x15
.word p25
.word p26
.endmacro
.macro setvar, p27, p28
.byte 0x16
.halfword p27
.halfword p28
.endmacro
.macro addvar, p29, p30
.byte 0x17
.halfword p29
.halfword p30
.endmacro
.macro subvar, p31, p32
.byte 0x18
.halfword p31
.halfword p32
.endmacro
.macro copyvar, p33, p34
.byte 0x19
.halfword p33
.halfword p34
.endmacro
.macro copyvarifnotzero, p35, p36
.byte 0x1A
.halfword p35
.halfword p36
.endmacro
.macro comparebanks, p37, p38
.byte 0x1B
.halfword p37
.halfword p38
.endmacro
.macro comparebanktobyte, p39, p40
.byte 0x1C
.byte p39
.byte p40
.endmacro
.macro comparebanktofarbyte, p41, p42
.byte 0x1D
.byte p41
.word p42
.endmacro
.macro comparefarbytetobank, p43, p44
.byte 0x1E
.word p43
.byte p44
.endmacro
.macro comparefarbytetobyte, p45, p46
.byte 0x1F
.word p45
.byte p46
.endmacro
.macro comparefarbytes, p47, p48
.byte 0x20
.word p47
.word p48
.endmacro
.macro compare, p49, p50
.byte 0x21
.halfword p49
.halfword p50
.endmacro
.macro comparevars, p51, p52
.byte 0x22
.halfword p51
.halfword p52
.endmacro
.macro callasm, p53
.byte 0x23
.word p53
.endmacro
.macro cmd24, p54
.byte 0x24
.word p54
.endmacro
.macro special, p55
.byte 0x25
.halfword p55
.endmacro
.macro special2, p56, p57
.byte 0x26
.halfword p56
.halfword p57
.endmacro
.macro waitstate
.byte 0x27
.endmacro
.macro pause, p58
.byte 0x28
.halfword p58
.endmacro
.macro setflag, p59
.byte 0x29
.halfword p59
.endmacro
.macro clearflag, p60
.byte 0x2A
.halfword p60
.endmacro
.macro checkflag, p61
.byte 0x2B
.halfword p61
.endmacro
.macro cmd2c, p62, p63
.byte 0x2C
.halfword p62
.halfword p63
.endmacro
.macro checkdailyflags
.byte 0x2D
.endmacro
.macro resetvars
.byte 0x2E
.endmacro
.macro sound, p64
.byte 0x2F
.halfword p64
.endmacro
.macro checksound
.byte 0x30
.endmacro
.macro fanfare, p65
.byte 0x31
.halfword p65
.endmacro
.macro waitfanfare
.byte 0x32
.endmacro
.macro playsong, p67, p68
.byte 0x33
.halfword p67
.byte p68
.endmacro
.macro playsong2, p69
.byte 0x34
.halfword p69
.endmacro
.macro fadedefault
.byte 0x35
.endmacro
.macro fadesong, p70
.byte 0x36
.halfword p70
.endmacro
.macro fadeout, p71
.byte 0x37
.byte p71
.endmacro
.macro fadein, p72
.byte 0x38
.byte p72
.endmacro
.macro warp, p73, p74, p75, p76, p77
.byte 0x39
.byte p73
.byte p74
.byte p75
.halfword p76
.halfword p77
.endmacro
.macro warpmuted, p78, p79, p80, p81, p82
.byte 0x3A
.byte p78
.byte p79
.byte p80
.halfword p81
.halfword p82
.endmacro
.macro warpwalk, p83, p84, p85, p86, p87
.byte 0x3B
.byte p83
.byte p84
.byte p85
.halfword p86
.halfword p87
.endmacro
.macro warphole, p88, p89, p90, p91
.byte 0x3C
.byte p88
.byte p89
.byte p90
.byte p91
.endmacro
.macro warpteleport, p92, p93, p94, p95, p96
.byte 0x3D
.byte p92
.byte p93
.byte p94
.halfword p95
.halfword p96
.endmacro
.macro warp3, p97, p98, p99, p100, p101
.byte 0x3E
.byte p97
.byte p98
.byte p99
.halfword p100
.halfword p101
.endmacro
.macro setwarpplace, p102, p103, p104, p105, p106
.byte 0x3F
.byte p102
.byte p103
.byte p104
.halfword p105
.halfword p106
.endmacro
.macro warp4, p107, p108, p109, p110, p111
.byte 0x40
.byte p107
.byte p108
.byte p109
.halfword p110
.halfword p111
.endmacro
.macro warp5, p112, p113, p114, p115, p116
.byte 0x41
.byte p112
.byte p113
.byte p114
.halfword p115
.halfword p116
.endmacro
.macro getplayerpos, p117, p118
.byte 0x42
.halfword p117
.halfword p118
.endmacro
.macro countpokemon
.byte 0x43
.endmacro
.macro additem, p119, p120
.byte 0x44
.halfword p119
.halfword p120
.endmacro
.macro removeitem, p121, p122
.byte 0x45
.halfword p121
.halfword p122
.endmacro
.macro checkitemroom, p123, p124
.byte 0x46
.halfword p123
.halfword p124
.endmacro
.macro checkitem, p125, p126
.byte 0x47
.halfword p125
.halfword p126
.endmacro
.macro checkitemtype, p127
.byte 0x48
.halfword p127
.endmacro
.macro addpcitem, p128, p129
.byte 0x49
.halfword p128
.halfword p129
.endmacro
.macro checkpcitem, p130, p131
.byte 0x4A
.halfword p130
.halfword p131
.endmacro
.macro adddecoration, p132
.byte 0x4B
.halfword p132
.endmacro
.macro removedecoration, p133
.byte 0x4C
.halfword p133
.endmacro
.macro testdecoration, p134
.byte 0x4D
.halfword p134
.endmacro
.macro checkdecoration, p135
.byte 0x4E
.halfword p135
.endmacro
.macro applymovement, p136, p137
.byte 0x4F
.halfword p136
.word p137
.endmacro
.macro applymovementpos, p138, p139, p140, p141
.byte 0x50
.halfword p138
.word p139
.byte p140
.byte p141
.endmacro
.macro waitmovement, p142
.byte 0x51
.halfword p142
.endmacro
.macro waitmovementpos, p143, p144, p145
.byte 0x52
.halfword p143
.byte p144
.byte p145
.endmacro
.macro hidesprite, p146
.byte 0x53
.halfword p146
.endmacro
.macro hidespritepos, p147, p148, p149
.byte 0x54
.halfword p147
.byte p148
.byte p149
.endmacro
.macro showsprite, p150
.byte 0x55
.halfword p150
.endmacro
.macro showspritepos, p151, p152, p153
.byte 0x56
.halfword p151
.byte p152
.byte p153
.endmacro
.macro movesprite, p154, p155, p156
.byte 0x57
.halfword p154
.halfword p155
.halfword p156
.endmacro
.macro spritevisible, p157, p158, p159
.byte 0x58
.halfword p157
.byte p158
.byte p159
.endmacro
.macro spriteinvisible, p160, p161, p162
.byte 0x59
.halfword p160
.byte p161
.byte p162
.endmacro
.macro faceplayer
.byte 0x5A
.endmacro
.macro spriteface, p163, p164
.byte 0x5B
.halfword p163
.byte p164
.endmacro
.macro trainerbattle, p165, p166, p167, p168, p169, p170
.byte 0x5C
.byte p165
.halfword p166
.halfword p167
.word p168
.word p169
.word p170
.endmacro
.macro repeattrainerbattle
.byte 0x5D
.endmacro
.macro endtrainerbattle
.byte 0x5E
.endmacro
.macro endtrainerbattle2
.byte 0x5F
.endmacro
.macro checktrainerflag, p171
.byte 0x60
.halfword p171
.endmacro
.macro cleartrainerflag, p172
.byte 0x61
.halfword p172
.endmacro
.macro settrainerflag, p173
.byte 0x62
.halfword p173
.endmacro
.macro movesprite2, p174, p175, p176
.byte 0x63
.halfword p174
.halfword p175
.halfword p176
.endmacro
.macro moveoffscreen, p177
.byte 0x64
.halfword p177
.endmacro
.macro spritebehave, p178, p179
.byte 0x65
.halfword p178
.byte p179
.endmacro
.macro waitmsg
.byte 0x66
.endmacro
.macro preparemsg, p180
.byte 0x67
.word p180
.endmacro
.macro closeonkeypress
.byte 0x68
.endmacro
.macro lockall
.byte 0x69
.endmacro
.macro lock
.byte 0x6A
.endmacro
.macro releaseall
.byte 0x6B
.endmacro
.macro release
.byte 0x6C
.endmacro
.macro waitkeypress
.byte 0x6D
.endmacro
.macro yesnobox, p181, p182
.byte 0x6E
.byte p181
.byte p182
.endmacro
.macro multichoice, p183, p184, p185, p186
.byte 0x6F
.byte p183
.byte p184
.byte p185
.byte p186
.endmacro
.macro multichoice2, p187, p188, p189, p190, p191
.byte 0x70
.byte p187
.byte p188
.byte p189
.byte p190
.byte p191
.endmacro
.macro multichoice3, p192, p193, p194, p195, p196
.byte 0x71
.byte p192
.byte p193
.byte p194
.byte p195
.byte p196
.endmacro
.macro showbox, p197, p198, p199, p200
.byte 0x72
.byte p197
.byte p198
.byte p199
.byte p200
.endmacro
.macro hidebox, p201, p202, p203, p204
.byte 0x73
.byte p201
.byte p202
.byte p203
.byte p204
.endmacro
.macro clearbox, p205, p206, p207, p208
.byte 0x74
.byte p205
.byte p206
.byte p207
.byte p208
.endmacro
.macro showpokepic, p209, p210, p211
.byte 0x75
.halfword p209
.byte p210
.byte p211
.endmacro
.macro hidepokepic
.byte 0x76
.endmacro
.macro showcontestwinner, p212
.byte 0x77
.byte p212
.endmacro
.macro braille, p213
.byte 0x78
.word p213
.endmacro
.macro givepokemon, p214, p215, p216, p217, p218, p219
.byte 0x79
.halfword p214
.byte p215
.halfword p216
.word p217
.word p218
.byte p219
.endmacro
.macro giveegg, p220
.byte 0x7A
.halfword p220
.endmacro
.macro setpkmnpp, p221, p222, p223
.byte 0x7B
.byte p221
.byte p222
.halfword p223
.endmacro
.macro checkattack, p224
.byte 0x7C
.halfword p224
.endmacro
.macro bufferpokemon, p225, p226
.byte 0x7D
.byte p225
.halfword p226
.endmacro
.macro bufferfirstpokemon, p227
.byte 0x7E
.byte p227
.endmacro
.macro bufferpartypokemon, p228, p229
.byte 0x7F
.byte p228
.halfword p229
.endmacro
.macro bufferitem, p230, p231
.byte 0x80
.byte p230
.halfword p231
.endmacro
.macro bufferdecoration, p232, p233
.byte 0x81
.byte p232
.halfword p233
.endmacro
.macro bufferattack, p234, p235
.byte 0x82
.byte p234
.halfword p235
.endmacro
.macro buffernumber, p236, p237
.byte 0x83
.byte p236
.halfword p237
.endmacro
.macro bufferstd, p238, p239
.byte 0x84
.byte p238
.halfword p239
.endmacro
.macro bufferstring, p240, p241
.byte 0x85
.byte p240
.word p241
.endmacro
.macro pokemart, p242
.byte 0x86
.word p242
.endmacro
.macro pokemart2, p243
.byte 0x87
.word p243
.endmacro
.macro pokemart3, p244
.byte 0x88
.word p244
.endmacro
.macro pokecasino, p245
.byte 0x89
.halfword p245
.endmacro
.macro cmd8a, p246, p247, p248
.byte 0x8A
.byte p246
.byte p247
.byte p248
.endmacro
.macro choosecontestpkmn
.byte 0x8B
.endmacro
.macro startcontest
.byte 0x8C
.endmacro
.macro showcontestresults
.byte 0x8D
.endmacro
.macro contestlinktransfer
.byte 0x8E
.endmacro
.macro random, p249
.byte 0x8F
.halfword p249
.endmacro
.macro givemoney, p250, p251
.byte 0x90
.word p250
.byte p251
.endmacro
.macro paymoney, p252, p253
.byte 0x91
.word p252
.byte p253
.endmacro
.macro checkmoney, p254, p255
.byte 0x92
.word p254
.byte p255
.endmacro
.macro showmoney, p256, p257, p258
.byte 0x93
.byte p256
.byte p257
.byte p258
.endmacro
.macro hidemoney, p259, p260
.byte 0x94
.byte p259
.byte p260
.endmacro
.macro updatemoney, p261, p262, p263
.byte 0x95
.byte p261
.byte p262
.byte p263
.endmacro
.macro cmd96, p264
.byte 0x96
.halfword p264
.endmacro
.macro fadescreen, p265
.byte 0x97
.byte p265
.endmacro
.macro fadescreendelay, p266, p267
.byte 0x98
.byte p266
.byte p267
.endmacro
.macro darken, p268
.byte 0x99
.halfword p268
.endmacro
.macro lighten, p269
.byte 0x9A
.byte p269
.endmacro
.macro preparemsg2, p270
.byte 0x9B
.word p270
.endmacro
.macro doanimation, p271
.byte 0x9C
.halfword p271
.endmacro
.macro setanimation, p272, p273
.byte 0x9D
.byte p272
.halfword p273
.endmacro
.macro checkanimation, p274
.byte 0x9E
.halfword p274
.endmacro
.macro sethealingplace, p275
.byte 0x9F
.halfword p275
.endmacro
.macro checkgender
.byte 0xA0
.endmacro
.macro cry, p276, p277
.byte 0xA1
.halfword p276
.halfword p277
.endmacro
.macro setmaptile, p278, p279, p280, p281
.byte 0xA2
.halfword p278
.halfword p279
.halfword p280
.halfword p281
.endmacro
.macro resetweather
.byte 0xA3
.endmacro
.macro setweather, p282
.byte 0xA4
.halfword p282
.endmacro
.macro doweather
.byte 0xA5
.endmacro
.macro cmda6, p283
.byte 0xA6
.byte p283
.endmacro
.macro setmapfooter, p284
.byte 0xA7
.halfword p284
.endmacro
.macro spritelevelup, p285, p286, p287, p288
.byte 0xA8
.halfword p285
.byte p286
.byte p287
.byte p288
.endmacro
.macro restorespritelevel, p289, p290, p291
.byte 0xA9
.halfword p289
.byte p290
.byte p291
.endmacro
.macro createsprite, p292, p293, p294, p295, p296, p297
.byte 0xAA
.byte p292
.byte p293
.halfword p294
.halfword p295
.byte p296
.byte p297
.endmacro
.macro spriteface2, p298, p299
.byte 0xAB
.byte p298
.byte p299
.endmacro
.macro setdooropened, p300, p301
.byte 0xAC
.halfword p300
.halfword p301
.endmacro
.macro setdoorclosed, p302, p303
.byte 0xAD
.halfword p302
.halfword p303
.endmacro
.macro doorchange