comparison mediaplayer.c @ 2491:6c834c281fa2

Some VGM player changes I forgot to commit
author Michael Pavone <pavone@retrodev.com>
date Wed, 17 Apr 2024 21:55:30 -0700
parents fb8f49b0aece
children
comparison
equal deleted inserted replaced
2490:a0837ea61fda 2491:6c834c281fa2
167 stream->chip->stream(stream->chip, stream->port, stream->command, sample); 167 stream->chip->stream(stream->chip, stream->port, stream->command, sample);
168 } 168 }
169 stream->next_sample_cycle += stream->cycles_per_sample; 169 stream->next_sample_cycle += stream->cycles_per_sample;
170 //TODO: deal with cycle adjustments 170 //TODO: deal with cycle adjustments
171 keep_going = 1; 171 keep_going = 1;
172 if (stream->length_mode == 1) {
173 //unclear how this is supposed to work
174 } else {
175 stream->remaining--;
176 if (!stream->remaining) {
177 //TODO: looping support
178 player->streams[i]->flags &= ~STREAM_FLAG_PLAY;
179 }
180 }
172 } 181 }
173 } 182 }
174 } while (keep_going); 183 } while (keep_going);
175 for (uint32_t i = 0; i < num_chips; i++) 184 for (uint32_t i = 0; i < num_chips; i++)
176 { 185 {
613 cur_block_id++; 622 cur_block_id++;
614 } 623 }
615 cur_block = cur_block->next; 624 cur_block = cur_block->next;
616 } 625 }
617 if (stream->cur_block) { 626 if (stream->cur_block) {
627 stream->remaining = 0xFFFFFFFF;
628 stream->length_mode = 3;
618 stream->flags |= STREAM_FLAG_PLAY; 629 stream->flags |= STREAM_FLAG_PLAY;
619 stream->next_sample_cycle = samples_to_cycles(stream->chip->clock, stream->chip->samples); 630 stream->next_sample_cycle = samples_to_cycles(stream->chip->clock, stream->chip->samples);
620 } 631 }
621 } 632 }
622 } 633 }