-
Notifications
You must be signed in to change notification settings - Fork 0
/
s2.constants.asm
2554 lines (2292 loc) · 97.1 KB
/
s2.constants.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
; >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
; Equates section - Names for variables.
; ---------------------------------------------------------------------------
; 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 = $2F00
Size_of_SEGA_sound = $6174
Size_of_Snd_driver_guess = $F64 ; 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:
id = 0 ; object ID (if you change this, change insn1op and insn2op in s2.macrosetup.asm, if you still use them)
render_flags = 1 ; bitfield ; bit 7 = onscreen flag, bit 0 = x mirror, bit 1 = y mirror, bit 2 = coordinate system, bit 6 = render subobjects
art_tile = 2 ; and 3 ; start of sprite's art
mappings = 4 ; and 5 and 6 and 7
x_pos = 8 ; and 9 ... some objects use $A and $B as well when extra precision is required (see ObjectMove) ... for screen-space objects this is called x_pixel instead
x_sub = $A ; and $B
y_pos = $C ; and $D ... some objects use $E and $F as well when extra precision is required ... screen-space objects use y_pixel instead
y_sub = $E ; and $F
priority = $18 ; 0 = front
width_pixels = $19
mapping_frame = $1A
; ---------------------------------------------------------------------------
; conventions followed by most objects:
x_vel = $10 ; and $11 ; horizontal velocity
y_vel = $12 ; and $13 ; vertical velocity
y_radius = $16 ; collision height / 2
x_radius = $17 ; collision width / 2
anim_frame = $1B
anim = $1C
prev_anim = $1D
anim_frame_duration = $1E
status = $22 ; note: exact meaning depends on the object... for Sonic/Tails: bit 0: left-facing. bit 1: in-air. bit 2: spinning. bit 3: on-object. bit 4: roll-jumping. bit 5: pushing. bit 6: underwater.
routine = $24
routine_secondary = $25
angle = $26 ; angle about the z axis (360 degrees = 256)
; ---------------------------------------------------------------------------
; conventions followed by many objects but NOT Sonic/Tails:
collision_flags = $20
collision_property = $21
respawn_index = $23
subtype = $28
; ---------------------------------------------------------------------------
; conventions specific to Sonic/Tails (Obj01, Obj02, and ObjDB):
; note: $1F, $20, and $21 are unused and available (however, $1F is cleared by loc_A53A and ObjB2_Landed_on_plane)
inertia = $14 ; and $15 ; directionless representation of speed... not updated in the air
flip_angle = $27 ; angle about the x axis (360 degrees = 256) (twist/tumble)
air_left = $28
flip_turned = $29 ; 0 for normal, 1 to invert flipping (it's a 180 degree rotation about the axis of Sonic's spine, so he stays in the same position but looks turned around)
obj_control = $2A ; 0 for normal, 1 for hanging or for resting on a flipper, $81 for going through CNZ/OOZ/MTZ tubes or stopped in CNZ cages or stoppers or flying if Tails
status_secondary = $2B
flips_remaining = $2C ; number of flip revolutions remaining
flip_speed = $2D ; number of flip revolutions per frame / 256
move_lock = $2E ; and $2F ; horizontal control lock, counts down to 0
invulnerable_time = $30 ; and $31 ; time remaining until you stop blinking
invincibility_time = $32 ; and $33 ; remaining
speedshoes_time = $34 ; and $35 ; remaining
next_tilt = $36 ; angle on ground in front of sprite
tilt = $37 ; angle on ground
stick_to_convex = $38 ; 0 for normal, 1 to make Sonic stick to convex surfaces like the rotating discs in Sonic 1 and 3 (unused in Sonic 2 but fully functional)
spindash_flag = $39 ; 0 for normal, 1 for charging a spindash or forced rolling
pinball_mode = spindash_flag
spindash_counter = $3A ; and $3B
restart_countdown = spindash_counter; and 1+spindash_counter
jumping = $3C
interact = $3D ; RAM address of the last object Sonic stood on, minus $FFFFB000 and divided by $40
top_solid_bit = $3E ; the bit to check for top solidity (either $C or $E)
lrb_solid_bit = $3F ; the bit to check for left/right/bottom solidity (either $D or $F)
; ---------------------------------------------------------------------------
; conventions followed by several objects but NOT Sonic/Tails:
y_pixel = 2+x_pos ; and 3+x_pos ; y coordinate for objects using screen-space coordinate system
x_pixel = x_pos ; and 1+x_pos ; x coordinate for objects using screen-space coordinate system
parent = objoff_3E ; and $3F ; address of object that owns or spawned this one, if applicable
; TODO: $2C is often parent instead (see LoadChildObject); consider defining parent2 = $2C and changing some objoff_2Cs to that
; ---------------------------------------------------------------------------
; conventions followed by some/most bosses:
boss_subtype = objoff_A
boss_invulnerable_time = objoff_14
boss_sine_count = mapping_frame
boss_routine = angle
boss_defeated = objoff_2C
boss_hitcount2 = objoff_32
boss_hurt_sonic = objoff_38 ; flag set by collision response routine when Sonic has just been hurt (by boss?)
; ---------------------------------------------------------------------------
; when childsprites are activated (i.e. bit #6 of render_flags set)
next_subspr = $6
mainspr_mapframe = objoff_B
mainspr_width = objoff_E
mainspr_childsprites = objoff_F ; amount of child sprites
mainspr_height = objoff_14
subspr_data = $10
sub2_x_pos = subspr_data+next_subspr*0+0 ;x_vel
sub2_y_pos = subspr_data+next_subspr*0+2 ;y_vel
sub2_mapframe = subspr_data+next_subspr*0+5
sub3_x_pos = subspr_data+next_subspr*1+0 ;y_radius
sub3_y_pos = subspr_data+next_subspr*1+2 ;priority
sub3_mapframe = subspr_data+next_subspr*1+5 ;anim_frame
sub4_x_pos = subspr_data+next_subspr*2+0 ;anim
sub4_y_pos = subspr_data+next_subspr*2+2 ;anim_frame_duration
sub4_mapframe = subspr_data+next_subspr*2+5 ;collision_property
sub5_x_pos = subspr_data+next_subspr*3+0 ;status
sub5_y_pos = subspr_data+next_subspr*3+2 ;routine
sub5_mapframe = subspr_data+next_subspr*3+5
sub6_x_pos = subspr_data+next_subspr*4+0 ;subtype
sub6_y_pos = subspr_data+next_subspr*4+2
sub6_mapframe = subspr_data+next_subspr*4+5
sub7_x_pos = subspr_data+next_subspr*5+0
sub7_y_pos = subspr_data+next_subspr*5+2
sub7_mapframe = subspr_data+next_subspr*5+5
sub8_x_pos = subspr_data+next_subspr*6+0
sub8_y_pos = subspr_data+next_subspr*6+2
sub8_mapframe = subspr_data+next_subspr*6+5
sub9_x_pos = subspr_data+next_subspr*7+0
sub9_y_pos = subspr_data+next_subspr*7+2
sub9_mapframe = subspr_data+next_subspr*7+5
; ---------------------------------------------------------------------------
; unknown or inconsistently used offsets that are not applicable to Sonic/Tails:
; (provided because rearrangement of the above values sometimes requires making space in here too)
objoff_A = x_sub+0 ; note: x_pos can be 4 bytes, but sometimes the last 2 bytes of x_pos are used for other unrelated things
objoff_B = x_sub+1 ; unused
objoff_E = y_sub+0 ; unused
objoff_F = y_sub+1 ; unused
objoff_10 = x_vel
objoff_14 = inertia+0
objoff_15 = inertia+1
objoff_1F = anim_frame_duration+1
objoff_27 = $27
objoff_28 = subtype ; overlaps subtype, but a few objects use it for other things anyway
enum objoff_29=$29,objoff_2A=$2A,objoff_2B=$2B,objoff_2C=$2C,objoff_2D=$2D,objoff_2E=$2E,objoff_2F=$2F
enum objoff_30=$30,objoff_31=$31,objoff_32=$32,objoff_33=$33,objoff_34=$34,objoff_35=$35,objoff_36=$36,objoff_37=$37
enum objoff_38=$38,objoff_39=$39,objoff_3A=$3A,objoff_3B=$3B,objoff_3C=$3C,objoff_3D=$3D,objoff_3E=$3E,objoff_3F=$3F
; ---------------------------------------------------------------------------
; Special Stage object properties:
ss_dplc_timer = respawn_index
ss_x_pos = objoff_2A
ss_x_sub = objoff_2C
ss_y_pos = objoff_2E
ss_y_sub = objoff_30
ss_init_flip_timer = objoff_32
ss_flip_timer = objoff_33
ss_z_pos = objoff_34
ss_hurt_timer = objoff_36
ss_slide_timer = objoff_37
ss_parent = objoff_38
ss_rings_base = objoff_3C ; word
ss_rings_hundreds = objoff_3C
ss_rings_tens = objoff_3D
ss_rings_units = objoff_3E
ss_last_angle_index = objoff_3F
; ---------------------------------------------------------------------------
; property of all objects:
object_size_bits = 6
object_size = 1<<object_size_bits ; 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
; ---------------------------------------------------------------------------
; Scroll Flags
scroll_flag_fg_up = 0
scroll_flag_fg_down = 1
scroll_flag_fg_left = 2
scroll_flag_fg_right = 3
scroll_flag_bg1_up = 0
scroll_flag_bg1_down = scroll_flag_bg1_up + 1
scroll_flag_bg1_left = 2
scroll_flag_bg1_right = scroll_flag_bg1_left + 1
scroll_flag_bg1_up_whole_row = 4
scroll_flag_bg1_down_whole_row = scroll_flag_bg1_up_whole_row + 1
scroll_flag_bg1_up_whole_row_2 = 6
scroll_flag_bg1_down_whole_row_2 = scroll_flag_bg1_up_whole_row_2 + 1
scroll_flag_bg2_left = 0
scroll_flag_bg2_right = 1
scroll_flag_bg3_left = 0
scroll_flag_bg3_right = 1
scroll_flag_advanced_bg_up = 0
scroll_flag_advanced_bg_down = 1
scroll_flag_advanced_bg1_left = 2
scroll_flag_advanced_bg1_right = 3
scroll_flag_advanced_bg2_left = 4
scroll_flag_advanced_bg2_right = 5
scroll_flag_advanced_bg3_left = 6
scroll_flag_advanced_bg3_right = 7
; ---------------------------------------------------------------------------
; 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
; ---------------------------------------------------------------------------
; 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
; 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
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_MilesLife2P = id(PLCptr_MilesLife2P) ; 6
PLCID_MilesLife = id(PLCptr_MilesLife) ; 7
PLCID_TailsLife2P = id(PLCptr_TailsLife2P) ; 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_Explosion = id(PLCptr_Explosion) ; 41
PLCID_ResultsTails = id(PLCptr_ResultsTails) ; 42
PLCID_Wz1 = id(PLCptr_Wz1) ; 43
PLCID_Wz2 = id(PLCptr_Wz2) ; 43
; 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_TitleIntro = id(ObjPtr_TitleIntro) ; 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_2PResults = id(ObjPtr_2PResults) ; 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 := 1
idstart := $81
; $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__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_MissileDissolve = id(SndPtr_MissileDissolve) ; 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_Smash = id(SndPtr_Smash) ; 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
; 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 = $7E+$80 ; FE
MusID_Unpause = $7F+$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 ; Exclusive to Sonic
AniIDSonAni_GetUp = id(SonAni_GetUp_ptr) ; 11 ; $B ; Exclusive to Sonic
AniIDSonAni_Balance2 = id(SonAni_Balance2_ptr) ; 12 ; $C ; Exclusive to Sonic
AniIDSonAni_Stop = id(SonAni_Stop_ptr) ; 13 ; $D
AniIDSonAni_Float = id(SonAni_Float_ptr) ; 14 ; $E
AniIDSonAni_Float2 = id(SonAni_Float2_ptr) ; 15 ; $F
AniIDSonAni_Spring = id(SonAni_Spring_ptr) ; 16 ; $10
AniIDSonAni_Hang = id(SonAni_Hang_ptr) ; 17 ; $11
AniIDSonAni_Dash2 = id(SonAni_Dash2_ptr) ; 18 ; $12 ; Unused.
AniIDSonAni_Dash3 = id(SonAni_Dash3_ptr) ; 19 ; $13 ; Unused.
AniIDSonAni_Hang2 = id(SonAni_Hang2_ptr) ; 20 ; $14
AniIDSonAni_Bubble = id(SonAni_Bubble_ptr) ; 21 ; $15
AniIDSonAni_DeathBW = id(SonAni_DeathBW_ptr) ; 22 ; $16
AniIDSonAni_Drown = id(SonAni_Drown_ptr) ; 23 ; $17
AniIDSonAni_Death = id(SonAni_Death_ptr) ; 24 ; $18
AniIDSonAni_Hurt = id(SonAni_Hurt_ptr) ; 25 ; $19
AniIDSonAni_Hurt2 = id(SonAni_Hurt2_ptr) ; 26 ; $1A
AniIDSonAni_Slide = id(SonAni_Slide_ptr) ; 27 ; $1B
AniIDSonAni_Blank = id(SonAni_Blank_ptr) ; 28 ; $1C
AniIDSonAni_Balance3 = id(SonAni_Balance3_ptr) ; 29 ; $1D ; Exclusive to Sonic
AniIDSonAni_Balance4 = id(SonAni_Balance4_ptr) ; 30 ; $1E ; Exclusive to Sonic
AniIDSupSonAni_Transform = id(SupSonAni_Transform_ptr) ; 31 ; $1F ; Exclusive to Sonic
AniIDSonAni_Lying = id(SonAni_Lying_ptr) ; 32 ; $20 ; Exclusive to Sonic
AniIDSonAni_LieDown = id(SonAni_LieDown_ptr) ; 33 ; $21 ; Exclusive to Sonic
offset := TailsAniData
ptrsize := 2
idstart := 0
AniIDTailsAni_HaulAss = id(TailsAni_HaulAss_ptr) ; 31 ; $1F
AniIDTailsAni_Fly = id(TailsAni_Fly_ptr) ; 32 ; $20
; Other sizes
palette_line_size = $10*2 ; 16 word entries
; Sprite queue
object_display_list_size_bits = 7
object_display_list_size = 1<<object_display_list_size_bits ; How big a list is
total_object_display_lists_bits = 3
total_object_display_lists = 1<<total_object_display_lists_bits ; How many lists there are
; ---------------------------------------------------------------------------
; I run the main 68k RAM addresses through this function
; to let them work in both 16-bit and 32-bit addressing modes.
ramaddr function x,-(-x)&$FFFFFFFF
; ---------------------------------------------------------------------------
; RAM variables - General
phase ramaddr($FFFF0000) ; Pretend we're in the RAM
RAM_Start:
Chunk_Table: ds.b $8000 ; was "Metablock_Table"
Chunk_Table_End:
Level_Layout: ds.b $1000
Level_Layout_End:
Block_Table: ds.w $C00
Block_Table_End:
TempArray_LayerDef: ds.b $200 ; used by some layer deformation routines
Decomp_Buffer: ds.b $200
Object_Display_Lists: ds.b object_display_list_size*total_object_display_lists ; in custom format before being converted and stored in Sprite_Table/Sprite_Table_P2
Object_Display_Lists_End:
Object_RAM: ; The various objects in the game are loaded in this area.
; Each game mode uses different objects, so some slots are reused.
; The section below declares labels for the objects used in main gameplay.
; Objects for other game modes are declared further down.
Reserved_Object_RAM: