{"schema":1,"platform":"c64","game":"darkman","part":"resident","title":"Darkman","build":"PAL original, two-sided G64; level 1 load in play","symbols_sha256":"b820197d8c6aabb57d820085c5a41bddff501e00201e13a7c67582ae8db7b8a1","snapshot":{"file":"play-level1.vsf","sha256":"87d620e84a39a71699e9648029e2c27c0f02864a0cbb847421a99a436d72d07a"},"index":[{"a":1,"n":"processor_port","k":"variable","len":1,"c":true},{"a":2,"n":"zero_page_unused_02","k":"table","len":18,"c":true},{"a":20,"n":"load_pointer_lo","k":"variable","len":1,"c":true},{"a":21,"n":"load_pointer_hi","k":"variable","len":1,"c":true},{"a":22,"n":"serial_byte","k":"table","len":64,"c":true},{"a":240,"n":"stream_ptr_lo","k":"variable","len":1,"c":true},{"a":241,"n":"stream_ptr_hi","k":"variable","len":1,"c":true},{"a":242,"n":"track_ptr_lo","k":"variable","len":1,"c":true},{"a":243,"n":"track_ptr_hi","k":"variable","len":1,"c":true},{"a":244,"n":"arp_entry_ptr_lo","k":"variable","len":1,"c":true},{"a":245,"n":"arp_entry_ptr_hi","k":"variable","len":1,"c":true},{"a":246,"n":"control_temp","k":"variable","len":1,"c":true},{"a":247,"n":"voice0_active","k":"variable","len":1,"c":true},{"a":248,"n":"voice1_active","k":"variable","len":1,"c":true},{"a":249,"n":"voice2_active","k":"variable","len":1,"c":true},{"a":250,"n":"voice_index","k":"variable","len":1,"c":true},{"a":251,"n":"zero_page_unused_fb","k":"table","len":5,"c":true},{"a":1024,"n":"loader_entry","k":"routine","len":7,"c":true},{"a":1031,"n":"next_level_load","k":"routine","len":32,"c":true},{"a":1032,"n":"b_0408","k":"branch","len":1,"c":false},{"a":1063,"n":"pad_0427","k":"table","len":8,"c":true},{"a":1071,"n":"reset_level_number","k":"routine","len":6,"c":true},{"a":1077,"n":"level_number","k":"variable","len":1,"c":true},{"a":1078,"n":"load_level_files","k":"routine","len":9,"c":true},{"a":1087,"n":"level_file_lo","k":"table","len":6,"c":true},{"a":1093,"n":"level_file_hi","k":"table","len":6,"c":true},{"a":1099,"n":"level_1_files","k":"table","len":11,"c":true},{"a":1110,"n":"file_list_cursor_start","k":"variable","len":1,"c":true},{"a":1111,"n":"level_2_files","k":"table","len":12,"c":true},{"a":1123,"n":"level_3_files","k":"table","len":12,"c":true},{"a":1135,"n":"level_4_files","k":"table","len":12,"c":true},{"a":1147,"n":"level_5_files","k":"table","len":12,"c":true},{"a":1159,"n":"level_6_files","k":"table","len":12,"c":true},{"a":1171,"n":"load_files","k":"routine","len":42,"c":true},{"a":1179,"n":"b_049B","k":"branch","len":1,"c":false},{"a":1188,"n":"b_04A4","k":"branch","len":1,"c":false},{"a":1201,"n":"b_04B1","k":"branch","len":1,"c":false},{"a":1213,"n":"next_list_byte","k":"routine","len":1,"c":true},{"a":1214,"n":"list_pointer_lo","k":"routine","len":1,"c":true},{"a":1215,"n":"list_pointer_hi","k":"routine","len":10,"c":true},{"a":1224,"n":"r_04C8","k":"branch","len":1,"c":false},{"a":1225,"n":"load_one_file","k":"routine","len":37,"c":true},{"a":1262,"n":"send_length_operand","k":"routine","len":59,"c":true},{"a":1277,"n":"j_04FD","k":"branch","len":1,"c":false},{"a":1305,"n":"b_0519","k":"branch","len":1,"c":false},{"a":1321,"n":"store_value_operand","k":"routine","len":29,"c":true},{"a":1337,"n":"b_0539","k":"branch","len":1,"c":false},{"a":1340,"n":"b_053C","k":"branch","len":1,"c":false},{"a":1341,"n":"b_053D","k":"branch","len":1,"c":false},{"a":1350,"n":"send_bytes","k":"routine","len":8,"c":true},{"a":1358,"n":"bus_start_operand","k":"routine","len":25,"c":true},{"a":1372,"n":"b_055C","k":"branch","len":1,"c":false},{"a":1383,"n":"read_serial_byte","k":"routine","len":18,"c":true},{"a":1400,"n":"r_0578","k":"branch","len":1,"c":false},{"a":1401,"n":"read_two_bits","k":"routine","len":1,"c":true},{"a":1402,"n":"read_bits_operand_1","k":"routine","len":15,"c":true},{"a":1417,"n":"read_bits_operand_2","k":"routine","len":11,"c":true},{"a":1428,"n":"send_serial_byte","k":"routine","len":15,"c":true},{"a":1443,"n":"send_two_bits","k":"routine","len":1,"c":true},{"a":1444,"n":"send_bits_operand_1","k":"routine","len":15,"c":true},{"a":1451,"n":"b_05AB","k":"branch","len":1,"c":false},{"a":1459,"n":"send_bits_operand_2","k":"routine","len":13,"c":true},{"a":1466,"n":"b_05BA","k":"branch","len":1,"c":false},{"a":1472,"n":"wait_for_drive","k":"routine","len":13,"c":true},{"a":1474,"n":"b_05C2","k":"branch","len":1,"c":false},{"a":1477,"n":"b_05C5","k":"branch","len":1,"c":false},{"a":1485,"n":"wait_operand","k":"routine","len":15,"c":true},{"a":1496,"n":"b_05D8","k":"branch","len":1,"c":false},{"a":1500,"n":"show_load_error","k":"routine","len":48,"c":true},{"a":1531,"n":"b_05FB","k":"branch","len":1,"c":false},{"a":1548,"n":"disc_error_text","k":"table","len":24,"c":true},{"a":1572,"n":"load_error","k":"variable","len":1,"c":true},{"a":1573,"n":"load_prompt","k":"routine","len":140,"c":true},{"a":1610,"n":"b_064A","k":"branch","len":1,"c":false},{"a":1625,"n":"b_0659","k":"branch","len":1,"c":false},{"a":1638,"n":"b_0666","k":"branch","len":1,"c":false},{"a":1647,"n":"j_066F","k":"branch","len":1,"c":false},{"a":1674,"n":"b_068A","k":"branch","len":1,"c":false},{"a":1677,"n":"b_068D","k":"branch","len":1,"c":false},{"a":1684,"n":"b_0694","k":"branch","len":1,"c":false},{"a":1692,"n":"b_069C","k":"branch","len":1,"c":false},{"a":1694,"n":"b_069E","k":"branch","len":1,"c":false},{"a":1713,"n":"insert_disk_text","k":"table","len":40,"c":true},{"a":1753,"n":"insert_disk_text_end","k":"variable","len":1,"c":true},{"a":1754,"n":"next_level_text","k":"table","len":40,"c":true},{"a":1794,"n":"loader_tail","k":"variable","len":2,"c":true},{"a":1796,"n":"saved_x","k":"variable","len":1,"c":true},{"a":1797,"n":"saved_y","k":"variable","len":1,"c":true},{"a":1798,"n":"sync_byte","k":"variable","len":1,"c":true},{"a":1799,"n":"file_name_buffer","k":"table","len":65,"c":true},{"a":1864,"n":"screen_row_21","k":"table","len":40,"c":true},{"a":1904,"n":"screen_row_22","k":"table","len":19,"c":true},{"a":1923,"n":"side_digit","k":"table","len":21,"c":true},{"a":1944,"n":"boot_leftover_routines","k":"table","len":104,"c":true},{"a":2048,"n":"boot_basic_stub","k":"table","len":13,"c":true},{"a":2061,"n":"boot_entry","k":"table","len":6,"c":true},{"a":2067,"n":"loader_load_image","k":"table","len":493,"c":true},{"a":2560,"n":"score_digits","k":"table","len":16,"c":true},{"a":2576,"n":"mask_result","k":"variable","len":1,"c":true},{"a":2577,"n":"skip_flag","k":"variable","len":1,"c":true},{"a":2578,"n":"credits","k":"variable","len":1,"c":true},{"a":2579,"n":"title_step_value","k":"table","len":13,"c":true},{"a":40960,"n":"tune_driver_flag","k":"variable","len":1,"c":true},{"a":40961,"n":"tune_hold_flag","k":"variable","len":1,"c":true},{"a":40962,"n":"tune_voice_scratch","k":"variable","len":1,"c":true},{"a":40963,"n":"tune_step_scratch","k":"variable","len":1,"c":true},{"a":40964,"n":"tune_note_countdown","k":"table","len":3,"c":true},{"a":40967,"n":"tune_fixed_length","k":"table","len":3,"c":true},{"a":40970,"n":"tune_wave_countdown","k":"table","len":3,"c":true},{"a":40973,"n":"tune_pulse_countdown","k":"table","len":3,"c":true},{"a":40976,"n":"tune_slide_countdown","k":"table","len":3,"c":true},{"a":40979,"n":"tune_filter_countdown","k":"variable","len":1,"c":true},{"a":40980,"n":"tune_track_index","k":"table","len":6,"c":true},{"a":40986,"n":"tune_track_lo","k":"table","len":3,"c":true},{"a":40989,"n":"tune_track_hi","k":"table","len":3,"c":true},{"a":40992,"n":"tune_wave_ptr_lo","k":"table","len":3,"c":true},{"a":40995,"n":"tune_wave_start_lo","k":"table","len":3,"c":true},{"a":40998,"n":"tune_wave_ptr_hi","k":"table","len":3,"c":true},{"a":41001,"n":"tune_wave_start_hi","k":"table","len":3,"c":true},{"a":41004,"n":"tune_pulse_index","k":"table","len":3,"c":true},{"a":41007,"n":"tune_pulse_start","k":"table","len":3,"c":true},{"a":41010,"n":"tune_slide_table_select","k":"table","len":3,"c":true},{"a":41013,"n":"tune_slide_index","k":"table","len":3,"c":true},{"a":41016,"n":"tune_slide_start","k":"table","len":3,"c":true},{"a":41019,"n":"tune_arp_ptr_lo","k":"table","len":6,"c":true},{"a":41025,"n":"tune_arp_ptr_hi","k":"table","len":6,"c":true},{"a":41031,"n":"tune_filter_start","k":"variable","len":1,"c":true},{"a":41032,"n":"tune_filter_index","k":"variable","len":1,"c":true},{"a":41033,"n":"tune_filter_step_lo","k":"variable","len":1,"c":true},{"a":41034,"n":"tune_filter_step_hi","k":"variable","len":1,"c":true},{"a":41035,"n":"tune_filter_start_hi","k":"variable","len":1,"c":true},{"a":41036,"n":"tune_filter_start_lo","k":"variable","len":1,"c":true},{"a":41037,"n":"tune_filter_hi","k":"variable","len":1,"c":true},{"a":41038,"n":"tune_filter_lo","k":"variable","len":1,"c":true},{"a":41039,"n":"tune_drum_ctrl_lo","k":"table","len":3,"c":true},{"a":41042,"n":"tune_drum_freq_lo","k":"table","len":3,"c":true},{"a":41045,"n":"tune_drum_ctrl_hi","k":"table","len":3,"c":true},{"a":41048,"n":"tune_drum_freq_hi","k":"table","len":3,"c":true},{"a":41051,"n":"tune_stream_lo","k":"table","len":3,"c":true},{"a":41054,"n":"tune_stream_hi","k":"table","len":3,"c":true},{"a":41057,"n":"tune_freq_lo","k":"table","len":3,"c":true},{"a":41060,"n":"tune_freq_hi","k":"table","len":3,"c":true},{"a":41063,"n":"tune_note","k":"table","len":3,"c":true},{"a":41066,"n":"tune_track_repeat","k":"table","len":3,"c":true},{"a":41069,"n":"tune_wave_position","k":"variable","len":1,"c":true},{"a":41070,"n":"tune_voice_offset","k":"variable","len":1,"c":true},{"a":41071,"n":"tune_attack_decay","k":"table","len":3,"c":true},{"a":41074,"n":"tune_sustain_release","k":"table","len":3,"c":true},{"a":41077,"n":"tune_slide_on","k":"table","len":3,"c":true},{"a":41080,"n":"tune_unused_078","k":"table","len":3,"c":true},{"a":41083,"n":"tune_arp_on","k":"table","len":3,"c":true},{"a":41086,"n":"tune_filter_on","k":"table","len":3,"c":true},{"a":41089,"n":"tune_drum_on","k":"table","len":3,"c":true},{"a":41092,"n":"tune_new_note","k":"table","len":3,"c":true},{"a":41095,"n":"tune_fixed_length_on","k":"table","len":3,"c":true},{"a":41098,"n":"tune_pitch_offset","k":"table","len":3,"c":true},{"a":41101,"n":"tune_transpose","k":"table","len":3,"c":true},{"a":41104,"n":"tune_pulse_lo","k":"table","len":3,"c":true},{"a":41107,"n":"tune_pulse_start_lo","k":"table","len":3,"c":true},{"a":41110,"n":"tune_pulse_hi","k":"table","len":3,"c":true},{"a":41113,"n":"tune_pulse_start_hi","k":"table","len":3,"c":true},{"a":41116,"n":"tune_pulse_step_lo","k":"table","len":3,"c":true},{"a":41119,"n":"tune_pulse_step_hi","k":"table","len":3,"c":true},{"a":41122,"n":"tune_slide_step_lo","k":"table","len":3,"c":true},{"a":41125,"n":"tune_slide_step_hi","k":"table","len":3,"c":true},{"a":41128,"n":"tune_stream_position","k":"table","len":3,"c":true},{"a":41131,"n":"tune_arp_countdown","k":"table","len":3,"c":true},{"a":41134,"n":"tune_arp_reload","k":"table","len":3,"c":true},{"a":41137,"n":"tune_arp_index","k":"table","len":3,"c":true},{"a":41140,"n":"tune_arp_length","k":"table","len":3,"c":true},{"a":41143,"n":"tune_filter_scratch","k":"variable","len":1,"c":true},{"a":41144,"n":"tune_drum_length","k":"table","len":3,"c":true},{"a":41147,"n":"tune_drum_step_count","k":"table","len":3,"c":true},{"a":41150,"n":"tune_fade_out_on","k":"variable","len":1,"c":true},{"a":41151,"n":"tune_fade_counter","k":"variable","len":1,"c":true},{"a":41152,"n":"tune_fade_rate","k":"variable","len":1,"c":true},{"a":41153,"n":"tune_volume_value","k":"variable","len":1,"c":true},{"a":41154,"n":"tune_fade_in_on","k":"variable","len":1,"c":true},{"a":41155,"n":"tune_fade_target","k":"variable","len":1,"c":true},{"a":41156,"n":"tune_keep_flags","k":"table","len":3,"c":true},{"a":41159,"n":"tune_sound_scratch","k":"variable","len":1,"c":true},{"a":41160,"n":"tune_init","k":"routine","len":38,"c":true},{"a":41198,"n":"tune_play_sound","k":"routine","len":56,"c":true},{"a":41254,"n":"tune_init_voice","k":"routine","len":62,"c":true},{"a":41316,"n":"tune_start","k":"routine","len":222,"c":true},{"a":41375,"n":"b_A19F","k":"branch","len":1,"c":false},{"a":41454,"n":"b_A1EE","k":"branch","len":1,"c":false},{"a":41532,"n":"b_A23C","k":"branch","len":1,"c":false},{"a":41538,"n":"tune_play","k":"routine","len":161,"c":true},{"a":41699,"n":"tune_fade_in_step","k":"routine","len":36,"c":true},{"a":41735,"n":"tune_voice_tick","k":"routine","len":33,"c":true},{"a":41768,"n":"tune_read_stream","k":"routine","len":186,"c":true},{"a":41954,"n":"tune_stream_command","k":"routine","len":16,"c":true},{"a":41970,"n":"tune_cmd_jump_operand_low","k":"routine","len":1,"c":true},{"a":41971,"n":"tune_cmd_jump_operand_high","k":"routine","len":1,"c":true},{"a":41972,"n":"tune_cmd_next_pattern","k":"routine","len":6,"c":true},{"a":41978,"n":"tune_track_next_pattern","k":"routine","len":85,"c":true},{"a":42010,"n":"b_A41A","k":"branch","len":1,"c":false},{"a":42043,"n":"b_A43B","k":"branch","len":1,"c":false},{"a":42047,"n":"b_A43F","k":"branch","len":1,"c":false},{"a":42063,"n":"tune_track_jump_operand_low","k":"routine","len":1,"c":true},{"a":42064,"n":"tune_track_jump_operand_high","k":"routine","len":1,"c":true},{"a":42065,"n":"tune_track_jump","k":"routine","len":9,"c":true},{"a":42074,"n":"tune_track_repeat_cmd","k":"routine","len":15,"c":true},{"a":42089,"n":"tune_track_stop","k":"routine","len":17,"c":true},{"a":42106,"n":"tune_track_transpose","k":"routine","len":15,"c":true},{"a":42121,"n":"tune_track_fade_out","k":"routine","len":21,"c":true},{"a":42142,"n":"tune_track_fade_in","k":"routine","len":38,"c":true},{"a":42180,"n":"tune_wave_program_tick","k":"routine","len":72,"c":true},{"a":42252,"n":"tune_wave_jump_operand_low","k":"routine","len":1,"c":true},{"a":42253,"n":"tune_wave_jump_operand_high","k":"routine","len":1,"c":true},{"a":42254,"n":"tune_wave_wait","k":"routine","len":12,"c":true},{"a":42266,"n":"tune_wave_jump","k":"routine","len":20,"c":true},{"a":42286,"n":"tune_wave_envelope","k":"routine","len":31,"c":true},{"a":42317,"n":"tune_wave_control","k":"routine","len":25,"c":true},{"a":42342,"n":"tune_wave_control_early","k":"routine","len":29,"c":true},{"a":42371,"n":"tune_wave_control_pitch","k":"routine","len":36,"c":true},{"a":42407,"n":"tune_wave_advance","k":"routine","len":20,"c":true},{"a":42427,"n":"tune_cmd_wave_program","k":"routine","len":30,"c":true},{"a":42457,"n":"tune_cmd_pulse","k":"routine","len":26,"c":true},{"a":42483,"n":"tune_cmd_pitch_slide","k":"routine","len":25,"c":true},{"a":42508,"n":"tune_cmd_arpeggio","k":"routine","len":62,"c":true},{"a":42570,"n":"tune_cmd_fixed_length","k":"routine","len":17,"c":true},{"a":42587,"n":"tune_cmd_free_length","k":"routine","len":11,"c":true},{"a":42598,"n":"tune_cmd_drum","k":"routine","len":100,"c":true},{"a":42698,"n":"tune_cmd_filter","k":"routine","len":54,"c":true},{"a":42752,"n":"tune_pulse_step","k":"routine","len":74,"c":true},{"a":42826,"n":"tune_pitch_slide_step","k":"routine","len":121,"c":true},{"a":42947,"n":"tune_arpeggio_step","k":"routine","len":77,"c":true},{"a":43024,"n":"tune_filter_sweep_step","k":"routine","len":112,"c":true},{"a":43136,"n":"tune_drum_step","k":"routine","len":75,"c":true},{"a":43211,"n":"tune_drum_freq_operand_low","k":"routine","len":1,"c":true},{"a":43212,"n":"tune_drum_freq_operand_high","k":"routine","len":13,"c":true},{"a":43225,"n":"tune_drum_ctrl_operand_low","k":"routine","len":1,"c":true},{"a":43226,"n":"tune_drum_ctrl_operand_high","k":"routine","len":17,"c":true},{"a":43243,"n":"tune_voices_active","k":"routine","len":7,"c":true},{"a":43250,"n":"tune_silence_all","k":"routine","len":40,"c":true},{"a":43290,"n":"tune_start_fade_out","k":"routine","len":15,"c":true},{"a":43305,"n":"tune_cmd_end_voice","k":"routine","len":11,"c":true},{"a":43316,"n":"tune_cmd_set_stream","k":"routine","len":20,"c":true},{"a":43336,"n":"tune_stream_command_lo","k":"table","len":14,"c":true},{"a":43350,"n":"tune_stream_command_hi","k":"table","len":14,"c":true},{"a":43364,"n":"tune_track_command_lo","k":"table","len":6,"c":true},{"a":43370,"n":"tune_track_command_hi","k":"table","len":6,"c":true},{"a":43376,"n":"tune_wave_command_lo","k":"table","len":7,"c":true},{"a":43383,"n":"tune_wave_command_hi","k":"table","len":7,"c":true},{"a":43390,"n":"tune_voice_offsets","k":"table","len":3,"c":true},{"a":43393,"n":"tune_idle_program","k":"table","len":11,"c":true},{"a":43404,"n":"tune_note_freq_lo","k":"table","len":94,"c":true},{"a":43498,"n":"tune_note_freq_hi","k":"table","len":94,"c":true},{"a":43592,"n":"tune_drum_records","k":"table","len":15,"c":true},{"a":43607,"n":"tune_drum_lists","k":"table","len":54,"c":true},{"a":43661,"n":"tune_starts_table","k":"table","len":24,"c":true},{"a":43685,"n":"tune_pattern_lo","k":"table","len":81,"c":true},{"a":43766,"n":"tune_pattern_hi","k":"table","len":81,"c":true},{"a":43847,"n":"tune_pulse_table","k":"table","len":62,"c":true},{"a":43909,"n":"tune_slide_table","k":"table","len":85,"c":true},{"a":43994,"n":"tune_arpeggio_pointers","k":"table","len":62,"c":true},{"a":44056,"n":"tune_arpeggio_lists_0","k":"table","len":113,"c":true},{"a":44169,"n":"tune_arpeggio_lists_1","k":"table","len":82,"c":true},{"a":44251,"n":"tune_filter_sweep_table","k":"table","len":28,"c":true},{"a":44279,"n":"tune_wave_program_table","k":"table","len":22,"c":true},{"a":44301,"n":"tune_wave_program_0","k":"table","len":12,"c":true},{"a":44313,"n":"tune_wave_program_1","k":"table","len":13,"c":true},{"a":44326,"n":"tune_wave_program_2","k":"table","len":12,"c":true},{"a":44338,"n":"tune_wave_program_3","k":"table","len":15,"c":true},{"a":44353,"n":"tune_wave_program_4","k":"table","len":15,"c":true},{"a":44368,"n":"tune_wave_program_5","k":"table","len":16,"c":true},{"a":44384,"n":"tune_wave_program_6","k":"table","len":12,"c":true},{"a":44396,"n":"tune_wave_program_7","k":"table","len":12,"c":true},{"a":44408,"n":"tune_wave_program_8","k":"table","len":12,"c":true},{"a":44420,"n":"tune_wave_program_9","k":"table","len":12,"c":true},{"a":44432,"n":"tune_wave_program_10","k":"table","len":16,"c":true},{"a":44448,"n":"tune_0_voice_1_track","k":"table","len":13,"c":true},{"a":44461,"n":"tune_0_voice_0_track","k":"table","len":5,"c":true},{"a":44466,"n":"tune_0_voice_2_track","k":"table","len":24,"c":true},{"a":44490,"n":"tune_pattern_0","k":"table","len":129,"c":true},{"a":44619,"n":"tune_pattern_1","k":"table","len":58,"c":true},{"a":44677,"n":"tune_pattern_6","k":"table","len":29,"c":true},{"a":44706,"n":"tune_pattern_7","k":"table","len":18,"c":true},{"a":44724,"n":"tune_pattern_2","k":"table","len":4,"c":true},{"a":44728,"n":"tune_2_voice_0_track","k":"table","len":4,"c":true},{"a":44732,"n":"tune_2_voice_1_track","k":"table","len":4,"c":true},{"a":44736,"n":"tune_2_voice_2_track","k":"table","len":4,"c":true},{"a":44740,"n":"tune_pattern_21","k":"table","len":64,"c":true},{"a":44804,"n":"tune_pattern_22","k":"table","len":43,"c":true},{"a":44847,"n":"tune_pattern_23","k":"table","len":43,"c":true},{"a":44890,"n":"tune_1_voice_0_track","k":"table","len":57,"c":true},{"a":44947,"n":"tune_1_voice_1_track","k":"table","len":19,"c":true},{"a":44966,"n":"tune_1_voice_2_track","k":"table","len":14,"c":true},{"a":44980,"n":"tune_pattern_26","k":"table","len":30,"c":true},{"a":45010,"n":"tune_pattern_27","k":"table","len":46,"c":true},{"a":45056,"n":"driver_flag","k":"variable","len":1,"c":true},{"a":45057,"n":"hold_flag","k":"variable","len":1,"c":true},{"a":45058,"n":"voice_scratch","k":"variable","len":1,"c":true},{"a":45059,"n":"step_scratch","k":"variable","len":1,"c":true},{"a":45060,"n":"note_countdown","k":"table","len":3,"c":true},{"a":45063,"n":"fixed_length","k":"table","len":3,"c":true},{"a":45066,"n":"wave_countdown","k":"table","len":3,"c":true},{"a":45069,"n":"pulse_countdown","k":"table","len":3,"c":true},{"a":45072,"n":"slide_countdown","k":"table","len":3,"c":true},{"a":45075,"n":"filter_countdown","k":"variable","len":1,"c":true},{"a":45076,"n":"track_index","k":"table","len":6,"c":true},{"a":45082,"n":"track_lo","k":"table","len":3,"c":true},{"a":45085,"n":"track_hi","k":"table","len":3,"c":true},{"a":45088,"n":"wave_ptr_lo","k":"table","len":3,"c":true},{"a":45091,"n":"wave_start_lo","k":"table","len":3,"c":true},{"a":45094,"n":"wave_ptr_hi","k":"table","len":3,"c":true},{"a":45097,"n":"wave_start_hi","k":"table","len":3,"c":true},{"a":45100,"n":"pulse_index","k":"table","len":3,"c":true},{"a":45103,"n":"pulse_start","k":"table","len":3,"c":true},{"a":45106,"n":"slide_table_select","k":"table","len":3,"c":true},{"a":45109,"n":"slide_index","k":"table","len":3,"c":true},{"a":45112,"n":"slide_start","k":"table","len":3,"c":true},{"a":45115,"n":"arp_ptr_lo","k":"table","len":6,"c":true},{"a":45121,"n":"arp_ptr_hi","k":"table","len":6,"c":true},{"a":45127,"n":"filter_start","k":"variable","len":1,"c":true},{"a":45128,"n":"filter_index","k":"variable","len":1,"c":true},{"a":45129,"n":"filter_step_lo","k":"variable","len":1,"c":true},{"a":45130,"n":"filter_step_hi","k":"variable","len":1,"c":true},{"a":45131,"n":"filter_start_hi","k":"variable","len":1,"c":true},{"a":45132,"n":"filter_start_lo","k":"variable","len":1,"c":true},{"a":45133,"n":"filter_hi","k":"variable","len":1,"c":true},{"a":45134,"n":"filter_lo","k":"variable","len":1,"c":true},{"a":45135,"n":"drum_ctrl_lo","k":"table","len":3,"c":true},{"a":45138,"n":"drum_freq_lo","k":"table","len":3,"c":true},{"a":45141,"n":"drum_ctrl_hi","k":"table","len":3,"c":true},{"a":45144,"n":"drum_freq_hi","k":"table","len":3,"c":true},{"a":45147,"n":"stream_lo","k":"table","len":3,"c":true},{"a":45150,"n":"stream_hi","k":"table","len":3,"c":true},{"a":45153,"n":"freq_lo","k":"table","len":3,"c":true},{"a":45156,"n":"freq_hi","k":"table","len":3,"c":true},{"a":45159,"n":"note","k":"table","len":3,"c":true},{"a":45162,"n":"track_repeat","k":"table","len":3,"c":true},{"a":45165,"n":"wave_position","k":"variable","len":1,"c":true},{"a":45166,"n":"voice_offset","k":"variable","len":1,"c":true},{"a":45167,"n":"attack_decay","k":"table","len":3,"c":true},{"a":45170,"n":"sustain_release","k":"table","len":3,"c":true},{"a":45173,"n":"slide_on","k":"table","len":3,"c":true},{"a":45176,"n":"unused_078","k":"table","len":3,"c":true},{"a":45179,"n":"arp_on","k":"table","len":3,"c":true},{"a":45182,"n":"filter_on","k":"table","len":3,"c":true},{"a":45185,"n":"drum_on","k":"table","len":3,"c":true},{"a":45188,"n":"new_note","k":"table","len":3,"c":true},{"a":45191,"n":"fixed_length_on","k":"table","len":3,"c":true},{"a":45194,"n":"pitch_offset","k":"table","len":3,"c":true},{"a":45197,"n":"transpose","k":"table","len":3,"c":true},{"a":45200,"n":"pulse_lo","k":"table","len":3,"c":true},{"a":45203,"n":"pulse_start_lo","k":"table","len":3,"c":true},{"a":45206,"n":"pulse_hi","k":"table","len":3,"c":true},{"a":45209,"n":"pulse_start_hi","k":"table","len":3,"c":true},{"a":45212,"n":"pulse_step_lo","k":"table","len":3,"c":true},{"a":45215,"n":"pulse_step_hi","k":"table","len":3,"c":true},{"a":45218,"n":"slide_step_lo","k":"table","len":3,"c":true},{"a":45221,"n":"slide_step_hi","k":"table","len":3,"c":true},{"a":45224,"n":"stream_position","k":"table","len":3,"c":true},{"a":45227,"n":"arp_countdown","k":"table","len":3,"c":true},{"a":45230,"n":"arp_reload","k":"table","len":3,"c":true},{"a":45233,"n":"arp_index","k":"table","len":3,"c":true},{"a":45236,"n":"arp_length","k":"table","len":3,"c":true},{"a":45239,"n":"filter_scratch","k":"variable","len":1,"c":true},{"a":45240,"n":"drum_length","k":"table","len":3,"c":true},{"a":45243,"n":"drum_step_count","k":"table","len":3,"c":true},{"a":45246,"n":"fade_out_on","k":"variable","len":1,"c":true},{"a":45247,"n":"fade_counter","k":"variable","len":1,"c":true},{"a":45248,"n":"fade_rate","k":"variable","len":1,"c":true},{"a":45249,"n":"volume_value","k":"variable","len":1,"c":true},{"a":45250,"n":"fade_in_on","k":"variable","len":1,"c":true},{"a":45251,"n":"fade_target","k":"variable","len":1,"c":true},{"a":45252,"n":"keep_flags","k":"table","len":3,"c":true},{"a":45255,"n":"sound_scratch","k":"variable","len":1,"c":true},{"a":45256,"n":"music_init","k":"routine","len":38,"c":true},{"a":45282,"n":"b_B0E2","k":"branch","len":1,"c":false},{"a":45294,"n":"play_sound","k":"routine","len":74,"c":true},{"a":45301,"n":"b_B0F5","k":"branch","len":1,"c":false},{"a":45341,"n":"b_B11D","k":"branch","len":1,"c":false},{"a":45361,"n":"b_B131","k":"branch","len":1,"c":false},{"a":45368,"n":"init_voice","k":"routine","len":62,"c":true},{"a":45430,"n":"music_play","k":"routine","len":161,"c":true},{"a":45436,"n":"b_B17C","k":"branch","len":1,"c":false},{"a":45440,"n":"j_B180","k":"branch","len":1,"c":false},{"a":45455,"n":"b_B18F","k":"branch","len":1,"c":false},{"a":45463,"n":"b_B197","k":"branch","len":1,"c":false},{"a":45498,"n":"b_B1BA","k":"branch","len":1,"c":false},{"a":45560,"n":"b_B1F8","k":"branch","len":1,"c":false},{"a":45578,"n":"j_B20A","k":"branch","len":1,"c":false},{"a":45585,"n":"b_B211","k":"branch","len":1,"c":false},{"a":45591,"n":"fade_in_step","k":"routine","len":36,"c":true},{"a":45626,"n":"r_B23A","k":"branch","len":1,"c":false},{"a":45627,"n":"voice_tick","k":"routine","len":33,"c":true},{"a":45633,"n":"b_B241","k":"branch","len":1,"c":false},{"a":45660,"n":"read_stream","k":"routine","len":186,"c":true},{"a":45670,"n":"b_B266","k":"branch","len":1,"c":false},{"a":45677,"n":"b_B26D","k":"branch","len":1,"c":false},{"a":45714,"n":"b_B292","k":"branch","len":1,"c":false},{"a":45744,"n":"b_B2B0","k":"branch","len":1,"c":false},{"a":45767,"n":"b_B2C7","k":"branch","len":1,"c":false},{"a":45789,"n":"b_B2DD","k":"branch","len":1,"c":false},{"a":45824,"n":"j_B300","k":"branch","len":1,"c":false},{"a":45835,"n":"b_B30B","k":"branch","len":1,"c":false},{"a":45838,"n":"j_B30E","k":"branch","len":1,"c":false},{"a":45846,"n":"stream_command","k":"routine","len":16,"c":true},{"a":45862,"n":"cmd_jump_operand_low","k":"routine","len":1,"c":true},{"a":45863,"n":"cmd_jump_operand_high","k":"routine","len":1,"c":true},{"a":45864,"n":"cmd_next_pattern","k":"routine","len":6,"c":true},{"a":45870,"n":"track_next_pattern","k":"routine","len":85,"c":true},{"a":45955,"n":"track_jump_operand_low","k":"routine","len":1,"c":true},{"a":45956,"n":"track_jump_operand_high","k":"routine","len":1,"c":true},{"a":45957,"n":"track_jump","k":"routine","len":9,"c":true},{"a":45966,"n":"track_repeat_cmd","k":"routine","len":15,"c":true},{"a":45981,"n":"track_stop","k":"routine","len":17,"c":true},{"a":45998,"n":"track_transpose","k":"routine","len":15,"c":true},{"a":46013,"n":"track_fade_out","k":"routine","len":21,"c":true},{"a":46034,"n":"track_fade_in","k":"routine","len":38,"c":true},{"a":46072,"n":"wave_program_tick","k":"routine","len":72,"c":true},{"a":46078,"n":"b_B3FE","k":"branch","len":1,"c":false},{"a":46108,"n":"b_B41C","k":"branch","len":1,"c":false},{"a":46144,"n":"wave_jump_operand_low","k":"routine","len":1,"c":true},{"a":46145,"n":"wave_jump_operand_high","k":"routine","len":1,"c":true},{"a":46146,"n":"wave_wait","k":"routine","len":12,"c":true},{"a":46158,"n":"wave_jump","k":"routine","len":20,"c":true},{"a":46178,"n":"wave_envelope","k":"routine","len":31,"c":true},{"a":46209,"n":"wave_control","k":"routine","len":25,"c":true},{"a":46234,"n":"wave_control_early","k":"routine","len":29,"c":true},{"a":46263,"n":"wave_control_pitch","k":"routine","len":54,"c":true},{"a":46317,"n":"wave_advance","k":"routine","len":20,"c":true},{"a":46337,"n":"cmd_wave_program","k":"routine","len":30,"c":true},{"a":46367,"n":"cmd_pulse","k":"routine","len":26,"c":true},{"a":46393,"n":"cmd_pitch_slide","k":"routine","len":25,"c":true},{"a":46418,"n":"cmd_arpeggio","k":"routine","len":62,"c":true},{"a":46480,"n":"cmd_fixed_length","k":"routine","len":17,"c":true},{"a":46497,"n":"cmd_free_length","k":"routine","len":11,"c":true},{"a":46508,"n":"cmd_drum","k":"routine","len":108,"c":true},{"a":46616,"n":"cmd_filter","k":"routine","len":54,"c":true},{"a":46670,"n":"pulse_step","k":"routine","len":74,"c":true},{"a":46675,"n":"j_B653","k":"branch","len":1,"c":false},{"a":46693,"n":"b_B665","k":"branch","len":1,"c":false},{"a":46715,"n":"b_B67B","k":"branch","len":1,"c":false},{"a":46743,"n":"r_B697","k":"branch","len":1,"c":false},{"a":46744,"n":"pitch_slide_step","k":"routine","len":121,"c":true},{"a":46759,"n":"j_B6A7","k":"branch","len":1,"c":false},{"a":46777,"n":"b_B6B9","k":"branch","len":1,"c":false},{"a":46802,"n":"b_B6D2","k":"branch","len":1,"c":false},{"a":46820,"n":"b_B6E4","k":"branch","len":1,"c":false},{"a":46842,"n":"b_B6FA","k":"branch","len":1,"c":false},{"a":46865,"n":"arpeggio_step","k":"routine","len":77,"c":true},{"a":46876,"n":"b_B71C","k":"branch","len":1,"c":false},{"a":46941,"n":"r_B75D","k":"branch","len":1,"c":false},{"a":46942,"n":"filter_sweep_step","k":"routine","len":88,"c":true},{"a":46947,"n":"j_B763","k":"branch","len":1,"c":false},{"a":46965,"n":"b_B775","k":"branch","len":1,"c":false},{"a":46986,"n":"b_B78A","k":"branch","len":1,"c":false},{"a":47030,"n":"drum_step","k":"routine","len":75,"c":true},{"a":47032,"n":"b_B7B8","k":"branch","len":1,"c":false},{"a":47064,"n":"b_B7D8","k":"branch","len":1,"c":false},{"a":47068,"n":"b_B7DC","k":"branch","len":1,"c":false},{"a":47105,"n":"drum_freq_operand_low","k":"routine","len":1,"c":true},{"a":47106,"n":"drum_freq_operand_high","k":"routine","len":13,"c":true},{"a":47119,"n":"drum_ctrl_operand_low","k":"routine","len":1,"c":true},{"a":47120,"n":"drum_ctrl_operand_high","k":"routine","len":17,"c":true},{"a":47136,"n":"r_B820","k":"branch","len":1,"c":false},{"a":47137,"n":"voices_active","k":"routine","len":7,"c":true},{"a":47144,"n":"silence_all","k":"routine","len":40,"c":true},{"a":47184,"n":"start_fade_out","k":"routine","len":15,"c":true},{"a":47199,"n":"cmd_end_voice","k":"routine","len":11,"c":true},{"a":47210,"n":"cmd_set_stream","k":"routine","len":20,"c":true},{"a":47230,"n":"stream_command_lo","k":"table","len":14,"c":true},{"a":47244,"n":"stream_command_hi","k":"table","len":14,"c":true},{"a":47258,"n":"track_command_lo","k":"table","len":6,"c":true},{"a":47264,"n":"track_command_hi","k":"table","len":6,"c":true},{"a":47270,"n":"wave_command_lo","k":"table","len":7,"c":true},{"a":47277,"n":"wave_command_hi","k":"table","len":7,"c":true},{"a":47284,"n":"voice_offsets","k":"table","len":3,"c":true},{"a":47287,"n":"idle_program","k":"table","len":11,"c":true},{"a":47298,"n":"note_freq_lo","k":"table","len":94,"c":true},{"a":47392,"n":"note_freq_hi","k":"table","len":94,"c":true},{"a":47486,"n":"drum_records","k":"table","len":30,"c":true},{"a":47516,"n":"drum_lists","k":"table","len":72,"c":true},{"a":47588,"n":"pulse_table","k":"table","len":35,"c":true},{"a":47623,"n":"pitch_slide_table","k":"table","len":84,"c":true},{"a":47707,"n":"arpeggio_table","k":"table","len":7,"c":true},{"a":47714,"n":"filter_sweep_table","k":"table","len":26,"c":true},{"a":47740,"n":"wave_program_table","k":"table","len":20,"c":true},{"a":47760,"n":"wave_programs","k":"table","len":184,"c":true},{"a":47944,"n":"sound_table","k":"table","len":44,"c":true},{"a":47988,"n":"stream_pointer_table","k":"table","len":36,"c":true},{"a":48024,"n":"sound_streams","k":"table","len":161,"c":true}],"records":[{"a":0,"t":"gap","n":1},{"a":1,"l":"processor_port","c":"The 6510's on-chip port, which sets what the CPU sees at $A000, $D000 and $E000. The loader stores $34 here for the instant it writes each loaded byte at $052A, so that RAM shows through, and puts the old value back at $052D; $05DE and $0627 store $37 to bring the ROMs and I/O back for the screen. The sound drivers do not use it.","t":"byte","b":[61],"x":[1308,1318,1325,1502,1575]},{"a":2,"l":"zero_page_unused_02","c":"18 bytes, $0002-$0013, that no resident code reads or writes.","t":"byte","b":[0,170,177,145,179,34,34,0]},{"a":10,"t":"byte","b":[0,76,0,255,0,2,0,0]},{"a":18,"t":"byte","b":[0,0]},{"a":20,"l":"load_pointer_lo","c":"Low byte of the address the fast loader stores the next byte at. Set from the first byte of a file-list entry at $049B and used by the store through ($14),Y at $052A.","t":"byte","b":[0],"x":[1179,1322]},{"a":21,"l":"load_pointer_hi","c":"High byte of the load address: set from the second byte of the file-list entry at $04A0, and incremented at $0537 each time Y wraps after 256 stored bytes.","t":"byte","b":[255],"x":[1184,1335]},{"a":22,"l":"serial_byte","c":"Byte being sent to or from the disk drive: $0579 shifts received bits into it with ROR, $0594 puts the byte to send here and $05A3 shifts it out with LSR, and $0567 returns it in A. The bytes $0017-$0055 behind it are used by no resident code.","t":"byte","b":[255,22,0,10,118,163,0,0],"x":[1398,1410,1425,1428,1445,1460]},{"a":30,"t":"byte","b":[0,0,0,0,118,163,179,189]},{"a":38,"t":"byte","b":[0,0,0,0,0,0,0,0]},{"a":46,"t":"byte","b":[0,0,0,0,0,0,0,0]},{"a":54,"t":"byte","b":[0,0,0,0,0,0,0,0]},{"a":62,"t":"byte","b":[0,0,0,0,0,0,0,0]},{"a":70,"t":"byte","b":[0,0,0,0,0,0,0,0]},{"a":78,"t":"byte","b":[0,0,0,0,0,0,0,0]},{"a":86,"t":"gap","n":154},{"a":240,"l":"stream_ptr_lo","c":"Low byte of a pointer shared by both sound drivers: the address of the voice stream, wave program or arpeggio list being read through ($F0),Y. The routines load it from the voice's own pointers first ($B05B, $B020 and $B03B in the driver at $B000; $A05B, $A020 and $A03B in the one at $A000), and the stream reader stores it back to $B05B at $B253.","t":"byte","b":[183],"x":[41438,41744,41757,41771,41944,42023,42219,42234,42258,42267,42271,42276,42287,42293,42318,42323,42343,42355,42372,42377,42386,42410,42428,42458,42464,42470,42484,42518,42571,42603,42692,42699,42705,42714,42723,42961,42977,43317,43323,45636,45649,45663,45836,45915,46111,46126,46150,46159,46163,46168,46179,46185,46210,46215,46235,46247,46264,46269,46278,46320,46338,46368,46374,46380,46394,46428,46481,46513,46587,46617,46623,46632,46641,46879,46895,47211,47217]},{"a":241,"l":"stream_ptr_hi","c":"High byte of the stream or wave-program pointer at $00F0, loaded and stored together with it.","t":"byte","b":[184],"x":[41443,41749,41762,42028,42224,42273,42419,42966,45641,45654,45920,46116,46165,46329,46884]},{"a":242,"l":"track_ptr_lo","c":"Low byte of the pointer to the current voice's track list (the list of pattern numbers and track commands), loaded by $B32E and $A3FA from the per-voice tables at $B01A and $A01A and read through ($F2),Y.","t":"byte","b":[0],"x":[41983,42013,42066,42075,42107,42122,42143,42163,45875,45905,45958,45967,45999,46014,46035,46055]},{"a":243,"l":"track_ptr_hi","c":"High byte of the track-list pointer at $00F2, loaded from the per-voice tables at $B01D and $A01D.","t":"byte","b":[0],"x":[41988,45880]},{"a":244,"l":"arp_entry_ptr_lo","c":"Low byte of a pointer to an arpeggio table entry, set by the stream command at $B552 (and $A60C) from the pointer tables and read through ($F4),Y to fetch the entry's step count and length.","t":"byte","b":[0],"x":[42525,42541,42547,42552,46435,46451,46457,46462]},{"a":245,"l":"arp_entry_ptr_hi","c":"High byte of the arpeggio entry pointer at $00F4.","t":"byte","b":[0],"x":[42530,42560,46440,46470]},{"a":246,"l":"control_temp","c":"Scratch byte for the wave-program commands: holds the SID control-register value read from the program until the code has the voice's register offset ready to store it (stores at $B484, $B49D, $B4BA).","t":"byte","b":[64],"x":[42320,42334,42345,42363,42374,42399,46212,46226,46237,46255,46266,46291]},{"a":247,"l":"voice0_active","c":"Non-zero while voice 0 (SID registers $D400-$D406) has a stream to play. Set to 1 by the voice set-up at $B138 and $A126, cleared by the end-of-voice commands at $B85F and $A929, by the track command at $B39D and by the silence routines. Voices 1 and 2 use $F8 and $F9.","t":"byte","b":[0],"x":[41256,41324,41475,41556,41609,42091,43243,43252,43307,45370,45448,45501,45983,47137,47146,47201]},{"a":248,"l":"voice1_active","c":"Non-zero while voice 1 (SID registers $D407-$D40D) has a stream to play; see $00F7.","t":"byte","b":[1],"x":[41326,41477,43245,43254,47139,47148]},{"a":249,"l":"voice2_active","c":"Non-zero while voice 2 (SID registers $D40E-$D414) has a stream to play; see $00F7. The routine at $B821 (and $A8EB) ORs $F7, $F8 and $F9 to tell whether anything is still sounding.","t":"byte","b":[1],"x":[41328,41479,43247,43256,47141,47150]},{"a":250,"l":"voice_index","c":"Number of the voice being worked on, 2 down to 0. The play routines count it down in their voice loops and every sub-routine reloads X from it ($B176, $A242, $A164).","t":"byte","b":[255],"x":[41373,41375,41412,41448,41546,41548,41686,41967,41978,42030,42060,42249,42534,43005,45438,45440,45578,45859,45870,45922,45952,46141,46444,46923]},{"a":251,"l":"zero_page_unused_fb","c":"5 bytes, $00FB-$00FF, that no resident code reads or writes.","t":"byte","b":[0,0,0,0,0]},{"a":256,"t":"gap","n":768},{"a":1024,"l":"loader_entry","c":"Entry of the resident loader. Loads A and X with 0, then calls $042F, which sets the level number $0435 to 0, and runs on into the loader loop at $0407. The levels jump to $0404, skipping the two loads, when the game is over, so the next load is level 1's files.","t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":1026,"t":"code","b":[162,0],"m":"ldx","o":"#$00"},{"a":1028,"t":"code","b":[32,47,4],"m":"jsr","oa":1071,"o":"reset_level_number"},{"a":1031,"l":"next_level_load","c":"Loads the next level's two files and starts them. Calls the prompt at $0625, then the file loader at $0436 with the file-name pointer for level number $0435, repeats while the error flag $0624 is set, then increments the level number and jumps to the level's entry at $0A20.","t":"code","b":[120],"m":"sei"},{"a":1032,"l":"b_0408","t":"code","b":[32,37,6],"m":"jsr","oa":1573,"o":"load_prompt","x":[1055]},{"a":1035,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":1037,"t":"code","b":[141,17,208],"m":"sta","o":"vic_control1"},{"a":1040,"t":"code","b":[174,53,4],"m":"ldx","oa":1077,"o":"level_number"},{"a":1043,"t":"code","b":[189,63,4],"m":"lda","oa":1087,"o":"level_file_lo,x"},{"a":1046,"t":"code","b":[188,69,4],"m":"ldy","oa":1093,"o":"level_file_hi,x"},{"a":1049,"t":"code","b":[32,54,4],"m":"jsr","oa":1078,"o":"load_level_files"},{"a":1052,"t":"code","b":[173,36,6],"m":"lda","oa":1572,"o":"load_error"},{"a":1055,"t":"code","b":[208,231],"m":"bne","oa":1032,"o":"b_0408"},{"a":1057,"t":"code","b":[238,53,4],"m":"inc","oa":1077,"o":"level_number"},{"a":1060,"t":"code","b":[76,32,10],"m":"jmp","oa":2592,"o":"$0A20"},{"a":1063,"l":"pad_0427","c":"8 zero bytes after with no type between code ($0427): padding that no traced code reads.","t":"byte","b":[0,0,0,0,0,0,0,0]},{"a":1071,"l":"reset_level_number","c":"Sets the level number $0435 to 0 and returns. Called from $0404.","t":"code","b":[169,0],"m":"lda","o":"#$00","x":[1028]},{"a":1073,"t":"code","b":[141,53,4],"m":"sta","oa":1077,"o":"level_number"},{"a":1076,"t":"code","b":[96],"m":"rts"},{"a":1077,"l":"level_number","c":"Number of the next level to load, 0 to 5, read by the loader loop at $0407 and the prompt at $0625.","t":"byte","b":[1],"x":[1040,1057,1073,1638,1665]},{"a":1078,"l":"load_level_files","c":"Stores the file-name pointer from A (low) and Y (high) at $04BE and $04BF, then runs the fast loader at $0493.","t":"code","b":[141,190,4],"m":"sta","oa":1214,"o":"list_pointer_lo","x":[1049]},{"a":1081,"t":"code","b":[140,191,4],"m":"sty","oa":1215,"o":"list_pointer_hi"},{"a":1084,"t":"code","b":[76,147,4],"m":"jmp","oa":1171,"o":"load_files"},{"a":1087,"l":"level_file_lo","c":"Low bytes of the six per-level file-name pointers, indexed by $0435.","t":"byte","b":[75,87,99,111,123,135],"x":[1043]},{"a":1093,"l":"level_file_hi","c":"High bytes of the six per-level file-name pointers, indexed by $0435.","t":"byte","b":[4,4,4,4,4,4],"x":[1046]},{"a":1099,"l":"level_1_files","c":"File list of level 1, 12 bytes: load address $0A20 with the name \"1A\" and a zero terminator, load address $BF00 with the name \"1B\" and a zero terminator, then the end marker $FF,$FF. The loader at $0493 reads an entry as two address bytes and a zero-ended name, until it meets $FF.","t":"byte","b":[32,10,49,65,0,0,191,49]},{"a":1107,"t":"byte","b":[66,0,255]},{"a":1110,"l":"file_list_cursor_start","c":"Address in the operand of the byte fetch LDA $0456 at $04BD. The operand is overwritten with the file-list pointer by $0436 and counted up by $04BD, so this value is only what the instruction held when it was assembled; $0456 is the last byte of level 1's file list.","t":"byte","b":[255],"x":[1213]},{"a":1111,"l":"level_2_files","c":"File list of level 2, 12 bytes: \"2A\" to $0A20, \"2B\" to $BF00, then the end marker $FF,$FF.","t":"byte","b":[32,10,50,65,0,0,191,50]},{"a":1119,"t":"byte","b":[66,0,255,255]},{"a":1123,"l":"level_3_files","c":"File list of level 3, 12 bytes: \"3A\" to $0A20, \"3B\" to $E000, then the end marker $FF,$FF. This is the only list whose second file is not loaded at $BF00.","t":"byte","b":[32,10,51,65,0,0,224,51]},{"a":1131,"t":"byte","b":[66,0,255,255]},{"a":1135,"l":"level_4_files","c":"File list of level 4, 12 bytes: \"4A\" to $0A20, \"4B\" to $BF00, then the end marker $FF,$FF. The prompt asks for disk side 2 before this level.","t":"byte","b":[32,10,52,65,0,0,191,52]},{"a":1143,"t":"byte","b":[66,0,255,255]},{"a":1147,"l":"level_5_files","c":"File list of level 5, 12 bytes: \"5A\" to $0A20, \"5B\" to $BF00, then the end marker $FF,$FF.","t":"byte","b":[32,10,53,65,0,0,191,53]},{"a":1155,"t":"byte","b":[66,0,255,255]},{"a":1159,"l":"level_6_files","c":"File list of level 6, 12 bytes: \"6A\" to $0A20, \"6B\" to $BF00, then the end marker $FF,$FF.","t":"byte","b":[32,10,54,65,0,0,191,54]},{"a":1167,"t":"byte","b":[66,0,255,255]},{"a":1171,"l":"load_files","c":"The fast loader. Reads a file-list entry through $04BD: an $FF first byte ends it, otherwise the first two bytes are the load address (stored at $14/$15), then the name bytes up to a zero are copied to the buffer at $0707. $04C9 then loads the named file. If that returns with carry set the loader repeats for the next entry; if clear, $05DC runs, which sets the error flag $0624 and shows the error text.","t":"code","b":[32,189,4],"m":"jsr","oa":1213,"o":"next_list_byte","x":[1084,1205]},{"a":1174,"t":"code","b":[201,255],"m":"cmp","o":"#$FF"},{"a":1176,"t":"code","b":[208,1],"m":"bne","oa":1179,"o":"b_049B"},{"a":1178,"t":"code","b":[96],"m":"rts"},{"a":1179,"l":"b_049B","t":"code","b":[133,20],"m":"sta","oa":20,"o":"load_pointer_lo","x":[1176]},{"a":1181,"t":"code","b":[32,189,4],"m":"jsr","oa":1213,"o":"next_list_byte"},{"a":1184,"t":"code","b":[133,21],"m":"sta","oa":21,"o":"load_pointer_hi"},{"a":1186,"t":"code","b":[160,0],"m":"ldy","o":"#$00"},{"a":1188,"l":"b_04A4","t":"code","b":[32,189,4],"m":"jsr","oa":1213,"o":"next_list_byte","x":[1199]},{"a":1191,"t":"code","b":[201,0],"m":"cmp","o":"#$00"},{"a":1193,"t":"code","b":[240,6],"m":"beq","oa":1201,"o":"b_04B1"},{"a":1195,"t":"code","b":[153,7,7],"m":"sta","oa":1799,"o":"file_name_buffer,y"},{"a":1198,"t":"code","b":[200],"m":"iny"},{"a":1199,"t":"code","b":[208,243],"m":"bne","oa":1188,"o":"b_04A4"},{"a":1201,"l":"b_04B1","t":"code","b":[152],"m":"tya","x":[1193]},{"a":1202,"t":"code","b":[32,201,4],"m":"jsr","oa":1225,"o":"load_one_file"},{"a":1205,"t":"code","b":[176,220],"m":"bcs","oa":1171,"o":"load_files"},{"a":1207,"t":"code","b":[234],"m":"nop"},{"a":1208,"t":"code","b":[32,220,5],"m":"jsr","oa":1500,"o":"show_load_error"},{"a":1211,"t":"code","b":[234],"m":"nop"},{"a":1212,"t":"code","b":[96],"m":"rts"},{"a":1213,"l":"next_list_byte","c":"Returns the next byte of the file list in A and moves the pointer on. The pointer is the operand of the LDA $0456 itself, at $04BE/$04BF; $04C0 and $04C5 increment it.","t":"code","b":[173,86,4],"m":"lda","oa":1110,"o":"file_list_cursor_start","x":[1171,1181,1188]},{"a":1214,"t":"note","l":"list_pointer_lo","c":"Low byte of the file-list pointer: the operand of the LDA at $04BD. Set by $0436 and incremented at $04C0.","note":"inside the item at $04BD","x":[1078,1216]},{"a":1215,"t":"note","l":"list_pointer_hi","c":"High byte of the file-list pointer: the operand of the LDA at $04BD. Set by $0436 and incremented at $04C5 when the low byte wraps.","note":"inside the item at $04BD","x":[1081,1221]},{"a":1216,"t":"code","b":[238,190,4],"m":"inc","oa":1214,"o":"list_pointer_lo"},{"a":1219,"t":"code","b":[208,3],"m":"bne","oa":1224,"o":"r_04C8"},{"a":1221,"t":"code","b":[238,191,4],"m":"inc","oa":1215,"o":"list_pointer_hi"},{"a":1224,"l":"r_04C8","t":"code","b":[96],"m":"rts","x":[1219]},{"a":1225,"l":"load_one_file","c":"Loads one file from the drive over the serial bus, bit by bit through CIA 2 port A ($DD00). First it patches the immediate values of the bit routines ($054E, $057A, $0589, $05A4, $05B3, $05CD) with the current video bank bits of $DD00. Then it sends 4 bytes of the name buffer $0707 with $0546, waits with $05C0 and discards two bytes. After that it reads bytes with $0567: a byte other than $AC is stored through ($14),Y at $052A, with the border red and RAM switched in; $AC followed by $AC stores an $AC; $AC followed by $FF ends with carry set, $AC followed by $F7 ends with carry clear, and $AC followed by anything else waits again.","t":"code","b":[169,4],"m":"lda","o":"#$04","x":[1202]},{"a":1227,"t":"code","b":[141,238,4],"m":"sta","oa":1262,"o":"send_length_operand"},{"a":1230,"t":"code","b":[173,0,221],"m":"lda","o":"cia2_port_a"},{"a":1233,"t":"code","b":[41,15],"m":"and","o":"#$0F"},{"a":1235,"t":"code","b":[141,179,5],"m":"sta","oa":1459,"o":"send_bits_operand_2"},{"a":1238,"t":"code","b":[73,16],"m":"eor","o":"#$10"},{"a":1240,"t":"code","b":[141,164,5],"m":"sta","oa":1444,"o":"send_bits_operand_1"},{"a":1243,"t":"code","b":[73,48],"m":"eor","o":"#$30"},{"a":1245,"t":"code","b":[141,78,5],"m":"sta","oa":1358,"o":"bus_start_operand"},{"a":1248,"t":"code","b":[73,176],"m":"eor","o":"#$B0"},{"a":1250,"t":"code","b":[141,122,5],"m":"sta","oa":1402,"o":"read_bits_operand_1"},{"a":1253,"t":"code","b":[73,80],"m":"eor","o":"#$50"},{"a":1255,"t":"code","b":[141,137,5],"m":"sta","oa":1417,"o":"read_bits_operand_2"},{"a":1258,"t":"code","b":[141,205,5],"m":"sta","oa":1485,"o":"wait_operand"},{"a":1261,"t":"code","b":[169,4],"m":"lda","o":"#$04"},{"a":1262,"t":"note","l":"send_length_operand","c":"Operand of the LDA #$04 at $04ED, which sets the number of bytes of the buffer $0707 that $0546 sends to the drive. $04C9 stores 4 here at its start.","note":"inside the item at $04ED","x":[1227]},{"a":1263,"t":"code","b":[32,70,5],"m":"jsr","oa":1350,"o":"send_bytes"},{"a":1266,"t":"code","b":[32,192,5],"m":"jsr","oa":1472,"o":"wait_for_drive"},{"a":1269,"t":"code","b":[32,103,5],"m":"jsr","oa":1383,"o":"read_serial_byte"},{"a":1272,"t":"code","b":[32,103,5],"m":"jsr","oa":1383,"o":"read_serial_byte"},{"a":1275,"t":"code","b":[160,0],"m":"ldy","o":"#$00"},{"a":1277,"l":"j_04FD","t":"code","b":[32,103,5],"m":"jsr","oa":1383,"o":"read_serial_byte","x":[1302,1337]},{"a":1280,"t":"code","b":[201,172],"m":"cmp","o":"#$AC"},{"a":1282,"t":"code","b":[208,21],"m":"bne","oa":1305,"o":"b_0519"},{"a":1284,"t":"code","b":[32,103,5],"m":"jsr","oa":1383,"o":"read_serial_byte"},{"a":1287,"t":"code","b":[201,172],"m":"cmp","o":"#$AC"},{"a":1289,"t":"code","b":[240,14],"m":"beq","oa":1305,"o":"b_0519"},{"a":1291,"t":"code","b":[201,255],"m":"cmp","o":"#$FF"},{"a":1293,"t":"code","b":[240,46],"m":"beq","oa":1341,"o":"b_053D"},{"a":1295,"t":"code","b":[201,247],"m":"cmp","o":"#$F7"},{"a":1297,"t":"code","b":[240,41],"m":"beq","oa":1340,"o":"b_053C"},{"a":1299,"t":"code","b":[32,192,5],"m":"jsr","oa":1472,"o":"wait_for_drive"},{"a":1302,"t":"code","b":[76,253,4],"m":"jmp","oa":1277,"o":"j_04FD"},{"a":1305,"l":"b_0519","t":"code","b":[141,41,5],"m":"sta","oa":1321,"o":"store_value_operand","x":[1282,1289]},{"a":1308,"t":"code","b":[165,1],"m":"lda","oa":1,"o":"processor_port"},{"a":1310,"t":"code","b":[72],"m":"pha"},{"a":1311,"t":"code","b":[169,2],"m":"lda","o":"#$02"},{"a":1313,"t":"code","b":[141,32,208],"m":"sta","o":"vic_border"},{"a":1316,"t":"code","b":[169,52],"m":"lda","o":"#$34"},{"a":1318,"t":"code","b":[133,1],"m":"sta","oa":1,"o":"processor_port"},{"a":1320,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":1321,"t":"note","l":"store_value_operand","c":"Operand of the LDA #$00 at $0528: the value stored by the STA ($14),Y at $052A. $0519 puts the byte just read from the drive here.","note":"inside the item at $0528","x":[1305]},{"a":1322,"t":"code","b":[145,20],"m":"sta","oa":20,"o":"(load_pointer_lo),y"},{"a":1324,"t":"code","b":[104],"m":"pla"},{"a":1325,"t":"code","b":[133,1],"m":"sta","oa":1,"o":"processor_port"},{"a":1327,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":1329,"t":"code","b":[141,32,208],"m":"sta","o":"vic_border"},{"a":1332,"t":"code","b":[200],"m":"iny"},{"a":1333,"t":"code","b":[208,2],"m":"bne","oa":1337,"o":"b_0539"},{"a":1335,"t":"code","b":[230,21],"m":"inc","oa":21,"o":"load_pointer_hi"},{"a":1337,"l":"b_0539","t":"code","b":[76,253,4],"m":"jmp","oa":1277,"o":"j_04FD","x":[1333]},{"a":1340,"l":"b_053C","t":"code","b":[24],"m":"clc","x":[1297]},{"a":1341,"l":"b_053D","t":"code","b":[174,4,7],"m":"ldx","oa":1796,"o":"saved_x","x":[1293]},{"a":1344,"t":"code","b":[172,5,7],"m":"ldy","oa":1797,"o":"saved_y"},{"a":1347,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":1349,"t":"code","b":[96],"m":"rts"},{"a":1350,"l":"send_bytes","c":"Sends A bytes from the buffer $0707 to the drive. Saves X and Y at $0704/$0705, writes $27 (patched at $054E) to $DD00, waits with $05C0, then sends the count and each buffer byte through $0594.","t":"code","b":[72],"m":"pha","x":[1263]},{"a":1351,"t":"code","b":[142,4,7],"m":"stx","oa":1796,"o":"saved_x"},{"a":1354,"t":"code","b":[140,5,7],"m":"sty","oa":1797,"o":"saved_y"},{"a":1357,"t":"code","b":[169,39],"m":"lda","o":"#$27"},{"a":1358,"t":"note","l":"bus_start_operand","c":"Operand of the LDA #$27 at $054D, the value written to $DD00 to start sending. $04C9 rebuilds it from the video bank bits.","note":"inside the item at $054D","x":[1245]},{"a":1359,"t":"code","b":[141,0,221],"m":"sta","o":"cia2_port_a"},{"a":1362,"t":"code","b":[32,192,5],"m":"jsr","oa":1472,"o":"wait_for_drive"},{"a":1365,"t":"code","b":[104],"m":"pla"},{"a":1366,"t":"code","b":[170],"m":"tax"},{"a":1367,"t":"code","b":[32,148,5],"m":"jsr","oa":1428,"o":"send_serial_byte"},{"a":1370,"t":"code","b":[160,0],"m":"ldy","o":"#$00"},{"a":1372,"l":"b_055C","t":"code","b":[185,7,7],"m":"lda","oa":1799,"o":"file_name_buffer,y","x":[1380]},{"a":1375,"t":"code","b":[32,148,5],"m":"jsr","oa":1428,"o":"send_serial_byte"},{"a":1378,"t":"code","b":[200],"m":"iny"},{"a":1379,"t":"code","b":[202],"m":"dex"},{"a":1380,"t":"code","b":[208,246],"m":"bne","oa":1372,"o":"b_055C"},{"a":1382,"t":"code","b":[96],"m":"rts"},{"a":1383,"l":"read_serial_byte","c":"Reads one byte from the drive: four calls of $0579, which take two bits each, followed by a call of the bare RTS at $0578 that only passes time. The byte is returned in A and left in $16.","t":"code","b":[32,121,5],"m":"jsr","oa":1401,"o":"read_two_bits","x":[1269,1272,1277,1284]},{"a":1386,"t":"code","b":[32,121,5],"m":"jsr","oa":1401,"o":"read_two_bits"},{"a":1389,"t":"code","b":[32,121,5],"m":"jsr","oa":1401,"o":"read_two_bits"},{"a":1392,"t":"code","b":[32,121,5],"m":"jsr","oa":1401,"o":"read_two_bits"},{"a":1395,"t":"code","b":[32,120,5],"m":"jsr","oa":1400,"o":"r_0578"},{"a":1398,"t":"code","b":[165,22],"m":"lda","oa":22,"o":"serial_byte"},{"a":1400,"l":"r_0578","t":"code","b":[96],"m":"rts","x":[1395]},{"a":1401,"l":"read_two_bits","c":"Reads two bits from the serial bus. With X=$97 it reads $DD00, writes X back to $DD00 and shifts bit 7 of the value read into $16 (ASL A, ROR $16); after a short wait it does the same with X=$C7. The values $97 and $C7 are patched at $057A and $0589.","t":"code","b":[162,151],"m":"ldx","o":"#$97","x":[1383,1386,1389,1392]},{"a":1402,"t":"note","l":"read_bits_operand_1","c":"Operand of the LDX #$97 at $0579: the first value written to $DD00 by $0579, patched by $04C9.","note":"inside the item at $0579","x":[1250]},{"a":1403,"t":"code","b":[173,0,221],"m":"lda","o":"cia2_port_a"},{"a":1406,"t":"code","b":[142,0,221],"m":"stx","o":"cia2_port_a"},{"a":1409,"t":"code","b":[10],"m":"asl","o":"a"},{"a":1410,"t":"code","b":[102,22],"m":"ror","oa":22,"o":"serial_byte"},{"a":1412,"t":"code","b":[72],"m":"pha"},{"a":1413,"t":"code","b":[104],"m":"pla"},{"a":1414,"t":"code","b":[72],"m":"pha"},{"a":1415,"t":"code","b":[104],"m":"pla"},{"a":1416,"t":"code","b":[162,199],"m":"ldx","o":"#$C7"},{"a":1417,"t":"note","l":"read_bits_operand_2","c":"Operand of the LDX #$C7 at $0588: the second value written to $DD00 by $0579, patched by $04C9.","note":"inside the item at $0588","x":[1255]},{"a":1418,"t":"code","b":[173,0,221],"m":"lda","o":"cia2_port_a"},{"a":1421,"t":"code","b":[142,0,221],"m":"stx","o":"cia2_port_a"},{"a":1424,"t":"code","b":[10],"m":"asl","o":"a"},{"a":1425,"t":"code","b":[102,22],"m":"ror","oa":22,"o":"serial_byte"},{"a":1427,"t":"code","b":[96],"m":"rts"},{"a":1428,"l":"send_serial_byte","c":"Sends the byte in A to the drive: stores it in $16 and calls $05A3 four times, two bits each.","t":"code","b":[133,22],"m":"sta","oa":22,"o":"serial_byte","x":[1367,1375]},{"a":1430,"t":"code","b":[32,163,5],"m":"jsr","oa":1443,"o":"send_two_bits"},{"a":1433,"t":"code","b":[32,163,5],"m":"jsr","oa":1443,"o":"send_two_bits"},{"a":1436,"t":"code","b":[32,163,5],"m":"jsr","oa":1443,"o":"send_two_bits"},{"a":1439,"t":"code","b":[32,163,5],"m":"jsr","oa":1443,"o":"send_two_bits"},{"a":1442,"t":"code","b":[96],"m":"rts"},{"a":1443,"l":"send_two_bits","c":"Sends two bits of $16: for each, shifts the lowest bit out of $16 and writes $DD00 with bit 5 set when it was 1, using $17 and $07 as the base values (the two are patched at $05A4 and $05B3).","t":"code","b":[169,23],"m":"lda","o":"#$17","x":[1430,1433,1436,1439]},{"a":1444,"t":"note","l":"send_bits_operand_1","c":"Operand of the LDA #$17 at $05A3: the first base value written to $DD00 by $05A3, patched by $04C9.","note":"inside the item at $05A3","x":[1240]},{"a":1445,"t":"code","b":[70,22],"m":"lsr","oa":22,"o":"serial_byte"},{"a":1447,"t":"code","b":[144,2],"m":"bcc","oa":1451,"o":"b_05AB"},{"a":1449,"t":"code","b":[9,32],"m":"ora","o":"#$20"},{"a":1451,"l":"b_05AB","t":"code","b":[141,0,221],"m":"sta","o":"cia2_port_a","x":[1447]},{"a":1454,"t":"code","b":[234],"m":"nop"},{"a":1455,"t":"code","b":[234],"m":"nop"},{"a":1456,"t":"code","b":[234],"m":"nop"},{"a":1457,"t":"code","b":[234],"m":"nop"},{"a":1458,"t":"code","b":[169,7],"m":"lda","o":"#$07"},{"a":1459,"t":"note","l":"send_bits_operand_2","c":"Operand of the LDA #$07 at $05B2: the second base value written to $DD00 by $05A3, patched by $04C9.","note":"inside the item at $05B2","x":[1235]},{"a":1460,"t":"code","b":[70,22],"m":"lsr","oa":22,"o":"serial_byte"},{"a":1462,"t":"code","b":[144,2],"m":"bcc","oa":1466,"o":"b_05BA"},{"a":1464,"t":"code","b":[9,32],"m":"ora","o":"#$20"},{"a":1466,"l":"b_05BA","t":"code","b":[141,0,221],"m":"sta","o":"cia2_port_a","x":[1462]},{"a":1469,"t":"code","b":[234],"m":"nop"},{"a":1470,"t":"code","b":[234],"m":"nop"},{"a":1471,"t":"code","b":[96],"m":"rts"},{"a":1472,"l":"wait_for_drive","c":"Short delay, then waits until bit 6 of $DD00 is set, writes $C7 (patched at $05CD) to $DD00, stores $FE in $0706 and delays again.","t":"code","b":[162,50],"m":"ldx","o":"#$32","x":[1266,1299,1362]},{"a":1474,"l":"b_05C2","t":"code","b":[202],"m":"dex","x":[1475]},{"a":1475,"t":"code","b":[208,253],"m":"bne","oa":1474,"o":"b_05C2"},{"a":1477,"l":"b_05C5","t":"code","b":[173,0,221],"m":"lda","o":"cia2_port_a","x":[1482]},{"a":1480,"t":"code","b":[41,64],"m":"and","o":"#$40"},{"a":1482,"t":"code","b":[240,249],"m":"beq","oa":1477,"o":"b_05C5"},{"a":1484,"t":"code","b":[169,199],"m":"lda","o":"#$C7"},{"a":1485,"t":"note","l":"wait_operand","c":"Operand of the LDA #$C7 at $05CC: the value $05C0 writes to $DD00 once the drive answers, patched by $04C9.","note":"inside the item at $05CC","x":[1258]},{"a":1486,"t":"code","b":[141,0,221],"m":"sta","o":"cia2_port_a"},{"a":1489,"t":"code","b":[169,254],"m":"lda","o":"#$FE"},{"a":1491,"t":"code","b":[141,6,7],"m":"sta","oa":1798,"o":"sync_byte"},{"a":1494,"t":"code","b":[162,5],"m":"ldx","o":"#$05"},{"a":1496,"l":"b_05D8","t":"code","b":[202],"m":"dex","x":[1497]},{"a":1497,"t":"code","b":[208,253],"m":"bne","oa":1496,"o":"b_05D8"},{"a":1499,"t":"code","b":[96],"m":"rts"},{"a":1500,"l":"show_load_error","c":"Runs when a load ends with carry clear. Switches the ROMs and I/O back in ($01=$37), sets the text screen ($D018=$15, $D011=$1B, $D016=$C8), $DD00=$97, sets the error flag $0624 to 1 and copies the 24 bytes of \"DISC ERROR\" from $060C to screen row 21 at $0748, with colour 7 in colour RAM at $DB48.","t":"code","b":[169,55],"m":"lda","o":"#$37","x":[1208]},{"a":1502,"t":"code","b":[133,1],"m":"sta","oa":1,"o":"processor_port"},{"a":1504,"t":"code","b":[169,21],"m":"lda","o":"#$15"},{"a":1506,"t":"code","b":[141,24,208],"m":"sta","o":"vic_memory"},{"a":1509,"t":"code","b":[169,27],"m":"lda","o":"#$1B"},{"a":1511,"t":"code","b":[141,17,208],"m":"sta","o":"vic_control1"},{"a":1514,"t":"code","b":[169,200],"m":"lda","o":"#$C8"},{"a":1516,"t":"code","b":[141,22,208],"m":"sta","o":"vic_control2"},{"a":1519,"t":"code","b":[169,151],"m":"lda","o":"#$97"},{"a":1521,"t":"code","b":[141,0,221],"m":"sta","o":"cia2_port_a"},{"a":1524,"t":"code","b":[169,1],"m":"lda","o":"#$01"},{"a":1526,"t":"code","b":[141,36,6],"m":"sta","oa":1572,"o":"load_error"},{"a":1529,"t":"code","b":[160,0],"m":"ldy","o":"#$00"},{"a":1531,"l":"b_05FB","t":"code","b":[169,7],"m":"lda","o":"#$07","x":[1545]},{"a":1533,"t":"code","b":[153,72,219],"m":"sta","o":"$DB48,y"},{"a":1536,"t":"code","b":[185,12,6],"m":"lda","oa":1548,"o":"disc_error_text,y"},{"a":1539,"t":"code","b":[153,72,7],"m":"sta","oa":1864,"o":"screen_row_21,y"},{"a":1542,"t":"code","b":[200],"m":"iny"},{"a":1543,"t":"code","b":[192,24],"m":"cpy","o":"#$18"},{"a":1545,"t":"code","b":[208,240],"m":"bne","oa":1531,"o":"b_05FB"},{"a":1547,"t":"code","b":[96],"m":"rts"},{"a":1548,"l":"disc_error_text","c":"\"DISC ERROR\", shown by the loader when a load fails.","t":"byte","b":[32,32,32,32,32,32,32,32],"x":[1536]},{"a":1556,"t":"byte","b":[32,32,32,32,32,32,4,9]},{"a":1564,"t":"byte","b":[19,3,32,5,18,18,15,18]},{"a":1572,"l":"load_error","c":"Set when a load fails; makes $0625 show the disk prompt again and $0407 retry the load.","t":"byte","b":[0],"x":[1052,1526,1602,1625,1632]},{"a":1573,"l":"load_prompt","c":"Screen shown between levels. Banks the KERNAL in ($01=$37), sets a text screen at $0400, and prints either the disk-side prompt (before level 1, before level 4, and after an error) or the next-level prompt, then waits for fire on joystick port 2 ($DC00).","t":"code","b":[169,55],"m":"lda","o":"#$37","x":[1032]},{"a":1575,"t":"code","b":[133,1],"m":"sta","oa":1,"o":"processor_port"},{"a":1577,"t":"code","b":[169,21],"m":"lda","o":"#$15"},{"a":1579,"t":"code","b":[141,24,208],"m":"sta","o":"vic_memory"},{"a":1582,"t":"code","b":[169,27],"m":"lda","o":"#$1B"},{"a":1584,"t":"code","b":[141,17,208],"m":"sta","o":"vic_control1"},{"a":1587,"t":"code","b":[169,200],"m":"lda","o":"#$C8"},{"a":1589,"t":"code","b":[141,22,208],"m":"sta","o":"vic_control2"},{"a":1592,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":1594,"t":"code","b":[141,21,208],"m":"sta","o":"vic_sprite_enable"},{"a":1597,"t":"code","b":[169,151],"m":"lda","o":"#$97"},{"a":1599,"t":"code","b":[141,0,221],"m":"sta","o":"cia2_port_a"},{"a":1602,"t":"code","b":[173,36,6],"m":"lda","oa":1572,"o":"load_error"},{"a":1605,"t":"code","b":[208,18],"m":"bne","oa":1625,"o":"b_0659"},{"a":1607,"t":"code","b":[160,0],"m":"ldy","o":"#$00"},{"a":1609,"t":"code","b":[152],"m":"tya"},{"a":1610,"l":"b_064A","t":"code","b":[153,0,216],"m":"sta","o":"colour_ram,y","x":[1623]},{"a":1613,"t":"code","b":[153,0,217],"m":"sta","o":"$D900,y"},{"a":1616,"t":"code","b":[153,0,218],"m":"sta","o":"$DA00,y"},{"a":1619,"t":"code","b":[153,0,219],"m":"sta","o":"$DB00,y"},{"a":1622,"t":"code","b":[200],"m":"iny"},{"a":1623,"t":"code","b":[208,241],"m":"bne","oa":1610,"o":"b_064A"},{"a":1625,"l":"b_0659","t":"code","b":[173,36,6],"m":"lda","oa":1572,"o":"load_error","x":[1605]},{"a":1628,"t":"code","b":[240,8],"m":"beq","oa":1638,"o":"b_0666"},{"a":1630,"t":"code","b":[160,0],"m":"ldy","o":"#$00"},{"a":1632,"t":"code","b":[140,36,6],"m":"sty","oa":1572,"o":"load_error"},{"a":1635,"t":"code","b":[76,111,6],"m":"jmp","oa":1647,"o":"j_066F"},{"a":1638,"l":"b_0666","t":"code","b":[173,53,4],"m":"lda","oa":1077,"o":"level_number","x":[1628]},{"a":1641,"t":"code","b":[240,4],"m":"beq","oa":1647,"o":"j_066F"},{"a":1643,"t":"code","b":[201,3],"m":"cmp","o":"#$03"},{"a":1645,"t":"code","b":[208,45],"m":"bne","oa":1692,"o":"b_069C"},{"a":1647,"l":"j_066F","t":"code","b":[169,1],"m":"lda","o":"#$01","x":[1635,1641,1661]},{"a":1649,"t":"code","b":[153,112,219],"m":"sta","o":"$DB70,y"},{"a":1652,"t":"code","b":[185,177,6],"m":"lda","oa":1713,"o":"insert_disk_text,y"},{"a":1655,"t":"code","b":[153,112,7],"m":"sta","oa":1904,"o":"screen_row_22,y"},{"a":1658,"t":"code","b":[200],"m":"iny"},{"a":1659,"t":"code","b":[192,40],"m":"cpy","o":"#$28"},{"a":1661,"t":"code","b":[208,240],"m":"bne","oa":1647,"o":"j_066F"},{"a":1663,"t":"code","b":[162,49],"m":"ldx","o":"#$31"},{"a":1665,"t":"code","b":[173,53,4],"m":"lda","oa":1077,"o":"level_number"},{"a":1668,"t":"code","b":[201,3],"m":"cmp","o":"#$03"},{"a":1670,"t":"code","b":[144,2],"m":"bcc","oa":1674,"o":"b_068A"},{"a":1672,"t":"code","b":[162,50],"m":"ldx","o":"#$32"},{"a":1674,"l":"b_068A","t":"code","b":[142,131,7],"m":"stx","oa":1923,"o":"side_digit","x":[1670]},{"a":1677,"l":"b_068D","t":"code","b":[173,0,220],"m":"lda","o":"cia1_port_a","x":[1682,1710]},{"a":1680,"t":"code","b":[41,16],"m":"and","o":"#$10"},{"a":1682,"t":"code","b":[240,249],"m":"beq","oa":1677,"o":"b_068D"},{"a":1684,"l":"b_0694","t":"code","b":[173,0,220],"m":"lda","o":"cia1_port_a","x":[1689]},{"a":1687,"t":"code","b":[41,16],"m":"and","o":"#$10"},{"a":1689,"t":"code","b":[208,249],"m":"bne","oa":1684,"o":"b_0694"},{"a":1691,"t":"code","b":[96],"m":"rts"},{"a":1692,"l":"b_069C","t":"code","b":[160,0],"m":"ldy","o":"#$00","x":[1645]},{"a":1694,"l":"b_069E","t":"code","b":[169,1],"m":"lda","o":"#$01","x":[1708]},{"a":1696,"t":"code","b":[153,112,219],"m":"sta","o":"$DB70,y"},{"a":1699,"t":"code","b":[185,218,6],"m":"lda","oa":1754,"o":"next_level_text,y"},{"a":1702,"t":"code","b":[153,112,7],"m":"sta","oa":1904,"o":"screen_row_22,y"},{"a":1705,"t":"code","b":[200],"m":"iny"},{"a":1706,"t":"code","b":[192,40],"m":"cpy","o":"#$28"},{"a":1708,"t":"code","b":[208,240],"m":"bne","oa":1694,"o":"b_069E"},{"a":1710,"t":"code","b":[76,141,6],"m":"jmp","oa":1677,"o":"b_068D"},{"a":1713,"l":"insert_disk_text","c":"\"INSERT DISK SIDE #1, THEN PRESS FIRE\"; the side digit is patched to 1 or 2 by $067F before printing.","t":"byte","b":[32,9,14,19,5,18,20,32],"x":[1652]},{"a":1721,"t":"byte","b":[4,9,19,11,32,19,9,4]},{"a":1729,"t":"byte","b":[5,32,35,49,44,32,20,8]},{"a":1737,"t":"byte","b":[5,14,32,16,18,5,19,19]},{"a":1745,"t":"byte","b":[32,6,9,18,5,32,32,32]},{"a":1753,"l":"insert_disk_text_end","c":"One byte ($20, a space in screen codes) after insert_disk_text; the text's prompt print routine does not reach it.","t":"byte","b":[32]},{"a":1754,"l":"next_level_text","c":"\"PRESS FIRE TO LOAD NEXT LEVEL\", shown before levels 2, 3, 5 and 6.","t":"byte","b":[32,32,32,32,32,16,18,5],"x":[1699]},{"a":1762,"t":"byte","b":[19,19,32,6,9,18,5,32]},{"a":1770,"t":"byte","b":[20,15,32,12,15,1,4,32]},{"a":1778,"t":"byte","b":[14,5,24,20,32,12,5,22]},{"a":1786,"t":"byte","b":[5,12,32,32,32,32,32,32]},{"a":1794,"l":"loader_tail","c":"Two bytes ($02 and $FE) after next_level_text that no traced code reads.","t":"byte","b":[32,5]},{"a":1796,"l":"saved_x","c":"X saved by $0546 and handed back to the caller by $053D, because the bit routines use X.","t":"byte","b":[0],"x":[1341,1351]},{"a":1797,"l":"saved_y","c":"Y saved by $0546 and handed back to the caller by $053D, because the bit routines use Y.","t":"byte","b":[2],"x":[1344,1354]},{"a":1798,"l":"sync_byte","c":"Byte written by $05D3 with $FE after the drive has answered; nothing in the resident code reads it.","t":"byte","b":[254],"x":[1491]},{"a":1799,"l":"file_name_buffer","c":"Buffer for the file name: $0493 stores the name bytes here up to its zero terminator and $0546 sends them to the drive. After the last load of this run it holds 31 42 00 (\"1B\"). The bytes behind the name, up to $0747, are leftovers of the start-up program's copy loop, which the loader never reads.","t":"byte","b":[49,66,0,142,32,208,142,33],"x":[1195,1372]},{"a":1807,"t":"byte","b":[208,142,17,208,189,19,8,157]},{"a":1815,"t":"byte","b":[0,4,189,19,9,157,0,5]},{"a":1823,"t":"byte","b":[189,19,10,157,0,6,189,19]},{"a":1831,"t":"byte","b":[11,157,0,7,202,208,229,32]},{"a":1839,"t":"byte","b":[80,11,76,0,4,173,25,208]},{"a":1847,"t":"byte","b":[141,25,208,76,126,234,120,169]},{"a":1855,"t":"byte","b":[54,133,1,173,188,11,141,80]},{"a":1863,"t":"byte","b":[11]},{"a":1864,"l":"screen_row_21","c":"Screen row 21 of the text screen at $0400 (colour RAM $DB48), 40 bytes. $05DC copies the 24 bytes of \"DISC ERROR\" to its first 24 bytes. In the level 1 snapshot it holds leftover start-up program bytes.","t":"byte","b":[32,132,255,32,138,255,120,169],"x":[1539]},{"a":1872,"t":"byte","b":[71,141,20,3,169,11,141,21]},{"a":1880,"t":"byte","b":[3,32,189,11,169,35,162,12]},{"a":1888,"t":"byte","b":[133,158,134,159,32,224,11,160]},{"a":1896,"t":"byte","b":[0,177,158,32,214,11,200,192]},{"a":1904,"l":"screen_row_22","c":"Screen row 22 (colour RAM $DB70), 40 bytes, where the prompt $0625 prints one of its two texts: \"INSERT DISK SIDE #1, THEN PRESS FIRE\" from $06B1 or \"PRESS FIRE TO LOAD NEXT LEVEL\" from $06DA. The snapshot holds the first.","t":"byte","b":[32,9,14,19,5,18,20,32],"x":[1655,1702]},{"a":1912,"t":"byte","b":[4,9,19,11,32,19,9,4]},{"a":1920,"t":"byte","b":[5,32,35]},{"a":1923,"l":"side_digit","c":"Screen cell of the disk side digit inside the prompt text: $068A stores \"1\" or \"2\" here, according to the level number.","t":"byte","b":[49,44,32,20,8,5,14,32],"x":[1674]},{"a":1931,"t":"byte","b":[16,18,5,19,19,32,6,9]},{"a":1939,"t":"byte","b":[18,5,32,32,32]},{"a":1944,"l":"boot_leftover_routines","c":"104 bytes left in memory by the boot program that loaded with the game. Nothing in the resident loader refers to them. They begin in the middle of a routine that sets the serial-bus lines in $DD00 and waits ($0798-$07A9: the bytes read as the end of LDA $DD00, AND #$03, ORA #$C4, STA $DD00, a delay loop and RTS, but the LDA opcode that would sit at $0797 is $20, a space of the screen row that ends there), then calls the KERNAL's disk-command routines ($07AA-$07C2: $FFE7, $FFBA, $FFBD, $FFC0, $FFC9), a one-character print stub ($07C3-$07CC), and a routine that sends the characters M, - and W, an address and the length 16 through $0BD6 ($07CD-$07F3): the shape of the disk drive's memory-write command. The level 1 file holds data where the $0BD6 they call used to be.","t":"byte","b":[0,221,41,3,9,196,141,0]},{"a":1952,"t":"byte","b":[221,162,0,136,208,253,202,208]},{"a":1960,"t":"byte","b":[250,96,32,231,255,162,8,169]},{"a":1968,"t":"byte","b":[15,168,32,186,255,169,0,32]},{"a":1976,"t":"byte","b":[189,255,32,192,255,162,15,32]},{"a":1984,"t":"byte","b":[201,255,96,140,3,7,32,210]},{"a":1992,"t":"byte","b":[255,172,3,7,96,169,77,32]},{"a":2000,"t":"byte","b":[214,11,169,45,32,214,11,169]},{"a":2008,"t":"byte","b":[87,32,214,11,165,158,56,233]},{"a":2016,"t":"byte","b":[35,8,24,32,214,11,40,165]},{"a":2024,"t":"byte","b":[159,233,7,24,32,214,11,169]},{"a":2032,"t":"byte","b":[16,76,214,11,160,0,185,21]},{"a":2040,"t":"byte","b":[12,32,214,11,200,192,6,208]},{"a":2048,"l":"boot_basic_stub","c":"The BASIC program the boot loaded at $0801, 13 bytes: a zero, the link to the next line ($080B), line number 10, the SYS token $9E and the text 2061, the end of the line, and the two zeros that end the program. SYS 2061 is $080D.","t":"byte","b":[0,11,8,10,0,158,50,48]},{"a":2056,"t":"byte","b":[54,49,0,0,0]},{"a":2061,"l":"boot_entry","c":"SYS 2061 starts here: LDX #$FF, TXS, JMP $0B1B. The address $0B1B lies in the boot program's code, which the level 1 file has since overwritten, so what it did next is not in memory.","t":"byte","b":[162,255,154,76,27,11]},{"a":2067,"l":"loader_load_image","c":"493 bytes: the resident loader as the boot loaded it, which the loader at $0400-$05EC copies byte for byte (it lies $0413 below this), except for ten operands that differ: the level number at $0435, the read pointer at $04BE and $04BF, the operand at $04EE, and six operands the loader sets from the low four bits of $DD00 ($054E, $057A, $0589, $05A4, $05B3 and $05CD). Nothing runs from here; the loader at $0400 is the one in use.","t":"byte","b":[169,0,162,0,32,47,4,120]},{"a":2075,"t":"byte","b":[32,37,6,169,0,141,17,208]},{"a":2083,"t":"byte","b":[174,53,4,189,63,4,188,69]},{"a":2091,"t":"byte","b":[4,32,54,4,173,36,6,208]},{"a":2099,"t":"byte","b":[231,238,53,4,76,32,10,0]},{"a":2107,"t":"byte","b":[0,0,0,0,0,0,0,169]},{"a":2115,"t":"byte","b":[0,141,53,4,96,0,141,190]},{"a":2123,"t":"byte","b":[4,140,191,4,76,147,4,75]},{"a":2131,"t":"byte","b":[87,99,111,123,135,4,4,4]},{"a":2139,"t":"byte","b":[4,4,4,32,10,49,65,0]},{"a":2147,"t":"byte","b":[0,191,49,66,0,255,255,32]},{"a":2155,"t":"byte","b":[10,50,65,0,0,191,50,66]},{"a":2163,"t":"byte","b":[0,255,255,32,10,51,65,0]},{"a":2171,"t":"byte","b":[0,224,51,66,0,255,255,32]},{"a":2179,"t":"byte","b":[10,52,65,0,0,191,52,66]},{"a":2187,"t":"byte","b":[0,255,255,32,10,53,65,0]},{"a":2195,"t":"byte","b":[0,191,53,66,0,255,255,32]},{"a":2203,"t":"byte","b":[10,54,65,0,0,191,54,66]},{"a":2211,"t":"byte","b":[0,255,255,32,189,4,201,255]},{"a":2219,"t":"byte","b":[208,1,96,133,20,32,189,4]},{"a":2227,"t":"byte","b":[133,21,160,0,32,189,4,201]},{"a":2235,"t":"byte","b":[0,240,6,153,7,7,200,208]},{"a":2243,"t":"byte","b":[243,152,32,201,4,176,220,234]},{"a":2251,"t":"byte","b":[32,220,5,234,96,173,255,255]},{"a":2259,"t":"byte","b":[238,190,4,208,3,238,191,4]},{"a":2267,"t":"byte","b":[96,169,4,141,238,4,173,0]},{"a":2275,"t":"byte","b":[221,41,15,141,179,5,73,16]},{"a":2283,"t":"byte","b":[141,164,5,73,48,141,78,5]},{"a":2291,"t":"byte","b":[73,176,141,122,5,73,80,141]},{"a":2299,"t":"byte","b":[137,5,141,205,5,169,2,32]},{"a":2307,"t":"byte","b":[70,5,32,192,5,32,103,5]},{"a":2315,"t":"byte","b":[32,103,5,160,0,32,103,5]},{"a":2323,"t":"byte","b":[201,172,208,21,32,103,5,201]},{"a":2331,"t":"byte","b":[172,240,14,201,255,240,46,201]},{"a":2339,"t":"byte","b":[247,240,41,32,192,5,76,253]},{"a":2347,"t":"byte","b":[4,141,41,5,165,1,72,169]},{"a":2355,"t":"byte","b":[2,141,32,208,169,52,133,1]},{"a":2363,"t":"byte","b":[169,0,145,20,104,133,1,169]},{"a":2371,"t":"byte","b":[0,141,32,208,200,208,2,230]},{"a":2379,"t":"byte","b":[21,76,253,4,24,174,4,7]},{"a":2387,"t":"byte","b":[172,5,7,169,0,96,72,142]},{"a":2395,"t":"byte","b":[4,7,140,5,7,169,36,141]},{"a":2403,"t":"byte","b":[0,221,32,192,5,104,170,32]},{"a":2411,"t":"byte","b":[148,5,160,0,185,7,7,32]},{"a":2419,"t":"byte","b":[148,5,200,202,208,246,96,32]},{"a":2427,"t":"byte","b":[121,5,32,121,5,32,121,5]},{"a":2435,"t":"byte","b":[32,121,5,32,120,5,165,22]},{"a":2443,"t":"byte","b":[96,162,148,173,0,221,142,0]},{"a":2451,"t":"byte","b":[221,10,102,22,72,104,72,104]},{"a":2459,"t":"byte","b":[162,196,173,0,221,142,0,221]},{"a":2467,"t":"byte","b":[10,102,22,96,133,22,32,163]},{"a":2475,"t":"byte","b":[5,32,163,5,32,163,5,32]},{"a":2483,"t":"byte","b":[163,5,96,169,20,70,22,144]},{"a":2491,"t":"byte","b":[2,9,32,141,0,221,234,234]},{"a":2499,"t":"byte","b":[234,234,169,4,70,22,144,2]},{"a":2507,"t":"byte","b":[9,32,141,0,221,234,234,96]},{"a":2515,"t":"byte","b":[162,50,202,208,253,173,0,221]},{"a":2523,"t":"byte","b":[41,64,240,249,169,196,141,0]},{"a":2531,"t":"byte","b":[221,169,254,141,6,7,162,5]},{"a":2539,"t":"byte","b":[202,208,253,96,169,55,133,1]},{"a":2547,"t":"byte","b":[169,21,141,24,208,169,27,141]},{"a":2555,"t":"byte","b":[17,208,169,200,141]},{"a":2560,"l":"score_digits","c":"The seven digits of the score, one decimal digit per byte, most significant first ($0A00-$0A06): the levels add to them with a carry towards the lower address and draw them into the panel. The next 9 bytes, $0A07-$0A0F, are not used by the resident code.","t":"byte","b":[0,0,0,0,0,0,0,0]},{"a":2568,"t":"byte","b":[1,141,36,6,160,0,169,7]},{"a":2576,"l":"mask_result","c":"Result of the mask-matching game kept for the next level: the rating routines of levels 1 and 5 store 0, 1 or 2 here (level 3 reads it). The levels read it as a flag: while non-zero the countdown timer starts at 500 and its picture is drawn, and the timer's expiry clears it; the follower checks of levels 4 and 6 return at once when it is non-zero. The continue screens clear it.","t":"byte","b":[0]},{"a":2577,"l":"skip_flag","c":"Flag tested by the levels' main loops: while non-zero the key code $20 ends the level and a level with no energy does not go to the game over screen. Level 1's cheat_check ($1385) flips it when BABY AXE MAN is typed on the title pages ($13BB, $13C0); level 1 also clears it at $0AEC. An unreferenced routine of level 6 ($5552) sets it to 1 when CIA 1 port B reads $7F.","t":"byte","b":[0]},{"a":2578,"l":"credits","c":"Number of credits (continues) left, shown as a digit on the continue screens, which are only entered while it is non-zero. It holds 3 in the level 1 snapshot.","t":"byte","b":[3]},{"a":2579,"l":"title_step_value","c":"Byte that level 1's title step ($124E) compares with $58, calling $1110 while they match and the NMI flag is clear. It holds $58 in the level 1 snapshot. The 12 bytes after it, up to $0A1F, are not used by the resident code.","t":"byte","b":[88,12,6,153,72,7,200,192]},{"a":2587,"t":"byte","b":[24,208,240,96,32]},{"a":2592,"t":"gap","n":38368,"x":[1060]},{"a":40960,"l":"tune_driver_flag","c":"Driver flag. $A0C8 sets it to $1F. $A0EE returns at once while it is zero, and $A880 clears a voice's registers $D404-$D406 at the end of a drum list only while it is non-zero. $A164 clears it, and $A810 does nothing while it is non-zero.","t":"byte","b":[0],"x":[41176,41198,41321,43024,43151]},{"a":40961,"l":"tune_hold_flag","c":"While non-zero, $A242 returns at once and touches no voice. $A164 adds 1 to it when it begins and clears it when it ends, so the player stays out while a tune is being set up.","t":"byte","b":[0],"x":[41316,41534,41538]},{"a":40962,"l":"tune_voice_scratch","c":"Scratch byte: $A5BB keeps twice the wave-program number here, and $A8A6 keeps the voice number here while it writes a drum step.","t":"byte","b":[20],"x":[42431,42439,43174,43230]},{"a":40963,"l":"tune_step_scratch","c":"Scratch byte: $A8A6 keeps the drum step number here while it writes the step to the chip.","t":"byte","b":[0],"x":[43177,43207]},{"a":40964,"l":"tune_note_countdown","c":"Frames left in the current note of each of the three voices (3 bytes). $A307 counts it down and reads the next stream entry at zero; $A328 reloads it from the entry's length byte (or from $A007 in fixed-length mode), the drum command sets it from the byte after the drum number, and $A126 starts it at the voice number plus 1.","t":"byte","b":[3,10,10],"x":[41262,41472,41735,41946,42351,42694]},{"a":40967,"l":"tune_fixed_length","c":"Note length of each voice (3 bytes) as set by stream command $87. $A328 uses it instead of a length byte after each note while the voice's flag in $A087 is non-zero.","t":"byte","b":[6,0,0],"x":[41937,42573]},{"a":40970,"l":"tune_wave_countdown","c":"Frames until each voice's wave program takes its next step (3 bytes). $A4C4 counts it down and runs the step at zero; a new note sets it to 1 and the wave-program commands set it to the wait they read.","t":"byte","b":[255,9,232],"x":[41481,41807,42180,42260,42325,42357,42379]},{"a":40973,"l":"tune_pulse_countdown","c":"Frames left in each voice's current pulse-width step (3 bytes). $A700 counts it down and fetches the next step from the table at $AB47 at zero; a new note sets it to 1 unless the mask $02 is set in the voice's byte in $A0C4.","t":"byte","b":[2,3,232],"x":[41484,41831,42752,42775]},{"a":40976,"l":"tune_slide_countdown","c":"Frames left in each voice's current pitch-slide step (3 bytes), counted down by $A74A. A new note sets it to 1 when the voice has a slide and the mask $01 is clear in its byte in $A0C4.","t":"byte","b":[2,2,3],"x":[41487,41866,42831,42859,42902]},{"a":40979,"l":"tune_filter_countdown","c":"Frames left in the current filter-sweep step, counted down by $A810. Notes of a voice with the filter on, the filter command $A6CA and the drum command $A666 set it to 1.","t":"byte","b":[5],"x":[41490,41929,43048,43071]},{"a":40980,"l":"tune_track_index","c":"Position in each voice's track list (3 bytes), the offset from the list address $A01A/$A01D. $A3FA reads the entry at that position and the track commands change it. The 3 bytes after it, $A017-$A019, are not used by the driver.","t":"byte","b":[4,4,5,0,0,0],"x":[41379,42010,42043,42068,42080,42083,42112,42115,42133,42136,42168,42171,42174]},{"a":40986,"l":"tune_track_lo","c":"Low byte of the address of each voice's track list (3 bytes), loaded into $F2 by $A3FA. $A164 fills it from the tune table at $AA8D.","t":"byte","b":[11,67,243],"x":[41333,41980]},{"a":40989,"l":"tune_track_hi","c":"High byte of the address of each voice's track list (3 bytes), loaded into $F3 by $A3FA. $A164 fills it from the tune table at $AA8D.","t":"byte","b":[177,177,176],"x":[41339,41985]},{"a":40992,"l":"tune_wave_ptr_lo","c":"Low byte of the address of each voice's wave program step (3 bytes), the list of SID control-register values and waits that $A4C4 runs. $A5A7 stores the advanced pointer here; a new note copies it from $A023, and $A126 sets it to the idle program at $A981.","t":"byte","b":[129,154,131],"x":[41296,41416,41813,42216,42416]},{"a":40995,"l":"tune_wave_start_lo","c":"Low byte of the start of each voice's wave program (3 bytes): $A5BB sets it from the table at $ACF7, and a new note copies it to $A020 unless the mask $04 is set in the voice's byte in $A0C4.","t":"byte","b":[120,144,129],"x":[41299,41419,41810,42445]},{"a":40998,"l":"tune_wave_ptr_hi","c":"High byte of the address of each voice's wave program step (3 bytes); see $A020. A new note copies it from $A029.","t":"byte","b":[173,173,169],"x":[41304,41424,41819,42221,42423]},{"a":41001,"l":"tune_wave_start_hi","c":"High byte of the start of each voice's wave program (3 bytes); see $A023.","t":"byte","b":[173,173,169],"x":[41307,41427,41816,42451]},{"a":41004,"l":"tune_pulse_index","c":"Index of each voice into the pulse-width table at $AB47 (3 bytes): $A700 reads the step there and moves it on by 3, or to the index that follows a zero count. A new note copies it from $A02F.","t":"byte","b":[30,30,3],"x":[41837,42757,42769,42794]},{"a":41007,"l":"tune_pulse_start","c":"Start index of each voice into the pulse-width table (3 bytes), set by stream command $82 and cleared by $A0C8 and $A126. A new note copies it to $A02C.","t":"byte","b":[27,27,0],"x":[41191,41312,41432,41834,42460]},{"a":41010,"l":"tune_slide_table_select","c":"Selects each voice's pitch-slide table (3 bytes): $A74A uses the table at $AB85 while it is zero and the one at $ABDA otherwise. Only $A5F3 and $A126 write it, and only with zero.","t":"byte","b":[0,0,0],"x":[42499,42836]},{"a":41013,"l":"tune_slide_index","c":"Index of each voice into its pitch-slide table (3 bytes), moved on by 3 per step by $A74A and copied from $A038 at a new note.","t":"byte","b":[77,0,0],"x":[41872,42841,42853,42878,42884,42896,42921]},{"a":41016,"l":"tune_slide_start","c":"Start index of each voice's pitch-slide program (3 bytes), set by stream command $83 and copied to $A035 at a new note.","t":"byte","b":[71,0,0],"x":[41869,42486]},{"a":41019,"l":"tune_arp_ptr_lo","c":"Low byte of the address of each voice's arpeggio steps (3 bytes), set by stream command $84 to the address of the entry's step list (two bytes after its header). $A7C3 reads through it. The 3 bytes after it, $A03E-$A040, are not used by the driver.","t":"byte","b":[0,0,0,0,0,0],"x":[42557,42958]},{"a":41025,"l":"tune_arp_ptr_hi","c":"High byte of the address of each voice's arpeggio steps (3 bytes); see $A03B. The 3 bytes after it, $A044-$A046, are not used by the driver.","t":"byte","b":[0,0,0,0,0,0],"x":[42564,42963]},{"a":41031,"l":"tune_filter_start","c":"Start index into the filter-sweep table at $ACDB, set by stream command $85 and copied to $A048 at a new note of a voice with the filter on.","t":"byte","b":[10],"x":[41435,41909,42701]},{"a":41032,"l":"tune_filter_index","c":"Current index into the filter-sweep table at $ACDB, moved on by 3 per step by $A810.","t":"byte","b":[13],"x":[41912,43053,43065,43089]},{"a":41033,"l":"tune_filter_step_lo","c":"Low byte of the amount $A810 adds to the filter value $A04E each frame, read from the sweep table.","t":"byte","b":[156],"x":[43078,43096]},{"a":41034,"l":"tune_filter_step_hi","c":"High byte of the amount $A810 adds to the filter value $A04D each frame, read from the sweep table.","t":"byte","b":[255],"x":[43085,43113]},{"a":41035,"l":"tune_filter_start_hi","c":"High byte of the filter value a sweep starts from, set by stream command $85 and copied to $A04D when a sweep restarts.","t":"byte","b":[3],"x":[41915,42707]},{"a":41036,"l":"tune_filter_start_lo","c":"Low byte of the filter value a sweep starts from, set by stream command $85 and copied to $A04E when a sweep restarts.","t":"byte","b":[128],"x":[41921,42716]},{"a":41037,"l":"tune_filter_hi","c":"High byte of the 16-bit filter value that $A810 sweeps; its bits are shifted through $A0B7 to make the byte written to the filter cut-off register $D416.","t":"byte","b":[1],"x":[41918,42710,43110,43116]},{"a":41038,"l":"tune_filter_lo","c":"Low byte of the 16-bit filter value that $A810 sweeps; its low three bits go to the cut-off low register $D415.","t":"byte","b":[240],"x":[41924,42719,43092,43099]},{"a":41039,"l":"tune_drum_ctrl_lo","c":"Low byte of the address of each voice's drum control-value list (3 bytes), set by $A666 from the record in the table at $AA48 and patched into the operand at $A8D9 by $A8A6.","t":"byte","b":[0,0,0],"x":[42615,43192]},{"a":41042,"l":"tune_drum_freq_lo","c":"Low byte of the address of each voice's drum frequency list (3 bytes): the control list address plus the list length, set by $A666 and patched into the operand at $A8CB.","t":"byte","b":[0,0,0],"x":[42622,43180]},{"a":41045,"l":"tune_drum_ctrl_hi","c":"High byte of the address of each voice's drum control-value list (3 bytes); see $A04F.","t":"byte","b":[0,0,0],"x":[42628,43198]},{"a":41048,"l":"tune_drum_freq_hi","c":"High byte of the address of each voice's drum frequency list (3 bytes); see $A052.","t":"byte","b":[0,0,0],"x":[42633,43186]},{"a":41051,"l":"tune_stream_lo","c":"Low byte of the address of the stream each voice is playing (3 bytes). $A307 loads it into $F0 and stores $F0 back, and stream command $8B replaces it. $A164 sets it from each voice's first pattern and $A0EE from a table at $B2E6.","t":"byte","b":[176,124,120],"x":[41218,41440,41741,41759,43319]},{"a":41054,"l":"tune_stream_hi","c":"High byte of the address of the stream each voice is playing (3 bytes); see $A05B.","t":"byte","b":[177,177,177],"x":[41224,41445,41746,41764,43325]},{"a":41057,"l":"tune_freq_lo","c":"Low byte of each voice's current frequency (3 bytes), looked up from the note table at $A98C for a new note, changed by the pitch slide and the wave program, and written to $D400, $D407 or $D40E by $A242.","t":"byte","b":[103,139,0],"x":[41659,41674,42207,42927,42934]},{"a":41060,"l":"tune_freq_hi","c":"High byte of each voice's current frequency (3 bytes), looked up from the note table at $A9EA and written to $D401, $D408 or $D40F by $A242.","t":"byte","b":[31,6,0],"x":[41665,41680,42213,42937,42943]},{"a":41063,"l":"tune_note","c":"Number of each voice's current note (3 bytes), as read from its stream by $A328; with the offsets $A08A and $A08D it indexes the note tables.","t":"byte","b":[63,24,0],"x":[41645,41785,42196,42980]},{"a":41066,"l":"tune_track_repeat","c":"Repeat count of each voice's current pattern (3 bytes), set by track command $F1 and counted down by $A3FA; the pattern is read again until it reaches zero.","t":"byte","b":[0,0,4],"x":[41385,42000,42032,42037,42077]},{"a":41069,"l":"tune_wave_position","c":"Offset into the wave program being read; the wave-program commands step it on and $A5A7 adds it to $F0/$F1 to store the new program pointer.","t":"byte","b":[3],"x":[42228,42231,42255,42280,42299,42328,42348,42383,42407,42413]},{"a":41070,"l":"tune_voice_offset","c":"Offset of the current voice's registers from $D400 (0, 7 or $0E), read from the table at $A97E at the start of each voice's turn in $A242.","t":"byte","b":[0],"x":[41553,41671,42093,42302,42331,42360,42396,42643,42797,42924,42989,43309]},{"a":41071,"l":"tune_attack_decay","c":"Attack/decay value of each voice (3 bytes), set by wave-program command 2 ($A52E), which also writes it to the voice's $D405.","t":"byte","b":[1,2,0],"x":[42289,42308]},{"a":41074,"l":"tune_sustain_release","c":"Sustain/release value of each voice (3 bytes), set by wave-program command 2 ($A52E), which also writes it to the voice's $D406.","t":"byte","b":[72,152,0],"x":[42295]},{"a":41077,"l":"tune_slide_on","c":"Non-zero for a voice (3 bytes) whose pitch slide $A74A is running. Stream command $83 sets it and command $84 clears it; $A126 clears it.","t":"byte","b":[4,0,0],"x":[41279,41394,41852,42494,42510,42826]},{"a":41080,"l":"tune_unused_078","c":"3 bytes that $A126 clears and nothing reads.","t":"byte","b":[0,0,0],"x":[41282,41397]},{"a":41083,"l":"tune_arp_on","c":"Non-zero for a voice (3 bytes) whose arpeggio $A7C3 is running; it holds the stream index just after the $84 command. Stream command $83 clears it and $A126 clears it.","t":"byte","b":[0,0,0],"x":[41285,41400,41627,41875,42502,42515,42947]},{"a":41086,"l":"tune_filter_on","c":"Non-zero for a voice (3 bytes) that has the filter on: stream command $85 clears all three and stores the filter control value $D417 in the one for its own voice, and $A0EE clears the first when it starts a sound on another voice. A new note of such a voice restarts the sweep.","t":"byte","b":[0,35,0],"x":[41897,42656,42733,42746,43031]},{"a":41089,"l":"tune_drum_on","c":"Non-zero while a voice (3 bytes) is playing a drum list: $A666 stores the record's sustain/release value here, and a new note clears it. $A242 leaves such a voice's frequency alone and $A8A6 steps it.","t":"byte","b":[0,0,0],"x":[41288,41403,41613,41795,42653,43042,43138]},{"a":41092,"l":"tune_new_note","c":"Non-zero for a voice (3 bytes) whose frequency must be looked up again: a new note sets it to 1 ($A328) and wave-program command 5 sets it to its third parameter ($A583); $A242 does the lookup and clears it.","t":"byte","b":[0,0,0],"x":[41291,41406,41632,41639,41790,42390]},{"a":41095,"l":"tune_fixed_length_on","c":"Non-zero for a voice (3 bytes) in fixed-length mode: stream command $87 sets it and $88 clears it. $A3CC then takes the note length from $A007.","t":"byte","b":[6,0,0],"x":[41273,41388,41932,42576,42589]},{"a":41098,"l":"tune_pitch_offset","c":"Extra offset (3 bytes) added to the note number when the frequency is looked up, set by wave-program command 5 and cleared by $A4C4, which then looks the note up again without it.","t":"byte","b":[0,0,0],"x":[41642,41649,42186,42193,42393,42983]},{"a":41101,"l":"tune_transpose","c":"Transposition of each voice (3 bytes), added to the note number: set by track command $F3, cleared when a track step starts with no repeats left, and cleared by $A126.","t":"byte","b":[251,7,0],"x":[41267,41382,41652,41995,42007,42109,42200,42986]},{"a":41104,"l":"tune_pulse_lo","c":"Current pulse width, low byte, of each voice (3 bytes): $A700 adds the step to it each frame and writes it to $D402, $D409 or $D410. A new note copies it from $A093.","t":"byte","b":[0,192,0],"x":[41843,42800,42807]},{"a":41107,"l":"tune_pulse_start_lo","c":"Initial pulse width, low byte, of each voice (3 bytes), set by stream command $82 ($A5D9) and copied to $A090 at a new note.","t":"byte","b":[0,192,0],"x":[41840,42472]},{"a":41110,"l":"tune_pulse_hi","c":"Current pulse width, high byte, of each voice (3 bytes): $A700 adds the step and the carry to it each frame and writes it to $D403, $D40A or $D411. A new note copies it from $A099.","t":"byte","b":[13,6,0],"x":[41849,42813,42819]},{"a":41113,"l":"tune_pulse_start_hi","c":"Initial pulse width, high byte, of each voice (3 bytes), set by stream command $82 ($A5D9) and copied to $A096 at a new note.","t":"byte","b":[13,6,0],"x":[41846,42466]},{"a":41116,"l":"tune_pulse_step_lo","c":"Low byte of the amount $A700 adds to the pulse width of each voice (3 bytes) every frame, read from the table at $AB47.","t":"byte","b":[0,0,0],"x":[42782,42804]},{"a":41119,"l":"tune_pulse_step_hi","c":"High byte of the amount $A700 adds to the pulse width of each voice (3 bytes) every frame, read from the table at $AB47.","t":"byte","b":[0,0,0],"x":[42789,42816]},{"a":41122,"l":"tune_slide_step_lo","c":"Low byte of the amount $A74A adds to each voice's frequency every frame (3 bytes), read from its pitch-slide table.","t":"byte","b":[36,0,0],"x":[42866,42909,42931]},{"a":41125,"l":"tune_slide_step_hi","c":"High byte of the amount $A74A adds to each voice's frequency every frame (3 bytes), read from its pitch-slide table.","t":"byte","b":[0,0,0],"x":[42873,42916,42940]},{"a":41128,"l":"tune_stream_position","c":"Position of each voice in its stream (3 bytes): the offset that $A328 reads through $F0/$F1. $A307 moves it past each note and the commands move it past their parameters.","t":"byte","b":[25,31,3],"x":[41270,41754,41768,41950,41992,42436,42477,42491,42536,42581,42592,42600,42686,42689,42728,43330]},{"a":41131,"l":"tune_arp_countdown","c":"Frames until each voice's next arpeggio step (3 bytes), counted down by $A7C3 and reloaded from $A0AE; stream command $84 and a new note set it.","t":"byte","b":[0,0,0],"x":[41894,42952,42971]},{"a":41134,"l":"tune_arp_reload","c":"Frames per arpeggio step of each voice (3 bytes), the first byte of the entry chosen by stream command $84 ($A60C); $A7C3 copies it to $A0AB after each step.","t":"byte","b":[0,0,0],"x":[42543,42968]},{"a":41137,"l":"tune_arp_index","c":"Index of each voice's current arpeggio step (3 bytes), counted up by $A7C3 and returned to 0 when it reaches $A0B4.","t":"byte","b":[0,0,0],"x":[41889,42974,43007,43010,43020]},{"a":41140,"l":"tune_arp_length","c":"Number of steps in each voice's arpeggio (3 bytes), the second byte of the entry chosen by stream command $84 ($A60C); $A7C3 compares $A0B1 with it.","t":"byte","b":[0,0,0],"x":[42549,43013]},{"a":41143,"l":"tune_filter_scratch","c":"Scratch byte in which $A810 builds the filter cut-off high byte.","t":"byte","b":[124],"x":[43102,43120,43124,43128]},{"a":41144,"l":"tune_drum_length","c":"Length of each voice's drum list (3 bytes), the third byte of the record read by $A666; $A880 ends the list when $A0BB reaches it.","t":"byte","b":[0,0,0],"x":[42609,42619,43146]},{"a":41147,"l":"tune_drum_step_count","c":"Number of drum steps already played by each voice (3 bytes), set to 0 by $A666 and incremented by $A8A6.","t":"byte","b":[0,0,0],"x":[42683,43143,43233]},{"a":41150,"l":"tune_fade_out_on","c":"Non-zero while a fade-out is running. Track command $F4 and $A91A set it, and $A0C8, $A1FB (tune_start) and $A8F2 clear it. $A242 lowers the volume step by step while it is set.","t":"byte","b":[0],"x":[41165,41467,41571,42124,43258,43290]},{"a":41151,"l":"tune_fade_counter","c":"Counter that the fade-out in $A242 and the fade-in in $A2E3 count down before each change of the volume; reloaded from $A0C0.","t":"byte","b":[4],"x":[41576,41579,41587,41699,41702,41710,42127,42148,43293]},{"a":41152,"l":"tune_fade_rate","c":"Reload value of the fade counter $A0BF: the number of counts per volume step. Set by track commands $F4 and $F5 and by $A91A.","t":"byte","b":[4],"x":[41584,41707,42130,42151,43296]},{"a":41153,"l":"tune_volume_value","c":"The value written to the volume register $D418: the volume in the low nibble. $A0C8 sets it to $1F, the fade routines count it down or up, and $A242 ends the sound with $A8F2 when the low nibble reaches 0.","t":"byte","b":[16],"x":[41173,41526,41590,41593,41713,41716,42156]},{"a":41154,"l":"tune_fade_in_on","c":"Non-zero while a fade-in is running, set by track command $F5. $A2E3 clears it when the volume reaches the target $A0C3; $A0C8, $A8F2 and $A91A clear it too.","t":"byte","b":[0],"x":[41162,41368,41519,41563,41731,42145,43261,43301]},{"a":41155,"l":"tune_fade_target","c":"Volume (low nibble) at which the fade-in stops, the second parameter of track command $F5 ($A49E); $A2E3 compares $A0C1 with it.","t":"byte","b":[15],"x":[41724,42165]},{"a":41156,"l":"tune_keep_flags","c":"Per voice (3 bytes), bits that stop a new note from restarting a part of the voice: 1 the pitch slide, 2 the pulse sweep, 4 the wave program, 8 the filter sweep, $10 the arpeggio. $A126 clears them and $A8F2 sets all of them to $FF.","t":"byte","b":[255,255,255],"x":[41276,41391,41798,41822,41857,41880,41902,43269]},{"a":41159,"l":"tune_sound_scratch","c":"Scratch byte: $A0EE keeps the table position and the voice number here by turns while it starts the sounds.","t":"byte","b":[0],"x":[41210,41230,41233,41244]},{"a":41160,"l":"tune_init","c":"Silences the sound chip, as the copy at $B0C8 does: clears the fade flags $A0C2 and $A0BE and $D417, sets $A0C1, $A000 and the volume register $D418 to $1F, and zeroes the 23 registers $D400-$D416 together with $A02F-$A045. No call to it was found in the level 1 snapshot.","t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":41162,"t":"code","b":[141,194,160],"m":"sta","oa":41154,"o":"tune_fade_in_on"},{"a":41165,"t":"code","b":[141,190,160],"m":"sta","oa":41150,"o":"tune_fade_out_on"},{"a":41168,"t":"code","b":[141,23,212],"m":"sta","o":"sid_filter_resonance"},{"a":41171,"t":"code","b":[169,31],"m":"lda","o":"#$1F"},{"a":41173,"t":"code","b":[141,193,160],"m":"sta","oa":41153,"o":"tune_volume_value"},{"a":41176,"t":"code","b":[141,0,160],"m":"sta","oa":40960,"o":"tune_driver_flag"},{"a":41179,"t":"code","b":[141,24,212],"m":"sta","o":"sid_filter_mode_volume"},{"a":41182,"t":"code","b":[162,22],"m":"ldx","o":"#$16"},{"a":41184,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":41186,"t":"code","b":[157,0,212],"m":"sta","o":"sid_v1_freq_lo,x","x":[41195]},{"a":41189,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":41191,"t":"code","b":[157,47,160],"m":"sta","oa":41007,"o":"tune_pulse_start,x"},{"a":41194,"t":"code","b":[202],"m":"dex"},{"a":41195,"t":"code","b":[16,245],"m":"bpl","oa":41186,"o":"$A0E2"},{"a":41197,"t":"code","b":[96],"m":"rts"},{"a":41198,"l":"tune_play_sound","c":"Copy of the sound starter at $B0EE, in the tune driver. Returns at once while $A000 is zero. Otherwise it takes up to three bytes from the table at $B2E2 and, for each that has bit 7 clear, a stream address from the table at $B2E6; those two addresses are inside the code of the sound driver, so they are not tables of this driver. It uses $A126 to restart each voice. No call to it was found in the level 1 snapshot.","t":"code","b":[173,0,160],"m":"lda","oa":40960,"o":"tune_driver_flag"},{"a":41201,"t":"code","b":[240,50],"m":"beq","oa":41253,"o":"$A125"},{"a":41203,"t":"code","b":[160,0],"m":"ldy","o":"#$00"},{"a":41205,"t":"code","b":[189,226,178],"m":"lda","oa":45794,"o":"$B2E2,x","x":[41251]},{"a":41208,"t":"code","b":[48,37],"m":"bmi","oa":41247,"o":"$A11F"},{"a":41210,"t":"code","b":[142,199,160],"m":"stx","oa":41159,"o":"tune_sound_scratch"},{"a":41213,"t":"code","b":[10],"m":"asl","o":"a"},{"a":41214,"t":"code","b":[170],"m":"tax"},{"a":41215,"t":"code","b":[189,230,178],"m":"lda","oa":45798,"o":"$B2E6,x"},{"a":41218,"t":"code","b":[153,91,160],"m":"sta","oa":41051,"o":"tune_stream_lo,y"},{"a":41221,"t":"code","b":[189,231,178],"m":"lda","oa":45799,"o":"$B2E7,x"},{"a":41224,"t":"code","b":[153,94,160],"m":"sta","oa":41054,"o":"tune_stream_hi,y"},{"a":41227,"t":"code","b":[32,38,161],"m":"jsr","oa":41254,"o":"tune_init_voice"},{"a":41230,"t":"code","b":[174,199,160],"m":"ldx","oa":41159,"o":"tune_sound_scratch"},{"a":41233,"t":"code","b":[140,199,160],"m":"sty","oa":41159,"o":"tune_sound_scratch"},{"a":41236,"t":"code","b":[188,126,169],"m":"ldy","oa":43390,"o":"tune_voice_offsets,x"},{"a":41239,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":41241,"t":"code","b":[153,4,212],"m":"sta","o":"sid_v1_control,y"},{"a":41244,"t":"code","b":[172,199,160],"m":"ldy","oa":41159,"o":"tune_sound_scratch"},{"a":41247,"t":"code","b":[232],"m":"inx","x":[41208]},{"a":41248,"t":"code","b":[200],"m":"iny"},{"a":41249,"t":"code","b":[192,3],"m":"cpy","o":"#$03"},{"a":41251,"t":"code","b":[144,208],"m":"bcc","oa":41205,"o":"$A0F5"},{"a":41253,"t":"code","b":[96],"m":"rts","x":[41201]},{"a":41254,"l":"tune_init_voice","c":"Sets up voice Y (0 to 2) to start a stream: marks it active in $00F7+Y, sets its note countdown $A004 to Y+1, clears its transpose $A08D, stream position $A0A8, fixed-length flag $A087, keep flags $A0C4, slide flag $A075, $A078, arpeggio flag $A07B, drum flag $A081 and new-note flag $A084, points its wave program $A020-$A029 at the idle program $A981 and clears its pulse start $A02F. Called by $A0EE. Same code as the routine at $B138 of the sound driver.","t":"code","b":[169,1],"m":"lda","o":"#$01","x":[41227]},{"a":41256,"t":"code","b":[153,247,0],"m":"sta","oa":247,"o":"voice0_active,y"},{"a":41259,"t":"code","b":[200],"m":"iny"},{"a":41260,"t":"code","b":[152],"m":"tya"},{"a":41261,"t":"code","b":[136],"m":"dey"},{"a":41262,"t":"code","b":[153,4,160],"m":"sta","oa":40964,"o":"tune_note_countdown,y"},{"a":41265,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":41267,"t":"code","b":[153,141,160],"m":"sta","oa":41101,"o":"tune_transpose,y"},{"a":41270,"t":"code","b":[153,168,160],"m":"sta","oa":41128,"o":"tune_stream_position,y"},{"a":41273,"t":"code","b":[153,135,160],"m":"sta","oa":41095,"o":"tune_fixed_length_on,y"},{"a":41276,"t":"code","b":[153,196,160],"m":"sta","oa":41156,"o":"tune_keep_flags,y"},{"a":41279,"t":"code","b":[153,117,160],"m":"sta","oa":41077,"o":"tune_slide_on,y"},{"a":41282,"t":"code","b":[153,120,160],"m":"sta","oa":41080,"o":"tune_unused_078,y"},{"a":41285,"t":"code","b":[153,123,160],"m":"sta","oa":41083,"o":"tune_arp_on,y"},{"a":41288,"t":"code","b":[153,129,160],"m":"sta","oa":41089,"o":"tune_drum_on,y"},{"a":41291,"t":"code","b":[153,132,160],"m":"sta","oa":41092,"o":"tune_new_note,y"},{"a":41294,"t":"code","b":[169,129],"m":"lda","o":"#$81"},{"a":41296,"t":"code","b":[153,32,160],"m":"sta","oa":40992,"o":"tune_wave_ptr_lo,y"},{"a":41299,"t":"code","b":[153,35,160],"m":"sta","oa":40995,"o":"tune_wave_start_lo,y"},{"a":41302,"t":"code","b":[169,169],"m":"lda","o":"#$A9"},{"a":41304,"t":"code","b":[153,38,160],"m":"sta","oa":40998,"o":"tune_wave_ptr_hi,y"},{"a":41307,"t":"code","b":[153,41,160],"m":"sta","oa":41001,"o":"tune_wave_start_hi,y"},{"a":41310,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":41312,"t":"code","b":[153,47,160],"m":"sta","oa":41007,"o":"tune_pulse_start,y"},{"a":41315,"t":"code","b":[96],"m":"rts"},{"a":41316,"l":"tune_start","c":"Starts tune number X/6. Level 1's title code calls it from $0ACA, $0F70 and $1320, loading X with 6 at $0AC1 when the high-score flag $110F is not zero, with $12 at $0AC8 (which replaces the 6 when it is zero) and at $131E, and with 0 at $0F6E. It raises the hold flag $A001, clears $A000 and $F7-$F9, and copies the six bytes at $AA8D+X to the track list addresses $A01A-$A01F. For each voice, 2 down to 0, it clears the voice's track index, transpose, repeat count, fixed-length flag, keep flags, slide, arpeggio, drum and new-note flags, gets the first pattern through $A3FA, points the wave program at $A981 and stores the pattern as the stream pointer. Then it zeroes the SID registers $D400-$D417 (writing 8 first), clears the fade-out flag $A0BE, sets the three voices active with their countdowns at 1, 2 and 3, writes $1F to $A0C1 and $D418 unless a fade-in is running, and lowers the hold flag.","t":"code","b":[238,1,160],"m":"inc","oa":40961,"o":"tune_hold_flag"},{"a":41319,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":41321,"t":"code","b":[141,0,160],"m":"sta","oa":40960,"o":"tune_driver_flag"},{"a":41324,"t":"code","b":[133,247],"m":"sta","oa":247,"o":"voice0_active"},{"a":41326,"t":"code","b":[133,248],"m":"sta","oa":248,"o":"voice1_active"},{"a":41328,"t":"code","b":[133,249],"m":"sta","oa":249,"o":"voice2_active"},{"a":41330,"t":"code","b":[189,141,170],"m":"lda","oa":43661,"o":"tune_starts_table,x"},{"a":41333,"t":"code","b":[141,26,160],"m":"sta","oa":40986,"o":"tune_track_lo"},{"a":41336,"t":"code","b":[189,142,170],"m":"lda","oa":43662,"o":"$AA8E,x"},{"a":41339,"t":"code","b":[141,29,160],"m":"sta","oa":40989,"o":"tune_track_hi"},{"a":41342,"t":"code","b":[189,143,170],"m":"lda","oa":43663,"o":"$AA8F,x"},{"a":41345,"t":"code","b":[141,27,160],"m":"sta","oa":40987,"o":"$A01B"},{"a":41348,"t":"code","b":[189,144,170],"m":"lda","oa":43664,"o":"$AA90,x"},{"a":41351,"t":"code","b":[141,30,160],"m":"sta","oa":40990,"o":"$A01E"},{"a":41354,"t":"code","b":[189,145,170],"m":"lda","oa":43665,"o":"$AA91,x"},{"a":41357,"t":"code","b":[141,28,160],"m":"sta","oa":40988,"o":"$A01C"},{"a":41360,"t":"code","b":[189,146,170],"m":"lda","oa":43666,"o":"$AA92,x"},{"a":41363,"t":"code","b":[141,31,160],"m":"sta","oa":40991,"o":"$A01F"},{"a":41366,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":41368,"t":"code","b":[141,194,160],"m":"sta","oa":41154,"o":"tune_fade_in_on"},{"a":41371,"t":"code","b":[162,2],"m":"ldx","o":"#$02"},{"a":41373,"t":"code","b":[134,250],"m":"stx","oa":250,"o":"voice_index"},{"a":41375,"l":"b_A19F","t":"code","b":[166,250],"m":"ldx","oa":250,"o":"voice_index","x":[41450]},{"a":41377,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":41379,"t":"code","b":[157,20,160],"m":"sta","oa":40980,"o":"tune_track_index,x"},{"a":41382,"t":"code","b":[157,141,160],"m":"sta","oa":41101,"o":"tune_transpose,x"},{"a":41385,"t":"code","b":[157,106,160],"m":"sta","oa":41066,"o":"tune_track_repeat,x"},{"a":41388,"t":"code","b":[157,135,160],"m":"sta","oa":41095,"o":"tune_fixed_length_on,x"},{"a":41391,"t":"code","b":[157,196,160],"m":"sta","oa":41156,"o":"tune_keep_flags,x"},{"a":41394,"t":"code","b":[157,117,160],"m":"sta","oa":41077,"o":"tune_slide_on,x"},{"a":41397,"t":"code","b":[157,120,160],"m":"sta","oa":41080,"o":"tune_unused_078,x"},{"a":41400,"t":"code","b":[157,123,160],"m":"sta","oa":41083,"o":"tune_arp_on,x"},{"a":41403,"t":"code","b":[157,129,160],"m":"sta","oa":41089,"o":"tune_drum_on,x"},{"a":41406,"t":"code","b":[157,132,160],"m":"sta","oa":41092,"o":"tune_new_note,x"},{"a":41409,"t":"code","b":[32,250,163],"m":"jsr","oa":41978,"o":"tune_track_next_pattern"},{"a":41412,"t":"code","b":[166,250],"m":"ldx","oa":250,"o":"voice_index"},{"a":41414,"t":"code","b":[169,129],"m":"lda","o":"#$81"},{"a":41416,"t":"code","b":[157,32,160],"m":"sta","oa":40992,"o":"tune_wave_ptr_lo,x"},{"a":41419,"t":"code","b":[157,35,160],"m":"sta","oa":40995,"o":"tune_wave_start_lo,x"},{"a":41422,"t":"code","b":[169,169],"m":"lda","o":"#$A9"},{"a":41424,"t":"code","b":[157,38,160],"m":"sta","oa":40998,"o":"tune_wave_ptr_hi,x"},{"a":41427,"t":"code","b":[157,41,160],"m":"sta","oa":41001,"o":"tune_wave_start_hi,x"},{"a":41430,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":41432,"t":"code","b":[157,47,160],"m":"sta","oa":41007,"o":"tune_pulse_start,x"},{"a":41435,"t":"code","b":[157,71,160],"m":"sta","oa":41031,"o":"tune_filter_start,x"},{"a":41438,"t":"code","b":[165,240],"m":"lda","oa":240,"o":"stream_ptr_lo"},{"a":41440,"t":"code","b":[157,91,160],"m":"sta","oa":41051,"o":"tune_stream_lo,x"},{"a":41443,"t":"code","b":[165,241],"m":"lda","oa":241,"o":"stream_ptr_hi"},{"a":41445,"t":"code","b":[157,94,160],"m":"sta","oa":41054,"o":"tune_stream_hi,x"},{"a":41448,"t":"code","b":[198,250],"m":"dec","oa":250,"o":"voice_index"},{"a":41450,"t":"code","b":[16,179],"m":"bpl","oa":41375,"o":"b_A19F"},{"a":41452,"t":"code","b":[162,23],"m":"ldx","o":"#$17"},{"a":41454,"l":"b_A1EE","t":"code","b":[169,8],"m":"lda","o":"#$08","x":[41465]},{"a":41456,"t":"code","b":[157,0,212],"m":"sta","o":"sid_v1_freq_lo,x"},{"a":41459,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":41461,"t":"code","b":[157,0,212],"m":"sta","o":"sid_v1_freq_lo,x"},{"a":41464,"t":"code","b":[202],"m":"dex"},{"a":41465,"t":"code","b":[16,243],"m":"bpl","oa":41454,"o":"b_A1EE"},{"a":41467,"t":"code","b":[141,190,160],"m":"sta","oa":41150,"o":"tune_fade_out_on"},{"a":41470,"t":"code","b":[160,1],"m":"ldy","o":"#$01"},{"a":41472,"t":"code","b":[140,4,160],"m":"sty","oa":40964,"o":"tune_note_countdown"},{"a":41475,"t":"code","b":[132,247],"m":"sty","oa":247,"o":"voice0_active"},{"a":41477,"t":"code","b":[132,248],"m":"sty","oa":248,"o":"voice1_active"},{"a":41479,"t":"code","b":[132,249],"m":"sty","oa":249,"o":"voice2_active"},{"a":41481,"t":"code","b":[140,10,160],"m":"sty","oa":40970,"o":"tune_wave_countdown"},{"a":41484,"t":"code","b":[140,13,160],"m":"sty","oa":40973,"o":"tune_pulse_countdown"},{"a":41487,"t":"code","b":[140,16,160],"m":"sty","oa":40976,"o":"tune_slide_countdown"},{"a":41490,"t":"code","b":[140,19,160],"m":"sty","oa":40979,"o":"tune_filter_countdown"},{"a":41493,"t":"code","b":[200],"m":"iny"},{"a":41494,"t":"code","b":[140,5,160],"m":"sty","oa":40965,"o":"$A005"},{"a":41497,"t":"code","b":[140,11,160],"m":"sty","oa":40971,"o":"$A00B"},{"a":41500,"t":"code","b":[140,14,160],"m":"sty","oa":40974,"o":"$A00E"},{"a":41503,"t":"code","b":[140,17,160],"m":"sty","oa":40977,"o":"$A011"},{"a":41506,"t":"code","b":[200],"m":"iny"},{"a":41507,"t":"code","b":[140,6,160],"m":"sty","oa":40966,"o":"$A006"},{"a":41510,"t":"code","b":[140,12,160],"m":"sty","oa":40972,"o":"$A00C"},{"a":41513,"t":"code","b":[140,15,160],"m":"sty","oa":40975,"o":"$A00F"},{"a":41516,"t":"code","b":[140,18,160],"m":"sty","oa":40978,"o":"$A012"},{"a":41519,"t":"code","b":[173,194,160],"m":"lda","oa":41154,"o":"tune_fade_in_on"},{"a":41522,"t":"code","b":[208,8],"m":"bne","oa":41532,"o":"b_A23C"},{"a":41524,"t":"code","b":[169,31],"m":"lda","o":"#$1F"},{"a":41526,"t":"code","b":[141,193,160],"m":"sta","oa":41153,"o":"tune_volume_value"},{"a":41529,"t":"code","b":[141,24,212],"m":"sta","o":"sid_filter_mode_volume"},{"a":41532,"l":"b_A23C","t":"code","b":[169,0],"m":"lda","o":"#$00","x":[41522]},{"a":41534,"t":"code","b":[141,1,160],"m":"sta","oa":40961,"o":"tune_hold_flag"},{"a":41537,"t":"code","b":[96],"m":"rts"},{"a":41538,"l":"tune_play","c":"Plays the tunes once per call: the copy of $B176 in the tune driver. Returns at once while the hold flag $A001 is set; otherwise it works through the three voices, X from 2 down to 0. Level 1 calls it from $157D, in title_irq_top, the raster interrupt of every title page. Same code as the routine at $B176 of the sound driver.","t":"code","b":[173,1,160],"m":"lda","oa":40961,"o":"tune_hold_flag"},{"a":41541,"t":"code","b":[240,1],"m":"beq","oa":41544,"o":"$A248"},{"a":41543,"t":"code","b":[96],"m":"rts"},{"a":41544,"t":"code","b":[169,2],"m":"lda","o":"#$02","x":[41541]},{"a":41546,"t":"code","b":[133,250],"m":"sta","oa":250,"o":"voice_index"},{"a":41548,"t":"code","b":[166,250],"m":"ldx","oa":250,"o":"voice_index","x":[41690]},{"a":41550,"t":"code","b":[189,126,169],"m":"lda","oa":43390,"o":"tune_voice_offsets,x"},{"a":41553,"t":"code","b":[141,110,160],"m":"sta","oa":41070,"o":"tune_voice_offset"},{"a":41556,"t":"code","b":[181,247],"m":"lda","oa":247,"o":"voice0_active,x"},{"a":41558,"t":"code","b":[208,3],"m":"bne","oa":41563,"o":"$A25B"},{"a":41560,"t":"code","b":[76,214,162],"m":"jmp","oa":41686,"o":"$A2D6"},{"a":41563,"t":"code","b":[173,194,160],"m":"lda","oa":41154,"o":"tune_fade_in_on","x":[41558]},{"a":41566,"t":"code","b":[240,3],"m":"beq","oa":41571,"o":"$A263"},{"a":41568,"t":"code","b":[32,227,162],"m":"jsr","oa":41699,"o":"tune_fade_in_step"},{"a":41571,"t":"code","b":[173,190,160],"m":"lda","oa":41150,"o":"tune_fade_out_on","x":[41566]},{"a":41574,"t":"code","b":[240,30],"m":"beq","oa":41606,"o":"$A286"},{"a":41576,"t":"code","b":[206,191,160],"m":"dec","oa":41151,"o":"tune_fade_counter"},{"a":41579,"t":"code","b":[173,191,160],"m":"lda","oa":41151,"o":"tune_fade_counter"},{"a":41582,"t":"code","b":[208,22],"m":"bne","oa":41606,"o":"$A286"},{"a":41584,"t":"code","b":[173,192,160],"m":"lda","oa":41152,"o":"tune_fade_rate"},{"a":41587,"t":"code","b":[141,191,160],"m":"sta","oa":41151,"o":"tune_fade_counter"},{"a":41590,"t":"code","b":[206,193,160],"m":"dec","oa":41153,"o":"tune_volume_value"},{"a":41593,"t":"code","b":[173,193,160],"m":"lda","oa":41153,"o":"tune_volume_value"},{"a":41596,"t":"code","b":[141,24,212],"m":"sta","o":"sid_filter_mode_volume"},{"a":41599,"t":"code","b":[41,15],"m":"and","o":"#$0F"},{"a":41601,"t":"code","b":[208,3],"m":"bne","oa":41606,"o":"$A286"},{"a":41603,"t":"code","b":[76,242,168],"m":"jmp","oa":43250,"o":"tune_silence_all"},{"a":41606,"t":"code","b":[32,7,163],"m":"jsr","oa":41735,"o":"tune_voice_tick","x":[41574,41582,41601]},{"a":41609,"t":"code","b":[181,247],"m":"lda","oa":247,"o":"voice0_active,x"},{"a":41611,"t":"code","b":[240,73],"m":"beq","oa":41686,"o":"$A2D6"},{"a":41613,"t":"code","b":[189,129,160],"m":"lda","oa":41089,"o":"tune_drum_on,x"},{"a":41616,"t":"code","b":[208,68],"m":"bne","oa":41686,"o":"$A2D6"},{"a":41618,"t":"code","b":[32,196,164],"m":"jsr","oa":42180,"o":"tune_wave_program_tick"},{"a":41621,"t":"code","b":[32,0,167],"m":"jsr","oa":42752,"o":"tune_pulse_step"},{"a":41624,"t":"code","b":[32,195,167],"m":"jsr","oa":42947,"o":"tune_arpeggio_step"},{"a":41627,"t":"code","b":[189,123,160],"m":"lda","oa":41083,"o":"tune_arp_on,x"},{"a":41630,"t":"code","b":[208,54],"m":"bne","oa":41686,"o":"$A2D6"},{"a":41632,"t":"code","b":[189,132,160],"m":"lda","oa":41092,"o":"tune_new_note,x"},{"a":41635,"t":"code","b":[240,31],"m":"beq","oa":41668,"o":"$A2C4"},{"a":41637,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":41639,"t":"code","b":[157,132,160],"m":"sta","oa":41092,"o":"tune_new_note,x"},{"a":41642,"t":"code","b":[189,138,160],"m":"lda","oa":41098,"o":"tune_pitch_offset,x"},{"a":41645,"t":"code","b":[189,103,160],"m":"lda","oa":41063,"o":"tune_note,x"},{"a":41648,"t":"code","b":[24],"m":"clc"},{"a":41649,"t":"code","b":[125,138,160],"m":"adc","oa":41098,"o":"tune_pitch_offset,x"},{"a":41652,"t":"code","b":[125,141,160],"m":"adc","oa":41101,"o":"tune_transpose,x"},{"a":41655,"t":"code","b":[168],"m":"tay"},{"a":41656,"t":"code","b":[185,140,169],"m":"lda","oa":43404,"o":"tune_note_freq_lo,y"},{"a":41659,"t":"code","b":[157,97,160],"m":"sta","oa":41057,"o":"tune_freq_lo,x"},{"a":41662,"t":"code","b":[185,234,169],"m":"lda","oa":43498,"o":"tune_note_freq_hi,y"},{"a":41665,"t":"code","b":[157,100,160],"m":"sta","oa":41060,"o":"tune_freq_hi,x"},{"a":41668,"t":"code","b":[32,74,167],"m":"jsr","oa":42826,"o":"tune_pitch_slide_step","x":[41635]},{"a":41671,"t":"code","b":[172,110,160],"m":"ldy","oa":41070,"o":"tune_voice_offset"},{"a":41674,"t":"code","b":[189,97,160],"m":"lda","oa":41057,"o":"tune_freq_lo,x"},{"a":41677,"t":"code","b":[153,0,212],"m":"sta","o":"sid_v1_freq_lo,y"},{"a":41680,"t":"code","b":[189,100,160],"m":"lda","oa":41060,"o":"tune_freq_hi,x"},{"a":41683,"t":"code","b":[153,1,212],"m":"sta","o":"sid_v1_freq_hi,y"},{"a":41686,"t":"code","b":[198,250],"m":"dec","oa":250,"o":"voice_index","x":[41560,41611,41616,41630]},{"a":41688,"t":"code","b":[48,3],"m":"bmi","oa":41693,"o":"$A2DD"},{"a":41690,"t":"code","b":[76,76,162],"m":"jmp","oa":41548,"o":"$A24C"},{"a":41693,"t":"code","b":[32,128,168],"m":"jsr","oa":43136,"o":"tune_drum_step","x":[41688]},{"a":41696,"t":"code","b":[76,16,168],"m":"jmp","oa":43024,"o":"tune_filter_sweep_step"},{"a":41699,"l":"tune_fade_in_step","c":"Raises the volume one step at a time while a fade-in runs. Counts $A0BF down; at zero it reloads it from $A0C0, adds 1 to $A0C1, writes that to the volume register $D418 and clears the fade-in flag $A0C2 once the low nibble equals the target $A0C3. Called by $A242 while $A0C2 is non-zero. Same code as the routine at $B217 of the sound driver.","t":"code","b":[206,191,160],"m":"dec","oa":41151,"o":"tune_fade_counter","x":[41568]},{"a":41702,"t":"code","b":[173,191,160],"m":"lda","oa":41151,"o":"tune_fade_counter"},{"a":41705,"t":"code","b":[208,27],"m":"bne","oa":41734,"o":"$A306"},{"a":41707,"t":"code","b":[173,192,160],"m":"lda","oa":41152,"o":"tune_fade_rate"},{"a":41710,"t":"code","b":[141,191,160],"m":"sta","oa":41151,"o":"tune_fade_counter"},{"a":41713,"t":"code","b":[238,193,160],"m":"inc","oa":41153,"o":"tune_volume_value"},{"a":41716,"t":"code","b":[173,193,160],"m":"lda","oa":41153,"o":"tune_volume_value"},{"a":41719,"t":"code","b":[141,24,212],"m":"sta","o":"sid_filter_mode_volume"},{"a":41722,"t":"code","b":[41,15],"m":"and","o":"#$0F"},{"a":41724,"t":"code","b":[205,195,160],"m":"cmp","oa":41155,"o":"tune_fade_target"},{"a":41727,"t":"code","b":[208,5],"m":"bne","oa":41734,"o":"$A306"},{"a":41729,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":41731,"t":"code","b":[141,194,160],"m":"sta","oa":41154,"o":"tune_fade_in_on"},{"a":41734,"t":"code","b":[96],"m":"rts","x":[41705,41727]},{"a":41735,"l":"tune_voice_tick","c":"Counts the current voice's note down: decrements $A004,X and returns unless it reaches zero. At zero it loads the voice's stream pointer $A05B/$A05E into $F0/$F1, runs $A328, steps the stream position $A0A8 past the length byte and stores $F0/$F1 back. Called by $A242. Same code as the routine at $B23B of the sound driver.","t":"code","b":[222,4,160],"m":"dec","oa":40964,"o":"tune_note_countdown,x","x":[41606]},{"a":41738,"t":"code","b":[240,1],"m":"beq","oa":41741,"o":"$A30D"},{"a":41740,"t":"code","b":[96],"m":"rts"},{"a":41741,"t":"code","b":[189,91,160],"m":"lda","oa":41051,"o":"tune_stream_lo,x","x":[41738]},{"a":41744,"t":"code","b":[133,240],"m":"sta","oa":240,"o":"stream_ptr_lo"},{"a":41746,"t":"code","b":[189,94,160],"m":"lda","oa":41054,"o":"tune_stream_hi,x"},{"a":41749,"t":"code","b":[133,241],"m":"sta","oa":241,"o":"stream_ptr_hi"},{"a":41751,"t":"code","b":[32,40,163],"m":"jsr","oa":41768,"o":"tune_read_stream"},{"a":41754,"t":"code","b":[254,168,160],"m":"inc","oa":41128,"o":"tune_stream_position,x"},{"a":41757,"t":"code","b":[165,240],"m":"lda","oa":240,"o":"stream_ptr_lo"},{"a":41759,"t":"code","b":[157,91,160],"m":"sta","oa":41051,"o":"tune_stream_lo,x"},{"a":41762,"t":"code","b":[165,241],"m":"lda","oa":241,"o":"stream_ptr_hi"},{"a":41764,"t":"code","b":[157,94,160],"m":"sta","oa":41054,"o":"tune_stream_hi,x"},{"a":41767,"t":"code","b":[96],"m":"rts"},{"a":41768,"l":"tune_read_stream","c":"Reads the next entry of the current voice's stream through ($F0),Y with Y from $A0A8,X. A byte with bit 7 set is a command and goes to $A3E2. A byte of $60 is a rest: only the length byte is read. Any other byte is a note: it is stored in $A067, the new-note flag $A084 becomes 1 and the drum flag $A081 is cleared. Each part the voice's keep flags $A0C4 do not hold is restarted: the wave program (mask 4, from $A023/$A029), the pulse sweep (mask 2, from $A02F, $A093 and $A099), the pitch slide (mask 1, from $A038), the arpeggio (mask $10) and the filter sweep (mask 8). The length byte then goes to $A004,X, or $A007,X in fixed-length mode, and the stream position to $A0A8,X. Called by $A307. Same code as the routine at $B25C of the sound driver.","t":"code","b":[188,168,160],"m":"ldy","oa":41128,"o":"tune_stream_position,x","x":[41751,41975,42454,42480,42505,42567,42584,42595,42749,43333]},{"a":41771,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":41773,"t":"code","b":[16,3],"m":"bpl","oa":41778,"o":"$A332"},{"a":41775,"t":"code","b":[76,226,163],"m":"jmp","oa":41954,"o":"tune_stream_command"},{"a":41778,"t":"code","b":[201,96],"m":"cmp","o":"#$60","x":[41773]},{"a":41780,"t":"code","b":[208,3],"m":"bne","oa":41785,"o":"$A339"},{"a":41782,"t":"code","b":[76,204,163],"m":"jmp","oa":41932,"o":"$A3CC"},{"a":41785,"t":"code","b":[157,103,160],"m":"sta","oa":41063,"o":"tune_note,x","x":[41780]},{"a":41788,"t":"code","b":[169,1],"m":"lda","o":"#$01"},{"a":41790,"t":"code","b":[157,132,160],"m":"sta","oa":41092,"o":"tune_new_note,x"},{"a":41793,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":41795,"t":"code","b":[157,129,160],"m":"sta","oa":41089,"o":"tune_drum_on,x"},{"a":41798,"t":"code","b":[189,196,160],"m":"lda","oa":41156,"o":"tune_keep_flags,x"},{"a":41801,"t":"code","b":[41,4],"m":"and","o":"#$04"},{"a":41803,"t":"code","b":[208,17],"m":"bne","oa":41822,"o":"$A35E"},{"a":41805,"t":"code","b":[169,1],"m":"lda","o":"#$01"},{"a":41807,"t":"code","b":[157,10,160],"m":"sta","oa":40970,"o":"tune_wave_countdown,x"},{"a":41810,"t":"code","b":[189,35,160],"m":"lda","oa":40995,"o":"tune_wave_start_lo,x"},{"a":41813,"t":"code","b":[157,32,160],"m":"sta","oa":40992,"o":"tune_wave_ptr_lo,x"},{"a":41816,"t":"code","b":[189,41,160],"m":"lda","oa":41001,"o":"tune_wave_start_hi,x"},{"a":41819,"t":"code","b":[157,38,160],"m":"sta","oa":40998,"o":"tune_wave_ptr_hi,x"},{"a":41822,"t":"code","b":[189,196,160],"m":"lda","oa":41156,"o":"tune_keep_flags,x","x":[41803]},{"a":41825,"t":"code","b":[41,2],"m":"and","o":"#$02"},{"a":41827,"t":"code","b":[208,23],"m":"bne","oa":41852,"o":"$A37C"},{"a":41829,"t":"code","b":[169,1],"m":"lda","o":"#$01"},{"a":41831,"t":"code","b":[157,13,160],"m":"sta","oa":40973,"o":"tune_pulse_countdown,x"},{"a":41834,"t":"code","b":[189,47,160],"m":"lda","oa":41007,"o":"tune_pulse_start,x"},{"a":41837,"t":"code","b":[157,44,160],"m":"sta","oa":41004,"o":"tune_pulse_index,x"},{"a":41840,"t":"code","b":[189,147,160],"m":"lda","oa":41107,"o":"tune_pulse_start_lo,x"},{"a":41843,"t":"code","b":[157,144,160],"m":"sta","oa":41104,"o":"tune_pulse_lo,x"},{"a":41846,"t":"code","b":[189,153,160],"m":"lda","oa":41113,"o":"tune_pulse_start_hi,x"},{"a":41849,"t":"code","b":[157,150,160],"m":"sta","oa":41110,"o":"tune_pulse_hi,x"},{"a":41852,"t":"code","b":[189,117,160],"m":"lda","oa":41077,"o":"tune_slide_on,x","x":[41827]},{"a":41855,"t":"code","b":[240,18],"m":"beq","oa":41875,"o":"$A393"},{"a":41857,"t":"code","b":[189,196,160],"m":"lda","oa":41156,"o":"tune_keep_flags,x"},{"a":41860,"t":"code","b":[41,1],"m":"and","o":"#$01"},{"a":41862,"t":"code","b":[208,11],"m":"bne","oa":41875,"o":"$A393"},{"a":41864,"t":"code","b":[169,1],"m":"lda","o":"#$01"},{"a":41866,"t":"code","b":[157,16,160],"m":"sta","oa":40976,"o":"tune_slide_countdown,x"},{"a":41869,"t":"code","b":[189,56,160],"m":"lda","oa":41016,"o":"tune_slide_start,x"},{"a":41872,"t":"code","b":[157,53,160],"m":"sta","oa":41013,"o":"tune_slide_index,x"},{"a":41875,"t":"code","b":[189,123,160],"m":"lda","oa":41083,"o":"tune_arp_on,x","x":[41855,41862]},{"a":41878,"t":"code","b":[240,17],"m":"beq","oa":41897,"o":"$A3A9"},{"a":41880,"t":"code","b":[189,196,160],"m":"lda","oa":41156,"o":"tune_keep_flags,x"},{"a":41883,"t":"code","b":[41,16],"m":"and","o":"#$10"},{"a":41885,"t":"code","b":[208,10],"m":"bne","oa":41897,"o":"$A3A9"},{"a":41887,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":41889,"t":"code","b":[157,177,160],"m":"sta","oa":41137,"o":"tune_arp_index,x"},{"a":41892,"t":"code","b":[169,1],"m":"lda","o":"#$01"},{"a":41894,"t":"code","b":[157,171,160],"m":"sta","oa":41131,"o":"tune_arp_countdown,x"},{"a":41897,"t":"code","b":[189,126,160],"m":"lda","oa":41086,"o":"tune_filter_on,x","x":[41878,41885]},{"a":41900,"t":"code","b":[240,30],"m":"beq","oa":41932,"o":"$A3CC"},{"a":41902,"t":"code","b":[189,196,160],"m":"lda","oa":41156,"o":"tune_keep_flags,x"},{"a":41905,"t":"code","b":[41,8],"m":"and","o":"#$08"},{"a":41907,"t":"code","b":[208,23],"m":"bne","oa":41932,"o":"$A3CC"},{"a":41909,"t":"code","b":[173,71,160],"m":"lda","oa":41031,"o":"tune_filter_start"},{"a":41912,"t":"code","b":[141,72,160],"m":"sta","oa":41032,"o":"tune_filter_index"},{"a":41915,"t":"code","b":[173,75,160],"m":"lda","oa":41035,"o":"tune_filter_start_hi"},{"a":41918,"t":"code","b":[141,77,160],"m":"sta","oa":41037,"o":"tune_filter_hi"},{"a":41921,"t":"code","b":[173,76,160],"m":"lda","oa":41036,"o":"tune_filter_start_lo"},{"a":41924,"t":"code","b":[141,78,160],"m":"sta","oa":41038,"o":"tune_filter_lo"},{"a":41927,"t":"code","b":[169,1],"m":"lda","o":"#$01"},{"a":41929,"t":"code","b":[141,19,160],"m":"sta","oa":40979,"o":"tune_filter_countdown"},{"a":41932,"t":"code","b":[189,135,160],"m":"lda","oa":41095,"o":"tune_fixed_length_on,x","x":[41782,41900,41907]},{"a":41935,"t":"code","b":[240,6],"m":"beq","oa":41943,"o":"$A3D7"},{"a":41937,"t":"code","b":[189,7,160],"m":"lda","oa":40967,"o":"tune_fixed_length,x"},{"a":41940,"t":"code","b":[76,218,163],"m":"jmp","oa":41946,"o":"$A3DA"},{"a":41943,"t":"code","b":[200],"m":"iny","x":[41935]},{"a":41944,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":41946,"t":"code","b":[157,4,160],"m":"sta","oa":40964,"o":"tune_note_countdown,x","x":[41940]},{"a":41949,"t":"code","b":[152],"m":"tya"},{"a":41950,"t":"code","b":[157,168,160],"m":"sta","oa":41128,"o":"tune_stream_position,x"},{"a":41953,"t":"code","b":[96],"m":"rts"},{"a":41954,"l":"tune_stream_command","c":"Runs a stream command, entered from $A328 with the command byte (bit 7 set) in A. Looks up the handler in the tables $A948 and $A956, stores it in the JMP operand at $A3F2, reloads X from $FA and jumps. Same code as the routine at $B316 of the sound driver.","t":"code","b":[170],"m":"tax","x":[41775]},{"a":41955,"t":"code","b":[189,200,168],"m":"lda","oa":43208,"o":"$A8C8,x"},{"a":41958,"t":"code","b":[141,242,163],"m":"sta","oa":41970,"o":"tune_cmd_jump_operand_low"},{"a":41961,"t":"code","b":[189,214,168],"m":"lda","oa":43222,"o":"$A8D6,x"},{"a":41964,"t":"code","b":[141,243,163],"m":"sta","oa":41971,"o":"tune_cmd_jump_operand_high"},{"a":41967,"t":"code","b":[166,250],"m":"ldx","oa":250,"o":"voice_index"},{"a":41969,"t":"code","b":[76,91,166],"m":"jmp","oa":42587,"o":"tune_cmd_free_length"},{"a":41970,"t":"note","l":"tune_cmd_jump_operand_low","c":"Low byte of the address operand of the JMP at $A3F1, overwritten each time with the address of the stream command handler to run.","note":"inside the item at $A3F1","x":[41958]},{"a":41971,"t":"note","l":"tune_cmd_jump_operand_high","c":"High byte of the address operand of the JMP at $A3F1, overwritten each time with the address of the stream command handler to run.","note":"inside the item at $A3F1","x":[41964]},{"a":41972,"l":"tune_cmd_next_pattern","c":"Stream command $80: calls $A3FA to fetch the voice's next pattern address into $F0/$F1 and carries on reading at $A328. Same code as the routine at $B328 of the sound driver.","t":"code","b":[32,250,163],"m":"jsr","oa":41978,"o":"tune_track_next_pattern"},{"a":41975,"t":"code","b":[76,40,163],"m":"jmp","oa":41768,"o":"tune_read_stream"},{"a":41978,"l":"tune_track_next_pattern","c":"Fetches a pattern from the voice's track list. Loads the list address $A01A/$A01D into $F2/$F3, sets the stream position $A0A8 to 0, and clears the transpose $A08D when it is set and the repeat count $A06A is zero. It then reads the entry at $A014,X. A value below $F0 is a pattern number n and gives $F0/$F1 the address from the tables $AAA5 and $AAF6; if the repeat count is zero the track index advances, otherwise the count goes down and the index advances when it reaches zero. A value of $F0 or more is a track command, dispatched through $A964 and $A96A by the JMP operand at $A44F. Same code as the routine at $B32E of the sound driver.","t":"code","b":[166,250],"m":"ldx","oa":250,"o":"voice_index","x":[41409,41972]},{"a":41980,"t":"code","b":[189,26,160],"m":"lda","oa":40986,"o":"tune_track_lo,x"},{"a":41983,"t":"code","b":[133,242],"m":"sta","oa":242,"o":"track_ptr_lo"},{"a":41985,"t":"code","b":[189,29,160],"m":"lda","oa":40989,"o":"tune_track_hi,x"},{"a":41988,"t":"code","b":[133,243],"m":"sta","oa":243,"o":"track_ptr_hi"},{"a":41990,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":41992,"t":"code","b":[157,168,160],"m":"sta","oa":41128,"o":"tune_stream_position,x"},{"a":41995,"t":"code","b":[189,141,160],"m":"lda","oa":41101,"o":"tune_transpose,x"},{"a":41998,"t":"code","b":[240,10],"m":"beq","oa":42010,"o":"b_A41A"},{"a":42000,"t":"code","b":[189,106,160],"m":"lda","oa":41066,"o":"tune_track_repeat,x"},{"a":42003,"t":"code","b":[208,5],"m":"bne","oa":42010,"o":"b_A41A"},{"a":42005,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":42007,"t":"code","b":[157,141,160],"m":"sta","oa":41101,"o":"tune_transpose,x"},{"a":42010,"l":"b_A41A","t":"code","b":[188,20,160],"m":"ldy","oa":40980,"o":"tune_track_index,x","x":[41998,42003,42071,42086,42118,42139,42177]},{"a":42013,"t":"code","b":[177,242],"m":"lda","oa":242,"o":"(track_ptr_lo),y"},{"a":42015,"t":"code","b":[201,240],"m":"cmp","o":"#$F0"},{"a":42017,"t":"code","b":[176,28],"m":"bcs","oa":42047,"o":"b_A43F"},{"a":42019,"t":"code","b":[170],"m":"tax"},{"a":42020,"t":"code","b":[189,165,170],"m":"lda","oa":43685,"o":"tune_pattern_lo,x"},{"a":42023,"t":"code","b":[133,240],"m":"sta","oa":240,"o":"stream_ptr_lo"},{"a":42025,"t":"code","b":[189,246,170],"m":"lda","oa":43766,"o":"tune_pattern_hi,x"},{"a":42028,"t":"code","b":[133,241],"m":"sta","oa":241,"o":"stream_ptr_hi"},{"a":42030,"t":"code","b":[166,250],"m":"ldx","oa":250,"o":"voice_index"},{"a":42032,"t":"code","b":[189,106,160],"m":"lda","oa":41066,"o":"tune_track_repeat,x"},{"a":42035,"t":"code","b":[240,6],"m":"beq","oa":42043,"o":"b_A43B"},{"a":42037,"t":"code","b":[222,106,160],"m":"dec","oa":41066,"o":"tune_track_repeat,x"},{"a":42040,"t":"code","b":[240,1],"m":"beq","oa":42043,"o":"b_A43B"},{"a":42042,"t":"code","b":[96],"m":"rts"},{"a":42043,"l":"b_A43B","t":"code","b":[254,20,160],"m":"inc","oa":40980,"o":"tune_track_index,x","x":[42035,42040]},{"a":42046,"t":"code","b":[96],"m":"rts"},{"a":42047,"l":"b_A43F","t":"code","b":[170],"m":"tax","x":[42017]},{"a":42048,"t":"code","b":[189,116,168],"m":"lda","oa":43124,"o":"$A874,x"},{"a":42051,"t":"code","b":[141,79,164],"m":"sta","oa":42063,"o":"tune_track_jump_operand_low"},{"a":42054,"t":"code","b":[189,122,168],"m":"lda","oa":43130,"o":"$A87A,x"},{"a":42057,"t":"code","b":[141,80,164],"m":"sta","oa":42064,"o":"tune_track_jump_operand_high"},{"a":42060,"t":"code","b":[166,250],"m":"ldx","oa":250,"o":"voice_index"},{"a":42062,"t":"code","b":[76,122,164],"m":"jmp","oa":42106,"o":"tune_track_transpose"},{"a":42063,"t":"note","l":"tune_track_jump_operand_low","c":"Low byte of the address operand of the JMP at $A44E, overwritten each time with the address of the track command handler to run.","note":"inside the item at $A44E","x":[42051]},{"a":42064,"t":"note","l":"tune_track_jump_operand_high","c":"High byte of the address operand of the JMP at $A44E, overwritten each time with the address of the track command handler to run.","note":"inside the item at $A44E","x":[42057]},{"a":42065,"l":"tune_track_jump","c":"Track command $F0: sets the track index $A014,X to the next byte of the list and goes on reading the list at $A41A. Same code as the routine at $B385 of the sound driver.","t":"code","b":[200],"m":"iny"},{"a":42066,"t":"code","b":[177,242],"m":"lda","oa":242,"o":"(track_ptr_lo),y"},{"a":42068,"t":"code","b":[157,20,160],"m":"sta","oa":40980,"o":"tune_track_index,x"},{"a":42071,"t":"code","b":[76,26,164],"m":"jmp","oa":42010,"o":"b_A41A"},{"a":42074,"l":"tune_track_repeat_cmd","c":"Track command $F1: stores the next byte in the repeat count $A06A,X, moves the track index $A014,X on by 2 and goes on at $A41A. Same code as the routine at $B38E of the sound driver.","t":"code","b":[200],"m":"iny"},{"a":42075,"t":"code","b":[177,242],"m":"lda","oa":242,"o":"(track_ptr_lo),y"},{"a":42077,"t":"code","b":[157,106,160],"m":"sta","oa":41066,"o":"tune_track_repeat,x"},{"a":42080,"t":"code","b":[254,20,160],"m":"inc","oa":40980,"o":"tune_track_index,x"},{"a":42083,"t":"code","b":[254,20,160],"m":"inc","oa":40980,"o":"tune_track_index,x"},{"a":42086,"t":"code","b":[76,26,164],"m":"jmp","oa":42010,"o":"b_A41A"},{"a":42089,"l":"tune_track_stop","c":"Track command $F2: stops the voice: clears its active flag $F7+X and the voice's registers $D404-$D406 and returns. Same code as the routine at $B39D of the sound driver.","t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":42091,"t":"code","b":[149,247],"m":"sta","oa":247,"o":"voice0_active,x"},{"a":42093,"t":"code","b":[172,110,160],"m":"ldy","oa":41070,"o":"tune_voice_offset"},{"a":42096,"t":"code","b":[153,4,212],"m":"sta","o":"sid_v1_control,y"},{"a":42099,"t":"code","b":[153,5,212],"m":"sta","o":"sid_v1_attack_decay,y"},{"a":42102,"t":"code","b":[153,6,212],"m":"sta","o":"sid_v1_sustain_release,y"},{"a":42105,"t":"code","b":[96],"m":"rts"},{"a":42106,"l":"tune_track_transpose","c":"Track command $F3: stores the next byte in the transposition $A08D,X, moves the track index on by 2 and goes on at $A41A. Same code as the routine at $B3AE of the sound driver.","t":"code","b":[200],"m":"iny","x":[42062]},{"a":42107,"t":"code","b":[177,242],"m":"lda","oa":242,"o":"(track_ptr_lo),y"},{"a":42109,"t":"code","b":[157,141,160],"m":"sta","oa":41101,"o":"tune_transpose,x"},{"a":42112,"t":"code","b":[254,20,160],"m":"inc","oa":40980,"o":"tune_track_index,x"},{"a":42115,"t":"code","b":[254,20,160],"m":"inc","oa":40980,"o":"tune_track_index,x"},{"a":42118,"t":"code","b":[76,26,164],"m":"jmp","oa":42010,"o":"b_A41A"},{"a":42121,"l":"tune_track_fade_out","c":"Track command $F4: stores the next byte in $A0BE, $A0BF and $A0C0, which starts a fade-out with that rate, moves the track index on by 2 and goes on at $A41A. Same code as the routine at $B3BD of the sound driver.","t":"code","b":[200],"m":"iny"},{"a":42122,"t":"code","b":[177,242],"m":"lda","oa":242,"o":"(track_ptr_lo),y"},{"a":42124,"t":"code","b":[141,190,160],"m":"sta","oa":41150,"o":"tune_fade_out_on"},{"a":42127,"t":"code","b":[141,191,160],"m":"sta","oa":41151,"o":"tune_fade_counter"},{"a":42130,"t":"code","b":[141,192,160],"m":"sta","oa":41152,"o":"tune_fade_rate"},{"a":42133,"t":"code","b":[254,20,160],"m":"inc","oa":40980,"o":"tune_track_index,x"},{"a":42136,"t":"code","b":[254,20,160],"m":"inc","oa":40980,"o":"tune_track_index,x"},{"a":42139,"t":"code","b":[76,26,164],"m":"jmp","oa":42010,"o":"b_A41A"},{"a":42142,"l":"tune_track_fade_in","c":"Track command $F5: stores the next byte in $A0C2, $A0BF and $A0C0, which starts a fade-in with that rate, sets $A0C1 and $D418 to $10, stores the byte after it in $A0C3 as the target volume, moves the track index on by 3 and goes on at $A41A. Same code as the routine at $B3D2 of the sound driver.","t":"code","b":[200],"m":"iny"},{"a":42143,"t":"code","b":[177,242],"m":"lda","oa":242,"o":"(track_ptr_lo),y"},{"a":42145,"t":"code","b":[141,194,160],"m":"sta","oa":41154,"o":"tune_fade_in_on"},{"a":42148,"t":"code","b":[141,191,160],"m":"sta","oa":41151,"o":"tune_fade_counter"},{"a":42151,"t":"code","b":[141,192,160],"m":"sta","oa":41152,"o":"tune_fade_rate"},{"a":42154,"t":"code","b":[169,16],"m":"lda","o":"#$10"},{"a":42156,"t":"code","b":[141,193,160],"m":"sta","oa":41153,"o":"tune_volume_value"},{"a":42159,"t":"code","b":[141,24,212],"m":"sta","o":"sid_filter_mode_volume"},{"a":42162,"t":"code","b":[200],"m":"iny"},{"a":42163,"t":"code","b":[177,242],"m":"lda","oa":242,"o":"(track_ptr_lo),y"},{"a":42165,"t":"code","b":[141,195,160],"m":"sta","oa":41155,"o":"tune_fade_target"},{"a":42168,"t":"code","b":[254,20,160],"m":"inc","oa":40980,"o":"tune_track_index,x"},{"a":42171,"t":"code","b":[254,20,160],"m":"inc","oa":40980,"o":"tune_track_index,x"},{"a":42174,"t":"code","b":[254,20,160],"m":"inc","oa":40980,"o":"tune_track_index,x"},{"a":42177,"t":"code","b":[76,26,164],"m":"jmp","oa":42010,"o":"b_A41A"},{"a":42180,"l":"tune_wave_program_tick","c":"Runs the current voice's wave program, called by $A242 for each active voice that is not playing a drum. Counts $A00A,X down and returns unless it reaches zero. At zero, if the pitch offset $A08A is set, it clears it and looks the frequency up again from the note $A067 plus the transposition $A08D in the tables $A98C and $A9EA. It then loads the program pointer $A020/$A026 into $F0/$F1, reads the command number at the position $A06D (starting at 0), stores the handler from $A970 and $A977 in the JMP operand at $A50C and jumps to it. $A4F7 is where commands 1 and 2 read the next command. Same code as the routine at $B3F8 of the sound driver.","t":"code","b":[222,10,160],"m":"dec","oa":40970,"o":"tune_wave_countdown,x","x":[41618]},{"a":42183,"t":"code","b":[240,1],"m":"beq","oa":42186,"o":"$A4CA"},{"a":42185,"t":"code","b":[96],"m":"rts"},{"a":42186,"t":"code","b":[189,138,160],"m":"lda","oa":41098,"o":"tune_pitch_offset,x","x":[42183]},{"a":42189,"t":"code","b":[240,25],"m":"beq","oa":42216,"o":"$A4E8"},{"a":42191,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":42193,"t":"code","b":[157,138,160],"m":"sta","oa":41098,"o":"tune_pitch_offset,x"},{"a":42196,"t":"code","b":[189,103,160],"m":"lda","oa":41063,"o":"tune_note,x"},{"a":42199,"t":"code","b":[24],"m":"clc"},{"a":42200,"t":"code","b":[125,141,160],"m":"adc","oa":41101,"o":"tune_transpose,x"},{"a":42203,"t":"code","b":[168],"m":"tay"},{"a":42204,"t":"code","b":[185,140,169],"m":"lda","oa":43404,"o":"tune_note_freq_lo,y"},{"a":42207,"t":"code","b":[157,97,160],"m":"sta","oa":41057,"o":"tune_freq_lo,x"},{"a":42210,"t":"code","b":[185,234,169],"m":"lda","oa":43498,"o":"tune_note_freq_hi,y"},{"a":42213,"t":"code","b":[157,100,160],"m":"sta","oa":41060,"o":"tune_freq_hi,x"},{"a":42216,"t":"code","b":[189,32,160],"m":"lda","oa":40992,"o":"tune_wave_ptr_lo,x","x":[42189]},{"a":42219,"t":"code","b":[133,240],"m":"sta","oa":240,"o":"stream_ptr_lo"},{"a":42221,"t":"code","b":[189,38,160],"m":"lda","oa":40998,"o":"tune_wave_ptr_hi,x"},{"a":42224,"t":"code","b":[133,241],"m":"sta","oa":241,"o":"stream_ptr_hi"},{"a":42226,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":42228,"t":"code","b":[141,109,160],"m":"sta","oa":41069,"o":"tune_wave_position"},{"a":42231,"t":"code","b":[172,109,160],"m":"ldy","oa":41069,"o":"tune_wave_position","x":[42283,42314]},{"a":42234,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":42236,"t":"code","b":[170],"m":"tax"},{"a":42237,"t":"code","b":[189,112,169],"m":"lda","oa":43376,"o":"tune_wave_command_lo,x"},{"a":42240,"t":"code","b":[141,12,165],"m":"sta","oa":42252,"o":"tune_wave_jump_operand_low"},{"a":42243,"t":"code","b":[189,119,169],"m":"lda","oa":43383,"o":"tune_wave_command_hi,x"},{"a":42246,"t":"code","b":[141,13,165],"m":"sta","oa":42253,"o":"tune_wave_jump_operand_high"},{"a":42249,"t":"code","b":[166,250],"m":"ldx","oa":250,"o":"voice_index"},{"a":42251,"t":"code","b":[76,77,165],"m":"jmp","oa":42317,"o":"tune_wave_control"},{"a":42252,"t":"note","l":"tune_wave_jump_operand_low","c":"Low byte of the address operand of the JMP at $A50B, overwritten each time with the address of the wave-program command handler to run.","note":"inside the item at $A50B","x":[42240]},{"a":42253,"t":"note","l":"tune_wave_jump_operand_high","c":"High byte of the address operand of the JMP at $A50B, overwritten each time with the address of the wave-program command handler to run.","note":"inside the item at $A50B","x":[42246]},{"a":42254,"l":"tune_wave_wait","c":"Wave-program command 0: stores the next byte as the number of frames to wait in $A00A,X and ends the step through $A5A7. Same code as the routine at $B442 of the sound driver.","t":"code","b":[200],"m":"iny"},{"a":42255,"t":"code","b":[140,109,160],"m":"sty","oa":41069,"o":"tune_wave_position"},{"a":42258,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":42260,"t":"code","b":[157,10,160],"m":"sta","oa":40970,"o":"tune_wave_countdown,x"},{"a":42263,"t":"code","b":[76,167,165],"m":"jmp","oa":42407,"o":"tune_wave_advance"},{"a":42266,"l":"tune_wave_jump","c":"Wave-program command 1: loads $F0/$F1 with the two bytes that follow, a new program address, sets the position $A06D to 0 and carries on at $A4F7 in the same frame. Same code as the routine at $B44E of the sound driver.","t":"code","b":[200],"m":"iny"},{"a":42267,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":42269,"t":"code","b":[72],"m":"pha"},{"a":42270,"t":"code","b":[200],"m":"iny"},{"a":42271,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":42273,"t":"code","b":[133,241],"m":"sta","oa":241,"o":"stream_ptr_hi"},{"a":42275,"t":"code","b":[104],"m":"pla"},{"a":42276,"t":"code","b":[133,240],"m":"sta","oa":240,"o":"stream_ptr_lo"},{"a":42278,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":42280,"t":"code","b":[141,109,160],"m":"sta","oa":41069,"o":"tune_wave_position"},{"a":42283,"t":"code","b":[76,247,164],"m":"jmp","oa":42231,"o":"$A4F7"},{"a":42286,"l":"tune_wave_envelope","c":"Wave-program command 2: stores the next two bytes in $A06F,X (attack/decay) and $A072,X (sustain/release), writes them to the voice's $D405 and $D406 and carries on at $A4F7. Same code as the routine at $B462 of the sound driver.","t":"code","b":[200],"m":"iny"},{"a":42287,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":42289,"t":"code","b":[157,111,160],"m":"sta","oa":41071,"o":"tune_attack_decay,x"},{"a":42292,"t":"code","b":[200],"m":"iny"},{"a":42293,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":42295,"t":"code","b":[157,114,160],"m":"sta","oa":41074,"o":"tune_sustain_release,x"},{"a":42298,"t":"code","b":[200],"m":"iny"},{"a":42299,"t":"code","b":[140,109,160],"m":"sty","oa":41069,"o":"tune_wave_position"},{"a":42302,"t":"code","b":[172,110,160],"m":"ldy","oa":41070,"o":"tune_voice_offset"},{"a":42305,"t":"code","b":[153,6,212],"m":"sta","o":"sid_v1_sustain_release,y"},{"a":42308,"t":"code","b":[189,111,160],"m":"lda","oa":41071,"o":"tune_attack_decay,x"},{"a":42311,"t":"code","b":[153,5,212],"m":"sta","o":"sid_v1_attack_decay,y"},{"a":42314,"t":"code","b":[76,247,164],"m":"jmp","oa":42231,"o":"$A4F7"},{"a":42317,"l":"tune_wave_control","c":"Wave-program command 3: writes the next byte to the voice's control register $D404 (waveform and gate) and stores the byte after it as the frames to wait in $A00A,X; ends the step through $A5A7. Same code as the routine at $B481 of the sound driver.","t":"code","b":[200],"m":"iny","x":[42251]},{"a":42318,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":42320,"t":"code","b":[133,246],"m":"sta","oa":246,"o":"control_temp"},{"a":42322,"t":"code","b":[200],"m":"iny"},{"a":42323,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":42325,"t":"code","b":[157,10,160],"m":"sta","oa":40970,"o":"tune_wave_countdown,x"},{"a":42328,"t":"code","b":[140,109,160],"m":"sty","oa":41069,"o":"tune_wave_position"},{"a":42331,"t":"code","b":[172,110,160],"m":"ldy","oa":41070,"o":"tune_voice_offset"},{"a":42334,"t":"code","b":[165,246],"m":"lda","oa":246,"o":"control_temp"},{"a":42336,"t":"code","b":[153,4,212],"m":"sta","o":"sid_v1_control,y"},{"a":42339,"t":"code","b":[76,167,165],"m":"jmp","oa":42407,"o":"tune_wave_advance"},{"a":42342,"l":"tune_wave_control_early","c":"Wave-program command 4: writes the next byte to the voice's $D404 like command 3, but the wait is the note's remaining count $A004,X minus the byte after it, so the step comes that many frames before the note ends. Same code as the routine at $B49A of the sound driver.","t":"code","b":[200],"m":"iny"},{"a":42343,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":42345,"t":"code","b":[133,246],"m":"sta","oa":246,"o":"control_temp"},{"a":42347,"t":"code","b":[200],"m":"iny"},{"a":42348,"t":"code","b":[140,109,160],"m":"sty","oa":41069,"o":"tune_wave_position"},{"a":42351,"t":"code","b":[189,4,160],"m":"lda","oa":40964,"o":"tune_note_countdown,x"},{"a":42354,"t":"code","b":[56],"m":"sec"},{"a":42355,"t":"code","b":[241,240],"m":"sbc","oa":240,"o":"(stream_ptr_lo),y"},{"a":42357,"t":"code","b":[157,10,160],"m":"sta","oa":40970,"o":"tune_wave_countdown,x"},{"a":42360,"t":"code","b":[172,110,160],"m":"ldy","oa":41070,"o":"tune_voice_offset"},{"a":42363,"t":"code","b":[165,246],"m":"lda","oa":246,"o":"control_temp"},{"a":42365,"t":"code","b":[153,4,212],"m":"sta","o":"sid_v1_control,y"},{"a":42368,"t":"code","b":[76,167,165],"m":"jmp","oa":42407,"o":"tune_wave_advance"},{"a":42371,"l":"tune_wave_control_pitch","c":"Wave-program command 5: writes the next byte to the voice's $D404, stores the one after it as the frames to wait in $A00A,X and the third in $A084,X and $A08A,X, which asks for the frequency to be looked up again with that offset. The sound driver's copy at $B4B7 also handles a third byte of 0.","t":"code","b":[200],"m":"iny"},{"a":42372,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":42374,"t":"code","b":[133,246],"m":"sta","oa":246,"o":"control_temp"},{"a":42376,"t":"code","b":[200],"m":"iny"},{"a":42377,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":42379,"t":"code","b":[157,10,160],"m":"sta","oa":40970,"o":"tune_wave_countdown,x"},{"a":42382,"t":"code","b":[200],"m":"iny"},{"a":42383,"t":"code","b":[140,109,160],"m":"sty","oa":41069,"o":"tune_wave_position"},{"a":42386,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":42388,"t":"code","b":[240,17],"m":"beq","oa":42407,"o":"tune_wave_advance"},{"a":42390,"t":"code","b":[157,132,160],"m":"sta","oa":41092,"o":"tune_new_note,x"},{"a":42393,"t":"code","b":[157,138,160],"m":"sta","oa":41098,"o":"tune_pitch_offset,x"},{"a":42396,"t":"code","b":[172,110,160],"m":"ldy","oa":41070,"o":"tune_voice_offset"},{"a":42399,"t":"code","b":[165,246],"m":"lda","oa":246,"o":"control_temp"},{"a":42401,"t":"code","b":[153,4,212],"m":"sta","o":"sid_v1_control,y"},{"a":42404,"t":"code","b":[76,167,165],"m":"jmp","oa":42407,"o":"tune_wave_advance"},{"a":42407,"l":"tune_wave_advance","c":"End of a wave-program step: adds 1 to the position $A06D and stores $F0/$F1 plus the position as the voice's wave pointer $A020/$A026. Wave-program command 6 enters here directly, so it skips one byte. Same code as the routine at $B4ED of the sound driver.","t":"code","b":[238,109,160],"m":"inc","oa":41069,"o":"tune_wave_position","x":[42263,42339,42368,42388,42404]},{"a":42410,"t":"code","b":[165,240],"m":"lda","oa":240,"o":"stream_ptr_lo"},{"a":42412,"t":"code","b":[24],"m":"clc"},{"a":42413,"t":"code","b":[109,109,160],"m":"adc","oa":41069,"o":"tune_wave_position"},{"a":42416,"t":"code","b":[157,32,160],"m":"sta","oa":40992,"o":"tune_wave_ptr_lo,x"},{"a":42419,"t":"code","b":[165,241],"m":"lda","oa":241,"o":"stream_ptr_hi"},{"a":42421,"t":"code","b":[105,0],"m":"adc","o":"#$00"},{"a":42423,"t":"code","b":[157,38,160],"m":"sta","oa":40998,"o":"tune_wave_ptr_hi,x"},{"a":42426,"t":"code","b":[96],"m":"rts"},{"a":42427,"l":"tune_cmd_wave_program","c":"Stream command $81: the next byte n selects a wave program. The address at offset 2n of the table $ACF7 is stored as the voice's program start $A023/$A029, which the next note copies to $A020/$A026. Carries on at $A328. Same code as the routine at $B501 of the sound driver.","t":"code","b":[200],"m":"iny"},{"a":42428,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":42430,"t":"code","b":[10],"m":"asl","o":"a"},{"a":42431,"t":"code","b":[141,2,160],"m":"sta","oa":40962,"o":"tune_voice_scratch"},{"a":42434,"t":"code","b":[200],"m":"iny"},{"a":42435,"t":"code","b":[152],"m":"tya"},{"a":42436,"t":"code","b":[157,168,160],"m":"sta","oa":41128,"o":"tune_stream_position,x"},{"a":42439,"t":"code","b":[172,2,160],"m":"ldy","oa":40962,"o":"tune_voice_scratch"},{"a":42442,"t":"code","b":[185,247,172],"m":"lda","oa":44279,"o":"tune_wave_program_table,y"},{"a":42445,"t":"code","b":[157,35,160],"m":"sta","oa":40995,"o":"tune_wave_start_lo,x"},{"a":42448,"t":"code","b":[185,248,172],"m":"lda","oa":44280,"o":"$ACF8,y"},{"a":42451,"t":"code","b":[157,41,160],"m":"sta","oa":41001,"o":"tune_wave_start_hi,x"},{"a":42454,"t":"code","b":[76,40,163],"m":"jmp","oa":41768,"o":"tune_read_stream"},{"a":42457,"l":"tune_cmd_pulse","c":"Stream command $82: the three bytes that follow go to $A02F (start index into the table $AB47), $A099 (initial pulse width, high byte) and $A093 (low byte). Carries on at $A328. Same code as the routine at $B51F of the sound driver.","t":"code","b":[200],"m":"iny"},{"a":42458,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":42460,"t":"code","b":[157,47,160],"m":"sta","oa":41007,"o":"tune_pulse_start,x"},{"a":42463,"t":"code","b":[200],"m":"iny"},{"a":42464,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":42466,"t":"code","b":[157,153,160],"m":"sta","oa":41113,"o":"tune_pulse_start_hi,x"},{"a":42469,"t":"code","b":[200],"m":"iny"},{"a":42470,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":42472,"t":"code","b":[157,147,160],"m":"sta","oa":41107,"o":"tune_pulse_start_lo,x"},{"a":42475,"t":"code","b":[200],"m":"iny"},{"a":42476,"t":"code","b":[152],"m":"tya"},{"a":42477,"t":"code","b":[157,168,160],"m":"sta","oa":41128,"o":"tune_stream_position,x"},{"a":42480,"t":"code","b":[76,40,163],"m":"jmp","oa":41768,"o":"tune_read_stream"},{"a":42483,"l":"tune_cmd_pitch_slide","c":"Stream command $83: the next byte goes to $A038, the start index into the slide table $AB85. Sets the slide flag $A075 and clears $A032 and the arpeggio flag $A07B. Carries on at $A328. Same code as the routine at $B539 of the sound driver.","t":"code","b":[200],"m":"iny"},{"a":42484,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":42486,"t":"code","b":[157,56,160],"m":"sta","oa":41016,"o":"tune_slide_start,x"},{"a":42489,"t":"code","b":[200],"m":"iny"},{"a":42490,"t":"code","b":[152],"m":"tya"},{"a":42491,"t":"code","b":[157,168,160],"m":"sta","oa":41128,"o":"tune_stream_position,x"},{"a":42494,"t":"code","b":[157,117,160],"m":"sta","oa":41077,"o":"tune_slide_on,x"},{"a":42497,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":42499,"t":"code","b":[157,50,160],"m":"sta","oa":41010,"o":"tune_slide_table_select,x"},{"a":42502,"t":"code","b":[157,123,160],"m":"sta","oa":41083,"o":"tune_arp_on,x"},{"a":42505,"t":"code","b":[76,40,163],"m":"jmp","oa":41768,"o":"tune_read_stream"},{"a":42508,"l":"tune_cmd_arpeggio","c":"Stream commands $84 and $8D: clears the slide flag $A075 and sets the arpeggio flag $A07B. The next byte n selects the entry whose address is at offset 2n of the table $ABDA (kept in $F4/$F5); its first byte goes to $A0AE (frames per step), its second to $A0B4 (number of steps) and the address after them to $A03B/$A041. Carries on at $A328. Same code as the routine at $B552 of the sound driver.","t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":42510,"t":"code","b":[157,117,160],"m":"sta","oa":41077,"o":"tune_slide_on,x"},{"a":42513,"t":"code","b":[200],"m":"iny"},{"a":42514,"t":"code","b":[152],"m":"tya"},{"a":42515,"t":"code","b":[157,123,160],"m":"sta","oa":41083,"o":"tune_arp_on,x"},{"a":42518,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":42520,"t":"code","b":[10],"m":"asl","o":"a"},{"a":42521,"t":"code","b":[170],"m":"tax"},{"a":42522,"t":"code","b":[189,218,171],"m":"lda","oa":43994,"o":"tune_arpeggio_pointers,x"},{"a":42525,"t":"code","b":[133,244],"m":"sta","oa":244,"o":"arp_entry_ptr_lo"},{"a":42527,"t":"code","b":[189,219,171],"m":"lda","oa":43995,"o":"$ABDB,x"},{"a":42530,"t":"code","b":[133,245],"m":"sta","oa":245,"o":"arp_entry_ptr_hi"},{"a":42532,"t":"code","b":[200],"m":"iny"},{"a":42533,"t":"code","b":[152],"m":"tya"},{"a":42534,"t":"code","b":[166,250],"m":"ldx","oa":250,"o":"voice_index"},{"a":42536,"t":"code","b":[157,168,160],"m":"sta","oa":41128,"o":"tune_stream_position,x"},{"a":42539,"t":"code","b":[160,0],"m":"ldy","o":"#$00"},{"a":42541,"t":"code","b":[177,244],"m":"lda","oa":244,"o":"(arp_entry_ptr_lo),y"},{"a":42543,"t":"code","b":[157,174,160],"m":"sta","oa":41134,"o":"tune_arp_reload,x"},{"a":42546,"t":"code","b":[200],"m":"iny"},{"a":42547,"t":"code","b":[177,244],"m":"lda","oa":244,"o":"(arp_entry_ptr_lo),y"},{"a":42549,"t":"code","b":[157,180,160],"m":"sta","oa":41140,"o":"tune_arp_length,x"},{"a":42552,"t":"code","b":[165,244],"m":"lda","oa":244,"o":"arp_entry_ptr_lo"},{"a":42554,"t":"code","b":[24],"m":"clc"},{"a":42555,"t":"code","b":[105,2],"m":"adc","o":"#$02"},{"a":42557,"t":"code","b":[157,59,160],"m":"sta","oa":41019,"o":"tune_arp_ptr_lo,x"},{"a":42560,"t":"code","b":[165,245],"m":"lda","oa":245,"o":"arp_entry_ptr_hi"},{"a":42562,"t":"code","b":[105,0],"m":"adc","o":"#$00"},{"a":42564,"t":"code","b":[157,65,160],"m":"sta","oa":41025,"o":"tune_arp_ptr_hi,x"},{"a":42567,"t":"code","b":[76,40,163],"m":"jmp","oa":41768,"o":"tune_read_stream"},{"a":42570,"l":"tune_cmd_fixed_length","c":"Stream command $87: the next byte is stored in $A007,X and in the flag $A087,X, so that following notes carry no length byte. Carries on at $A328. Same code as the routine at $B590 of the sound driver.","t":"code","b":[200],"m":"iny"},{"a":42571,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":42573,"t":"code","b":[157,7,160],"m":"sta","oa":40967,"o":"tune_fixed_length,x"},{"a":42576,"t":"code","b":[157,135,160],"m":"sta","oa":41095,"o":"tune_fixed_length_on,x"},{"a":42579,"t":"code","b":[200],"m":"iny"},{"a":42580,"t":"code","b":[152],"m":"tya"},{"a":42581,"t":"code","b":[157,168,160],"m":"sta","oa":41128,"o":"tune_stream_position,x"},{"a":42584,"t":"code","b":[76,40,163],"m":"jmp","oa":41768,"o":"tune_read_stream"},{"a":42587,"l":"tune_cmd_free_length","c":"Stream command $88: clears the fixed-length flag $A087,X so that notes carry a length byte again. Carries on at $A328. Same code as the routine at $B5A1 of the sound driver.","t":"code","b":[169,0],"m":"lda","o":"#$00","x":[41969]},{"a":42589,"t":"code","b":[157,135,160],"m":"sta","oa":41095,"o":"tune_fixed_length_on,x"},{"a":42592,"t":"code","b":[254,168,160],"m":"inc","oa":41128,"o":"tune_stream_position,x"},{"a":42595,"t":"code","b":[76,40,163],"m":"jmp","oa":41768,"o":"tune_read_stream"},{"a":42598,"l":"tune_cmd_drum","c":"Stream commands $86 and $89: the next byte is an offset into the 5-byte records of the table $AA48. A record holds a list address, a list length (to $A0B8), a sustain/release value (to $D406 and $A081) and a pulse width high byte (to $D403). The list address goes to $A04F/$A055 and the address plus the length to $A052/$A058. It then writes 0 to $D405 and 8 to $D404, clears $A0BB, takes the byte after the drum number as the note length $A004,X and returns without reading on; $A880 plays the list. If the voice has the filter on ($A07E,X) it also writes $FF to $D415 and $90 to $D416. The sound driver's copy at $B5AC does not write the filter registers but restarts the filter sweep instead.","t":"code","b":[200],"m":"iny"},{"a":42599,"t":"code","b":[152],"m":"tya"},{"a":42600,"t":"code","b":[157,168,160],"m":"sta","oa":41128,"o":"tune_stream_position,x"},{"a":42603,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":42605,"t":"code","b":[168],"m":"tay"},{"a":42606,"t":"code","b":[185,74,170],"m":"lda","oa":43594,"o":"$AA4A,y"},{"a":42609,"t":"code","b":[157,184,160],"m":"sta","oa":41144,"o":"tune_drum_length,x"},{"a":42612,"t":"code","b":[185,72,170],"m":"lda","oa":43592,"o":"tune_drum_records,y"},{"a":42615,"t":"code","b":[157,79,160],"m":"sta","oa":41039,"o":"tune_drum_ctrl_lo,x"},{"a":42618,"t":"code","b":[24],"m":"clc"},{"a":42619,"t":"code","b":[125,184,160],"m":"adc","oa":41144,"o":"tune_drum_length,x"},{"a":42622,"t":"code","b":[157,82,160],"m":"sta","oa":41042,"o":"tune_drum_freq_lo,x"},{"a":42625,"t":"code","b":[185,73,170],"m":"lda","oa":43593,"o":"$AA49,y"},{"a":42628,"t":"code","b":[157,85,160],"m":"sta","oa":41045,"o":"tune_drum_ctrl_hi,x"},{"a":42631,"t":"code","b":[105,0],"m":"adc","o":"#$00"},{"a":42633,"t":"code","b":[157,88,160],"m":"sta","oa":41048,"o":"tune_drum_freq_hi,x"},{"a":42636,"t":"code","b":[185,75,170],"m":"lda","oa":43595,"o":"$AA4B,y"},{"a":42639,"t":"code","b":[72],"m":"pha"},{"a":42640,"t":"code","b":[185,76,170],"m":"lda","oa":43596,"o":"$AA4C,y"},{"a":42643,"t":"code","b":[172,110,160],"m":"ldy","oa":41070,"o":"tune_voice_offset"},{"a":42646,"t":"code","b":[153,3,212],"m":"sta","o":"sid_v1_pulse_hi,y"},{"a":42649,"t":"code","b":[104],"m":"pla"},{"a":42650,"t":"code","b":[153,6,212],"m":"sta","o":"sid_v1_sustain_release,y"},{"a":42653,"t":"code","b":[157,129,160],"m":"sta","oa":41089,"o":"tune_drum_on,x"},{"a":42656,"t":"code","b":[189,126,160],"m":"lda","oa":41086,"o":"tune_filter_on,x"},{"a":42659,"t":"code","b":[240,10],"m":"beq","oa":42671,"o":"$A6AF"},{"a":42661,"t":"code","b":[169,255],"m":"lda","o":"#$FF"},{"a":42663,"t":"code","b":[141,21,212],"m":"sta","o":"sid_filter_cutoff_lo"},{"a":42666,"t":"code","b":[169,144],"m":"lda","o":"#$90"},{"a":42668,"t":"code","b":[141,22,212],"m":"sta","o":"sid_filter_cutoff_hi"},{"a":42671,"t":"code","b":[169,0],"m":"lda","o":"#$00","x":[42659]},{"a":42673,"t":"code","b":[153,5,212],"m":"sta","o":"sid_v1_attack_decay,y"},{"a":42676,"t":"code","b":[169,8],"m":"lda","o":"#$08"},{"a":42678,"t":"code","b":[153,4,212],"m":"sta","o":"sid_v1_control,y"},{"a":42681,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":42683,"t":"code","b":[157,187,160],"m":"sta","oa":41147,"o":"tune_drum_step_count,x"},{"a":42686,"t":"code","b":[254,168,160],"m":"inc","oa":41128,"o":"tune_stream_position,x"},{"a":42689,"t":"code","b":[188,168,160],"m":"ldy","oa":41128,"o":"tune_stream_position,x"},{"a":42692,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":42694,"t":"code","b":[157,4,160],"m":"sta","oa":40964,"o":"tune_note_countdown,x"},{"a":42697,"t":"code","b":[96],"m":"rts"},{"a":42698,"l":"tune_cmd_filter","c":"Stream command $85: the first byte goes to $A047 (start index into the table $ACDB), the second to $A04B and $A04D, the third to $A04C and $A04E, the fourth to the filter control register $D417 and to $A07E,X, after all three of $A07E are cleared. Carries on at $A328. Same code as the routine at $B618 of the sound driver.","t":"code","b":[200],"m":"iny"},{"a":42699,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":42701,"t":"code","b":[141,71,160],"m":"sta","oa":41031,"o":"tune_filter_start"},{"a":42704,"t":"code","b":[200],"m":"iny"},{"a":42705,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":42707,"t":"code","b":[141,75,160],"m":"sta","oa":41035,"o":"tune_filter_start_hi"},{"a":42710,"t":"code","b":[141,77,160],"m":"sta","oa":41037,"o":"tune_filter_hi"},{"a":42713,"t":"code","b":[200],"m":"iny"},{"a":42714,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":42716,"t":"code","b":[141,76,160],"m":"sta","oa":41036,"o":"tune_filter_start_lo"},{"a":42719,"t":"code","b":[141,78,160],"m":"sta","oa":41038,"o":"tune_filter_lo"},{"a":42722,"t":"code","b":[200],"m":"iny"},{"a":42723,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":42725,"t":"code","b":[72],"m":"pha"},{"a":42726,"t":"code","b":[200],"m":"iny"},{"a":42727,"t":"code","b":[152],"m":"tya"},{"a":42728,"t":"code","b":[157,168,160],"m":"sta","oa":41128,"o":"tune_stream_position,x"},{"a":42731,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":42733,"t":"code","b":[141,126,160],"m":"sta","oa":41086,"o":"tune_filter_on"},{"a":42736,"t":"code","b":[141,127,160],"m":"sta","oa":41087,"o":"$A07F"},{"a":42739,"t":"code","b":[141,128,160],"m":"sta","oa":41088,"o":"$A080"},{"a":42742,"t":"code","b":[104],"m":"pla"},{"a":42743,"t":"code","b":[141,23,212],"m":"sta","o":"sid_filter_resonance"},{"a":42746,"t":"code","b":[157,126,160],"m":"sta","oa":41086,"o":"tune_filter_on,x"},{"a":42749,"t":"code","b":[76,40,163],"m":"jmp","oa":41768,"o":"tune_read_stream"},{"a":42752,"l":"tune_pulse_step","c":"Pulse-width sweep of the current voice. Counts $A00D,X down. At zero it reads a step from the table $AB47 at the index $A02C,X: a frame count (to $A00D), a low and a high step (to $A09C and $A09F); a count of 0 means the next byte is a new index and the read is repeated. Every call it adds the step to the width $A090/$A096 and writes it to the voice's $D402 and $D403. Called by $A242. Same code as the routine at $B64E of the sound driver.","t":"code","b":[222,13,160],"m":"dec","oa":40973,"o":"tune_pulse_countdown,x","x":[41621]},{"a":42755,"t":"code","b":[208,40],"m":"bne","oa":42797,"o":"$A72D"},{"a":42757,"t":"code","b":[188,44,160],"m":"ldy","oa":41004,"o":"tune_pulse_index,x","x":[42772]},{"a":42760,"t":"code","b":[185,71,171],"m":"lda","oa":43847,"o":"tune_pulse_table,y"},{"a":42763,"t":"code","b":[208,10],"m":"bne","oa":42775,"o":"$A717"},{"a":42765,"t":"code","b":[200],"m":"iny"},{"a":42766,"t":"code","b":[185,71,171],"m":"lda","oa":43847,"o":"tune_pulse_table,y"},{"a":42769,"t":"code","b":[157,44,160],"m":"sta","oa":41004,"o":"tune_pulse_index,x"},{"a":42772,"t":"code","b":[76,5,167],"m":"jmp","oa":42757,"o":"$A705"},{"a":42775,"t":"code","b":[157,13,160],"m":"sta","oa":40973,"o":"tune_pulse_countdown,x","x":[42763]},{"a":42778,"t":"code","b":[200],"m":"iny"},{"a":42779,"t":"code","b":[185,71,171],"m":"lda","oa":43847,"o":"tune_pulse_table,y"},{"a":42782,"t":"code","b":[157,156,160],"m":"sta","oa":41116,"o":"tune_pulse_step_lo,x"},{"a":42785,"t":"code","b":[200],"m":"iny"},{"a":42786,"t":"code","b":[185,71,171],"m":"lda","oa":43847,"o":"tune_pulse_table,y"},{"a":42789,"t":"code","b":[157,159,160],"m":"sta","oa":41119,"o":"tune_pulse_step_hi,x"},{"a":42792,"t":"code","b":[200],"m":"iny"},{"a":42793,"t":"code","b":[152],"m":"tya"},{"a":42794,"t":"code","b":[157,44,160],"m":"sta","oa":41004,"o":"tune_pulse_index,x"},{"a":42797,"t":"code","b":[172,110,160],"m":"ldy","oa":41070,"o":"tune_voice_offset","x":[42755]},{"a":42800,"t":"code","b":[189,144,160],"m":"lda","oa":41104,"o":"tune_pulse_lo,x"},{"a":42803,"t":"code","b":[24],"m":"clc"},{"a":42804,"t":"code","b":[125,156,160],"m":"adc","oa":41116,"o":"tune_pulse_step_lo,x"},{"a":42807,"t":"code","b":[157,144,160],"m":"sta","oa":41104,"o":"tune_pulse_lo,x"},{"a":42810,"t":"code","b":[153,2,212],"m":"sta","o":"sid_v1_pulse_lo,y"},{"a":42813,"t":"code","b":[189,150,160],"m":"lda","oa":41110,"o":"tune_pulse_hi,x"},{"a":42816,"t":"code","b":[125,159,160],"m":"adc","oa":41119,"o":"tune_pulse_step_hi,x"},{"a":42819,"t":"code","b":[157,150,160],"m":"sta","oa":41110,"o":"tune_pulse_hi,x"},{"a":42822,"t":"code","b":[153,3,212],"m":"sta","o":"sid_v1_pulse_hi,y"},{"a":42825,"t":"code","b":[96],"m":"rts","x":[42829]},{"a":42826,"l":"tune_pitch_slide_step","c":"Pitch slide of the current voice. Returns if $A075,X is zero. Counts $A010,X down. At zero it reads a step (frame count, low step, high step) from the table $AB85, or from $ABDA when $A032 is non-zero, at the index $A035,X into $A010, $A0A2 and $A0A5; a count of 0 means the next byte is a new index. Every call it adds the step to the frequency $A061/$A064. Called by $A242 before the frequency is written. Same code as the routine at $B698 of the sound driver.","t":"code","b":[189,117,160],"m":"lda","oa":41077,"o":"tune_slide_on,x","x":[41668]},{"a":42829,"t":"code","b":[240,250],"m":"beq","oa":42825,"o":"$A749"},{"a":42831,"t":"code","b":[222,16,160],"m":"dec","oa":40976,"o":"tune_slide_countdown,x"},{"a":42834,"t":"code","b":[208,88],"m":"bne","oa":42924,"o":"$A7AC"},{"a":42836,"t":"code","b":[189,50,160],"m":"lda","oa":41010,"o":"tune_slide_table_select,x"},{"a":42839,"t":"code","b":[240,43],"m":"beq","oa":42884,"o":"$A784"},{"a":42841,"t":"code","b":[188,53,160],"m":"ldy","oa":41013,"o":"tune_slide_index,x","x":[42856]},{"a":42844,"t":"code","b":[185,218,171],"m":"lda","oa":43994,"o":"tune_arpeggio_pointers,y"},{"a":42847,"t":"code","b":[208,10],"m":"bne","oa":42859,"o":"$A76B"},{"a":42849,"t":"code","b":[200],"m":"iny"},{"a":42850,"t":"code","b":[185,218,171],"m":"lda","oa":43994,"o":"tune_arpeggio_pointers,y"},{"a":42853,"t":"code","b":[157,53,160],"m":"sta","oa":41013,"o":"tune_slide_index,x"},{"a":42856,"t":"code","b":[76,89,167],"m":"jmp","oa":42841,"o":"$A759"},{"a":42859,"t":"code","b":[157,16,160],"m":"sta","oa":40976,"o":"tune_slide_countdown,x","x":[42847]},{"a":42862,"t":"code","b":[200],"m":"iny"},{"a":42863,"t":"code","b":[185,218,171],"m":"lda","oa":43994,"o":"tune_arpeggio_pointers,y"},{"a":42866,"t":"code","b":[157,162,160],"m":"sta","oa":41122,"o":"tune_slide_step_lo,x"},{"a":42869,"t":"code","b":[200],"m":"iny"},{"a":42870,"t":"code","b":[185,218,171],"m":"lda","oa":43994,"o":"tune_arpeggio_pointers,y"},{"a":42873,"t":"code","b":[157,165,160],"m":"sta","oa":41125,"o":"tune_slide_step_hi,x"},{"a":42876,"t":"code","b":[200],"m":"iny"},{"a":42877,"t":"code","b":[152],"m":"tya"},{"a":42878,"t":"code","b":[157,53,160],"m":"sta","oa":41013,"o":"tune_slide_index,x"},{"a":42881,"t":"code","b":[76,172,167],"m":"jmp","oa":42924,"o":"$A7AC"},{"a":42884,"t":"code","b":[188,53,160],"m":"ldy","oa":41013,"o":"tune_slide_index,x","x":[42839,42899]},{"a":42887,"t":"code","b":[185,133,171],"m":"lda","oa":43909,"o":"tune_slide_table,y"},{"a":42890,"t":"code","b":[208,10],"m":"bne","oa":42902,"o":"$A796"},{"a":42892,"t":"code","b":[200],"m":"iny"},{"a":42893,"t":"code","b":[185,133,171],"m":"lda","oa":43909,"o":"tune_slide_table,y"},{"a":42896,"t":"code","b":[157,53,160],"m":"sta","oa":41013,"o":"tune_slide_index,x"},{"a":42899,"t":"code","b":[76,132,167],"m":"jmp","oa":42884,"o":"$A784"},{"a":42902,"t":"code","b":[157,16,160],"m":"sta","oa":40976,"o":"tune_slide_countdown,x","x":[42890]},{"a":42905,"t":"code","b":[200],"m":"iny"},{"a":42906,"t":"code","b":[185,133,171],"m":"lda","oa":43909,"o":"tune_slide_table,y"},{"a":42909,"t":"code","b":[157,162,160],"m":"sta","oa":41122,"o":"tune_slide_step_lo,x"},{"a":42912,"t":"code","b":[200],"m":"iny"},{"a":42913,"t":"code","b":[185,133,171],"m":"lda","oa":43909,"o":"tune_slide_table,y"},{"a":42916,"t":"code","b":[157,165,160],"m":"sta","oa":41125,"o":"tune_slide_step_hi,x"},{"a":42919,"t":"code","b":[200],"m":"iny"},{"a":42920,"t":"code","b":[152],"m":"tya"},{"a":42921,"t":"code","b":[157,53,160],"m":"sta","oa":41013,"o":"tune_slide_index,x"},{"a":42924,"t":"code","b":[172,110,160],"m":"ldy","oa":41070,"o":"tune_voice_offset","x":[42834,42881]},{"a":42927,"t":"code","b":[189,97,160],"m":"lda","oa":41057,"o":"tune_freq_lo,x"},{"a":42930,"t":"code","b":[24],"m":"clc"},{"a":42931,"t":"code","b":[125,162,160],"m":"adc","oa":41122,"o":"tune_slide_step_lo,x"},{"a":42934,"t":"code","b":[157,97,160],"m":"sta","oa":41057,"o":"tune_freq_lo,x"},{"a":42937,"t":"code","b":[189,100,160],"m":"lda","oa":41060,"o":"tune_freq_hi,x"},{"a":42940,"t":"code","b":[125,165,160],"m":"adc","oa":41125,"o":"tune_slide_step_hi,x"},{"a":42943,"t":"code","b":[157,100,160],"m":"sta","oa":41060,"o":"tune_freq_hi,x"},{"a":42946,"t":"code","b":[96],"m":"rts"},{"a":42947,"l":"tune_arpeggio_step","c":"Arpeggio of the current voice. Returns if $A07B,X is zero. Counts $A0AB,X down; at zero it reloads it from $A0AE, reads the step at $A0B1,X from the list at $A03B/$A041, adds it to the note $A067 and the offsets $A08A and $A08D, looks the sum up in $A98C and $A9EA and writes the frequency to the voice's $D400/$D401. $A0B1 is counted up and returns to 0 at $A0B4. Called by $A242. Same code as the routine at $B711 of the sound driver.","t":"code","b":[189,123,160],"m":"lda","oa":41083,"o":"tune_arp_on,x","x":[41624]},{"a":42950,"t":"code","b":[240,71],"m":"beq","oa":43023,"o":"$A80F"},{"a":42952,"t":"code","b":[222,171,160],"m":"dec","oa":41131,"o":"tune_arp_countdown,x"},{"a":42955,"t":"code","b":[240,1],"m":"beq","oa":42958,"o":"$A7CE"},{"a":42957,"t":"code","b":[96],"m":"rts"},{"a":42958,"t":"code","b":[189,59,160],"m":"lda","oa":41019,"o":"tune_arp_ptr_lo,x","x":[42955]},{"a":42961,"t":"code","b":[133,240],"m":"sta","oa":240,"o":"stream_ptr_lo"},{"a":42963,"t":"code","b":[189,65,160],"m":"lda","oa":41025,"o":"tune_arp_ptr_hi,x"},{"a":42966,"t":"code","b":[133,241],"m":"sta","oa":241,"o":"stream_ptr_hi"},{"a":42968,"t":"code","b":[189,174,160],"m":"lda","oa":41134,"o":"tune_arp_reload,x"},{"a":42971,"t":"code","b":[157,171,160],"m":"sta","oa":41131,"o":"tune_arp_countdown,x"},{"a":42974,"t":"code","b":[188,177,160],"m":"ldy","oa":41137,"o":"tune_arp_index,x"},{"a":42977,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":42979,"t":"code","b":[24],"m":"clc"},{"a":42980,"t":"code","b":[125,103,160],"m":"adc","oa":41063,"o":"tune_note,x"},{"a":42983,"t":"code","b":[125,138,160],"m":"adc","oa":41098,"o":"tune_pitch_offset,x"},{"a":42986,"t":"code","b":[125,141,160],"m":"adc","oa":41101,"o":"tune_transpose,x"},{"a":42989,"t":"code","b":[172,110,160],"m":"ldy","oa":41070,"o":"tune_voice_offset"},{"a":42992,"t":"code","b":[170],"m":"tax"},{"a":42993,"t":"code","b":[189,140,169],"m":"lda","oa":43404,"o":"tune_note_freq_lo,x"},{"a":42996,"t":"code","b":[153,0,212],"m":"sta","o":"sid_v1_freq_lo,y"},{"a":42999,"t":"code","b":[189,234,169],"m":"lda","oa":43498,"o":"tune_note_freq_hi,x"},{"a":43002,"t":"code","b":[153,1,212],"m":"sta","o":"sid_v1_freq_hi,y"},{"a":43005,"t":"code","b":[166,250],"m":"ldx","oa":250,"o":"voice_index"},{"a":43007,"t":"code","b":[254,177,160],"m":"inc","oa":41137,"o":"tune_arp_index,x"},{"a":43010,"t":"code","b":[189,177,160],"m":"lda","oa":41137,"o":"tune_arp_index,x"},{"a":43013,"t":"code","b":[221,180,160],"m":"cmp","oa":41140,"o":"tune_arp_length,x"},{"a":43016,"t":"code","b":[208,5],"m":"bne","oa":43023,"o":"$A80F"},{"a":43018,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":43020,"t":"code","b":[157,177,160],"m":"sta","oa":41137,"o":"tune_arp_index,x"},{"a":43023,"t":"code","b":[96],"m":"rts","x":[42950,43016]},{"a":43024,"l":"tune_filter_sweep_step","c":"Filter sweep, once per call. Counts $A013 down; at zero it reads a step from the table $ACDB at $A048: a frame count (to $A013), a low and a high step (to $A049 and $A04A); a count of 0 means the next byte is a new index. It adds the step to the 16-bit filter value $A04D/$A04E and writes its low three bits to $D415 and a byte made from its upper bits to $D416. Called by $A242 after the voices. It first returns at once while $A000 is non-zero, and also when the highest voice with its filter flag $A07E set is playing a drum; the sweep step itself starts at $A828. The sound driver's copy at $B75E has the sweep step without the guard.","t":"code","b":[173,0,160],"m":"lda","oa":40960,"o":"tune_driver_flag","x":[41696]},{"a":43027,"t":"code","b":[208,18],"m":"bne","oa":43047,"o":"$A827"},{"a":43029,"t":"code","b":[162,2],"m":"ldx","o":"#$02"},{"a":43031,"t":"code","b":[189,126,160],"m":"lda","oa":41086,"o":"tune_filter_on,x","x":[43037]},{"a":43034,"t":"code","b":[208,6],"m":"bne","oa":43042,"o":"$A822"},{"a":43036,"t":"code","b":[202],"m":"dex"},{"a":43037,"t":"code","b":[16,248],"m":"bpl","oa":43031,"o":"$A817"},{"a":43039,"t":"code","b":[76,40,168],"m":"jmp","oa":43048,"o":"$A828"},{"a":43042,"t":"code","b":[189,129,160],"m":"lda","oa":41089,"o":"tune_drum_on,x","x":[43034]},{"a":43045,"t":"code","b":[240,1],"m":"beq","oa":43048,"o":"$A828"},{"a":43047,"t":"code","b":[96],"m":"rts","x":[43027]},{"a":43048,"t":"code","b":[206,19,160],"m":"dec","oa":40979,"o":"tune_filter_countdown","x":[43039,43045]},{"a":43051,"t":"code","b":[208,39],"m":"bne","oa":43092,"o":"$A854"},{"a":43053,"t":"code","b":[172,72,160],"m":"ldy","oa":41032,"o":"tune_filter_index","x":[43068]},{"a":43056,"t":"code","b":[185,219,172],"m":"lda","oa":44251,"o":"tune_filter_sweep_table,y"},{"a":43059,"t":"code","b":[208,10],"m":"bne","oa":43071,"o":"$A83F"},{"a":43061,"t":"code","b":[200],"m":"iny"},{"a":43062,"t":"code","b":[185,219,172],"m":"lda","oa":44251,"o":"tune_filter_sweep_table,y"},{"a":43065,"t":"code","b":[141,72,160],"m":"sta","oa":41032,"o":"tune_filter_index"},{"a":43068,"t":"code","b":[76,45,168],"m":"jmp","oa":43053,"o":"$A82D"},{"a":43071,"t":"code","b":[141,19,160],"m":"sta","oa":40979,"o":"tune_filter_countdown","x":[43059]},{"a":43074,"t":"code","b":[200],"m":"iny"},{"a":43075,"t":"code","b":[185,219,172],"m":"lda","oa":44251,"o":"tune_filter_sweep_table,y"},{"a":43078,"t":"code","b":[141,73,160],"m":"sta","oa":41033,"o":"tune_filter_step_lo"},{"a":43081,"t":"code","b":[200],"m":"iny"},{"a":43082,"t":"code","b":[185,219,172],"m":"lda","oa":44251,"o":"tune_filter_sweep_table,y"},{"a":43085,"t":"code","b":[141,74,160],"m":"sta","oa":41034,"o":"tune_filter_step_hi"},{"a":43088,"t":"code","b":[200],"m":"iny"},{"a":43089,"t":"code","b":[140,72,160],"m":"sty","oa":41032,"o":"tune_filter_index"},{"a":43092,"t":"code","b":[173,78,160],"m":"lda","oa":41038,"o":"tune_filter_lo","x":[43051]},{"a":43095,"t":"code","b":[24],"m":"clc"},{"a":43096,"t":"code","b":[109,73,160],"m":"adc","oa":41033,"o":"tune_filter_step_lo"},{"a":43099,"t":"code","b":[141,78,160],"m":"sta","oa":41038,"o":"tune_filter_lo"},{"a":43102,"t":"code","b":[141,183,160],"m":"sta","oa":41143,"o":"tune_filter_scratch"},{"a":43105,"t":"code","b":[41,7],"m":"and","o":"#$07"},{"a":43107,"t":"code","b":[141,21,212],"m":"sta","o":"sid_filter_cutoff_lo"},{"a":43110,"t":"code","b":[173,77,160],"m":"lda","oa":41037,"o":"tune_filter_hi"},{"a":43113,"t":"code","b":[109,74,160],"m":"adc","oa":41034,"o":"tune_filter_step_hi"},{"a":43116,"t":"code","b":[141,77,160],"m":"sta","oa":41037,"o":"tune_filter_hi"},{"a":43119,"t":"code","b":[74],"m":"lsr","o":"a"},{"a":43120,"t":"code","b":[110,183,160],"m":"ror","oa":41143,"o":"tune_filter_scratch"},{"a":43123,"t":"code","b":[74],"m":"lsr","o":"a"},{"a":43124,"t":"code","b":[110,183,160],"m":"ror","oa":41143,"o":"tune_filter_scratch","x":[42048]},{"a":43127,"t":"code","b":[74],"m":"lsr","o":"a"},{"a":43128,"t":"code","b":[173,183,160],"m":"lda","oa":41143,"o":"tune_filter_scratch"},{"a":43131,"t":"code","b":[106],"m":"ror","o":"a"},{"a":43132,"t":"code","b":[141,22,212],"m":"sta","o":"sid_filter_cutoff_hi"},{"a":43135,"t":"code","b":[96],"m":"rts"},{"a":43136,"l":"tune_drum_step","c":"Plays the drum lists of the three voices, X from 2 down to 0, for every voice with $A081 set. While the step count $A0BB differs from the list length $A0B8 it patches the list addresses $A04F/$A055 and $A052/$A058 into the operands at $A8D9 and $A8CB and writes the frequency entry to the voice's $D400 and $D401, 8 to $D404 and then the control entry to $D404; it counts $A0BB up. When they are equal and $A000 is non-zero it clears $D404-$D406 of the voice. Called by $A242 after the voice loop. Same code as the routine at $B7B6 of the sound driver.","t":"code","b":[162,2],"m":"ldx","o":"#$02","x":[41693]},{"a":43138,"t":"code","b":[189,129,160],"m":"lda","oa":41089,"o":"tune_drum_on,x","x":[43171,43239]},{"a":43141,"t":"code","b":[240,27],"m":"beq","oa":43170,"o":"$A8A2"},{"a":43143,"t":"code","b":[189,187,160],"m":"lda","oa":41147,"o":"tune_drum_step_count,x"},{"a":43146,"t":"code","b":[221,184,160],"m":"cmp","oa":41144,"o":"tune_drum_length,x"},{"a":43149,"t":"code","b":[208,23],"m":"bne","oa":43174,"o":"$A8A6"},{"a":43151,"t":"code","b":[173,0,160],"m":"lda","oa":40960,"o":"tune_driver_flag"},{"a":43154,"t":"code","b":[240,14],"m":"beq","oa":43170,"o":"$A8A2"},{"a":43156,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":43158,"t":"code","b":[188,126,169],"m":"ldy","oa":43390,"o":"tune_voice_offsets,x"},{"a":43161,"t":"code","b":[153,4,212],"m":"sta","o":"sid_v1_control,y"},{"a":43164,"t":"code","b":[153,5,212],"m":"sta","o":"sid_v1_attack_decay,y"},{"a":43167,"t":"code","b":[153,6,212],"m":"sta","o":"sid_v1_sustain_release,y"},{"a":43170,"t":"code","b":[202],"m":"dex","x":[43141,43154]},{"a":43171,"t":"code","b":[16,221],"m":"bpl","oa":43138,"o":"$A882"},{"a":43173,"t":"code","b":[96],"m":"rts"},{"a":43174,"t":"code","b":[142,2,160],"m":"stx","oa":40962,"o":"tune_voice_scratch","x":[43149]},{"a":43177,"t":"code","b":[141,3,160],"m":"sta","oa":40963,"o":"tune_step_scratch"},{"a":43180,"t":"code","b":[189,82,160],"m":"lda","oa":41042,"o":"tune_drum_freq_lo,x"},{"a":43183,"t":"code","b":[141,203,168],"m":"sta","oa":43211,"o":"tune_drum_freq_operand_low"},{"a":43186,"t":"code","b":[189,88,160],"m":"lda","oa":41048,"o":"tune_drum_freq_hi,x"},{"a":43189,"t":"code","b":[141,204,168],"m":"sta","oa":43212,"o":"tune_drum_freq_operand_high"},{"a":43192,"t":"code","b":[189,79,160],"m":"lda","oa":41039,"o":"tune_drum_ctrl_lo,x"},{"a":43195,"t":"code","b":[141,217,168],"m":"sta","oa":43225,"o":"tune_drum_ctrl_operand_low"},{"a":43198,"t":"code","b":[189,85,160],"m":"lda","oa":41045,"o":"tune_drum_ctrl_hi,x"},{"a":43201,"t":"code","b":[141,218,168],"m":"sta","oa":43226,"o":"tune_drum_ctrl_operand_high"},{"a":43204,"t":"code","b":[188,126,169],"m":"ldy","oa":43390,"o":"tune_voice_offsets,x"},{"a":43207,"t":"code","b":[174,3,160],"m":"ldx","oa":40963,"o":"tune_step_scratch"},{"a":43210,"t":"code","b":[189,221,221],"m":"lda","o":"$DDDD,x"},{"a":43211,"t":"note","l":"tune_drum_freq_operand_low","c":"Low byte of the address operand of the LDA ...,X at $A8CA, overwritten by the drum step with the address of the drum frequency list.","note":"inside the item at $A8CA","x":[43183]},{"a":43212,"t":"note","l":"tune_drum_freq_operand_high","c":"High byte of the address operand of the LDA ...,X at $A8CA, overwritten by the drum step with the address of the drum frequency list.","note":"inside the item at $A8CA","x":[43189]},{"a":43213,"t":"code","b":[153,0,212],"m":"sta","o":"sid_v1_freq_lo,y"},{"a":43216,"t":"code","b":[153,1,212],"m":"sta","o":"sid_v1_freq_hi,y"},{"a":43219,"t":"code","b":[169,8],"m":"lda","o":"#$08"},{"a":43221,"t":"code","b":[153,4,212],"m":"sta","o":"sid_v1_control,y"},{"a":43224,"t":"code","b":[189,221,221],"m":"lda","o":"$DDDD,x"},{"a":43225,"t":"note","l":"tune_drum_ctrl_operand_low","c":"Low byte of the address operand of the LDA ...,X at $A8D8, overwritten by the drum step with the address of the drum control list.","note":"inside the item at $A8D8","x":[43195]},{"a":43226,"t":"note","l":"tune_drum_ctrl_operand_high","c":"High byte of the address operand of the LDA ...,X at $A8D8, overwritten by the drum step with the address of the drum control list.","note":"inside the item at $A8D8","x":[43201]},{"a":43227,"t":"code","b":[153,4,212],"m":"sta","o":"sid_v1_control,y"},{"a":43230,"t":"code","b":[174,2,160],"m":"ldx","oa":40962,"o":"tune_voice_scratch"},{"a":43233,"t":"code","b":[254,187,160],"m":"inc","oa":41147,"o":"tune_drum_step_count,x"},{"a":43236,"t":"code","b":[202],"m":"dex"},{"a":43237,"t":"code","b":[48,3],"m":"bmi","oa":43242,"o":"$A8EA"},{"a":43239,"t":"code","b":[76,130,168],"m":"jmp","oa":43138,"o":"$A882"},{"a":43242,"t":"code","b":[96],"m":"rts","x":[43237]},{"a":43243,"l":"tune_voices_active","c":"Returns in A the OR of the voice flags $F7, $F8 and $F9, which is non-zero while any voice is playing. Level 1's title code polls it from $0F67, $0FE0 and $1319. Same code as the routine at $B821 of the sound driver.","t":"code","b":[165,247],"m":"lda","oa":247,"o":"voice0_active"},{"a":43245,"t":"code","b":[5,248],"m":"ora","oa":248,"o":"voice1_active"},{"a":43247,"t":"code","b":[5,249],"m":"ora","oa":249,"o":"voice2_active"},{"a":43249,"t":"code","b":[96],"m":"rts"},{"a":43250,"l":"tune_silence_all","c":"Stops all sound: clears the voice flags $F7-$F9, the fade flags $A0BE and $A0C2 and the volume register $D418, sets the keep flags $A0C4-$A0C6 to $FF and writes 8 to the control registers $D404, $D40B and $D412. $A242 calls it when a fade-out has run down. Same code as the routine at $B828 of the sound driver.","t":"code","b":[169,0],"m":"lda","o":"#$00","x":[41603]},{"a":43252,"t":"code","b":[133,247],"m":"sta","oa":247,"o":"voice0_active"},{"a":43254,"t":"code","b":[133,248],"m":"sta","oa":248,"o":"voice1_active"},{"a":43256,"t":"code","b":[133,249],"m":"sta","oa":249,"o":"voice2_active"},{"a":43258,"t":"code","b":[141,190,160],"m":"sta","oa":41150,"o":"tune_fade_out_on"},{"a":43261,"t":"code","b":[141,194,160],"m":"sta","oa":41154,"o":"tune_fade_in_on"},{"a":43264,"t":"code","b":[141,24,212],"m":"sta","o":"sid_filter_mode_volume"},{"a":43267,"t":"code","b":[169,255],"m":"lda","o":"#$FF"},{"a":43269,"t":"code","b":[141,196,160],"m":"sta","oa":41156,"o":"tune_keep_flags"},{"a":43272,"t":"code","b":[141,197,160],"m":"sta","oa":41157,"o":"$A0C5"},{"a":43275,"t":"code","b":[141,198,160],"m":"sta","oa":41158,"o":"$A0C6"},{"a":43278,"t":"code","b":[169,8],"m":"lda","o":"#$08"},{"a":43280,"t":"code","b":[141,4,212],"m":"sta","o":"sid_v1_control"},{"a":43283,"t":"code","b":[141,11,212],"m":"sta","o":"sid_v2_control"},{"a":43286,"t":"code","b":[141,18,212],"m":"sta","o":"sid_v3_control"},{"a":43289,"t":"code","b":[96],"m":"rts"},{"a":43290,"l":"tune_start_fade_out","c":"Starts a fade-out: stores A in $A0BE, $A0BF and $A0C0 (so A is also the rate) and clears the fade-in flag $A0C2. Level 1's title code calls it from $0F1F, $0FDD and $1316 with A=$0A, $04 and $28. Same code as the routine at $B850 of the sound driver.","t":"code","b":[141,190,160],"m":"sta","oa":41150,"o":"tune_fade_out_on"},{"a":43293,"t":"code","b":[141,191,160],"m":"sta","oa":41151,"o":"tune_fade_counter"},{"a":43296,"t":"code","b":[141,192,160],"m":"sta","oa":41152,"o":"tune_fade_rate"},{"a":43299,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":43301,"t":"code","b":[141,194,160],"m":"sta","oa":41154,"o":"tune_fade_in_on"},{"a":43304,"t":"code","b":[96],"m":"rts"},{"a":43305,"l":"tune_cmd_end_voice","c":"Stream command $8A: ends the voice: clears its active flag $F7+X and writes 0 to its control register $D404, then returns. Same code as the routine at $B85F of the sound driver.","t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":43307,"t":"code","b":[149,247],"m":"sta","oa":247,"o":"voice0_active,x"},{"a":43309,"t":"code","b":[172,110,160],"m":"ldy","oa":41070,"o":"tune_voice_offset"},{"a":43312,"t":"code","b":[153,4,212],"m":"sta","o":"sid_v1_control,y"},{"a":43315,"t":"code","b":[96],"m":"rts"},{"a":43316,"l":"tune_cmd_set_stream","c":"Stream command $8B: loads the voice's stream pointer $A05B/$A05E from the next two bytes, sets the stream position $A0A8 to 0 and carries on at $A328. Same code as the routine at $B86A of the sound driver.","t":"code","b":[200],"m":"iny"},{"a":43317,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":43319,"t":"code","b":[157,91,160],"m":"sta","oa":41051,"o":"tune_stream_lo,x"},{"a":43322,"t":"code","b":[200],"m":"iny"},{"a":43323,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":43325,"t":"code","b":[157,94,160],"m":"sta","oa":41054,"o":"tune_stream_hi,x"},{"a":43328,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":43330,"t":"code","b":[157,168,160],"m":"sta","oa":41128,"o":"tune_stream_position,x"},{"a":43333,"t":"code","b":[76,40,163],"m":"jmp","oa":41768,"o":"tune_read_stream"},{"a":43336,"l":"tune_stream_command_lo","c":"Low bytes of the handler addresses of stream commands $80-$8D (14 bytes), read by the instruction at $A3E3 as $A8C8,X with X from $80. With the high bytes at $A956 the handlers are, in order: $A3F4, $A5BB, $A5D9, $A5F3, $A60C, $A6CA, $A666, $A64A, $A65B, $A666, $A929, $A934, $A948, $A60C. The entry for $8C is the address of this table, so that command would run data.","t":"byte","b":[244,187,217,243,12,202,102,74]},{"a":43344,"t":"byte","b":[91,102,41,52,72,12]},{"a":43350,"l":"tune_stream_command_hi","c":"High bytes of the handler addresses of stream commands $80-$8D (14 bytes), read as $A8D6,X by the instruction at $A3E9; the low bytes are at $A948.","t":"byte","b":[163,165,165,165,166,166,166,166]},{"a":43358,"t":"byte","b":[166,166,169,169,169,166]},{"a":43364,"l":"tune_track_command_lo","c":"Low bytes of the handler addresses of track commands $F0-$F5 (6 bytes), read as $A874,X at $A440 with X from $F0. With the high bytes at $A96A the handlers are: $A451, $A45A, $A469, $A47A, $A489, $A49E.","t":"byte","b":[81,90,105,122,137,158]},{"a":43370,"l":"tune_track_command_hi","c":"High bytes of the handler addresses of track commands $F0-$F5 (6 bytes), read as $A87A,X at $A446; the low bytes are at $A964.","t":"byte","b":[164,164,164,164,164,164]},{"a":43376,"l":"tune_wave_command_lo","c":"Low bytes of the handler addresses of wave-program commands 0-6 (7 bytes), read as $A970,X at $A4FD. With the high bytes at $A977 the handlers are: $A50E, $A51A, $A52E, $A54D, $A566, $A583, $A5A7.","t":"byte","b":[14,26,46,77,102,131,167],"x":[42237]},{"a":43383,"l":"tune_wave_command_hi","c":"High bytes of the handler addresses of wave-program commands 0-6 (7 bytes), read as $A977,X at $A503; the low bytes are at $A970.","t":"byte","b":[165,165,165,165,165,165,165],"x":[42243]},{"a":43390,"l":"tune_voice_offsets","c":"Offsets of the three voices' SID registers from $D400: 00 07 0E (voice 0 at $D400, voice 1 at $D407, voice 2 at $D40E). Read by $A242, $A0EE, $A880 and $A8A6.","t":"byte","b":[0,7,14],"x":[41236,41550,43158,43204]},{"a":43393,"l":"tune_idle_program","c":"11 bytes, 00 FF 01 81 A9 FF 00 00 4C 86 A9. The first five are the idle wave program that $A126 gives every voice: command 0 with a wait of $FF frames, then command 1 jumping to its own start at $A981. The six after it, FF 00 00 4C 86 A9, end in a JMP to $A986 and are not read by the driver.","t":"byte","b":[0,255,1,129,169,255,0,0]},{"a":43401,"t":"byte","b":[76,134,169]},{"a":43404,"l":"tune_note_freq_lo","c":"Low bytes of the 94-entry table of SID frequency values, with the high bytes at $A9EA. The index is a note number plus the offsets $A08A and $A08D; it is looked up by $A242, $A4C4 and $A7C3. Entry 0 is $0578, entries 1 to 93 rise from $0128 to $EB00.","t":"byte","b":[120,40,58,76,96,117,139,163],"x":[41656,42204,42993]},{"a":43412,"t":"byte","b":[188,214,242,16,47,80,115,153]},{"a":43420,"t":"byte","b":[192,234,22,69,119,172,228,31]},{"a":43428,"t":"byte","b":[94,160,231,50,128,212,45,139]},{"a":43436,"t":"byte","b":[238,88,200,62,188,65,205,99]},{"a":43444,"t":"byte","b":[1,168,90,22,221,176,144,124]},{"a":43452,"t":"byte","b":[119,129,155,197,2,81,180,44]},{"a":43460,"t":"byte","b":[186,96,31,249,239,3,54,139]},{"a":43468,"t":"byte","b":[3,161,103,87,115,192,62,241]},{"a":43476,"t":"byte","b":[222,5,108,22,6,67,206,174]},{"a":43484,"t":"byte","b":[231,128,125,228,187,10,215,44]},{"a":43492,"t":"byte","b":[13,133,156,92,207,0]},{"a":43498,"l":"tune_note_freq_hi","c":"High bytes of the 94-entry table of SID frequency values (94 bytes); the low bytes are at $A98C. Entry 0 is $0578 and entry 93 is $EB00.","t":"byte","b":[5,1,1,1,1,1,1,1],"x":[41662,42210,42999]},{"a":43506,"t":"byte","b":[1,1,1,2,2,2,2,2]},{"a":43514,"t":"byte","b":[2,2,3,3,3,3,3,4]},{"a":43522,"t":"byte","b":[4,4,4,5,5,5,6,6]},{"a":43530,"t":"byte","b":[6,7,7,8,8,9,9,10]},{"a":43538,"t":"byte","b":[11,11,12,13,13,14,15,16]},{"a":43546,"t":"byte","b":[17,18,19,20,22,23,24,26]},{"a":43554,"t":"byte","b":[27,29,31,32,34,37,39,41]},{"a":43562,"t":"byte","b":[44,46,49,52,55,58,62,65]},{"a":43570,"t":"byte","b":[69,74,78,83,88,93,98,104]},{"a":43578,"t":"byte","b":[110,117,124,131,139,148,156,166]},{"a":43586,"t":"byte","b":[176,186,197,209,221,235]},{"a":43592,"l":"tune_drum_records","c":"3 records of 5 bytes, chosen by the offset after stream command $86 or $89 ($A666): list address (2 bytes), list length, sustain/release value and pulse width high byte. They are, by offset: 00: list $AA57 length $09 sustain/release $B8 pulse high $08; 05: list $AA69 length $0C sustain/release $D9 pulse high $08; 0A: list $AA81 length $06 sustain/release $98 pulse high $01.","t":"byte","b":[87,170,9,184,8,105,170,12],"x":[42612]},{"a":43600,"t":"byte","b":[217,8,129,170,6,152,1]},{"a":43607,"l":"tune_drum_lists","c":"The drum lists the records at $AA48 point to, 54 bytes. A list is a run of control register values for $D404 followed by a run of the same length of values that $A880 writes to both $D400 and $D401; a record's length is the length of each run. Lists may be shared by several records.","t":"byte","b":[9,129,65,16,16,16,16,16]},{"a":43615,"t":"byte","b":[16,0,128,7,13,7,6,5]},{"a":43623,"t":"byte","b":[3,2,9,129,64,128,128,128]},{"a":43631,"t":"byte","b":[128,128,128,128,240,240,0,255]},{"a":43639,"t":"byte","b":[16,238,190,189,188,187,186,185]},{"a":43647,"t":"byte","b":[184,183,9,129,65,16,16,16]},{"a":43655,"t":"byte","b":[0,255,37,32,28,24]},{"a":43661,"l":"tune_starts_table","c":"Tune table, 4 entries of 6 bytes, indexed by 6 times the tune number in X at $A164: for each voice the low and the high byte of the address of its track list, in the order voice 0 low, voice 0 high, voice 1 low, voice 1 high, voice 2 low, voice 2 high. The track list addresses of tunes 0 to 3 are: $ADAD/$ADA0/$ADB2; $AF5A/$AF93/$AFA6; $AEB8/$AEBC/$AEC0; $B10B/$B143/$B0F3. Level 1's title code starts tune 3 on entering the title pages (tune 1 instead when $110F says the last score made the table, and tune 3 again after the name is typed), and tune 0 when the briefing text is typed; nothing starts tune 2. Tune 3's lists are past $AFFF, where the sound driver's variables overwrite them in play; level 1's file holds them at $91A7, $91BF and $91F7.","t":"byte","b":[173,173,160,173,178,173,90,175],"x":[41330]},{"a":43669,"t":"byte","b":[147,175,166,175,184,174,188,174]},{"a":43677,"t":"byte","b":[192,174,11,177,67,177,243,176]},{"a":43685,"l":"tune_pattern_lo","c":"Low bytes of the addresses of the 81 patterns, indexed by the pattern number in a track list (a value below $F0 read by $A3FA). Numbers 3 to 5, 9 to 20, 24, 25 and 32 to 68 hold the address of a track list ($AEB8, $AF5A or $B0F3), not a pattern, and no track list of the four tunes names them. The high bytes are at $AAF6.","t":"byte","b":[202,75,180,184,184,184,133,162],"x":[42020]},{"a":43693,"t":"byte","b":[180,184,184,184,184,184,184,184]},{"a":43701,"t":"byte","b":[184,184,184,184,184,196,4,47]},{"a":43709,"t":"byte","b":[90,90,180,210,65,102,177,198]},{"a":43717,"t":"byte","b":[243,243,243,243,243,243,243,243]},{"a":43725,"t":"byte","b":[243,243,243,243,243,243,243,243]},{"a":43733,"t":"byte","b":[243,243,243,243,243,243,243,243]},{"a":43741,"t":"byte","b":[243,243,243,243,243,243,243,243]},{"a":43749,"t":"byte","b":[243,243,243,243,243,120,124,176]},{"a":43757,"t":"byte","b":[219,226,34,56,120,120,223,226]},{"a":43765,"t":"byte","b":[226]},{"a":43766,"l":"tune_pattern_hi","c":"High bytes of the addresses of the 81 patterns; the low bytes are at $AAA5. The addresses lie between $AD00 and $B2FF.","t":"byte","b":[173,174,174,174,174,174,174,174],"x":[42025]},{"a":43774,"t":"byte","b":[174,174,174,174,174,174,174,174]},{"a":43782,"t":"byte","b":[174,174,174,174,174,174,175,175]},{"a":43790,"t":"byte","b":[175,175,175,175,176,176,176,176]},{"a":43798,"t":"byte","b":[176,176,176,176,176,176,176,176]},{"a":43806,"t":"byte","b":[176,176,176,176,176,176,176,176]},{"a":43814,"t":"byte","b":[176,176,176,176,176,176,176,176]},{"a":43822,"t":"byte","b":[176,176,176,176,176,176,176,176]},{"a":43830,"t":"byte","b":[176,176,176,176,176,177,177,177]},{"a":43838,"t":"byte","b":[177,177,178,178,178,178,178,178]},{"a":43846,"t":"byte","b":[178]},{"a":43847,"l":"tune_pulse_table","c":"Pulse-width programs, 62 bytes, read by $A700. An entry is 3 bytes: a frame count, then a signed 16-bit amount that is added to the voice's pulse width on every frame of that count. A count of 0 takes the next byte as the index of the entry to carry on from. The pattern command $82 gives the index a note starts at. By start index: 0 holds the width for 255 frames and again; 5 adds 40 on each of 3 frames, then takes 40 off on each of 3, and repeats; 13 holds 2 frames, then adds 50 for 5 frames, takes off 100 for 5 and adds 50 for 5, repeating from index 16; 27 holds 5 frames, then adds 20 for 4 frames, takes off 40 for 4 and adds 20 for 4, repeating from index 30; 41 adds 60 on each of 255 frames and repeats; 46 adds 40 for 2 frames and takes off 40 for 1; 54 adds 10 for 184 frames and takes off 10 for 184. The four tunes start 5, 13, 27 and 41 and no other.","t":"byte","b":[255,0,0,0,0,3,40,0],"x":[42760,42766,42779,42786]},{"a":43855,"t":"byte","b":[3,216,255,0,5,2,0,0]},{"a":43863,"t":"byte","b":[5,50,0,5,156,255,5,50]},{"a":43871,"t":"byte","b":[0,0,16,5,0,0,4,20]},{"a":43879,"t":"byte","b":[0,4,216,255,4,20,0,0]},{"a":43887,"t":"byte","b":[30,255,60,0,0,41,2,40]},{"a":43895,"t":"byte","b":[0,1,216,255,0,46,184,10]},{"a":43903,"t":"byte","b":[0,184,246,255,0,54]},{"a":43909,"l":"tune_slide_table","c":"Pitch-slide programs, 85 bytes, read by $A74A while the table select $A032 is 0, which is always. Entries as in the pulse table: a frame count and a signed 16-bit amount added to the voice's frequency on each of those frames; a count of 0 takes the next byte as the index to carry on from. The pattern command $83 gives the start index. By start index: 0 holds for 255 frames and again; 5 waits 25 frames, then adds 28 for 3 frames, takes off 28 for 6 and adds 28 for 3, repeating from index 8 (a vibrato); 19 adds 6 for 1 frame, holds 24 and joins the vibrato at 8; 27 takes off 100 for 1 frame, adds 20 for 5, holds 19 and joins at 8; 38 adds 12 for 1 frame, holds 24 and joins at 8; 46 holds 2 frames, then adds 224 for 3, takes off 448 for 3 and adds 224 for 3, repeating from 49; 60 holds 2 frames, takes off 200 for 1, adds 25 for 8 and joins at 5; 71 holds 2 frames, then adds 36 for 3, takes off 72 for 3 and adds 36 for 3, repeating from 74. The tunes start 5, 19, 27, 38 and 71.","t":"byte","b":[255,0,0,0,0,25,0,0],"x":[42887,42893,42906,42913]},{"a":43917,"t":"byte","b":[3,28,0,6,228,255,3,28]},{"a":43925,"t":"byte","b":[0,0,8,1,6,0,24,0]},{"a":43933,"t":"byte","b":[0,0,8,1,156,255,5,20]},{"a":43941,"t":"byte","b":[0,19,0,0,0,8,1,12]},{"a":43949,"t":"byte","b":[0,24,0,0,0,8,2,0]},{"a":43957,"t":"byte","b":[0,3,224,0,3,64,254,3]},{"a":43965,"t":"byte","b":[224,0,0,49,2,0,0,1]},{"a":43973,"t":"byte","b":[56,255,8,25,0,0,5,2]},{"a":43981,"t":"byte","b":[0,0,3,36,0,3,184,255]},{"a":43989,"t":"byte","b":[3,36,0,0,74]},{"a":43994,"l":"tune_arpeggio_pointers","c":"Addresses of the 31 arpeggio lists, 2 bytes each, low byte first, from $AC18 to $ACD6. The pattern commands $84 and $8D give the list number n and $A60C reads the address at offset 2n. The tunes use lists 13, 14, 23, 24, 25, 27 and 28.","t":"byte","b":[24,172,32,172,40,172,48,172],"x":[42522,42844,42850,42863,42870]},{"a":44002,"t":"byte","b":[56,172,64,172,72,172,80,172]},{"a":44010,"t":"byte","b":[88,172,92,172,100,172,105,172]},{"a":44018,"t":"byte","b":[113,172,121,172,126,172,131,172]},{"a":44026,"t":"byte","b":[137,172,143,172,149,172,154,172]},{"a":44034,"t":"byte","b":[160,172,168,172,172,172,176,172]},{"a":44042,"t":"byte","b":[182,172,188,172,194,172,199,172]},{"a":44050,"t":"byte","b":[204,172,209,172,214,172]},{"a":44056,"l":"tune_arpeggio_lists_0","c":"Arpeggio lists 0 to 15, read by $A7C3. A list is a frame count per step, the number of steps, and then one semitone offset for each step, added to the note number as the steps go round. Numbers, addresses, frames per step and offsets: 0 $AC18: 2 frames, 0 5 7 12 17 19; 1 $AC20: 2 frames, 0 5 8 12 17 20; 2 $AC28: 2 frames, 0 2 7 12 14 19; 3 $AC30: 3 frames, 0 5 7 12 17 19; 4 $AC38: 3 frames, 0 5 8 12 17 20; 5 $AC40: 3 frames, 0 2 7 12 14 19; 6 $AC48: 2 frames, 0 5 7 12 17 19; 7 $AC50: 2 frames, 0 2 7 12 14 19; 8 $AC58: 1 frame, 0 0; 9 $AC5C: 2 frames, 0 5 7 12 17 19; 10 $AC64: 2 frames, 12 0 0; 11 $AC69: 2 frames, 0 3 7 12 15 19; 12 $AC71: 2 frames, 0 4 7 12 16 19; 13 $AC79: 3 frames, 0 5 12; 14 $AC7E: 3 frames, 0 3 12; 15 $AC83: 2 frames, 0 2 7 12.","t":"byte","b":[2,6,0,5,7,12,17,19]},{"a":44064,"t":"byte","b":[2,6,0,5,8,12,17,20]},{"a":44072,"t":"byte","b":[2,6,0,2,7,12,14,19]},{"a":44080,"t":"byte","b":[3,6,0,5,7,12,17,19]},{"a":44088,"t":"byte","b":[3,6,0,5,8,12,17,20]},{"a":44096,"t":"byte","b":[3,6,0,2,7,12,14,19]},{"a":44104,"t":"byte","b":[2,6,0,5,7,12,17,19]},{"a":44112,"t":"byte","b":[2,6,0,2,7,12,14,19]},{"a":44120,"t":"byte","b":[1,2,0,0,2,6,0,5]},{"a":44128,"t":"byte","b":[7,12,17,19,2,3,12,0]},{"a":44136,"t":"byte","b":[0,2,6,0,3,7,12,15]},{"a":44144,"t":"byte","b":[19,2,6,0,4,7,12,16]},{"a":44152,"t":"byte","b":[19,3,3,0,5,12,3,3]},{"a":44160,"t":"byte","b":[0,3,12,2,4,0,2,7]},{"a":44168,"t":"byte","b":[12]},{"a":44169,"l":"tune_arpeggio_lists_1","c":"Arpeggio lists 16 to 30, in the same layout as the lists before them (frames per step, number of steps, then the semitone offsets): 16 $AC89: 1 frame, 0 3 8 12; 17 $AC8F: 1 frame, 0 5 9 12; 18 $AC95: 1 frame, 24 12 0; 19 $AC9A: 2 frames, 0 4 5 9; 20 $ACA0: 1 frame, 0 2 3 8 12 20; 21 $ACA8: 1 frame, 12 0; 22 $ACAC: 2 frames, 0 12; 23 $ACB0: 3 frames, 0 5 8 12; 24 $ACB6: 3 frames, 0 5 7 12; 25 $ACBC: 3 frames, 0 4 7 12; 26 $ACC2: 1 frame, 0 5 9; 27 $ACC7: 1 frame, 12 4 0; 28 $ACCC: 1 frame, 12 3 0; 29 $ACD1: 1 frame, 0 4 9; 30 $ACD6: 1 frame, 0 3 7.","t":"byte","b":[1,4,0,3,8,12,1,4]},{"a":44177,"t":"byte","b":[0,5,9,12,1,3,24,12]},{"a":44185,"t":"byte","b":[0,2,4,0,4,5,9,1]},{"a":44193,"t":"byte","b":[6,0,2,3,8,12,20,1]},{"a":44201,"t":"byte","b":[2,12,0,2,2,0,12,3]},{"a":44209,"t":"byte","b":[4,0,5,8,12,3,4,0]},{"a":44217,"t":"byte","b":[5,7,12,3,4,0,4,7]},{"a":44225,"t":"byte","b":[12,1,3,0,5,9,1,3]},{"a":44233,"t":"byte","b":[12,4,0,1,3,12,3,0]},{"a":44241,"t":"byte","b":[1,3,0,4,9,1,3,0]},{"a":44249,"t":"byte","b":[3,7]},{"a":44251,"l":"tune_filter_sweep_table","c":"Filter-sweep programs, 28 bytes, read by $A810. An entry is a frame count and a signed 16-bit amount added to the 16-bit filter value on each of those frames; a count of 0 takes the next byte as the index to carry on from. The pattern command $85 gives the start index. By start index: 0 holds for 255 frames and again; 5 takes off 85 on each of 12 frames, then holds; 10 takes off 100 on each of 8 frames, then holds; 15 adds 10 for 96 frames and takes off 10 for 96, repeating; 23 takes off 250 on each of 6 frames, then holds. The tunes start 5 (tune 0), 10 (tunes 1 and 3) and 23 (tune 2).","t":"byte","b":[255,0,0,0,0,12,171,255],"x":[43056,43062,43075,43082]},{"a":44259,"t":"byte","b":[0,0,8,156,255,0,0,96]},{"a":44267,"t":"byte","b":[10,0,96,246,255,0,15,6]},{"a":44275,"t":"byte","b":[6,255,0,0]},{"a":44279,"l":"tune_wave_program_table","c":"Addresses of the 11 wave programs, 2 bytes each, low byte first: 0 $AD0D, 1 $AD19, 2 $AD26, 3 $AD32, 4 $AD41, 5 $AD50, 6 $AD60, 7 $AD6C, 8 $AD78, 9 $AD84, 10 $AD90. The pattern command $81 gives the program number n and $A5BB reads the address at offset 2n. A program is a run of steps, each a command number and its parameters: 0 waits (frames), 1 jumps (address), 2 sets the envelope (attack/decay, sustain/release), 3 writes the control register and waits (control, frames), 4 writes it and waits until some frames before the note ends (control, frames), 5 writes it, waits and plays the note at an offset for those frames (control, frames, semitones).","t":"byte","b":[13,173,25,173,38,173,50,173],"x":[42442]},{"a":44287,"t":"byte","b":[65,173,80,173,96,173,108,173]},{"a":44295,"t":"byte","b":[120,173,132,173,144,173]},{"a":44301,"l":"tune_wave_program_0","c":"Wave program 0, 12 bytes, used by tune 0. It sets attack/decay $00 and sustain/release $76 (attack 0, decay 0, sustain 7, release 6); then writes $41 (pulse, gate on) and waits 2 frames; then writes $20 (sawtooth, gate off) and waits 255 frames; then jumps to $AD13.","t":"byte","b":[2,0,118,3,65,2,3,32]},{"a":44309,"t":"byte","b":[255,1,19,173]},{"a":44313,"l":"tune_wave_program_1","c":"Wave program 1, 13 bytes, used by tune 0. It sets attack/decay $01 and sustain/release $7A (attack 0, decay 1, sustain 7, release 10); then writes $41 (pulse, gate on), plays the note +12 semitones for 2 frames, then at its pitch; then writes $40 (pulse, gate off) and waits 255 frames; then jumps to $AD20.","t":"byte","b":[2,1,122,5,65,2,12,3]},{"a":44321,"t":"byte","b":[64,255,1,32,173]},{"a":44326,"l":"tune_wave_program_2","c":"Wave program 2, 12 bytes, used by tune 2. It sets attack/decay $03 and sustain/release $4A (attack 0, decay 3, sustain 4, release 10); then writes $41 (pulse, gate on) and waits until 1 frame before the note ends; then writes $40 (pulse, gate off) and waits 255 frames; then jumps to $AD2C.","t":"byte","b":[2,3,74,4,65,1,3,64]},{"a":44334,"t":"byte","b":[255,1,44,173]},{"a":44338,"l":"tune_wave_program_3","c":"Wave program 3, 15 bytes, used by tune 2. It sets attack/decay $01 and sustain/release $AA (attack 0, decay 1, sustain 10, release 10); then writes $51 (pulse+triangle, gate on) and waits 1 frame; then writes $41 (pulse, gate on) and waits 1 frame; then writes $40 (pulse, gate off) and waits 255 frames; then jumps to $AD20.","t":"byte","b":[2,1,170,3,81,1,3,65]},{"a":44346,"t":"byte","b":[1,3,64,255,1,32,173]},{"a":44353,"l":"tune_wave_program_4","c":"Wave program 4, 15 bytes, used by tune 1. It sets attack/decay $03 and sustain/release $5A (attack 0, decay 3, sustain 5, release 10); then writes $21 (sawtooth, gate on) and waits 2 frames; then writes $41 (pulse, gate on) and waits 2 frames; then writes $20 (sawtooth, gate off) and waits 255 frames; then jumps to $AD20.","t":"byte","b":[2,3,90,3,33,2,3,65]},{"a":44361,"t":"byte","b":[2,3,32,255,1,32,173]},{"a":44368,"l":"tune_wave_program_5","c":"Wave program 5, 16 bytes, used by tune 1. It sets attack/decay $02 and sustain/release $A9 (attack 0, decay 2, sustain 10, release 9); then writes $41 (pulse, gate on), plays the note -12 semitones for 1 frame, then at its pitch; then writes $41 (pulse, gate on) and waits 1 frame; then writes $40 (pulse, gate off) and waits 255 frames; then jumps to $AD20.","t":"byte","b":[2,2,169,5,65,1,244,3]},{"a":44376,"t":"byte","b":[65,1,3,64,255,1,32,173]},{"a":44384,"l":"tune_wave_program_6","c":"Wave program 6, 12 bytes, used by tune 1. It sets attack/decay $03 and sustain/release $5E (attack 0, decay 3, sustain 5, release 14); then writes $21 (sawtooth, gate on) and waits 3 frames; then writes $40 (pulse, gate off) and waits 255 frames; then jumps to $AD2C.","t":"byte","b":[2,3,94,3,33,3,3,64]},{"a":44392,"t":"byte","b":[255,1,44,173]},{"a":44396,"l":"tune_wave_program_7","c":"Wave program 7, 12 bytes, used by tune 3. It sets attack/decay $14 and sustain/release $68 (attack 1, decay 4, sustain 6, release 8); then writes $41 (pulse, gate on) and waits until 1 frame before the note ends; then writes $40 (pulse, gate off) and waits 255 frames; then jumps to $AD2C.","t":"byte","b":[2,20,104,4,65,1,3,64]},{"a":44404,"t":"byte","b":[255,1,44,173]},{"a":44408,"l":"tune_wave_program_8","c":"Wave program 8, 12 bytes, used by tune 3. It sets attack/decay $01 and sustain/release $48 (attack 0, decay 1, sustain 4, release 8); then writes $41 (pulse, gate on) and waits 3 frames; then writes $60 (pulse+sawtooth, gate off) and waits 255 frames; then jumps to $AD13.","t":"byte","b":[2,1,72,3,65,3,3,96]},{"a":44416,"t":"byte","b":[255,1,19,173]},{"a":44420,"l":"tune_wave_program_9","c":"Wave program 9, 12 bytes, used by tune 3. It sets attack/decay $02 and sustain/release $A9 (attack 0, decay 2, sustain 10, release 9); then writes $41 (pulse, gate on) and waits 3 frames; then writes $20 (sawtooth, gate off) and waits 255 frames; then jumps to $AD8A.","t":"byte","b":[2,2,169,3,65,3,3,32]},{"a":44428,"t":"byte","b":[255,1,138,173]},{"a":44432,"l":"tune_wave_program_10","c":"Wave program 10, 16 bytes, used by tune 3. It sets attack/decay $02 and sustain/release $98 (attack 0, decay 2, sustain 9, release 8); then writes $41 (pulse, gate on), plays the note +12 semitones for 2 frames, then at its pitch; then writes $41 (pulse, gate on) and waits until 1 frame before the note ends; then writes $40 (pulse, gate off) and waits 255 frames; then jumps to $AD20.","t":"byte","b":[2,2,152,5,65,2,12,4]},{"a":44440,"t":"byte","b":[65,1,3,64,255,1,32,173]},{"a":44448,"l":"tune_0_voice_1_track","c":"Track list of tune 0, voice 1 (SID voice 2), 13 bytes, read by $A3FA. Entries by offset: 0: fades the volume in at rate 12 to 15; 3: pattern 0, 4 times; 6: pattern 0, 4 times, transposed -1; 11: jumps back to offset 3. A pattern number is looked up in the pattern tables at $AAA5 and $AAF6.","t":"byte","b":[245,12,15,241,4,0,243,255]},{"a":44456,"t":"byte","b":[241,4,0,240,3]},{"a":44461,"l":"tune_0_voice_0_track","c":"Track list of tune 0, voice 0 (SID voice 1), 5 bytes, read by $A3FA. Entries by offset: 0: pattern 6, 8 times; 3: jumps back to offset 0. A pattern number is looked up in the pattern tables at $AAA5 and $AAF6.","t":"byte","b":[241,8,6,240,0]},{"a":44466,"l":"tune_0_voice_2_track","c":"Track list of tune 0, voice 2 (SID voice 3), 24 bytes, read by $A3FA. Entries by offset: 0: pattern 1; 1: pattern 1, transposed -5; 4: pattern 1, transposed -7; 7: pattern 1, transposed -5; 10: pattern 1, transposed -1; 13: pattern 1, transposed -6; 16: pattern 1, transposed -8; 19: pattern 1, transposed -6; 22: jumps back to offset 0. A pattern number is looked up in the pattern tables at $AAA5 and $AAF6.","t":"byte","b":[1,243,251,1,243,249,1,243]},{"a":44474,"t":"byte","b":[251,1,243,255,1,243,250,1]},{"a":44482,"t":"byte","b":[243,248,1,243,250,1,240,0]},{"a":44490,"l":"tune_pattern_0","c":"Pattern 0, 129 bytes, 240 frames, 40 notes. Tune 0 plays it on voice 1, four times and then four times transposed by -1, over and over. Fixed note length of 6 frames ($87), wave program 0, pulse width $0400 with pulse program 5. The notes go A3, C4, B3, C4 ten times; each A3 or B3 starts arpeggio list 28 (the octave above, a minor third above, the note itself, a step every frame) and each C4 list 27 (the same with a major third).","t":"byte","b":[135,6,129,0,130,5,4,0]},{"a":44498,"t":"byte","b":[132,28,45,132,27,48,132,28]},{"a":44506,"t":"byte","b":[47,132,27,48,132,28,45,132]},{"a":44514,"t":"byte","b":[27,48,132,28,47,132,27,48]},{"a":44522,"t":"byte","b":[132,28,45,132,27,48,132,28]},{"a":44530,"t":"byte","b":[47,132,27,48,132,28,45,132]},{"a":44538,"t":"byte","b":[27,48,132,28,47,132,27,48]},{"a":44546,"t":"byte","b":[132,28,45,132,27,48,132,28]},{"a":44554,"t":"byte","b":[47,132,27,48,132,28,45,132]},{"a":44562,"t":"byte","b":[27,48,132,28,47,132,27,48]},{"a":44570,"t":"byte","b":[132,28,45,132,27,48,132,28]},{"a":44578,"t":"byte","b":[47,132,27,48,132,28,45,132]},{"a":44586,"t":"byte","b":[27,48,132,28,47,132,27,48]},{"a":44594,"t":"byte","b":[132,28,45,132,27,48,132,28]},{"a":44602,"t":"byte","b":[47,132,27,48,132,28,45,132]},{"a":44610,"t":"byte","b":[27,48,132,28,47,132,27,48]},{"a":44618,"t":"byte","b":[128]},{"a":44619,"l":"tune_pattern_1","c":"Pattern 1, 58 bytes, 240 frames, 11 notes. Tune 0 plays it on voice 2, eight times in a row with a transposition that changes between plays. Wave program 1, pulse width $0800 with pulse program 13, and a filter sweep from index 5 with start value $0420 and control $85 (resonance 8, SID voices 1 and 3 through the filter). Nine of the notes are A2, and the last two are C3 and D3; the rest of the 240 frames is rests.","t":"byte","b":[129,1,130,13,8,0,133,5]},{"a":44627,"t":"byte","b":[4,32,133,33,12,96,24,33]},{"a":44635,"t":"byte","b":[12,96,12,33,6,96,6,96]},{"a":44643,"t":"byte","b":[12,33,6,96,6,33,12,96]},{"a":44651,"t":"byte","b":[12,33,12,96,24,33,12,96]},{"a":44659,"t":"byte","b":[12,33,6,96,6,33,12,96]},{"a":44667,"t":"byte","b":[12,36,9,96,3,38,9,96]},{"a":44675,"t":"byte","b":[3,128]},{"a":44677,"l":"tune_pattern_6","c":"Pattern 6, 29 bytes, 240 frames, no notes. Tune 0 plays it on voice 0, eight times, over and over. Free note length, then nine drum commands ($86): six with drum record 0 and three with record 5 (offsets into the table at $AA48), each lasting 12, 24 or 36 frames.","t":"byte","b":[136,134,0,36,134,5,36,134]},{"a":44685,"t":"byte","b":[0,24,134,0,36,134,0,24]},{"a":44693,"t":"byte","b":[134,5,36,134,0,24,134,5]},{"a":44701,"t":"byte","b":[12,134,0,12,128]},{"a":44706,"l":"tune_pattern_7","c":"Pattern 7, 18 bytes, 240 frames, 3 notes. Free note length: a rest of 120 frames and one of 24, then C3, B2 and G2 for 12, 12 and 18 frames with rests of 12, 12 and 30 after them. No track list of the four tunes names pattern 7.","t":"byte","b":[136,96,120,96,24,36,12,96]},{"a":44714,"t":"byte","b":[12,35,12,96,12,31,18,96]},{"a":44722,"t":"byte","b":[30,128]},{"a":44724,"l":"tune_pattern_2","c":"Patterns 2 and 8, 4 bytes, 96 frames: free note length and one rest of 96 frames. Tune 1 plays pattern 2 four times on voice 1 and eight times on voice 2 as an opening rest; no track list names pattern 8.","t":"byte","b":[136,96,96,128]},{"a":44728,"l":"tune_2_voice_0_track","c":"Track list of tune 2, voice 0 (SID voice 1), 4 bytes, read by $A3FA. Entries by offset: 0: pattern 22, transposed +24; 3: stops the voice. A pattern number is looked up in the pattern tables at $AAA5 and $AAF6.","t":"byte","b":[243,24,22,242]},{"a":44732,"l":"tune_2_voice_1_track","c":"Track list of tune 2, voice 1 (SID voice 2), 4 bytes, read by $A3FA. Entries by offset: 0: pattern 23, transposed +24; 3: stops the voice. A pattern number is looked up in the pattern tables at $AAA5 and $AAF6.","t":"byte","b":[243,24,23,242]},{"a":44736,"l":"tune_2_voice_2_track","c":"Track list of tune 2, voice 2 (SID voice 3), 4 bytes, read by $A3FA. Entries by offset: 0: pattern 21, transposed +12; 3: stops the voice. A pattern number is looked up in the pattern tables at $AAA5 and $AAF6.","t":"byte","b":[243,12,21,242]},{"a":44740,"l":"tune_pattern_21","c":"Pattern 21, 64 bytes, 384 frames, 22 notes. Tune 2 plays it on voice 2 with a transposition of 12. Wave program 3, pulse width $0600 with pulse program 41, and a filter sweep from index 23 with start value $0610 and control $84 (resonance 8, SID voice 3 through the filter). The notes are C#1, C#1, B0 and C#1 with a rest of 36 frames, then G#0 and B0; that bar three times, then the first four notes once more with a rest of 48.","t":"byte","b":[129,3,130,41,6,0,133,23]},{"a":44748,"t":"byte","b":[6,16,132,13,12,13,12,11]},{"a":44756,"t":"byte","b":[12,13,12,96,36,8,6,11]},{"a":44764,"t":"byte","b":[6,13,12,13,12,11,12,13]},{"a":44772,"t":"byte","b":[12,96,36,8,6,11,6,13]},{"a":44780,"t":"byte","b":[12,13,12,11,12,13,12,96]},{"a":44788,"t":"byte","b":[36,8,6,11,6,13,12,13]},{"a":44796,"t":"byte","b":[12,11,12,13,12,96,48,128]},{"a":44804,"l":"tune_pattern_22","c":"Pattern 22, 43 bytes, 456 frames, 11 notes. Tune 2 plays it on voice 0 with a transposition of 24. Wave program 2, pulse width $0600 with pulse program 27, pitch slide 27 for the first note and slide 5 for the rest. The notes, before the transposition: C#3, G#2, A#2 B2 A#2, G#2, F#2, D#2 E2 D#2, then C#2 held for 192 frames and a rest of 72.","t":"byte","b":[129,2,130,27,6,0,131,27]},{"a":44812,"t":"byte","b":[37,30,96,6,131,5,32,30]},{"a":44820,"t":"byte","b":[96,6,34,12,35,6,34,6]},{"a":44828,"t":"byte","b":[32,30,96,6,30,30,96,6]},{"a":44836,"t":"byte","b":[27,12,28,6,27,6,25,192]},{"a":44844,"t":"byte","b":[96,72,128]},{"a":44847,"l":"tune_pattern_23","c":"Pattern 23, 43 bytes, 455 frames, 11 notes. Tune 2 plays it on voice 1 with a transposition of 24, the melody of pattern 22 one frame later: wave program 2, pulse width $0640 with pulse program 27, a rest of 1 frame, pitch slide 19, and a last note two frames shorter than pattern 22's.","t":"byte","b":[129,2,130,27,6,64,96,1]},{"a":44855,"t":"byte","b":[131,19,37,30,96,6,32,30]},{"a":44863,"t":"byte","b":[96,6,34,12,35,6,34,6]},{"a":44871,"t":"byte","b":[32,30,96,6,30,30,96,6]},{"a":44879,"t":"byte","b":[27,12,28,6,27,6,25,190]},{"a":44887,"t":"byte","b":[96,72,128]},{"a":44890,"l":"tune_1_voice_0_track","c":"Track list of tune 1, voice 0 (SID voice 1), 57 bytes, read by $A3FA. Entries by offset: 0: fades the volume in at rate 20 to 15; 3: pattern 26, 4 times, transposed -3; 8: pattern 26, 4 times, transposed -3; 13: pattern 26, 2 times, transposed -3; 18: pattern 26, 2 times, transposed -7; 23: pattern 26, transposed -8; 26: pattern 26, transposed -5; 29: pattern 26, 2 times, transposed -3; 34: pattern 26, 2 times, transposed -7; 39: pattern 26, transposed -8; 42: pattern 26, transposed -5; 45: pattern 26, 2 times, transposed -2; 50: pattern 26, 2 times, transposed -7; 55: jumps back to offset 29. A pattern number is looked up in the pattern tables at $AAA5 and $AAF6.","t":"byte","b":[245,20,15,241,4,243,253,26]},{"a":44898,"t":"byte","b":[241,4,243,253,26,241,2,243]},{"a":44906,"t":"byte","b":[253,26,241,2,243,249,26,243]},{"a":44914,"t":"byte","b":[248,26,243,251,26,241,2,243]},{"a":44922,"t":"byte","b":[253,26,241,2,243,249,26,243]},{"a":44930,"t":"byte","b":[248,26,243,251,26,241,2,243]},{"a":44938,"t":"byte","b":[254,26,241,2,243,249,26,240]},{"a":44946,"t":"byte","b":[29]},{"a":44947,"l":"tune_1_voice_1_track","c":"Track list of tune 1, voice 1 (SID voice 2), 19 bytes, read by $A3FA. Entries by offset: 0: pattern 2, 4 times; 3: pattern 31, 2 times, transposed +33; 8: pattern 27, transposed +33; 11: pattern 27, transposed +33; 14: pattern 29, transposed +33; 17: jumps back to offset 11. A pattern number is looked up in the pattern tables at $AAA5 and $AAF6.","t":"byte","b":[241,4,2,241,2,243,33,31]},{"a":44955,"t":"byte","b":[243,33,27,243,33,27,243,33]},{"a":44963,"t":"byte","b":[29,240,11]},{"a":44966,"l":"tune_1_voice_2_track","c":"Track list of tune 1, voice 2 (SID voice 3), 14 bytes, read by $A3FA. Entries by offset: 0: pattern 2, 8 times; 3: pattern 28, transposed +9; 6: pattern 28, transposed +9; 9: pattern 30, transposed +9; 12: jumps back to offset 6. A pattern number is looked up in the pattern tables at $AAA5 and $AAF6.","t":"byte","b":[241,8,2,243,9,28,243,9]},{"a":44974,"t":"byte","b":[28,243,9,30,240,6]},{"a":44980,"l":"tune_pattern_26","c":"Pattern 26, 30 bytes, 96 frames, 9 notes. Tune 1 plays it on voice 0 under a changing transposition. Wave program 5, pulse width $0800 with pulse program 41, and a filter sweep from index 10 with start value $0360 and control $D1 (resonance 13, SID voice 1 through the filter). Every note is G2: 18, 6, 6, 6, 18, 6, 12, 12 and 12 frames.","t":"byte","b":[129,5,130,41,8,0,133,10]},{"a":44988,"t":"byte","b":[3,96,209,31,18,31,6,31]},{"a":44996,"t":"byte","b":[6,31,6,31,18,31,6,31]},{"a":45004,"t":"byte","b":[12,31,12,31,12,128]},{"a":45010,"l":"tune_pattern_27","c":"The first 46 bytes of pattern 27, the rest of which lies past $AFFF in the file and is overwritten in play by the sound driver's variables. The whole pattern is 111 bytes and 576 frames: arpeggio list 13, then a bar of nine notes (18, 6, 6, 6, 18, 6, 12, 12 and 12 frames) six times, on D2 for two bars, A#1 for two, A1 for one and G1 for one. Tune 1 plays it on voice 1, transposed by 33, at offsets 8 and 11 of that voice's track list.","t":"byte","b":[132,13,26,18,26,6,26,6]},{"a":45018,"t":"byte","b":[26,6,26,18,26,6,26,12]},{"a":45026,"t":"byte","b":[26,12,26,12,26,18,26,6]},{"a":45034,"t":"byte","b":[26,6,26,6,26,18,26,6]},{"a":45042,"t":"byte","b":[26,12,26,12,26,12,22,18]},{"a":45050,"t":"byte","b":[22,6,22,6,22,6]},{"a":45056,"l":"driver_flag","c":"Driver flag. $B0C8 sets it to $1F. $B0EE returns at once while it is zero, and $B7B6 clears a voice's registers $D404-$D406 at the end of a drum list only while it is non-zero.","t":"byte","b":[31],"x":[45272,45294,47045]},{"a":45057,"l":"hold_flag","c":"While non-zero, $B176 returns at once and touches no voice. Nothing in this driver's own code writes it.","t":"byte","b":[0],"x":[45430]},{"a":45058,"l":"voice_scratch","c":"Scratch byte: $B501 keeps twice the wave-program number here, and $B7DC keeps the voice number here while it writes a drum step.","t":"byte","b":[2],"x":[46341,46349,47068,47124]},{"a":45059,"l":"step_scratch","c":"Scratch byte: $B7DC keeps the drum step number here while it writes the step to the chip.","t":"byte","b":[11],"x":[47071,47101]},{"a":45060,"l":"note_countdown","c":"Frames left in the current note of each of the three voices (3 bytes). $B23B counts it down and reads the next stream entry at zero; $B25C reloads it from the entry's length byte (or from $B007 in fixed-length mode), the drum command sets it from the byte after the drum number, and $B138 starts it at the voice number plus 1.","t":"byte","b":[0,1,2],"x":[45376,45627,45838,46243,46589]},{"a":45063,"l":"fixed_length","c":"Note length of each voice (3 bytes) as set by stream command $87. $B25C uses it instead of a length byte after each note while the voice's flag in $B087 is non-zero.","t":"byte","b":[0,0,0],"x":[45829,46483]},{"a":45066,"l":"wave_countdown","c":"Frames until each voice's wave program takes its next step (3 bytes). $B3F8 counts it down and runs the step at zero; a new note sets it to 1 and the wave-program commands set it to the wait they read.","t":"byte","b":[0,255,255],"x":[45699,46072,46152,46217,46249,46271]},{"a":45069,"l":"pulse_countdown","c":"Frames left in each voice's current pulse-width step (3 bytes). $B64E counts it down and fetches the next step from the table at $B9E4 at zero; a new note sets it to 1 unless the mask $02 is set in the voice's byte in $B0C4.","t":"byte","b":[0,3,243],"x":[45723,46670,46693]},{"a":45072,"l":"slide_countdown","c":"Frames left in each voice's current pitch-slide step (3 bytes), counted down by $B698. A new note sets it to 1 when the voice has a slide and the mask $01 is clear in its byte in $B0C4.","t":"byte","b":[0,244,244],"x":[45758,46749,46777,46820]},{"a":45075,"l":"filter_countdown","c":"Frames left in the current filter-sweep step, counted down by $B75E. Notes of a voice with the filter on, the filter command $B618 and the drum command $B5AC set it to 1.","t":"byte","b":[181],"x":[45821,46612,46942,46965]},{"a":45076,"l":"track_index","c":"Position in each voice's track list (3 bytes), the offset from the list address $B01A/$B01D. $B32E reads the entry at that position and the track commands change it. The 3 bytes after it, $B017-$B019, are not used by the driver.","t":"byte","b":[0,0,0,0,0,0],"x":[45902,45935,45960,45972,45975,46004,46007,46025,46028,46060,46063,46066]},{"a":45082,"l":"track_lo","c":"Low byte of the address of each voice's track list (3 bytes), loaded into $F2 by $B32E. Nothing in the driver's code writes it; it is 0 in the snapshot.","t":"byte","b":[0,0,0],"x":[45872]},{"a":45085,"l":"track_hi","c":"High byte of the address of each voice's track list (3 bytes), loaded into $F3 by $B32E. Nothing in the driver's code writes it.","t":"byte","b":[0,0,0],"x":[45877]},{"a":45088,"l":"wave_ptr_lo","c":"Low byte of the address of each voice's wave program step (3 bytes), the list of SID control-register values and waits that $B3F8 runs. $B4ED stores the advanced pointer here; a new note copies it from $B023, and $B138 sets it to the idle program at $B8B7.","t":"byte","b":[183,185,185],"x":[45410,45705,46108,46326]},{"a":45091,"l":"wave_start_lo","c":"Low byte of the start of each voice's wave program (3 bytes): $B501 sets it from the table at $BA7C, and a new note copies it to $B020 unless the mask $04 is set in the voice's byte in $B0C4.","t":"byte","b":[183,183,183],"x":[45413,45702,46355]},{"a":45094,"l":"wave_ptr_hi","c":"High byte of the address of each voice's wave program step (3 bytes); see $B020. A new note copies it from $B029.","t":"byte","b":[184,184,184],"x":[45418,45711,46113,46333]},{"a":45097,"l":"wave_start_hi","c":"High byte of the start of each voice's wave program (3 bytes); see $B023.","t":"byte","b":[184,184,184],"x":[45421,45708,46361]},{"a":45100,"l":"pulse_index","c":"Index of each voice into the pulse-width table at $B9E4 (3 bytes): $B64E reads the step there and moves it on by 3, or to the index that follows a zero count. A new note copies it from $B02F.","t":"byte","b":[0,14,3],"x":[45729,46675,46687,46712]},{"a":45103,"l":"pulse_start","c":"Start index of each voice into the pulse-width table (3 bytes), set by stream command $82 and cleared by $B0C8 and $B138. A new note copies it to $B02C.","t":"byte","b":[0,0,0],"x":[45287,45426,45726,46370]},{"a":45106,"l":"slide_table_select","c":"Selects each voice's pitch-slide table (3 bytes): $B698 uses the table at $BA07 while it is zero and the one at $BA5B otherwise. Only $B539 and $B138 write it, and only with zero.","t":"byte","b":[0,0,0],"x":[46409,46754]},{"a":45109,"l":"slide_index","c":"Index of each voice into its pitch-slide table (3 bytes), moved on by 3 per step by $B698 and copied from $B038 at a new note.","t":"byte","b":[0,8,8],"x":[45764,46759,46771,46796,46802,46814,46839]},{"a":45112,"l":"slide_start","c":"Start index of each voice's pitch-slide program (3 bytes), set by stream command $83 and copied to $B035 at a new note.","t":"byte","b":[0,5,5],"x":[45761,46396]},{"a":45115,"l":"arp_ptr_lo","c":"Low byte of the address of each voice's arpeggio steps (3 bytes), set by stream command $84 to the address of the entry's step list (two bytes after its header). $B711 reads through it. The 3 bytes after it, $B03E-$B040, are not used by the driver.","t":"byte","b":[0,0,0,0,0,0],"x":[46467,46876]},{"a":45121,"l":"arp_ptr_hi","c":"High byte of the address of each voice's arpeggio steps (3 bytes); see $B03B. The 3 bytes after it, $B044-$B046, are not used by the driver.","t":"byte","b":[0,0,0,0,0,0],"x":[46474,46881]},{"a":45127,"l":"filter_start","c":"Start index into the filter-sweep table at $BA62, set by stream command $85 and copied to $B048 at a new note of a voice with the filter on.","t":"byte","b":[0],"x":[45801,46592,46619]},{"a":45128,"l":"filter_index","c":"Current index into the filter-sweep table at $BA62, moved on by 3 per step by $B75E.","t":"byte","b":[3],"x":[45804,46595,46947,46959,46983]},{"a":45129,"l":"filter_step_lo","c":"Low byte of the amount $B75E adds to the filter value $B04E each frame, read from the sweep table.","t":"byte","b":[0],"x":[46972,46990]},{"a":45130,"l":"filter_step_hi","c":"High byte of the amount $B75E adds to the filter value $B04D each frame, read from the sweep table.","t":"byte","b":[0],"x":[46979,47007]},{"a":45131,"l":"filter_start_hi","c":"High byte of the filter value a sweep starts from, set by stream command $85 and copied to $B04D when a sweep restarts.","t":"byte","b":[0],"x":[45807,46598,46625]},{"a":45132,"l":"filter_start_lo","c":"Low byte of the filter value a sweep starts from, set by stream command $85 and copied to $B04E when a sweep restarts.","t":"byte","b":[0],"x":[45813,46604,46634]},{"a":45133,"l":"filter_hi","c":"High byte of the 16-bit filter value that $B75E sweeps; its bits are shifted through $B0B7 to make the byte written to the filter cut-off register $D416.","t":"byte","b":[0],"x":[45810,46601,46628,47004,47010]},{"a":45134,"l":"filter_lo","c":"Low byte of the 16-bit filter value that $B75E sweeps; its low three bits go to the cut-off low register $D415.","t":"byte","b":[0],"x":[45816,46607,46637,46986,46993]},{"a":45135,"l":"drum_ctrl_lo","c":"Low byte of the address of each voice's drum control-value list (3 bytes), set by $B5AC from the record in the table at $B97E and patched into the operand at $B80F by $B7DC.","t":"byte","b":[156,0,0],"x":[46525,47086]},{"a":45138,"l":"drum_freq_lo","c":"Low byte of the address of each voice's drum frequency list (3 bytes): the control list address plus the list length, set by $B5AC and patched into the operand at $B801.","t":"byte","b":[168,0,0],"x":[46532,47074]},{"a":45141,"l":"drum_ctrl_hi","c":"High byte of the address of each voice's drum control-value list (3 bytes); see $B04F.","t":"byte","b":[185,0,0],"x":[46538,47092]},{"a":45144,"l":"drum_freq_hi","c":"High byte of the address of each voice's drum frequency list (3 bytes); see $B052.","t":"byte","b":[185,0,0],"x":[46543,47080]},{"a":45147,"l":"stream_lo","c":"Low byte of the address of the stream each voice is playing (3 bytes). $B23B loads it into $F0 and stores $F0 back, and stream command $8B replaces it. $B0EE sets it from the table at $BB74.","t":"byte","b":[152,156,167],"x":[45314,45633,45651,47213]},{"a":45150,"l":"stream_hi","c":"High byte of the address of the stream each voice is playing (3 bytes); see $B05B.","t":"byte","b":[187,187,187],"x":[45320,45638,45656,47219]},{"a":45153,"l":"freq_lo","c":"Low byte of each voice's current frequency (3 bytes), looked up from the note table at $B8C2 for a new note, changed by the pitch slide and the wave program, and written to $D400, $D407 or $D40E by $B176.","t":"byte","b":[0,168,63],"x":[45551,45566,46099,46301,46845,46852]},{"a":45156,"l":"freq_hi","c":"High byte of each voice's current frequency (3 bytes), looked up from the note table at $B920 and written to $D401, $D408 or $D40F by $B176.","t":"byte","b":[0,2,30],"x":[45557,45572,46105,46304,46855,46861]},{"a":45159,"l":"note","c":"Number of each voice's current note (3 bytes), as read from its stream by $B25C; with the offsets $B08A and $B08D it indexes the note tables.","t":"byte","b":[0,33,60],"x":[45537,45677,46088,46898]},{"a":45162,"l":"track_repeat","c":"Repeat count of each voice's current pattern (3 bytes), set by track command $F1 and counted down by $B32E; the pattern is read again until it reaches zero.","t":"byte","b":[0,0,0],"x":[45892,45924,45929,45969]},{"a":45165,"l":"wave_position","c":"Offset into the wave program being read; the wave-program commands step it on and $B4ED adds it to $F0/$F1 to store the new program pointer.","t":"byte","b":[2],"x":[46120,46123,46147,46172,46191,46220,46240,46275,46317,46323]},{"a":45166,"l":"voice_offset","c":"Offset of the current voice's registers from $D400 (0, 7 or $0E), read from the table at $B8B4 at the start of each voice's turn in $B176.","t":"byte","b":[0],"x":[45445,45563,45985,46194,46223,46252,46288,46553,46715,46842,46907,47203]},{"a":45167,"l":"attack_decay","c":"Attack/decay value of each voice (3 bytes), set by wave-program command 2 ($B462), which also writes it to the voice's $D405.","t":"byte","b":[0,0,0],"x":[46181,46200]},{"a":45170,"l":"sustain_release","c":"Sustain/release value of each voice (3 bytes), set by wave-program command 2 ($B462), which also writes it to the voice's $D406.","t":"byte","b":[0,215,215],"x":[46187]},{"a":45173,"l":"slide_on","c":"Non-zero for a voice (3 bytes) whose pitch slide $B698 is running. Stream command $83 sets it and command $84 clears it; $B138 clears it.","t":"byte","b":[0,0,0],"x":[45393,45744,46404,46420,46744]},{"a":45176,"l":"unused_078","c":"3 bytes that $B138 clears and nothing reads.","t":"byte","b":[0,0,0],"x":[45396]},{"a":45179,"l":"arp_on","c":"Non-zero for a voice (3 bytes) whose arpeggio $B711 is running; it holds the stream index just after the $84 command. Stream command $83 clears it and $B138 clears it.","t":"byte","b":[0,0,0],"x":[45399,45519,45767,46412,46425,46865]},{"a":45182,"l":"filter_on","c":"Non-zero for a voice (3 bytes) that has the filter on: stream command $85 clears all three and stores the filter control value $D417 in the one for its own voice, and $B0EE clears the first when it starts a sound on another voice. A new note of such a voice restarts the sweep.","t":"byte","b":[0,0,0],"x":[45338,45789,46651,46664]},{"a":45185,"l":"drum_on","c":"Non-zero while a voice (3 bytes) is playing a drum list: $B5AC stores the record's sustain/release value here, and a new note clears it. $B176 leaves such a voice's frequency alone and $B7DC steps it.","t":"byte","b":[232,0,0],"x":[45402,45505,45687,46563,47032]},{"a":45188,"l":"new_note","c":"Non-zero for a voice (3 bytes) whose frequency must be looked up again: a new note sets it to 1 ($B25C) and wave-program command 5 sets it to its third parameter ($B4B7); $B176 does the lookup and clears it.","t":"byte","b":[0,0,0],"x":[45405,45524,45531,45682,46282,46309]},{"a":45191,"l":"fixed_length_on","c":"Non-zero for a voice (3 bytes) in fixed-length mode: stream command $87 sets it and $88 clears it. $B300 then takes the note length from $B007.","t":"byte","b":[0,0,0],"x":[45387,45824,46486,46499]},{"a":45194,"l":"pitch_offset","c":"Extra offset (3 bytes) added to the note number when the frequency is looked up, set by wave-program command 5 and cleared by $B3F8, which then looks the note up again without it.","t":"byte","b":[0,0,0],"x":[45534,45541,46078,46085,46285,46901]},{"a":45197,"l":"transpose","c":"Transposition of each voice (3 bytes), added to the note number: set by track command $F3, cleared when a track step starts with no repeats left, and cleared by $B138.","t":"byte","b":[0,0,0],"x":[45381,45544,45887,45899,46001,46092,46904]},{"a":45200,"l":"pulse_lo","c":"Current pulse width, low byte, of each voice (3 bytes): $B64E adds the step to it each frame and writes it to $D402, $D409 or $D410. A new note copies it from $B093.","t":"byte","b":[0,216,0],"x":[45735,46718,46725]},{"a":45203,"l":"pulse_start_lo","c":"Initial pulse width, low byte, of each voice (3 bytes), set by stream command $82 ($B51F) and copied to $B090 at a new note.","t":"byte","b":[0,0,0],"x":[45732,46382]},{"a":45206,"l":"pulse_hi","c":"Current pulse width, high byte, of each voice (3 bytes): $B64E adds the step and the carry to it each frame and writes it to $D403, $D40A or $D411. A new note copies it from $B099.","t":"byte","b":[0,7,0],"x":[45741,46731,46737]},{"a":45209,"l":"pulse_start_hi","c":"Initial pulse width, high byte, of each voice (3 bytes), set by stream command $82 ($B51F) and copied to $B096 at a new note.","t":"byte","b":[0,8,0],"x":[45738,46376]},{"a":45212,"l":"pulse_step_lo","c":"Low byte of the amount $B64E adds to the pulse width of each voice (3 bytes) every frame, read from the table at $B9E4.","t":"byte","b":[0,20,0],"x":[46700,46722]},{"a":45215,"l":"pulse_step_hi","c":"High byte of the amount $B64E adds to the pulse width of each voice (3 bytes) every frame, read from the table at $B9E4.","t":"byte","b":[0,0,0],"x":[46707,46734]},{"a":45218,"l":"slide_step_lo","c":"Low byte of the amount $B698 adds to each voice's frequency every frame (3 bytes), read from its pitch-slide table.","t":"byte","b":[0,156,156],"x":[46784,46827,46849]},{"a":45221,"l":"slide_step_hi","c":"High byte of the amount $B698 adds to each voice's frequency every frame (3 bytes), read from its pitch-slide table.","t":"byte","b":[0,255,255],"x":[46791,46834,46858]},{"a":45224,"l":"stream_position","c":"Position of each voice in its stream (3 bytes): the offset that $B25C reads through $F0/$F1. $B23B moves it past each note and the commands move it past their parameters.","t":"byte","b":[4,0,0],"x":[45384,45646,45660,45842,45884,46346,46387,46401,46446,46491,46502,46510,46581,46584,46646,47224]},{"a":45227,"l":"arp_countdown","c":"Frames until each voice's next arpeggio step (3 bytes), counted down by $B711 and reloaded from $B0AE; stream command $84 and a new note set it.","t":"byte","b":[0,0,0],"x":[45786,46870,46889]},{"a":45230,"l":"arp_reload","c":"Frames per arpeggio step of each voice (3 bytes), the first byte of the entry chosen by stream command $84 ($B552); $B711 copies it to $B0AB after each step.","t":"byte","b":[0,0,0],"x":[46453,46886]},{"a":45233,"l":"arp_index","c":"Index of each voice's current arpeggio step (3 bytes), counted up by $B711 and returned to 0 when it reaches $B0B4.","t":"byte","b":[0,0,0],"x":[45781,46892,46925,46928,46938]},{"a":45236,"l":"arp_length","c":"Number of steps in each voice's arpeggio (3 bytes), the second byte of the entry chosen by stream command $84 ($B552); $B711 compares $B0B1 with it.","t":"byte","b":[0,0,0],"x":[46459,46931]},{"a":45239,"l":"filter_scratch","c":"Scratch byte in which $B75E builds the filter cut-off high byte.","t":"byte","b":[0],"x":[46996,47014,47018,47022]},{"a":45240,"l":"drum_length","c":"Length of each voice's drum list (3 bytes), the third byte of the record read by $B5AC; $B7B6 ends the list when $B0BB reaches it.","t":"byte","b":[12,0,0],"x":[46519,46529,47040]},{"a":45243,"l":"drum_step_count","c":"Number of drum steps already played by each voice (3 bytes), set to 0 by $B5AC and incremented by $B7DC.","t":"byte","b":[12,0,0],"x":[46578,47037,47127]},{"a":45246,"l":"fade_out_on","c":"Non-zero while a fade-out is running. Track command $F4 and $B850 set it, and $B0C8 and $B828 clear it. $B176 lowers the volume step by step while it is set.","t":"byte","b":[0],"x":[45261,45463,46016,47152,47184]},{"a":45247,"l":"fade_counter","c":"Counter that the fade-out in $B176 and the fade-in in $B217 count down before each change of the volume; reloaded from $B0C0.","t":"byte","b":[0],"x":[45468,45471,45479,45591,45594,45602,46019,46040,47187]},{"a":45248,"l":"fade_rate","c":"Reload value of the fade counter $B0BF: the number of counts per volume step. Set by track commands $F4 and $F5 and by $B850.","t":"byte","b":[0],"x":[45476,45599,46022,46043,47190]},{"a":45249,"l":"volume_value","c":"The value written to the volume register $D418: the volume in the low nibble. $B0C8 sets it to $1F, the fade routines count it down or up, and $B176 ends the sound with $B828 when the low nibble reaches 0.","t":"byte","b":[31],"x":[45269,45482,45485,45605,45608,46048]},{"a":45250,"l":"fade_in_on","c":"Non-zero while a fade-in is running, set by track command $F5. $B217 clears it when the volume reaches the target $B0C3; $B0C8, $B828 and $B850 clear it too.","t":"byte","b":[0],"x":[45258,45455,45623,46037,47155,47195]},{"a":45251,"l":"fade_target","c":"Volume (low nibble) at which the fade-in stops, the second parameter of track command $F5 ($B3D2); $B217 compares $B0C1 with it.","t":"byte","b":[0],"x":[45616,46057]},{"a":45252,"l":"keep_flags","c":"Per voice (3 bytes), bits that stop a new note from restarting a part of the voice: 1 the pitch slide, 2 the pulse sweep, 4 the wave program, 8 the filter sweep, $10 the arpeggio. $B138 clears them and $B828 sets all of them to $FF.","t":"byte","b":[0,0,0],"x":[45390,45690,45714,45749,45772,45794,47163]},{"a":45255,"l":"sound_scratch","c":"Scratch byte: $B0EE keeps the table position and the voice number here by turns while it starts the sounds.","t":"byte","b":[2],"x":[45306,45344,45347,45358]},{"a":45256,"l":"music_init","c":"Silences the sound chip: clears the resonance and filter routing at $D417, sets volume 15 at $D418, and zeroes all 21 voice registers $D400-$D414 together with the driver's shadow table at $B02F. Level 1 puts the driver here at run time from its own file (a copy of the bytes at $7543); the level loads after it leave $9A00-$BEFF alone, and level 2 calls it at $5491.","t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":45258,"t":"code","b":[141,194,176],"m":"sta","oa":45250,"o":"fade_in_on"},{"a":45261,"t":"code","b":[141,190,176],"m":"sta","oa":45246,"o":"fade_out_on"},{"a":45264,"t":"code","b":[141,23,212],"m":"sta","o":"sid_filter_resonance"},{"a":45267,"t":"code","b":[169,31],"m":"lda","o":"#$1F"},{"a":45269,"t":"code","b":[141,193,176],"m":"sta","oa":45249,"o":"volume_value"},{"a":45272,"t":"code","b":[141,0,176],"m":"sta","oa":45056,"o":"driver_flag"},{"a":45275,"t":"code","b":[141,24,212],"m":"sta","o":"sid_filter_mode_volume"},{"a":45278,"t":"code","b":[162,20],"m":"ldx","o":"#$14"},{"a":45280,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":45282,"l":"b_B0E2","t":"code","b":[157,0,212],"m":"sta","o":"sid_v1_freq_lo,x","x":[45291]},{"a":45285,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":45287,"t":"code","b":[157,47,176],"m":"sta","oa":45103,"o":"pulse_start,x"},{"a":45290,"t":"code","b":[202],"m":"dex"},{"a":45291,"t":"code","b":[16,245],"m":"bpl","oa":45282,"o":"b_B0E2"},{"a":45293,"t":"code","b":[96],"m":"rts"},{"a":45294,"l":"play_sound","c":"Starts a sound effect. X is the offset of a row in the sound table $BB48; the levels pass 4 times the sound number. Returns at once while $B000 is zero. Otherwise it takes up to three consecutive table bytes as the entries for voices 0 to 2. An entry with bit 7 set leaves its voice alone; any other entry is a stream number n, and the address at offset 2n of the pointer table $BB74 becomes the voice's stream pointer $B05B/$B05E. Voices 1 and 2 first clear $D415-$D417 and $B07E. $B138 then restarts the voice and a zero goes to a control register whose offset is read from $B8B4 with the table position in X, not the voice number.","t":"code","b":[173,0,176],"m":"lda","oa":45056,"o":"driver_flag"},{"a":45297,"t":"code","b":[240,68],"m":"beq","oa":45367,"o":"$B137"},{"a":45299,"t":"code","b":[160,0],"m":"ldy","o":"#$00"},{"a":45301,"l":"b_B0F5","t":"code","b":[189,72,187],"m":"lda","oa":47944,"o":"sound_table,x","x":[45365]},{"a":45304,"t":"code","b":[48,55],"m":"bmi","oa":45361,"o":"b_B131"},{"a":45306,"t":"code","b":[142,199,176],"m":"stx","oa":45255,"o":"sound_scratch"},{"a":45309,"t":"code","b":[10],"m":"asl","o":"a"},{"a":45310,"t":"code","b":[170],"m":"tax"},{"a":45311,"t":"code","b":[189,116,187],"m":"lda","oa":47988,"o":"stream_pointer_table,x"},{"a":45314,"t":"code","b":[153,91,176],"m":"sta","oa":45147,"o":"stream_lo,y"},{"a":45317,"t":"code","b":[189,117,187],"m":"lda","oa":47989,"o":"$BB75,x"},{"a":45320,"t":"code","b":[153,94,176],"m":"sta","oa":45150,"o":"stream_hi,y"},{"a":45323,"t":"code","b":[192,0],"m":"cpy","o":"#$00"},{"a":45325,"t":"code","b":[240,14],"m":"beq","oa":45341,"o":"b_B11D"},{"a":45327,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":45329,"t":"code","b":[141,21,212],"m":"sta","o":"sid_filter_cutoff_lo"},{"a":45332,"t":"code","b":[141,22,212],"m":"sta","o":"sid_filter_cutoff_hi"},{"a":45335,"t":"code","b":[141,23,212],"m":"sta","o":"sid_filter_resonance"},{"a":45338,"t":"code","b":[141,126,176],"m":"sta","oa":45182,"o":"filter_on"},{"a":45341,"l":"b_B11D","t":"code","b":[32,56,177],"m":"jsr","oa":45368,"o":"init_voice","x":[45325]},{"a":45344,"t":"code","b":[174,199,176],"m":"ldx","oa":45255,"o":"sound_scratch"},{"a":45347,"t":"code","b":[140,199,176],"m":"sty","oa":45255,"o":"sound_scratch"},{"a":45350,"t":"code","b":[188,180,184],"m":"ldy","oa":47284,"o":"voice_offsets,x"},{"a":45353,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":45355,"t":"code","b":[153,4,212],"m":"sta","o":"sid_v1_control,y"},{"a":45358,"t":"code","b":[172,199,176],"m":"ldy","oa":45255,"o":"sound_scratch"},{"a":45361,"l":"b_B131","t":"code","b":[232],"m":"inx","x":[45304]},{"a":45362,"t":"code","b":[200],"m":"iny"},{"a":45363,"t":"code","b":[192,3],"m":"cpy","o":"#$03"},{"a":45365,"t":"code","b":[144,190],"m":"bcc","oa":45301,"o":"b_B0F5"},{"a":45367,"t":"code","b":[96],"m":"rts","x":[45297]},{"a":45368,"l":"init_voice","c":"Sets up voice Y (0 to 2) to start a stream: marks it active in $00F7+Y, sets its note countdown $B004 to Y+1, clears its transpose $B08D, stream position $B0A8, fixed-length flag $B087, keep flags $B0C4, slide flag $B075, $B078, arpeggio flag $B07B, drum flag $B081 and new-note flag $B084, points its wave program $B020-$B029 at the idle program $B8B7 and clears its pulse start $B02F. Called by $B0EE.","t":"code","b":[169,1],"m":"lda","o":"#$01","x":[45341]},{"a":45370,"t":"code","b":[153,247,0],"m":"sta","oa":247,"o":"voice0_active,y"},{"a":45373,"t":"code","b":[200],"m":"iny"},{"a":45374,"t":"code","b":[152],"m":"tya"},{"a":45375,"t":"code","b":[136],"m":"dey"},{"a":45376,"t":"code","b":[153,4,176],"m":"sta","oa":45060,"o":"note_countdown,y"},{"a":45379,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":45381,"t":"code","b":[153,141,176],"m":"sta","oa":45197,"o":"transpose,y"},{"a":45384,"t":"code","b":[153,168,176],"m":"sta","oa":45224,"o":"stream_position,y"},{"a":45387,"t":"code","b":[153,135,176],"m":"sta","oa":45191,"o":"fixed_length_on,y"},{"a":45390,"t":"code","b":[153,196,176],"m":"sta","oa":45252,"o":"keep_flags,y"},{"a":45393,"t":"code","b":[153,117,176],"m":"sta","oa":45173,"o":"slide_on,y"},{"a":45396,"t":"code","b":[153,120,176],"m":"sta","oa":45176,"o":"unused_078,y"},{"a":45399,"t":"code","b":[153,123,176],"m":"sta","oa":45179,"o":"arp_on,y"},{"a":45402,"t":"code","b":[153,129,176],"m":"sta","oa":45185,"o":"drum_on,y"},{"a":45405,"t":"code","b":[153,132,176],"m":"sta","oa":45188,"o":"new_note,y"},{"a":45408,"t":"code","b":[169,183],"m":"lda","o":"#$B7"},{"a":45410,"t":"code","b":[153,32,176],"m":"sta","oa":45088,"o":"wave_ptr_lo,y"},{"a":45413,"t":"code","b":[153,35,176],"m":"sta","oa":45091,"o":"wave_start_lo,y"},{"a":45416,"t":"code","b":[169,184],"m":"lda","o":"#$B8"},{"a":45418,"t":"code","b":[153,38,176],"m":"sta","oa":45094,"o":"wave_ptr_hi,y"},{"a":45421,"t":"code","b":[153,41,176],"m":"sta","oa":45097,"o":"wave_start_hi,y"},{"a":45424,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":45426,"t":"code","b":[153,47,176],"m":"sta","oa":45103,"o":"pulse_start,y"},{"a":45429,"t":"code","b":[96],"m":"rts"},{"a":45430,"l":"music_play","c":"Plays the music and sound effects, once a frame from the interrupt at $1EF4 in level 1; level 2 calls it from $6526. Returns at once while $B001 is set; otherwise works through the three voices, X from 2 down to 0, through zero page $F7-$F9.","t":"code","b":[173,1,176],"m":"lda","oa":45057,"o":"hold_flag"},{"a":45433,"t":"code","b":[240,1],"m":"beq","oa":45436,"o":"b_B17C"},{"a":45435,"t":"code","b":[96],"m":"rts"},{"a":45436,"l":"b_B17C","t":"code","b":[169,2],"m":"lda","o":"#$02","x":[45433]},{"a":45438,"t":"code","b":[133,250],"m":"sta","oa":250,"o":"voice_index"},{"a":45440,"l":"j_B180","t":"code","b":[166,250],"m":"ldx","oa":250,"o":"voice_index","x":[45582]},{"a":45442,"t":"code","b":[189,180,184],"m":"lda","oa":47284,"o":"voice_offsets,x"},{"a":45445,"t":"code","b":[141,110,176],"m":"sta","oa":45166,"o":"voice_offset"},{"a":45448,"t":"code","b":[181,247],"m":"lda","oa":247,"o":"voice0_active,x"},{"a":45450,"t":"code","b":[208,3],"m":"bne","oa":45455,"o":"b_B18F"},{"a":45452,"t":"code","b":[76,10,178],"m":"jmp","oa":45578,"o":"j_B20A"},{"a":45455,"l":"b_B18F","t":"code","b":[173,194,176],"m":"lda","oa":45250,"o":"fade_in_on","x":[45450]},{"a":45458,"t":"code","b":[240,3],"m":"beq","oa":45463,"o":"b_B197"},{"a":45460,"t":"code","b":[32,23,178],"m":"jsr","oa":45591,"o":"fade_in_step"},{"a":45463,"l":"b_B197","t":"code","b":[173,190,176],"m":"lda","oa":45246,"o":"fade_out_on","x":[45458]},{"a":45466,"t":"code","b":[240,30],"m":"beq","oa":45498,"o":"b_B1BA"},{"a":45468,"t":"code","b":[206,191,176],"m":"dec","oa":45247,"o":"fade_counter"},{"a":45471,"t":"code","b":[173,191,176],"m":"lda","oa":45247,"o":"fade_counter"},{"a":45474,"t":"code","b":[208,22],"m":"bne","oa":45498,"o":"b_B1BA"},{"a":45476,"t":"code","b":[173,192,176],"m":"lda","oa":45248,"o":"fade_rate"},{"a":45479,"t":"code","b":[141,191,176],"m":"sta","oa":45247,"o":"fade_counter"},{"a":45482,"t":"code","b":[206,193,176],"m":"dec","oa":45249,"o":"volume_value"},{"a":45485,"t":"code","b":[173,193,176],"m":"lda","oa":45249,"o":"volume_value"},{"a":45488,"t":"code","b":[141,24,212],"m":"sta","o":"sid_filter_mode_volume"},{"a":45491,"t":"code","b":[41,15],"m":"and","o":"#$0F"},{"a":45493,"t":"code","b":[208,3],"m":"bne","oa":45498,"o":"b_B1BA"},{"a":45495,"t":"code","b":[76,40,184],"m":"jmp","oa":47144,"o":"silence_all"},{"a":45498,"l":"b_B1BA","t":"code","b":[32,59,178],"m":"jsr","oa":45627,"o":"voice_tick","x":[45466,45474,45493]},{"a":45501,"t":"code","b":[181,247],"m":"lda","oa":247,"o":"voice0_active,x"},{"a":45503,"t":"code","b":[240,73],"m":"beq","oa":45578,"o":"j_B20A"},{"a":45505,"t":"code","b":[189,129,176],"m":"lda","oa":45185,"o":"drum_on,x"},{"a":45508,"t":"code","b":[208,68],"m":"bne","oa":45578,"o":"j_B20A"},{"a":45510,"t":"code","b":[32,248,179],"m":"jsr","oa":46072,"o":"wave_program_tick"},{"a":45513,"t":"code","b":[32,78,182],"m":"jsr","oa":46670,"o":"pulse_step"},{"a":45516,"t":"code","b":[32,17,183],"m":"jsr","oa":46865,"o":"arpeggio_step"},{"a":45519,"t":"code","b":[189,123,176],"m":"lda","oa":45179,"o":"arp_on,x"},{"a":45522,"t":"code","b":[208,54],"m":"bne","oa":45578,"o":"j_B20A"},{"a":45524,"t":"code","b":[189,132,176],"m":"lda","oa":45188,"o":"new_note,x"},{"a":45527,"t":"code","b":[240,31],"m":"beq","oa":45560,"o":"b_B1F8"},{"a":45529,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":45531,"t":"code","b":[157,132,176],"m":"sta","oa":45188,"o":"new_note,x"},{"a":45534,"t":"code","b":[189,138,176],"m":"lda","oa":45194,"o":"pitch_offset,x"},{"a":45537,"t":"code","b":[189,103,176],"m":"lda","oa":45159,"o":"note,x"},{"a":45540,"t":"code","b":[24],"m":"clc"},{"a":45541,"t":"code","b":[125,138,176],"m":"adc","oa":45194,"o":"pitch_offset,x"},{"a":45544,"t":"code","b":[125,141,176],"m":"adc","oa":45197,"o":"transpose,x"},{"a":45547,"t":"code","b":[168],"m":"tay"},{"a":45548,"t":"code","b":[185,194,184],"m":"lda","oa":47298,"o":"note_freq_lo,y"},{"a":45551,"t":"code","b":[157,97,176],"m":"sta","oa":45153,"o":"freq_lo,x"},{"a":45554,"t":"code","b":[185,32,185],"m":"lda","oa":47392,"o":"note_freq_hi,y"},{"a":45557,"t":"code","b":[157,100,176],"m":"sta","oa":45156,"o":"freq_hi,x"},{"a":45560,"l":"b_B1F8","t":"code","b":[32,152,182],"m":"jsr","oa":46744,"o":"pitch_slide_step","x":[45527]},{"a":45563,"t":"code","b":[172,110,176],"m":"ldy","oa":45166,"o":"voice_offset"},{"a":45566,"t":"code","b":[189,97,176],"m":"lda","oa":45153,"o":"freq_lo,x"},{"a":45569,"t":"code","b":[153,0,212],"m":"sta","o":"sid_v1_freq_lo,y"},{"a":45572,"t":"code","b":[189,100,176],"m":"lda","oa":45156,"o":"freq_hi,x"},{"a":45575,"t":"code","b":[153,1,212],"m":"sta","o":"sid_v1_freq_hi,y"},{"a":45578,"l":"j_B20A","t":"code","b":[198,250],"m":"dec","oa":250,"o":"voice_index","x":[45452,45503,45508,45522]},{"a":45580,"t":"code","b":[48,3],"m":"bmi","oa":45585,"o":"b_B211"},{"a":45582,"t":"code","b":[76,128,177],"m":"jmp","oa":45440,"o":"j_B180"},{"a":45585,"l":"b_B211","t":"code","b":[32,182,183],"m":"jsr","oa":47030,"o":"drum_step","x":[45580]},{"a":45588,"t":"code","b":[76,94,183],"m":"jmp","oa":46942,"o":"filter_sweep_step"},{"a":45591,"l":"fade_in_step","c":"Raises the volume one step at a time while a fade-in runs. Counts $B0BF down; at zero it reloads it from $B0C0, adds 1 to $B0C1, writes that to the volume register $D418 and clears the fade-in flag $B0C2 once the low nibble equals the target $B0C3. Called by $B176 while $B0C2 is non-zero.","t":"code","b":[206,191,176],"m":"dec","oa":45247,"o":"fade_counter","x":[45460]},{"a":45594,"t":"code","b":[173,191,176],"m":"lda","oa":45247,"o":"fade_counter"},{"a":45597,"t":"code","b":[208,27],"m":"bne","oa":45626,"o":"r_B23A"},{"a":45599,"t":"code","b":[173,192,176],"m":"lda","oa":45248,"o":"fade_rate"},{"a":45602,"t":"code","b":[141,191,176],"m":"sta","oa":45247,"o":"fade_counter"},{"a":45605,"t":"code","b":[238,193,176],"m":"inc","oa":45249,"o":"volume_value"},{"a":45608,"t":"code","b":[173,193,176],"m":"lda","oa":45249,"o":"volume_value"},{"a":45611,"t":"code","b":[141,24,212],"m":"sta","o":"sid_filter_mode_volume"},{"a":45614,"t":"code","b":[41,15],"m":"and","o":"#$0F"},{"a":45616,"t":"code","b":[205,195,176],"m":"cmp","oa":45251,"o":"fade_target"},{"a":45619,"t":"code","b":[208,5],"m":"bne","oa":45626,"o":"r_B23A"},{"a":45621,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":45623,"t":"code","b":[141,194,176],"m":"sta","oa":45250,"o":"fade_in_on"},{"a":45626,"l":"r_B23A","t":"code","b":[96],"m":"rts","x":[45597,45619]},{"a":45627,"l":"voice_tick","c":"Counts the current voice's note down: decrements $B004,X and returns unless it reaches zero. At zero it loads the voice's stream pointer $B05B/$B05E into $F0/$F1, runs $B25C, steps the stream position $B0A8 past the length byte and stores $F0/$F1 back. Called by $B176.","t":"code","b":[222,4,176],"m":"dec","oa":45060,"o":"note_countdown,x","x":[45498]},{"a":45630,"t":"code","b":[240,1],"m":"beq","oa":45633,"o":"b_B241"},{"a":45632,"t":"code","b":[96],"m":"rts"},{"a":45633,"l":"b_B241","t":"code","b":[189,91,176],"m":"lda","oa":45147,"o":"stream_lo,x","x":[45630]},{"a":45636,"t":"code","b":[133,240],"m":"sta","oa":240,"o":"stream_ptr_lo"},{"a":45638,"t":"code","b":[189,94,176],"m":"lda","oa":45150,"o":"stream_hi,x"},{"a":45641,"t":"code","b":[133,241],"m":"sta","oa":241,"o":"stream_ptr_hi"},{"a":45643,"t":"code","b":[32,92,178],"m":"jsr","oa":45660,"o":"read_stream"},{"a":45646,"t":"code","b":[254,168,176],"m":"inc","oa":45224,"o":"stream_position,x"},{"a":45649,"t":"code","b":[165,240],"m":"lda","oa":240,"o":"stream_ptr_lo"},{"a":45651,"t":"code","b":[157,91,176],"m":"sta","oa":45147,"o":"stream_lo,x"},{"a":45654,"t":"code","b":[165,241],"m":"lda","oa":241,"o":"stream_ptr_hi"},{"a":45656,"t":"code","b":[157,94,176],"m":"sta","oa":45150,"o":"stream_hi,x"},{"a":45659,"t":"code","b":[96],"m":"rts"},{"a":45660,"l":"read_stream","c":"Reads the next entry of the current voice's stream through ($F0),Y with Y from $B0A8,X. A byte with bit 7 set is a command and goes to $B316. A byte of $60 is a rest: only the length byte is read. Any other byte is a note: it is stored in $B067, the new-note flag $B084 becomes 1 and the drum flag $B081 is cleared. Each part the voice's keep flags $B0C4 do not hold is restarted: the wave program (mask 4, from $B023/$B029), the pulse sweep (mask 2, from $B02F, $B093 and $B099), the pitch slide (mask 1, from $B038), the arpeggio (mask $10) and the filter sweep (mask 8). The length byte then goes to $B004,X, or $B007,X in fixed-length mode, and the stream position to $B0A8,X. Called by $B23B.","t":"code","b":[188,168,176],"m":"ldy","oa":45224,"o":"stream_position,x","x":[45643,45867,46364,46390,46415,46477,46494,46505,46667,47227]},{"a":45663,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":45665,"t":"code","b":[16,3],"m":"bpl","oa":45670,"o":"b_B266"},{"a":45667,"t":"code","b":[76,22,179],"m":"jmp","oa":45846,"o":"stream_command"},{"a":45670,"l":"b_B266","t":"code","b":[201,96],"m":"cmp","o":"#$60","x":[45665]},{"a":45672,"t":"code","b":[208,3],"m":"bne","oa":45677,"o":"b_B26D"},{"a":45674,"t":"code","b":[76,0,179],"m":"jmp","oa":45824,"o":"j_B300"},{"a":45677,"l":"b_B26D","t":"code","b":[157,103,176],"m":"sta","oa":45159,"o":"note,x","x":[45672]},{"a":45680,"t":"code","b":[169,1],"m":"lda","o":"#$01"},{"a":45682,"t":"code","b":[157,132,176],"m":"sta","oa":45188,"o":"new_note,x"},{"a":45685,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":45687,"t":"code","b":[157,129,176],"m":"sta","oa":45185,"o":"drum_on,x"},{"a":45690,"t":"code","b":[189,196,176],"m":"lda","oa":45252,"o":"keep_flags,x"},{"a":45693,"t":"code","b":[41,4],"m":"and","o":"#$04"},{"a":45695,"t":"code","b":[208,17],"m":"bne","oa":45714,"o":"b_B292"},{"a":45697,"t":"code","b":[169,1],"m":"lda","o":"#$01"},{"a":45699,"t":"code","b":[157,10,176],"m":"sta","oa":45066,"o":"wave_countdown,x"},{"a":45702,"t":"code","b":[189,35,176],"m":"lda","oa":45091,"o":"wave_start_lo,x"},{"a":45705,"t":"code","b":[157,32,176],"m":"sta","oa":45088,"o":"wave_ptr_lo,x"},{"a":45708,"t":"code","b":[189,41,176],"m":"lda","oa":45097,"o":"wave_start_hi,x"},{"a":45711,"t":"code","b":[157,38,176],"m":"sta","oa":45094,"o":"wave_ptr_hi,x"},{"a":45714,"l":"b_B292","t":"code","b":[189,196,176],"m":"lda","oa":45252,"o":"keep_flags,x","x":[45695]},{"a":45717,"t":"code","b":[41,2],"m":"and","o":"#$02"},{"a":45719,"t":"code","b":[208,23],"m":"bne","oa":45744,"o":"b_B2B0"},{"a":45721,"t":"code","b":[169,1],"m":"lda","o":"#$01"},{"a":45723,"t":"code","b":[157,13,176],"m":"sta","oa":45069,"o":"pulse_countdown,x"},{"a":45726,"t":"code","b":[189,47,176],"m":"lda","oa":45103,"o":"pulse_start,x"},{"a":45729,"t":"code","b":[157,44,176],"m":"sta","oa":45100,"o":"pulse_index,x"},{"a":45732,"t":"code","b":[189,147,176],"m":"lda","oa":45203,"o":"pulse_start_lo,x"},{"a":45735,"t":"code","b":[157,144,176],"m":"sta","oa":45200,"o":"pulse_lo,x"},{"a":45738,"t":"code","b":[189,153,176],"m":"lda","oa":45209,"o":"pulse_start_hi,x"},{"a":45741,"t":"code","b":[157,150,176],"m":"sta","oa":45206,"o":"pulse_hi,x"},{"a":45744,"l":"b_B2B0","t":"code","b":[189,117,176],"m":"lda","oa":45173,"o":"slide_on,x","x":[45719]},{"a":45747,"t":"code","b":[240,18],"m":"beq","oa":45767,"o":"b_B2C7"},{"a":45749,"t":"code","b":[189,196,176],"m":"lda","oa":45252,"o":"keep_flags,x"},{"a":45752,"t":"code","b":[41,1],"m":"and","o":"#$01"},{"a":45754,"t":"code","b":[208,11],"m":"bne","oa":45767,"o":"b_B2C7"},{"a":45756,"t":"code","b":[169,1],"m":"lda","o":"#$01"},{"a":45758,"t":"code","b":[157,16,176],"m":"sta","oa":45072,"o":"slide_countdown,x"},{"a":45761,"t":"code","b":[189,56,176],"m":"lda","oa":45112,"o":"slide_start,x"},{"a":45764,"t":"code","b":[157,53,176],"m":"sta","oa":45109,"o":"slide_index,x"},{"a":45767,"l":"b_B2C7","t":"code","b":[189,123,176],"m":"lda","oa":45179,"o":"arp_on,x","x":[45747,45754]},{"a":45770,"t":"code","b":[240,17],"m":"beq","oa":45789,"o":"b_B2DD"},{"a":45772,"t":"code","b":[189,196,176],"m":"lda","oa":45252,"o":"keep_flags,x"},{"a":45775,"t":"code","b":[41,16],"m":"and","o":"#$10"},{"a":45777,"t":"code","b":[208,10],"m":"bne","oa":45789,"o":"b_B2DD"},{"a":45779,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":45781,"t":"code","b":[157,177,176],"m":"sta","oa":45233,"o":"arp_index,x"},{"a":45784,"t":"code","b":[169,1],"m":"lda","o":"#$01"},{"a":45786,"t":"code","b":[157,171,176],"m":"sta","oa":45227,"o":"arp_countdown,x"},{"a":45789,"l":"b_B2DD","t":"code","b":[189,126,176],"m":"lda","oa":45182,"o":"filter_on,x","x":[45770,45777]},{"a":45792,"t":"code","b":[240,30],"m":"beq","oa":45824,"o":"j_B300"},{"a":45794,"t":"code","b":[189,196,176],"m":"lda","oa":45252,"o":"keep_flags,x","x":[41205]},{"a":45797,"t":"code","b":[41,8],"m":"and","o":"#$08"},{"a":45799,"t":"code","b":[208,23],"m":"bne","oa":45824,"o":"j_B300","x":[41221]},{"a":45801,"t":"code","b":[173,71,176],"m":"lda","oa":45127,"o":"filter_start"},{"a":45804,"t":"code","b":[141,72,176],"m":"sta","oa":45128,"o":"filter_index"},{"a":45807,"t":"code","b":[173,75,176],"m":"lda","oa":45131,"o":"filter_start_hi"},{"a":45810,"t":"code","b":[141,77,176],"m":"sta","oa":45133,"o":"filter_hi"},{"a":45813,"t":"code","b":[173,76,176],"m":"lda","oa":45132,"o":"filter_start_lo"},{"a":45816,"t":"code","b":[141,78,176],"m":"sta","oa":45134,"o":"filter_lo"},{"a":45819,"t":"code","b":[169,1],"m":"lda","o":"#$01"},{"a":45821,"t":"code","b":[141,19,176],"m":"sta","oa":45075,"o":"filter_countdown"},{"a":45824,"l":"j_B300","t":"code","b":[189,135,176],"m":"lda","oa":45191,"o":"fixed_length_on,x","x":[45674,45792,45799]},{"a":45827,"t":"code","b":[240,6],"m":"beq","oa":45835,"o":"b_B30B"},{"a":45829,"t":"code","b":[189,7,176],"m":"lda","oa":45063,"o":"fixed_length,x"},{"a":45832,"t":"code","b":[76,14,179],"m":"jmp","oa":45838,"o":"j_B30E"},{"a":45835,"l":"b_B30B","t":"code","b":[200],"m":"iny","x":[45827]},{"a":45836,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":45838,"l":"j_B30E","t":"code","b":[157,4,176],"m":"sta","oa":45060,"o":"note_countdown,x","x":[45832]},{"a":45841,"t":"code","b":[152],"m":"tya"},{"a":45842,"t":"code","b":[157,168,176],"m":"sta","oa":45224,"o":"stream_position,x"},{"a":45845,"t":"code","b":[96],"m":"rts"},{"a":45846,"l":"stream_command","c":"Runs a stream command, entered from $B25C with the command byte (bit 7 set) in A. Looks up the handler in the tables $B87E and $B88C, stores it in the JMP operand at $B326, reloads X from $FA and jumps.","t":"code","b":[170],"m":"tax","x":[45667]},{"a":45847,"t":"code","b":[189,254,183],"m":"lda","oa":47102,"o":"$B7FE,x"},{"a":45850,"t":"code","b":[141,38,179],"m":"sta","oa":45862,"o":"cmd_jump_operand_low"},{"a":45853,"t":"code","b":[189,12,184],"m":"lda","oa":47116,"o":"$B80C,x"},{"a":45856,"t":"code","b":[141,39,179],"m":"sta","oa":45863,"o":"cmd_jump_operand_high"},{"a":45859,"t":"code","b":[166,250],"m":"ldx","oa":250,"o":"voice_index"},{"a":45861,"t":"code","b":[76,95,184],"m":"jmp","oa":47199,"o":"cmd_end_voice"},{"a":45862,"t":"note","l":"cmd_jump_operand_low","c":"Low byte of the address operand of the JMP at $B325, overwritten each time with the address of the stream command handler to run.","note":"inside the item at $B325","x":[45850]},{"a":45863,"t":"note","l":"cmd_jump_operand_high","c":"High byte of the address operand of the JMP at $B325, overwritten each time with the address of the stream command handler to run.","note":"inside the item at $B325","x":[45856]},{"a":45864,"l":"cmd_next_pattern","c":"Stream command $80: calls $B32E to fetch the voice's next pattern address into $F0/$F1 and carries on reading at $B25C.","t":"code","b":[32,46,179],"m":"jsr","oa":45870,"o":"track_next_pattern"},{"a":45867,"t":"code","b":[76,92,178],"m":"jmp","oa":45660,"o":"read_stream"},{"a":45870,"l":"track_next_pattern","c":"Fetches a pattern from the voice's track list. Loads the list address $B01A/$B01D into $F2/$F3, sets the stream position $B0A8 to 0, and clears the transpose $B08D when it is set and the repeat count $B06A is zero. It then reads the entry at $B014,X. A value below $F0 is a pattern number n and gives $F0/$F1 the byte at $B9E4+n, which the code reads twice, once into each of $F0 and $F1; if the repeat count is zero the track index advances, otherwise the count goes down and the index advances when it reaches zero. A value of $F0 or more is a track command, dispatched through $B89A and $B8A0 by the JMP operand at $B383.","t":"code","b":[166,250],"m":"ldx","oa":250,"o":"voice_index","x":[45864]},{"a":45872,"t":"code","b":[189,26,176],"m":"lda","oa":45082,"o":"track_lo,x"},{"a":45875,"t":"code","b":[133,242],"m":"sta","oa":242,"o":"track_ptr_lo"},{"a":45877,"t":"code","b":[189,29,176],"m":"lda","oa":45085,"o":"track_hi,x"},{"a":45880,"t":"code","b":[133,243],"m":"sta","oa":243,"o":"track_ptr_hi"},{"a":45882,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":45884,"t":"code","b":[157,168,176],"m":"sta","oa":45224,"o":"stream_position,x"},{"a":45887,"t":"code","b":[189,141,176],"m":"lda","oa":45197,"o":"transpose,x"},{"a":45890,"t":"code","b":[240,10],"m":"beq","oa":45902,"o":"$B34E"},{"a":45892,"t":"code","b":[189,106,176],"m":"lda","oa":45162,"o":"track_repeat,x"},{"a":45895,"t":"code","b":[208,5],"m":"bne","oa":45902,"o":"$B34E"},{"a":45897,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":45899,"t":"code","b":[157,141,176],"m":"sta","oa":45197,"o":"transpose,x"},{"a":45902,"t":"code","b":[188,20,176],"m":"ldy","oa":45076,"o":"track_index,x","x":[45890,45895,45963,45978,46010,46031,46069]},{"a":45905,"t":"code","b":[177,242],"m":"lda","oa":242,"o":"(track_ptr_lo),y"},{"a":45907,"t":"code","b":[201,240],"m":"cmp","o":"#$F0"},{"a":45909,"t":"code","b":[176,28],"m":"bcs","oa":45939,"o":"$B373"},{"a":45911,"t":"code","b":[170],"m":"tax"},{"a":45912,"t":"code","b":[189,228,185],"m":"lda","oa":47588,"o":"pulse_table,x"},{"a":45915,"t":"code","b":[133,240],"m":"sta","oa":240,"o":"stream_ptr_lo"},{"a":45917,"t":"code","b":[189,228,185],"m":"lda","oa":47588,"o":"pulse_table,x"},{"a":45920,"t":"code","b":[133,241],"m":"sta","oa":241,"o":"stream_ptr_hi"},{"a":45922,"t":"code","b":[166,250],"m":"ldx","oa":250,"o":"voice_index"},{"a":45924,"t":"code","b":[189,106,176],"m":"lda","oa":45162,"o":"track_repeat,x"},{"a":45927,"t":"code","b":[240,6],"m":"beq","oa":45935,"o":"$B36F"},{"a":45929,"t":"code","b":[222,106,176],"m":"dec","oa":45162,"o":"track_repeat,x"},{"a":45932,"t":"code","b":[240,1],"m":"beq","oa":45935,"o":"$B36F"},{"a":45934,"t":"code","b":[96],"m":"rts"},{"a":45935,"t":"code","b":[254,20,176],"m":"inc","oa":45076,"o":"track_index,x","x":[45927,45932]},{"a":45938,"t":"code","b":[96],"m":"rts"},{"a":45939,"t":"code","b":[170],"m":"tax","x":[45909]},{"a":45940,"t":"code","b":[189,170,183],"m":"lda","oa":47018,"o":"$B7AA,x"},{"a":45943,"t":"code","b":[141,131,179],"m":"sta","oa":45955,"o":"track_jump_operand_low"},{"a":45946,"t":"code","b":[189,176,183],"m":"lda","oa":47024,"o":"$B7B0,x"},{"a":45949,"t":"code","b":[141,132,179],"m":"sta","oa":45956,"o":"track_jump_operand_high"},{"a":45952,"t":"code","b":[166,250],"m":"ldx","oa":250,"o":"voice_index"},{"a":45954,"t":"code","b":[76,255,255],"m":"jmp","oa":65535,"o":"$FFFF"},{"a":45955,"t":"note","l":"track_jump_operand_low","c":"Low byte of the address operand of the JMP at $B382, overwritten each time with the address of the track command handler to run.","note":"inside the item at $B382","x":[45943]},{"a":45956,"t":"note","l":"track_jump_operand_high","c":"High byte of the address operand of the JMP at $B382, overwritten each time with the address of the track command handler to run.","note":"inside the item at $B382","x":[45949]},{"a":45957,"l":"track_jump","c":"Track command $F0: sets the track index $B014,X to the next byte of the list and goes on reading the list at $B34E.","t":"code","b":[200],"m":"iny"},{"a":45958,"t":"code","b":[177,242],"m":"lda","oa":242,"o":"(track_ptr_lo),y"},{"a":45960,"t":"code","b":[157,20,176],"m":"sta","oa":45076,"o":"track_index,x"},{"a":45963,"t":"code","b":[76,78,179],"m":"jmp","oa":45902,"o":"$B34E"},{"a":45966,"l":"track_repeat_cmd","c":"Track command $F1: stores the next byte in the repeat count $B06A,X, moves the track index $B014,X on by 2 and goes on at $B34E.","t":"code","b":[200],"m":"iny"},{"a":45967,"t":"code","b":[177,242],"m":"lda","oa":242,"o":"(track_ptr_lo),y"},{"a":45969,"t":"code","b":[157,106,176],"m":"sta","oa":45162,"o":"track_repeat,x"},{"a":45972,"t":"code","b":[254,20,176],"m":"inc","oa":45076,"o":"track_index,x"},{"a":45975,"t":"code","b":[254,20,176],"m":"inc","oa":45076,"o":"track_index,x"},{"a":45978,"t":"code","b":[76,78,179],"m":"jmp","oa":45902,"o":"$B34E"},{"a":45981,"l":"track_stop","c":"Track command $F2: stops the voice: clears its active flag $F7+X and the voice's registers $D404-$D406 and returns.","t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":45983,"t":"code","b":[149,247],"m":"sta","oa":247,"o":"voice0_active,x"},{"a":45985,"t":"code","b":[172,110,176],"m":"ldy","oa":45166,"o":"voice_offset"},{"a":45988,"t":"code","b":[153,4,212],"m":"sta","o":"sid_v1_control,y"},{"a":45991,"t":"code","b":[153,5,212],"m":"sta","o":"sid_v1_attack_decay,y"},{"a":45994,"t":"code","b":[153,6,212],"m":"sta","o":"sid_v1_sustain_release,y"},{"a":45997,"t":"code","b":[96],"m":"rts"},{"a":45998,"l":"track_transpose","c":"Track command $F3: stores the next byte in the transposition $B08D,X, moves the track index on by 2 and goes on at $B34E.","t":"code","b":[200],"m":"iny"},{"a":45999,"t":"code","b":[177,242],"m":"lda","oa":242,"o":"(track_ptr_lo),y"},{"a":46001,"t":"code","b":[157,141,176],"m":"sta","oa":45197,"o":"transpose,x"},{"a":46004,"t":"code","b":[254,20,176],"m":"inc","oa":45076,"o":"track_index,x"},{"a":46007,"t":"code","b":[254,20,176],"m":"inc","oa":45076,"o":"track_index,x"},{"a":46010,"t":"code","b":[76,78,179],"m":"jmp","oa":45902,"o":"$B34E"},{"a":46013,"l":"track_fade_out","c":"Track command $F4: stores the next byte in $B0BE, $B0BF and $B0C0, which starts a fade-out with that rate, moves the track index on by 2 and goes on at $B34E.","t":"code","b":[200],"m":"iny"},{"a":46014,"t":"code","b":[177,242],"m":"lda","oa":242,"o":"(track_ptr_lo),y"},{"a":46016,"t":"code","b":[141,190,176],"m":"sta","oa":45246,"o":"fade_out_on"},{"a":46019,"t":"code","b":[141,191,176],"m":"sta","oa":45247,"o":"fade_counter"},{"a":46022,"t":"code","b":[141,192,176],"m":"sta","oa":45248,"o":"fade_rate"},{"a":46025,"t":"code","b":[254,20,176],"m":"inc","oa":45076,"o":"track_index,x"},{"a":46028,"t":"code","b":[254,20,176],"m":"inc","oa":45076,"o":"track_index,x"},{"a":46031,"t":"code","b":[76,78,179],"m":"jmp","oa":45902,"o":"$B34E"},{"a":46034,"l":"track_fade_in","c":"Track command $F5: stores the next byte in $B0C2, $B0BF and $B0C0, which starts a fade-in with that rate, sets $B0C1 and $D418 to $10, stores the byte after it in $B0C3 as the target volume, moves the track index on by 3 and goes on at $B34E.","t":"code","b":[200],"m":"iny"},{"a":46035,"t":"code","b":[177,242],"m":"lda","oa":242,"o":"(track_ptr_lo),y"},{"a":46037,"t":"code","b":[141,194,176],"m":"sta","oa":45250,"o":"fade_in_on"},{"a":46040,"t":"code","b":[141,191,176],"m":"sta","oa":45247,"o":"fade_counter"},{"a":46043,"t":"code","b":[141,192,176],"m":"sta","oa":45248,"o":"fade_rate"},{"a":46046,"t":"code","b":[169,16],"m":"lda","o":"#$10"},{"a":46048,"t":"code","b":[141,193,176],"m":"sta","oa":45249,"o":"volume_value"},{"a":46051,"t":"code","b":[141,24,212],"m":"sta","o":"sid_filter_mode_volume"},{"a":46054,"t":"code","b":[200],"m":"iny"},{"a":46055,"t":"code","b":[177,242],"m":"lda","oa":242,"o":"(track_ptr_lo),y"},{"a":46057,"t":"code","b":[141,195,176],"m":"sta","oa":45251,"o":"fade_target"},{"a":46060,"t":"code","b":[254,20,176],"m":"inc","oa":45076,"o":"track_index,x"},{"a":46063,"t":"code","b":[254,20,176],"m":"inc","oa":45076,"o":"track_index,x"},{"a":46066,"t":"code","b":[254,20,176],"m":"inc","oa":45076,"o":"track_index,x"},{"a":46069,"t":"code","b":[76,78,179],"m":"jmp","oa":45902,"o":"$B34E"},{"a":46072,"l":"wave_program_tick","c":"Runs the current voice's wave program, called by $B176 for each active voice that is not playing a drum. Counts $B00A,X down and returns unless it reaches zero. At zero, if the pitch offset $B08A is set, it clears it and looks the frequency up again from the note $B067 plus the transposition $B08D in the tables $B8C2 and $B920. It then loads the program pointer $B020/$B026 into $F0/$F1, reads the command number at the position $B06D (starting at 0), stores the handler from $B8A6 and $B8AD in the JMP operand at $B440 and jumps to it. $B42B is where commands 1 and 2 read the next command.","t":"code","b":[222,10,176],"m":"dec","oa":45066,"o":"wave_countdown,x","x":[45510]},{"a":46075,"t":"code","b":[240,1],"m":"beq","oa":46078,"o":"b_B3FE"},{"a":46077,"t":"code","b":[96],"m":"rts"},{"a":46078,"l":"b_B3FE","t":"code","b":[189,138,176],"m":"lda","oa":45194,"o":"pitch_offset,x","x":[46075]},{"a":46081,"t":"code","b":[240,25],"m":"beq","oa":46108,"o":"b_B41C"},{"a":46083,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":46085,"t":"code","b":[157,138,176],"m":"sta","oa":45194,"o":"pitch_offset,x"},{"a":46088,"t":"code","b":[189,103,176],"m":"lda","oa":45159,"o":"note,x"},{"a":46091,"t":"code","b":[24],"m":"clc"},{"a":46092,"t":"code","b":[125,141,176],"m":"adc","oa":45197,"o":"transpose,x"},{"a":46095,"t":"code","b":[168],"m":"tay"},{"a":46096,"t":"code","b":[185,194,184],"m":"lda","oa":47298,"o":"note_freq_lo,y"},{"a":46099,"t":"code","b":[157,97,176],"m":"sta","oa":45153,"o":"freq_lo,x"},{"a":46102,"t":"code","b":[185,32,185],"m":"lda","oa":47392,"o":"note_freq_hi,y"},{"a":46105,"t":"code","b":[157,100,176],"m":"sta","oa":45156,"o":"freq_hi,x"},{"a":46108,"l":"b_B41C","t":"code","b":[189,32,176],"m":"lda","oa":45088,"o":"wave_ptr_lo,x","x":[46081]},{"a":46111,"t":"code","b":[133,240],"m":"sta","oa":240,"o":"stream_ptr_lo"},{"a":46113,"t":"code","b":[189,38,176],"m":"lda","oa":45094,"o":"wave_ptr_hi,x"},{"a":46116,"t":"code","b":[133,241],"m":"sta","oa":241,"o":"stream_ptr_hi"},{"a":46118,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":46120,"t":"code","b":[141,109,176],"m":"sta","oa":45165,"o":"wave_position"},{"a":46123,"t":"code","b":[172,109,176],"m":"ldy","oa":45165,"o":"wave_position","x":[46175,46206]},{"a":46126,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":46128,"t":"code","b":[170],"m":"tax"},{"a":46129,"t":"code","b":[189,166,184],"m":"lda","oa":47270,"o":"wave_command_lo,x"},{"a":46132,"t":"code","b":[141,64,180],"m":"sta","oa":46144,"o":"wave_jump_operand_low"},{"a":46135,"t":"code","b":[189,173,184],"m":"lda","oa":47277,"o":"wave_command_hi,x"},{"a":46138,"t":"code","b":[141,65,180],"m":"sta","oa":46145,"o":"wave_jump_operand_high"},{"a":46141,"t":"code","b":[166,250],"m":"ldx","oa":250,"o":"voice_index"},{"a":46143,"t":"code","b":[76,66,180],"m":"jmp","oa":46146,"o":"wave_wait"},{"a":46144,"t":"note","l":"wave_jump_operand_low","c":"Low byte of the address operand of the JMP at $B43F, overwritten each time with the address of the wave-program command handler to run.","note":"inside the item at $B43F","x":[46132]},{"a":46145,"t":"note","l":"wave_jump_operand_high","c":"High byte of the address operand of the JMP at $B43F, overwritten each time with the address of the wave-program command handler to run.","note":"inside the item at $B43F","x":[46138]},{"a":46146,"l":"wave_wait","c":"Wave-program command 0: stores the next byte as the number of frames to wait in $B00A,X and ends the step through $B4ED.","t":"code","b":[200],"m":"iny","x":[46143]},{"a":46147,"t":"code","b":[140,109,176],"m":"sty","oa":45165,"o":"wave_position"},{"a":46150,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":46152,"t":"code","b":[157,10,176],"m":"sta","oa":45066,"o":"wave_countdown,x"},{"a":46155,"t":"code","b":[76,237,180],"m":"jmp","oa":46317,"o":"wave_advance"},{"a":46158,"l":"wave_jump","c":"Wave-program command 1: loads $F0/$F1 with the two bytes that follow, a new program address, sets the position $B06D to 0 and carries on at $B42B in the same frame.","t":"code","b":[200],"m":"iny"},{"a":46159,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":46161,"t":"code","b":[72],"m":"pha"},{"a":46162,"t":"code","b":[200],"m":"iny"},{"a":46163,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":46165,"t":"code","b":[133,241],"m":"sta","oa":241,"o":"stream_ptr_hi"},{"a":46167,"t":"code","b":[104],"m":"pla"},{"a":46168,"t":"code","b":[133,240],"m":"sta","oa":240,"o":"stream_ptr_lo"},{"a":46170,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":46172,"t":"code","b":[141,109,176],"m":"sta","oa":45165,"o":"wave_position"},{"a":46175,"t":"code","b":[76,43,180],"m":"jmp","oa":46123,"o":"$B42B"},{"a":46178,"l":"wave_envelope","c":"Wave-program command 2: stores the next two bytes in $B06F,X (attack/decay) and $B072,X (sustain/release), writes them to the voice's $D405 and $D406 and carries on at $B42B.","t":"code","b":[200],"m":"iny"},{"a":46179,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":46181,"t":"code","b":[157,111,176],"m":"sta","oa":45167,"o":"attack_decay,x"},{"a":46184,"t":"code","b":[200],"m":"iny"},{"a":46185,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":46187,"t":"code","b":[157,114,176],"m":"sta","oa":45170,"o":"sustain_release,x"},{"a":46190,"t":"code","b":[200],"m":"iny"},{"a":46191,"t":"code","b":[140,109,176],"m":"sty","oa":45165,"o":"wave_position"},{"a":46194,"t":"code","b":[172,110,176],"m":"ldy","oa":45166,"o":"voice_offset"},{"a":46197,"t":"code","b":[153,6,212],"m":"sta","o":"sid_v1_sustain_release,y"},{"a":46200,"t":"code","b":[189,111,176],"m":"lda","oa":45167,"o":"attack_decay,x"},{"a":46203,"t":"code","b":[153,5,212],"m":"sta","o":"sid_v1_attack_decay,y"},{"a":46206,"t":"code","b":[76,43,180],"m":"jmp","oa":46123,"o":"$B42B"},{"a":46209,"l":"wave_control","c":"Wave-program command 3: writes the next byte to the voice's control register $D404 (waveform and gate) and stores the byte after it as the frames to wait in $B00A,X; ends the step through $B4ED.","t":"code","b":[200],"m":"iny"},{"a":46210,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":46212,"t":"code","b":[133,246],"m":"sta","oa":246,"o":"control_temp"},{"a":46214,"t":"code","b":[200],"m":"iny"},{"a":46215,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":46217,"t":"code","b":[157,10,176],"m":"sta","oa":45066,"o":"wave_countdown,x"},{"a":46220,"t":"code","b":[140,109,176],"m":"sty","oa":45165,"o":"wave_position"},{"a":46223,"t":"code","b":[172,110,176],"m":"ldy","oa":45166,"o":"voice_offset"},{"a":46226,"t":"code","b":[165,246],"m":"lda","oa":246,"o":"control_temp"},{"a":46228,"t":"code","b":[153,4,212],"m":"sta","o":"sid_v1_control,y"},{"a":46231,"t":"code","b":[76,237,180],"m":"jmp","oa":46317,"o":"wave_advance"},{"a":46234,"l":"wave_control_early","c":"Wave-program command 4: writes the next byte to the voice's $D404 like command 3, but the wait is the note's remaining count $B004,X minus the byte after it, so the step comes that many frames before the note ends.","t":"code","b":[200],"m":"iny"},{"a":46235,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":46237,"t":"code","b":[133,246],"m":"sta","oa":246,"o":"control_temp"},{"a":46239,"t":"code","b":[200],"m":"iny"},{"a":46240,"t":"code","b":[140,109,176],"m":"sty","oa":45165,"o":"wave_position"},{"a":46243,"t":"code","b":[189,4,176],"m":"lda","oa":45060,"o":"note_countdown,x"},{"a":46246,"t":"code","b":[56],"m":"sec"},{"a":46247,"t":"code","b":[241,240],"m":"sbc","oa":240,"o":"(stream_ptr_lo),y"},{"a":46249,"t":"code","b":[157,10,176],"m":"sta","oa":45066,"o":"wave_countdown,x"},{"a":46252,"t":"code","b":[172,110,176],"m":"ldy","oa":45166,"o":"voice_offset"},{"a":46255,"t":"code","b":[165,246],"m":"lda","oa":246,"o":"control_temp"},{"a":46257,"t":"code","b":[153,4,212],"m":"sta","o":"sid_v1_control,y"},{"a":46260,"t":"code","b":[76,237,180],"m":"jmp","oa":46317,"o":"wave_advance"},{"a":46263,"l":"wave_control_pitch","c":"Wave-program command 5: writes the next byte to the voice's $D404, stores the one after it as the frames to wait in $B00A,X and the third in $B084,X and $B08A,X, which asks for the frequency to be looked up again with that offset. When the third byte is 0 it instead sets the voice's frequency $B061/$B064 to $FFFF, clears $B084 and sets the offset to 1.","t":"code","b":[200],"m":"iny"},{"a":46264,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":46266,"t":"code","b":[133,246],"m":"sta","oa":246,"o":"control_temp"},{"a":46268,"t":"code","b":[200],"m":"iny"},{"a":46269,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":46271,"t":"code","b":[157,10,176],"m":"sta","oa":45066,"o":"wave_countdown,x"},{"a":46274,"t":"code","b":[200],"m":"iny"},{"a":46275,"t":"code","b":[140,109,176],"m":"sty","oa":45165,"o":"wave_position"},{"a":46278,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":46280,"t":"code","b":[240,17],"m":"beq","oa":46299,"o":"$B4DB"},{"a":46282,"t":"code","b":[157,132,176],"m":"sta","oa":45188,"o":"new_note,x"},{"a":46285,"t":"code","b":[157,138,176],"m":"sta","oa":45194,"o":"pitch_offset,x","x":[46314]},{"a":46288,"t":"code","b":[172,110,176],"m":"ldy","oa":45166,"o":"voice_offset"},{"a":46291,"t":"code","b":[165,246],"m":"lda","oa":246,"o":"control_temp"},{"a":46293,"t":"code","b":[153,4,212],"m":"sta","o":"sid_v1_control,y"},{"a":46296,"t":"code","b":[76,237,180],"m":"jmp","oa":46317,"o":"wave_advance"},{"a":46299,"t":"code","b":[169,255],"m":"lda","o":"#$FF","x":[46280]},{"a":46301,"t":"code","b":[157,97,176],"m":"sta","oa":45153,"o":"freq_lo,x"},{"a":46304,"t":"code","b":[157,100,176],"m":"sta","oa":45156,"o":"freq_hi,x"},{"a":46307,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":46309,"t":"code","b":[157,132,176],"m":"sta","oa":45188,"o":"new_note,x"},{"a":46312,"t":"code","b":[169,1],"m":"lda","o":"#$01"},{"a":46314,"t":"code","b":[76,205,180],"m":"jmp","oa":46285,"o":"$B4CD"},{"a":46317,"l":"wave_advance","c":"End of a wave-program step: adds 1 to the position $B06D and stores $F0/$F1 plus the position as the voice's wave pointer $B020/$B026. Wave-program command 6 enters here directly, so it skips one byte.","t":"code","b":[238,109,176],"m":"inc","oa":45165,"o":"wave_position","x":[46155,46231,46260,46296]},{"a":46320,"t":"code","b":[165,240],"m":"lda","oa":240,"o":"stream_ptr_lo"},{"a":46322,"t":"code","b":[24],"m":"clc"},{"a":46323,"t":"code","b":[109,109,176],"m":"adc","oa":45165,"o":"wave_position"},{"a":46326,"t":"code","b":[157,32,176],"m":"sta","oa":45088,"o":"wave_ptr_lo,x"},{"a":46329,"t":"code","b":[165,241],"m":"lda","oa":241,"o":"stream_ptr_hi"},{"a":46331,"t":"code","b":[105,0],"m":"adc","o":"#$00"},{"a":46333,"t":"code","b":[157,38,176],"m":"sta","oa":45094,"o":"wave_ptr_hi,x"},{"a":46336,"t":"code","b":[96],"m":"rts"},{"a":46337,"l":"cmd_wave_program","c":"Stream command $81: the next byte n selects a wave program. The address at offset 2n of the table $BA7C is stored as the voice's program start $B023/$B029, which the next note copies to $B020/$B026. Carries on at $B25C.","t":"code","b":[200],"m":"iny"},{"a":46338,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":46340,"t":"code","b":[10],"m":"asl","o":"a"},{"a":46341,"t":"code","b":[141,2,176],"m":"sta","oa":45058,"o":"voice_scratch"},{"a":46344,"t":"code","b":[200],"m":"iny"},{"a":46345,"t":"code","b":[152],"m":"tya"},{"a":46346,"t":"code","b":[157,168,176],"m":"sta","oa":45224,"o":"stream_position,x"},{"a":46349,"t":"code","b":[172,2,176],"m":"ldy","oa":45058,"o":"voice_scratch"},{"a":46352,"t":"code","b":[185,124,186],"m":"lda","oa":47740,"o":"wave_program_table,y"},{"a":46355,"t":"code","b":[157,35,176],"m":"sta","oa":45091,"o":"wave_start_lo,x"},{"a":46358,"t":"code","b":[185,125,186],"m":"lda","oa":47741,"o":"$BA7D,y"},{"a":46361,"t":"code","b":[157,41,176],"m":"sta","oa":45097,"o":"wave_start_hi,x"},{"a":46364,"t":"code","b":[76,92,178],"m":"jmp","oa":45660,"o":"read_stream"},{"a":46367,"l":"cmd_pulse","c":"Stream command $82: the three bytes that follow go to $B02F (start index into the table $B9E4), $B099 (initial pulse width, high byte) and $B093 (low byte). Carries on at $B25C.","t":"code","b":[200],"m":"iny"},{"a":46368,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":46370,"t":"code","b":[157,47,176],"m":"sta","oa":45103,"o":"pulse_start,x"},{"a":46373,"t":"code","b":[200],"m":"iny"},{"a":46374,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":46376,"t":"code","b":[157,153,176],"m":"sta","oa":45209,"o":"pulse_start_hi,x"},{"a":46379,"t":"code","b":[200],"m":"iny"},{"a":46380,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":46382,"t":"code","b":[157,147,176],"m":"sta","oa":45203,"o":"pulse_start_lo,x"},{"a":46385,"t":"code","b":[200],"m":"iny"},{"a":46386,"t":"code","b":[152],"m":"tya"},{"a":46387,"t":"code","b":[157,168,176],"m":"sta","oa":45224,"o":"stream_position,x"},{"a":46390,"t":"code","b":[76,92,178],"m":"jmp","oa":45660,"o":"read_stream"},{"a":46393,"l":"cmd_pitch_slide","c":"Stream command $83: the next byte goes to $B038, the start index into the slide table $BA07. Sets the slide flag $B075 and clears $B032 and the arpeggio flag $B07B. Carries on at $B25C.","t":"code","b":[200],"m":"iny"},{"a":46394,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":46396,"t":"code","b":[157,56,176],"m":"sta","oa":45112,"o":"slide_start,x"},{"a":46399,"t":"code","b":[200],"m":"iny"},{"a":46400,"t":"code","b":[152],"m":"tya"},{"a":46401,"t":"code","b":[157,168,176],"m":"sta","oa":45224,"o":"stream_position,x"},{"a":46404,"t":"code","b":[157,117,176],"m":"sta","oa":45173,"o":"slide_on,x"},{"a":46407,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":46409,"t":"code","b":[157,50,176],"m":"sta","oa":45106,"o":"slide_table_select,x"},{"a":46412,"t":"code","b":[157,123,176],"m":"sta","oa":45179,"o":"arp_on,x"},{"a":46415,"t":"code","b":[76,92,178],"m":"jmp","oa":45660,"o":"read_stream"},{"a":46418,"l":"cmd_arpeggio","c":"Stream commands $84 and $8D: clears the slide flag $B075 and sets the arpeggio flag $B07B. The next byte n selects the entry whose address is at offset 2n of the table $BA5B (kept in $F4/$F5); its first byte goes to $B0AE (frames per step), its second to $B0B4 (number of steps) and the address after them to $B03B/$B041. Carries on at $B25C.","t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":46420,"t":"code","b":[157,117,176],"m":"sta","oa":45173,"o":"slide_on,x"},{"a":46423,"t":"code","b":[200],"m":"iny"},{"a":46424,"t":"code","b":[152],"m":"tya"},{"a":46425,"t":"code","b":[157,123,176],"m":"sta","oa":45179,"o":"arp_on,x"},{"a":46428,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":46430,"t":"code","b":[10],"m":"asl","o":"a"},{"a":46431,"t":"code","b":[170],"m":"tax"},{"a":46432,"t":"code","b":[189,91,186],"m":"lda","oa":47707,"o":"arpeggio_table,x"},{"a":46435,"t":"code","b":[133,244],"m":"sta","oa":244,"o":"arp_entry_ptr_lo"},{"a":46437,"t":"code","b":[189,92,186],"m":"lda","oa":47708,"o":"$BA5C,x"},{"a":46440,"t":"code","b":[133,245],"m":"sta","oa":245,"o":"arp_entry_ptr_hi"},{"a":46442,"t":"code","b":[200],"m":"iny"},{"a":46443,"t":"code","b":[152],"m":"tya"},{"a":46444,"t":"code","b":[166,250],"m":"ldx","oa":250,"o":"voice_index"},{"a":46446,"t":"code","b":[157,168,176],"m":"sta","oa":45224,"o":"stream_position,x"},{"a":46449,"t":"code","b":[160,0],"m":"ldy","o":"#$00"},{"a":46451,"t":"code","b":[177,244],"m":"lda","oa":244,"o":"(arp_entry_ptr_lo),y"},{"a":46453,"t":"code","b":[157,174,176],"m":"sta","oa":45230,"o":"arp_reload,x"},{"a":46456,"t":"code","b":[200],"m":"iny"},{"a":46457,"t":"code","b":[177,244],"m":"lda","oa":244,"o":"(arp_entry_ptr_lo),y"},{"a":46459,"t":"code","b":[157,180,176],"m":"sta","oa":45236,"o":"arp_length,x"},{"a":46462,"t":"code","b":[165,244],"m":"lda","oa":244,"o":"arp_entry_ptr_lo"},{"a":46464,"t":"code","b":[24],"m":"clc"},{"a":46465,"t":"code","b":[105,2],"m":"adc","o":"#$02"},{"a":46467,"t":"code","b":[157,59,176],"m":"sta","oa":45115,"o":"arp_ptr_lo,x"},{"a":46470,"t":"code","b":[165,245],"m":"lda","oa":245,"o":"arp_entry_ptr_hi"},{"a":46472,"t":"code","b":[105,0],"m":"adc","o":"#$00"},{"a":46474,"t":"code","b":[157,65,176],"m":"sta","oa":45121,"o":"arp_ptr_hi,x"},{"a":46477,"t":"code","b":[76,92,178],"m":"jmp","oa":45660,"o":"read_stream"},{"a":46480,"l":"cmd_fixed_length","c":"Stream command $87: the next byte is stored in $B007,X and in the flag $B087,X, so that following notes carry no length byte. Carries on at $B25C.","t":"code","b":[200],"m":"iny"},{"a":46481,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":46483,"t":"code","b":[157,7,176],"m":"sta","oa":45063,"o":"fixed_length,x"},{"a":46486,"t":"code","b":[157,135,176],"m":"sta","oa":45191,"o":"fixed_length_on,x"},{"a":46489,"t":"code","b":[200],"m":"iny"},{"a":46490,"t":"code","b":[152],"m":"tya"},{"a":46491,"t":"code","b":[157,168,176],"m":"sta","oa":45224,"o":"stream_position,x"},{"a":46494,"t":"code","b":[76,92,178],"m":"jmp","oa":45660,"o":"read_stream"},{"a":46497,"l":"cmd_free_length","c":"Stream command $88: clears the fixed-length flag $B087,X so that notes carry a length byte again. Carries on at $B25C.","t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":46499,"t":"code","b":[157,135,176],"m":"sta","oa":45191,"o":"fixed_length_on,x"},{"a":46502,"t":"code","b":[254,168,176],"m":"inc","oa":45224,"o":"stream_position,x"},{"a":46505,"t":"code","b":[76,92,178],"m":"jmp","oa":45660,"o":"read_stream"},{"a":46508,"l":"cmd_drum","c":"Stream commands $86 and $89: the next byte is an offset into the 5-byte records of the table $B97E. A record holds a list address, a list length (to $B0B8), a sustain/release value (to $D406 and $B081) and a pulse width high byte (to $D403). The list address goes to $B04F/$B055 and the address plus the length to $B052/$B058. It then writes 0 to $D405 and 8 to $D404, clears $B0BB, takes the byte after the drum number as the note length $B004,X and returns without reading on; $B7B6 plays the list. It also restarts the filter sweep, copying $B047 to $B048, $B04B to $B04D and $B04C to $B04E and setting $B013 to 1.","t":"code","b":[200],"m":"iny"},{"a":46509,"t":"code","b":[152],"m":"tya"},{"a":46510,"t":"code","b":[157,168,176],"m":"sta","oa":45224,"o":"stream_position,x"},{"a":46513,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":46515,"t":"code","b":[168],"m":"tay"},{"a":46516,"t":"code","b":[185,128,185],"m":"lda","oa":47488,"o":"$B980,y"},{"a":46519,"t":"code","b":[157,184,176],"m":"sta","oa":45240,"o":"drum_length,x"},{"a":46522,"t":"code","b":[185,126,185],"m":"lda","oa":47486,"o":"drum_records,y"},{"a":46525,"t":"code","b":[157,79,176],"m":"sta","oa":45135,"o":"drum_ctrl_lo,x"},{"a":46528,"t":"code","b":[24],"m":"clc"},{"a":46529,"t":"code","b":[125,184,176],"m":"adc","oa":45240,"o":"drum_length,x"},{"a":46532,"t":"code","b":[157,82,176],"m":"sta","oa":45138,"o":"drum_freq_lo,x"},{"a":46535,"t":"code","b":[185,127,185],"m":"lda","oa":47487,"o":"$B97F,y"},{"a":46538,"t":"code","b":[157,85,176],"m":"sta","oa":45141,"o":"drum_ctrl_hi,x"},{"a":46541,"t":"code","b":[105,0],"m":"adc","o":"#$00"},{"a":46543,"t":"code","b":[157,88,176],"m":"sta","oa":45144,"o":"drum_freq_hi,x"},{"a":46546,"t":"code","b":[185,129,185],"m":"lda","oa":47489,"o":"$B981,y"},{"a":46549,"t":"code","b":[72],"m":"pha"},{"a":46550,"t":"code","b":[185,130,185],"m":"lda","oa":47490,"o":"$B982,y"},{"a":46553,"t":"code","b":[172,110,176],"m":"ldy","oa":45166,"o":"voice_offset"},{"a":46556,"t":"code","b":[153,3,212],"m":"sta","o":"sid_v1_pulse_hi,y"},{"a":46559,"t":"code","b":[104],"m":"pla"},{"a":46560,"t":"code","b":[153,6,212],"m":"sta","o":"sid_v1_sustain_release,y"},{"a":46563,"t":"code","b":[157,129,176],"m":"sta","oa":45185,"o":"drum_on,x"},{"a":46566,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":46568,"t":"code","b":[153,5,212],"m":"sta","o":"sid_v1_attack_decay,y"},{"a":46571,"t":"code","b":[169,8],"m":"lda","o":"#$08"},{"a":46573,"t":"code","b":[153,4,212],"m":"sta","o":"sid_v1_control,y"},{"a":46576,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":46578,"t":"code","b":[157,187,176],"m":"sta","oa":45243,"o":"drum_step_count,x"},{"a":46581,"t":"code","b":[254,168,176],"m":"inc","oa":45224,"o":"stream_position,x"},{"a":46584,"t":"code","b":[188,168,176],"m":"ldy","oa":45224,"o":"stream_position,x"},{"a":46587,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":46589,"t":"code","b":[157,4,176],"m":"sta","oa":45060,"o":"note_countdown,x"},{"a":46592,"t":"code","b":[173,71,176],"m":"lda","oa":45127,"o":"filter_start"},{"a":46595,"t":"code","b":[141,72,176],"m":"sta","oa":45128,"o":"filter_index"},{"a":46598,"t":"code","b":[173,75,176],"m":"lda","oa":45131,"o":"filter_start_hi"},{"a":46601,"t":"code","b":[141,77,176],"m":"sta","oa":45133,"o":"filter_hi"},{"a":46604,"t":"code","b":[173,76,176],"m":"lda","oa":45132,"o":"filter_start_lo"},{"a":46607,"t":"code","b":[141,78,176],"m":"sta","oa":45134,"o":"filter_lo"},{"a":46610,"t":"code","b":[169,1],"m":"lda","o":"#$01"},{"a":46612,"t":"code","b":[141,19,176],"m":"sta","oa":45075,"o":"filter_countdown"},{"a":46615,"t":"code","b":[96],"m":"rts"},{"a":46616,"l":"cmd_filter","c":"Stream command $85: the first byte goes to $B047 (start index into the table $BA62), the second to $B04B and $B04D, the third to $B04C and $B04E, the fourth to the filter control register $D417 and to $B07E,X, after all three of $B07E are cleared. Carries on at $B25C.","t":"code","b":[200],"m":"iny"},{"a":46617,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":46619,"t":"code","b":[141,71,176],"m":"sta","oa":45127,"o":"filter_start"},{"a":46622,"t":"code","b":[200],"m":"iny"},{"a":46623,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":46625,"t":"code","b":[141,75,176],"m":"sta","oa":45131,"o":"filter_start_hi"},{"a":46628,"t":"code","b":[141,77,176],"m":"sta","oa":45133,"o":"filter_hi"},{"a":46631,"t":"code","b":[200],"m":"iny"},{"a":46632,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":46634,"t":"code","b":[141,76,176],"m":"sta","oa":45132,"o":"filter_start_lo"},{"a":46637,"t":"code","b":[141,78,176],"m":"sta","oa":45134,"o":"filter_lo"},{"a":46640,"t":"code","b":[200],"m":"iny"},{"a":46641,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":46643,"t":"code","b":[72],"m":"pha"},{"a":46644,"t":"code","b":[200],"m":"iny"},{"a":46645,"t":"code","b":[152],"m":"tya"},{"a":46646,"t":"code","b":[157,168,176],"m":"sta","oa":45224,"o":"stream_position,x"},{"a":46649,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":46651,"t":"code","b":[141,126,176],"m":"sta","oa":45182,"o":"filter_on"},{"a":46654,"t":"code","b":[141,127,176],"m":"sta","oa":45183,"o":"$B07F"},{"a":46657,"t":"code","b":[141,128,176],"m":"sta","oa":45184,"o":"$B080"},{"a":46660,"t":"code","b":[104],"m":"pla"},{"a":46661,"t":"code","b":[141,23,212],"m":"sta","o":"sid_filter_resonance"},{"a":46664,"t":"code","b":[157,126,176],"m":"sta","oa":45182,"o":"filter_on,x"},{"a":46667,"t":"code","b":[76,92,178],"m":"jmp","oa":45660,"o":"read_stream"},{"a":46670,"l":"pulse_step","c":"Pulse-width sweep of the current voice. Counts $B00D,X down. At zero it reads a step from the table $B9E4 at the index $B02C,X: a frame count (to $B00D), a low and a high step (to $B09C and $B09F); a count of 0 means the next byte is a new index and the read is repeated. Every call it adds the step to the width $B090/$B096 and writes it to the voice's $D402 and $D403. Called by $B176.","t":"code","b":[222,13,176],"m":"dec","oa":45069,"o":"pulse_countdown,x","x":[45513]},{"a":46673,"t":"code","b":[208,40],"m":"bne","oa":46715,"o":"b_B67B"},{"a":46675,"l":"j_B653","t":"code","b":[188,44,176],"m":"ldy","oa":45100,"o":"pulse_index,x","x":[46690]},{"a":46678,"t":"code","b":[185,228,185],"m":"lda","oa":47588,"o":"pulse_table,y"},{"a":46681,"t":"code","b":[208,10],"m":"bne","oa":46693,"o":"b_B665"},{"a":46683,"t":"code","b":[200],"m":"iny"},{"a":46684,"t":"code","b":[185,228,185],"m":"lda","oa":47588,"o":"pulse_table,y"},{"a":46687,"t":"code","b":[157,44,176],"m":"sta","oa":45100,"o":"pulse_index,x"},{"a":46690,"t":"code","b":[76,83,182],"m":"jmp","oa":46675,"o":"j_B653"},{"a":46693,"l":"b_B665","t":"code","b":[157,13,176],"m":"sta","oa":45069,"o":"pulse_countdown,x","x":[46681]},{"a":46696,"t":"code","b":[200],"m":"iny"},{"a":46697,"t":"code","b":[185,228,185],"m":"lda","oa":47588,"o":"pulse_table,y"},{"a":46700,"t":"code","b":[157,156,176],"m":"sta","oa":45212,"o":"pulse_step_lo,x"},{"a":46703,"t":"code","b":[200],"m":"iny"},{"a":46704,"t":"code","b":[185,228,185],"m":"lda","oa":47588,"o":"pulse_table,y"},{"a":46707,"t":"code","b":[157,159,176],"m":"sta","oa":45215,"o":"pulse_step_hi,x"},{"a":46710,"t":"code","b":[200],"m":"iny"},{"a":46711,"t":"code","b":[152],"m":"tya"},{"a":46712,"t":"code","b":[157,44,176],"m":"sta","oa":45100,"o":"pulse_index,x"},{"a":46715,"l":"b_B67B","t":"code","b":[172,110,176],"m":"ldy","oa":45166,"o":"voice_offset","x":[46673]},{"a":46718,"t":"code","b":[189,144,176],"m":"lda","oa":45200,"o":"pulse_lo,x"},{"a":46721,"t":"code","b":[24],"m":"clc"},{"a":46722,"t":"code","b":[125,156,176],"m":"adc","oa":45212,"o":"pulse_step_lo,x"},{"a":46725,"t":"code","b":[157,144,176],"m":"sta","oa":45200,"o":"pulse_lo,x"},{"a":46728,"t":"code","b":[153,2,212],"m":"sta","o":"sid_v1_pulse_lo,y"},{"a":46731,"t":"code","b":[189,150,176],"m":"lda","oa":45206,"o":"pulse_hi,x"},{"a":46734,"t":"code","b":[125,159,176],"m":"adc","oa":45215,"o":"pulse_step_hi,x"},{"a":46737,"t":"code","b":[157,150,176],"m":"sta","oa":45206,"o":"pulse_hi,x"},{"a":46740,"t":"code","b":[153,3,212],"m":"sta","o":"sid_v1_pulse_hi,y"},{"a":46743,"l":"r_B697","t":"code","b":[96],"m":"rts","x":[46747]},{"a":46744,"l":"pitch_slide_step","c":"Pitch slide of the current voice. Returns if $B075,X is zero. Counts $B010,X down. At zero it reads a step (frame count, low step, high step) from the table $BA07, or from $BA5B when $B032 is non-zero, at the index $B035,X into $B010, $B0A2 and $B0A5; a count of 0 means the next byte is a new index. Every call it adds the step to the frequency $B061/$B064. Called by $B176 before the frequency is written.","t":"code","b":[189,117,176],"m":"lda","oa":45173,"o":"slide_on,x","x":[45560]},{"a":46747,"t":"code","b":[240,250],"m":"beq","oa":46743,"o":"r_B697"},{"a":46749,"t":"code","b":[222,16,176],"m":"dec","oa":45072,"o":"slide_countdown,x"},{"a":46752,"t":"code","b":[208,88],"m":"bne","oa":46842,"o":"b_B6FA"},{"a":46754,"t":"code","b":[189,50,176],"m":"lda","oa":45106,"o":"slide_table_select,x"},{"a":46757,"t":"code","b":[240,43],"m":"beq","oa":46802,"o":"b_B6D2"},{"a":46759,"l":"j_B6A7","t":"code","b":[188,53,176],"m":"ldy","oa":45109,"o":"slide_index,x","x":[46774]},{"a":46762,"t":"code","b":[185,91,186],"m":"lda","oa":47707,"o":"arpeggio_table,y"},{"a":46765,"t":"code","b":[208,10],"m":"bne","oa":46777,"o":"b_B6B9"},{"a":46767,"t":"code","b":[200],"m":"iny"},{"a":46768,"t":"code","b":[185,91,186],"m":"lda","oa":47707,"o":"arpeggio_table,y"},{"a":46771,"t":"code","b":[157,53,176],"m":"sta","oa":45109,"o":"slide_index,x"},{"a":46774,"t":"code","b":[76,167,182],"m":"jmp","oa":46759,"o":"j_B6A7"},{"a":46777,"l":"b_B6B9","t":"code","b":[157,16,176],"m":"sta","oa":45072,"o":"slide_countdown,x","x":[46765]},{"a":46780,"t":"code","b":[200],"m":"iny"},{"a":46781,"t":"code","b":[185,91,186],"m":"lda","oa":47707,"o":"arpeggio_table,y"},{"a":46784,"t":"code","b":[157,162,176],"m":"sta","oa":45218,"o":"slide_step_lo,x"},{"a":46787,"t":"code","b":[200],"m":"iny"},{"a":46788,"t":"code","b":[185,91,186],"m":"lda","oa":47707,"o":"arpeggio_table,y"},{"a":46791,"t":"code","b":[157,165,176],"m":"sta","oa":45221,"o":"slide_step_hi,x"},{"a":46794,"t":"code","b":[200],"m":"iny"},{"a":46795,"t":"code","b":[152],"m":"tya"},{"a":46796,"t":"code","b":[157,53,176],"m":"sta","oa":45109,"o":"slide_index,x"},{"a":46799,"t":"code","b":[76,250,182],"m":"jmp","oa":46842,"o":"b_B6FA"},{"a":46802,"l":"b_B6D2","t":"code","b":[188,53,176],"m":"ldy","oa":45109,"o":"slide_index,x","x":[46757,46817]},{"a":46805,"t":"code","b":[185,7,186],"m":"lda","oa":47623,"o":"pitch_slide_table,y"},{"a":46808,"t":"code","b":[208,10],"m":"bne","oa":46820,"o":"b_B6E4"},{"a":46810,"t":"code","b":[200],"m":"iny"},{"a":46811,"t":"code","b":[185,7,186],"m":"lda","oa":47623,"o":"pitch_slide_table,y"},{"a":46814,"t":"code","b":[157,53,176],"m":"sta","oa":45109,"o":"slide_index,x"},{"a":46817,"t":"code","b":[76,210,182],"m":"jmp","oa":46802,"o":"b_B6D2"},{"a":46820,"l":"b_B6E4","t":"code","b":[157,16,176],"m":"sta","oa":45072,"o":"slide_countdown,x","x":[46808]},{"a":46823,"t":"code","b":[200],"m":"iny"},{"a":46824,"t":"code","b":[185,7,186],"m":"lda","oa":47623,"o":"pitch_slide_table,y"},{"a":46827,"t":"code","b":[157,162,176],"m":"sta","oa":45218,"o":"slide_step_lo,x"},{"a":46830,"t":"code","b":[200],"m":"iny"},{"a":46831,"t":"code","b":[185,7,186],"m":"lda","oa":47623,"o":"pitch_slide_table,y"},{"a":46834,"t":"code","b":[157,165,176],"m":"sta","oa":45221,"o":"slide_step_hi,x"},{"a":46837,"t":"code","b":[200],"m":"iny"},{"a":46838,"t":"code","b":[152],"m":"tya"},{"a":46839,"t":"code","b":[157,53,176],"m":"sta","oa":45109,"o":"slide_index,x"},{"a":46842,"l":"b_B6FA","t":"code","b":[172,110,176],"m":"ldy","oa":45166,"o":"voice_offset","x":[46752,46799]},{"a":46845,"t":"code","b":[189,97,176],"m":"lda","oa":45153,"o":"freq_lo,x"},{"a":46848,"t":"code","b":[24],"m":"clc"},{"a":46849,"t":"code","b":[125,162,176],"m":"adc","oa":45218,"o":"slide_step_lo,x"},{"a":46852,"t":"code","b":[157,97,176],"m":"sta","oa":45153,"o":"freq_lo,x"},{"a":46855,"t":"code","b":[189,100,176],"m":"lda","oa":45156,"o":"freq_hi,x"},{"a":46858,"t":"code","b":[125,165,176],"m":"adc","oa":45221,"o":"slide_step_hi,x"},{"a":46861,"t":"code","b":[157,100,176],"m":"sta","oa":45156,"o":"freq_hi,x"},{"a":46864,"t":"code","b":[96],"m":"rts"},{"a":46865,"l":"arpeggio_step","c":"Arpeggio of the current voice. Returns if $B07B,X is zero. Counts $B0AB,X down; at zero it reloads it from $B0AE, reads the step at $B0B1,X from the list at $B03B/$B041, adds it to the note $B067 and the offsets $B08A and $B08D, looks the sum up in $B8C2 and $B920 and writes the frequency to the voice's $D400/$D401. $B0B1 is counted up and returns to 0 at $B0B4. Called by $B176.","t":"code","b":[189,123,176],"m":"lda","oa":45179,"o":"arp_on,x","x":[45516]},{"a":46868,"t":"code","b":[240,71],"m":"beq","oa":46941,"o":"r_B75D"},{"a":46870,"t":"code","b":[222,171,176],"m":"dec","oa":45227,"o":"arp_countdown,x"},{"a":46873,"t":"code","b":[240,1],"m":"beq","oa":46876,"o":"b_B71C"},{"a":46875,"t":"code","b":[96],"m":"rts"},{"a":46876,"l":"b_B71C","t":"code","b":[189,59,176],"m":"lda","oa":45115,"o":"arp_ptr_lo,x","x":[46873]},{"a":46879,"t":"code","b":[133,240],"m":"sta","oa":240,"o":"stream_ptr_lo"},{"a":46881,"t":"code","b":[189,65,176],"m":"lda","oa":45121,"o":"arp_ptr_hi,x"},{"a":46884,"t":"code","b":[133,241],"m":"sta","oa":241,"o":"stream_ptr_hi"},{"a":46886,"t":"code","b":[189,174,176],"m":"lda","oa":45230,"o":"arp_reload,x"},{"a":46889,"t":"code","b":[157,171,176],"m":"sta","oa":45227,"o":"arp_countdown,x"},{"a":46892,"t":"code","b":[188,177,176],"m":"ldy","oa":45233,"o":"arp_index,x"},{"a":46895,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":46897,"t":"code","b":[24],"m":"clc"},{"a":46898,"t":"code","b":[125,103,176],"m":"adc","oa":45159,"o":"note,x"},{"a":46901,"t":"code","b":[125,138,176],"m":"adc","oa":45194,"o":"pitch_offset,x"},{"a":46904,"t":"code","b":[125,141,176],"m":"adc","oa":45197,"o":"transpose,x"},{"a":46907,"t":"code","b":[172,110,176],"m":"ldy","oa":45166,"o":"voice_offset"},{"a":46910,"t":"code","b":[170],"m":"tax"},{"a":46911,"t":"code","b":[189,194,184],"m":"lda","oa":47298,"o":"note_freq_lo,x"},{"a":46914,"t":"code","b":[153,0,212],"m":"sta","o":"sid_v1_freq_lo,y"},{"a":46917,"t":"code","b":[189,32,185],"m":"lda","oa":47392,"o":"note_freq_hi,x"},{"a":46920,"t":"code","b":[153,1,212],"m":"sta","o":"sid_v1_freq_hi,y"},{"a":46923,"t":"code","b":[166,250],"m":"ldx","oa":250,"o":"voice_index"},{"a":46925,"t":"code","b":[254,177,176],"m":"inc","oa":45233,"o":"arp_index,x"},{"a":46928,"t":"code","b":[189,177,176],"m":"lda","oa":45233,"o":"arp_index,x"},{"a":46931,"t":"code","b":[221,180,176],"m":"cmp","oa":45236,"o":"arp_length,x"},{"a":46934,"t":"code","b":[208,5],"m":"bne","oa":46941,"o":"r_B75D"},{"a":46936,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":46938,"t":"code","b":[157,177,176],"m":"sta","oa":45233,"o":"arp_index,x"},{"a":46941,"l":"r_B75D","t":"code","b":[96],"m":"rts","x":[46868,46934]},{"a":46942,"l":"filter_sweep_step","c":"Filter sweep, once per call. Counts $B013 down; at zero it reads a step from the table $BA62 at $B048: a frame count (to $B013), a low and a high step (to $B049 and $B04A); a count of 0 means the next byte is a new index. It adds the step to the 16-bit filter value $B04D/$B04E and writes its low three bits to $D415 and a byte made from its upper bits to $D416. Called by $B176 after the voices.","t":"code","b":[206,19,176],"m":"dec","oa":45075,"o":"filter_countdown","x":[45588]},{"a":46945,"t":"code","b":[208,39],"m":"bne","oa":46986,"o":"b_B78A"},{"a":46947,"l":"j_B763","t":"code","b":[172,72,176],"m":"ldy","oa":45128,"o":"filter_index","x":[46962]},{"a":46950,"t":"code","b":[185,98,186],"m":"lda","oa":47714,"o":"filter_sweep_table,y"},{"a":46953,"t":"code","b":[208,10],"m":"bne","oa":46965,"o":"b_B775"},{"a":46955,"t":"code","b":[200],"m":"iny"},{"a":46956,"t":"code","b":[185,98,186],"m":"lda","oa":47714,"o":"filter_sweep_table,y"},{"a":46959,"t":"code","b":[141,72,176],"m":"sta","oa":45128,"o":"filter_index"},{"a":46962,"t":"code","b":[76,99,183],"m":"jmp","oa":46947,"o":"j_B763"},{"a":46965,"l":"b_B775","t":"code","b":[141,19,176],"m":"sta","oa":45075,"o":"filter_countdown","x":[46953]},{"a":46968,"t":"code","b":[200],"m":"iny"},{"a":46969,"t":"code","b":[185,98,186],"m":"lda","oa":47714,"o":"filter_sweep_table,y"},{"a":46972,"t":"code","b":[141,73,176],"m":"sta","oa":45129,"o":"filter_step_lo"},{"a":46975,"t":"code","b":[200],"m":"iny"},{"a":46976,"t":"code","b":[185,98,186],"m":"lda","oa":47714,"o":"filter_sweep_table,y"},{"a":46979,"t":"code","b":[141,74,176],"m":"sta","oa":45130,"o":"filter_step_hi"},{"a":46982,"t":"code","b":[200],"m":"iny"},{"a":46983,"t":"code","b":[140,72,176],"m":"sty","oa":45128,"o":"filter_index"},{"a":46986,"l":"b_B78A","t":"code","b":[173,78,176],"m":"lda","oa":45134,"o":"filter_lo","x":[46945]},{"a":46989,"t":"code","b":[24],"m":"clc"},{"a":46990,"t":"code","b":[109,73,176],"m":"adc","oa":45129,"o":"filter_step_lo"},{"a":46993,"t":"code","b":[141,78,176],"m":"sta","oa":45134,"o":"filter_lo"},{"a":46996,"t":"code","b":[141,183,176],"m":"sta","oa":45239,"o":"filter_scratch"},{"a":46999,"t":"code","b":[41,7],"m":"and","o":"#$07"},{"a":47001,"t":"code","b":[141,21,212],"m":"sta","o":"sid_filter_cutoff_lo"},{"a":47004,"t":"code","b":[173,77,176],"m":"lda","oa":45133,"o":"filter_hi"},{"a":47007,"t":"code","b":[109,74,176],"m":"adc","oa":45130,"o":"filter_step_hi"},{"a":47010,"t":"code","b":[141,77,176],"m":"sta","oa":45133,"o":"filter_hi"},{"a":47013,"t":"code","b":[74],"m":"lsr","o":"a"},{"a":47014,"t":"code","b":[110,183,176],"m":"ror","oa":45239,"o":"filter_scratch"},{"a":47017,"t":"code","b":[74],"m":"lsr","o":"a"},{"a":47018,"t":"code","b":[110,183,176],"m":"ror","oa":45239,"o":"filter_scratch","x":[45940]},{"a":47021,"t":"code","b":[74],"m":"lsr","o":"a"},{"a":47022,"t":"code","b":[173,183,176],"m":"lda","oa":45239,"o":"filter_scratch"},{"a":47025,"t":"code","b":[106],"m":"ror","o":"a"},{"a":47026,"t":"code","b":[141,22,212],"m":"sta","o":"sid_filter_cutoff_hi"},{"a":47029,"t":"code","b":[96],"m":"rts"},{"a":47030,"l":"drum_step","c":"Plays the drum lists of the three voices, X from 2 down to 0, for every voice with $B081 set. While the step count $B0BB differs from the list length $B0B8 it patches the list addresses $B04F/$B055 and $B052/$B058 into the operands at $B80F and $B801 and writes the frequency entry to the voice's $D400 and $D401, 8 to $D404 and then the control entry to $D404; it counts $B0BB up. When they are equal and $B000 is non-zero it clears $D404-$D406 of the voice. Called by $B176 after the voice loop.","t":"code","b":[162,2],"m":"ldx","o":"#$02","x":[45585]},{"a":47032,"l":"b_B7B8","t":"code","b":[189,129,176],"m":"lda","oa":45185,"o":"drum_on,x","x":[47065,47133]},{"a":47035,"t":"code","b":[240,27],"m":"beq","oa":47064,"o":"b_B7D8"},{"a":47037,"t":"code","b":[189,187,176],"m":"lda","oa":45243,"o":"drum_step_count,x"},{"a":47040,"t":"code","b":[221,184,176],"m":"cmp","oa":45240,"o":"drum_length,x"},{"a":47043,"t":"code","b":[208,23],"m":"bne","oa":47068,"o":"b_B7DC"},{"a":47045,"t":"code","b":[173,0,176],"m":"lda","oa":45056,"o":"driver_flag"},{"a":47048,"t":"code","b":[240,14],"m":"beq","oa":47064,"o":"b_B7D8"},{"a":47050,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":47052,"t":"code","b":[188,180,184],"m":"ldy","oa":47284,"o":"voice_offsets,x"},{"a":47055,"t":"code","b":[153,4,212],"m":"sta","o":"sid_v1_control,y"},{"a":47058,"t":"code","b":[153,5,212],"m":"sta","o":"sid_v1_attack_decay,y"},{"a":47061,"t":"code","b":[153,6,212],"m":"sta","o":"sid_v1_sustain_release,y"},{"a":47064,"l":"b_B7D8","t":"code","b":[202],"m":"dex","x":[47035,47048]},{"a":47065,"t":"code","b":[16,221],"m":"bpl","oa":47032,"o":"b_B7B8"},{"a":47067,"t":"code","b":[96],"m":"rts"},{"a":47068,"l":"b_B7DC","t":"code","b":[142,2,176],"m":"stx","oa":45058,"o":"voice_scratch","x":[47043]},{"a":47071,"t":"code","b":[141,3,176],"m":"sta","oa":45059,"o":"step_scratch"},{"a":47074,"t":"code","b":[189,82,176],"m":"lda","oa":45138,"o":"drum_freq_lo,x"},{"a":47077,"t":"code","b":[141,1,184],"m":"sta","oa":47105,"o":"drum_freq_operand_low"},{"a":47080,"t":"code","b":[189,88,176],"m":"lda","oa":45144,"o":"drum_freq_hi,x"},{"a":47083,"t":"code","b":[141,2,184],"m":"sta","oa":47106,"o":"drum_freq_operand_high"},{"a":47086,"t":"code","b":[189,79,176],"m":"lda","oa":45135,"o":"drum_ctrl_lo,x"},{"a":47089,"t":"code","b":[141,15,184],"m":"sta","oa":47119,"o":"drum_ctrl_operand_low"},{"a":47092,"t":"code","b":[189,85,176],"m":"lda","oa":45141,"o":"drum_ctrl_hi,x"},{"a":47095,"t":"code","b":[141,16,184],"m":"sta","oa":47120,"o":"drum_ctrl_operand_high"},{"a":47098,"t":"code","b":[188,180,184],"m":"ldy","oa":47284,"o":"voice_offsets,x"},{"a":47101,"t":"code","b":[174,3,176],"m":"ldx","oa":45059,"o":"step_scratch"},{"a":47104,"t":"code","b":[189,168,185],"m":"lda","oa":47528,"o":"$B9A8,x"},{"a":47105,"t":"note","l":"drum_freq_operand_low","c":"Low byte of the address operand of the LDA ...,X at $B800, overwritten by the drum step with the address of the drum frequency list.","note":"inside the item at $B800","x":[47077]},{"a":47106,"t":"note","l":"drum_freq_operand_high","c":"High byte of the address operand of the LDA ...,X at $B800, overwritten by the drum step with the address of the drum frequency list.","note":"inside the item at $B800","x":[47083]},{"a":47107,"t":"code","b":[153,0,212],"m":"sta","o":"sid_v1_freq_lo,y"},{"a":47110,"t":"code","b":[153,1,212],"m":"sta","o":"sid_v1_freq_hi,y"},{"a":47113,"t":"code","b":[169,8],"m":"lda","o":"#$08"},{"a":47115,"t":"code","b":[153,4,212],"m":"sta","o":"sid_v1_control,y"},{"a":47118,"t":"code","b":[189,156,185],"m":"lda","oa":47516,"o":"drum_lists,x"},{"a":47119,"t":"note","l":"drum_ctrl_operand_low","c":"Low byte of the address operand of the LDA ...,X at $B80E, overwritten by the drum step with the address of the drum control list.","note":"inside the item at $B80E","x":[47089]},{"a":47120,"t":"note","l":"drum_ctrl_operand_high","c":"High byte of the address operand of the LDA ...,X at $B80E, overwritten by the drum step with the address of the drum control list.","note":"inside the item at $B80E","x":[47095]},{"a":47121,"t":"code","b":[153,4,212],"m":"sta","o":"sid_v1_control,y"},{"a":47124,"t":"code","b":[174,2,176],"m":"ldx","oa":45058,"o":"voice_scratch"},{"a":47127,"t":"code","b":[254,187,176],"m":"inc","oa":45243,"o":"drum_step_count,x"},{"a":47130,"t":"code","b":[202],"m":"dex"},{"a":47131,"t":"code","b":[48,3],"m":"bmi","oa":47136,"o":"r_B820"},{"a":47133,"t":"code","b":[76,184,183],"m":"jmp","oa":47032,"o":"b_B7B8"},{"a":47136,"l":"r_B820","t":"code","b":[96],"m":"rts","x":[47131]},{"a":47137,"l":"voices_active","c":"Returns in A the OR of the voice flags $F7, $F8 and $F9, which is non-zero while any voice is playing.","t":"code","b":[165,247],"m":"lda","oa":247,"o":"voice0_active"},{"a":47139,"t":"code","b":[5,248],"m":"ora","oa":248,"o":"voice1_active"},{"a":47141,"t":"code","b":[5,249],"m":"ora","oa":249,"o":"voice2_active"},{"a":47143,"t":"code","b":[96],"m":"rts"},{"a":47144,"l":"silence_all","c":"Stops all sound: clears the voice flags $F7-$F9, the fade flags $B0BE and $B0C2 and the volume register $D418, sets the keep flags $B0C4-$B0C6 to $FF and writes 8 to the control registers $D404, $D40B and $D412. $B176 calls it when a fade-out has run down, and the levels call it when a level ends or the game is over.","t":"code","b":[169,0],"m":"lda","o":"#$00","x":[45495]},{"a":47146,"t":"code","b":[133,247],"m":"sta","oa":247,"o":"voice0_active"},{"a":47148,"t":"code","b":[133,248],"m":"sta","oa":248,"o":"voice1_active"},{"a":47150,"t":"code","b":[133,249],"m":"sta","oa":249,"o":"voice2_active"},{"a":47152,"t":"code","b":[141,190,176],"m":"sta","oa":45246,"o":"fade_out_on"},{"a":47155,"t":"code","b":[141,194,176],"m":"sta","oa":45250,"o":"fade_in_on"},{"a":47158,"t":"code","b":[141,24,212],"m":"sta","o":"sid_filter_mode_volume"},{"a":47161,"t":"code","b":[169,255],"m":"lda","o":"#$FF"},{"a":47163,"t":"code","b":[141,196,176],"m":"sta","oa":45252,"o":"keep_flags"},{"a":47166,"t":"code","b":[141,197,176],"m":"sta","oa":45253,"o":"$B0C5"},{"a":47169,"t":"code","b":[141,198,176],"m":"sta","oa":45254,"o":"$B0C6"},{"a":47172,"t":"code","b":[169,8],"m":"lda","o":"#$08"},{"a":47174,"t":"code","b":[141,4,212],"m":"sta","o":"sid_v1_control"},{"a":47177,"t":"code","b":[141,11,212],"m":"sta","o":"sid_v2_control"},{"a":47180,"t":"code","b":[141,18,212],"m":"sta","o":"sid_v3_control"},{"a":47183,"t":"code","b":[96],"m":"rts"},{"a":47184,"l":"start_fade_out","c":"Starts a fade-out: stores A in $B0BE, $B0BF and $B0C0 (so A is also the rate) and clears the fade-in flag $B0C2. No call to it was found in the level 1 snapshot.","t":"code","b":[141,190,176],"m":"sta","oa":45246,"o":"fade_out_on"},{"a":47187,"t":"code","b":[141,191,176],"m":"sta","oa":45247,"o":"fade_counter"},{"a":47190,"t":"code","b":[141,192,176],"m":"sta","oa":45248,"o":"fade_rate"},{"a":47193,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":47195,"t":"code","b":[141,194,176],"m":"sta","oa":45250,"o":"fade_in_on"},{"a":47198,"t":"code","b":[96],"m":"rts"},{"a":47199,"l":"cmd_end_voice","c":"Stream command $8A: ends the voice: clears its active flag $F7+X and writes 0 to its control register $D404, then returns.","t":"code","b":[169,0],"m":"lda","o":"#$00","x":[45861]},{"a":47201,"t":"code","b":[149,247],"m":"sta","oa":247,"o":"voice0_active,x"},{"a":47203,"t":"code","b":[172,110,176],"m":"ldy","oa":45166,"o":"voice_offset"},{"a":47206,"t":"code","b":[153,4,212],"m":"sta","o":"sid_v1_control,y"},{"a":47209,"t":"code","b":[96],"m":"rts"},{"a":47210,"l":"cmd_set_stream","c":"Stream command $8B: loads the voice's stream pointer $B05B/$B05E from the next two bytes, sets the stream position $B0A8 to 0 and carries on at $B25C.","t":"code","b":[200],"m":"iny"},{"a":47211,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":47213,"t":"code","b":[157,91,176],"m":"sta","oa":45147,"o":"stream_lo,x"},{"a":47216,"t":"code","b":[200],"m":"iny"},{"a":47217,"t":"code","b":[177,240],"m":"lda","oa":240,"o":"(stream_ptr_lo),y"},{"a":47219,"t":"code","b":[157,94,176],"m":"sta","oa":45150,"o":"stream_hi,x"},{"a":47222,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":47224,"t":"code","b":[157,168,176],"m":"sta","oa":45224,"o":"stream_position,x"},{"a":47227,"t":"code","b":[76,92,178],"m":"jmp","oa":45660,"o":"read_stream"},{"a":47230,"l":"stream_command_lo","c":"Low bytes of the handler addresses of stream commands $80-$8D (14 bytes), read by the instruction at $B317 as $B7FE,X with X from $80. With the high bytes at $B88C the handlers are, in order: $B328, $B501, $B51F, $B539, $B552, $B618, $B5AC, $B590, $B5A1, $B5AC, $B85F, $B86A, $B87E, $B552. The entry for $8C is the address of this table, so that command would run data.","t":"byte","b":[40,1,31,57,82,24,172,144]},{"a":47238,"t":"byte","b":[161,172,95,106,126,82]},{"a":47244,"l":"stream_command_hi","c":"High bytes of the handler addresses of stream commands $80-$8D (14 bytes), read as $B80C,X by the instruction at $B31D; the low bytes are at $B87E.","t":"byte","b":[179,181,181,181,181,182,181,181]},{"a":47252,"t":"byte","b":[181,181,184,184,184,181]},{"a":47258,"l":"track_command_lo","c":"Low bytes of the handler addresses of track commands $F0-$F5 (6 bytes), read as $B7AA,X at $B374 with X from $F0. With the high bytes at $B8A0 the handlers are: $B385, $B38E, $B39D, $B3AE, $B3BD, $B3D2.","t":"byte","b":[133,142,157,174,189,210]},{"a":47264,"l":"track_command_hi","c":"High bytes of the handler addresses of track commands $F0-$F5 (6 bytes), read as $B7B0,X at $B37A; the low bytes are at $B89A.","t":"byte","b":[179,179,179,179,179,179]},{"a":47270,"l":"wave_command_lo","c":"Low bytes of the handler addresses of wave-program commands 0-6 (7 bytes), read as $B8A6,X at $B431. With the high bytes at $B8AD the handlers are: $B442, $B44E, $B462, $B481, $B49A, $B4B7, $B4ED.","t":"byte","b":[66,78,98,129,154,183,237],"x":[46129]},{"a":47277,"l":"wave_command_hi","c":"High bytes of the handler addresses of wave-program commands 0-6 (7 bytes), read as $B8AD,X at $B437; the low bytes are at $B8A6.","t":"byte","b":[180,180,180,180,180,180,180],"x":[46135]},{"a":47284,"l":"voice_offsets","c":"Offsets of the three voices' SID registers from $D400: 00 07 0E (voice 0 at $D400, voice 1 at $D407, voice 2 at $D40E). Read by $B176, $B0EE, $B7B6 and $B7DC.","t":"byte","b":[0,7,14],"x":[45350,45442,47052,47098]},{"a":47287,"l":"idle_program","c":"11 bytes, 00 FF 01 B7 B8 FF 00 00 4C BC B8. The first five are the idle wave program that $B138 gives every voice: command 0 with a wait of $FF frames, then command 1 jumping to its own start at $B8B7. The six after it, FF 00 00 4C BC B8, end in a JMP to $B8BC and are not read by the driver.","t":"byte","b":[0,255,1,183,184,255,0,0]},{"a":47295,"t":"byte","b":[76,188,184]},{"a":47298,"l":"note_freq_lo","c":"Low bytes of the 94-entry table of SID frequency values, with the high bytes at $B920. The index is a note number plus the offsets $B08A and $B08D; it is looked up by $B176, $B3F8 and $B711. Entry 0 is $0578, entries 1 to 93 rise from $0128 to $EB00.","t":"byte","b":[120,40,58,76,96,117,139,163],"x":[45548,46096,46911]},{"a":47306,"t":"byte","b":[188,214,242,16,47,80,115,153]},{"a":47314,"t":"byte","b":[192,234,22,69,119,172,228,31]},{"a":47322,"t":"byte","b":[94,160,231,50,128,212,45,139]},{"a":47330,"t":"byte","b":[238,88,200,62,188,65,205,99]},{"a":47338,"t":"byte","b":[1,168,90,22,221,176,144,124]},{"a":47346,"t":"byte","b":[119,129,155,197,2,81,180,44]},{"a":47354,"t":"byte","b":[186,96,31,249,239,3,54,139]},{"a":47362,"t":"byte","b":[3,161,103,87,115,192,62,241]},{"a":47370,"t":"byte","b":[222,5,108,22,6,67,206,174]},{"a":47378,"t":"byte","b":[231,128,125,228,187,10,215,44]},{"a":47386,"t":"byte","b":[13,133,156,92,207,0]},{"a":47392,"l":"note_freq_hi","c":"High bytes of the 94-entry table of SID frequency values (94 bytes); the low bytes are at $B8C2. Entry 0 is $0578 and entry 93 is $EB00.","t":"byte","b":[5,1,1,1,1,1,1,1],"x":[45554,46102,46917]},{"a":47400,"t":"byte","b":[1,1,1,2,2,2,2,2]},{"a":47408,"t":"byte","b":[2,2,3,3,3,3,3,4]},{"a":47416,"t":"byte","b":[4,4,4,5,5,5,6,6]},{"a":47424,"t":"byte","b":[6,7,7,8,8,9,9,10]},{"a":47432,"t":"byte","b":[11,11,12,13,13,14,15,16]},{"a":47440,"t":"byte","b":[17,18,19,20,22,23,24,26]},{"a":47448,"t":"byte","b":[27,29,31,32,34,37,39,41]},{"a":47456,"t":"byte","b":[44,46,49,52,55,58,62,65]},{"a":47464,"t":"byte","b":[69,74,78,83,88,93,98,104]},{"a":47472,"t":"byte","b":[110,117,124,131,139,148,156,166]},{"a":47480,"t":"byte","b":[176,186,197,209,221,235]},{"a":47486,"l":"drum_records","c":"6 records of 5 bytes, chosen by the offset after stream command $86 or $89 ($B5AC): list address (2 bytes), list length, sustain/release value and pulse width high byte. They are, by offset: 00: list $B99C length $0C sustain/release $E8 pulse high $08; 05: list $B9B4 length $0C sustain/release $D9 pulse high $08; 0A: list $B9CC length $0C sustain/release $D8 pulse high $08; 0F: list $B9CC length $0C sustain/release $B8 pulse high $08; 14: list $B9CC length $0C sustain/release $78 pulse high $08; 19: list $B9CC length $0C sustain/release $38 pulse high $08.","t":"byte","b":[156,185,12,232,8,180,185,12],"x":[46522]},{"a":47494,"t":"byte","b":[217,8,204,185,12,216,8,204]},{"a":47502,"t":"byte","b":[185,12,184,8,204,185,12,120]},{"a":47510,"t":"byte","b":[8,204,185,12,56,8]},{"a":47516,"l":"drum_lists","c":"The drum lists the records at $B97E point to, 72 bytes. A list is a run of control register values for $D404 followed by a run of the same length of values that $B7B6 writes to both $D400 and $D401; a record's length is the length of each run. Lists may be shared by several records.","t":"byte","b":[8,129,65,65,16,16,16,128],"x":[47118]},{"a":47524,"t":"byte","b":[128,128,128,128,0,128,13,6]},{"a":47532,"t":"byte","b":[7,6,37,67,66,64,64,64]},{"a":47540,"t":"byte","b":[8,129,17,129,16,128,16,128]},{"a":47548,"t":"byte","b":[16,128,16,128,0,112,14,112]},{"a":47556,"t":"byte","b":[13,112,13,112,9,112,9,112]},{"a":47564,"t":"byte","b":[8,129,65,65,16,16,16,16]},{"a":47572,"t":"byte","b":[16,16,16,16,0,255,15,8]},{"a":47580,"t":"byte","b":[11,11,10,10,9,9,8,7]},{"a":47588,"l":"pulse_table","c":"Pulse-width sweep steps, 35 bytes, read by $B64E with the index in $B02C and started by stream command $82. A step is three bytes: a frame count, then the low and high bytes of the amount added to the pulse width each frame. A count of 0 is followed by the index to go back to instead. Programs start at offsets $00, $05, $10 and $1B.","t":"byte","b":[255,0,0,0,0,5,20,0],"x":[45912,45917,46678,46684,46697,46704]},{"a":47596,"t":"byte","b":[5,216,255,5,20,0,0,5]},{"a":47604,"t":"byte","b":[5,50,0,10,206,255,5,50]},{"a":47612,"t":"byte","b":[0,0,16,2,150,0,2,106]},{"a":47620,"t":"byte","b":[255,0,27]},{"a":47623,"l":"pitch_slide_table","c":"Pitch-slide steps, 84 bytes, read by $B698 with the index in $B035 and started by stream command $83. A step is three bytes: a frame count, then the low and high bytes of the amount added to the voice's frequency each frame. A count of 0 is followed by the index to go back to instead.","t":"byte","b":[255,0,0,0,0,255,156,255],"x":[46805,46811,46824,46831]},{"a":47631,"t":"byte","b":[0,0,4,0,0,9,56,255]},{"a":47639,"t":"byte","b":[0,0,1,32,3,3,0,0]},{"a":47647,"t":"byte","b":[0,18,1,60,0,0,18,1]},{"a":47655,"t":"byte","b":[196,9,1,60,246,0,31,9]},{"a":47663,"t":"byte","b":[4,0,255,12,0,0,39,2]},{"a":47671,"t":"byte","b":[20,0,1,200,0,1,56,255]},{"a":47679,"t":"byte","b":[1,200,0,1,56,255,1,200]},{"a":47687,"t":"byte","b":[0,1,56,255,1,200,0,1]},{"a":47695,"t":"byte","b":[56,255,6,251,255,0,47,1]},{"a":47703,"t":"byte","b":[100,0,0,47]},{"a":47707,"l":"arpeggio_table","c":"7 bytes: the pointer table for stream command $84 (one entry, $BA5D, at $BA5B/$BA5C) and the entry it points to: 01 03 00 05 0C, which gives 1 frame per step, 3 steps and the step values 0, 5 and 12 added to the note. $B698 also reads $BA5B as a slide table, but only when $B032 is non-zero, which nothing sets.","t":"byte","b":[93,186,1,3,0,5,12],"x":[46432,46762,46768,46781,46788]},{"a":47714,"l":"filter_sweep_table","c":"Filter-sweep steps, 26 bytes, read by $B75E with the index in $B048 and started by stream command $85. A step is three bytes: a frame count, then the low and high bytes of the amount added to the filter value. A count of 0 is followed by the index to go back to instead. Programs start at offsets $00, $05, $10 and $15.","t":"byte","b":[255,0,0,0,0,2,0,254],"x":[46950,46956,46969,46976]},{"a":47722,"t":"byte","b":[8,231,255,8,22,0,0,8]},{"a":47730,"t":"byte","b":[255,60,0,0,0,255,255,255]},{"a":47738,"t":"byte","b":[0,21]},{"a":47740,"l":"wave_program_table","c":"10 addresses of wave programs (20 bytes), chosen by stream command $81 with the program number as the index: $BA90, $BA9F, $BAAE, $BAC5, $BAD4, $BB04, $BB13, $BB1F, $BB2F, $BB3B.","t":"byte","b":[144,186,159,186,174,186,197,186],"x":[46352]},{"a":47748,"t":"byte","b":[212,186,4,187,19,187,31,187]},{"a":47756,"t":"byte","b":[47,187,59,187]},{"a":47760,"l":"wave_programs","c":"The wave programs, 184 bytes, started at the addresses in the table at $BA7C. A program is a list of commands for $B3F8, each a command number 0 to 6 followed by its parameters: 0 waits, 1 jumps to an address, 2 sets attack/decay and sustain/release, 3 sets the control register $D404 and waits, 4 does the same relative to the note end, 5 also changes the pitch, 6 only moves on. The idle program that new voices start with is at $B8B7.","t":"byte","b":[2,0,215,3,65,3,3,64]},{"a":47768,"t":"byte","b":[1,3,32,1,1,150,186,2]},{"a":47776,"t":"byte","b":[0,215,3,21,3,3,20,3]},{"a":47784,"t":"byte","b":[3,18,3,1,165,186,2,1]},{"a":47792,"t":"byte","b":[168,3,17,1,5,129,1,0]},{"a":47800,"t":"byte","b":[3,17,1,5,129,1,0,3]},{"a":47808,"t":"byte","b":[128,255,1,191,186,2,0,167]},{"a":47816,"t":"byte","b":[3,17,3,3,32,1,3,16]},{"a":47824,"t":"byte","b":[1,1,203,186,2,0,184,3]},{"a":47832,"t":"byte","b":[65,3,3,64,8,2,0,167]},{"a":47840,"t":"byte","b":[3,65,3,3,64,8,2,0]},{"a":47848,"t":"byte","b":[135,3,65,3,3,64,8,2]},{"a":47856,"t":"byte","b":[0,87,3,65,3,3,64,8]},{"a":47864,"t":"byte","b":[2,0,23,3,65,3,3,64]},{"a":47872,"t":"byte","b":[8,1,254,186,2,2,250,3]},{"a":47880,"t":"byte","b":[129,6,3,128,8,3,0,4]},{"a":47888,"t":"byte","b":[1,10,187,2,146,248,3,129]},{"a":47896,"t":"byte","b":[9,3,128,255,1,25,187,2]},{"a":47904,"t":"byte","b":[1,162,5,129,1,0,3,129]},{"a":47912,"t":"byte","b":[2,3,128,255,1,41,187,2]},{"a":47920,"t":"byte","b":[1,86,4,65,3,3,64,255]},{"a":47928,"t":"byte","b":[1,53,187,2,0,177,5,129]},{"a":47936,"t":"byte","b":[1,36,3,17,2,1,62,187]},{"a":47944,"l":"sound_table","c":"The sound table, 44 bytes: 11 rows of 4 bytes, one per sound effect, so the number passed to $B0EE in X is the row offset. A row has the stream numbers for voices 0 to 2 (an entry with bit 7 set leaves the voice alone) and a zero. Streams by row offset (-- means none): 00: 00 -- --; 04: -- 01 02; 08: 03 -- --; 0C: -- 04 05; 10: -- 06 07; 14: -- 08 09; 18: 0A -- --; 1C: 0B -- --; 20: -- 0C 0D; 24: -- 0E 0F; 28: -- 10 11.","t":"byte","b":[0,128,128,0,128,1,2,0],"x":[45301]},{"a":47952,"t":"byte","b":[3,128,128,0,128,4,5,0]},{"a":47960,"t":"byte","b":[128,6,7,0,128,8,9,0]},{"a":47968,"t":"byte","b":[10,128,128,0,11,128,128,0]},{"a":47976,"t":"byte","b":[128,12,13,0,128,14,15,0]},{"a":47984,"t":"byte","b":[128,16,17,0]},{"a":47988,"l":"stream_pointer_table","c":"18 addresses of sound streams (36 bytes), indexed by twice the stream number taken from the sound table at $BB48: $BB98, $BB9C, $BBA7, $BBAE, $BBB5, $BBB5, $BBC4, $BBCF, $BBDC, $BBE3, $BBEA, $BBFD, $BC01, $BC06, $BC0D, $BC1F, $BC2E, $BC35. The streams numbered 4 and 5 are the same.","t":"byte","b":[152,187,156,187,167,187,174,187],"x":[45311]},{"a":47996,"t":"byte","b":[181,187,181,187,196,187,207,187]},{"a":48004,"t":"byte","b":[220,187,227,187,234,187,253,187]},{"a":48012,"t":"byte","b":[1,188,6,188,13,188,31,188]},{"a":48020,"t":"byte","b":[46,188,53,188]},{"a":48024,"l":"sound_streams","c":"The 18 sound streams, 161 bytes, started from the addresses in the table at $BB74. A stream is a series of entries read by $B25C: a note number below $60 followed by its length in frames, $60 and a length for a rest, or a command $80-$8D with its parameters (for instance $81 and a wave program number, $86 and a drum number, $8A to end the voice). Streams 4 and 5 share their data.","t":"byte","b":[134,0,12,138,129,0,130,5]},{"a":48032,"t":"byte","b":[8,0,131,5,33,12,138,129]},{"a":48040,"t":"byte","b":[1,131,5,60,12,138,129,2]},{"a":48048,"t":"byte","b":[131,10,48,15,138,129,3,132]},{"a":48056,"t":"byte","b":[0,36,2,43,3,48,4,55]},{"a":48064,"t":"byte","b":[5,60,6,138,129,4,131,18]},{"a":48072,"t":"byte","b":[130,16,8,0,48,70,138,96]},{"a":48080,"t":"byte","b":[6,129,4,131,26,130,16,8]},{"a":48088,"t":"byte","b":[4,48,70,138,133,5,5,96]},{"a":48096,"t":"byte","b":[134,96,5,129,5,131,31,12]},{"a":48104,"t":"byte","b":[100,138,129,7,94,1,43,2]},{"a":48112,"t":"byte","b":[60,10,129,8,130,27,4,0]},{"a":48120,"t":"byte","b":[131,47,38,20,138,134,5,10]},{"a":48128,"t":"byte","b":[138,133,16,0,0,70,129,6]},{"a":48136,"t":"byte","b":[131,39,24,60,138,133,21,4]},{"a":48144,"t":"byte","b":[128,134,134,10,15,134,15,15]},{"a":48152,"t":"byte","b":[134,20,15,134,25,15,138,96]},{"a":48160,"t":"byte","b":[4,134,10,15,134,15,15,134]},{"a":48168,"t":"byte","b":[20,15,134,25,15,138,129,9]},{"a":48176,"t":"byte","b":[31,255,139,48,188,96,2,138]},{"a":48184,"t":"byte","b":[255]},{"a":48185,"t":"gap","n":17351}]}