More analysis
authorNick Downing <nick@ndcode.org>
Tue, 28 Jun 2022 18:06:21 +0000 (04:06 +1000)
committerNick Downing <nick@ndcode.org>
Tue, 28 Jun 2022 18:06:21 +0000 (04:06 +1000)
galaxian/galaxian.txt

index fddad13..75e95ef 100644 (file)
@@ -30,19 +30,33 @@ items
 # lo byte of (shift count * 0x80) + shape
 # also y coordinate temporary storage
 0x0017,0x0001,draw_temp,byte
+# saves value of ships before increment
+0x0018,0x0001,score_temp,byte
 0x0020,0x0001,draw_x_save,byte
 # high score in 4-digit BCD
 0x0023,0x0002,high_score,byte
 # cleared when keyboard input occurs
 # I think it controls demo mode, 0 for play mode
 0x0025,0x0001,demo_mode,byte
+# I think this controls awarding of bonus ships
+0x0026,0x0001,score_threshold,byte
 # score in 4-digit BCD
 0x0029,0x0002,score,byte
 0x0036,0x0001,starfield_count,byte
 # ships in 2-digit BCD
 0x0069,0x0001,ships,byte
+0x006a,0x0001,active_aliens,byte
+# gets set to value of bvar_48a0 when win awarded
+# does it cause a new phalanx of aliens to appear?
+0x0071,0x0001,new_level_flag,byte
 # wins in 2-digit BCD
 0x0072,0x0001,wins,byte
+# saves x reg during calculation
+0x0091,0x0001,score_x_save,byte
+# bits 0 and 7 seem to be used for something
+# there seem to be aliens 0x01 (maybe 0x00) to 0x12
+# or maybe entry 0 is used for currently processing alien
+0x00c1,0x0012,alien_status,byte
 0x2000,0x0028,VIDEO_LINE_00,byte
 0x2028,0x0028,VIDEO_LINE_40,byte
 0x2050,0x0028,VIDEO_LINE_80,byte
@@ -243,17 +257,25 @@ items
 0x485e,0x0001,high_score_x,byte
 0x4860,0x0001,score_y,byte
 0x4862,0x0001,score_x,byte
-0x486e,0x0001,y_velocity,byte
-0x4870,0x0001,x_velocity_lo,byte
+0x486e,0x0001,shell_y_velocity,byte
+0x4870,0x0001,shell_x_velocity_fraction,byte
+0x4872,0x0001,missile_y_velocity,byte
 0x4886,0x0001,high_score_init,byte
+# ships won't be redrawn if they exceed this
+0x48a4,0x0001,max_displayed_ships,byte
 0x48aa,0x0001,starfield_count_init,byte
 # used for clearing the screen in the beginning
 # seems to be x0, x1, y0, y1
 # it will be offset by the centre values x = 0x6c, y = 0x20
 0x48b2,0x0004,screen_size,byte
+# added to score, presumably when alien is destroyed
+0x48ca,0x0004,points_table,byte
 0x48de,0x0010,title_display_delay,byte
 0x48ee,0x0010,title_display_y,byte
 0x48fe,0x0010,title_display_x,byte
+# the basic shape
+# a value from a lookup table gets added to this
+0x4c01,0x0012,alien_shapes,byte
 0x7280,0x0380,shape_data_ptr_lo,byte
 0x7600,0x0380,shape_data_ptr_hi,byte
 0x7980,0x0380,shape_width_bytes,byte
@@ -264,17 +286,17 @@ items
 0x8b80,0x0080,misc_shape_width_bytes,byte
 0x8c00,0x0080,misc_shape_height,byte
 0x8c81,0x0028,star_x,byte
-0x8cf1,0x0008,y_8cf1,byte
-0x8d01,0x0008,velocity_hi_8d01,byte
-0x8d11,0x0008,x_hi_8d11,byte
-0x8d21,0x0008,x_lo_8d21,byte
+0x8cf1,0x0008,shell_y,byte
+0x8d01,0x0008,shell_x_velocity,byte
+0x8d11,0x0008,shell_x,byte
+0x8d21,0x0008,shell_x_fraction,byte
 0x8d31,0x0028,star_y,byte
 0x8df1,0x0028,star_shape_left,byte
 0x8e51,0x0028,star_shape_right,byte
 0x8eb1,0x0028,star_y_velocity,byte
-0x8f71,0x0001,y_8f71,byte
+0x8f71,0x0001,missile_y,byte
 0x8f79,0x0028,move_starfield_table,byte
-0x8fe1,0x0001,x_8fe1,byte
+0x8fe1,0x0001,missile_x,byte
 0x9028,0x0012,y_9028,byte
 0x90a8,0x0012,x_90a8,byte
 0x937c,0x0001,init_bvar_0019,byte
@@ -346,14 +368,25 @@ items
 0x98e5,0x0001,,code_ign # accessing video_line_table before clipping y
 0x990a,0x0001,,code_ign # accessing video_line_table before clipping y
 0x990f,0x0001,,code_ign # accessing video_line_table before clipping y
-0x9eec,0x0001,get_shape_9eec,code
+# these get barr_9168[current alien] added to them and stored where indicated
+0x9ad7,0x0002,ptr_9ef1_base,word
+0x9ad9,0x0002,ptr_9efe_base,word
+0x9adb,0x0002,ptr_9f18_base,word
+# this is probably called when we start to process a certain alien
+# it sets lookup tables that are used for animating the shape and other things
+0x9cb1,0x0001,setup_ptr_9ef1_ptr_9efe_ptr_9f18,code
+0x9eec,0x0001,get_alien_shape_9eec,code
 0x9ef7,0x0001,physics_9ef7,code
 0x9f22,0x0001,physics_9f22,code
-0x9f5b,0x0001,add_velocity_to_position,code
-0x9f7d,0x0001,add_x_velocity_to_position,code
-0x9f88,0x0001,move_shape_9f88,code
+0x9f5b,0x0001,move_shell_by_velocity,code
+0x9f7d,0x0001,move_missile_by_velocity,code
+0x9f88,0x0001,move_alien_shape_9f88,code
 0x9fcf,0x0001,move_missile,code
 0xa018,0x0001,move_shell,code
+0xa061,0x0001,maybe_move_ship,code
+0xa098,0x0001,maybe_award_points,code
+0xa0d3,0x0001,calculate_xy_a0d3,code
+0xa0d9,0x0001,calculate_xy_a0d9,code
 0xa0f4,0x0001,clip_xy,code
 0xa10d,0x0001,move_ship,code
 0xa12e,0x0001,move_shape_a12e,code
@@ -361,9 +394,16 @@ items
 0xa156,0x0001,get_new_position,code
 0xa15f,0x0001,get_shape_a15f,code
 0xa167,0x0001,do_erase_shape,code
+# might also be doing collision detection?
+0xa173,0x0001,award_points,code
 # returns a = object x - 3, y = object y
 0xa205,0x0001,get_old_position,code
-0xa22e,0x0001,move_shape_a22e,code
+# it can calculate a foot or an explosion shape
+# it can also return a value from a table directly
+0xa20f,0x0001,get_alien_shape_a20f,code
+0xa22e,0x0001,move_alien_shape_a22e,code
+# called when an alien is killed and needs to be erased
+# decrements active_aliens, awards a win if decremented to zero
 0xa264,0x0001,erase_shape_a264,code
 0xa281,0x0001,erase_missile,code
 0xa2a6,0x0001,erase_shell,code