comparison mediaplayer.h @ 2374:97f164d1f0f6

Re-enable VGM looping. Enable oscilloscope in VGM player. Fix VGM player PSG output
author Michael Pavone <pavone@retrodev.com>
date Wed, 15 Nov 2023 23:23:52 -0800
parents 789802d99629
children 02c04196c2da
comparison
equal deleted inserted replaced
2373:f6213de4224c 2374:97f164d1f0f6
4 #include <stdint.h> 4 #include <stdint.h>
5 #include "system.h" 5 #include "system.h"
6 #include "vgm.h" 6 #include "vgm.h"
7 #include "wave.h" 7 #include "wave.h"
8 #include "flac.h" 8 #include "flac.h"
9 #include "oscilloscope.h"
9 #include "render_audio.h" 10 #include "render_audio.h"
10 11
11 typedef struct chip_info chip_info; 12 typedef struct chip_info chip_info;
12 typedef void (*chip_run_fun)(void *context, uint32_t cycle); 13 typedef void (*chip_run_fun)(void *context, uint32_t cycle);
14 typedef void (*chip_scope_fun)(chip_info *chip, oscilloscope *scope);
15 typedef void (*chip_noarg_fun)(void *context);
13 typedef void (*chip_adjust_fun)(chip_info *chip); 16 typedef void (*chip_adjust_fun)(chip_info *chip);
14 struct chip_info { 17 struct chip_info {
15 void *context; 18 void *context;
16 chip_run_fun run; 19 chip_run_fun run;
17 chip_adjust_fun adjust; 20 chip_adjust_fun adjust;
21 chip_scope_fun scope;
22 chip_noarg_fun no_scope;
18 data_block *blocks; 23 data_block *blocks;
19 uint32_t clock; 24 uint32_t clock;
20 uint32_t samples; 25 uint32_t samples;
21 uint8_t cmd; 26 uint8_t cmd;
22 uint8_t data_type; 27 uint8_t data_type;
30 data_block *ym_seek_block; 35 data_block *ym_seek_block;
31 wave_header *wave; 36 wave_header *wave;
32 flac_file *flac; 37 flac_file *flac;
33 audio_source *audio; 38 audio_source *audio;
34 chip_info *chips; 39 chip_info *chips;
40 oscilloscope *scope;
35 uint32_t num_chips; 41 uint32_t num_chips;
36 uint32_t current_offset; 42 uint32_t current_offset;
37 uint32_t playback_time; 43 uint32_t playback_time;
38 uint32_t wait_samples; 44 uint32_t wait_samples;
39 uint32_t ym_seek_offset; 45 uint32_t ym_seek_offset;
40 uint32_t ym_block_offset; 46 uint32_t ym_block_offset;
47 uint32_t loop_count;
41 uint8_t state; 48 uint8_t state;
42 uint8_t media_type; 49 uint8_t media_type;
43 uint8_t should_return; 50 uint8_t should_return;
44 } media_player; 51 } media_player;
45 52