# these values come from do_microcode_pair (I think the only external caller)
# does ldx *microcode_pair_object first, so in below, "object" refers to this
# 1st byte:
-# < 0x10: go to check_microcode_status_bits
+# < 0x10: go to microcode_escape
# if 1st byte bit 0 = 1, only do the rest if demo mode (otherwise continue)
# if 1st byte bit 1 = 1, only do the rest if NOT demo mode (otherwise done)
# < 0x04: go to 2$
# = 0x0f: if object is active, make it inactive and erase it
0x0fdd,0x0001,microcode_pair,code
0x1009,0x0001,vector_to_microcode,code
-0x1016,0x0001,check_microcode_status_bits,code
+0x1016,0x0001,microcode_escape,code
# enter with a = value for microcode_pair_object, microcode_ptr_c0 setup,
# y = index into table at microcode_ptr_c0 (it will be incremented twice)
-# routine loads a command from the microcode table and calls microcode_pair
+# routine loads first byte from the microcode table and calls microcode_pair
0x106a,0x0001,do_microcode_pair,code
0x107c,0x0001,decimal_zero,code
# zf=1 -> go to loc_10cd
# otherwise load microcode_start_sentinel from object1080_start_sentinel,
# and enter a loop scanning microcode table at microcode_ptr_c0 from index 0,
# when value read from microcode table is:
-# 0 go to loc_10cd
-# >= 0xf0 see if it's the start sentinel in microcode_start_sentinel
+# == 0x00: go to loc_10cd
+# >= 0xf0: see if it's the start sentinel in microcode_start_sentinel
# if it's not then keep skipping 2 locations until end of table or found
# when found, skip 2 locations and check for more commands (0 is end of
# table, >= 0xf0 is a different section, otherwise execute + zf=0 repeat
0x1160,0x0001,reset_object_state,code
0x11a7,0x0001,make_object_active_and_compute_bounds,code
0x11b2,0x0001,make_object_inactive_and_erase,code
-0x11bd,0x0001,countdown_b120_or_b190_expired,code
-0x1291,0x0001,homing_test,code
+# called from update_object, when:
+# object1080_countdown_b120 or object1080_countdown_b190 expires
+0x11bd,0x0001,execute_microcode_table_5520,code
+# called from update_object, when:
+# test_object_collision returns cf=1
+0x11cd,0x0001,execute_microcode_table_5720,code
+# called from update_object for objects >= 40, when:
+# object1080_x_hi outside [object4080_x_hi_min, object4080_x_hi_max)
+0x11dd,0x0001,execute_microcode_table_5800,code
+# called from update_object for objects >= 40, when:
+# object1080_y_hi outside [object4080_y_hi_min, object4080_y_hi_max)
+0x11ed,0x0001,execute_microcode_table_5880,code
+# called from update_object for objects >= 60, when:
+# object1080_start_sentinel == 0xf0
+# and then test_object_fire_14ef returns cf=1
+0x11fd,0x0001,execute_microcode_table_5a00,code
+# called from update_object for objects >= 60, when:
+# object1080_start_sentinel == 0xf1
+# and then test_object_fire_150f returns cf=1
+0x1222,0x0001,execute_microcode_table_5a80,code
+# called from update_object for objects >= 60, when:
+# object1080_start_sentinel == 0xf2
+# and then test_object_fire_1549 returns cf=1
+0x1247,0x0001,execute_microcode_table_5b00,code
+# called from update_object for objects >= 60, when:
+# object1080_start_sentinel == 0xf3
+# and then test_object_fire_1569 returns cf=1
+0x126c,0x0001,execute_microcode_table_5b80,code
+# called from accelerate_object_towards_another
+# seems to have a chance to intervene in the homing logic
+0x1291,0x0001,execute_microcode_table_5920,code
0x12e1,0x0001,accelerate_object_towards_another,code
0x133f,0x0001,sign_extend_a_to_ya_asl_by_4,code
0x1350,0x0001,accelerate_object_somehow,code
0x1388,0x0001,move_object_by_velocity,code
-0x13d0,0x0001,object_overlap_loop,code
+0x13d0,0x0001,test_object_collision,code
0x1447,0x0001,accelerate_object_anyhow,code
-0x150f,0x0001,test_object_fire,code
-0x153f,0x0001,dummy_test_fire,code
-0x1542,0x0001,do_test_fire,code
+0x14ef,0x0001,test_object_fire_14ef,code
+0x150f,0x0001,test_object_fire_150f,code
+0x152c,0x0001,test_object_fire_entry,code
+0x153f,0x0001,test_object_fire_false,code
+0x1542,0x0001,test_object_fire_player,code
+0x1549,0x0001,test_object_fire_1549,code
+0x1569,0x0001,test_object_fire_1569,code
0x1589,0x0001,objects_init,code
0x1595,0x0001,objects_init_entry,code
+0x15d7,0x0001,maybe_calculate_object_shape_and_update,code
0x15ee,0x0001,update_object,code
+0x15ff,0x0001,update_object_entry,code
0x16ae,0x0001,all_init,code
0x16f1,0x0001,clear_demo_mode_set_mission_from_a,code
0x16f7,0x0001,set_demo_mode_set_mission_from_a,code
0x4f40,0x0040,object4080_4f40,byte
0x4f80,0x0040,object4080_x_random_base,byte
0x4fc0,0x0040,object4080_x_random_range,byte
-0x5000,0x0040,object4080_5000,byte
-0x5040,0x0040,object4080_5040,byte
+0x5000,0x0040,object4080_x_hi_min,byte
+0x5040,0x0040,object4080_x_hi_max,byte
0x5080,0x0040,object4080_y_random_base,byte
0x50c0,0x0040,object4080_y_random_range,byte
-0x5100,0x0040,object4080_5100,byte
-0x5140,0x0040,object4080_5140,byte
+0x5100,0x0040,object4080_y_hi_min,byte
+0x5140,0x0040,object4080_y_hi_max,byte
0x5180,0x0030,object5080_x_difference,byte
0x51b0,0x0030,object5080_y_difference,byte
0x5240,0x0030,object5080_difference_5240,byte