-
Notifications
You must be signed in to change notification settings - Fork 3
/
Bank1D.asm
1629 lines (1037 loc) · 37.2 KB
/
Bank1D.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
; ==============================================================================
; $E8000-$E800F DATA
pool Sprite_ApplyConveyorAdjustment:
{
.x_shake_values
db 1, -1
.y_shake_values
db 0, -1
.y_speeds_high length 4
db -1, 0
.x_speeds_low length 4
db 0, 0
.y_speeds_low
db -1, 1, 0, 0
.x_high
db 0, 0, -1, 0
}
; ==============================================================================
; *$E8010-$E803F LONG
Sprite_ApplyConveyorAdjustment:
{
; Seems like this handles the velocity adjustment that a conveyor
; belt provides. The input for Y only allows for tile types 0x68 to
; 0x6B
LDA $1A : LSR A : BCC .return
PHB : PHK : PLB
; I think it is perhaps possible that the low byte offset is an
; incorrectly calculated address. It overlaps with that of the Y
; coordinate's adjustment.
LDA $0D10, X : ADD .x_speeds_low , Y : STA $0D10, X
LDA $0D30, X : ADC .x_speeds_high - $68, Y : STA $0D30, X
LDA $0D00, X : ADD .y_speeds_low - $68, Y : STA $0D00, X
LDA $0D20, X : ADC .y_speeds_high - $68, Y : STA $0D20, X
PLB
.return
RTL
}
; ==============================================================================
; *$E8040-$E808B LONG
Sprite_CreateDeflectedArrow:
{
; Creates a ... arrow that has been deflected (as in, now it's falling)
; This is the opposite of the arrow ending up stuck in an enemy or wall.
PHB : PHK : PLB
PHY
STZ $0C4A, X
LDA.b #$1B : JSL Sprite_SpawnDynamically : BMI .spawn_failed
LDA $0C04, X : STA $0D10, Y
LDA $0C18, X : STA $0D30, Y
LDA $0BFA, X : STA $0D00, Y
LDA $0C0E, X : STA $0D20, Y
LDA.b #$06 : STA $0DD0, Y
LDA.b #$1F : STA $0DF0, Y
LDA $0C2C, X : STA $0D50, Y
LDA $0C22, X : STA $0D40, Y
LDA $EE : STA $0F20, Y
PHX
TYX
JSL Sprite_PlaceRupulseSpark
PLX
.spawn_failed
PLY
PLB
RTL
}
; ==============================================================================
; *$E808C-$E8093 LONG
Sprite_MoveLong:
{
; Invoked from ending mode usually...?
PHB : PHK : PLB
JSR Sprite4_Move
PLB
RTL
}
; ==============================================================================
; *$E8094-$E8098 LOCAL
Sprite4_CheckTileCollision:
{
JSL Sprite_CheckTileCollisionLong
RTS
}
; ==============================================================================
incsrc "sprite_landmine.asm"
incsrc "sprite_stal.asm"
incsrc "sprite_fish.asm"
incsrc "sprite_rabbit_beam.asm"
incsrc "sprite_lynel.asm"
incsrc "sprite_phantom_ganon.asm"
incsrc "sprite_trident.asm"
incsrc "sprite_flame_trail_bat.asm"
incsrc "sprite_spiral_fire_bat.asm"
incsrc "sprite_fire_bat.asm"
incsrc "sprite_ganon.asm"
incsrc "sprite_swamola.asm"
incsrc "sprite_blind_entities.asm"
incsrc "sprite_trinexx.asm"
incsrc "sprite_sidenexx.asm"
incsrc "sprite_chain_chomp.asm"
; ==============================================================================
; *$EC211-$EC219 LOCAL
Sprite4_CheckDamage:
{
JSL Sprite_CheckDamageFromPlayerLong
JSL Sprite_CheckDamageToPlayerLong
RTS
}
; ==============================================================================
; *$EC21A-$EC221 LONG
SpriteActive4_MainLong:
{
PHB : PHK : PLB
JSR SpriteActive4_Main
PLB
RTL
}
; ==============================================================================
; *$EC222-$EC26C LOCAL
SpriteActive4_Main:
{
; Ranges from 0 to 0x1A (since highest pointer is 0xD7)
LDA $0E20, X : SUB.b #$BD : REP #$30 : AND.w #$00FF : ASL A : TAY
; Again, we have a subtle jump table by means of stack manipulation.
LDA .handlers, Y : DEC A : PHA
SEP #$30
RTS
.handlers
; Sprite routines 4
;
; Numbers in the index are actual sprite values, not the indexed values
; for the table itself in rom.
dw Sprite_Vitreous ; 0xBD - Vitreous
dw Sprite_Vitreolus ; 0xBE - "???" in hyrule magic
dw Sprite_Lightning ; 0xBF - Vitreous' Lightning (also Agahnim)
dw Sprite_GreatCatfish ; 0xC0 - Lake of Ill Omen Monster
dw Sprite_ChattyAgahnim ; 0xC1 - Agahnim teleporting Zelda to darkworld
dw Sprite_Boulder ; 0xC2 - Boulders
dw Sprite_Gibo ; 0xC3 - Symbion 2
dw Sprite_Thief ; 0xC4 - Thief
dw Sprite_Medusa ; 0xC5 - Evil fireball spitting faces!
dw Sprite_FireballJunction ; 0xC6 - Four way fireball spitters
dw Sprite_Hokbok ; 0xC7 - Hokbok and its segments (I call them Ricochet)
dw Sprite_BigFaerie ; 0xC8 - Big Faerie / Faerie Dust Cloud
dw Sprite_GanonHelpers ; 0xC9 - Ganon's Firebat, Tektite and friends
dw Sprite_ChainChomp ; 0xCA - Chain Chomp
dw Sprite_Trinexx ; 0xCB - Trinexx 1
dw $B897 ; = $EB897* ; 0xCC - Trinexx 2
dw $B89F ; = $EB89F* ; 0xCD - Trinexx 3
dw Sprite_BlindEntities ; 0xCE - Blind the Thief
dw Sprite_Swamola ; 0xCF - Swamola
dw Sprite_Lynel ; 0xD0 - Lynel
dw Sprite_ChimneyAndRabbitBeam ; 0xD1 - Yellow Hunter pointer
dw Sprite_Fish ; 0xD2 - flopping fish
dw Sprite_Stal ; 0xD3 - Stal
dw Sprite_Landmine ; 0xD4 - Landmine
dw Sprite_DiggingGameGuy ; 0xD5 - Digging game guy
dw Sprite_Ganon ; 0xD6 - Pointer for Ganon.
dw Sprite_Ganon ; 0xD7 - Pointer for Ganon when he's invincible (blue mode)
}
; ==============================================================================
incsrc "sprite_tektite.asm"
incsrc "sprite_big_faerie.asm"
incsrc "sprite_hokbok.asm"
incsrc "sprite_medusa.asm"
incsrc "sprite_fireball_junction.asm"
incsrc "sprite_thief.asm"
incsrc "sprite_gibo.asm"
incsrc "sprite_boulder.asm"
incsrc "sprite_chatty_agahnim.asm"
incsrc "sprite_giant_moldorm.asm"
incsrc "sprite_vulture.asm"
incsrc "sprite_raven.asm"
; ==============================================================================
; *$EDE82-$EDE89 LONG
Vitreous_SpawnSmallerEyesLong:
{
PHB : PHK : PLB
JSR Vitreous_SpawnSmallerEyes
PLB
RTL
}
; ==============================================================================
; $EDE8A-$EDECA DATA
{
.
db
}
; ==============================================================================
; *$EDECB-$EDF44 LOCAL
Vitreous_SpawnSmallerEyes:
{
LDA.b #$09 : STA $0ED0, X
LDA.b #$04 : STA $0DC0, X
LDY.b #$0D
JSL Sprite_SpawnDynamically_arbitrary
LDY.b #$0C
.next_eyeball
LDA.b #$09 : STA $0DD1, Y
LDA.b #$BE : STA $0E21, Y
PHX : TYX : INX
JSL Sprite_LoadProperties
PLX
LDA.b #$00 : STA $0F21, Y
LDA $00 : ADD $DE8A, Y : STA $0D11, Y
STA $0D91, Y
LDA $01 : ADC $DE97, Y : STA $0D31, Y
STA $0DA1, Y
LDA $02 : ADD $DEA4, Y : PHP : ADD.b #$20 : STA $0D01, Y
STA $0DB1, Y
LDA $03 : ADC.b #$00 : PLP : ADC $DEB1, Y : STA $0D21, Y
STA $0DE1, Y
LDA $DEBE, Y : STA $0DC1, Y : STA $0BA1, Y
TYA : ASL #3 : STA $0F
JSL GetRandomInt : ADC $0F : STA $0E81, Y
DEY : BPL .next_eyeball
RTS
}
; ==============================================================================
incsrc "sprite_great_catfish.asm"
incsrc "sprite_lightning.asm"
incsrc "sprite_vitreous.asm"
incsrc "sprite_vitreolus.asm"
; ==============================================================================
; *$EE893-$EE897 LOCAL
Sprite4_DirectionToFacePlayer:
{
JSL Sprite_DirectionToFacePlayerLong
RTS
}
; ==============================================================================
; *$EE898-$EE89C LOCAL
Sprite4_IsToRightOfPlayer:
{
JSL Sprite_IsToRightOfPlayerLong
RTS
}
; ==============================================================================
; *$EE89D-$EE8A1 LOCAL
Sprite4_IsBelowPlayer:
{
JSL Sprite_IsBelowPlayerLong
RTS
}
; ==============================================================================
; *$EE8A2-$EE8BE LOCAL
Sprite4_CheckIfActive:
{
LDA $0DD0, X : CMP.b #$09 : BNE .inactive
LDA $0FC1 : BNE .inactive
LDA $11 : BNE .inactive
LDA $0CAA, X : BMI .active
LDA $0F00, X : BEQ .active
.inactive
PLA : PLA
.active
RTS
}
; ==============================================================================
; *$EE8C5-$EE947 LOCAL
Sprite4_CheckIfRecoiling:
{
LDA $0EA0, X : BEQ .return
AND.b #$7F : BEQ .recoil_finished
LDA $0D40, X : PHA
LDA $0D50, X : PHA
DEC $0EA0, X : BNE .not_halted_yet
LDA $0F40, X : ADD.b #$20 : CMP.b #$40 : BCS .too_fast_so_halt
LDA $0F30, X : ADD.b #$20 : CMP.b #$40 : BCC .slow_enough
.too_fast_so_halt
LDA.b #$90 : STA $0EA0, X
.slow_enough
.not_halted_yet
LDA $0EA0, X : BMI .halted
LSR #2 : TAY
LDA $1A : AND $E8BF, Y : BNE .halted
LDA $0F30, X : STA $0D40, X
LDA $0F40, X : STA $0D50, X
LDA $0CD2, X : BMI .no_wall_collision
JSR Sprite4_CheckTileCollision
AND.b #$0F : BEQ .no_wall_collision
CMP.b #$04 : BCS .y_axis_wall_collision
STZ $0F40, X
STZ $0D50, X
BRA .moving_on
.y_axis_wall_collision
STZ $0F30, X
STZ $0D40, X
.moving_on
BRA .halted
.no_wall_collision
JSR Sprite4_Move
.halted
PLA : STA $0D50, X
PLA : STA $0D40, X
; Blind the thief. \task Apply enumerated value here when it becomes
; available.
LDA $0E20, X : CMP.b #$CE : BEQ .return
PLA : PLA
.return
RTS
.recoil_finished
STZ $0EA0, X
RTS
}
; ==============================================================================
; *$EE948-$EE951 LOCAL
Sprite4_MoveXyz:
{
JSR Sprite4_MoveAltitude
; *$EE94B ALTERNATE ENTRY POINT
shared Sprite4_Move:
JSR Sprite4_MoveHoriz
JSR Sprite4_MoveVert
RTS
}
; ==============================================================================
; *$EE952-$EE95C LOCAL
Sprite4_MoveHoriz:
{
PHX : TXA : ADD.b #$10 : TAX
JSR Sprite4_MoveVert
PLX
RTS
}
; ==============================================================================
; *$EE95D-$EE98A LOCAL
Sprite4_MoveVert:
{
LDA $0D40, X : BEQ .no_velocity
ASL #4 : ADD $0D60, X : STA $0D60, X
LDA $0D40, X : PHP : LSR #4 : LDY.b #$00 : PLP : BPL .positive
ORA.b #$F0
DEY
.positive
ADC $0D00, X : STA $0D00, X
TYA : ADC $0D20, X : STA $0D20, X
.no_velocity
RTS
}
; ==============================================================================
; *$EE98B-$EE9AC LOCAL
Sprite4_MoveAltitude:
{
LDA $0F80, X : ASL #4 : ADD $0F90, X : STA $0F90, X
; Sign extend the difference from 4 bits to 8.
LDA $0F80, X : PHP : LSR #4 : PLP : BPL .sign_extend
ORA.b #$F0
.sign_extend
ADC $0F70, X : STA $0F70, X
RTS
}
; ==============================================================================
; *$EE9AD-$EE9B5 LOCAL
Sprite4_PrepOamCoord:
{
; \task Perhaps come up with a better name for these sublabels?
JSL Sprite_PrepOamCoordLong : BCC .sprite_wasnt_disabled
PLA : PLA
.sprite_wasnt_disabled
RTS
}
; ==============================================================================
; *$EE9B6-$EE9D9 LONG
Filter_MajorWhitenMain:
{
LDA $0FF9 : BEQ .major_white_filter_inactive
LDY $11 : BNE .major_white_filter_inactive
DEC $0FF9 : BNE .filter_still_active
; What the hell, restore the whole damn set of BG palettes, even the
; HUD ones. I don't quite understand why this is necessary though, as
; the HUD palettes weren't (intentionally) modified by this
; particular subset of the game logic.
JSL Palette_Restore_BG_And_HUD
RTL
.filter_still_active
AND.b #$01 : BEQ .restore_palette
JSL Filter_Majorly_Whiten_Bg
BRA .set_palette_update_flag
.restore_palette
JSL Palette_Restore_BG_From_Flash
.set_palette_update_flag
INC $15
.major_white_filter_inactive
RTL
}
; ==============================================================================
; *$EE9DA-$EE9FF LONG
CacheSprite_ExecuteAll:
{
; Some kind of special enemy "switch out"
; It's used on certain room transitions where the enemies from both rooms
; are supposed to remain visible (excludes spiral staircases)
; Don't do this outdoors
LDA $1B : BEQ .return
; Don't use if in "normal" submode
; Don't use if going on a spiral staircase
LDA $11 : BEQ .return
CMP.b #$0E : BEQ .return
; the last screen transition occurred on the overworld, and no
; sprites were cached anyways.
LDA $0FFA : BEQ .return
LDX.b #$0F
.next_cached_sprite
STX $0FA0
LDA $1D00, X : BEQ .inactive_cached_sprite
JSR CacheSprite_ExecuteSingle
.inactive_cached_sprite
DEX : BPL .next_cached_sprite
RTL
.return
STZ $0FFA
RTL
}
; ==============================================================================
; *$EEA00-$EEB67 LOCAL
CacheSprite_ExecuteSingle:
{
; Save the relevant data of this non-cached sprite before
; swapping in the cached sprite data.
LDA $0DD0, X : PHA
LDA $0E20, X : PHA
LDA $0D10, X : PHA
LDA $0D30, X : PHA
LDA $0D00, X : PHA
LDA $0D20, X : PHA
LDA $0DC0, X : PHA
LDA $0D90, X : PHA
LDA $0EB0, X : PHA
LDA $0F50, X : PHA
LDA $0B89, X : PHA
LDA $0DE0, X : PHA
LDA $0E40, X : PHA
LDA $0F20, X : PHA
LDA $0D80, X : PHA
LDA $0E60, X : PHA
LDA $0DA0, X : PHA
LDA $0DB0, X : PHA
LDA $0E90, X : PHA
LDA $0E80, X : PHA
LDA $0F70, X : PHA
LDA $0DF0, X : PHA
LDA $7FF9C2, X : PHA
LDA $0BA0, X : PHA
; temporarily swap the cached sprite data in.
LDA $1D00, X : STA $0DD0, X
LDA $1D10, X : STA $0E20, X
LDA $1D20, X : STA $0D10, X
LDA $1D30, X : STA $0D30, X
LDA $1D40, X : STA $0D00, X
LDA $1D50, X : STA $0D20, X
LDA $1D60, X : STA $0DC0, X
LDA $1D70, X : STA $0D90, X
LDA $1D80, X : STA $0EB0, X
LDA $1D90, X : STA $0F50, X
LDA $1DA0, X : STA $0B89, X
LDA $1DB0, X : STA $0DE0, X
LDA $1DC0, X : STA $0E40, X
LDA $1DD0, X : STA $0F20, X
LDA $1DE0, X : STA $0D80, X
LDA $1DF0, X : STA $0E60, X
LDA $7FFA5C, X : STA $0DA0, X
LDA $7FFA6C, X : STA $0DB0, X
LDA $7FFA7C, X : STA $0E90, X
LDA $7FFA8C, X : STA $0E80, X
LDA $7FFA9C, X : STA $0F70, X
LDA $7FFAAC, X : STA $0DF0, X
LDA $7FFACC, X : STA $7FF9C2, X
LDA $7FFADC, X : STA $0BA0, X
JSL Sprite_ExecuteSingleLong
LDA $0F00, X : BEQ .active_sprite
STZ $1D00, X
.active_sprite
; Restore the data of the non-cached sprite from the stack.
PLA : STA $0BA0, X
PLA : STA $7FF9C2, X
PLA : STA $0DF0, X
PLA : STA $0F70, X
PLA : STA $0E80, X
PLA : STA $0E90, X
PLA : STA $0DB0, X
PLA : STA $0DA0, X
PLA : STA $0E60, X
PLA : STA $0D80, X
PLA : STA $0F20, X
PLA : STA $0E40, X
PLA : STA $0DE0, X
PLA : STA $0B89, X
PLA : STA $0F50, X
PLA : STA $0EB0, X
PLA : STA $0D90, X
PLA : STA $0DC0, X
PLA : STA $0D20, X
PLA : STA $0D00, X
PLA : STA $0D30, X
PLA : STA $0D10, X
PLA : STA $0E20, X
PLA : STA $0DD0, X
RTS
}
; ==============================================================================
; $EEB68-$EEB83 DATA
pool Sprite_SimulateSoldier:
{
; \task Fill in data.
}
; ==============================================================================
; *$EEB84-$EEBEA LONG
Sprite_SimulateSoldier:
{
PHB : PHK : PLB
LDA $00 : STA $0D10, X
LDA $01 : STA $0D30, X
LDA $02 : STA $0D00, X
LDA $03 : STA $0D20, X
STZ $0F70, X
JSL Sprite_Get_16_bit_CoordsLong
LDA $04 : STA $0DE0, X : STA $0EB0, X : TAY
LDA $EB68, Y : ADD $06 : STA $0DC0, X
LDA.b #$10 : STA $0E60, X
STZ $0B89, X
LDA $05 : ORA.b #$30 : STA $0F50, X
LDY.b #$41
CMP.b #$39 : BEQ .normalSoldier
; red spear soldier
LDY.b #$43
.normalSoldier
TYA : STA $0E20, X
LDA.b #$07 : STA $0E40, X
TXA : ASL A : TAY
REP #$20
LDA $EB6C, Y : STA $90
LDA $EB78, Y : STA $92
SEP #$20
JSL Soldier_AnimateMarionetteTempLong
PLB
RTL
}
; ==============================================================================
incsrc "overlord_armos_coordinator.asm"
incsrc "sprite_helmasaur_fireball.asm"
incsrc "sprite_armos_crusher.asm"
incsrc "sprite_evil_barrier.asm"
; ==============================================================================
; *$EF277-$EF2A4 LONG
Moldorm_Initialize:
{
PHX
TXY
LDA $1DF7CF, X : TAX
LDA.b #$1F : STA $00
.next_subsprite
LDA $0D10, Y : STA $7FFC00, X
LDA $0D30, Y : STA $7FFC80, X
LDA $0D00, Y : STA $7FFD00, X
LDA $0D20, Y : STA $7FFD80, X
INX
DEC $00 : BPL .next_subsprite
PLX
RTL
}
; ==============================================================================
; $EF2A5-$EF394 DATA
pool Sprite_DrawFourAroundOne:
{
; \task Fill in data.
}
; ==============================================================================
; *$EF395-$EF3D3 LONG
Sprite_DrawFourAroundOne:
{
PHB : PHK : PLB
INC $0E80, X
LDA $0E80, X : AND.b #$01 : ORA $0011 : ORA $0FC1 : BNE .dont_reset
INC $0DC0, X : LDA $0DC0, X : CMP.b #$06 : BNE .dont_reset
STZ $0DC0, X
.dont_reset
LDA.b #$00 : XBA
LDA $0DC0, X : REP #$20 : ASL #3 : STA $00
ASL #2 : ADC $00 : ADC.w #$F2A5 : STA $08
SEP #$20
LDA.b #$05 : JSR Sprite4_DrawMultiple
PLB
RTL
}
; ==============================================================================
; $EF3D4-$EF44C LONG
Toppo_Flustered:
{
PHB : PHK : PLB
LDA.b #$82 : STA $0E40, X : STA $0BA0, X
LDA.b #$49 : STA $0E60, X
LDA $0E30, X : BNE .caught_by_player
JSL Sprite_CheckDamageToPlayerLong : BCC .just_animate
INC $0E30, X
; "All right! Take it Thief!"
LDA.b #$74 : STA $1CF0
LDA.b #$01 : STA $1CF1
JSL Sprite_ShowMessageMinimal
BRA .just_animate
.caught_by_player
CMP.b #$10 : BCC .prize_delay
BNE .just_animate
STZ $0BE0, X
LDA.b #$06 : STA $0DD0, X
LDA.b #$0F : STA $0DF0, X
LDA $0E40, X : ADD.b #$04 : STA $0E40, X
LDA.b #$15 : JSL Sound_SetSfx2PanLong
LDA.b #$4D : JSL Sprite_SpawnDynamically : BMI .prize_delay
JSL Sprite_SetSpawnedCoords
PHX : TYX : LDY.b #$06
; Transmute this thing to a prize?
JSL $06FA54 ; $37A54 IN ROM
PLX
.prize_delay
INC $0E30, X
.just_animate
INC $0E80, X
LDA $0E80, X : AND.b #$04 : LSR #2 : ADC.b #$03 : STA $0DC0, X
PLB
RTL
}
; ==============================================================================
; $EF44D-$EF588 DATA
pool Goriya_Draw:
{
; \task Fill in data
; note: it does draw multiple with a pointer table, unlike many
; sprites. The table is $F565, Y
; $EF565
dw $F54D, $F555, $F55D
; $EF56B
dw $F44D, $F46D, $F48D, $F4AD, $F4CD, $F4ED, $F50D, $F51D
dw $F52D, $F53D
; $EF57F
db $04, $04, $04, $04, $04, $04, $02, $02
db $02, $02
}
; ==============================================================================
; *$EF589-$EF5D3 LONG
Goriya_Draw:
{
PHB : PHK : PLB
LDA $0E00, X : BEQ .not_firing_fire_pleghm
LDA $0DE0, X : CMP.b #$03 : BEQ .facing_right
ASL A : TAY
REP #$20
LDA $F565, Y : STA $08
SEP #$20
LDA.b #$01 : JSR Sprite4_DrawMultiple
.facing_right
.not_firing_fire_pleghm
LDA $0DC0, X : PHA : ASL A : TAY
REP #$20
LDA $F56B, Y : STA $08
LDA $90 : ADD.w #$0004 : STA $90
INC $92
SEP #$20
PLY
LDA $F57F, Y : JSR Sprite4_DrawMultiple
DEC $0E40, X
JSL Sprite_DrawShadowLong