-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmaps.asm
18994 lines (17625 loc) · 273 KB
/
maps.asm
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
INCLUDE "includes.asm"
INCLUDE "charmap.asm"
INCLUDE "macros/bank20.asm"
INCLUDE "maps/block_data.asm"
SECTION "Bank 20", ROMX, BANK [$20]
script_library 20
INCLUDE "maps/scripts/unknown_81281.asm"
INCLUDE "maps/scripts/unknown_81ac1.asm"
INCLUDE "maps/scripts/unknown_81d6a.asm"
INCLUDE "maps/scripts/unknown_8240c.asm"
INCLUDE "maps/scripts/unknown_825cc.asm"
INCLUDE "maps/scripts/unknown_82628.asm"
INCLUDE "maps/scripts/unknown_827a9.asm"
INCLUDE "maps/scripts/unknown_82b03.asm"
INCLUDE "maps/scripts/unknown_82c44.asm"
INCLUDE "maps/scripts/unknown_82d7f.asm"
INCLUDE "maps/scripts/unknown_82e70.asm"
INCLUDE "maps/scripts/unknown_82f08.asm"
INCLUDE "maps/scripts/unknown_82fa8.asm"
INCLUDE "maps/scripts/unknown_83026.asm"
INCLUDE "maps/scripts/unknown_83169.asm"
INCLUDE "maps/scripts/unknown_831c2.asm"
Data_831e4:
dr $831e4, $83205
Data_83205: ; 83205
dr $83205, $83213
Func_83213:
call Func_8324c
ld hl, Func_8324c
call Func_80f11_20
ld a, $9
ld [wc7de], a
loadwarps $3, Data_831e4
loadpeople $1, Data_83205
playmusic SONG_SHOP
call FadeInMap_20
landmarksign TreeBitstreamText_46c4e
ret
Data_83240:
dr $83240, $83246
Data_83246: ; 83246
dr $83246, $8324c
Func_8324c: ; 8324c (20:724c)
ld a, [wc78c]
cp $a
jp nc, Func_8325a
ld hl, Data_83240
call Func_80d9b_20
Func_8325a: ; 8325a (20:725a)
ld a, [wc78c]
cp $5
jp nc, Func_83268
ld hl, Data_83246
call Func_80d9b_20
Func_83268: ; 83268 (20:7268)
call Func_80f02_20
ret
Func_8326c:
push af
ld a, e
or a
jp nz, Func_83318
ld hl, sp+$1
ld a, [hl]
call FacePlayer_20
writetext_yesorno TreeBitstreamText_4600d
or a
jp nz, Func_832d4
writetext TreeBitstreamText_46031
ld a, $1
call NamingScreen_20
checkevent $108
or a
jp nz, Func_832cb
ld a, [wc79c]
cp $1
jp c, Func_832cb
checkevent $114
or a
jp nz, Func_832cb
writetext TreeBitstreamText_45fec
playsfx $2a
writetext TreeBitstreamText_45ffd
ld c, $0
ld e, $1
ld a, $10
call Func_80d4d_20
setevent $108
Func_832cb: ; 832cb (20:72cb)
writetext TreeBitstreamText_4604f
jp Func_83318
Func_832d4: ; 832d4 (20:72d4)
writetext TreeBitstreamText_46040
checkevent $108
or a
jp nz, Func_83318
ld a, [wc79c]
cp $1
jp c, Func_83318
checkevent $114
or a
jp nz, Func_83318
writetext TreeBitstreamText_45fec
playsfx $2a
writetext TreeBitstreamText_45ffd
ld c, $0
ld e, $1
ld a, $10
call Func_80d4d_20
setevent $108
Func_83318: ; 83318 (20:7318)
pop bc
ret
Data_8331a:
dr $8331a, $8333b
Data_8333b: ; 8333b
dr $8333b, $83340
Func_83340:
call Func_83379
ld hl, Func_83379
call Func_80f11_20
ld a, $a
ld [wc7de], a
loadwarps $3, Data_8331a
ld e, $1
ld hl, Data_8333b
call Func_80ce7_20
playmusic SONG_SHOP
call FadeInMap_20
ld hl, Func_03d1
call LandmarkSign_20
ret
Data_8336d:
dr $8336d, $83373
Data_83373: ; 83373
dr $83373, $83379
Func_83379:
ld a, [wc78c]
cp $b
jp nc, Func_83387
ld hl, Data_8336d
call Func_80d9b_20
Func_83387: ; 83387 (20:7387)
ld a, [wc78c]
cp $5
jp nc, Func_83395
ld hl, Data_83373
call Func_80d9b_20
Func_83395: ; 83395 (20:7395)
call Func_80f02_20
ret
Data_83399:
dr $83399, $833ba
Func_833ba:
call Func_833eb
ld hl, Func_833eb
call Func_80f11_20
ld a, $b
ld [wc7de], a
loadwarps $3, Data_83399
playmusic SONG_SHOP
call FadeInMap_20
landmarksign TreeBitstreamText_46c6a
ret
Data_833df:
dr $833df, $833e5
Data_833e5: ; 833e5
dr $833e5, $833eb
Func_833eb:
ld a, [wc78c]
cp $c
jp nc, Func_833f9
ld hl, Data_833df
call Func_80d9b_20
Func_833f9: ; 833f9 (20:73f9)
ld a, [wc78c]
cp $5
jp nc, Func_83407
ld hl, Data_833e5
call Func_80d9b_20
Func_83407: ; 83407 (20:7407)
call Func_80f02_20
ret
Data_8340b:
dr $8340b, $8342c
Data_8342c: ; 8342c
dr $8342c, $83431
Func_83431:
call Func_8346a
ld hl, Func_8346a
call Func_80f11_20
ld a, $c
ld [wc7de], a
loadwarps $3, Data_8340b
ld e, $1
ld hl, Data_8342c
call Func_80ce7_20
playmusic SONG_SHOP
call FadeInMap_20
ld hl, Func_03d3
call LandmarkSign_20
ret
Data_8345e:
dr $8345e, $83464
Data_83464: ; 83464
dr $83464, $8346a
Func_8346a:
ld a, [wc78c]
cp $d
jp nc, Func_83478
ld hl, Data_8345e
call Func_80d9b_20
Func_83478: ; 83478 (20:7478)
ld a, [wc78c]
cp $5
jp nc, Func_83486
ld hl, Data_83464
call Func_80d9b_20
Func_83486: ; 83486 (20:7486)
call Func_80f02_20
ret
Data_8348a:
dr $8348a, $834af
Data_834af: ; 834af
dr $834af, $834bd
Func_834bd:
call Func_834f6
ld hl, Func_834f6
call Func_80f11_20
ld a, $d
ld [wc7de], a
loadwarps $3, Data_8348a
loadpeople $1, Data_834af
playmusic SONG_SHOP
call FadeInMap_20
landmarksign TreeBitstreamText_46c83
ret
Data_834ea:
dr $834ea, $834f0
Data_834f0: ; 834f0
dr $834f0, $834f6
Func_834f6: ; 834f6 (20:74f6)
ld a, [wc78c]
cp $e
jp nc, Func_83504
ld hl, Data_834ea
call Func_80d9b_20
Func_83504: ; 83504 (20:7504)
ld a, [wc78c]
cp $5
jp nc, Func_83512
ld hl, Data_834f0
call Func_80d9b_20
Func_83512: ; 83512 (20:7512)
call Func_80f02_20
ret
Data_83516:
dr $83516, $83537
Func_83537:
call Func_83568
ld hl, Func_83568
call Func_80f11_20
ld a, $e
ld [wc7de], a
loadwarps $3, Data_83516
playmusic SONG_SHOP
call FadeInMap_20
ld hl, GetSRAMBank
call LandmarkSign_20
ret
Data_8355c:
dr $8355c, $83562
Data_83562: ; 83562
dr $83562, $83568
Func_83568:
ld a, [wc78c]
cp $f
jp nc, Func_83576
ld hl, Data_8355c
call Func_80d9b_20
Func_83576: ; 83576 (20:7576)
ld a, [wc78c]
cp $5
jp nc, Func_83584
ld hl, Data_83562
call Func_80d9b_20
Func_83584: ; 83584 (20:7584)
call Func_80f02_20
ret
Data_83588:
dr $83588, $835a9
Data_835a9: ; 835a9
dr $835a9, $835ae
Func_835ae:
call Func_835e7
ld hl, Func_835e7
call Func_80f11_20
ld a, $f
ld [wc7de], a
loadwarps $3, Data_83588
ld e, $1
ld hl, Data_835a9
call Func_80ce7_20
playmusic SONG_SHOP
call FadeInMap_20
landmarksign TreeBitstreamText_46c9b
ret
Data_835db:
dr $835db, $835e1
Data_835e1: ; 835e1
dr $835e1, $835e7
Func_835e7: ; 835e7 (20:75e7)
ld a, [wc78c]
cp $10
jp nc, Func_835f5
ld hl, Data_835db
call Func_80d9b_20
Func_835f5: ; 835f5 (20:75f5)
ld a, [wc78c]
cp $5
jp nc, Func_83603
ld hl, Data_835e1
call Func_80d9b_20
Func_83603: ; 83603 (20:7603)
call Func_80f02_20
ret
Data_83607:
dr $83607, $83628
Data_83628: ; 83628
dr $83628, $83632
Func_83632:
call Func_8366b
ld hl, Func_8366b
call Func_80f11_20
ld a, $10
ld [wc7de], a
loadwarps $3, Data_83607
ld e, $2
ld hl, Data_83628
call Func_80ce7_20
playmusic SONG_SHOP
call FadeInMap_20
landmarksign TreeBitstreamText_46ca8
ret
Data_8365f:
dr $8365f, $83665
Data_83665: ; 83665
dr $83665, $8366b
Func_8366b:
ld a, [wc78c]
cp $11
jp nc, Func_83679
ld hl, Data_8365f
call Func_80d9b_20
Func_83679: ; 83679 (20:7679)
ld a, [wc78c]
cp $5
jp nc, Func_83687
ld hl, Data_83665
call Func_80d9b_20
Func_83687: ; 83687 (20:7687)
call Func_80f02_20
ret
Data_8368b:
dr $8368b, $836ac
Data_836ac: ; 836ac
dr $836ac, $836b1
Func_836b1:
call Func_836ea
ld hl, Func_836ea
call Func_80f11_20
ld a, $11
ld [wc7de], a
loadwarps $3, Data_8368b
ld e, $1
ld hl, Data_836ac
call Func_80ce7_20
playmusic SONG_SHOP
call FadeInMap_20
landmarksign TreeBitstreamText_46cb3
ret
Data_836de:
dr $836de, $836e4
Data_836e4: ; 836e4
dr $836e4, $836ea
Func_836ea: ; 836ea (20:76ea)
ld a, [wc78c]
cp $12
jp nc, Func_836f8
ld hl, Data_836de
call Func_80d9b_20
Func_836f8: ; 836f8 (20:76f8)
ld a, [wc78c]
cp $5
jp nc, Func_83706
ld hl, Data_836e4
call Func_80d9b_20
Func_83706: ; 83706 (20:7706)
call Func_80f02_20
ret
Data_8370a:
dr $8370a, $8372b
Data_8372b: ; 8372b
dr $8372b, $83730
Func_83730:
call Func_83769
ld hl, Func_83769
call Func_80f11_20
ld a, $12
ld [wc7de], a
loadwarps $3, Data_8370a
ld e, $1
ld hl, Data_8372b
call Func_80ce7_20
playmusic SONG_SHOP
call FadeInMap_20
landmarksign TreeBitstreamText_46cbf
ret
Data_8375d:
dr $8375d, $83763
Data_83763: ; 83763
dr $83763, $83769
Func_83769: ; 83769 (20:7769)
ld a, [wc78c]
cp $13
jp nc, Func_83777
ld hl, Data_8375d
call Func_80d9b_20
Func_83777: ; 83777 (20:7777)
ld a, [wc78c]
cp $5
jp nc, Func_83785
ld hl, Data_83763
call Func_80d9b_20
Func_83785: ; 83785 (20:7785)
call Func_80f02_20
ret
Data_83789:
dr $83789, $837aa
Func_837aa:
call Func_837db
ld hl, Func_837db
call Func_80f11_20
ld a, $13
ld [wc7de], a
loadwarps $3, Data_83789
playmusic SONG_SHOP
call FadeInMap_20
landmarksign TreeBitstreamText_46ccb
ret
Data_837cf:
dr $837cf, $837d5
Data_837d5: ; 837d5
dr $837d5, $837db
Func_837db:
ld a, [wc78c]
cp $14
jp nc, Func_837e9
ld hl, Data_837cf
call Func_80d9b_20
Func_837e9: ; 837e9 (20:77e9)
ld a, [wc78c]
cp $5
jp nc, Func_837f7
ld hl, Data_837d5
call Func_80d9b_20
Func_837f7: ; 837f7 (20:77f7)
call Func_80f02_20
ret
Data_837fb:
dr $837fb, $83811
Data_83811: ; 83811
dr $83811, $83816
Func_83816:
call Func_8384f
ld hl, Func_8384f
call Func_80f11_20
ld a, $14
ld [wc7de], a
loadwarps $2, Data_837fb
ld e, $1
ld hl, Data_83811
call Func_80ce7_20
playmusic SONG_SHOP
call FadeInMap_20
landmarksign TreeBitstreamText_46cd7
ret
Data_83843:
dr $83843, $83849
Data_83849: ; 83849
dr $83849, $8384f
Func_8384f:
ld a, [wc78c]
cp $15
jp nc, Func_8385d
ld hl, Data_83843
call Func_80d9b_20
Func_8385d: ; 8385d (20:785d)
ld a, [wc78c]
cp $5
jp nc, Func_8386b
ld hl, Data_83849
call Func_80d9b_20
Func_8386b: ; 8386b (20:786b)
call Func_80f02_20
ret
Data_8386f:
dr $8386f, $83885
Data_83885: ; 83885
dr $83885, $83894
Data_83894: ; 83894
dr $83894, $838a2
Func_838a2:
call Func_838f0
ld hl, Func_838f0
call Func_80f11_20
xor a
ld [wc7de], a
loadwarps $2, Data_8386f
ld e, $3
ld hl, Data_83885
call Func_80ce7_20
loadpeople $1, Data_83894
playmusic SONG_SHOP
call Func_83e56
ld [wc7a4], a
ld a, [wc7a4]
cp $1
jp nz, Func_838e0
ld e, $0
xor a
call SetPersonVisibilityState_20
Func_838e0: ; 838e0 (20:78e0)
call FadeInMap_20
landmarksign TreeBitstreamText_46c00
ret
Data_838ea: ; 838ea
dr $838ea, $838f0
Func_838f0: ; 838f0 (20:78f0)
ld a, [wc78c]
cp $5
jp nc, Func_83901
ld hl, Data_838ea
call Func_80d9b_20
call Func_80f02_20
Func_83901: ; 83901 (20:7901)
ret
Data_83902:
dr $83902, $839ff
Data_839ff: ; 839ff
dr $839ff, $83a13
Data_83a13: ; 83a13
dr $83a13, $83a17
Data_83a17: ; 83a17
dr $83a17, $83a1f
Data_83a1f:
push af
ld hl, -$12e
add hl, sp
ld sp, hl
push de
ld hl, sp+$33
reg16swap de, hl
ld hl, Data_83902
ld bc, $fc
call MemCopy
pop de
ld a, e
or a
jp nz, Func_83e48
ld hl, $12f
add hl, sp
ld a, [hl]
call FacePlayer_20
checkevent $58
or a
jp nz, Func_83a5e
writenpctext TreeBitstreamText_45c80
setevent $58
jp Func_83e48
Func_83a5e: ; 83a5e (20:7a5e)
ld a, [wc79d]
cp $1
jp nz, Func_83b71
ld a, [wc7a4]
cp $ff
jp nz, Func_83a7b
writenpctext TreeBitstreamText_47e30
xor a
ld [wc79d], a
jp Func_83b6e
Func_83a7b: ; 83a7b (20:7a7b)
writenpctext TreeBitstreamText_45e29
ld a, [wc78c]
inc a
ld [wc78c], a
xor a
ld [wc79d], a
ld a, [wc78c]
cp $2
jp z, Func_83b53
cp $3
jp z, Func_83b3b
cp $4
jp z, Func_83b23
cp $5
jp z, Func_83b0b
cp $8
jp z, Func_83af3
cp $9
jp z, Func_83adb
cp $a
jp nz, Func_83b6e
checkevent $110
or a
jp nz, Func_83adb
playsfx $5c
script_sleep $78
writenpctext TreeBitstreamText_39c6c
writenpctext TreeBitstreamText_39c82
setevent $110
Func_83adb: ; 83adb (20:7adb)
checkevent $106
or a
jp nz, Func_83af3
landmarksign TreeBitstreamText_461a9
setevent $106
Func_83af3: ; 83af3 (20:7af3)
checkevent $105
or a
jp nz, Func_83b0b
landmarksign TreeBitstreamText_461b4
setevent $105
Func_83b0b: ; 83b0b (20:7b0b)
checkevent $104
or a
jp nz, Func_83b23
landmarksign TreeBitstreamText_46175
setevent $104
Func_83b23: ; 83b23 (20:7b23)
checkevent $103
or a
jp nz, Func_83b3b
landmarksign TreeBitstreamText_4619b
setevent $103
Func_83b3b: ; 83b3b (20:7b3b)
checkevent $102
or a
jp nz, Func_83b53
landmarksign TreeBitstreamText_4618f
setevent $102
Func_83b53: ; 83b53 (20:7b53)
checkevent $101
or a
jp nz, Func_83b6b
landmarksign TreeBitstreamText_46183
setevent $101
Func_83b6b: ; 83b6b (20:7b6b)
jp Func_83b6e
Func_83b6e: ; 83b6e (20:7b6e)
jp Func_83e48
Func_83b71: ; 83b71 (20:7b71)
ld a, [wc78c]
cp $14
jp nz, Func_83b96
checkevent $e7
cp $1
jp nz, Func_83b8d
writenpctext TreeBitstreamText_45db0
jp Func_83b93
Func_83b8d: ; 83b8d (20:7b8d)
writenpctext TreeBitstreamText_45dff
Func_83b93: ; 83b93 (20:7b93)
jp Func_83e48
Func_83b96: ; 83b96 (20:7b96)
push hl
push hl
ld hl, $0
push hl
ld hl, $0
push hl
call AdjustMoney
pop bc
pop bc
ld hl, sp+$f
call PutLongFromStackToHL
ld hl, sp+$7
push hl
ld hl, wc78c
ld l, [hl]
ld h, $0
add hl, hl
add hl, hl
ld e, l
ld d, h
add hl, hl
add hl, de
reg16swap de, hl
ld hl, sp+$33
add hl, de
ld de, $8
add hl, de
pop de
ld bc, $4
call MemCopy
ld hl, sp+$b
call PutLongFromHLOnStack
ld hl, sp+$b
call PutLongFromHLOnStack
call CompareStackLongs_Signed
jp c, Func_83e42
writenpctext_yesorno TreeBitstreamText_45cb9
or a
jp nz, Func_83e39
ld a, $3
call Random_20
cp $2
jp z, Func_83c48
cp $1
jp z, Func_83c1e
or a
jp nz, Func_83c6f
writenpctext TreeBitstreamText_45d1c
ld hl, sp+$b
push hl
ld hl, wc78c
ld l, [hl]
ld h, $0
add hl, hl
add hl, hl
ld e, l
ld d, h
add hl, hl
add hl, de
reg16swap de, hl
ld hl, sp+$33
add hl, de
pop de
ld bc, $4
call MemCopy
jp Func_83c6f
Func_83c1e: ; 83c1e (20:7c1e)
writenpctext TreeBitstreamText_45d3d
ld hl, sp+$b
push hl
ld hl, wc78c
ld l, [hl]
ld h, $0
add hl, hl
add hl, hl
ld e, l
ld d, h
add hl, hl
add hl, de
reg16swap de, hl
ld hl, sp+$33
add hl, de
inc hl
inc hl
inc hl
inc hl
pop de
ld bc, $4
call MemCopy
jp Func_83c6f
Func_83c48: ; 83c48 (20:7c48)
writenpctext TreeBitstreamText_45d61
ld hl, sp+$b
push hl
ld hl, wc78c
ld l, [hl]
ld h, $0
add hl, hl
add hl, hl
ld e, l
ld d, h
add hl, hl
add hl, de
reg16swap de, hl
ld hl, sp+$33
add hl, de
ld de, $8
add hl, de
pop de
ld bc, $4
call MemCopy
Func_83c6f: ; 83c6f (20:7c6f)
ld hl, sp+$b
call PutLongFromHLOnStack
ld hl, sp+$13
call PrintNum
pop bc
pop bc
ld hl, sp+$f
call FindFirstNonzero
reg16swap de, hl
ld hl, sp+$f
add hl, de
ld de, Data_83e4e
call CopyUntilNull
ld hl, sp+$f
write_hl_to_sp_plus $2f
ld hl, $0
write_hl_to_sp_plus $31
ld a, $1
ld [wEnableAttrMapTransfer], a
ld l, $12
push hl
ld c, $14
ld e, $0
xor a
call PushBGMapRegion_NoWaitBefore
pop bc
set_farcall_addrs_hli Func_17e95
ld c, $5
ld e, $14
ld hl, $d
call FarCall
set_farcall_addrs_hli Func_da901
ld de, PutOnVideoTransferQueue
ld hl, $d
call FarCall
push hl
ld a, $2
ld [wEnableAttrMapTransfer], a
ld l, $12
push hl
ld c, $14
ld e, $0
xor a
call PushBGMapRegion
pop bc
ld l, $12
push hl
ld c, $14
ld e, $0
xor a
call PushBGMapRegion
pop bc
set_farcall_addrs_hli PrintMapText_
ld c, $80
ld hl, sp+$2f
reg16swap de, hl
ld hl, $10e
call FarCall
set_farcall_addrs_hli SetSpriteYCoordinatesAndCollectGarbage
pop hl
call FarCall
writenpctext TreeBitstreamText_45d82
ld a, [wMapX]
cp $3
jp nz, Func_83d45
ld a, [wMapY]
cp $1
jp nz, Func_83d45
ld bc, Data_83a17
ld e, BANK(Data_83a17)
ld hl, $12f
add hl, sp
ld a, [hl]
call Func_80688_20
playsfx $2e
jp Func_83d57
Func_83d45: ; 83d45 (20:7d45)
ld bc, Data_83a13
ld e, BANK(Data_83a13)
ld hl, $12f
add hl, sp
ld a, [hl]
call Func_80688_20
playsfx $2e
Func_83d57: ; 83d57 (20:7d57)
ld e, $0
ld hl, $12f
add hl, sp
ld a, [hl]
call SetPersonVisibilityState_20
playsfx $2e
push hl
push hl
ld hl, sp+$f
call PutLongFromHLOnStack
call NegateLongOnStack
call AdjustMoney
pop bc
pop bc
pop bc
pop bc
ld hl, sp+$2
call Func_80f94_20
ld hl, sp+$5
ld l, [hl]
ld h, $0
ld de, $3c
call MultiplyHLbyDE
reg16swap de, hl
ld hl, sp+$6
ld l, [hl]
ld h, $0
add hl, de
ld c, l
ld b, h
push bc
set_farcall_addrs_hli Func_93883
ld hl, sp+$6
ld c, [hl]