MAIN FUNCTION - runs 1 tick of music according tempo
| 783 | |
| 784 | //MAIN FUNCTION - runs 1 tick of music according tempo |
| 785 | void func_play_tick() |
| 786 | { |
| 787 | bool another_loop; |
| 788 | |
| 789 | if (!adl_gv_music_playing) return; |
| 790 | fade_volume_if_need(); |
| 791 | adl_gv_tempo_run -= adl_gv_tempo; |
| 792 | if (adl_gv_tempo_run>0) return; |
| 793 | adl_gv_tempo_run += adl_gv_tempo_inc; |
| 794 | |
| 795 | do { |
| 796 | another_loop = false; |
| 797 | for (int i=0; i<16; ++i) |
| 798 | { |
| 799 | int instr = adl_gv_instr_order[i]; |
| 800 | // if (instr!=10) continue; |
| 801 | if (instruments[instr].cur_address == 0) continue; |
| 802 | if (instruments[instr].cur_delay == 0) |
| 803 | { |
| 804 | instruments[instr].cur_delay = decode_op(instr,&another_loop); |
| 805 | if (!adl_gv_music_playing) break; |
| 806 | } |
| 807 | --instruments[instr].cur_delay; |
| 808 | } |
| 809 | if (!another_loop && adl_gv_music_playing) break; |
| 810 | init_music(); |
| 811 | clear_channels(); |
| 812 | } while (another_loop); |
| 813 | } |
| 814 | |
| 815 | //MAIN FUNCTION - setup music for playing |
| 816 | void func_setup_music(unsigned char* music_ptr, int length) |
no test coverage detected