More analysis of alien movement
authorNick Downing <nick@ndcode.org>
Wed, 29 Jun 2022 13:51:51 +0000 (23:51 +1000)
committerNick Downing <nick@ndcode.org>
Wed, 29 Jun 2022 13:54:04 +0000 (23:54 +1000)
galaxian/galaxian.txt

index 5d2b5db..2eb9f94 100644 (file)
@@ -81,16 +81,22 @@ items
 0x0071,0x0001,new_level_flag,byte
 # wins in 2-digit BCD
 0x0072,0x0001,wins,byte
-0x0073,0x0001,gal_bvar_0073,byte
-0x0074,0x0001,gal_bvar_0074,byte
-0x0075,0x0001,gal_bvar_0075,byte
+# bit 7 set when formation exceeds its bounds
+0x0073,0x0001,formation_flag,byte
+# value of (x, y) which is outside formation bounds
+# probably used to determine new direction of movement
+0x0074,0x0001,formation_outside_x,byte
+0x0075,0x0001,formation_outside_y,byte
 0x0076,0x0001,gal_bvar_0076,byte
 0x0078,0x0001,gal_bvar_0078,byte
 0x0079,0x0001,gal_bvar_0079,byte
 0x007a,0x0001,gal_bvar_007a,byte
 0x007b,0x0001,gal_bvar_007b,byte
 0x007c,0x0001,gal_bvar_007c,byte
+# set to monotonic_492e[gal_bvar_007e]
 0x007d,0x0001,gal_bvar_007d,byte
+# it increments up to a maximum of 0x0f
+# is it to do with the formation shape or difficulty level?
 0x007e,0x0001,gal_bvar_007e,byte
 0x007f,0x0001,gal_bvar_007f,byte
 0x0080,0x0001,gal_bvar_0080,byte
@@ -314,9 +320,9 @@ items
 0x485e,0x0001,high_score_x,byte
 0x4860,0x0001,score_y,byte
 0x4862,0x0001,score_x,byte
-0x4864,0x0001,gal_bvar_4864,byte
-0x4866,0x0001,gal_bvar_4866,byte
-0x4868,0x0001,gal_bvar_4868,byte
+0x4864,0x0001,formation_centre_y,byte
+0x4866,0x0001,formation_centre_x,byte
+0x4868,0x0001,alien_orientation_init,byte
 0x486c,0x0001,gal_bvar_486c,byte
 0x486e,0x0001,shell_y_velocity,byte
 0x4870,0x0001,shell_x_velocity_fraction,byte
@@ -356,11 +362,18 @@ items
 0x48bb,0x0001,gal_bvar_48bb,byte
 0x48bc,0x0001,gal_bvar_48bc,byte
 0x48bd,0x0001,gal_bvar_48bd,byte
-0x48c2,0x0001,gal_bvar_48c2,byte
-0x48c3,0x0001,gal_bvar_48c3,byte
-0x48c4,0x0001,gal_bvar_48c4,byte
-0x48c5,0x0001,gal_bvar_48c5,byte
-0x48c9,0x0001,gal_bvar_48c9,byte
+# formation inner bounds?
+# used to determine if alien should be moved in formation
+0x48c2,0x0001,formation_inner_x0,byte
+0x48c3,0x0001,formation_inner_x1,byte
+0x48c4,0x0001,formation_inner_y0,byte
+0x48c5,0x0001,formation_inner_y1,byte
+# formation outer bounds?
+# used to determine if formation should change direction?
+0x48c6,0x0001,formation_outer_x0,byte
+0x48c7,0x0001,formation_outer_x1,byte
+0x48c8,0x0001,formation_outer_y0,byte
+0x48c9,0x0001,formation_outer_y1,byte
 # added to score, presumably when alien is destroyed
 0x48ca,0x0004,points_table,byte
 # sizes have not been examined yet
@@ -378,8 +391,8 @@ items
 # then zeros... padding?
 0x49c0,0x0040,alien_49c0,byte
 0x4a00,0x0040,alien_4a00,byte
-0x4a40,0x0040,alien_4a40,byte
-0x4a80,0x0040,alien_4a80,byte
+0x4a40,0x0040,alien_formation_y,byte
+0x4a80,0x0040,alien_formation_x,byte
 0x4ac0,0x0040,alien_4ac0,byte
 0x4b00,0x0040,alien_4b00,byte
 0x4b40,0x0040,alien_4b41,byte
@@ -441,8 +454,10 @@ items
 # a value 0x00..0xff which I think is the angle
 # it is applied to one of the ptr_9ef1_table pages
 0x8fe8,0x0040,alien_orientation,byte
+# 0th entry is used to hold the y value of the formation
 0x9028,0x0040,alien_y,byte
 0x9068,0x0040,alien_9068,byte
+# 0th entry is used to hold the x value of the formation
 0x90a8,0x0040,alien_x,byte
 0x90e8,0x0040,alien_90e8,byte
 # I think this gets used when the alien is in formation
@@ -454,7 +469,7 @@ items
 # ptr_9f18 <- ptr_9f18_base + alien_kind[alien] * 0x100
 0x9168,0x0040,alien_kind,byte
 0x91a8,0x0040,alien_91a8,byte
-# seems to be a counter, low 3 bits used to animate the foot
+# seems to be a counter, low 2 bits used to animate the foot
 # also gets compared against gal_bvar_488e, some kind of threshold?
 0x91e8,0x0040,alien_animate,byte
 # flag which is nonzero to draw a foot? or does it have other uses?
@@ -556,11 +571,12 @@ items
 0x9ad7,0x0002,ptr_9ef1_base,word,byte
 0x9ad9,0x0002,ptr_9efe_base,word,byte
 0x9adb,0x0002,ptr_9f18_base,word,byte
-0x9add,0x0001,gal_sub_9add,code
-0x9b2d,0x0001,gal_sub_9b2d,code
-0x9b34,0x0001,gal_loc_9b34,code
-0x9b9e,0x0001,gal_sub_9b9e,code
-0x9bdc,0x0001,gal_sub_9bdc,code
+0x9add,0x0001,init_game,code
+0x9b2d,0x0001,maybe_activate_aliens,code
+0x9b34,0x0001,activate_aliens,code
+0x9b93,0x0001,zero_bvar_006b_bvar_0076_bvar_0080_bvar_0073,code
+0x9b9e,0x0001,check_formation_bounds,code
+0x9bdc,0x0001,move_alien_in_formation,code
 0x9bfe,0x0001,init_alien,code
 0x9c10,0x0001,gal_sub_9c10,code
 0x9c85,0x0001,gal_sub_9c85,code