-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathConstants.asm
More file actions
2591 lines (2363 loc) · 104 KB
/
Constants.asm
File metadata and controls
2591 lines (2363 loc) · 104 KB
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
; >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
; Equates section - Names for variables.
Max_Rings = 511 ; default. maximum number possible is 759
if Max_Rings > 759
fatal "Maximum number of rings possible is 759"
endif
Rings_Space = (Max_Rings+1)*2
; ---------------------------------------------------------------------------
; size variables - you'll get an informational error if you need to change these...
; they are all in units of bytes
Size_of_DAC_samples = $1F44D
Size_of_Snd_driver_guess = $1500 ; approximate post-compressed size of the Z80 sound driver
; ---------------------------------------------------------------------------
; Object Status Table offsets (for everything between Object_RAM and Primary_Collision)
; ---------------------------------------------------------------------------
; universally followed object conventions:
inertia = $1C
anim_frame_duration = $24
next_anim = $21
speedshoes_time = $36
invincibility_time = $35
invulnerable_time = $34
spindash_flag = $3D
pinball_mode = $3D
flip_turned = $2D
spindash_counter = $3E
restart_countdown = spindash_counter
respawn_index = $48
peelout_flag = $5D
peelout_counter = $20 ;word
;.....///////////////////////////..........
; ---------------------------------------------------------------------------
; Object Status Table offsets (for everything between Object_RAM and Primary_Collision)
; ---------------------------------------------------------------------------
; universally followed object conventions:
id = 0 ; object ID (if you change this, change insn1op and insn2op in s2.macrosetup.asm, if you still use them)
render_flags = 4 ; bitfield
; Render flags. The bitfield looks like this:
; Bit 0 is the horizontal mirror flag. If set, the object will be flipped on its horizontal axis.
; Bit 1 is the vertical mirror flag.
; Bits 2 and 3 are the coordinate system flags. If both bits are clear, the object will be positioned by absolute screen coordinates. This is used for things like the HUD and menu options. If either bit is set, the object will be positioned by the playfield coordinates, i.e. where it is in a level.
; Bit 4 is the assume pixel height flag. If clear, the pixel height of each object is assumed to be 32 pixels, otherwise the y-radius of the object (byte $16 of its status table) is also taken to be its pixel height.
; Bit 5 is the static mappings flag. If set, this indicates that the mappings pointer for this object points directly to the pieces data for this frame, and implies that the object consists of only one sprite piece.
; Bit 6 is the compound sprites flag. If set, this indicates that the current object's status table also contains information about other child sprites which need to be drawn using the current object's mappings, and also signifies that certain bytes of its status table have different meanings:
; Byte $B is the mapping frame to display.
; Byte $E is the pixel width of the object.
; Byte $14 is the pixel height of the object.
; Byte $F is the number of child sprites to draw.
; From byte $10 onwards is the actual data for each child sprite. The format is six bytes per sprite: the first word is the base X position, the next word is the base Y position, the next byte is ignored and the last byte is the mapping frame to display.
; Bit 7 is the on-screen flag. It will be set if the object is on-screen, and clear otherwise
height_pixels = 6 ; byte
width_pixels = 7 ; byte
priority = 8 ; word ; in units of $80
art_tile = $A ; word ; PCCVH AAAAAAAAAAA ; P = priority, CC = palette line, V = y-flip; H = x-flip, A = starting cell index of art
mappings = $C ; long
x_pos = $10 ; word, or long when extra precision is required
y_pos = $14 ; word, or long when extra precision is required
x_sub = $12 ; and
y_sub = $16 ; and $F
mapping_frame = $22 ; byte
; ---------------------------------------------------------------------------
; conventions followed by most objects:
routine = 5 ; byte
x_vel = $18 ; word
y_vel = $1A ; word
y_radius = $1E ; byte ; collision height / 2
x_radius = $1F ; byte ; collision width / 2
anim = $20 ; byte
prev_anim = $21 ; byte ; when this isn't equal to anim the animation restarts
anim_frame = $23 ; byte
anim_frame_timer = $24 ; byte
angle = $26 ; byte ; angle about axis into plane of the screen (00 = vertical, 360 degrees = 256)
status = $2A ; bitfield ; refer to SCHG for details
; ---------------------------------------------------------------------------
; conventions followed by many objects but not Sonic/Tails/Knuckles:
x_pixel = x_pos ; word ; x-coordinate for objects using screen positioning
y_pixel = y_pos ; word ; y-coordinate for objects using screen positioning
collision_flags = $28 ; byte ; TT SSSSSS ; TT = collision type, SSSSSS = size
collision_property = $29 ; byte ; usage varies, bosses use it as a hit counter
shield_reaction = $2B ; byte ; bit 3 = bounces off shield, bit 4 = negated by fire shield, bit 5 = negated by lightning shield, bit 6 = negated by bubble shield
subtype = $2C ; byte
ros_bit = $3B ; byte ; the bit to be cleared when an object is destroyed if the ROS flag is set
ros_addr = $3C ; word ; the RAM address whose bit to clear when an object is destroyed if the ROS flag is set
routine_secondary = $3C ; byte ; used by monitors for this purpose at least
vram_art = $40 ; word ; address of art in VRAM (same as art_tile * $20)
parent = $42 ; word ; address of the object that owns or spawned this one, if applicable
child_dx = $42 ; byte ; X offset of child relative to parent
child_dy = $43 ; byte ; Y offset of child relative to parent
parent3 = $46 ; word ; parent of child objects
parent2 = $48 ; word ; several objects use this instead
respawn_addr = $48 ; word ; the address of this object's entry in the respawn table
; ---------------------------------------------------------------------------
; conventions specific to Sonic/Tails/Knuckles:
ground_vel = $1C ; word ; overall velocity along ground, not updated when in the air
double_jump_property = $25 ; byte ; remaining frames of flight / 2 for Tails, gliding-related for Knuckles
flip_angle = $27 ; byte ; angle about horizontal axis (360 degrees = 256)
status_secondary = $2B ; byte ; see SCHG for details
air_left = $2C ; byte
flip_type = $2D ; byte ; bit 7 set means flipping is inverted, lower bits control flipping type
object_control = $2E ; byte ; bit 0 set means character can jump out, bit 7 set means he can't
double_jump_flag = $2F ; byte ; meaning depends on current character, see SCHG for details
flips_remaining = $30 ; byte
flip_speed = $31 ; byte
move_lock = $32 ; word ; horizontal control lock, counts down to 0
invulnerability_timer = $34 ; byte ; decremented every frame
invincibility_timer = $35 ; byte ; decremented every 8 frames
speed_shoes_timer = $36 ; byte ; decremented every 8 frames
status_tertiary = $37 ; byte ; see SCHG for details
character_id = $38 ; byte ; 0 for Sonic, 1 for Tails, 2 for Knuckles
scroll_delay_counter = $39 ; byte ; incremented each frame the character is looking up/down, camera starts scrolling when this reaches 120
next_tilt = $3A ; byte ; angle on ground in front of character
tilt = $3B ; byte ; angle on ground
stick_to_convex = $3C ; byte ; used to make character stick to convex surfaces such as the rotating discs in CNZ
spin_dash_flag = $3D ; byte ; bit 1 indicates spin dash, bit 7 indicates forced roll
spin_dash_counter = $3E ; word
jumping = $40 ; byte
interact = $42 ; word ; RAM address of the last object the character stood on
default_y_radius = $44 ; byte ; default value of y_radius
default_x_radius = $45 ; byte ; default value of x_radius
top_solid_bit = $46 ; byte ; the bit to check for top solidity (either $C or $E)
lrb_solid_bit = $47 ; byte ; the bit to check for left/right/bottom solidity (either $D or $F)
;=============================================================================
;some sonic 3 equs that match sonic 2
;=============================================================================
;ground_vel = inertia
obj_control = $2E
Sprite_table_buffer = Sprite_Table
Sprite_table_input = Sprite_Table_Input
Current_zone = Current_Zone
;Sprites_drawn = Sprite_count
;============================================================================
;some sonic 1 equs that match sonic 2
;============================================================================
ob2ndRout = routine_secondary
obVelX = x_vel
obVelY = y_vel
;============================================================================
LastLoadedDPLC = $34
Art_Address = $38
DPLC_Address = $3C
; ---------------------------------------------------------------------------
; conventions followed by some/most bosses:
boss_subtype = $12 ;$12
boss_invulnerable_time = $13 ;$13
boss_sine_count = mapping_frame ;$1A ;mapping_frame
boss_routine = $26 ;angle
boss_defeated = $45
boss_hitcount2 = $42
boss_hurt_sonic = $44 ; flag set by collision response routine when sonic has just been hurt (by boss?)
; ---------------------------------------------------------------------------
; Player Status Variables
Status_Facing = 0
Status_InAir = 1
Status_Roll = 2
Status_OnObj = 3
Status_RollJump = 4
Status_Push = 5
Status_Underwater = 6
; Elemental Shield DPLC variables
;LastLoadedDPLC = $34
;Art_Address = $38
;DPLC_Address = $3C
; ---------------------------------------------------------------------------
; when childsprites are activated (i.e. bit #6 of render_flags set)
; BUGS
;mainspr_mapframe = x_sub+1
;mainspr_width = width_pixels
;mainspr_height = height_pixels
;mainspr_childsprites = y_sub+1 ; amount of child sprites
;-----------------------------------------------------------------------------
mainspr_mapframe = $16 ;$12 ; also these varables also work but i decided to use that insted
mainspr_width = width_pixels ;$13
mainspr_height = height_pixels ;$16
mainspr_childsprites = $17 ; amount of child sprites
mainspr_childsprites_S3K = $16
;------------------------------------------------------------------------------
sub2_x_pos = $18 ;x_vel
sub2_y_pos = $1A ;y_vel
sub2_mapframe = $1D
sub3_x_pos = $1E ;y_radius
sub3_y_pos = $20 ;anim
sub3_mapframe = $23 ;anim_frame
sub4_x_pos = $24 ;anim_frame_timer
sub4_y_pos = $26 ;angle
sub4_mapframe = $29 ;collision_property
sub5_x_pos = $2A ;status
sub5_y_pos = $2C ;subtype
sub5_mapframe = $2F
sub6_x_pos = $30
sub6_y_pos = $32
sub6_mapframe = $35
sub7_x_pos = $36
sub7_y_pos = $38
sub7_mapframe = $3B
sub8_x_pos = $3C
sub8_y_pos = $3E
sub8_mapframe = $41
sub9_x_pos = $42
sub9_y_pos = $44
sub9_mapframe = $47
next_subspr = $6
; ---------------------------------------------------------------------------
objoff_12 = 2+x_pos;$12 ; note: x_pos can be 4 bytes, but sometimes the last 2 bytes of x_pos are used for other unrelated things
objoff_13 = $13 ;3+x_pos ; unused
objoff_14 = $14 ;2+y_pos ; unused
objoff_15 = $15 ;3+y_pos ; unused
objoff_23 = $23
objoff_2B = $2B
objoff_2C = $2C ; overlaps subtype, but a few objects use it for other things anyway
;enum objoff_29_s2=$2D,objoff_2A_s2=$2E,objoff_2B_s2=$2F,objoff_2C_s2=$30,objoff_2D_s2=$31,objoff_2E_s2=$32,objoff_2F_s2=$33
;enum objoff_30_s2=$34,objoff_31_s2=$35,objoff_32_s2=$36,objoff_33_s2=$37,objoff_34_s2=$38,objoff_35_s2=$39,objoff_36_s2=$3A,objoff_37_s2=$3B
;enum objoff_38_s2=$3C,objoff_39_s2=$3D,objoff_3A_s2=$3E,objoff_3B_s2=$3F,objoff_3C_s2=$40,objoff_3D_s2=$41,objoff_3E_s2=$42,objoff_3F_s2=$43
;enum objoff_44=$44,objoff_45=$45,objoff_46=$46,objoff_47=$47,objoff_48=$48,objoff_49=$49
enum objoff_2D=$2D,objoff_2E=$2E,objoff_2F=$2F,objoff_30=$30,objoff_31=$31,objoff_32=$32,objoff_33=$33 ; done
enum objoff_34=$34,objoff_35=$35,objoff_36=$36,objoff_37=$37,objoff_38=$38,objoff_39=$39,objoff_3A=$3A,objoff_3B=$3B
enum objoff_3C=$3C,objoff_3D=$3D,objoff_3E=$3E,objoff_3F=$3F,objoff_40=$40,objoff_41,objoff_42=$42,objoff_43=$43,objoff_44=$44,objoff_46=$46,objoff_48=$48
; ---------------------------------------------------------------------------
; Special Stage object properties:
ss_dplc_timer = $25 ;s2 => 23
SSTestRoutineSec = angle+1 ;flag for your hurt state
ss_x_pos = objoff_2C
ss_x_sub = objoff_2E
ss_y_pos = objoff_30
ss_y_sub = objoff_32
ss_init_flip_timer = objoff_34
ss_flip_timer = objoff_35
ss_z_pos = objoff_36
ss_hurt_timer = objoff_3A
ss_slide_timer = objoff_3B
ss_parent = objoff_3C
ss_rings_base = objoff_3E ; word
ss_rings_hundreds = objoff_3E
ss_rings_tens = objoff_3F
ss_rings_units = objoff_40
ss_last_angle_index = objoff_41
; ---------------------------------------------------------------------------
; property of all objects:
object_size = $4A ; the size of an object
next_object = object_size
; ---------------------------------------------------------------------------
; Bits 3-6 of an object's status after a SolidObject call is a
; bitfield with the following meaning:
p1_standing_bit = 3
p2_standing_bit = p1_standing_bit + 1
p1_standing = 1<<p1_standing_bit
p2_standing = 1<<p2_standing_bit
pushing_bit_delta = 2
p1_pushing_bit = p1_standing_bit + pushing_bit_delta
p2_pushing_bit = p1_pushing_bit + 1
p1_pushing = 1<<p1_pushing_bit
p2_pushing = 1<<p2_pushing_bit
standing_mask = p1_standing|p2_standing
pushing_mask = p1_pushing|p2_pushing
; ---------------------------------------------------------------------------
; The high word of d6 after a SolidObject call is a bitfield
; with the following meaning:
p1_touch_side_bit = 0
p2_touch_side_bit = p1_touch_side_bit + 1
p1_touch_side = 1<<p1_touch_side_bit
p2_touch_side = 1<<p2_touch_side_bit
touch_side_mask = p1_touch_side|p2_touch_side
p1_touch_bottom_bit = p1_touch_side_bit + pushing_bit_delta
p2_touch_bottom_bit = p1_touch_bottom_bit + 1
p1_touch_bottom = 1<<p1_touch_bottom_bit
p2_touch_bottom = 1<<p2_touch_bottom_bit
touch_bottom_mask = p1_touch_bottom|p2_touch_bottom
p1_touch_top_bit = p1_touch_bottom_bit + pushing_bit_delta
p2_touch_top_bit = p1_touch_top_bit + 1
p1_touch_top = 1<<p1_touch_top_bit
p2_touch_top = 1<<p2_touch_top_bit
touch_top_mask = p1_touch_top|p2_touch_top
; ---------------------------------------------------------------------------
; Controller Buttons
;
; Buttons bit numbers
button_up: EQU 0
button_down: EQU 1
button_left: EQU 2
button_right: EQU 3
button_B: EQU 4
button_C: EQU 5
button_A: EQU 6
button_start: EQU 7
; Buttons masks (1 << x == pow(2, x))
button_up_mask: EQU 1<<button_up ; $01
button_down_mask: EQU 1<<button_down ; $02
button_left_mask: EQU 1<<button_left ; $04
button_right_mask: EQU 1<<button_right ; $08
button_B_mask: EQU 1<<button_B ; $10
button_C_mask: EQU 1<<button_C ; $20
button_A_mask: EQU 1<<button_A ; $40
button_start_mask: EQU 1<<button_start ; $80
; ---------------------------------------------------------------------------
; Casino night bumpers
bumper_id = 0
bumper_x = 2
bumper_y = 4
next_bumper = 6
prev_bumper_x = bumper_x-next_bumper
; ---------------------------------------------------------------------------
; status_secondary bitfield variables
;
; status_secondary variable bit numbers
status_sec_hasShield: EQU 0
status_sec_isInvincible: EQU 1
status_sec_hasSpeedShoes: EQU 2
status_sec_isSliding: EQU 7
; status_secondary variable masks (1 << x == pow(2, x))
status_sec_hasShield_mask: EQU 1<<status_sec_hasShield ; $01
status_sec_isInvincible_mask: EQU 1<<status_sec_isInvincible ; $02
status_sec_hasSpeedShoes_mask: EQU 1<<status_sec_hasSpeedShoes ; $04
status_sec_isSliding_mask: EQU 1<<status_sec_isSliding ; $80
; ---------------------------------------------------------------------------
; Constants that can be used instead of hard-coded IDs for various things.
; The "id" function allows to remove elements from an array/table without having
; to change the IDs everywhere in the code.
cur_zone_id := 0 ; the zone ID currently being declared
cur_zone_str := "0" ; string representation of the above
; macro to declare a zone ID
; this macro also declares constants of the form zone_id_X, where X is the ID of the zone in stock Sonic 2
; in order to allow level offset tables to be made dynamic
zoneID macro zoneID,{INTLABEL}
__LABEL__ = zoneID
zone_id_{cur_zone_str} = zoneID
cur_zone_id := cur_zone_id+1
cur_zone_str := "\{cur_zone_id}"
endm
; Zone IDs. These MUST be declared in the order in which their IDs are in stock Sonic 2, otherwise zone offset tables will screw up
emerald_hill_zone zoneID $00
zone_1 zoneID $01
wood_zone zoneID $02
zone_3 zoneID $03
metropolis_zone zoneID $04
metropolis_zone_2 zoneID $05
wing_fortress_zone zoneID $06
hill_top_zone zoneID $07
hidden_palace_zone zoneID $08
zone_9 zoneID $09
oil_ocean_zone zoneID $0A
mystic_cave_zone zoneID $0B
casino_night_zone zoneID $0C
chemical_plant_zone zoneID $0D
death_egg_zone zoneID $0E
aquatic_ruin_zone zoneID $0F
sky_chase_zone zoneID $10
; NOTE: If you want to shift IDs around, set useFullWaterTables to 1 in the assembly options
; set the number of zones
no_of_zones = cur_zone_id
; Zone and act IDs
emerald_hill_zone_act_1 = (emerald_hill_zone<<8)|$00
emerald_hill_zone_act_2 = (emerald_hill_zone<<8)|$01
chemical_plant_zone_act_1 = (chemical_plant_zone<<8)|$00
chemical_plant_zone_act_2 = (chemical_plant_zone<<8)|$01
aquatic_ruin_zone_act_1 = (aquatic_ruin_zone<<8)|$00
aquatic_ruin_zone_act_2 = (aquatic_ruin_zone<<8)|$01
casino_night_zone_act_1 = (casino_night_zone<<8)|$00
casino_night_zone_act_2 = (casino_night_zone<<8)|$01
hill_top_zone_act_1 = (hill_top_zone<<8)|$00
hill_top_zone_act_2 = (hill_top_zone<<8)|$01
mystic_cave_zone_act_1 = (mystic_cave_zone<<8)|$00
mystic_cave_zone_act_2 = (mystic_cave_zone<<8)|$01
oil_ocean_zone_act_1 = (oil_ocean_zone<<8)|$00
oil_ocean_zone_act_2 = (oil_ocean_zone<<8)|$01
metropolis_zone_act_1 = (metropolis_zone<<8)|$00
metropolis_zone_act_2 = (metropolis_zone<<8)|$01
metropolis_zone_act_3 = (metropolis_zone_2<<8)|$00
sky_chase_zone_act_1 = (sky_chase_zone<<8)|$00
wing_fortress_zone_act_1 = (wing_fortress_zone<<8)|$00
death_egg_zone_act_1 = (death_egg_zone<<8)|$00
; Prototype zone and act IDs
wood_zone_act_1 = (wood_zone<<8)|$00
wood_zone_act_2 = (wood_zone<<8)|$01
hidden_palace_zone_act_1 = (hidden_palace_zone<<8)|$00
hidden_palace_zone_act_2 = (hidden_palace_zone<<8)|$01
level_select_special_stage = $4000
level_select_exit = $FFFF
; ---------------------------------------------------------------------------
; some variables and functions to help define those constants (redefined before a new set of IDs)
offset := 0 ; this is the start of the pointer table
ptrsize := 1 ; this is the size of a pointer (should be 1 if the ID is a multiple of the actual size)
idstart := 0 ; value to add to all IDs
; function using these variables
id function ptr,((ptr-offset)/ptrsize+idstart)
; V-Int routines
offset := Vint_SwitchTbl
ptrsize := 1
idstart := 0
VintID_Lag = id(Vint_Lag_ptr) ; 0
VintID_SEGA = id(Vint_SEGA_ptr) ; 2
VintID_Title = id(Vint_Title_ptr) ; 4
VintID_Unused6 = id(Vint_Unused6_ptr) ; 6
VintID_Level = id(Vint_Level_ptr) ; 8
VintID_S2SS = id(Vint_S2SS_ptr) ; A
VintID_TitleCard = id(Vint_TitleCard_ptr) ; C
VintID_UnusedE = id(Vint_UnusedE_ptr) ; E
VintID_Pause = id(Vint_Pause_ptr) ; 10
VintID_Fade = id(Vint_Fade_ptr) ; 12
VintID_PCM = id(Vint_PCM_ptr) ; 14
VintID_Menu = id(Vint_Menu_ptr) ; 16
VintID_Ending = id(Vint_Ending_ptr) ; 18
VintID_CtrlDMA = id(Vint_CtrlDMA_ptr) ; 1A
VintID_Savescreen = id(Vint_Save_Screen)
; Game modes
offset := GameModesArray
ptrsize := 1
idstart := 0
GameModeID_SegaScreen = id(GameMode_SegaScreen) ; 0
GameModeID_TitleScreen = id(GameMode_TitleScreen) ; 4
GameModeID_Demo = id(GameMode_Demo) ; 8
GameModeID_Level = id(GameMode_Level) ; C
GameModeID_SpecialStage = id(GameMode_SpecialStage) ; 10
GameModeID_ContinueScreen = id(GameMode_ContinueScreen) ; 14
GameModeID_2PResults = id(GameMode_2PResults) ; 18
GameModeID_2PLevelSelect = id(GameMode_2PLevelSelect) ; 1C
GameModeID_EndingSequence = id(GameMode_EndingSequence) ; 20
GameModeID_OptionsMenu = id(GameMode_OptionsMenu) ; 24
GameModeID_LevelSelect = id(GameMode_LevelSelect) ; 28
GameModeID_save_screen = id(GameMode_save_screen)
GameModeFlag_TitleCard = 7 ; flag bit
GameModeID_TitleCard = 1<<GameModeFlag_TitleCard ; flag mask
; palette IDs
offset := PalPointers
ptrsize := 8
idstart := 0
PalID_SEGA = id(PalPtr_SEGA) ; 0
PalID_Title = id(PalPtr_Title) ; 1
PalID_MenuB = id(PalPtr_MenuB) ; 2
PalID_BGND = id(PalPtr_BGND) ; 3
PalID_EHZ = id(PalPtr_EHZ) ; 4
PalID_EHZ2 = id(PalPtr_EHZ2) ; 5
PalID_WZ = id(PalPtr_WZ) ; 6
PalID_EHZ3 = id(PalPtr_EHZ3) ; 7
PalID_MTZ = id(PalPtr_MTZ) ; 8
PalID_MTZ2 = id(PalPtr_MTZ2) ; 9
PalID_WFZ = id(PalPtr_WFZ) ; A
PalID_HTZ = id(PalPtr_HTZ) ; B
PalID_HPZ = id(PalPtr_HPZ) ; C
PalID_EHZ4 = id(PalPtr_EHZ4) ; D
PalID_OOZ = id(PalPtr_OOZ) ; E
PalID_MCZ = id(PalPtr_MCZ) ; F
PalID_CNZ = id(PalPtr_CNZ) ; 10
PalID_CPZ = id(PalPtr_CPZ) ; 11
PalID_DEZ = id(PalPtr_DEZ) ; 12
PalID_ARZ = id(PalPtr_ARZ) ; 13
PalID_SCZ = id(PalPtr_SCZ) ; 14
PalID_HPZ_U = id(PalPtr_HPZ_U) ; 15
PalID_CPZ_U = id(PalPtr_CPZ_U) ; 16
PalID_ARZ_U = id(PalPtr_ARZ_U) ; 17
PalID_SS = id(PalPtr_SS) ; 18
PalID_MCZ_B = id(PalPtr_MCZ_B) ; 19
PalID_CNZ_B = id(PalPtr_CNZ_B) ; 1A
PalID_SS1 = id(PalPtr_SS1) ; 1B
PalID_SS2 = id(PalPtr_SS2) ; 1C
PalID_SS3 = id(PalPtr_SS3) ; 1D
PalID_SS4 = id(PalPtr_SS4) ; 1E
PalID_SS5 = id(PalPtr_SS5) ; 1F
PalID_SS6 = id(PalPtr_SS6) ; 20
PalID_SS7 = id(PalPtr_SS7) ; 21
PalID_SS1_2p = id(PalPtr_SS1_2p) ; 22
PalID_SS2_2p = id(PalPtr_SS2_2p) ; 23
PalID_SS3_2p = id(PalPtr_SS3_2p) ; 24
PalID_OOZ_B = id(PalPtr_OOZ_B) ; 25
PalID_Menu = id(PalPtr_Menu) ; 26
PalID_Result = id(PalPtr_Result) ; 27
; PLC IDs
offset := ArtLoadCues
ptrsize := 2
idstart := 0
PLCID_Std1 = id(PLCptr_Std1) ; 0
PLCID_Std2 = id(PLCptr_Std2) ; 1
PLCID_StdWtr = id(PLCptr_StdWtr) ; 2
PLCID_GameOver = id(PLCptr_GameOver) ; 3
PLCID_Ehz1 = id(PLCptr_Ehz1) ; 4
PLCID_Ehz2 = id(PLCptr_Ehz2) ; 5
PLCID_Miles1up = id(PLCptr_Miles1up) ; 6
PLCID_MilesLife = id(PLCptr_MilesLife) ; 7
PLCID_Tails1up = id(PLCptr_Tails1up) ; 8
PLCID_TailsLife = id(PLCptr_TailsLife) ; 9
PLCID_Unused1 = id(PLCptr_Unused1) ; A
PLCID_Unused2 = id(PLCptr_Unused2) ; B
PLCID_Mtz1 = id(PLCptr_Mtz1) ; C
PLCID_Mtz2 = id(PLCptr_Mtz2) ; D
PLCID_Wfz1 = id(PLCptr_Wfz1) ; 10
PLCID_Wfz2 = id(PLCptr_Wfz2) ; 11
PLCID_Htz1 = id(PLCptr_Htz1) ; 12
PLCID_Htz2 = id(PLCptr_Htz2) ; 13
PLCID_Hpz1 = id(PLCptr_Hpz1) ; 14
PLCID_Hpz2 = id(PLCptr_Hpz2) ; 15
PLCID_Unused3 = id(PLCptr_Unused3) ; 16
PLCID_Unused4 = id(PLCptr_Unused4) ; 17
PLCID_Ooz1 = id(PLCptr_Ooz1) ; 18
PLCID_Ooz2 = id(PLCptr_Ooz2) ; 19
PLCID_Mcz1 = id(PLCptr_Mcz1) ; 1A
PLCID_Mcz2 = id(PLCptr_Mcz2) ; 1B
PLCID_Cnz1 = id(PLCptr_Cnz1) ; 1C
PLCID_Cnz2 = id(PLCptr_Cnz2) ; 1D
PLCID_Cpz1 = id(PLCptr_Cpz1) ; 1E
PLCID_Cpz2 = id(PLCptr_Cpz2) ; 1F
PLCID_Dez1 = id(PLCptr_Dez1) ; 20
PLCID_Dez2 = id(PLCptr_Dez2) ; 21
PLCID_Arz1 = id(PLCptr_Arz1) ; 22
PLCID_Arz2 = id(PLCptr_Arz2) ; 23
PLCID_Scz1 = id(PLCptr_Scz1) ; 24
PLCID_Scz2 = id(PLCptr_Scz2) ; 25
PLCID_Results = id(PLCptr_Results) ; 26
PLCID_Signpost = id(PLCptr_Signpost) ; 27
PLCID_CpzBoss = id(PLCptr_CpzBoss) ; 28
PLCID_EhzBoss = id(PLCptr_EhzBoss) ; 29
PLCID_HtzBoss = id(PLCptr_HtzBoss) ; 2A
PLCID_ArzBoss = id(PLCptr_ArzBoss) ; 2B
PLCID_MczBoss = id(PLCptr_MczBoss) ; 2C
PLCID_CnzBoss = id(PLCptr_CnzBoss) ; 2D
PLCID_MtzBoss = id(PLCptr_MtzBoss) ; 2E
PLCID_OozBoss = id(PLCptr_OozBoss) ; 2F
PLCID_FieryExplosion = id(PLCptr_FieryExplosion) ; 30
PLCID_DezBoss = id(PLCptr_DezBoss) ; 31
PLCID_EhzAnimals = id(PLCptr_EhzAnimals) ; 32
PLCID_MczAnimals = id(PLCptr_MczAnimals) ; 33
PLCID_HtzAnimals = id(PLCptr_HtzAnimals) ; 34
PLCID_MtzAnimals = id(PLCptr_MtzAnimals) ; 34
PLCID_WfzAnimals = id(PLCptr_WfzAnimals) ; 34
PLCID_DezAnimals = id(PLCptr_DezAnimals) ; 35
PLCID_HpzAnimals = id(PLCptr_HpzAnimals) ; 36
PLCID_OozAnimals = id(PLCptr_OozAnimals) ; 37
PLCID_SczAnimals = id(PLCptr_SczAnimals) ; 38
PLCID_CnzAnimals = id(PLCptr_CnzAnimals) ; 39
PLCID_CpzAnimals = id(PLCptr_CpzAnimals) ; 3A
PLCID_ArzAnimals = id(PLCptr_ArzAnimals) ; 3B
PLCID_SpecialStage = id(PLCptr_SpecialStage) ; 3C
PLCID_SpecStageBombs = id(PLCptr_SpecStageBombs) ; 3D
PLCID_WfzBoss = id(PLCptr_WfzBoss) ; 3E
PLCID_Tornado = id(PLCptr_Tornado) ; 3F
PLCID_Capsule = id(PLCptr_Capsule) ; 40
PLCID_ResultsTails = id(PLCptr_ResultsTails) ; 42
; Object IDs
offset := Obj_Index
ptrsize := 4
idstart := 1
ObjID_Sonic = id(ObjPtr_Sonic) ; 01
ObjID_Tails = id(ObjPtr_Tails) ; 02
ObjID_PlaneSwitcher = id(ObjPtr_PlaneSwitcher) ; 03
ObjID_WaterSurface = id(ObjPtr_WaterSurface) ; 04
ObjID_TailsTails = id(ObjPtr_TailsTails) ; 05
ObjID_Spiral = id(ObjPtr_Spiral) ; 06
ObjID_Oil = id(ObjPtr_Oil) ; 07
ObjID_SpindashDust = id(ObjPtr_SpindashDust) ; 08
ObjID_Splash = id(ObjPtr_Splash) ; 08
ObjID_SonicSS = id(ObjPtr_SonicSS) ; 09
ObjID_SmallBubbles = id(ObjPtr_SmallBubbles) ; 0A
ObjID_TippingFloor = id(ObjPtr_TippingFloor) ; 0B
ObjID_Signpost = id(ObjPtr_Signpost) ; 0D
ObjID_IntroStars = id(ObjPtr_IntroStars) ; 0E
ObjID_TitleMenu = id(ObjPtr_TitleMenu) ; 0F
ObjID_TailsSS = id(ObjPtr_TailsSS) ; 10
ObjID_Bridge = id(ObjPtr_Bridge) ; 11
ObjID_HPZEmerald = id(ObjPtr_HPZEmerald) ; 12
ObjID_HPZWaterfall = id(ObjPtr_HPZWaterfall) ; 13
ObjID_Seesaw = id(ObjPtr_Seesaw) ; 14
ObjID_SwingingPlatform = id(ObjPtr_SwingingPlatform) ; 15
ObjID_HTZLift = id(ObjPtr_HTZLift) ; 16
ObjID_ARZPlatform = id(ObjPtr_ARZPlatform) ; 18
ObjID_EHZPlatform = id(ObjPtr_EHZPlatform) ; 18
ObjID_CPZPlatform = id(ObjPtr_CPZPlatform) ; 19
ObjID_OOZMovingPform = id(ObjPtr_OOZMovingPform) ; 19
ObjID_WFZPlatform = id(ObjPtr_WFZPlatform) ; 19
ObjID_HPZCollapsPform = id(ObjPtr_HPZCollapsPform) ; 1A
ObjID_SpeedBooster = id(ObjPtr_SpeedBooster) ; 1B
ObjID_Scenery = id(ObjPtr_Scenery) ; 1C
ObjID_BridgeStake = id(ObjPtr_BridgeStake) ; 1C
ObjID_FallingOil = id(ObjPtr_FallingOil) ; 1C
ObjID_BlueBalls = id(ObjPtr_BlueBalls) ; 1D
ObjID_CPZSpinTube = id(ObjPtr_CPZSpinTube) ; 1E
ObjID_CollapsPform = id(ObjPtr_CollapsPform) ; 1F
ObjID_LavaBubble = id(ObjPtr_LavaBubble) ; 20
ObjID_HUD = id(ObjPtr_HUD) ; 21
ObjID_ArrowShooter = id(ObjPtr_ArrowShooter) ; 22
ObjID_FallingPillar = id(ObjPtr_FallingPillar) ; 23
ObjID_ARZBubbles = id(ObjPtr_ARZBubbles) ; 24
ObjID_Ring = id(ObjPtr_Ring) ; 25
ObjID_Monitor = id(ObjPtr_Monitor) ; 26
ObjID_Explosion = id(ObjPtr_Explosion) ; 27
ObjID_Animal = id(ObjPtr_Animal) ; 28
ObjID_Points = id(ObjPtr_Points) ; 29
ObjID_Stomper = id(ObjPtr_Stomper) ; 2A
ObjID_RisingPillar = id(ObjPtr_RisingPillar) ; 2B
ObjID_LeavesGenerator = id(ObjPtr_LeavesGenerator) ; 2C
ObjID_Barrier = id(ObjPtr_Barrier) ; 2D
ObjID_MonitorContents = id(ObjPtr_MonitorContents) ; 2E
ObjID_SmashableGround = id(ObjPtr_SmashableGround) ; 2F
ObjID_RisingLava = id(ObjPtr_RisingLava) ; 30
ObjID_LavaMarker = id(ObjPtr_LavaMarker) ; 31
ObjID_BreakableBlock = id(ObjPtr_BreakableBlock) ; 32
ObjID_BreakableRock = id(ObjPtr_BreakableRock) ; 32
ObjID_OOZPoppingPform = id(ObjPtr_OOZPoppingPform) ; 33
ObjID_TitleCard = id(ObjPtr_TitleCard) ; 34
ObjID_InvStars = id(ObjPtr_InvStars) ; 35
ObjID_Spikes = id(ObjPtr_Spikes) ; 36
ObjID_LostRings = id(ObjPtr_LostRings) ; 37
ObjID_Shield = id(ObjPtr_Shield) ; 38
ObjID_GameOver = id(ObjPtr_GameOver) ; 39
ObjID_TimeOver = id(ObjPtr_TimeOver) ; 39
ObjID_Results = id(ObjPtr_Results) ; 3A
ObjID_OOZLauncher = id(ObjPtr_OOZLauncher) ; 3D
ObjID_EggPrison = id(ObjPtr_EggPrison) ; 3E
ObjID_Fan = id(ObjPtr_Fan) ; 3F
ObjID_Springboard = id(ObjPtr_Springboard) ; 40
ObjID_Spring = id(ObjPtr_Spring) ; 41
ObjID_SteamSpring = id(ObjPtr_SteamSpring) ; 42
ObjID_SlidingSpike = id(ObjPtr_SlidingSpike) ; 43
ObjID_RoundBumper = id(ObjPtr_RoundBumper) ; 44
ObjID_OOZSpring = id(ObjPtr_OOZSpring) ; 45
ObjID_OOZBall = id(ObjPtr_OOZBall) ; 46
ObjID_Button = id(ObjPtr_Button) ; 47
ObjID_LauncherBall = id(ObjPtr_LauncherBall) ; 48
ObjID_EHZWaterfall = id(ObjPtr_EHZWaterfall) ; 49
ObjID_Octus = id(ObjPtr_Octus) ; 4A
ObjID_Buzzer = id(ObjPtr_Buzzer) ; 4B
ObjID_Aquis = id(ObjPtr_Aquis) ; 50
ObjID_CNZBoss = id(ObjPtr_CNZBoss) ; 51
ObjID_HTZBoss = id(ObjPtr_HTZBoss) ; 52
ObjID_MTZBossOrb = id(ObjPtr_MTZBossOrb) ; 53
ObjID_MTZBoss = id(ObjPtr_MTZBoss) ; 54
ObjID_OOZBoss = id(ObjPtr_OOZBoss) ; 55
ObjID_EHZBoss = id(ObjPtr_EHZBoss) ; 56
ObjID_MCZBoss = id(ObjPtr_MCZBoss) ; 57
ObjID_BossExplosion = id(ObjPtr_BossExplosion) ; 58
ObjID_SSEmerald = id(ObjPtr_SSEmerald) ; 59
ObjID_SSMessage = id(ObjPtr_SSMessage) ; 5A
ObjID_SSRingSpill = id(ObjPtr_SSRingSpill) ; 5B
ObjID_Masher = id(ObjPtr_Masher) ; 5C
ObjID_CPZBoss = id(ObjPtr_CPZBoss) ; 5D
ObjID_SSHUD = id(ObjPtr_SSHUD) ; 5E
ObjID_StartBanner = id(ObjPtr_StartBanner) ; 5F
ObjID_EndingController = id(ObjPtr_EndingController) ; 5F
ObjID_SSRing = id(ObjPtr_SSRing) ; 60
ObjID_SSBomb = id(ObjPtr_SSBomb) ; 61
ObjID_SSShadow = id(ObjPtr_SSShadow) ; 63
ObjID_MTZTwinStompers = id(ObjPtr_MTZTwinStompers) ; 64
ObjID_MTZLongPlatform = id(ObjPtr_MTZLongPlatform) ; 65
ObjID_MTZSpringWall = id(ObjPtr_MTZSpringWall) ; 66
ObjID_MTZSpinTube = id(ObjPtr_MTZSpinTube) ; 67
ObjID_SpikyBlock = id(ObjPtr_SpikyBlock) ; 68
ObjID_Nut = id(ObjPtr_Nut) ; 69
ObjID_MCZRotPforms = id(ObjPtr_MCZRotPforms) ; 6A
ObjID_MTZMovingPforms = id(ObjPtr_MTZMovingPforms) ; 6A
ObjID_MTZPlatform = id(ObjPtr_MTZPlatform) ; 6B
ObjID_CPZSquarePform = id(ObjPtr_CPZSquarePform) ; 6B
ObjID_Conveyor = id(ObjPtr_Conveyor) ; 6C
ObjID_FloorSpike = id(ObjPtr_FloorSpike) ; 6D
ObjID_LargeRotPform = id(ObjPtr_LargeRotPform) ; 6E
ObjID_SSResults = id(ObjPtr_SSResults) ; 6F
ObjID_Cog = id(ObjPtr_Cog) ; 70
ObjID_MTZLavaBubble = id(ObjPtr_MTZLavaBubble) ; 71
ObjID_HPZBridgeStake = id(ObjPtr_HPZBridgeStake) ; 71
ObjID_PulsingOrb = id(ObjPtr_PulsingOrb) ; 71
ObjID_CNZConveyorBelt = id(ObjPtr_CNZConveyorBelt) ; 72
ObjID_RotatingRings = id(ObjPtr_RotatingRings) ; 73
ObjID_InvisibleBlock = id(ObjPtr_InvisibleBlock) ; 74
ObjID_MCZBrick = id(ObjPtr_MCZBrick) ; 75
ObjID_SlidingSpikes = id(ObjPtr_SlidingSpikes) ; 76
ObjID_MCZBridge = id(ObjPtr_MCZBridge) ; 77
ObjID_CPZStaircase = id(ObjPtr_CPZStaircase) ; 78
ObjID_Starpost = id(ObjPtr_Starpost) ; 79
ObjID_SidewaysPform = id(ObjPtr_SidewaysPform) ; 7A
ObjID_PipeExitSpring = id(ObjPtr_PipeExitSpring) ; 7B
ObjID_CPZPylon = id(ObjPtr_CPZPylon) ; 7C
ObjID_SuperSonicStars = id(ObjPtr_SuperSonicStars) ; 7E
ObjID_VineSwitch = id(ObjPtr_VineSwitch) ; 7F
ObjID_MovingVine = id(ObjPtr_MovingVine) ; 80
ObjID_MCZDrawbridge = id(ObjPtr_MCZDrawbridge) ; 81
ObjID_SwingingPform = id(ObjPtr_SwingingPform) ; 82
ObjID_ARZRotPforms = id(ObjPtr_ARZRotPforms) ; 83
ObjID_ForcedSpin = id(ObjPtr_ForcedSpin) ; 84
ObjID_PinballMode = id(ObjPtr_PinballMode) ; 84
ObjID_LauncherSpring = id(ObjPtr_LauncherSpring) ; 85
ObjID_Flipper = id(ObjPtr_Flipper) ; 86
ObjID_SSNumberOfRings = id(ObjPtr_SSNumberOfRings) ; 87
ObjID_SSTailsTails = id(ObjPtr_SSTailsTails) ; 88
ObjID_ARZBoss = id(ObjPtr_ARZBoss) ; 89
ObjID_WFZPalSwitcher = id(ObjPtr_WFZPalSwitcher) ; 8B
ObjID_Whisp = id(ObjPtr_Whisp) ; 8C
ObjID_GrounderInWall = id(ObjPtr_GrounderInWall) ; 8D
ObjID_GrounderInWall2 = id(ObjPtr_GrounderInWall2) ; 8E
ObjID_GrounderWall = id(ObjPtr_GrounderWall) ; 8F
ObjID_GrounderRocks = id(ObjPtr_GrounderRocks) ; 90
ObjID_ChopChop = id(ObjPtr_ChopChop) ; 91
ObjID_Spiker = id(ObjPtr_Spiker) ; 92
ObjID_SpikerDrill = id(ObjPtr_SpikerDrill) ; 93
ObjID_Rexon = id(ObjPtr_Rexon) ; 94
ObjID_Sol = id(ObjPtr_Sol) ; 95
ObjID_Rexon2 = id(ObjPtr_Rexon2) ; 96
ObjID_RexonHead = id(ObjPtr_RexonHead) ; 97
ObjID_Projectile = id(ObjPtr_Projectile) ; 98
ObjID_Nebula = id(ObjPtr_Nebula) ; 99
ObjID_Turtloid = id(ObjPtr_Turtloid) ; 9A
ObjID_TurtloidRider = id(ObjPtr_TurtloidRider) ; 9B
ObjID_BalkiryJet = id(ObjPtr_BalkiryJet) ; 9C
ObjID_Coconuts = id(ObjPtr_Coconuts) ; 9D
ObjID_Crawlton = id(ObjPtr_Crawlton) ; 9E
ObjID_Shellcracker = id(ObjPtr_Shellcracker) ; 9F
ObjID_ShellcrackerClaw = id(ObjPtr_ShellcrackerClaw) ; A0
ObjID_Slicer = id(ObjPtr_Slicer) ; A1
ObjID_SlicerPincers = id(ObjPtr_SlicerPincers) ; A2
ObjID_Flasher = id(ObjPtr_Flasher) ; A3
ObjID_Asteron = id(ObjPtr_Asteron) ; A4
ObjID_Spiny = id(ObjPtr_Spiny) ; A5
ObjID_SpinyOnWall = id(ObjPtr_SpinyOnWall) ; A6
ObjID_Grabber = id(ObjPtr_Grabber) ; A7
ObjID_GrabberLegs = id(ObjPtr_GrabberLegs) ; A8
ObjID_GrabberBox = id(ObjPtr_GrabberBox) ; A9
ObjID_GrabberString = id(ObjPtr_GrabberString) ; AA
ObjID_Balkiry = id(ObjPtr_Balkiry) ; AC
ObjID_CluckerBase = id(ObjPtr_CluckerBase) ; AD
ObjID_Clucker = id(ObjPtr_Clucker) ; AE
ObjID_MechaSonic = id(ObjPtr_MechaSonic) ; AF
ObjID_SonicOnSegaScr = id(ObjPtr_SonicOnSegaScr) ; B0
ObjID_SegaHideTM = id(ObjPtr_SegaHideTM) ; B1
ObjID_Tornado = id(ObjPtr_Tornado) ; B2
ObjID_Cloud = id(ObjPtr_Cloud) ; B3
ObjID_VPropeller = id(ObjPtr_VPropeller) ; B4
ObjID_HPropeller = id(ObjPtr_HPropeller) ; B5
ObjID_TiltingPlatform = id(ObjPtr_TiltingPlatform) ; B6
ObjID_VerticalLaser = id(ObjPtr_VerticalLaser) ; B7
ObjID_WallTurret = id(ObjPtr_WallTurret) ; B8
ObjID_Laser = id(ObjPtr_Laser) ; B9
ObjID_WFZWheel = id(ObjPtr_WFZWheel) ; BA
ObjID_WFZShipFire = id(ObjPtr_WFZShipFire) ; BC
ObjID_SmallMetalPform = id(ObjPtr_SmallMetalPform) ; BD
ObjID_LateralCannon = id(ObjPtr_LateralCannon) ; BE
ObjID_WFZStick = id(ObjPtr_WFZStick) ; BF
ObjID_SpeedLauncher = id(ObjPtr_SpeedLauncher) ; C0
ObjID_BreakablePlating = id(ObjPtr_BreakablePlating) ; C1
ObjID_Rivet = id(ObjPtr_Rivet) ; C2
ObjID_TornadoSmoke = id(ObjPtr_TornadoSmoke) ; C3
ObjID_TornadoSmoke2 = id(ObjPtr_TornadoSmoke2) ; C4
ObjID_WFZBoss = id(ObjPtr_WFZBoss) ; C5
ObjID_Eggman = id(ObjPtr_Eggman) ; C6
ObjID_Eggrobo = id(ObjPtr_Eggrobo) ; C7
ObjID_Crawl = id(ObjPtr_Crawl) ; C8
ObjID_TtlScrPalChanger = id(ObjPtr_TtlScrPalChanger) ; C9
ObjID_CutScene = id(ObjPtr_CutScene) ; CA
ObjID_EndingSeqClouds = id(ObjPtr_EndingSeqClouds) ; CB
ObjID_EndingSeqTrigger = id(ObjPtr_EndingSeqTrigger) ; CC
ObjID_EndingSeqBird = id(ObjPtr_EndingSeqBird) ; CD
ObjID_EndingSeqSonic = id(ObjPtr_EndingSeqSonic) ; CE
ObjID_EndingSeqTails = id(ObjPtr_EndingSeqTails) ; CE
ObjID_TornadoHelixes = id(ObjPtr_TornadoHelixes) ; CF
ObjID_CNZRectBlocks = id(ObjPtr_CNZRectBlocks) ; D2
ObjID_BombPrize = id(ObjPtr_BombPrize) ; D3
ObjID_CNZBigBlock = id(ObjPtr_CNZBigBlock) ; D4
ObjID_Elevator = id(ObjPtr_Elevator) ; D5
ObjID_PointPokey = id(ObjPtr_PointPokey) ; D6
ObjID_Bumper = id(ObjPtr_Bumper) ; D7
ObjID_BonusBlock = id(ObjPtr_BonusBlock) ; D8
ObjID_Grab = id(ObjPtr_Grab) ; D9
ObjID_ContinueText = id(ObjPtr_ContinueText) ; DA
ObjID_ContinueIcons = id(ObjPtr_ContinueIcons) ; DA
ObjID_ContinueChars = id(ObjPtr_ContinueChars) ; DB
ObjID_RingPrize = id(ObjPtr_RingPrize) ; DC
; Music IDs
offset := zMasterPlaylist
ptrsize := 4
idstart := $01
; $80 is reserved for silence, so if you make idstart $80 or less,
; you may need to insert a dummy zMusIDPtr in the $80 slot
MusID__First = idstart
MusID_2PResult = id(zMusIDPtr_2PResult) ; 81
MusID_EHZ = id(zMusIDPtr_EHZ) ; 82
MusID_MCZ_2P = id(zMusIDPtr_MCZ_2P) ; 83
MusID_OOZ = id(zMusIDPtr_OOZ) ; 84
MusID_MTZ = id(zMusIDPtr_MTZ) ; 85
MusID_HTZ = id(zMusIDPtr_HTZ) ; 86
MusID_ARZ = id(zMusIDPtr_ARZ) ; 87
MusID_CNZ_2P = id(zMusIDPtr_CNZ_2P) ; 88
MusID_CNZ = id(zMusIDPtr_CNZ) ; 89
MusID_DEZ = id(zMusIDPtr_DEZ) ; 8A
MusID_MCZ = id(zMusIDPtr_MCZ) ; 8B
MusID_EHZ_2P = id(zMusIDPtr_EHZ_2P) ; 8C
MusID_SCZ = id(zMusIDPtr_SCZ) ; 8D
MusID_CPZ = id(zMusIDPtr_CPZ) ; 8E
MusID_WFZ = id(zMusIDPtr_WFZ) ; 8F
MusID_HPZ = id(zMusIDPtr_HPZ) ; 90
MusID_Options = id(zMusIDPtr_Options) ; 91
MusID_SpecStage = id(zMusIDPtr_SpecStage) ; 92
MusID_Boss = id(zMusIDPtr_Boss) ; 93
MusID_EndBoss = id(zMusIDPtr_EndBoss) ; 94
MusID_Ending = id(zMusIDPtr_Ending) ; 95
MusID_SuperSonic = id(zMusIDPtr_SuperSonic); 96
MusID_Invincible = id(zMusIDPtr_Invincible); 97
MusID_ExtraLife = id(zMusIDPtr_ExtraLife) ; 98
MusID_Title = id(zMusIDPtr_Title) ; 99
MusID_EndLevel = id(zMusIDPtr_EndLevel) ; 9A
MusID_GameOver = id(zMusIDPtr_GameOver) ; 9B
MusID_Continue = id(zMusIDPtr_Continue) ; 9C
MusID_Emerald = id(zMusIDPtr_Emerald) ; 9D
MusID_Credits = id(zMusIDPtr_Credits) ; 9E
MusID_Countdown = id(zMusIDPtr_Countdown) ; 9F
MusID_SaveScreen = id(zMusIDPtr_SaveScreen) ; 9F
MusID__End = id(zMusIDPtr__End) ; A0
if MOMPASS == 2
if MusID__End > SndID__First
fatal "You have too many SndPtrs. MusID__End ($\{MusID__End}) can't exceed SndID__First ($\{SndID__First})."
endif
endif
; Sound IDs
offset := SoundIndex
ptrsize := 2
idstart := $A0
; $80 is reserved for silence, so if you make idstart $80 or less,
; you may need to insert a dummy SndPtr in the $80 slot
SndID__First = idstart
SndID_Jump = id(SndPtr_Jump) ; A0
SndID_Checkpoint = id(SndPtr_Checkpoint) ; A1
SndID_SpikeSwitch = id(SndPtr_SpikeSwitch) ; A2
SndID_Hurt = id(SndPtr_Hurt) ; A3
SndID_Skidding = id(SndPtr_Skidding) ; A4
SndID_BlockPush = id(SndPtr_BlockPush) ; A5
SndID_HurtBySpikes = id(SndPtr_HurtBySpikes) ; A6
SndID_Sparkle = id(SndPtr_Sparkle) ; A7
SndID_Beep = id(SndPtr_Beep) ; A8
SndID_Bwoop = id(SndPtr_Bwoop) ; A9
SndID_Splash = id(SndPtr_Splash) ; AA
SndID_Swish = id(SndPtr_Swish) ; AB
SndID_BossHit = id(SndPtr_BossHit) ; AC
SndID_InhalingBubble = id(SndPtr_InhalingBubble) ; AD
SndID_ArrowFiring = id(SndPtr_ArrowFiring) ; AE
SndID_LavaBall = id(SndPtr_LavaBall) ; AE
SndID_Shield = id(SndPtr_Shield) ; AF
SndID_LaserBeam = id(SndPtr_LaserBeam) ; B0
SndID_Zap = id(SndPtr_Zap) ; B1
SndID_Drown = id(SndPtr_Drown) ; B2
SndID_FireBurn = id(SndPtr_FireBurn) ; B3
SndID_Bumper = id(SndPtr_Bumper) ; B4
SndID_Ring = id(SndPtr_Ring) ; B5
SndID_RingRight = id(SndPtr_RingRight) ; B5
SndID_SpikesMove = id(SndPtr_SpikesMove) ; B6
SndID_Rumbling = id(SndPtr_Rumbling) ; B7
SndID_Fly = id(SndPtr_Fly) ; B9
SndID_Smash = id(SndPtr_Smash) ; B9
SndID_Tired = id(SndPtr_Tired) ; B9
SndID_DoorSlam = id(SndPtr_DoorSlam) ; BB
SndID_SpindashRelease = id(SndPtr_SpindashRelease) ; BC
SndID_Hammer = id(SndPtr_Hammer) ; BD
SndID_Roll = id(SndPtr_Roll) ; BE
SndID_ContinueJingle = id(SndPtr_ContinueJingle) ; BF
SndID_CasinoBonus = id(SndPtr_CasinoBonus) ; C0
SndID_Explosion = id(SndPtr_Explosion) ; C1
SndID_WaterWarning = id(SndPtr_WaterWarning) ; C2
SndID_EnterGiantRing = id(SndPtr_EnterGiantRing) ; C3
SndID_BossExplosion = id(SndPtr_BossExplosion) ; C4
SndID_TallyEnd = id(SndPtr_TallyEnd) ; C5
SndID_RingSpill = id(SndPtr_RingSpill) ; C6
SndID_Flamethrower = id(SndPtr_Flamethrower) ; C8
SndID_Bonus = id(SndPtr_Bonus) ; C9
SndID_SpecStageEntry = id(SndPtr_SpecStageEntry) ; CA
SndID_SlowSmash = id(SndPtr_SlowSmash) ; CB
SndID_Spring = id(SndPtr_Spring) ; CC
SndID_Blip = id(SndPtr_Blip) ; CD
SndID_RingLeft = id(SndPtr_RingLeft) ; CE
SndID_Signpost = id(SndPtr_Signpost) ; CF
SndID_CNZBossZap = id(SndPtr_CNZBossZap) ; D0
SndID_Signpost2P = id(SndPtr_Signpost2P) ; D3
SndID_OOZLidPop = id(SndPtr_OOZLidPop) ; D4
SndID_SlidingSpike = id(SndPtr_SlidingSpike) ; D5
SndID_CNZElevator = id(SndPtr_CNZElevator) ; D6
SndID_PlatformKnock = id(SndPtr_PlatformKnock) ; D7
SndID_BonusBumper = id(SndPtr_BonusBumper) ; D8
SndID_LargeBumper = id(SndPtr_LargeBumper) ; D9
SndID_Gloop = id(SndPtr_Gloop) ; DA
SndID_PreArrowFiring = id(SndPtr_PreArrowFiring) ; DB
SndID_Fire = id(SndPtr_Fire) ; DC
SndID_ArrowStick = id(SndPtr_ArrowStick) ; DD
SndID_Helicopter = id(SndPtr_Helicopter) ; DE
SndID_SuperTransform = id(SndPtr_SuperTransform) ; DF
SndID_SpindashRev = id(SndPtr_SpindashRev) ; E0
SndID_Rumbling2 = id(SndPtr_Rumbling2) ; E1
SndID_CNZLaunch = id(SndPtr_CNZLaunch) ; E2
SndID_Flipper = id(SndPtr_Flipper) ; E3
SndID_HTZLiftClick = id(SndPtr_HTZLiftClick) ; E4
SndID_Leaves = id(SndPtr_Leaves) ; E5
SndID_MegaMackDrop = id(SndPtr_MegaMackDrop) ; E6
SndID_DrawbridgeMove = id(SndPtr_DrawbridgeMove) ; E7
SndID_QuickDoorSlam = id(SndPtr_QuickDoorSlam) ; E8
SndID_DrawbridgeDown = id(SndPtr_DrawbridgeDown) ; E9
SndID_LaserBurst = id(SndPtr_LaserBurst) ; EA
SndID_Scatter = id(SndPtr_Scatter) ; EB
SndID_LaserFloor = id(SndPtr_LaserFloor) ; EB
SndID_Teleport = id(SndPtr_Teleport) ; EC
SndID_Error = id(SndPtr_Error) ; ED
SndID_MechaSonicBuzz = id(SndPtr_MechaSonicBuzz) ; EE
SndID_LargeLaser = id(SndPtr_LargeLaser) ; EF
SndID_OilSlide = id(SndPtr_OilSlide) ; F0
SndID__End = id(SndPtr__End) ; F1
if MOMPASS == 2
if SndID__End > CmdID__First
fatal "You have too many SndPtrs. SndID__End ($\{SndID__End}) can't exceed CmdID__First ($\{CmdID__First})."
endif
endif
sfx_Switch = SndID_Blip
sfx_Starpost = SndID_Checkpoint
sfx_Perfect = SndID_ContinueJingle
sfx_EnterSS = SndID_SpecStageEntry
sfx_SmallBumpers = SndID_Bumper
sfx_SlotMachine = SndID_CasinoBonus
; Sound command IDs
offset := zCommandIndex
ptrsize := 4
idstart := $F8
CmdID__First = idstart
MusID_StopSFX = id(CmdPtr_StopSFX) ; F8
MusID_FadeOut = id(CmdPtr_FadeOut) ; F9
SndID_SegaSound = id(CmdPtr_SegaSound) ; FA
MusID_SpeedUp = id(CmdPtr_SpeedUp) ; FB
MusID_SlowDown = id(CmdPtr_SlowDown) ; FC
MusID_Stop = id(CmdPtr_Stop) ; FD
CmdID__End = id(CmdPtr__End) ; FE
MusID_Pause = $7F ; FE
MusID_Unpause = $80 ; FF
; 2P VS results screens
offset := TwoPlayerResultsPointers
ptrsize := 8
idstart := 0
VsRSID_Act = id(VsResultsScreen_Act) ; 0
VsRSID_Zone = id(VsResultsScreen_Zone) ; 1
VsRSID_Game = id(VsResultsScreen_Game) ; 2
VsRSID_SS = id(VsResultsScreen_SS) ; 3
VsRSID_SSZone = id(VsResultsScreen_SSZone) ; 4
; Animation IDs
offset := SonicAniData
ptrsize := 2
idstart := 0
AniIDSonAni_Walk = id(SonAni_Walk_ptr) ; 0 ; 0
AniIDSonAni_Run = id(SonAni_Run_ptr) ; 1 ; 1
AniIDSonAni_Roll = id(SonAni_Roll_ptr) ; 2 ; 2
AniIDSonAni_Roll2 = id(SonAni_Roll2_ptr) ; 3 ; 3
AniIDSonAni_Push = id(SonAni_Push_ptr) ; 4 ; 4
AniIDSonAni_Wait = id(SonAni_Wait_ptr) ; 5 ; 5
AniIDSonAni_Balance = id(SonAni_Balance_ptr) ; 6 ; 6
AniIDSonAni_LookUp = id(SonAni_LookUp_ptr) ; 7 ; 7
AniIDSonAni_Duck = id(SonAni_Duck_ptr) ; 8 ; 8
AniIDSonAni_Spindash = id(SonAni_Spindash_ptr) ; 9 ; 9
AniIDSonAni_Blink = id(SonAni_Blink_ptr) ; 10 ; $A
AniIDSonAni_GetUp = id(SonAni_GetUp_ptr) ; 11 ; $B
AniIDSonAni_Balance2 = id(SonAni_Balance2_ptr) ; 12 ; $C
AniIDSonAni_Stop = id(SonAni_Stop_ptr) ; 13 ; $D
AniIDSonAni_Float = id(SonAni_Float_ptr) ; 14 ; $E