-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBank $90.asm
17085 lines (14866 loc) · 771 KB
/
Bank $90.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
;;; $8000..85E1: Animate Samus ;;;
{
;;; $8000: Animate Samus ;;;
{
$90:8000 08 PHP
$90:8001 C2 30 REP #$30
$90:8003 22 58 EC 90 JSL $90EC58[$90:EC58] ; $14 = Samus top boundary
$90:8007 AD 6E 19 LDA $196E [$7E:196E] ;\
$90:800A 29 0F 00 AND #$000F ;|
$90:800D AA TAX ;} Execute [$8067 + ([FX type] & Fh)]
$90:800E FC 67 80 JSR ($8067,x)[$90:8078];/
$90:8011 AD 1C 0A LDA $0A1C [$7E:0A1C] ;\
$90:8014 C9 4D 00 CMP #$004D ;|
$90:8017 F0 19 BEQ $19 [$8032] ;} If Samus pose is normal jump - not aiming - not moving - gun not extended: go to BRANCH_NEUTRAL_JUMP
$90:8019 C9 4E 00 CMP #$004E ;|
$90:801C F0 14 BEQ $14 [$8032] ;/
$90:801E AD 94 0A LDA $0A94 [$7E:0A94] ;\
$90:8021 3A DEC A ;} Decrement Samus animation frame timer
$90:8022 8D 94 0A STA $0A94 [$7E:0A94] ;/
$90:8025 F0 02 BEQ $02 [$8029] ;\
$90:8027 10 3C BPL $3C [$8065] ;} If [Samus animation frame timer] > 0: return
$90:8029 AD 96 0A LDA $0A96 [$7E:0A96] ;\
$90:802C 1A INC A ;} Increment Samus animation frame
$90:802D 8D 96 0A STA $0A96 [$7E:0A96] ;/
$90:8030 80 30 BRA $30 [$8062] ; Go to BRANCH_HANDLE_DELAY
; BRANCH_NEUTRAL_JUMP
$90:8032 AD 36 0B LDA $0B36 [$7E:0B36] ;\
$90:8035 C9 02 00 CMP #$0002 ;} If [Samus Y direction] != down:
$90:8038 F0 16 BEQ $16 [$8050] ;/
$90:803A AD 96 0A LDA $0A96 [$7E:0A96] ;\
$90:803D C9 01 00 CMP #$0001 ;} If [Samus animation frame] = 1:
$90:8040 D0 0E BNE $0E [$8050] ;/
$90:8042 AD 94 0A LDA $0A94 [$7E:0A94] ;\
$90:8045 C9 01 00 CMP #$0001 ;} If [Samus animation frame timer] = 1:
$90:8048 D0 06 BNE $06 [$8050] ;/
$90:804A A9 04 00 LDA #$0004 ;\
$90:804D 8D 94 0A STA $0A94 [$7E:0A94] ;} Samus animation frame timer = 4
$90:8050 AD 94 0A LDA $0A94 [$7E:0A94] ;\
$90:8053 3A DEC A ;} Decrement Samus animation frame timer
$90:8054 8D 94 0A STA $0A94 [$7E:0A94] ;/
$90:8057 F0 02 BEQ $02 [$805B] ;\
$90:8059 10 0A BPL $0A [$8065] ;} If [Samus animation frame timer] > 0: return
$90:805B AD 96 0A LDA $0A96 [$7E:0A96] ;\
$90:805E 1A INC A ;} Increment Samus animation frame
$90:805F 8D 96 0A STA $0A96 [$7E:0A96] ;/
; BRANCH_HANDLE_DELAY
$90:8062 20 DC 82 JSR $82DC [$90:82DC] ; Handle animation delay
$90:8065 28 PLP
$90:8066 60 RTS
$90:8067 dw 8078, 81C0, 8219, 80B8, 8077, 8077, 8077, 8077
}
;;; $8077: RTS ;;;
{
; 8: Spores
; Ah: Rain
; Ch: Fog
; 28h: Ceres Ridley
; 2Ah: Ceres elevator
; 2Ch: Haze
$90:8077 60 RTS
}
;;; $8078: Animate Samus - FX = none ;;;
{
;; Parameters:
;; $12: Samus bottom boundary
;; $14: Samus top boundary
; 0: None
; 20h: Scrolling sky
$90:8078 AD 66 0A LDA $0A66 [$7E:0A66] ;\
$90:807B 8D 9C 0A STA $0A9C [$7E:0A9C] ;} Animation frames buffer = [Samus X speed divisor]
$90:807E AD D2 0A LDA $0AD2 [$7E:0AD2] ;\
$90:8081 F0 34 BEQ $34 [$80B7] ;} If [liquid physics type] = air: return
$90:8083 89 01 00 BIT #$0001 ;\
$90:8086 D0 04 BNE $04 [$808C] ;} If [liquid physics type] != water:
$90:8088 9C D2 0A STZ $0AD2 [$7E:0AD2] ; Liquid physics type = air
$90:808B 60 RTS ; Return
$90:808C 9C D2 0A STZ $0AD2 [$7E:0AD2] ; Liquid physics type = air
$90:808F A9 0E 00 LDA #$000E ;\
$90:8092 22 CB 90 80 JSL $8090CB[$80:90CB] ;} Queue sound Eh, sound library 2, max queued sounds allowed = 6 (splashed out of water)
$90:8096 AD 74 0A LDA $0A74 [$7E:0A74] ;\
$90:8099 89 04 00 BIT #$0004 ;} If [Samus suit palette index] = gravity suit: go to spawn water splash
$90:809C D0 17 BNE $17 [$80B5] ;/
$90:809E AD 1F 0A LDA $0A1F [$7E:0A1F] ;\
$90:80A1 29 FF 00 AND #$00FF ;|
$90:80A4 C9 03 00 CMP #$0003 ;} If [Samus movement type] != spin jumping:
$90:80A7 F0 05 BEQ $05 [$80AE] ;/
$90:80A9 C9 14 00 CMP #$0014 ;\
$90:80AC D0 07 BNE $07 [$80B5] ;} If [Samus movement type] != wall jumping: go to spawn water splash
$90:80AE A9 30 00 LDA #$0030 ;\
$90:80B1 22 49 90 80 JSL $809049[$80:9049] ;} Queue sound 30h, sound library 1, max queued sounds allowed = 6 (resumed spin jump)
$90:80B5 80 2F BRA $2F [$80E6] ; Go to spawn water splash
$90:80B7 60 RTS
}
;;; $80B8: Animate Samus - FX = water ;;;
{
;; Parameters:
;; $12: Samus bottom boundary
;; $14: Samus top boundary
; 6h: Water
; 26h: Tourian entrance statue
$90:80B8 AD 5E 19 LDA $195E [$7E:195E] ;\
$90:80BB 30 BB BMI $BB [$8078] ;} [FX Y position] < 0: go to animate Samus - FX = none
$90:80BD C5 12 CMP $12 [$7E:0012] ;\
$90:80BF 30 02 BMI $02 [$80C3] ;} If [FX Y position] >= [Samus bottom boundary]:
$90:80C1 80 B5 BRA $B5 [$8078] ; Go to animate Samus - FX = none
$90:80C3 AD 7E 19 LDA $197E [$7E:197E] ;\
$90:80C6 89 04 00 BIT #$0004 ;} If liquid physics are disabled: go to animate Samus - FX = none
$90:80C9 D0 AD BNE $AD [$8078] ;/
$90:80CB AD 93 9E LDA $9E93 [$90:9E93] ;\
$90:80CE 8D 9C 0A STA $0A9C [$7E:0A9C] ;} Animation frames buffer = 3
$90:80D1 AD D2 0A LDA $0AD2 [$7E:0AD2] ;\
$90:80D4 C9 01 00 CMP #$0001 ;} If [liquid physics type] = water: go to spawn air bubbles
$90:80D7 F0 65 BEQ $65 [$813E] ;/
$90:80D9 A9 01 00 LDA #$0001 ;\
$90:80DC 8D D2 0A STA $0AD2 [$7E:0AD2] ;} Liquid physics type = water
$90:80DF A9 0D 00 LDA #$000D ;\
$90:80E2 22 CB 90 80 JSL $8090CB[$80:90CB] ;} Queue sound Dh, sound library 2, max queued sounds allowed = 6 (splashed into water)
}
;;; $80E6: Spawn water splash and air bubbles ;;;
{
;; Parameters:
;; $12: Samus bottom boundary
;; $14: Samus top boundary
$90:80E6 AD 1F 0A LDA $0A1F [$7E:0A1F] ;\
$90:80E9 29 FF 00 AND #$00FF ;|
$90:80EC AA TAX ;|
$90:80ED BD A4 81 LDA $81A4,x[$90:81A7] ;} If [$81A4 + [Samus movement type] = 0: (airborne)
$90:80F0 29 FF 00 AND #$00FF ;|
$90:80F3 D0 1A BNE $1A [$810F] ;/
$90:80F5 A9 00 03 LDA #$0300 ;\
$90:80F8 8D EC 0A STA $0AEC [$7E:0AEC] ;} Atmospheric graphics 0 animation frame = 0, type = 3 (diving splash)
$90:80FB A9 02 00 LDA #$0002 ;\
$90:80FE 8D D4 0A STA $0AD4 [$7E:0AD4] ;} Atmospheric graphics 0 animation timer = 2
$90:8101 AD F6 0A LDA $0AF6 [$7E:0AF6] ;\
$90:8104 8D DC 0A STA $0ADC [$7E:0ADC] ;} Atmospheric graphics 0 X position = [Samus X position]
$90:8107 AD 5E 19 LDA $195E [$7E:195E] ;\
$90:810A 8D E4 0A STA $0AE4 [$7E:0AE4] ;} Atmospheric graphics 0 Y position = [FX Y position]
$90:810D 80 2F BRA $2F [$813E]
$90:810F A9 00 01 LDA #$0100 ;\ Else ([$81A4 + [Samus movement type] != 0): (grounded)
$90:8112 8D EC 0A STA $0AEC [$7E:0AEC] ;} Atmospheric graphics 0/1 animation frame = 0, type = 1 (footstep splashes)
$90:8115 8D EE 0A STA $0AEE [$7E:0AEE] ;/
$90:8118 A9 03 00 LDA #$0003 ;\
$90:811B 8D D4 0A STA $0AD4 [$7E:0AD4] ;} Atmospheric graphics 0/1 animation timer = 3
$90:811E 8D D6 0A STA $0AD6 [$7E:0AD6] ;/
$90:8121 AD F6 0A LDA $0AF6 [$7E:0AF6] ;\
$90:8124 18 CLC ;|
$90:8125 69 04 00 ADC #$0004 ;} Atmospheric graphics 0 X position = [Samus X position] + 4
$90:8128 8D DC 0A STA $0ADC [$7E:0ADC] ;/
$90:812B 38 SEC ;\
$90:812C E9 07 00 SBC #$0007 ;} Atmospheric graphics 1 X position = [Samus X position] - 3
$90:812F 8D DE 0A STA $0ADE [$7E:0ADE] ;/
$90:8132 A5 12 LDA $12 [$7E:0012] ;\
$90:8134 38 SEC ;|
$90:8135 E9 04 00 SBC #$0004 ;} Atmospheric graphics 0/1 Y position = [Samus bottom boundary] - 4
$90:8138 8D E4 0A STA $0AE4 [$7E:0AE4] ;|
$90:813B 8D E6 0A STA $0AE6 [$7E:0AE6] ;/
}
;;; $813E: Spawn air bubbles ;;;
{
;; Parameters:
;; $12: Samus bottom boundary
;; $14: Samus top boundary
$90:813E A5 14 LDA $14 [$7E:0014] ;\
$90:8140 38 SEC ;|
$90:8141 E9 18 00 SBC #$0018 ;} If [Samus top boundary] - 18h < [FX Y position]: go to BRANCH_NO_BUBBLES
$90:8144 CD 5E 19 CMP $195E [$7E:195E] ;|
$90:8147 30 42 BMI $42 [$818B] ;/
$90:8149 AD B6 05 LDA $05B6 [$7E:05B6] ;\
$90:814C 89 7F 00 BIT #$007F ;} If [frame counter] % 80h != 0: go to BRANCH_NO_BUBBLES
$90:814F D0 3A BNE $3A [$818B] ;/
$90:8151 AD F0 0A LDA $0AF0 [$7E:0AF0] ;\
$90:8154 D0 35 BNE $35 [$818B] ;} If [atmospheric graphics 2 frame/type] != 0: go to BRANCH_NO_BUBBLES
$90:8156 A9 00 05 LDA #$0500 ;\
$90:8159 8D F0 0A STA $0AF0 [$7E:0AF0] ;} Atmospheric graphics 2 frame = 0, type = bubbles
$90:815C A9 03 00 LDA #$0003 ;\
$90:815F 8D D8 0A STA $0AD8 [$7E:0AD8] ;} Atmospheric graphics 2 animation timer = 3
$90:8162 AD F6 0A LDA $0AF6 [$7E:0AF6] ;\
$90:8165 8D E0 0A STA $0AE0 [$7E:0AE0] ;} Atmospheric graphics 2 X position = [Samus X position]
$90:8168 AD FA 0A LDA $0AFA [$7E:0AFA] ;\
$90:816B 38 SEC ;|
$90:816C ED 00 0B SBC $0B00 [$7E:0B00] ;|
$90:816F 18 CLC ;} Atmospheric graphics 2 Y position = (Samus top boundary) + 6
$90:8170 69 06 00 ADC #$0006 ;|
$90:8173 8D E8 0A STA $0AE8 [$7E:0AE8] ;/
$90:8176 22 11 81 80 JSL $808111[$80:8111] ; Generate random number
$90:817A 89 01 00 BIT #$0001 ;\
$90:817D F0 05 BEQ $05 [$8184] ;} If [random number] % 2 != 0:
$90:817F A9 0F 00 LDA #$000F ; A = Fh (low pitched air bubbles)
$90:8182 80 03 BRA $03 [$8187]
; Else ([random number] % 2 = 0):
$90:8184 A9 11 00 LDA #$0011 ; A = 11h (high pitched air bubbles)
$90:8187 22 CB 90 80 JSL $8090CB[$80:90CB] ; Queue sound [A], sound library 2, max queued sounds allowed = 6 (air bubbles)
; BRANCH_NO_BUBBLES
$90:818B AD 1C 0A LDA $0A1C [$7E:0A1C] ;\
$90:818E C9 00 00 CMP #$0000 ;|
$90:8191 F0 0D BEQ $0D [$81A0] ;} If [Samus pose] != facing forward:
$90:8193 C9 9B 00 CMP #$009B ;|
$90:8196 F0 08 BEQ $08 [$81A0] ;/
$90:8198 AD A2 09 LDA $09A2 [$7E:09A2] ;\
$90:819B 89 20 00 BIT #$0020 ;} If gravity suit not equipped: return
$90:819E F0 03 BEQ $03 [$81A3] ;/
$90:81A0 9C 9C 0A STZ $0A9C [$7E:0A9C] ; Samus animation frame buffer = 0
$90:81A3 60 RTS
}
;;; $81A4: Water splash type table ;;;
{
; 0: diving splash, else footstep splashes
$90:81A4 db 01, ;* 0: Standing
00, ; 1: Running
00, ; 2: Normal jumping
00, ; 3: Spin jumping
01, ;* 4: Morph ball - on ground
01, ;* 5: Crouching
00, ; 6: Falling
00, ; 7: Unused
00, ; 8: Morph ball - falling
00, ; 9: Unused
00, ; Ah: Knockback / crystal flash ending
00, ; Bh: Unused
00, ; Ch: Unused
00, ; Dh: Unused
01, ;* Eh: Turning around - on ground
01, ;* Fh: Crouching/standing/morphing/unmorphing transition
01, ;* 10h: Moonwalking
01, ;* 11h: Spring ball - on ground
00, ; 12h: Spring ball - in air
00, ; 13h: Spring ball - falling
00, ; 14h: Wall jumping
01, ;* 15h: Ran into a wall
00, ; 16h: Grappling
00, ; 17h: Turning around - jumping
00, ; 18h: Turning around - falling
00, ; 19h: Damage boost
00, ; 1Ah: Grabbed by Draygon
00 ; 1Bh: Shinespark / crystal flash / drained by metroid / damaged by MB's attacks
}
;;; $81C0: Animate Samus - FX = lava ;;;
{
;; Parameters:
;; $12: Samus bottom boundary
;; $14: Samus top boundary
; 2: Lava
; 22h: Unused
; Contains lava damage / gravity suit check
$90:81C0 AD 62 19 LDA $1962 [$7E:1962] ;\
$90:81C3 30 47 BMI $47 [$820C] ;} If [lava Y position] < 0: go to animate Samus - FX = none
$90:81C5 C5 12 CMP $12 [$7E:0012] ;\
$90:81C7 10 43 BPL $43 [$820C] ;} If [lava Y position] >= [Samus bottom boundary]: go to animate Samus - FX = none
$90:81C9 AD 3E 0B LDA $0B3E [$7E:0B3E] ;\
$90:81CC F0 0A BEQ $0A [$81D8] ;} If [Samus speed counter / timer] != 0:
$90:81CE 22 53 DE 91 JSL $91DE53[$91:DE53] ; Cancel speed boosting
$90:81D2 9C 42 0B STZ $0B42 [$7E:0B42] ;\
$90:81D5 9C 44 0B STZ $0B44 [$7E:0B44] ;} Samus X extra run speed = 0.0
$90:81D8 AD A2 09 LDA $09A2 [$7E:09A2] ;\
$90:81DB 89 20 00 BIT #$0020 ;} If gravity suit equipped: go to BRANCH_GRAVITY_SUIT_EQUIPPED
$90:81DE D0 2F BNE $2F [$820F] ;/
$90:81E0 AD DA 09 LDA $09DA [$7E:09DA] ;\
$90:81E3 89 07 00 BIT #$0007 ;} If [in-game time frames] % 8 = 0:
$90:81E6 D0 0F BNE $0F [$81F7] ;/
$90:81E8 AD C2 09 LDA $09C2 [$7E:09C2] ;\
$90:81EB C9 47 00 CMP #$0047 ;} If [Samus health] > 70:
$90:81EE 30 07 BMI $07 [$81F7] ;/
$90:81F0 A9 2D 00 LDA #$002D ;\
$90:81F3 22 39 91 80 JSL $809139[$80:9139] ;} Queue sound 2Dh, sound library 3, max queued sounds allowed = 3 (gaining/losing incremental health)
$90:81F7 AD 4E 0A LDA $0A4E [$7E:0A4E] ;\
$90:81FA 18 CLC ;|
$90:81FB 6D 8B 9E ADC $9E8B [$90:9E8B] ;|
$90:81FE 8D 4E 0A STA $0A4E [$7E:0A4E] ;} Periodic damage += 0.8000h
$90:8201 AD 50 0A LDA $0A50 [$7E:0A50] ;|
$90:8204 6D 8D 9E ADC $9E8D [$90:9E8D] ;|
$90:8207 8D 50 0A STA $0A50 [$7E:0A50] ;/
$90:820A 80 40 BRA $40 [$824C] ; Go to animate Samus - Samus is submerged in lava/acid
$90:820C 4C 78 80 JMP $8078 [$90:8078]
; BRANCH_GRAVITY_SUIT_EQUIPPED
$90:820F 9C 9C 0A STZ $0A9C [$7E:0A9C] ; Animation frames buffer = 0
$90:8212 A9 02 00 LDA #$0002 ;\
$90:8215 8D D2 0A STA $0AD2 [$7E:0AD2] ;} Liquid physics type = lava/acid
$90:8218 60 RTS
}
;;; $8219: Animate Samus - FX = acid ;;;
{
;; Parameters:
;; $12: Samus bottom boundary
;; $14: Samus top boundary
; 4: Acid
; 24h: Fireflea
$90:8219 AD 62 19 LDA $1962 [$7E:1962] ;\
$90:821C 30 EE BMI $EE [$820C] ;} If [acid Y position] < 0: go to animate Samus - FX = none
$90:821E C5 12 CMP $12 [$7E:0012] ;\
$90:8220 10 EA BPL $EA [$820C] ;} If [acid Y position] >= [Samus bottom boundary]: go to animate Samus - FX = none
$90:8222 AD DA 09 LDA $09DA [$7E:09DA] ;\
$90:8225 89 07 00 BIT #$0007 ;} If [game time, frames] % 8 = 0:
$90:8228 D0 0F BNE $0F [$8239] ;/
$90:822A AD C2 09 LDA $09C2 [$7E:09C2] ;\
$90:822D C9 47 00 CMP #$0047 ;} If [Samus health] > 70:
$90:8230 30 07 BMI $07 [$8239] ;/
$90:8232 A9 2D 00 LDA #$002D ;\
$90:8235 22 39 91 80 JSL $809139[$80:9139] ;} Queue sound 2Dh, sound library 3, max queued sounds allowed = 3 (gaining/losing incremental health)
$90:8239 AD 4E 0A LDA $0A4E [$7E:0A4E] ;\
$90:823C 18 CLC ;|
$90:823D 6D 8F 9E ADC $9E8F [$90:9E8F] ;|
$90:8240 8D 4E 0A STA $0A4E [$7E:0A4E] ;} Periodic damage += 1.8000h
$90:8243 AD 50 0A LDA $0A50 [$7E:0A50] ;|
$90:8246 6D 91 9E ADC $9E91 [$90:9E91] ;|
$90:8249 8D 50 0A STA $0A50 [$7E:0A50] ;/
}
;;; $824C: Animate Samus - Samus is submerged in lava/acid ;;;
{
;; Parameters:
;; $12: Samus bottom boundary
;; $14: Samus top boundary
$90:824C AD 95 9E LDA $9E95 [$90:9E95] ;\
$90:824F 8D 9C 0A STA $0A9C [$7E:0A9C] ;} Animation frames buffer = 2
$90:8252 A9 02 00 LDA #$0002 ;\
$90:8255 8D D2 0A STA $0AD2 [$7E:0AD2] ;} Liquid physics type = lava/acid
$90:8258 A5 14 LDA $14 [$7E:0014] ;\
$90:825A CD 62 19 CMP $1962 [$7E:1962] ;} If [Samus top boundary] >= [lava/acid Y position]: go to BRANCH_FULLY_SUBMERGED
$90:825D 10 64 BPL $64 [$82C3] ;/
$90:825F AD EC 0A LDA $0AEC [$7E:0AEC] ;\
$90:8262 89 00 04 BIT #$0400 ;} If [atmospheric graphics 0 type] != lava/acid surface damage:
$90:8265 D0 5C BNE $5C [$82C3] ;/
$90:8267 A9 00 04 LDA #$0400 ;\
$90:826A 8D EC 0A STA $0AEC [$7E:0AEC] ;} Atmospheric graphics 0 frame = 0, type = lava/acid surface damage
$90:826D 8D EE 0A STA $0AEE [$7E:0AEE] ; Atmospheric graphics 1 frame = 0, type = lava/acid surface damage
$90:8270 8D F0 0A STA $0AF0 [$7E:0AF0] ; Atmospheric graphics 2 frame = 0, type = lava/acid surface damage
$90:8273 8D F2 0A STA $0AF2 [$7E:0AF2] ; Atmospheric graphics 3 frame = 0, type = lava/acid surface damage
$90:8276 A9 03 00 LDA #$0003 ;\
$90:8279 8D D4 0A STA $0AD4 [$7E:0AD4] ;} Atmospheric graphics 0 animation timer = 3
$90:827C 8D DA 0A STA $0ADA [$7E:0ADA] ; Atmospheric graphics 3 animation timer = 3
$90:827F A9 02 80 LDA #$8002 ;\
$90:8282 8D D6 0A STA $0AD6 [$7E:0AD6] ;} Atmospheric graphics 1 animation timer = 8002h
$90:8285 8D D8 0A STA $0AD8 [$7E:0AD8] ; Atmospheric graphics 2 animation timer = 8002h
$90:8288 AD 62 19 LDA $1962 [$7E:1962] ;\
$90:828B 8D E4 0A STA $0AE4 [$7E:0AE4] ;} Atmospheric graphics 0 Y position = [lava/acid Y position]
$90:828E 8D E6 0A STA $0AE6 [$7E:0AE6] ; Atmospheric graphics 1 Y position = [lava/acid Y position]
$90:8291 8D E8 0A STA $0AE8 [$7E:0AE8] ; Atmospheric graphics 2 Y position = [lava/acid Y position]
$90:8294 8D EA 0A STA $0AEA [$7E:0AEA] ; Atmospheric graphics 3 Y position = [lava/acid Y position]
$90:8297 AD F6 0A LDA $0AF6 [$7E:0AF6] ;\
$90:829A 18 CLC ;|
$90:829B 69 06 00 ADC #$0006 ;} Atmospheric graphics 0 X position = [Samus X position]
$90:829E 8D DC 0A STA $0ADC [$7E:0ADC] ;/
$90:82A1 38 SEC ;\
$90:82A2 E9 06 00 SBC #$0006 ;} Atmospheric graphics 1 X position = [Samus X position] - 6
$90:82A5 8D DE 0A STA $0ADE [$7E:0ADE] ;/
$90:82A8 E9 00 00 SBC #$0000 ;\
$90:82AB 8D E0 0A STA $0AE0 [$7E:0AE0] ;} Atmospheric graphics 2 X position = [Samus X position] - 6
$90:82AE E9 06 00 SBC #$0006 ;\
$90:82B1 8D E2 0A STA $0AE2 [$7E:0AE2] ;} Atmospheric graphics 3 X position = [Samus X position] - Ch
$90:82B4 AD DA 09 LDA $09DA [$7E:09DA] ;\
$90:82B7 89 01 00 BIT #$0001 ;} If [game time frames] % 2 = 0:
$90:82BA D0 07 BNE $07 [$82C3] ;/
$90:82BC A9 10 00 LDA #$0010 ;\
$90:82BF 22 CB 90 80 JSL $8090CB[$80:90CB] ;} Queue sound 10h, sound library 2, max queued sounds allowed = 6 (lava/acid damaging Samus)
; BRANCH_FULLY_SUBMERGED
$90:82C3 AD 1C 0A LDA $0A1C [$7E:0A1C] ;\
$90:82C6 C9 00 00 CMP #$0000 ;|
$90:82C9 F0 0D BEQ $0D [$82D8] ;} If not facing forward:
$90:82CB C9 9B 00 CMP #$009B ;|
$90:82CE F0 08 BEQ $08 [$82D8] ;/
$90:82D0 AD A2 09 LDA $09A2 [$7E:09A2] ;\
$90:82D3 89 20 00 BIT #$0020 ;} If gravity suit not equipped: return
$90:82D6 F0 03 BEQ $03 [$82DB] ;/
$90:82D8 9C 9C 0A STZ $0A9C [$7E:0A9C] ; Animation frames buffer = 0
$90:82DB 60 RTS
}
;;; $82DC: Handle Samus animation delay ;;;
{
$90:82DC 08 PHP
$90:82DD E2 20 SEP #$20
$90:82DF 8B PHB
$90:82E0 A9 91 LDA #$91 ;\
$90:82E2 85 02 STA $02 [$7E:0002] ;} $02 = $91
$90:82E4 48 PHA ;\
$90:82E5 AB PLB ;} DB = $91
$90:82E6 C2 30 REP #$30
$90:82E8 AC 96 0A LDY $0A96 [$7E:0A96] ; Y = [Samus animation frame]
$90:82EB AD 1C 0A LDA $0A1C [$7E:0A1C] ;\
$90:82EE 0A ASL A ;|
$90:82EF AA TAX ;} $00 = [$91:B010 + [Samus pose] * 2] (animation delay data)
$90:82F0 BF 10 B0 91 LDA $91B010,x[$91:B014];|
$90:82F4 85 00 STA $00 [$7E:0000] ;/
$90:82F6 B7 00 LDA [$00],y[$91:B299] ;\
$90:82F8 29 FF 00 AND #$00FF ;|
$90:82FB 89 80 00 BIT #$0080 ;} If [[$00] + [Samus animation frame]] & 80h = 0:
$90:82FE D0 05 BNE $05 [$8305] ;/
$90:8300 20 E3 84 JSR $84E3 [$90:84E3] ; Handle normal animation delay
$90:8303 80 1C BRA $1C [$8321] ; Return
$90:8305 20 2C 85 JSR $852C [$90:852C] ; Handle speed booster animation delay
$90:8308 AA TAX ;\
$90:8309 F0 16 BEQ $16 [$8321] ;} If [A] = 0 (animation delay was processed): return
$90:830B 29 0F 00 AND #$000F ;\
$90:830E 0A ASL A ;|
$90:830F AA TAX ;} Execute [$8324 + ([A] & Fh) * 2]
$90:8310 FC 24 83 JSR ($8324,x)[$90:8346];/
$90:8313 90 0C BCC $0C [$8321] ; If returned carry clear: return
$90:8315 B7 00 LDA [$00],y[$91:B298] ;\
$90:8317 29 FF 00 AND #$00FF ;|
$90:831A 18 CLC ;} Samus animation frame timer = [[$00] + [Y]] + [Samus animation frame buffer]
$90:831B 6D 9C 0A ADC $0A9C [$7E:0A9C] ;|
$90:831E 8D 94 0A STA $0A94 [$7E:0A94] ;/
$90:8321 AB PLB
$90:8322 28 PLP
$90:8323 60 RTS
$90:8324 dw 8344, 8344, 8344, 8344, 8344, 8344, 8346, 8360, 8370, 839A, 83F6, 841D, 848B, 84B6, 84C7, 84DB
}
;;; $8344: Clear carry. Animation delay instruction 0..5 ;;;
{
$90:8344 18 CLC
$90:8345 60 RTS
}
;;; $8346: Animation delay instruction 6 - go to beginning if [Samus health] >= 30 ;;;
{
; Used by:
; 1: Facing right - normal
; 2: Facing left - normal
; 27h: Facing right - crouching
; 28h: Facing left - crouching
$90:8346 AD C2 09 LDA $09C2 [$7E:09C2] ;\
$90:8349 C9 1E 00 CMP #$001E ;} If [Samus health] >= 30:
$90:834C 30 08 BMI $08 [$8356] ;/
$90:834E A0 00 00 LDY #$0000 ;\
$90:8351 8C 96 0A STY $0A96 [$7E:0A96] ;} Y = Samus animation frame = 0
$90:8354 38 SEC ;\
$90:8355 60 RTS ;} Return carry set
$90:8356 AD 96 0A LDA $0A96 [$7E:0A96] ;\
$90:8359 1A INC A ;} Increment Samus animation frame
$90:835A 8D 96 0A STA $0A96 [$7E:0A96] ;/
$90:835D A8 TAY ; Y = [Samus animation frame]
$90:835E 38 SEC ;\
$90:835F 60 RTS ;} Return carry set
}
;;; $8360: Animation delay instruction 7 - set drained Samus movement handler ;;;
{
; Used by:
; E8h: Facing right - Samus drained - crouching
; E9h: Facing left - Samus drained - crouching
$90:8360 A9 CB 94 LDA #$94CB ;\
$90:8363 8D 58 0A STA $0A58 [$7E:0A58] ;} Samus movement handler = $94CB (Samus drained - falling)
$90:8366 AD 96 0A LDA $0A96 [$7E:0A96] ;\
$90:8369 1A INC A ;} Increment Samus animation frame
$90:836A 8D 96 0A STA $0A96 [$7E:0A96] ;/
$90:836D A8 TAY ; Y = [Samus animation frame]
$90:836E 38 SEC ;\
$90:836F 60 RTS ;} Return carry set
}
;;; $8370: Animation delay instruction 8 - enable auto-jump hack and transition to pose if not jumping ;;;
{
; Used by:
; 25h/26h / 2Fh/30h / 43h/44h / 87h/88h / 8Bh..9Ah / 9Ch..A3h: Turning -> 2/1 / 52h/51h / 28h/27h / 2Ah/29h / 4/3/8/7/16h/15h/18h/17h/2Ch/2Bh/2Eh/2Dh/86h/85h/74h/73h/6/5/6Ah/69h/6Eh/6Dh/72h/71h
; 1: Facing right - normal
; 2: Facing left - normal
; 3: Facing right - aiming up
; 4: Facing left - aiming up
; 5: Facing right - aiming up-right
; 6: Facing left - aiming up-left
; 7: Facing right - aiming down-right
; 8: Facing left - aiming down-left
; 15h: Facing right - normal jump - aiming up
; 16h: Facing left - normal jump - aiming up
; 17h: Facing right - normal jump - aiming down
; 18h: Facing left - normal jump - aiming down
; 27h: Facing right - crouching
; 28h: Facing left - crouching
; 29h: Facing right - falling
; 2Ah: Facing left - falling
; 2Bh: Facing right - falling - aiming up
; 2Ch: Facing left - falling - aiming up
; 2Dh: Facing right - falling - aiming down
; 2Eh: Facing left - falling - aiming down
; 51h: Facing right - normal jump - not aiming - moving forward
; 52h: Facing left - normal jump - not aiming - moving forward
; 69h: Facing right - normal jump - aiming up-right
; 6Ah: Facing left - normal jump - aiming up-left
; 6Dh: Facing right - falling - aiming up-right
; 6Eh: Facing left - falling - aiming up-left
; 71h: Facing right - crouching - aiming up-right
; 72h: Facing left - crouching - aiming up-left
; 73h: Facing right - crouching - aiming down-right
; 74h: Facing left - crouching - aiming down-left
; 85h: Facing right - crouching - aiming up
; 86h: Facing left - crouching - aiming up
; A4h..A7h / E0h..E7h: Landing from jump -> 1/2/1/2 / 3..8/1/2
; BFh..C4h: Moonwalking - turn/jump -> 1Ah/19h/1Ah/19h/1Ah/19h
; 19h: Facing right - spin jump
; 1Ah: Facing left - spin jump
$90:8370 AD 60 0A LDA $0A60 [$7E:0A60] ;\
$90:8373 C9 1D E9 CMP #$E91D ;} If [Samus pose input handler] != $E91D: (not demo)
$90:8376 F0 1D BEQ $1D [$8395] ;/
$90:8378 AD 28 0A LDA $0A28 [$7E:0A28] ;\
$90:837B C9 4B 00 CMP #$004B ;|
$90:837E F0 18 BEQ $18 [$8398] ;} If [prospective pose] = normal jump transition: return carry clear
$90:8380 C9 4C 00 CMP #$004C ;|
$90:8383 F0 13 BEQ $13 [$8398] ;/
$90:8385 C9 19 00 CMP #$0019 ;\
$90:8388 F0 0E BEQ $0E [$8398] ;|
$90:838A C9 1A 00 CMP #$001A ;} If [prospective pose] = spin jump: return carry clear
$90:838D F0 09 BEQ $09 [$8398] ;/
$90:838F A9 26 E9 LDA #$E926 ;\
$90:8392 8D 60 0A STA $0A60 [$7E:0A60] ;} Samus pose input handler = $E926 (auto-jump hack)
$90:8395 4C B6 84 JMP $84B6 [$90:84B6] ; Go to animation delay instruction Dh
$90:8398 18 CLC
$90:8399 60 RTS
}
;;; $839A: Animation delay instruction 9 - transition to pose depending on item equipped and Y speed ;;;
{
; Used by:
; 37h: Facing right - morphing transition. F9,0002,1D,31,79,7D
; 1Dh: Facing right - morph ball - no springball - on ground
; 31h: Facing right - morph ball - no springball - in air
; 79h: Facing right - morph ball - spring ball - on ground
; 7Dh: Facing right - morph ball - spring ball - falling
; 38h: Facing left - morphing transition. F9,0002,41,32,7A,7E
; 41h: Facing left - morph ball - no springball - on ground
; 32h: Facing left - morph ball - no springball - in air
; 7Ah: Facing left - morph ball - spring ball - on ground
; 7Eh: Facing left - morph ball - spring ball - falling
; DBh: Unused. F9,0002,1D,31,79,7D
; DCh: Unused. F9,0002,DF,DF,DF,DF (unused, related to Draygon?)
$90:839A C8 INY ;\
$90:839B B7 00 LDA [$00],y[$91:B4CB] ;|
$90:839D 85 12 STA $12 [$7E:0012] ;|
$90:839F AD A2 09 LDA $09A2 [$7E:09A2] ;} If [equipped items] & [[$00] + [Y] + 1] != 0: go to BRANCH_EQUIPPED_ITEMS
$90:83A2 24 12 BIT $12 [$7E:0012] ;|
$90:83A4 D0 23 BNE $23 [$83C9] ;/
$90:83A6 AD 2E 0B LDA $0B2E [$7E:0B2E] ;\
$90:83A9 D0 11 BNE $11 [$83BC] ;|
$90:83AB AD 2C 0B LDA $0B2C [$7E:0B2C] ;} If [Samus Y speed] = 0:
$90:83AE D0 0C BNE $0C [$83BC] ;/
$90:83B0 C8 INY ;\
$90:83B1 C8 INY ;|
$90:83B2 B7 00 LDA [$00],y[$91:B4CD] ;} Super special prospective pose = [[$00] + [Y] + 3]
$90:83B4 29 FF 00 AND #$00FF ;|
$90:83B7 8D 2C 0A STA $0A2C [$7E:0A2C] ;/
$90:83BA 80 32 BRA $32 [$83EE] ; Go to BRANCH_RETURN
$90:83BC C8 INY ;\
$90:83BD C8 INY ;|
$90:83BE C8 INY ;|
$90:83BF B7 00 LDA [$00],y[$91:B4D7] ;} Super special prospective pose = [[$00] + [Y] + 4]
$90:83C1 29 FF 00 AND #$00FF ;|
$90:83C4 8D 2C 0A STA $0A2C [$7E:0A2C] ;/
$90:83C7 80 25 BRA $25 [$83EE] ; Go to BRANCH_RETURN
; BRANCH_EQUIPPED_ITEMS
$90:83C9 AD 2E 0B LDA $0B2E [$7E:0B2E] ;\
$90:83CC D0 13 BNE $13 [$83E1] ;|
$90:83CE AD 2C 0B LDA $0B2C [$7E:0B2C] ;} If [Samus Y speed] = 0:
$90:83D1 D0 0E BNE $0E [$83E1] ;/
$90:83D3 C8 INY ;\
$90:83D4 C8 INY ;|
$90:83D5 C8 INY ;|
$90:83D6 C8 INY ;} Super special prospective pose = [[$00] + [Y] + 5]
$90:83D7 B7 00 LDA [$00],y[$91:B4D8] ;|
$90:83D9 29 FF 00 AND #$00FF ;|
$90:83DC 8D 2C 0A STA $0A2C [$7E:0A2C] ;/
$90:83DF 80 0D BRA $0D [$83EE] ; Go to BRANCH_RETURN
$90:83E1 C8 INY ;\
$90:83E2 C8 INY ;|
$90:83E3 C8 INY ;|
$90:83E4 C8 INY ;|
$90:83E5 C8 INY ;} Super special prospective pose = [[$00] + [Y] + 6]
$90:83E6 B7 00 LDA [$00],y[$91:B4D0] ;|
$90:83E8 29 FF 00 AND #$00FF ;|
$90:83EB 8D 2C 0A STA $0A2C [$7E:0A2C] ;/
; BRANCH_RETURN
$90:83EE A9 03 00 LDA #$0003 ;\
$90:83F1 8D 32 0A STA $0A32 [$7E:0A32] ;} Super special prospective pose change command = transition animation finished
$90:83F4 18 CLC ;\
$90:83F5 60 RTS ;} Return carry clear
}
;;; $83F6: Unused. Animation delay instruction Ah - transition to pose depending on Y speed ;;;
{
$90:83F6 AD 2E 0B LDA $0B2E [$7E:0B2E] ;\
$90:83F9 D0 10 BNE $10 [$840B] ;|
$90:83FB AD 2C 0B LDA $0B2C [$7E:0B2C] ;} If [Samus Y speed] = 0:
$90:83FE D0 0B BNE $0B [$840B] ;/
$90:8400 C8 INY ;\
$90:8401 B7 00 LDA [$00],y ;|
$90:8403 29 FF 00 AND #$00FF ;} Super special prospective pose = [[$00] + [Y] + 1]
$90:8406 8D 2C 0A STA $0A2C [$7E:0A2C] ;/
$90:8409 80 0A BRA $0A [$8415]
$90:840B C8 INY ;\ Else ([Samus Y speed] != 0):
$90:840C C8 INY ;|
$90:840D B7 00 LDA [$00],y ;} Super special prospective pose = [[$00] + [Y] + 2]
$90:840F 29 FF 00 AND #$00FF ;|
$90:8412 8D 2C 0A STA $0A2C [$7E:0A2C] ;/
$90:8415 A9 03 00 LDA #$0003 ;\
$90:8418 8D 32 0A STA $0A32 [$7E:0A32] ;} Super special prospective pose change command = transition animation finished
$90:841B 18 CLC ;\
$90:841C 60 RTS ;} Return carry clear
}
;;; $841D: Animation delay instruction Bh - select animation delay sequence for wall-jump ;;;
{
; Used by:
; 83h: Facing right - wall jump
; 84h: Facing left - wall jump
$90:841D AD A2 09 LDA $09A2 [$7E:09A2] ;\
$90:8420 89 20 00 BIT #$0020 ;} If gravity suit equipped: go to BRANCH_NOT_SUBMERGED
$90:8423 D0 20 BNE $20 [$8445] ;/
$90:8425 22 58 EC 90 JSL $90EC58[$90:EC58] ; $14 = Samus top boundary
$90:8429 AD 5E 19 LDA $195E [$7E:195E] ;\
$90:842C 30 0E BMI $0E [$843C] ;} If [FX Y position] >= 0:
$90:842E C5 14 CMP $14 [$7E:0014] ;\
$90:8430 10 13 BPL $13 [$8445] ;} If [FX Y position] >= Samus top boundary: go to BRANCH_NOT_SUBMERGED
$90:8432 AD 7E 19 LDA $197E [$7E:197E] ;\
$90:8435 89 04 00 BIT #$0004 ;} If liquid physics are disabled: go to BRANCH_NOT_SUBMERGED
$90:8438 D0 0B BNE $0B [$8445] ;/
$90:843A 80 16 BRA $16 [$8452] ; Go to BRANCH_SUBMERGED
$90:843C AD 62 19 LDA $1962 [$7E:1962] ;\
$90:843F 30 04 BMI $04 [$8445] ;} If [lava/acid Y position] < 0: go to BRANCH_NOT_SUBMERGED
$90:8441 C5 14 CMP $14 [$7E:0014] ;\
$90:8443 30 0D BMI $0D [$8452] ;} If [lava/acid Y position] < Samus top boundary: go to BRANCH_SUBMERGED
; BRANCH_NOT_SUBMERGED
$90:8445 AD A2 09 LDA $09A2 [$7E:09A2] ;\
$90:8448 89 08 00 BIT #$0008 ;} If screw attack equipped: go to BRANCH_SCREW_ATTACK
$90:844B D0 2A BNE $2A [$8477] ;/
$90:844D 89 00 02 BIT #$0200 ;\
$90:8450 D0 11 BNE $11 [$8463] ;} If space jump equipped: go to BRANCH_SPACE_JUMP
; BRANCH_SUBMERGED
$90:8452 A9 31 00 LDA #$0031 ;\
$90:8455 22 49 90 80 JSL $809049[$80:9049] ;} Queue sound 31h, sound library 1, max queued sounds allowed = 6 (spin jump)
$90:8459 AD 96 0A LDA $0A96 [$7E:0A96] ;\
$90:845C 1A INC A ;} Samus animation frame += 3 - 2 (normal)
$90:845D 8D 96 0A STA $0A96 [$7E:0A96] ;/
$90:8460 A8 TAY ; Y = [Samus animation frame]
$90:8461 38 SEC ;\
$90:8462 60 RTS ;} Return carry set
; BRANCH_SPACE_JUMP
$90:8463 A9 3E 00 LDA #$003E ;\
$90:8466 22 49 90 80 JSL $809049[$80:9049] ;} Queue sound 3Eh, sound library 1, max queued sounds allowed = 6 (space jump)
$90:846A AD 96 0A LDA $0A96 [$7E:0A96] ;\
$90:846D 18 CLC ;|
$90:846E 69 0B 00 ADC #$000B ;} Samus animation frame += Dh - 2 (space jump)
$90:8471 8D 96 0A STA $0A96 [$7E:0A96] ;/
$90:8474 A8 TAY ; Y = [Samus animation frame]
$90:8475 38 SEC ;\
$90:8476 60 RTS ;} Return carry set
; BRANCH_SCREW_ATTACK
$90:8477 A9 33 00 LDA #$0033 ;\
$90:847A 22 49 90 80 JSL $809049[$80:9049] ;} Queue sound 33h, sound library 1, max queued sounds allowed = 6 (screw attack)
$90:847E AD 96 0A LDA $0A96 [$7E:0A96] ;\
$90:8481 18 CLC ;|
$90:8482 69 15 00 ADC #$0015 ;} Samus animation frame += 17h - 2 (screw attack)
$90:8485 8D 96 0A STA $0A96 [$7E:0A96] ;/
$90:8488 A8 TAY ; Y = [Samus animation frame]
$90:8489 38 SEC ;\
$90:848A 60 RTS ;} Return carry set
}
;;; $848B: Unused. Animation delay instruction Ch - transition to pose depending on item equipped ;;;
{
; Used by:
; 3Fh: Unused. FC,0002,1D,79
; 1Dh: Facing right - morph ball - no springball - on ground
; 79h: Facing right - morph ball - spring ball - on ground
; 40h: Unused. FC,0002,41,7A
; 41h: Facing left - morph ball - no springball - on ground
; 7Ah: Facing left - morph ball - spring ball - on ground
$90:848B C8 INY ;\
$90:848C B7 00 LDA [$00],y ;|
$90:848E 85 12 STA $12 [$7E:0012] ;|
$90:8490 AD A2 09 LDA $09A2 [$7E:09A2] ;} If [equipped items] & [[$00] + [Y] + 1] != 0: go to BRANCH_EQUIPPED_ITEMS
$90:8493 24 12 BIT $12 [$7E:0012] ;|
$90:8495 D0 0C BNE $0C [$84A3] ;/
$90:8497 C8 INY ;\
$90:8498 C8 INY ;|
$90:8499 B7 00 LDA [$00],y ;} Super special prospective pose = [[$00] + [Y] + 3]
$90:849B 29 FF 00 AND #$00FF ;|
$90:849E 8D 2C 0A STA $0A2C [$7E:0A2C] ;/
$90:84A1 80 0B BRA $0B [$84AE] ; Go to BRANCH_RETURN
; BRANCH_EQUIPPED_ITEMS
$90:84A3 C8 INY ;\
$90:84A4 C8 INY ;|
$90:84A5 C8 INY ;|
$90:84A6 B7 00 LDA [$00],y ;} Super special prospective pose = [[$00] + [Y] + 4]
$90:84A8 29 FF 00 AND #$00FF ;|
$90:84AB 8D 2C 0A STA $0A2C [$7E:0A2C] ;/
; BRANCH_RETURN
$90:84AE A9 03 00 LDA #$0003 ;\
$90:84B1 8D 32 0A STA $0A32 [$7E:0A32] ;} Super special prospective pose change command = transition animation finished
$90:84B4 18 CLC ;\
$90:84B5 60 RTS ;} Return carry clear
}
;;; $84B6: Animation delay instruction Dh - transition to pose ;;;
{
; Also see instruction 8, which calls this instruction.
; Used by:
; 35h/36h / F1h..F6h: Crouching transition -> 27h/28h / 85h/86h/71h..74h
; 27h: Facing right - crouching
; 28h: Facing left - crouching
; 85h: Facing right - crouching - aiming up
; 86h: Facing left - crouching - aiming up
; 71h: Facing right - crouching - aiming up-right
; 72h: Facing left - crouching - aiming up-left
; 73h: Facing right - crouching - aiming down-right
; 74h: Facing left - crouching - aiming down-left
; 3Bh/3Ch / F7h..FCh: Standing transition -> 1/2 / 3..8
; 1: Facing right - normal
; 2: Facing left - normal
; 3: Facing right - aiming up
; 4: Facing left - aiming up
; 5: Facing right - aiming up-right
; 6: Facing left - aiming up-left
; 7: Facing right - aiming down-right
; 8: Facing left - aiming down-left
; 3Dh/3Eh: Unmorphing transition -> 27h/28h
; 4Bh/4Ch / 55h..5Ah: Normal jump transition -> 4Dh/4Eh / 15h/16h/69h..6Ch
; 4Dh: Facing right - normal jump - not aiming - not moving - gun not extended
; 4Eh: Facing left - normal jump - not aiming - not moving - gun not extended
; 15h: Facing right - normal jump - aiming up
; 16h: Facing left - normal jump - aiming up
; 69h: Facing right - normal jump - aiming up-right
; 6Ah: Facing left - normal jump - aiming up-left
; 6Bh: Facing right - normal jump - aiming down-right
; 6Ch: Facing left - normal jump - aiming down-left
; D3h/D4h: Crystal flash -> 1/2
; E8h..EBh: Samus drained -> 1/2/1/2
; 39h/3Ah / C6h / DDh/DEh: Unused -> 20h/42h / BAh / 1/BAh
; 20h: Unused
; 42h: Unused
; BAh: Facing left - grabbed by Draygon - not moving - not aiming
$90:84B6 C8 INY ;\
$90:84B7 B7 00 LDA [$00],y[$91:B234] ;|
$90:84B9 29 FF 00 AND #$00FF ;} Super special prospective pose = [[$00] + [Y] + 1]
$90:84BC 8D 2C 0A STA $0A2C [$7E:0A2C] ;/
$90:84BF A9 03 00 LDA #$0003 ;\
$90:84C2 8D 32 0A STA $0A32 [$7E:0A32] ;} Super special prospective pose change command = transition animation finished
$90:84C5 18 CLC ;\
$90:84C6 60 RTS ;} Return carry clear
}
;;; $84C7: Animation delay instruction Eh - go to [Y] - [[$00] + [Y] + 1] ;;;
{
$90:84C7 C8 INY ;\
$90:84C8 B7 00 LDA [$00],y[$91:B34E] ;|
$90:84CA 29 FF 00 AND #$00FF ;|
$90:84CD 85 12 STA $12 [$7E:0012] ;|
$90:84CF AD 96 0A LDA $0A96 [$7E:0A96] ;} Samus animation frame -= [[$00] + [Y] + 1]
$90:84D2 38 SEC ;|
$90:84D3 E5 12 SBC $12 [$7E:0012] ;|
$90:84D5 8D 96 0A STA $0A96 [$7E:0A96] ;/
$90:84D8 A8 TAY ; Y = [Samus animation frame]
$90:84D9 38 SEC ;\
$90:84DA 60 RTS ;} Return carry set
}
;;; $84DB: Animation delay instruction Fh - go to beginning ;;;
{
$90:84DB A0 00 00 LDY #$0000 ;\
$90:84DE 8C 96 0A STY $0A96 [$7E:0A96] ;} Y = Samus animation frame = 0
$90:84E1 38 SEC ;\
$90:84E2 60 RTS ;} Return carry set
}
;;; $84E3: Handle normal animation delay ;;;
{
;; Parameters:
;; Y: Samus animation frame
;; $00: Samus animation delay data pointer
; If check enabled and running:
; If speed booster equipped:
; Load animation delay data pointer from $91:B5DE table
; Else:
; Load animation delay data pointer from $91:B5D1
; Set animation frame timer
$90:84E3 08 PHP
$90:84E4 E2 20 SEP #$20
$90:84E6 8B PHB
$90:84E7 A9 91 LDA #$91 ;\
$90:84E9 85 02 STA $02 [$7E:0002] ;} $02 = $91
$90:84EB 48 PHA ;\
$90:84EC AB PLB ;} DB = $91
$90:84ED C2 30 REP #$30
$90:84EF AD 3C 0B LDA $0B3C [$7E:0B3C] ;\
$90:84F2 F0 29 BEQ $29 [$851D] ;} If [Samus running momentum flag] = 0: go to BRANCH_RETURN
$90:84F4 AD 1F 0A LDA $0A1F [$7E:0A1F] ;\
$90:84F7 29 FF 00 AND #$00FF ;|
$90:84FA C9 01 00 CMP #$0001 ;} If [Samus movement type] != running: go to BRANCH_RETURN
$90:84FD D0 1E BNE $1E [$851D] ;/
$90:84FF AD A2 09 LDA $09A2 [$7E:09A2] ;\
$90:8502 89 00 20 BIT #$2000 ;} If speed booster equipped:
$90:8505 F0 10 BEQ $10 [$8517] ;/
$90:8507 AD 3F 0B LDA $0B3F [$7E:0B3F] ;\
$90:850A 29 FF 00 AND #$00FF ;|
$90:850D 0A ASL A ;|
$90:850E AA TAX ;} $00 = [$91:B5DE + [speed boost counter] * 2]
$90:850F BF DE B5 91 LDA $91B5DE,x[$91:B5DE];|
$90:8513 85 00 STA $00 [$7E:0000] ;/
$90:8515 80 06 BRA $06 [$851D]
$90:8517 AF D1 B5 91 LDA $91B5D1[$91:B5D1] ;\ Else (speed booster not equipped):
$90:851B 85 00 STA $00 [$7E:0000] ;} $00 = $B5D3
; BRANCH_RETURN
$90:851D B7 00 LDA [$00],y[$91:B299] ;\
$90:851F 29 FF 00 AND #$00FF ;|
$90:8522 18 CLC ;} Samus animation frame timer = [[$00] + [Samus animation frame]] + [Samus animation frame buffer]
$90:8523 6D 9C 0A ADC $0A9C [$7E:0A9C] ;|
$90:8526 8D 94 0A STA $0A94 [$7E:0A94] ;/
$90:8529 AB PLB
$90:852A 28 PLP
$90:852B 60 RTS
}
;;; $852C: Handle speed booster animation delay ;;;
{
;; Parameters:
;; Y: Samus animation frame
;; $00: Samus animation delay data pointer
; If check enabled and running and pressing run:
; If speed booster not equipped:
; Samus animation frame = 0
; Load animation delay data pointer from $91:B5D1
; A = 0
; Else:
; Decrement speed boost timer
; If [speed boost timer] = 0:
; If [speed boost counter] != 4:
; Increment speed boost counter
; If [speed boost counter] = 4:
; Play speed echo sound effect
; BUG: This overwrites A with the number of sounds queued if the queue is not full
; Causing the index for the $91:B61F table to be 5 sometimes, which greater than the table size,
; which causes the blue suit fail when speed boosting sometimes (mostly in heated rooms)
; Load speed boost timer from $91:B61F table
; Samus animation frame = 0
; Load animation delay data pointer from $91:B5DE
; A = 0
; Set animation frame timer
; A = [[$00] + [Samus animation frame]]
$90:852C 08 PHP
$90:852D E2 20 SEP #$20
$90:852F 8B PHB
$90:8530 A9 91 LDA #$91 ;\
$90:8532 85 02 STA $02 [$7E:0002] ;} $02 = $91
$90:8534 48 PHA ;\
$90:8535 AB PLB ;} DB = $91
$90:8536 C2 30 REP #$30
$90:8538 AD 3C 0B LDA $0B3C [$7E:0B3C] ;\
$90:853B D0 03 BNE $03 [$8540] ;} If [Samus running momentum flag] = 0:
$90:853D 4C DA 85 JMP $85DA [$90:85DA] ; Go to BRANCH_RETURN
$90:8540 A5 8B LDA $8B [$7E:008B] ;\
$90:8542 2C B6 09 BIT $09B6 [$7E:09B6] ;} If not pressing run:
$90:8545 D0 03 BNE $03 [$854A] ;/
$90:8547 4C DA 85 JMP $85DA [$90:85DA] ; Go to BRANCH_RETURN
$90:854A AD 1F 0A LDA $0A1F [$7E:0A1F] ;\
$90:854D 29 FF 00 AND #$00FF ;|
$90:8550 C9 01 00 CMP #$0001 ;} If [movement type] != running:
$90:8553 F0 03 BEQ $03 [$8558] ;/
$90:8555 4C DA 85 JMP $85DA [$90:85DA] ; Go to BRANCH_RETURN
$90:8558 AD A2 09 LDA $09A2 [$7E:09A2] ;\
$90:855B 89 00 20 BIT #$2000 ;} If speed booster not equipped:
$90:855E D0 1D BNE $1D [$857D] ;/
$90:8560 A0 00 00 LDY #$0000 ;\
$90:8563 8C 96 0A STY $0A96 [$7E:0A96] ;} Y = Samus animation frame = 0
$90:8566 AF D1 B5 91 LDA $91B5D1[$91:B5D1] ;\
$90:856A 85 00 STA $00 [$7E:0000] ;} $00 = $B5D3
$90:856C B7 00 LDA [$00],y[$91:B5D3] ;\
$90:856E 29 FF 00 AND #$00FF ;|
$90:8571 18 CLC ;} Samus animation frame timer = [[$00]] + [Samus animation frame buffer]
$90:8572 6D 9C 0A ADC $0A9C [$7E:0A9C] ;|
$90:8575 8D 94 0A STA $0A94 [$7E:0A94] ;/
$90:8578 A9 00 00 LDA #$0000 ; A = 0
$90:857B 80 62 BRA $62 [$85DF] ; Return
$90:857D AD 3E 0B LDA $0B3E [$7E:0B3E] ;\
$90:8580 3A DEC A ;} Decrement speed boost timer
$90:8581 8D 3E 0B STA $0B3E [$7E:0B3E] ;/
$90:8584 89 FF 00 BIT #$00FF ;\
$90:8587 D0 51 BNE $51 [$85DA] ;} If [speed boost timer] != 0: go to BRANCH_RETURN
$90:8589 AD 3E 0B LDA $0B3E [$7E:0B3E] ;\
$90:858C 89 00 04 BIT #$0400 ;} If [speed boost counter] != 4:
$90:858F D0 19 BNE $19 [$85AA] ;/
$90:8591 18 CLC ;\
$90:8592 69 00 01 ADC #$0100 ;} Increment speed boost counter
$90:8595 8D 3E 0B STA $0B3E [$7E:0B3E] ;/
$90:8598 89 00 04 BIT #$0400 ;\
$90:859B F0 0D BEQ $0D [$85AA] ;} If [speed boost counter] = 4:
$90:859D A9 01 00 LDA #$0001 ;\
$90:85A0 8D 40 0B STA $0B40 [$7E:0B40] ;} Samus echo sound playing flag = 1
$90:85A3 A9 03 00 LDA #$0003 ;\
$90:85A6 22 4D 91 80 JSL $80914D[$80:914D] ;} Queue sound 3, sound library 3, max queued sounds allowed = 6 (speed booster)
$90:85AA EB XBA ;\
$90:85AB 29 FF 00 AND #$00FF ;|
$90:85AE 0A ASL A ;} X = [speed boost counter] * 2 <-- X is clobbered if speed booster sound effect was played
$90:85AF AA TAX ;/