UCODE_SOUND_EFFECT = 0x010c
; control game
-UCODE_CONTROL_GAME_CLEAR_DEMO_SET_MISSION = 0x0000
-UCODE_CONTROL_GAME_SET_DEMO_SET_MISSION = 0x2000
-UCODE_CONTROL_GAME_START_GAME = 0x4000
+UCODE_CONTROL_GAME_CLEAR_DEMO = 0x1000
+UCODE_CONTROL_GAME_SET_DEMO = 0x2000
+UCODE_CONTROL_GAME_START_GAME = 0x3000
UCODE_CONTROL_GAME_START_GAME_DEMO = 0xa000
+; control game set mission
+UCODE_CONTROL_GAME_SET_MISSION_1 = 0x0100
+UCODE_CONTROL_GAME_SET_MISSION_2 = 0x0200
+UCODE_CONTROL_GAME_SET_MISSION_3 = 0x0300
+UCODE_CONTROL_GAME_SET_MISSION_4 = 0x0400
+UCODE_CONTROL_GAME_SET_MISSION_5 = 0x0500
+UCODE_CONTROL_GAME_SET_MISSION_6 = 0x0600
+UCODE_CONTROL_GAME_SET_MISSION_7 = 0x0700
+UCODE_CONTROL_GAME_SET_MISSION_8 = 0x0800
+UCODE_CONTROL_GAME_SET_MISSION_9 = 0x0900
+UCODE_CONTROL_GAME_SET_MISSION_A = 0x0a00
+UCODE_CONTROL_GAME_SET_MISSION_B = 0x0b00
+UCODE_CONTROL_GAME_SET_MISSION_C = 0x0c00
+UCODE_CONTROL_GAME_SET_MISSION_D = 0x0d00
+UCODE_CONTROL_GAME_SET_MISSION_E = 0x0e00
+UCODE_CONTROL_GAME_SET_MISSION_F = 0x0f00
+
; decimal
UCODE_DECIMAL_DRAW = 0x2000
UCODE_DECIMAL_SET = 0x3000
value1.append(defs['escape bits 2 to 3'][k])
j &= 0xff00
if k == 0: # control game
- value1.append(defs['control game'].get(j, f'0x{j:04x}'))
+ k = j & 0xf000
+ value1.append(defs['control game'].get(k, f'0x{k:04x}'))
+ j &= 0xf00
+ if j in defs['control game set mission']:
+ value1.append(defs['control game set mission'][j])
elif k == 4: # decimal
k = j & 0xf000
value1.append(defs['decimal'].get(k, f'0x{k:04x}'))
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
+# takes mission number in x, does not set mission if x = 0
+0x16f1,0x0001,clear_demo_set_mission,code
+# takes mission number in x, does not set mission if x = 0
+0x16f7,0x0001,set_demo_set_mission,code
0x16fd,0x0001,inc_mission,code
0x1708,0x0001,init_game,code,,10000 # suppress local for patch
0x1719,0x0001,start_game_demo,code
0x171b,0x0001,start_game,code,,10000 # suppress local for patch
0x1750,0x0001,test_key,code
0x1797,0x0001,read_buttons,code
-0x17b1,0x0001,vector_to_start_game,code
+0x17b1,0x0001,not_demo_vector_to_start_game,code
0x17b6,0x0001,check_control_characters,code
0x17d1,0x0001,start,code
0x1800,0x0001,divide_a_by_y,code