-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathADAM.ASM
executable file
·1740 lines (1298 loc) · 31.7 KB
/
ADAM.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
**************************************************************
*
* Software: Jamie Rivett
* Initiated: 9/3/93
*
* COPYRIGHT (C) 1992 WILLIAMS ELECTRONICS GAMES, INC.
*
**************************************************************
.file "adam.asm"
.title "adam bomb specific game code"
.width 132
.option b,d,l,t
.mnolist
.include "macros.h"
.include "mproc.equ" ;Mproc equates
.include "display.equ" ;Display proc equates
.include "gsp.equ" ;Gsp asm equates
.include "sys.equ"
.include "game.equ"
.include "plyr.equ"
.include "anim.equ"
.include "audit.equ"
.include "sound.h"
.include "ring.equ"
.include "lifebar.h"
******************************************************************************
* EXTERNAL REFERENCES
.ref wres_get_but_val_down,wres_get_but_val_cur
.ref wres_get_stick_val_cur
.ref change_anim1,change_anim1a
.ref change_anim2
.ref process_ptrs
.ref keep_attached
.ref get_opp_plyrmode
.ref wres_collis_off
.ref convert_facing
.ref check_secret_moves
.ref change_walk_anim
.ref set_rotate_anim
.ref execute_walk
.ref start_run,bounce_off_ropes
.ref face_each_other
.ref lineup_grapple
.ref break_lockup
.ref climb_turnbuckle
;from DCSSOUND.ASM
.ref triple_sound
;from PAL.ASM
.ref pal_find,pal_set
;animation sequence
.ref wres_slave_anim
.ref adm_zip_anim
.ref adm_stand2_anim,adm_stand8_anim
.ref adm_stand4_anim,adm_stand6_anim
.ref adm_torso2_anim,adm_torso8_anim
.ref adm_torso4_anim,adm_torso6_anim
.ref adm_2_to_4_turn_anim,adm_8_to_6_turn_anim ;stand
.ref adm_4_to_2_turn_anim,adm_6_to_8_turn_anim
.ref adm_4_to_6_turn_anim,adm_6_to_4_turn_anim
.ref adm_2_to_8_turn_anim,adm_8_to_2_turn_anim
.ref adm_4_to_8_turn_anim,adm_6_to_2_turn_anim
.ref adm_2_to_6_turn_anim,adm_8_to_4_turn_anim
.ref adm_2_to_4_turn2_anim,adm_8_to_6_turn2_anim ;torso
.ref adm_4_to_2_turn2_anim,adm_6_to_8_turn2_anim
.ref adm_4_to_6_turn2_anim,adm_6_to_4_turn2_anim
.ref adm_2_to_8_turn2_anim,adm_8_to_2_turn2_anim
.ref adm_4_to_8_turn2_anim,adm_6_to_2_turn2_anim
.ref adm_2_to_6_turn2_anim,adm_8_to_4_turn2_anim
.ref adm_roll_frames
.ref adm_walk1_f2_anim,adm_walk2_f2_anim,adm_walk4_f2_anim
.ref adm_walk5_f2_anim,adm_walk6_f2_anim,adm_walk8_f2_anim
.ref adm_walk1_f4_anim,adm_walk2_f4_anim,adm_walk4_f4_anim
.ref adm_walk5_f4_anim,adm_walk6_f4_anim,adm_walk8_f4_anim
.ref adm_2_punch_anim,adm_4_punch_anim
.ref adm_2_butt_anim,adm_4_butt_anim
.ref adm_2_kick_anim,adm_4_kick_anim
.ref adm_2_uprcut_anim,adm_4_uprcut_anim
.ref adm_run_anim,adm_run2_anim,adm_ocrun_anim,adm_run_anim,adm_bounce_anim
.ref adm_2_lbowdrop_anim,adm_4_lbowdrop_anim
.ref adm_grab_throw_anim
.ref adm_2_grabfling_anim
.ref adm_4_grabfling_anim
.ref adm_2_graboh_anim,adm_heldoh_anim
.ref adm_4_graboh_anim
.ref adm_2_fly_cline_anim,adm_4_fly_cline_anim
.ref adm_flying_kick_anim
.ref adm_4_head_hit_anim
.ref adm_2_face_hit_anim,adm_4_face_hit_anim
.ref adm_2_head_hit_anim
.ref adm_2_body_hit_anim,adm_4_body_hit_anim
.ref adm_fall_back_anim
.ref adm_faceup_getup_anim
.ref adm_hitonground_anim
.ref adm_4_stomp_anim,adm_2_stomp_anim
.ref adm_2ndwind_anim
.ref adm_climb_up_anim,adm_climb_down_anim
.ref adm_2_hitblock_anim,adm_4_hitblock_anim
.ref adm_hiptoss_anim,adm_hiptossfall_anim
.ref adm_4_push_anim,adm_2_push_anim
.ref adm_4_bigboot_anim,adm_2_bigboot_anim
.ref adm_4_block_anim,adm_2_block_anim
.ref adm_4_losebal_anim,adm_2_losebal_anim
.ref adm_dizzy_anim
.ref adm_raisearm_anim
.ref adm_ohthrow1_anim
.ref adm_2_lockup_anim,adm_4_lockup_anim
******************************************************************************
* SYMBOLS DEFINED IN THIS FILE
******************************************************************************
* EQUATES FOR THIS FILE
#*****************************************************************************
adam_secret_moves
.long #button_hold ;must have this one
.long #grab_fling
;; .long #turbo_run
.long #2nd_wind1
.long #2nd_wind2
.long 0
#button_hold
rets
; BITS MASK
#grab_fling
.word B_GRAB | J_AWAY, J_UP | J_DOWN
.word 8000h | 10 ;max
.long scrt_grabfling
#turbo_run
.word B_TURBO, J_ALL
.word B_TURBO, J_ALL
.word 8000h | 16 ;max
.long scrt_run
#2nd_wind1
.word J_UP, 0
.word J_UP_AWAY, 0
.word J_AWAY, 0
.word J_DOWN_AWAY, 0
.word J_DOWN, 0
.word J_DOWN_TOWARD, 0
.word J_TOWARD, 0
.word J_UP_TOWARD, 0
.word J_UP, 0
.word 8000h | 50 ;max
.long scrt_2ndwind
#2nd_wind2
.word J_UP, 0
.word J_UP_TOWARD, 0
.word J_TOWARD, 0
.word J_DOWN_TOWARD, 0
.word J_DOWN, 0
.word J_DOWN_AWAY, 0
.word J_AWAY, 0
.word J_UP_AWAY, 0
.word J_UP, 0
.word 8000h | 50 ;max
.long scrt_2ndwind
.if 0
J_UP
J_UP_TOWARD
J_TOWARD
J_DOWN_TOWARD
J_DOWN
J_DOWN_AWAY
J_AWAY
J_UP_AWAY
B_PUNCH
B_KICK
B_BLOCK
B_GRAB
B_TURBO
B_RUN
.endif
scrt_grabfling
;Make this miss, rotate to missed opponent,
;and stay rotated to flung opponent, also make
;this work from both angles!
movi adm_2_grabfling_anim,a0
move *a13(FACING_DIR),a1
btst MOVE_UP_BIT,a1
jrnz #2_grb
movi adm_4_grabfling_anim,a0
#2_grb
calla change_anim1a
WRSND W_ADAM,GRABFLING_T1,GRABFLING_T2
rets
scrt_run
move *a13(ANIMODE),a0
btst MODE_UNINT_BIT,a0
jrnz #no_scrt_run
move *a13(PLYRMODE),a0
move *a13(PLYRMODE),a0
cmpi MODE_RUNNING,a0
jreq #no_scrt_run
cmpi MODE_BOUNCING,a0
jreq #no_scrt_run
calla start_run
#no_scrt_run
rets
scrt_2ndwind
movi adm_2ndwind_anim,a0
calla change_anim1a
rets
#*****************************************************************************
SUBR adam_ani_init
movi adm_stand2_anim,a0
calla change_anim1
movi adm_torso2_anim,a0
calla change_anim2
rets
#*****************************************************************************
*
* ADAMS CONTROL CODE
*
* a13 = * adam process
SUBR move_adam
movi 100h,a0 ;temp fix!
move a0,*a13(ANI_SPEED)
movi adam_secret_moves,a11
calla check_secret_moves
move *a13(PLYRMODE),a0
sll 5,a0 ;x 32
addi #mode_table,a0
move *a0,a0,L
call a0
rets
#mode_table
.long mode_normal ;0
.long mode_running ;1
.long mode_inair ;2
.long mode_attached ;3
.long mode_onground ;4
.long mode_bouncing ;5
.long mode_onturnbkl ;6
.long mode_block ;7
.long mode_dizzy ;8
.long mode_dead ;9
.long mode_oppoverhead ;10
.long mode_climbturnbkl ;11
.long mode_waitanim ;12
.long mode_grapple ;13
.long mode_master ;14
.long mode_slave ;15
.long mode_headhold ;16
#*****************************************************************************
mode_normal
move *a13(ANIMODE),a0
btst MODE_UNINT_BIT,a0
jrnz #no_interrupt
.if 1
calla get_opp_plyrmode
cmpi MODE_DEAD,a0
jrne #opp_not_dead
movi adm_raisearm_anim,a0
calla change_anim1a
rets
#opp_not_dead
GETLIFE
jruc #not_dizzy
jrnz #not_dizzy
SETMODE DIZZY
movi adm_dizzy_anim,a0
calla change_anim1a
rets
.endif
#not_dizzy
move a13,a0
calla wres_get_but_val_cur
btst PLAYER_BLOCK_BIT,a0 ;maybe have to action tables?
jrz #nblk ;1 for down transitions
callr #block ;& 1 for current buttons
#nblk
move a13,a0
calla wres_get_but_val_down
andi 011111b,a0
X32 a0
addi #action_table,a0
move *a0,a0,L
call a0
move *a13(ANIMODE),a0
btst MODE_UNINT_BIT,a0
jrnz #no_interrupt
move a13,a0
calla wres_get_stick_val_cur
move a0,*a13(MOVE_DIR)
calla climb_turnbuckle
jrnc #no_climb
rets
#no_climb
calla execute_walk
#no_interrupt
rets
#action_table
.long #z ;0
.long #punch ;1
.long #block ;2
.long #z ;3
.long #super_punch ;4
.long #z,#z,#z ;5-7
.long #kick ;8
.long #z,#z,#z,#z,#z,#z,#z ;9-15
.long #super_kick ;16
.long #z,#z,#z,#z,#z,#z,#z ;17-23
.long #z,#z,#z,#z,#z,#z,#z,#z ;24-31
************
#z
rets
************
#punch ;1
*
* MODE DX DZ ACTION
* ----------------------------------------------------
* normal < 60 92 headbutt
* dizzy " "
* normal > normal punch
* dizzy " "
*
* onground < 96 112 elbow drop
* onground > normal punch
*
* running | < 100 60 hip toss
* bouncing > normal punch
*
* onturnbkl normal punch
* climbturnbkl normal punch
*
JJXM_INIT
JJXM NORMAL, 60, 92,#punch_hdbutt,#punch_punch
JJXM DIZZY, 60, 92,#punch_hdbutt,#punch_punch
JJXM ONGROUND, 96,112,#punch_lbdrop,#punch_punch
JJXM RUNNING, 100, 60,#punch_hiptoss,#punch_punch
JJXM BOUNCING, 100, 60,#punch_hiptoss,#punch_punch
JJXM ONTURNBKL, #punch_punch
JJXM CLIMBTURNBKL, #punch_punch
.if DEBUG
LOCKUP
rets
.endif
*****
#punch_rets
rets
*****
#punch_punch
FACE24 adm,punch_anim
calla change_anim1a
WRSND W_ADAM,PUNCH_T1,PUNCH_T2
rets
*****
#punch_hdbutt
FACE24 adm,butt_anim
calla change_anim1a
WRSND W_ADAM,PUNCH_T1,PUNCH_T2
rets
*****
#punch_lbdrop
FACE24 adm,lbowdrop_anim
calla change_anim1a
WRSND W_ADAM,PUNCH_T1,PUNCH_T2
rets
*****
#punch_hiptoss
movi adm_hiptoss_anim,a0
calla change_anim1a
WRSND W_ADAM,PUNCH_T1,PUNCH_T2
rets
************
#block ;2
*
* MODE DX DZ ACTION
* ----------------------------------------------------
* all nothing. Ha.
*
rets
************
#super_punch ;4
*
* MODE DX DZ ACTION
* ----------------------------------------------------
* all uppercut
*
FACE24 adm,uprcut_anim
calla change_anim1a
WRSND W_ADAM,PUNCH_T1,PUNCH_T2
rets
************
#kick ;8
*
* MODE DX DZ ACTION
* ----------------------------------------------------
* normal normal kick
*
* onground < 96 112 stomp
* onground > normal kick
*
* running |
* bouncing big boot
*
* onturnbkl knee
*
JJXM_INIT
JJXM NORMAL, #kick_kick
JJXM DIZZY, #kick_kick
JJXM ONGROUND, 96,112,#kick_stomp,#kick_kick
JJXM RUNNING, #kick_bigboot
JJXM BOUNCING, #kick_bigboot
JJXM ONTURNBKL, #kick_kick
JJXM CLIMBTURNBKL, #kick_kick
.if DEBUG
LOCKUP
rets
.endif
*****
#kick_kick
FACE24 adm,kick_anim
calla change_anim1
WRSND W_ADAM,KICK_T1,KICK_T2
rets
*****
#kick_stomp
FACE24 adm,stomp_anim
calla change_anim1
WRSND W_ADAM,KICK_T1,KICK_T2
rets
*****
#kick_bigboot
FACE24 adm,bigboot_anim
calla change_anim1
WRSND W_ADAM,KICK_T1,KICK_T2
rets
************
#super_kick ;16
*
* MODE DX DZ ACTION
* ----------------------------------------------------
* normal normal kick
*
* onground < 96 112 stomp
* onground > normal kick
*
* running |
* bouncing big boot
*
* onturnbkl normal kick
*
JJXM_INIT
JJXM NORMAL, #skick_kick
JJXM DIZZY, #skick_kick
JJXM ONGROUND, 96,112,#skick_stomp,#skick_kick
JJXM RUNNING, #skick_bigboot
JJXM BOUNCING, #skick_bigboot
JJXM ONTURNBKL, #skick_kick
JJXM CLIMBTURNBKL, #skick_kick
.if DEBUG
LOCKUP
rets
.endif
*****
#skick_kick
FACE24 adm,kick_anim
calla change_anim1
WRSND W_ADAM,KICK_T1,KICK_T2
rets
*****
#skick_stomp
FACE24 adm,stomp_anim
calla change_anim1
WRSND W_ADAM,KICK_T1,KICK_T2
rets
*****
#skick_bigboot
FACE24 adm,bigboot_anim
calla change_anim1
WRSND W_ADAM,KICK_T1,KICK_T2
rets
#*****************************************************************************
*
* RUNNING (if GETUP_TIME > 0 then player is out of control)
*
#XRUN_VAL equ 60000h ;50000h
#ZDRIFT_VAL equ 20000h ;18000h
mode_running
move *a13(GETUP_TIME),a0 ;delay b4 gaining control
jrz #not_octrl
calla keep_attached ;if still being flung
jrnz #out_of_control ;(Z=0 - still attached)
;not_attached
#not_octrl
calla bounce_off_ropes
move *a13(MOVE_DIR),a0
movi #XRUN_VAL,a1
btst PLAYER_RIGHT_BIT,a0
jrnz #setxvel
movi -#XRUN_VAL,a1
#setxvel
move a1,*a13(OBJ_XVEL),L
move *a13(GETUP_TIME),a0 ;delay b4 gaining control
jrnz #out_of_control
move *a13(ANIMODE),a0
btst MODE_UNINT_BIT,a0
jrnz #no_interrupt
move a13,a0
calla wres_get_but_val_cur
btst PLAYER_TURBO_BIT,a0 ;turbo down?
jrnz #run_down
;has released turbo - go back to walk mode
SETMODE NORMAL
#run_down
#no_interrupt
move a13,a0
calla wres_get_stick_val_cur
clr a1
movi -#ZDRIFT_VAL,a1
btst PLAYER_UP_BIT,a0
jrnz #setvel
movi #ZDRIFT_VAL,a1
btst PLAYER_DOWN_BIT,a0
jrnz #setvel
clr a1
#setvel
move a1,*a13(OBJ_ZVEL),L
move a13,a0
calla wres_get_but_val_down
andi 011111b,a0
X32 a0
addi #action_table,a0
move *a0,a0,L
call a0
#out_of_control
rets
#action_table
.long #z ;0
.long #punch ;1 (punch)
.long #z ;2 (block)
.long #z ;3
.long #z ;4 (super punch)
.long #z,#z,#z ;5-7
.long #kick ;8 kick
.long #z,#z,#z,#z,#z,#z,#z ;9-15
.long #z ;16 (super kick)
.long #z,#z,#z,#z,#z,#z,#z ;17-23
.long #z,#z,#z,#z,#z,#z,#z,#z ;24-31
************
#z
rets
************
#punch ;1
*
* MODE DX DZ ACTION
* ----------------------------------------------------
* all flying clothesline
*
FACE24 adm,fly_cline_anim
calla change_anim1
;halve his velocity
move *a13(OBJ_XVEL),a0,L
sra 1,a0
move a0,*a13(OBJ_XVEL),L
WRSND W_ADAM,FLYKICK_T1,FLYKICK_T2
rets
************
#kick ;#4
*
* MODE DX DZ ACTION
* ----------------------------------------------------
* all flying kick
*
*****
movi adm_flying_kick_anim,a0
calla change_anim1
SETMODE INAIR
move *a13(OBJ_XVEL),a0,L
sra 1,a0
move a0,*a13(OBJ_XVEL),L
WRSND W_ADAM,FLYKICK_T1,FLYKICK_T2
rets
#*****************************************************************************
*
mode_inair ;2
rets
#*****************************************************************************
*
mode_attached ;3
calla keep_attached
jrnz #still_attached
clr a0
move a0,*a13(ATTACH_PROC),L
SETMODE NORMAL
movi MODE_NORMAL,a0
move a0,*a13(ANIMODE)
#still_attached
rets
#*****************************************************************************
#ZROLL_VAL equ 20000h
#ROLL_SPEED equ 50h
#ROLL_FRAMES equ 9
mode_onground ;4
; move a13,a0
; calla wres_get_but_val_cur
; btst PLAYER_TURBO_BIT,a0
; jrz #no_cheat
;
; clr a0
; move a0,*a13(GETUP_TIME)
;#no_cheat
move *a13(GETUP_TIME),a0
jrnz #nomove
move a13,a0
calla wres_get_stick_val_cur
movi -#ROLL_SPEED,a2
movi -#ZROLL_VAL,a1
btst PLAYER_UP_BIT,a0
jrnz #setvel
movi #ROLL_SPEED,a2
movi #ZROLL_VAL,a1
btst PLAYER_DOWN_BIT,a0
jrnz #setvel
clr a1
clr a2
movi adm_faceup_getup_anim,a0
calla change_anim1
SETMODE NORMAL
rets
#setvel
move a1,*a13(OBJ_ZVEL),L
move *a13(ROLL_POS),a0
add a2,a0
jrp #ok1
addi #ROLL_FRAMES<<8,a0
#ok1
cmpi #ROLL_FRAMES<<8,a0
jrlt #ok2
; subi #ROLL_FRAMES,a0
subi #ROLL_FRAMES<<8,a0
#ok2
move a0,*a13(ROLL_POS)
move *a13(ROLL_POS),a0
srl 8,a0
sll 5,a0
addi adm_roll_frames,a0
move *a0,a0,L
move a0,*a13(CUR_FRAME),L
#nomove
rets
#*****************************************************************************
*
* bouncing off ropes while running
mode_bouncing ;5
clr a0
move a0,*a13(OBJ_XVEL),L
move a0,*a13(OBJ_ZVEL),L
move *a13(ANIMODE),a0
btst MODE_END_BIT,a0
jrz #not_ended
move *a13(MOVE_DIR),a0
xori MOVE_LEFT+MOVE_RIGHT,a0 ;flip LEFT/RIGHT
move a0,*a13(MOVE_DIR)
move *a13(NEW_FACING_DIR),a1
andi MOVE_UP+MOVE_DOWN,a1
or a0,a1 ;LEFT or RIGHT
move a1,*a13(FACING_DIR) ;face same dir as run
movi adm_run2_anim,a0
calla change_anim1a
SETMODE RUNNING
; clr a0
; move a0,*a13(GETUP_TIME) ;in control
#not_ended
rets
#*****************************************************************************
*
* STANDING ON TOP OF TURNBUCKLE
mode_onturnbkl ;6
move a13,a0
calla wres_get_stick_val_cur
btst PLAYER_DOWN_BIT,a0
jrz #no_climbdown
movi adm_climb_down_anim,a0
calla change_anim1
SETMODE CLIMBTURNBKL
rets
#no_climbdown
move a13,a0
calla wres_get_but_val_down
andi 01111b,a0 ;mask out turbo button
jrz #no_exit
SETMODE INAIR
.ref adm_diveofftb_anim
movi adm_diveofftb_anim,a0
calla change_anim1
rets
#no_exit
rets
#*****************************************************************************
* blocking
mode_block ;7
move a13,a0
calla wres_get_but_val_cur
btst PLAYER_BLOCK_BIT,a0
jrnz #still_blocking
SETMODE NORMAL
#still_blocking
rets
#*****************************************************************************
* adam with zero health
mode_dizzy ;8
rets
#*****************************************************************************
mode_dead ;9
rets
#*****************************************************************************
* opponent held overhead
mode_oppoverhead ;10
move *a13(ATTACH_PROC),a2,L ;proc attached to
jrz #not_attached
move *a2(ATTACH_PROC),a0,L
jrnz #still_attached
#not_attached
move *a13(ANIMODE),a0
btst MODE_UNINT_BIT,a0
jrnz #no_interrupt
clr a0
move a0,*a13(ATTACH_PROC),L
SETMODE NORMAL
movi MODE_NORMAL,a0
move a0,*a13(ANIMODE)
#no_interrupt
rets
#still_attached
move a13,a0
calla wres_get_but_val_down
andi 011111b,a0
X32 a0
addi #action_table,a0
move *a0,a0,L
call a0
rets
#action_table
.long #z ;0
.long #punch ;1
.long #block ;2
.long #z ;3
.long #super_punch ;4
.long #z,#z,#z ;5-7
.long #kick ;8
.long #z,#z,#z,#z,#z,#z,#z ;9-15
.long #super_kick ;16
.long #z,#z,#z,#z,#z,#z,#z ;17-23
.long #z,#z,#z,#z,#z,#z,#z,#z ;24-31
************
#z
rets
************
#punch ;1
#block ;2
#super_punch ;4
#kick ;8
#super_kick ;16
*
* MODE DX DZ ACTION