-
Notifications
You must be signed in to change notification settings - Fork 0
/
KUNGTAB.ASM
5409 lines (5046 loc) · 194 KB
/
KUNGTAB.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
.import DIE1, DIE2, DIE3, MAPS, FINI, WIND, WINA, WINB, WINC, T1F, D2D, C3D
.import BOSSRM9, BOSSRM8, BOSSRM7, BOSSRM6, BOSSRM5, BOSSRM4, BOSSRM3, BOSSRM2, BOSSRM1
.import D2C, D2B, D2A, T5E, T5D, T5C, T5B, T5A, P1G, P1H, P1F, P1E, P1D, P1C, P1B, P1A
.import T1A, T1B, T1C, T1D, T1E, T1F, T2A, T2B, T2C, T2D, T2E, T2F
.import T3A, T3B, T3C, T3D, T3E, T3F, T4A, T4B, T4C, T4D, T4E, T4F
.import C5A, C5B, C5C, P2A, P2B, P2C, P2D, P2E, P2F
.import DU2A, DU2B, DU2C, DU2D, DU2E, DU3F, DU3A, DU3B, DU3C, DU3D, DU3E, DU3F
.import DU1A, DU1B, DU1C, DU1D, DU1E, DU1F, DU1G, DU4A, DU4B, DU4C, DU4D, DU4E, DU4F
.import D1A, D1B, D1C, D1E, D1D
.import J1A, J1B, J1C, J1D, J1E, J1F, J2A, J2B, J2C, J2D, C2A, C2B, C2C, C2D, C2E, C2F
.import J3A, J3B, J3C, J3D
.import C1A, C1B, C1C, C1D, C1E, C1F, C1G, C3A, C3B, C3C, C4A, C4B, C4C, C4D
.import BOOTSCRN, TEDCODE, BOOTMOVE, BOSSDROP, BOSSMECH, DUMBLAUNCH, STARMOVE
.import FORKSHOOT, QUIKSHOT, BALLDOOD, HOLDY, BRIZBIG, BRIZZY, MACHINEGUN
.import GRABBY, DRIPPY, GRENADE, GOOPY, STATGUY, SMALLROCK, ROCKFALL
.import BIRDFAKE, GATEKEY, MANARROW, BIGARROW, ARROWMAN, ARRSHT, BOOMMOVE
.import TORCHFIRE, BOMBER, SPIN, FIRE, MAPTHING, NINJA, WIZZARD, GREENTHUG
.import SAMURAI, JUMPY, MONGO, RIFLEMAN, EAGLEBIRD, QUIK, DRUGBOSS, STATSELECT
.import ROCKGATE, KEYPRIZE, SUCTPRIZE, FOODPRIZE, BRASSPRIZE, TORCHPRIZE, BOOMERPRIZE
.import SHIELD, LOTSMAGIC, MAGICTHROW, MANPRIZE, HEALTHPRIZE, MAGICPRIZE, SKLETON
.import WORLDWAKER, HEALTHENTITY, HEROINFO, COPRINFO
;ENHANCEMENTS TO MAKE
;23. GENERATE INDEX FOR SELPAGE ROM VERSION TO SPEED THINGS UP.
;**********************************************************************
; TROUBLES? CONSULT THIS CHART...
;
;PROCESSOR POWER TROUBLES:
;1. MAKE SURE THERE ARENT TOO MANY CONSTANTLY REARMING OR PERMANENTLY
; REARMED ENTITIES ON SCREEN. THE ATTACKS TAKE LOTS OF POWER.
;
;ATTACK DOESN'T SEEM TO BE ARMED:
;1. ONCE ARMED, AN ATTACK ONLY TRIGGERS ONCE UNTIL REARMED. IF AT THE
; TIME OF TRIGGER IT HITS NO ONE, DON'T EXPECT IT TO STAY "ARMED"
; UNTIL IT HURTS SOMEONE. ITS ONLY ARMED FOR 1 CYCLE OF THE ANIMATION
; TO THE PROPER FRAME THEN IT DISARMS WHETHER IT HITS SOMEONE OR NOT.
;
;PROGRAM CRASHES WILDLY:
;1. CHECK FOR .byte s WHEN THERE SHOULD BE .word s AND VICE VERSA. TRY THESE:
; SKIPS WITH .byte s FOR DESTINATION
; .word s WITH THE X AND Y OF THE RANGE COMMAND
;2. CHECK FOR TABLE COMMANDS WITH NOT ENOUGH ENTRIES FOR THE REGISTER
; VALUE. TRY STORING THE REGISTER IN SOME UNUSED COMMON DATA AREA
; RAM JUST BEFORE THE TABLE COMMAND. THEN IF IT CRASHES YOU CAN LOOK
; AT THE LAST VALUE WITH THE DEBUGGER. CHECK KUNGFU.LST FOR COMMONDATA
; TO SEE WHERE THE BASE IS AND THEN ADD YOUR BYTE LOCATION.
;3. MAKE SURE THAT YOU HAVEN'T OVERFLOWED PROGRAM OR BACKGROUND MEMORY.
;THE ASSEMBLER WON'T WARN YOU. CHECK CODE.SEG (OR OBJ) TO MAKE SURE THAT
;THE TOP ORG ISN'T OVERFLOWED BY THE BOTTOM ONE. CHECK MEMORY.SEG
;AT THE BOTTOM AND GO UP UNTIL YOU FIND THE DISCONTINUITY IN THE
;ORGS. THATS WHERE YOU BACKGROUND DATA MIGHT OVERFLOW INTO THE CODE
;IN THE SECOND PAGE.
;
;ENTITIES DISAPEAR WHILE ACTIVE FOR NO APPARENT REASON:
;
;1. IF YOU HAVE ENTITIES WHOS ANIMATIONS TAKE UP DIFFERENT NUMBERS OF
;SPRITES, ITS POSSIBLE THAT DURING THE SMOOTH ANIMATION CHANGE OF AN
;ACTIVE ENTITY A CONDITION COMES UP WHERE THERE AREN'T ENOUGH SPRITES
;TO BRING IN THE NEW ANIMATION. AVOID MAKING ANIMATIONS WHICH TAKE UP
;DIFFERENT AMOUNTS OF SPRITES IF YOU KNOW THAT THE WORLD WHERE THEY ARE
;GOING TO BE USED WILL HAVE FEW SPRITES AVAILABLE. FOR INSTANCE, IN
;CHALLENGE OF THE DRAGON THE MONGOLIAN GIANT WHO MAKES ROCKS COME CRASHING
;DOWN WOULD HAVE PROBLEMS IF HIS ANIMATIONS DIFFERED IN SIZE BECAUSE HE
;CREATES AS MANY ROCKS AS THERE ARE SPRITES AVAILABLE. THIS USED TO
;CAUSE HIM TO DISAPPEAR BECAUSE HIS HITTING ANIMATION WAS NOT AS WIDE AS
;HIS WALKING ANIMATION. THE HITTING MADE ALL SPRITES GET USED UP FOR
;ROCKS AND THEN HE COULDN'T BRING IN HIS WALK. THE SOLUTION WAS TO PAD HIS
;WALK OUT WITH BLANKS BUT IT MADE IT EASIER TO SWORD ATTACK HIM.
;
;HERO GETS INTO JUMP POSITION WHEN HE WASN'T JUMPING OR GETS STUCK IN IT:
;IF YOUR JUMP CODE STARTS BY CHECKING FOR STANDING AND DOES A RESUME IF
;YOU HERO ISN'T STANDING, YOU MUST HAVE -1 FOR THE ANIMATION OR ELSE YOU
;WILL ALWAYS GET THE JUMP IMAGE REGARDLESS IF YOU ARE JUMPING AND THE
;CODE THAT GETS RESUMED WON'T GET RID OF IT. USE -1 AND THEN SEQUENCE
;THE PICTURE AFTER YOUR CODE DECIDES ITS OK TO JUMP.
;
;***********************************************************
;
; CONTROL DATA INFORMATION FOR THE GAME STATE MACHINE.
;
;THIS ASSEMBLY CONTAINS THE SOUNDS, POINT TABLES, MUSIC, AND CONTROL
;DATA TABLES FOR THE NES UNIVERSAL QUEST GAME STATE MACHINE.
;
;THE BACKGROUND DATA SHOULD BE IN <<< YOURBACK.ASM >>>
;(THE DRAWING PROGRAM ND.EXE WILL MAKE THIS FILE).
;
;THE SPRITE AND PALETTE DATA SHOULD BE IN <<< DRAWDATA.ASM >>>
; (THE DRAWING PROGRAM ND.EXE WILL MAKE THIS FILE).
;
;THE SOUND INFO CAN BE IN THIS FILE OR IN A FILE CALLED <<< YOURSND.ASM. >>>
;IF YOU PUT IT INTO YOURSND.ASM IT WILL GO INTO THE SECOND ROM PAGE.
;THAT SHOULD BE BEST SINCE THIS STATE MACHINE SUPPORTS STRIPIZING
;YOUR BACKGROUNDS AND SHOULD LEAVE YOU WITH ROOM IN THE SECOND PAGE.
;YOU MUST HAVE THIS FILE EVEN IF ITS EMPTY.
;
;CODE FOR YOUR ENTITIES MAY BE PUT INTO THE FILE <<< YOURCODE.ASM >>> IF
;YOU WANT TO PUT IT INTO THE SECOND PAGE. YOU MUST HAVE YOURCODE
;EVEN IF ITS EMPTY.
;
;**************************************************************************
;**************************************************************************
; HINTS AND GOOD IDEAS
;
;PRIZE MAKING: YOU COULD MAKE PRIZES ATTACK THE HERO AND HAVE THE HERO
;IGNORE THE ATTACK AND HAVE THE PRIZE INCREMENT WHATEVER PRIZE COUNT
;BUT THIS MAKES YOUR HERO HAVE TO USE A -1 ANIMATION OR ELSE HE WOULD
;SKIP INTO HIS HURT ANIMATION. HERE'S A BETTER WAY: MAKE YOUR PRIZES
;TARGET THE HERO. THEN USE A RANGE COMMAND INSIDE THE PRIZE'S CODE
;LOOP AND MAKE THE PRIZE DO EVERYTHING WITHOUT THE HERO EVER KNOWING
;ABOUT IT. YOU MIGHT HAVE TO MAKE A MAILBOX IN COMMON DATA RAM FOR
;CASES SUCH AS HEALTH INCREMENTING. THE HERO IS BEST ABLE TO INCREMENT
;HIS OWN HEALTH. THE PRIZE COULD PUT A NUMBER TO ADD TO HIS HEALTH
;SOMEWHERE AND HE COULD JUST PERIODICALLY USE IT.
;
;CONTINUOUS ATTACKERS: CONTINUOUSLY ATTACKING THINGS TAKE UP LOTS OF
;PROCESSOR POWER BECAUSE THEY HAVE TO CHECK EVERYTHING ELSE ON THE SCREEN.
;INSTEAD OF MAKING THEM CONSTANTLY REARM, MAKE THEM USE A RANGE COMMAND
;IN CONJUNCTION WITH THE HURT COMMAND TO DO IT MANAULLY. THIS SLOWS DOWN
;THE PROCESSOR POWER REQUIREMENTS IN TIGHT SPOTS. OR MAKE THEM ONLY REARM
;WHEN THE ENEMY IS IN A SMALL RANGE.
;
;SHOWING HEALTH AND MEN LEFT: MAKE AN ENTITY THAT DOES THIS RUNNING
;HALF FREQUENCY. THEN WHEN YOU WANT AN UPDATE, JUST USE THE CREATE COMMAND
;TO LAUNCH HIM. HE SHOULD DIE BY HIMSELF WHEN DONE. THE ONLY PROBLEM WITH
;THIS TECHNIQUE IS THAT YOU MUST MAKE SURE A SLOT IS ALWAYS AVAILABLE FOR
;THIS OR YOUR STATUS BAR MIGHT NOT GET UPDATED.
;**************************************************************************
;THE FOLLOWING 4 BYTES ARE EQUIVALENT TO A TOPSTAT COMMAND AND
;MUST BE HERE TO GET THINGS SET UP AT RESET TIME. FROM THEN ON, ONLY
;YOUR TOPSTAT COMMAND VALUES ARE IN EFFECT. THE VALUES HERE ARE PROBABLY
;WHAT YOU WOULD WANT SINCE THEY MAKE A CLEAN CENTERED 24 HIGH BOOT
;SCREEN WITHOUT A STATUS BAR. BE SURE TO SET THE CHARACTERS SET HERE
;VALID FOR YOUR BOOT WORLD!!!
DEFTOPSTAT:
.byte 38,38,0,4 ;PUT SAME VALUES HERE AS FOR A TOPSTAT.
;THIS DEMO ONE MAKES A 4.75 HIGH (5 ROWS)
;STATUS BAR. VIEWABLE DATA IS IN ROWS
;3 AND 4 (THE BOTTOM 2).
; STATCHAR = $FE ;FOR BACKGROUND (BOTTOM OF STAT BAR)
; STATSPRITE = $FE ;FOR THE SPRITE (USUALLY 2 HIGH)
; CLOCKPHASE = 3 ;THIS VARIABLE CONTROLS HOW MANY TIMES PER
;SECOND EACH ENEMY IS MOVED. YOUR COUNTERS
;ALSO RUN AT THIS FREQUENCY SO BE CAREFUL.
;HERE ARE THE VALUES:
; 1 = 30 TIMES PER SECOND. WILL
; SLOW DOWN IF MORE THAN 10
; ENEMIES LAUNCHED BUT NOT
; THAT NOTICABLE.
; 3 = 15 TIMES PER SECOND.
; 7 = 7.5 TIMES PER SECOND
; XSCROLLSPEED = 8 ;FASTEST THE SCREEN IS ALLOWED TO SCROLL ON X.
;DON'T GO ABOVE 8 OR THE HERO WILL BE ABLE
;MAKE THE SCREEN SKIP OVER ENEMY LAUNCHES.
; ERASECHAR = $40 ;THE CHAR TO BLANK FILL SCREENS WITH. MUST BE
;BLANK IN ALL BACKGROUNDS.
;THIS TABLE CONTAINS THE DEFAULT MOMENTUMS THAT ARE LOADED AT THE
;START OF EACH WORLD. THESE 8 BYTES SPECIFY THE EFFECTS THAT THE
;LEFT, RIGHT, UP AND DOWN ARROW KEYS WILL HAVE ON THE HERO'S X TRAVEL AND Y
;TRAVEL MOMENTUM. EACH BYTE IS A SIGNED VALUE FOR THE AMOUNT TO
;ADD TO A PARTICULAR MOMENTUM VALUE. THE BYTES ARE:
;LEFTX, LEFTY, RIGHTX, RIGHTY, UPX, UPY, DOWNX, DOWNY.
;+ VALUES ARE RIGHT AND DOWN. - VALUES ARE UP AND LEFT.
;THE MAX VALUE IS $40. THE NEGATIVE VALUE MAY BE $FF DOWN TO
;$B0.
DEFMOMS: .byte $F4,$00,$0C,$00,$00,$F4,$00,$0C ;JOYSTICK
;THIS IS THE SOUND MADE BY THE DING COMMAND.
PNOISE: .byte VOICE3,LOADALL,$04,$00,$83,$08
.byte PAUSE+N4,ENDPLAY
;************************************************************************
; ENTITY (SPRITE) CONTROL INFORMATION
;
;THIS TABLE SPECIFIES THE INFORMATION NEEDED TO CONTROL A SPRITE ENTITY.
;ENTITIES INCLUDE THE HERO(S), ENEMIES, BULLETS, PLATFORMS, PRIZES, AND
;SPECIAL EFFECTS. THERE ARE 16 ALLOWED AT A TIME IN ANY COMBINATION.
;WHEN AN ENTITY IS LAUNCHED, HE IS PUT INTO THE "WAKEUP" MODE WITH
;THE WAKE UP ANIMATION SELECTED AND THE WAKE UP TABLE IN EFFECT. EACH
;TABLE CAN JUMP TO OR RUN ANOTHER TABLE USING EMBEDDED COMMANDS SO THE
;ENTITY'S FULL BEHAVIOR CAN BE CONTROLLED WITHOUT ASSEMBLY LANGUAGE. WHEN AN
;ENTITY IS HIT BY AN ATTACK HE GOES INTO HURT MODE AUTOMATICALLY. WHEN
;THE JOYSTICK IS TIED TO AN ENTITY (HERO MODE) VARIOUS FUNCTIONS ARE
;ACTIVATED AUTOMATICALLY FROM THE JOYSTICK BUTTONS AS SPECIFIED WITH THE
;SPECIAL COMMANDS.
;A SPECIAL KIND OF ENTITY CALLED "ZERO SPRITES ENTITY" IS ALSO SUPPORTED.
;SETTING BIT $40 IN THE RECOMMENDED BASE SPRITE FOR THE ENTITY CAUSES
;THIS EFFECT. THE ENTITY BEHAVES LIKE ANY OTHER EXCEPT THAT IT DOESN'T
;TAKE UP ANY SPRITES (AND NATURALLY IT DOESN'T DISPLAY). THE DRAWING
;PROGRAM WILL ALLOW YOU TO DEFINE THESE AUTOMATICALLY.
;AT BOOT UP THE FOLLOWING DEFAULTS ARE SET FOR THE ENTITY:
;MOMENTUM LIMIT FOR THE X AXIS IS SET TO DEF_XLIM.
;MOMENTUM LIMIT FOR THE Y AXIS IT IS SET TO DEF_YLIM.
;GRAVITY IS SET TO DEF_GRAV.
;FRICTION IS SET TO DEF_XFRICT AND DEF_YFRICT.
;BOUNCE IS SET TO DEF_BOUNCE.
;
;
;COMMANDS ARE PROVIDED TO CHANGE THESE DEFAULTS AS DESIRED.
;
;EACH ENTITY SPECIFICATION ENTRY CONTAINS THE FOLLOWING INFORMATION:
;
;1 WORD POINTER TO ANIMATION/MOVEMENT LIST FOR THIS ENTITY.
;1 BYTE FLAG BITS:
; 01 = IF SET, FRICTION IS APPLIED AT ALL TIMES. IF OFF, ONLY WHEN
; STANDING ON SOLID.
; 02 = DON'T REMOVE ENTITY FROM SCREEN IF IT SCROLLS HIM TO SIDE.
; 04 = ENTITY IS A MUST DEFEAT ENTITY FOR USE WITH THE FIGHT IT OUT
; SCREEN COMMAND FOR THE WORLD TABLE.
; 08 = ENTITIES FEET (BOTTOM SCAN LINE) WILL NOT BE ALLOWED TO
; GO ABOVE SCREEN TOP (0) OR BELOW BOTTOM (240-STATUS BAR
; HEIGHT IN PIXELS).
; 10 = ENTITY WILL NOT BE ALLOWED TO WALK RIGHT OFF VISUAL SCREEN.
; IF BACKGROUND SCROLLS HIM THERE HOWEVER HE WILL GO THERE.
; THIS SIMPLY PREVENTS HIM FROM GOING THERE UNDER HIS OWN
; MOMENTUM POWER. USED PRIMARILY FOR JOYSTICK ENTITIES.
; 20 = ENTITIES HEAD (TOP SCAN LINE) WILL NOT BE ALLOWED TO GO
; ABOVE SCREEN TOP (0) AND THUS NOT INTO THE STATUS LINE.
; 40 = ENTITY ATTACKS ONLY TARGETED ENTITIES. OTHERWISE ENTITY'S
; ATTACKS WILL BE REPORTED TO ALL WHO ARE HIT.
; 80 = ENTITY WILL TEST THE WORLD FLAGS. SET THIS ONLY IN THE
; HERO IF AT ALL POSSIBLE TO PREVENT PROCESSOR POWER DRAIN.
;1 BYTE SOLID CHAR VALUE FOR THIS ENTITY (0=NONE).
;1 BYTE CONTROL AND SCREEN SCROLL FLAG BITS:
; BITS 03 ARE SCREEN X SCROLL:
; 00=FULL SCREEN X SCROLL CORRECTION
; 01=HALF SCREEN X SCROLL CORRECTION
; 10=ONE QUARTER X SCREEN SCROLL CORRECTION
; 11=NO SCREEN X SCROLL CORRECTION
; (DON'T USE ANYTHING BUT 00 FOR A JOYSTICK ENTITY!)
; BITS 0C ARE SCREEN Y SCROLL:
; 00=FULL SCREEN Y SCROLL CORRECTION
; 01=HALF SCREEN Y SCROLL CORRECTION
; 10=ONE QUARTER Y SCREEN SCROLL CORRECTION
; 11=NO SCREEN Y SCROLL CORRECTION
; (DON'T USE ANYTHING BUT 00 FOR A JOYSTICK ENTITY!)
; BIT 10 = LOW PRIORITY ENTITY. IF A LAUNCH ENTITY COMMAND
; CANNOT FIND A FREE SLOT IT WILL REMOVE ANY ENTITY WITH
; THIS BIT SET. THE ENTITY WILL DISAPPEAR WITH A DIE,0.
; BIT 20 = LOW EXECUTION PRIORITY. SLOW THIS ENTITY DOWN IF YOU
; GET TOO FAR BEHIND.
; BITS C0 ARE UNUSED AT THIS TIME. SET THEM TO 0.
;1 BYTE STARTING HEALTH FOR THIS ENTITY. 255 IS MAXIMUM HEALTH.
;
;**********************************************************************
;NOTE: THESE VALUES WILL HAVE TO BE CHANGED IF YOU CHANGE CLOCKPHASE.
;DEF_XLIM = 24 ;64 MAX!
;DEF_YLIM = 64 ;64 MAX IF YOUR SOLIDS ARE 1 HIGH, 120 IF 2 HIGH.
;DEF_GRAV = 10
;DEF_XFRICT = 16
;DEF_YFRICT = 0
;XFCTR = 3 ;1/15 DELAY AFTER APPLYING X MOMENTUM BEFORE FRICTION
;EACH TICK HERE ALLOWS 2 INSTRUCTIONS.
;YFCTR = 3 ;DELAY AFTER APPLYING Y MOM BEFORE FRICTION KICKS IN
;DEF_BOUNCE = 0 ;DEFAULT BOUNCE FACTOR
ENTITYTAB: ;ENTITY SPRITE ASSIGNMENT TABLE
.word COPRINFO ;0=COPYRIGHT NOTICE AND START BUTTON MONITOR
.byte 0,0,0,0
;HEROID = 1
.word HEROINFO ;1 = HERO, JOYSTICK 1
.byte $9A,$E0,0,20 ;HIS HEALTH IS NOT USED. SEE COMMON DATA 21
;STATGUYID = 2
.word HEALTHENTITY ;2=STATUS BAR UPDATER.
.byte 2,0,0,0
;WORLDGUYID = 3
.word WORLDWAKER ;3=ENTITY TO LAUNCH AT A WORLD START TO DO
.byte 2,0,0,0 ;MISC. STUFF LIKE STATUS LINE COLORS, ETC.
;SKELETON = 4
.word SKLETON ;4=SKELETON GUY FOR CASTLE
.byte $2E,$E0,0,7
.word MAGICPRIZE ;5=STICK OF DYNAMITE
.byte 0,$E0,$20,0
.word HEALTHPRIZE ;6=HEART OF HEALTH
.byte 0,$E0,$20,0
.word MANPRIZE ;7=FREE MAN
.byte 0,$E0,0,0
;MAGICGUYID = 8 ;DYNAMITE THAT'S THROWN BY HERO
.word MAGICTHROW ;8=BOTTLE OF DYNAMITE
.byte $0A,$E0,0,0
.word LOTSMAGIC ;9=10 DYNAMITES
.byte 0,$E0,$20,0
.word SHIELD ;10=HERO'S SHIELD
.byte $40,$E0,0,0
.word BOOMERPRIZE ;11=BOOMERRANG
.byte 0,$E0,$20,0
.word TORCHPRIZE ;12=TORCH
.byte 0,$E0,$20,0
.word BRASSPRIZE ;13=BRASSKNUCKLES
.byte 0,$E0,$20,0
.word FOODPRIZE ;14=SHIELD
.byte 0,$E0,$20,0
.word SUCTPRIZE ;15=SUCTION CUPS
.byte 0,$E0,$20,0
.word KEYPRIZE ;16=KEY
.byte 0,$E0,$20,0
.word ROCKGATE ;17=HIDDEN GATE
.byte 0,0,0,8
.word STATSELECT ;18=STATUS SELECTOR
.byte 2,0,$23,0
;BOSSMAN = 19
.word DRUGBOSS ;19=BIG BOSS DUDE AT END
.byte $7E,$E0,0,25
;QUIKEIGHT = 20
.word QUIK ;20=FLYING FIGURE
.byte $72,$E0,0,0
;EAGLEFLY = 21
.word EAGLEBIRD ;21=EAGLE
.byte $63,$E0,$20,7
;WHITEFAKE = 22
.word RIFLEMAN ;22=ENEMY WITH WHITEHAT MOVEMENTS
.byte $2E,$E0,0,7
;MONGOLIAN = 23
.word MONGO ;23=ENEMY WITH BIG CLUB
.byte $6E,$E7,0,10
;KNIFEJUMP = 24
.word JUMPY ;24=ENEMY WITH VALKARY
.byte $6E,$E0,0,7
;SWORDMAN = 25
.word SAMURAI ;25=GUY WITH SWORD
.byte $6E,$E0,0,7
;GREENCAPE = 26
.word GREENTHUG ;26=GREEN THUG
.byte $2E,$E0,0,7
;FLYBOY = 27
.word WIZZARD ;27=EVIL, FLYING, TERRIBLE PERSON
.byte $3E,$E0,0,12
;NINJAFAKE = 28
.word NINJA ;28=MASTER NINJA WITH BOMBS
.byte $2E,$E0,0,7
.word MAPTHING ;29=MAP ICON
.byte 0,$E0,0,0
;BOLTGUYID = 30 ;BULLET WHITEHAT SHOOTS
.word FIRE
.byte $68,0,0,1
;SHURIGUYID = 31 ;DAGGER FOR NINJA
.word SPIN
.byte $68,$E0,$20,1
;BOMBGUYID = 32 ;BOMB THAT NINJA THROWS
.word BOMBER
.byte $7A,$E0,$20,0
;FIREDUMMY = 33
.word TORCHFIRE ;TORCH USED TO LIGHTEN UP ROOM
.byte 2,0,0,0
;BOOMCHUCK = 34
.word BOOMMOVE ;BOOMERRANG THAT IS THROWN
.byte $6A,$E0,0,1
.word ARRSHT ;35 ARROW BEING FLUNG
.byte $68,$E0,0,0
;ARRMAN = 36 ;ARROW MAN IN CITY
.word ARROWMAN
.byte $40,$E0,0,7
.word BIGARROW ;37 ARROW IN WINDOW ROOM
.byte $68,0,0,1
;WINDOWMAN = 38 ;MAN IN WINDOW ROOM
.word MANARROW
.byte $2E,$E0,0,5
.word GATEKEY ;39=GATE THAT NEEDS KEY TO OPEN
.byte 0,0,0,5
.word BIRDFAKE ;40=FAKE BIRD MAN WITH KNIFE
.byte $2E,$E0,0,7
;ROCKGUYID = 41 ;NEED TO MAKE A ROCK TO FALL SOME DAY
.word ROCKFALL
.byte $60,$E0,$20,5
;SMROCKGUYID = 42 ;SMALL ROCK THAT THE BIG ONE BLOWS UP INTO
.word SMALLROCK
.byte $60,$E0,$20,5
.word STATGUY ;43 MAP CODE
.byte $20,$E0,0,0
.word GOOPY ;44
.byte $20,$E0,0,0
;SKULLGUYID = 45 ;THING THROWN BY BIG WIZARD
.word GRENADE ;45
.byte $28,$E0,0,0
.word DRIPPY ;46
.byte $68,$E0,$20,0
.word GRABBY ;47 GRABS YOU IN WINDOW
.byte $72,$E0,0,0
;BIGSPGUYID = 48 ;THING SHOT BY BIG WIZZARD
;LITLSPGUYID = 48 ;THING SHOT BY LITTLE WIZZARD
.word MACHINEGUN ;48
.byte $68,$E0,$20,1
.word BRIZZY ;49
.byte $60,$E0,$20,0
.word BRIZBIG ;50
.byte $60,$E0,0,0
.word HOLDY ;51
.byte $62,$E0,0,0
.word BALLDOOD ;52
.byte $62,$E0,$20,0
.word QUIKSHOT ;53
.byte $40,$E0,$20,0
.word FORKSHOOT ;54
.byte $60,0,0,0
.word STARMOVE ;55
.byte $62,$E0,0,0
.word DUMBLAUNCH ;56
.byte $22,$E0,0,0
.word BOSSMECH ;57 ROBOT IN BOSS WORLD
.byte $40,$E0,0,0
.word BOSSDROP ;58 SHOT FROM ROBOT
.byte $40,$E0,$20,0
.word BOOTMOVE ;59 HERO MOVEMENT IN BOOT SCREEN
.byte $00,$E0,0,0
.word TEDCODE ;60 LITTLE TED MIDGETS
.byte $2E,$E0,0,7
;THE ANIMATION/MOVEMENT LIST SPECIFIES THE ANIMATION AND MOVEMENT TABLE
;TO USE FOR THE WAKEUP ANIMATION AND FOR ANY OTHER MODES THAT THE
;ENTITY CAN ENTER INTO. YOU DON'T HAVE TO HAVE A UNIQUE ANIMATION FOR EACH
;ENTRY, FOR INSTANCE, THE WAKE UP CAN BE THE SAME AS THE STANDING AND ANY
;OF THE ATTACKS MAY DUPLICATE ANOTHER ATTACK. THERE IS ONE MAJOR RULE
;FOR THE ARTISTS TO REMEMBER!!!! THE WAKE UP ANIMATION MUST CONTAIN
;THE BIGGEST WIDTH OF THE ANIMATION SEQUENCES. THE WIDTH MAY VARY
;FROM THEN ON BUT THE HEIGHT CANNOT.
;REMEMBER THAT THE HERO IS JUST A SPECIAL CASE OF AN ENTITY WHOS
;MOVEMENTS ARE TIED TO THE JOYSTICK. ALSO, BULLETS ARE SIMPLY
;ENEMIES LAUNCHED FROM ANOTHER ENTITY. PLATFORMS ARE ALSO JUST
;ENTITIES AS ARE SPECIAL EFFECTS. ANY SPRITE ON THE SCREEN IS
;JUST ANOTHER CASE OF AN ENTITY WITH A MOVEMENT TABLE.
;WHEN AN ANIMATION IS ACTIVATED, THE INIT OPTIONS FLAG IS USED.
;HERE IS THE FORMAT FOR THE INIT OPTIONS FLAG BYTE:
; $07 = 3 BITS USED WITH THE ALIGN ON X OR Y BITS. GIVES ALIGN VALUE.
; TYPICAL VALUE IS 2. ITS THE COUNT TO SHIFT X LOCATION RIGHT
; AND RESULT IS USED TO PICK A FRAME.
; $08 = UNUSED. SET TO 0.
; $10 = TRUE IF HERO ANIMATION ALIGNS TO Y AXIS
; $20 = TRUE IF HERO ANIMATION ALIGNS TO X AXIS
; $40 = TRUE IF ANIMATION SHOULD AUTOFREEZE (RUN TO END AND STOP)
; $80 = UNUSED. SET TO 0.
;WHEN ENEMIES AND HEROS "ATTACK" WITH EACH OTHER, THE DAMAGE FLAGS
;ARE USED TO QUALIFY IF DAMAGE IS TAKEN BY THE ONE ATTACKED.
;THERE ARE 3 DAMAGE FLAG BYTES. HERE ARE THEIR FORMATS:
;DAMAGE FLAG #1 = 1 BYTE FRAME # ON WHICH ATTACK IS ACTIVE. SET IT TO -1
; TO DISABLE ATTACKS. FOR WALKING, STANDING, ETC.
; YOU WOULD TYPICALLY DISABLE IT WITH -1. NOTE THAT
; THE ANIMATION WILL BE CHECKED AT A FREQUENCY OF 4
; RELATIVE TO THE ANIMATION SO YOUR ANIMATION MUST
; RUN SLOWER THAN THIS OR YOU MIGHT MISS THE FRAME
; ON WHICH THE ATTACK IS ACTIVE. THE ATTACK IS "ARMED"
; WHEN THE ANIMATION IS INITIALIZED AND TRIGGERS WHEN
; THIS FRAME NUMBER IS LESS THAN OR EQUAL TO THE CURRENT
; FRAME #. AN ATTACK WILL ONLY TRIGGER 1 TIME. USE COMMAND
; A6 IF YOU NEED MORE TRIGGERS.
;
; FOR SPRITES WHICH ARE NOT ANIMATIONS, USE FRAME #0.
;
; FOR A PERMANENTLY ARMED ATTACK (TAKES LOTS OF PROCESSOR
; POWER!), USE -2.
;
;DAMAGE FLAG #2 = 1 BYTE HOTSPOT FLAG. THIS BYTE SPECIFIES THE LOCATION
; IN SPACE RELATIVE TO THE ENTITY WHICH IS CONSIDERED
; THE ATTACKED AREA WHEN AN ATTACK IS COMPLETED. THE
; DIRECTION THE ENTITY FACES IS THE DIRECTION THAT
; YOUR FLAG WILL BE USED. IT IS A NIBBLE ORIENTED FLAG:
; BITS 0F = (DISTANCE/2) FROM CENTER OF SPRITE.
; BITS F0 = (DISTANCE/4) FROM TOP OF SPRITE.
;
;DAMAGE FLAG #3 = 1 BYTE DAMAGE BITS:
; BITS 07 = AMOUNT OF DAMAGE TO APPLY TO HERO OR ENTITY
; WHEN THIS ATTACK HITS HIM. SET
; TO 0 IF DESIRED, THEN ONLY THE HURT SEQUENCE
; WILL BE ACTIVATED BUT NO DAMAGE WILL OCCUR.
; RANGE IS 0-7 HEALTHS LOST.
; BIT 08 = SET TO SELECT HURT NUMBERS 16-31.
; BITS F0 = HURT # TO REPORT TO THE ENTITY THAT WAS HURT
; BY THIS ATTACK. ALLOWS HURT # 0-15. SET BIT
; 08 TO REPORT HURT NUMBERS 16-31.
;DAMAGE FLAG #4 = BITS 0F = X ATTACK ZONE HALF WIDTH. THIS IS THE
; DISTANCE/4 FROM THE HOTSPOT REGION WHICH
; IS CONSIDERED TO BE IN THE ATTACK REGION.
; THIS GIVES A TOTAL DISTANCE OF 60 WHICH
; ALLOWS A 120 PIXEL WIDE ATTACK ZONE (FOR BOMBS).
; BITS F0 = Y ATTACK ZONE HALF WIDTH. THIS IS THE
; DISTANCE/4 FROM THE HOTSPOT REGION WHICH
; IS CONSIDERED TO BE IN THE ATTACK REGION.
; THIS GIVES A TOTAL DISTANCE OF 60 WHICH
; ALLOWS A 120 PIXEL WIDE ATTACK ZONE (FOR BOMBS).
;DAMAGE FLAG #5 = BITS 0F = DIRECTION IN WHICH ATTACK IS VALID. ATTACKS
; ARE IGNORED UNLESS THEY ARE DIRECTED IN
; THE DIRECTION YOU SPECIFY. THERE ARE 4
; BITS, YOU CAN USE EQUATES TO "OR" THEM
; IF YOU LIKE (EXAMPLE: UP | DOWN)
; 08H = <UP>
; 04H = <DOWN>
; 02H = <LEFT>
; 01H = <RIGHT> (DIRECTION ENTITIES FACE)
; BITS F0 = UNUSED FOR NOW
;THE ENTRIES IN THE ANIMATION/MOVEMENT LIST WERE DESIGNED TO BE A MINIMUM
;SUBSET ACCORDING TO WHICH WERE MANDITORY (CALLED EXTERNALLY UNDER
;SOME CIRCUMSTANCES) PLUS A FEW THAT SHOULD BE COMMONLY NEEDED.
;FOR INSTANCE, WALKING AND STANDING ARE NEVER ACTIVATED EXTERNALLY
;BUT SHOULD BE COMMON ENOUGH TO BE WORTH HAVING AN ENTRY. ATTACKING
;IS ACTIVATED EXTERNALLY FOR JOYSTICK DRIVEN ENEMIES BUT ACTUALLY
;EACH ENTITY SHOULD HAVE SEVERAL ATTACKS. RATHER THAN INCLUDE ENTRIES
;FOR DIFFERENT ATTACKS ITS UP TO YOUR CODE TO BRANCH AND DO IT MANUALLY.
;THE SEQUENCE WAS DESIGNED TO PUT THOSE CALLED AUTOMATICALLY TOWARDS THE
;TOP OF THE LIST IN ORDER OF LIKELYHOOD THAT THEY WILL BE CALLED. YOU
;CAN "CONTROL" YOUR WORLD SUCH THAT ENTRIES BELOW A GIVEN ONE IN THE LIST
;WILL NOT BE ACTIVATED AND THUS YOU CAN SKIP USING THE MEMORY TO SPECIFY
;THE ENTRIES BELOW THAT LAST ONE YOU NEED. ENTRIES ARE ONLY CHECKED
;FOR VALIDITY WHEN USED. WAKEUP IS THE ONLY ENTRY THAT MUST
;ALWAYS BE PRESENT. AT WAKEUP, ALL INTERRUPTING STATES ARE DISABLED.
;UNLESS YOU ENABLE SOME INTERRUPT EXECUTION WILL STAY IN WAKEUP FOREVER.
;HERE ARE THE CIRCUMSTANCES UNDER WHICH THESE ANIMATION/MOVEMENT ENTRIES
;CAN BE ACTIVATED:
;1. WAKEUP IS AUTOMATIC AT ENTITY LAUNCH.
;2. HURT IS CALLED WHEN AN ATTACK HITS THIS ENTITY.
;3. FALLING IS CALLED THE FIRST TIME A GRAVITIED ENTITY WHICH WAS STANDING
; ON SOLIDS TRAVELS IN THE DIRECTION OF GRAVITY WITHOUT A SOLID UNDER
; IT.
;4. WORLD COMMAND IS CALLED WHEN AN ENTITY STEPS ONTO A SCREEN COLUMN
; THAT HAS A WORLD COMMAND DEFINED AND HE IS BETWEEN THE ROWS SPECIFIED.
;5. JUMPING IS CALLED IF A JOYSTICK DRIVEN ENTITY HAS BUTTON A PRESSED.
;6. ATTACKING IS CALLED WHEN BUTTON B IS PRESSED ON A JOYSTICK ENTITY.
;7. DUCKING IS CALLED WHEN DOWN IS PRESSED ON A JOYSTICK ENTITY. YOU SHOULD
; USUALLY CHECK IF IT WAS STANDING ON SOLIDS IN YOUR CODE.
;HERE IS THE TABLE FORMAT:
; 1 WORD WAKE UP ANIMATION OR SPRITE NAME. THIS ANIMATION IS
; MANDITORY AND MUST ALSO BE THE LARGEST ANIMATION OR SPRITE
; IN THE SERIES SO THAT SPRITES CAN BE ALLOCATED.
; 1 WORD POINTER TO THE WAKE UP MOVEMENT LIST. THIS LIST IS MANDITORY,
; DON'T TRY TO USE -1!!!!!!!!!!
; INIT FLAG, DAMAGE FLAG #1
; DAMAGE FLAG #2, DAMAGE FLAG #3
; 1 WORD HURT BY ATTACK. USE -1 FOR NO CHANGE.
; WHEN NO CHANGE IS SPECIFIED FOR THE ANIMATION, THE INIT FLAG
; AND DAMAGE FLAGS ARE ALSO NOT USED.
; 1 WORD POINTER TO THE HURT MOVEMENT LIST. USE -1 FOR NO CHANGE.
; DON'T USE NO CHANGE FOR INTERRUPT PROCESSES SINCE THEY DISABLE
; INTS AND WILL LEAVE THEM DISABLED. USE RESUME INSTEAD.
; INIT FLAG, DAMAGE FLAG #1
; DAMAGE FLAG #2, DAMAGE FLAG #3
; 1 WORD FALLING (OR -1)
; 1 WORD POINTER TO THE FALLING MOVEMENT LIST (OR -1)
; INIT FLAG, DAMAGE FLAG #1
; DAMAGE FLAG #2, DAMAGE FLAG #3
; 1 WORD WORLD COMMAND ANIMATION (ALMOST ALWAYS -1 FOR NONE)
; 1 WORD POINTER TO THE WORLD COMMAND MOVEMENT LIST (OR -1)
; INIT FLAG, DAMAGE FLAG #1
; DAMAGE FLAG #2, DAMAGE FLAG #3
; 1 WORD JUMPING (OR -1)
; 1 WORD POINTER TO THE JUMPING MOVEMENT LIST (OR -1)
; INIT FLAG, DAMAGE FLAG #1
; DAMAGE FLAG #2, DAMAGE FLAG #3
; 1 WORD ATTACKING (OR -1)
; 1 WORD POINTER TO THE ATTACKING MOVEMENT LIST (OR -1)
; INIT FLAG, DAMAGE FLAG #1
; DAMAGE FLAG #2, DAMAGE FLAG #3
; 1 WORD DUCKING (OR -1)
; 1 WORD POINTER TO THE DUCKING MOVEMENT LIST (OR -1)
; INIT FLAG, DAMAGE FLAG #1
; DAMAGE FLAG #2, DAMAGE FLAG #3
; 1 WORD STANDING ANIMATION OR SPRITE NAME. USE -1 FOR NO CHANGE.
; WHEN NO CHANGE IS SPECIFIED FOR THE ANIMATION, THE INIT FLAG
; AND DAMAGE FLAGS ARE ALSO NOT USED.
; 1 WORD POINTER TO THE STANDING MOVEMENT LIST. USE -1 FOR NO CHANGE.
; INIT FLAG, DAMAGE FLAG #1
; DAMAGE FLAG #2, DAMAGE FLAG #3
; 1 WORD WALKING (OR -1)
; 1 WORD POINTER TO THE WALKING MOVEMENT LIST (OR -1)
; INIT FLAG, DAMAGE FLAG #1
; DAMAGE FLAG #2, DAMAGE FLAG #3
;FOR EACH ANIMATION ABOVE THERE IS A TABLE COMMANDS TO EXECUTE. THE ANIMATION
;TABLE HAS THE POINTER TO THIS LIST. YOU CAN SHARE LISTS WITH OTHER
;ENEMIES. THE TABLE FORMAT CONSISTS OF COMMAND BYTES FOLLOWED BY
;VARIABLE LENGTH PARAMETERS.
;ALL COMMANDS EXECUTE AT A RATE OF 60 PER SECOND UNLESS THEY CHANGE
;THE ENTITIES MOMENTUM OR ARE TIMING COMMANDS SUCH AS THE DELAY COMMAND
;OR THE FINISH COMMAND. TO ACHEIVE THIS STEADY RATE, YOUR CLOCKPHASE
;VALUE IS USED TO DETERMINE THE NUMBER OF INSTRUCTIONS. THUS IF YOU
;HAVE A 3 PHASE CLOCK YOU WILL EXECUTE 3 INSTRUCTIONS EVERY CYCLE.
;CHANGING TO A 2 PHASE CLOCK WILL CHANGE TO YOU 2 INSTRUCTIONS. THIS
;ALLOWS YOU TO MAKE A CHANGE IN THE CLOCK PHASE WITHOUT SLOWING DOWN
;THE RATE AT WHICH ENTITIES EXECUTE (ALTHOUGH YOU WILL HAVE TO UPDATE
;THEIR MOMENTUM AND DELAY COMMANDS).
;YOU CAN COUNT HOW MANY CYCLES IT WILL TAKE TO GET TO A GIVEN POINT
;BY TAKING YOU CLOCKPHASE VALUE AND COUNTING THAT MANY INSTRUCTIONS
;PER TICK UNLESS A MOMENTUM CHANGE COMMAND IS ENCOUNTERED. WHEN
;SUCH A COMMAND IS ENCOUNTERED, THE EXECUTION IS TERMINATED FOR THAT
;CYCLE. ALSO, SOME COMMANDS SUCH AS FINISH OR DELAY TERMINATE EXECUTION.
;THE DOCUMENTATION FOR EACH COMMAND SIGNALS IF IT IS A TERMINATING
;COMMAND. IF YOU NEED TO SPEED UP EXECUTION OF SOME POINT IN YOUR
;CODE USE THE <INSTRUCTIONS> COMMAND.
;MOMENTUM ONCE APPLIED WILL BE USED TO MOVE THE ENTITY EVERY CLOCKPHASE
;REGARDLESS OF WHICH FLOW CONTROL COMMANDS ARE EXECUTED. NOTE THAT
;FRICTION IS NOT APPLIED UNTIL XFCTR COMPLETE PROCESSING CYCLES ARE APPLIED
;TO THE ENTITY WITHOUT ANY CHANGES TO ITS MOMENTUM. THIS WAS DONE TO
;ALLOW UP TO XFCTR*2 FLOW CONTROL COMMANDS IN THE STREAM BETWEEN MOMENTUM
;APPLICATIONS WITHOUT HAVING FRICTION MAKE THE MOVEMENT JUMPY. BUT YOU
;DO NEED TO MAKE SURE MOMENTUM COMMANDS SUCH AS ADDJOYX ARE NEVER MORE
;THAN XFCTR*2 APART OR FRICTION WILL MAKE THINGS JUMPY.
;BE SURE TO USE THE EQUATES FOR THE COMMANDS AND NOT THE NUMERICAL VALUE.
;ANYTHING SHOWN IN BRACKETS ( <ACTIVATE> ) IN THE DOCUMENTATION IS AN
;EQUATE YOU CAN USE FOR THAT FUNCTION. THE COMMANDS ARE:
;00= <ACTIVATE> ACTIVATE MODE. THIS COMMAND WILL ACTIVATE ANY OF THE
; ANIMATION/MOVEMENT TABLE MODES. FOR INSTANCE:
; ACTIVATE,EWALK WILL ACTIVATE THE WALKING ANIMATION AND MOVEMENT TABLE.
; SINCE ACTIVATE ONLY TAKES AN INDEX RELATIVE TO YOUR ANIMATION/MOVEMENT
; TABLE, YOU COULD EXTEND IT BY ADDING NEW EQUATES THAT SUIT YOUR
; OWN PURPOSES. THEN UNLIKE THE SEQUENCE COMMAND WHICH GOES TO
; AN ABSOLUTE MEMORY LOCATION, YOU COULD SHARE CODE BETWEEN ENTITIES
; SINCE THE FINAL DECISION THAT RESULTS IN AN ACTIVATE WILL BE RELATIVE
; TO THEIR OWN TABLE. FOR INSTANCE, YOU EWALK CODE COULD END UP
; DECIDING ON ONE OF 3 ATTACKS. EACH ENTITY COULD USE THE SAME DECISION
; MAKING WALKING CODE BUT THE ATTACKS COULD BE VERY DIFFERENT IF
; THE CODE ENDED WITH DOING 1 OF 3 ACTIVATES WITH ATTACKS ADDED TO
; THE END OF YOUR OWN LISTS. 1 BYTE FOLLOWS THIS COMMAND:
; 1 BYTE INDEX TO USE
; USE THE FOLLOWING EQUATES TO SPECIFY THE MODE:
;EWAKE = 0 ;WAKE UP.
;EHURT = 10 ;ENTITY HURT
;EFALL = 20 ;FALLING
;ECMD = 30 ;WORLD COMMAND
;EJUMP = 40 ;JUMPING
;EATTACK = 50 ;ATTACKING/SHOOTING
;EDUCK = 60 ;DUCKING (DOWN KEY PRESSED)
;ESTAND = 70 ;STANDING
;EWALK = 80 ;WALKING
; HERE ARE SOME RECOMMENDED EXTENSIONS AND AN EQUATE YOU COULD USE:
;ENEAR = 90 ;FOR A NEAR RANGE ATTACK
;EMIDDLE = 100 ;FOR A MIDDLE RANGE ATTACK
;EFAR = 110 ;FOR A FAR RANGE ATTACK
;ECHARGE = 120 ;FOR A CHARGING ATTACK
;EPOSE = 130 ;A POSE (DELAY) BEFORE AN ATTACK
;EDODGE = 140 ;TO DODGE ATTACKS
;ESHOOT = 150 ;SHOOTING ANIMATION
;NOTES ON ACTIVATE!!! READ THIS:
;1. IF YOU WANT A DUMB ENEMY THAT GOES INTO SOME HARD LOOP, DON'T USE
;ACTIVATE XXXX (SUCH ACTIVATE,EWAKE) BECAUSE IT TAKES TOO MUCH PROCESSOR
;POWER AND (GET THIS!) EACH TIME AN ACTIVATE IS DONE THE ENTITY "RECENTERS"
;ITSELF RELATIVE TO THE OLD SPRITE. THIS RECENTERING MAKES IT MOVE AWAY
;FROM THE RIGHT EDGE IF ITS CENTERLINE IS PAST THE EDGE. THIS CAN MAKE
;YOUR ENEMY REFUSE TO SCROLL OFF THE RIGHT EVEN THOUGH THE BIT TO MAKE
;HIM STAY ON SCREEN IS NOT SET IN ENTITYTAB FLAG BYTE. SO DON'T ACTIVATE
;EXCEPT IF YOU WANT A NEW ANIMATION OR MOVEMENT LIST.
;2. IF YOU ACTIVATE AN ENTRY WITH NO ANIMATION, THE DAMAGE FLAGS ARE ALSO
;NOT RELOADED. SO DON'T TRY TO SET UP A HOT SPOT WITHOUT RENAMING THE
;ANIMATION.
;01 = <RANGE> MOVE EXECUTE POINTER IF TARGET IS IN RANGE (LESS THAN
; DISTANCE). THE ENTITY MUST ALSO BE FACING THE TARGET. IF THE
; ENTITIES MOMENTUM IS ZERO, IT IS CONSIDERED TO BE ALWAYS FACING
; THE TARGET. THE ENTITIES CENTERLINES ARE USED FOR THE X,
; THE BOTTOM PIXEL ROW (ITS FOOT) IS USED FOR THE Y.
; THIS COMMAND IS FOLLOWED BY 4 BYTES:
; 1 WORD NEW POINTER (USED IF TEST PASSES)
; 1 BYTE X RANGE IN PIXELS (USE -1 FOR DON'T CARE)
; 1 BYTE Y RANGE IN PIXELS (USE -1 FOR DON'T CARE)
;02 = <LEDGE> MOVE EXECUTE POINTER IF THERE IS A LEDGE ABOVE. THE CORRECTION
; WILL BE MADE IF A SOLID LEDGE EXISTS ABOVE THE ENTITY WITHIN THE
; HEIGHT SPECIFIED. 3 BYTES FOLLOW THIS COMMAND:
; 1 WORD NEW POINTER
; 1 BYTE NUMBER OF ROWS TO CHECK ABOVE THE ENEMIES FEET.
; BE CAREFUL, IT USES LOTS OF PROCESSOR POWER.
;
;03 = <PRECIPICE> MOVE EXECUTE POINTER IF THERE IS A PRECIPICE IN THE
; ENEMIES FACING DIRECTION. IF A HOLE IN THE CURRENT SOLID THAT THE
; ENTITY IS STANDING ON EXISTS IN THE DIRECTION THE ENTITY IS
; TRAVELING THE EXECUTE POINTER IS MOVED. MOMENTUM FOR THE
; ENTITY WILL BE USED TO INTERPRET THE DIRECTION, NEGATIVE VALUES
; WILL CHECK TO THE LEFT, PLUS TO THE RIGHT. THE CHECK FOR A PRECIPICE
; IS MADE AS FOLLOWS; A PHANTOM COPY OF THE ENTITY IS PLACED RIGHT
; UP AGAINST THE ENTITIES EDGE IN THE DIRECTION OF TRAVEL PLUS
; THE AMOUNT YOU SPECIFY IN THE 3RD BYTE. IT IS PLACED 2 PIXELS
; DOWN. IF NO SOLID IS FOUND IN THAT AREA THE EXECUTE POINTER IS
; MOVED. OTHERWISE EXECUTION CONTINUES WITH THE NEXT INSTRUCTION.
; THE ENTITY IS NOT MOVED AS A RESULT OF THIS COMMAND.
; 3 BYTES FOLLOWS THIS COMMAND:
; 1 WORD NEW POINTER
; 1 BYTE AMOUNT TO ADD TO DIRECTION OF TRAVEL SHIFT
;
; RECOMMENDED USAGE: IF YOU ARE WALKING 16 OR MORE (MOMENTUM)
; IN THE DIRECTION OF TRAVEL IT IS SUGGESTED THAT YOU USE
; A 1 BYTE AMOUNT OF 8 AND WHEN THE PRECIPICE IS TRUE, SET THE
; THE MOMENTUM DOWN TO 8 WALKING IN THAT DIRECTION (SO THAT YOU DON'T
; OVERSHOOT THE PRECIPICE). MAKE THE JUMP BASED ON A BYTE VALUE OF
; 0 HOWEVER. THE NON-ZERO 1 BYTE AMOUNT SHOULD ONLY BE A SLOW DOWN
; FLAG. ITS NOT A GOOD IDEA TO DO AN ACTUAL JUMP ACROSS THE
; PRECIPICE BASED ON A NON-ZERO VALUE BECAUSE AN AREA SURROUNDED
; WITH A SINGLE SOLID IN FRONT OF YOU BUT FILLED WITH NON-SOLID CAN
; LOOK LIKE A PRECIPICE.
;04 = <SKIP> SKIP (MOVE) EXECUTE POINTER. THIS COMMAND IS FOLLOWED BY A
; 1 WORD NEW OFFSET IN MEMORY TO EXECUTE FROM. USE THE ASSEMBLERS
; ABILITY TO SET A WORD TO THE VALUE OF A LABEL TO FIND THE VALUE.
;05 = <RANDOM> MOVE EXECUTE POINTER RANDOM NUMBER IS BELOW A VALUE.
; THE RANDOM NUMBER GENERATOR HAS VALUES 0-255. 3 BYTES FOLLOW THIS
; COMMAND:
; 1 WORD NEW POINTER
; 1 BYTE RANDOM NUMBER TO BE BELOW (0-255)
;06 = <MOMLIMIT> SET MOMENTUM LIMIT. YOU MAY ESTABLISH A NEW VALUE UP TO
; 126. 64 IS THE RECOMMENDED MAXIMUM OR ELSE YOU MIGHT BE ABLE TO
; PASS THROUGH SINGLE HIGH SOLIDS. 2 BYTES FOLLOW THIS COMMAND:
; 1 BYTE NEW X MOMENTUM LIMIT OR <REGISTER> OR -1 = NO CHANGE
; 1 BYTE NEW Y MOMENTUM LIMIT OR <REGISTER> OR -1 = NO CHANGE
; IF YOU WANT A MOMLIMIT OF 0 YOU MUST LOAD REGISTER.
;07 = <DELAY> DELAY. A DELAY SUSPENDS EXECUTION OF FURTHER COMMANDS
; BUT DURING THIS SUSPENSION THE CURRENT MOMENTUM IS USED
; AND GRAVITY IS APPLIED. 1 BYTE FOLLOWS THIS COMMAND:
; 1 BYTE TIME IN 1/15 SECOND INTERVALS TO DELAY. 1 IS MINIMUM.
; IF 0 <REGISTER> IS USED AS DELAY TIME.
;08 = <ADDMOM> ADD TO MOMENTUMS. THIS COMMAND ALLOWS YOU TO ADD A VALUE
; TO THE X OR Y MOMENTUM. THE SIGN OF YOUR VALUE WILL BE ADJUSTED
; ACCORDING TO YOUR TRACKING YOU HAVE SELECTED WITH XTRACK OR YTRACK
; IN CONJUNCTION WITH THE TARGET COMMAND. 2 BYTES FOLLOW THIS
; COMMAND:
; 1 BYTE VALUE TO ADD TO X AXIS MOMENTUM (0=NO CHANGE).
; 1 BYTE VALUE TO ADD TO Y AXIS MOMENTUM (0=NO CHANGE).
;
; SAMPLE USAGE: .byte ADDMOM,4,0 ;SLOWLY ACCELERATES X MOMENTUM.
;
;09 = <GRAVITY> SPECIFY GRAVITY (Y AXIS ONLY). YOU CAN TURN GRAVITY OFF WITH
; A VALUE OF 0. 1 BYTE FOLLOWS THIS COMMAND:
; 1 BYTE NEW GRAVITY VALUE (RECOMMENDED 8 TO 32)
; USE -1 TO PUT BACK THE DEFAULT VALUE.
;0A = <SOLIDSTATE> SET SOLID STATE. USE THIS COMMAND TO TEMPORARILY SUSPEND SOLID
; CHECKING. USUALLY USED DURING A JUMP. THIS COMMAND WILL IMMEDIATLY
; TURN SOLID CHECKING OFF OR ON BUT WHEN TURNING IT ON IT IS RECOMMENDED
; TO USE THE CONDITIONAL TURN ON OR ELSE YOUR ENTITY MIGHT GET STUCK
; IN SOLIDS. 1 BYTE FOLLOWS THIS COMMAND:
; 0 = <REGISTER> TO USE THE REGISTER'S CONTENTS
; -1 = <OFF> TURN OFF SOLID CHECKING
; 1 = <ON> TURN ON SOLID CHECKING
; 2 = <SAFE> TURN ON SOLID CHECKING AS SOON AS ITS SAFE (NOT
; OVER SOLID). EXECUTING THIS COMMAND WHILE THE ENTITY IS
; STANDING ON A SOLID RAMP ABOVE A LOWER RAMP WILL CAUSE
; HIM TO FALL TO THE LOWER ONE.
; ANY OTHER VALUE = A NEW SOLID CHAR VALUE TO BE USED.
;
; IF YOU WANT TO BE ABLE TO JUMP UP THROUGH ALL SOLIDS DO THE FOLLOWING:
; 1. ISSUE AN INSTRUCTIONS,2 COMMAND, DO SOLIDSTATE,OFF FOLLOWED
; BY SOME UPWARDS MOMENTUM.
; 2. WHEN YOU REACH THE TOP OF THE UPWARD MOMENTUM, DO SOLIDSTATE,SAFE.
; 3. MAKE ABSOLUTELY SURE THAT YOU TURN SOLIDSTATE,SAFE AT THE TOP
; OF YOUR JUMP AND THAT ANY INTERRUPTING ROUTINE SUCH AS HURT DOES
; THE SAME JUST TO MAKE SURE. ITS ALWAYS SAFE TO DO SOLIDSTATE,SAFE
; EVEN IF THEY WERE ON. BUT IF YOU INTERRUPT AND YOUR CODE FAILS TO
; DO SAFE, YOU WILL FALL OFF SCREEN BOTTOM.
;
; IF YOU WANT TO BE ABLE TO JUMP UP THROUGH SOME BUT NOT OTHERS
; DO THE FOLLOWING:
; 1. ISSUE AN INSTRUCTIONS,2 COMMAND, DO SOLIDSTATE,$XX USING
; THE VALUE OF SOLID THAT NEVER GOES OFF. THEN DO SOME UPWARDS
; MOMENTUM.
; 2. WHEN YOU REACH THE TOP, DO INSTRUCTIONS,2 FOLLOWED BY
; SOLIDSTATE,$xx AND THEN SOLIDSTATE,SAFE. xx IS THE VALUE OF
; SOLID THAT CAN BE JUMPED THROUGH.
; 3. RULE 3 FROM ABOVE APPLIES JUST AS MUCH.
;
;0B = <IDENTIFY> SPECIFY ENTITY TARGET LEVEL. THIS COMMAND IS USED TO ASSIGN
; THIS ENTITY TO A SPECIFIC LEVEL FOR THE TARGET COMMANDS. THERE ARE
; UP TO 16 LEVELS (BITS). YOU SPECIFY A WORD VALUE HERE WITH BIT(S)
; SET FOR THE LEVEL(S) YOU WISH TO BE ASSOCIATED WITH. THEN
; THE SPECIFY TARGET COMMAND IS USED BY OTHER ENTITIES TO DETECT
; OR IGNORE THE PRESENSE OF YOUR TARGET LEVEL. FOR INSTANCE, YOU
; COULD ASSIGN THE HERO ENTITY TO LEVEL 0001. THEN ENTITIES
; CONSIDERED "ENEMIES" COULD SPECIFY A TARGET OF 0001 OR ANY
; OTHER VALUE WITH BIT 0001 SET AND THEY WOULD CONSIDER YOUR
; HERO ENTITY SOMETHING TO TRACK. AT WAKE UP, THIS VALUE IS
; SET TO 0. 1 WORD FOLLOWS THIS COMMAND:
; 1 WORD IDENTIFICATION LEVEL
;
; SOME RECOMMENDED BIT POSITIONS ARE DEFINED BELOW ALONG
; WITH EQUATE NAMES TO USE IF YOU WANT TO TARGET ONLY THEM.
; WARNING!!!! ITS EASY TO FORGET THAT THE VALUE FOLLOWING THIS
; COMMAND MUST BE A .word !!!!
;
; 0001 = <HERO0> HERO 0
; 0002 = <HERO1> HERO 1
; 0004 = <ENEMY> ENEMY WHO ATTACKS HEROS
; 0008 = <HELPER> ENEMY WHO ATTACKS ALL BUT HEROS
; 0010 = <BENIGN> ENTITY WHO ATTACKS ONLY THOSE WHO ATTACK HIM
; 0020 = <HARMLESS> ATTACKABLE ANIMAL OR PERSON WHO NEVER ATTACKS
; 0040 = <KILLER> ENEMY WHO ATTACKS ANYTHING DEFINED ABOVE
; 0080 = <DEADLY> UNKILLABLE OBJECT THAT WILL KILL IF CONTACTED (BOMB)
; 0100 = <BULLET0> HERO 0'S PROJECTILE (HERO BULLET)
; 0200 = <BULLET1> HERO 1'S PROJECTILE
; 0400 = <BULLET> ENEMIES PROJECTILE (ENEMY BULLET)
; 0800 = <PLATFORM> TRANSPORT PLATFORM
; 1000 = <HEART> HEALTH OR FUEL
; 2000 = <PRIZE> PRIZE
; 4000 = <SUPPLY> PROJECTILE SUPPLY (BULLETS, BOMBS, ETC)
;THE FOLLOWING BIT IS HARD CODED INTERNALLY TO REFER TO THE LAST ENTITY
;WHO ATTACKED YOU AND INFLICTED DAMAGE. IT SHOULD NEVER BE USED IN
;THIS COMMAND (LEAVE IT OFF). IT IS USED ONLY IN THE SPECIFY TARGET
;COMMAND (9C) AND TAKES PRIORITY OVER ALL OTHER BITS.
; 8000 = <ASSAILANT> LAST ENTITY THAT ATTACKED THIS ENTITY
;0C = <TARGET> SPECIFY TARGET. THIS COMMAND IS USED TO SPECIFY THE "TARGET"
; LEVEL THAT THE ENTITY TRACK AND RANGE COMMANDS WILL TEST.
; AT WAKE UP THE TARGET IS SET TO A VALUE OF 0 (NO TARGET).
; 1 WORD FOLLOWS THIS COMMAND AND BITS ARE SET HERE TO DETECT
; THE DESIRED TARGET. SEE COMMAND 1B.
; FOR MORE COMPLEX TARGETING YOU CAN USE AN "OR" (|) TO ADD THEM
; UP. FOR INSTANCE:
; .byte TARGET
; .word HERO0 | HERO1 | BENIGN
;0D = <XTRACK> SPECIFY X TARGET TRACKING. THIS COMMAND CAUSES ALL X MOMENTUM
; COMMANDS (WHEN EXECUTED, NOT AFTER STORAGE) TO BE SIGN CORRECTED
; ACCORDING TO THE DIRECTION OF THE DEFINED TARGET. 1 BYTE
; FOLLOWS THIS COMMAND:
; 0=<NONE> NO TRACKING AT ALL
; 1=<TOWARDS> TRACK TOWARDS TARGET (ATTEMPTS TO ALIGN THIS
; ENTITIES CENTER WITH THE TARGET ENTITIES CENTER)
; 2=<AWAY> TRACK AWAY FROM TARGET
; 3=<ORIGIN> TRACK TOWARDS LAUNCHING COLUMN. IF THIS ENTITY
; WAS LAUNCHED BY ANOTHER ENTITY, YOU WILL GO RIGHT.
;0E = <YTRACK> SPECIFY Y TARGET TRACKING. 1 BYTE FOLLOWS THIS COMMAND:
; 0=<NONE> NO TRACKING AT ALL
; 1=<TOWARDS> TRACK TOWARDS TARGET (ATTEMPTS TO ALIGN THIS
; ENTITIES FEET WITH THE TARGET ENTITIES FEET).
; 2=<AWAY> TRACK AWAY FROM TARGET
; <ORIGIN> UNAVAILABLE ON YTRACK AT THIS TIME
;0F = <WORLD> REQUEST WORLD (FOR WHEN A SPECIAL ENTITY IS KILLED). 1 BYTE
; FOLLOWS THIS COMMAND:
; 1 BYTE WORLD NUMBER TO REQUEST. USE:
; 1-254 FOR A WORLD FROM USE_BACK
; -1 FOR THE BOOT SCREEN
; 0 <REGISTER> FOR THE ENTITIES REGISTER.
;
;10 = <JOYSTICK> GRAB JOYSTICK (#0 OR 1). 1 BYTE FOLLOWS THIS COMMAND,
; THE JOYSTICK NUMBER TO GRAB. THE JOYSTICK'S MOMENTUM IS NOT
; ZEROED SO USE THE ZERO JOYSTICK MOMENTUM COMMAND. ONCE A JOYSTICK
; IS GRABBED, THIS ENTITY WILL BE UNDER ITS CONTROL AS FOLLOWS:
; 1. BUTTON A WILL ACTIVATE YOUR JUMPING MODE AND THE RESUME
; COMMAND WILL BE ENABLED.
; 2. BUTTON B WILL ACTIVATE YOUR ATTACKING MODE AND THE RESUME
; COMMAND WILL BE ENABLED.
; IT IS RECOMMENDED THAT YOU DECIDE WHICH OF THE ATTACKS IF
; ANY TO USE OR DECIDE TO SHOOT. THE RESUME COMMAND
; WILL RETURN YOU TO THE EXECUTE POINT PREVIOUS TO THE
; BUTTON PRESS (COMMAND 27). IT IS RECOMMENDED THAT
; YOUR ATTACK ROUTINE USE AN ANIMATION PTR OF -1 TO
; PREVENT THE TEMPORARY SELECTION OF AN ANIMATION WHICH
; WILL BE DISCARDED IN FAVOR OF THE ONE YOUR CODE DECIDES
; ON (IT WOULD PUT UP SHOOT BUT YOU MIGHT DECIDE TO
; ATTACK).
; 3. BUTTON DOWN WILL ACTIVATE YOUR DUCKING MODE IF YOU ARE
; STANDING ON SOLID.
; 4. WORLD COMMAND MODE WILL BE ACTIVATED IF YOU STEP ONTO A
; WORLD COMMAND IN THE PROPER ROWS. (STANDARD FOR ALL
; ENTITIES REGARDLES OF JOYSTICK IF THE BIT IS SET).
; 5. FALLING WILL BE ACTIVATED IF YOUR ENTITY TRAVELS IN
; THE GRAVITY DIRECTION WITH NO SOLID UNDERNEITH. ITS
; THEN SHUT OFF UNTIL THE ENTITY STANDS ON SOLID AGAIN.
; (STANDARD FOR ALL ENTITIES REGARDLESS OF JOYSTICK CONTROL).
; 5. SCORE 0 WILL BE UPDATED WHEN AN ENTITY IS KILLED BY
; THE ENTITY UNDER JOYSTICK 0s CONTROL. SCORE 1 WILL
; BE UPDATED WHEN AN ENTITY IS KILLED BY THE ENTITY UNDER
; JOYSTICK 1s CONTROL. DAMAGE TO EITHER ENTITY WILL
; BE REFLECTED IN THE APPROPRIATE HEALTH STATUS BAR.
; SCREEN SCROLL WILL BE ADJUSTED ACCORDING TO THE DEMANDS
; OF THESE ENTITIES.
;
;11 = <ADDJOYX> ADD JOYSTICK X MOMENTUM. THE CURRENTLY STORED X AXIS
; JOYSTICK MOMENTUM WILL BE ADDED TO YOUR ENTITIES X MOMENTUM,
; HIS Y WILL NOT BE CHANGED. TRACKING WILL NOT EFFECT THE VALUE,
; THE JOYSTICK ARROW KEY PRESSED CONTROLS THE SIGN OF THE MOMENTUM.
; THE JOYSTICK MOMENTUM WILL BE ZEROED AFTER USAGE.
;12 = <ADDJOYY> ADD JOYSTICK Y MOMENTUM. SAME AS ADDJOYX BUT IT
; WORKS WITH THE Y MOMENTUM.
;13 = <ZEROJOYX> ZERO JOYSTICK X MOMENTUM
;14 = <ZEROJOYY> ZERO JOYSTICK Y MOMENTUM
;15 = <BUTTON> MOVE EXECUTE POINTER IF ANY JOYSTICK BITS ARE SET.
; SEE <NOTBUTTON>. 3 BYTES FOLLOW THIS COMMAND:
; 1 WORD NEW POINTER
; 1 BYTE BITS TO BE SET:
; <A_BUTTON>
; <B_BUTTON>
; <SELECT>
; <START>
; <UP>
; <DOWN>
; <LEFT>
; <RIGHT>
;EXAMPLE: UP|DOWN = UP OR DOWN SET.
;16 = <SEQUENCE> ACTIVATE ANIMATION SEQUENCE AND OPTIONS. THIS CAN BE USED
; TO EXTEND THE SIZE OF YOUR TABLE BEYOND THE NUMBER OF ENTRIES
; IT ALREADY CONTAINS.
;
; A POINTER FOLLOWS THIS COMMAND AND IT POINTS TO A STRUCTURE
; WITH THE SAME FORMAT AS THE STRUCTURE
; USED IN THE ANIMATION/MOVEMENT LIST:
;
; 1 WORD PTR THAT POINTS TO:
; 1 WORD ANIMATION SEQUENCE (OR -1)
; 1 WORD MOVEMENT LIST (OR -1)
; INIT FLAG, DAMAGE FLAG #1
; DAMAGE FLAG #2, DAMAGE FLAG #3
; DAMAGE FLAG #4, DAMAGE FLAG #5
;17 = <RESUME> RESUME PREVIOUS COMMAND. THIS COMMAND CAN BE USED TO IGNORE
; AN EXTERNAL (JOYSTICK OR ENTITY ATTACK) REQUEST TO ACTIVATE
; A GIVEN MODE. IT IS IGNORED IF WE ARE NOT CURRENTLY IN A
; MODE REQUESTED EXTERNALLY. USE THIS IN COMBINATION WITH SETTING THE
; ANIMATION TO -1 AND POINT YOUR MOVEMENT LIST TO A DECISION
; MAKING DATA STREAM WHICH USES COMMAND 26 TO ACTIVATE THE DESIRED
; ANIMATION OR MODE OR ELSE USES COMMAND 27 (THIS COMMAND) TO
; IGNORE THE REQUEST.
;
; RESUME WILL RESTORE THE DELAY COUNTER PRIOR TO THE INTERRUPTION
; AND IT RESTORES THE INTERRUPT STATE PRIOR TO THE INTERRUPTS. AT
; THE START OF ANY INTERRUPT (JUMP, ATTACK, DUCK, ETC) ALL INTERRUPTS
; ARE DISABLED BECAUSE THERE IS ONLY 1 RESUME POINTER. IT WOULD
; BE A PROBLEM IF YOU CODE WERE MAKING A DECISION TO RESUME AND
; ANOTHER INTERRUPT INTERCEDED THUS ERASING YOUR NEEDED RESUME POINTER.
; FOR THIS REASON, BE CAREFUL WITH RESUMES. YOU SHOULD ALWAYS THINK
; ABOUT WHAT WOULD HAPPEN IF AN INTERRUPT TOOK PLACE BEFORE YOUR
; RESUME COMMAND AND REMEMBER THAT INTERRUPTS ARE DISABLED AT THE
; START OF AN INTERRUPTING ROUTINE. ALSO REMEMBER THAT YOUR
; REGISTER IS NOT SAVED DURING AN INTERRUPT. YOU SHOULD NOT USE
; IT IF YOU ARE GOING TO RESUME BECAUSE YOU'LL CHANGE ITS CONTENTS.
;
; AFTER THE RESUME IS ISSUED, CLOCKPHASE MORE COMMANDS ARE EXECUTED
; AT THE RESUME POINT. THIS IS DONE TO KEEP FROM LOCKING OUT
; YOUR OTHER CODE IN CASES SUCH AS A WORLD COLUMN COMMAND. THUS
; IF YOUR CLOCKPHASE IS 3 THEN 3 COMMANDS WILL BE EXECUTED AFTER
; YOUR RESUME.
;
; HERE IS A RULE YOU MUST FOLLOW!!!: INTERRUPTS MUST REMAIN DISABLED
; FROM THE START OF AN INTERRUPTING ROUTINE UNTIL ANY POINT WHERE
; A RESUME MIGHT TAKE PLACE. OTHERWISE, JUST BEFORE YOUR RESUME IS
; EXECUTED AN INTERRUPTING ROUTINE MIGHT DESTROY THE RESUME POINT
; AND WHEN YOU FINALLY DID HIT THAT RESUME YOU'D BE IN AN ENDLESS
; LOOP.
;18 = <DING> DING. USED TO MAKE A DING FOR DEBUGGING.
;19 = <FINISH> WAIT FOR ANIMATION TO FINISH AND FREEZE. USE THIS FOR
; AUTOFREEZE ANIMATIONS SUCH AS ATTACKS THAT YOU WANT TO WAIT TO
; COMPLETE VISUALLY BEFORE CONTINUING. IT IS RECOMMENDED THAT YOU
; USE THE DELAY COMMAND AFTER THIS FOR A DURATION OF 2 TO INSURE
; THAT THE LAST FRAME OF THE ANIMATION WAS UP LONG ENOUGH TO SEE. OR
; ADD AN EXTRA FRAME TO THE END THAT SHOWS THE SAME FRAME.
;1A = <SETCOUNTER> SET COUNTER. THE COUNTER WILL TICK DOWN AT THE RATE OF
; 1/15 SECOND AND STOP AT 0. IF YOU CHANGE CLOCKPHASE TO 1/30 SECOND,
; YOUR COUNTER (AND ALTERNATE) WILL RUN AT THE NEW SPEED.
; 1 BYTE FOLLOWS THIS COMMAND:
; 1 BYTE COUNTER VALUE. USE 0 <REGISTER> IF YOU WANT TO GET
; THE LOW BYTE OF THE REGISTER. IF YOU ACTUALLY WANTED TO CLEAR
; THE COUNTER, PUT 1 HERE AND IT WILL BE CLEAR NEXT CYCLE.
;1B = <COUNT> MOVE EXECUTE POINTER IF COUNTER IS BELOW OR EQUAL TO A
; SPECIFIED VALUE. SEE <ABOVECOUNT> 3 BYTES FOLLOW THIS COMMAND:
; 1 WORD NEW POINTER
; 1 BYTE COUNTER VALUE TO BE BELOW.
;
;1C = <FRICTION> SPECIFY FRICTION. FRICTION VALUES SHOULD BE + AND SMALL