-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbank_024.asm
executable file
·14676 lines (13680 loc) · 162 KB
/
bank_024.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
; Disassembly of "DQM.gbc"
; This file was created with:
; mgbdis v1.4 - Game Boy ROM disassembler by Matt Currie and contributors.
; https://github.com/mattcurrie/mgbdis
SECTION "ROM Bank $024", ROMX[$4000], BANK[$24]
inc h
dec a
ld b, b
ret z
ld b, h
dec c
ld b, [hl]
add hl, sp
ld b, a
sub c
ld c, h
jp $fa4d
ld c, [hl]
jp z, $b452
ld d, e
xor b
ld d, h
ld d, $57
rla
ld e, b
jr nz, @+$5b
inc de
ld e, h
di
ld e, h
jp c, $195d
ld h, d
nop
ld h, e
db $ed
ld h, e
sbc $66
ld [$d367], a
ld l, b
and h
ld l, e
db $76
ld l, h
ld c, d
ld l, l
ld b, d
ld [hl], c
adc b
ld [hl], d
adc $73
xor d
ld a, c
pop de
ld a, d
nop
ld [$0015], sp
rst $38
ld a, a
ld a, a
add b
cp a
ld a, a
ld a, a
cp e
cp e
sub c
sub c
sub c
cp e
cp e
rst $38
nop
rst $38
rst $38
dec d
rrca
ld bc, $bbbb
ld de, $1111
dec d
dec c
ld bc, $fefe
ld bc, $fefd
cp $15
jr jr_024_4068
cp c
jr_024_4068:
cp e
rst $38
xor $ee
call nz, $c4c4
xor $ee
rst $38
dec d
ld [$ee04], sp
xor $44
ld b, h
ld b, h
dec d
dec [hl]
ld bc, $1a15
ld [bc], a
rst $28
rst $28
ld b, l
ld b, l
ld b, l
rst $28
rst $28
jr_024_4087:
dec d
rla
dec b
rst $38
rst $38
add b
sbc a
rst $38
rst $38
ld c, b
ret z
ld c, b
ret c
ld c, b
rst $18
ld c, e
call c, $df48
dec d
ld [de], a
ld [bc], a
dec d
db $fc
ld a, [c]
cp e
ld b, h
dec d
stop
ld bc, $fffd
rst $38
ld [de], a
inc de
ld [de], a
dec de
ld [de], a
ei
or d
ld e, e
ld [de], a
ei
ld c, [hl]
reti
dec d
ld l, d
ld [bc], a
dec d
sub b
inc b
xor $11
dec d
ld a, d
ld [bc], a
dec d
and b
inc b
ld a, [c]
dec d
adc c
inc bc
dec d
or b
inc b
dec d
sub b
ld [bc], a
ld c, a
rst $18
ld c, b
rst $18
ld c, b
ret c
ld c, a
rst $18
jr nc, jr_024_4087
dec d
and b
ld [bc], a
dec d
ld [de], a
nop
nop
nop
Call_024_40df:
dec d
ld [hl], h
nop
dec d
or b
ld [bc], a
ld a, [c]
ei
ld [de], a
ei
ld [de], a
dec de
ld a, [c]
ei
inc c
dec c
dec d
pop af
db $fc
ld bc, $02b7
ld a, [hl]
ld b, $6e
dec bc
db $eb
rra
cp [hl]
ld a, [hl+]
ld l, e
ld a, [hl]
ld a, a
call c, $80d3
or a
ld b, b
rst $38
ld h, b
db $eb
ret nc
ei
ret z
ld e, a
call nz, $f26d
ld [hl], a
ld sp, hl
dec bc
ld bc, $1115
dec bc
ld [hl], b
ld a, a
cp $ff
ld a, [hl+]
db $eb
sub $d7
rst $38
ei
ld e, a
ld e, b
sbc b
sbc a
xor a
rst $28
ld [$7ffd], sp
rst $38
ld hl, sp+$7b
rst $28
ld l, a
rst $30
rst $18
ei
dec de
add hl, de
ei
push af
db $fd
add b
dec d
ld de, $150b
ld d, b
nop
ld b, a
rst $28
xor $fe
cp [hl]
cp a
rla
rla
ld a, [de]
cp d
cp h
db $fc
ld c, h
ld c, l
rst $10
rst $30
ld [hl], h
ld a, l
ld e, c
ld e, e
sub e
sub a
and [hl]
xor $cc
call c, $b998
or e
inc sp
db $eb
rst $28
ld l, $ff
sbc d
cp [hl]
ret
jr_024_4162:
reti
ld h, l
ld l, a
inc sp
jr_024_4166:
scf
add hl, de
sbc e
dec d
ld b, b
nop
call nz, Call_024_6eee
ld a, a
ld a, e
ei
pop de
pop de
ld [hl], c
ei
dec hl
cpl
db $fd
rst $38
ld d, [hl]
jr_024_417b:
ld d, [hl]
ld h, h
push hl
jp hl
ei
db $d3
rst $10
ld h, [hl]
ld l, [hl]
dec d
ld a, h
db $10
jr nc, jr_024_41fc
ld h, b
rst $20
jp $80cc
sbc a
ld c, $31
nop
ld a, a
dec sp
call nz, $ff00
inc c
call $e606
add e
ld [hl], e
ld bc, $e0f9
inc e
nop
cp $b8
ld b, a
nop
rst $38
cp [hl]
cp $6c
db $fc
inc h
ld h, [hl]
sub [hl]
cp a
set 3, e
dec d
adc d
ld [de], a
dec d
or b
rra
dec c
rst $08
cpl
db $10
rst $10
jr nz, jr_024_4166
ld l, $ae
jr nz, jr_024_4162
dec d
Jump_024_41c3:
ld b, $22
ld a, [c]
push af
ld [$07eb], sp
sub h
ld [hl], h
rst $38
ld b, $8d
ld [hl], h
jr_024_41d0:
rst $38
rlca
adc h
ld [hl], h
rst $38
dec d
ld [$ae21], sp
jr nz, jr_024_417b
ld a, a
ld a, a
add b
add b
ld a, a
ld a, a
nop
add b
dec d
jr jr_024_4207
sbc h
inc b
rlca
cp $ff
ld bc, $fe05
cp $00
inc bc
rst $00
scf
jr jr_024_41d0
and b
jr z, jr_024_4238
ret nz
ld e, a
ld e, a
ld b, c
jr_024_41fc:
ld d, c
ld b, c
ld e, a
ld b, b
ld b, b
ld a, [c]
push af
inc c
db $ed
ld [bc], a
ld a, [bc]
jr_024_4207:
ld bc, $7d01
ld a, l
dec b
ld b, l
dec b
ld a, l
ld bc, $4001
ld b, b
ld d, h
ld c, h
ld e, h
ld e, h
ret nz
ret nz
ld a, a
ld a, a
ld b, b
ld a, a
ret nz
ret nz
ccf
ccf
dec d
ld e, b
inc h
rst $38
rst $38
ld bc, $01ff
ld bc, $fefe
db $eb
inc de
dec b
or $ab
ld c, l
inc d
ld hl, sp-$22
db $10
ld l, $f4
jr_024_4238:
cp [hl]
inc l
ld [hl], $a4
adc $d1
ldh [$2f], a
or e
call nc, $efd8
ld a, [$ec89]
or a
rst $18
sub h
call c, $3697
and h
ld a, $a0
or [hl]
inc h
dec d
and b
jr nz, jr_024_4294
xor [hl]
or b
jr nz, jr_024_4298
and b
sbc $95
jr_024_425d:
db $fc
add a
jr_024_425f:
dec d
sbc h
jr_024_4261:
jr nz, jr_024_4261
add l
db $fc
rst $30
rrca
jr_024_4267:
inc b
db $fc
add a
ld a, $ac
ld [hl], $a4
dec d
and h
jr nz, jr_024_42a8
and h
cpl
or b
cp a
ccf
nop
add b
cp $b5
call c, $1597
sbc h
jr nz, jr_024_425f
sub l
db $f4
rrca
rst $38
db $fc
nop
inc bc
dec d
or b
ld [de], a
nop
rra
jr_024_428d:
ld c, $31
dec d
ld a, d
ld [bc], a
dec d
ret nz
jr_024_4294:
ld [de], a
nop
ld hl, sp-$20
jr_024_4298:
inc e
dec d
ld a, d
ld [bc], a
add e
db $eb
ld b, h
ld d, l
jr jr_024_425d
jr nz, jr_024_42ce
ld c, b
call c, $f930
jr_024_42a8:
ld b, d
di
ld l, b
jp hl
add d
and a
ld b, h
ld e, a
jr nc, jr_024_4267
inc c
xor a
ld h, $77
sbc l
cp l
ld b, [hl]
ld e, a
inc l
cpl
inc bc
ei
inc b
and l
jr jr_024_431d
jr nz, jr_024_432e
ld c, b
call c, $b930
ld b, d
ld [hl], e
ld l, b
ld l, b
add b
or a
jr_024_42ce:
ld b, b
ld e, l
jr nc, jr_024_428d
ld [$24aa], sp
ld [hl], a
sbc b
cp c
ld b, h
ld e, l
Jump_024_42da:
inc l
ld l, $31
cp c
ld b, b
ld d, d
sub b
or l
ld h, d
ei
adc d
xor a
ld [hl], d
ld a, d
and l
or l
ld a, b
ld a, [$0b0a]
ld b, $57
ld [de], a
ld e, d
inc c
ld l, l
sub d
cp e
adc c
ret
ld b, $26
ld [hl+], a
dec sp
sub c
Call_024_42fd:
sub l
ld h, d
ld a, d
ld c, h
db $ec
inc [hl]
or l
inc b
ld [hl], a
ld [$02bd], sp
db $eb
nop
cp $1a
ld e, d
call $32fd
inc sp
jr nz, jr_024_4343
ld d, b
ld d, a
and b
and e
sub b
rst $18
nop
jr_024_431b:
rst $38
ld b, b
jr_024_431d:
rst $30
jr nc, jr_024_431d
add hl, bc
ld l, a
inc d
or $20
ld l, d
ld c, d
jp nc, $e846
ld e, h
di
nop
cp [hl]
jr_024_432e:
jr nz, jr_024_431b
nop
and $90
di
ld [hl+], a
dec hl
ld c, d
Call_024_4337:
sub $1c
and b
xor c
scf
and h
or c
reti
jp z, $e4d3
and a
jr_024_4343:
sbc b
inc hl
or h
push hl
sbc [hl]
jr jr_024_434f
inc sp
or h
sbc b
ld b, [hl]
push de
jr_024_434f:
cpl
add b
ld [hl], h
ld [de], a
db $db
adc l
ld d, e
inc [hl]
adc l
inc b
jr_024_4359:
rst $20
jr c, jr_024_439a
ld b, b
ld a, d
jr c, jr_024_4359
ld b, $6f
inc c
xor d
add d
sub l
ld d, e
ld hl, sp+$47
call nc, $aa31
ld b, b
and $08
dec de
add sp, -$46
or d
db $db
db $10
dec h
ld c, l
ld d, e
ret z
ld h, $7d
add e
add c
jp z, $f451
ld d, b
ret
xor h
push af
inc l
inc hl
call nc, $04b8
ld [hl], $26
and c
nop
db $dd
adc e
ld l, l
pop hl
inc bc
inc [hl]
ret z
add e
ld a, a
ld h, h
sub l
sub [hl]
add [hl]
jr_024_439a:
ld a, b
ld e, l
ld h, e
sbc e
dec c
xor $9e
ld d, c
ld [hl], $af
ld l, d
db $db
and c
add d
and e
push bc
cp h
ret nz
add $d9
ldh a, [$37]
cp c
ld c, d
db $ec
ld [hl], l
sub [hl]
ld a, [de]
call $ab09
call $615f
cp d
call c, $86a5
ld d, d
ld h, e
ld a, [hl+]
or a
sub a
jr jr_024_43d3
call $8363
nop
ld hl, sp-$45
db $dd
push hl
jr_024_43cf:
ld hl, $4ac6
sbc h
jr_024_43d3:
dec h
ld sp, hl
ld a, [bc]
jr nc, jr_024_43cf
add $c9
nop
ccf
dec d
and b
rst $38
ld c, l
dec d
sbc a
ld c, a
ld c, l
nop
or a
nop
ld a, a
nop
ld l, e
nop
db $eb
nop
or a
nop
ld a, l
nop
ld l, l
nop
or $00
db $fc
nop
di
ld [bc], a
push hl
nop
db $db
ld [$00b5], sp
cp h
ld [bc], a
reti
nop
and e
nop
db $fc
nop
inc sp
ld [bc], a
add l
dec d
ld d, $51
inc a
ld [bc], a
add hl, de
nop
inc hl
nop
ld a, [$6f00]
nop
cp c
inc b
or d
nop
halt
cp c
nop
ld c, a
nop
ld [hl], $10
xor b
nop