Mercurial > repos > blastem
comparison mediaplayer.h @ 2482:fb8f49b0aece
Impelement partial support for DAC stream commands in VGM player
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 30 Mar 2024 21:10:20 -0700 |
parents | 30e59954eab9 |
children |
comparison
equal
deleted
inserted
replaced
2481:f0645adddf0d | 2482:fb8f49b0aece |
---|---|
13 typedef struct chip_info chip_info; | 13 typedef struct chip_info chip_info; |
14 typedef void (*chip_run_fun)(void *context, uint32_t cycle); | 14 typedef void (*chip_run_fun)(void *context, uint32_t cycle); |
15 typedef void (*chip_scope_fun)(chip_info *chip, oscilloscope *scope); | 15 typedef void (*chip_scope_fun)(chip_info *chip, oscilloscope *scope); |
16 typedef void (*chip_noarg_fun)(void *context); | 16 typedef void (*chip_noarg_fun)(void *context); |
17 typedef void (*chip_adjust_fun)(chip_info *chip); | 17 typedef void (*chip_adjust_fun)(chip_info *chip); |
18 typedef void (*chip_stream_fun)(chip_info *chip, uint8_t port, uint8_t command, uint16_t sample); | |
18 struct chip_info { | 19 struct chip_info { |
19 void *context; | 20 void *context; |
20 chip_run_fun run; | 21 chip_run_fun run; |
21 chip_adjust_fun adjust; | 22 chip_adjust_fun adjust; |
22 chip_scope_fun scope; | 23 chip_scope_fun scope; |
23 chip_noarg_fun no_scope; | 24 chip_noarg_fun no_scope; |
24 chip_noarg_fun free; | 25 chip_noarg_fun free; |
26 chip_stream_fun stream; | |
25 data_block *blocks; | 27 data_block *blocks; |
26 uint32_t clock; | 28 uint32_t clock; |
27 uint32_t samples; | 29 uint32_t samples; |
28 uint8_t cmd; | 30 uint8_t cmd; |
29 uint8_t data_type; | 31 uint8_t data_type; |
32 uint8_t stream_type; | |
30 }; | 33 }; |
34 | |
35 typedef struct { | |
36 chip_info *chip; | |
37 data_block *cur_block; | |
38 uint32_t step; | |
39 uint32_t block_offset; | |
40 uint32_t start_offset; | |
41 uint32_t cycles_per_sample; | |
42 uint32_t sample_rate; | |
43 uint32_t next_sample_cycle; | |
44 uint32_t remaining; // sample count or command count | |
45 uint8_t data_type; | |
46 uint8_t port; | |
47 uint8_t command; | |
48 uint8_t flags; | |
49 uint8_t length_mode; | |
50 } vgm_stream; | |
31 | 51 |
32 enum { | 52 enum { |
33 STATE_PLAY, | 53 STATE_PLAY, |
34 STATE_PAUSED | 54 STATE_PAUSED |
35 }; | 55 }; |
43 wave_header *wave; | 63 wave_header *wave; |
44 flac_file *flac; | 64 flac_file *flac; |
45 audio_source *audio; | 65 audio_source *audio; |
46 chip_info *chips; | 66 chip_info *chips; |
47 oscilloscope *scope; | 67 oscilloscope *scope; |
68 vgm_stream *streams[256]; | |
48 uint32_t num_chips; | 69 uint32_t num_chips; |
49 uint32_t current_offset; | 70 uint32_t current_offset; |
50 uint32_t playback_time; | 71 uint32_t playback_time; |
51 uint32_t wait_samples; | 72 uint32_t wait_samples; |
52 uint32_t ym_seek_offset; | 73 uint32_t ym_seek_offset; |