comparison psg.h @ 1909:508522f08e4d

Initial stab at VGM logging support
author Michael Pavone <pavone@retrodev.com>
date Fri, 27 Mar 2020 00:03:58 -0700
parents 4c322abd9fa5
children 2648081f3100
comparison
equal deleted inserted replaced
1908:c3d49c338224 1909:508522f08e4d
7 #define PSG_CONTEXT_H_ 7 #define PSG_CONTEXT_H_
8 8
9 #include <stdint.h> 9 #include <stdint.h>
10 #include "serialize.h" 10 #include "serialize.h"
11 #include "render_audio.h" 11 #include "render_audio.h"
12 #include "vgm.h"
12 13
13 typedef struct { 14 typedef struct {
14 audio_source *audio; 15 audio_source *audio;
16 vgm_writer *vgm;
15 uint32_t clock_inc; 17 uint32_t clock_inc;
16 uint32_t cycles; 18 uint32_t cycles;
17 uint16_t lsfr; 19 uint16_t lsfr;
18 uint16_t counter_load[4]; 20 uint16_t counter_load[4];
19 uint16_t counters[4]; 21 uint16_t counters[4];
29 void psg_init(psg_context * context, uint32_t master_clock, uint32_t clock_div); 31 void psg_init(psg_context * context, uint32_t master_clock, uint32_t clock_div);
30 void psg_free(psg_context *context); 32 void psg_free(psg_context *context);
31 void psg_adjust_master_clock(psg_context * context, uint32_t master_clock); 33 void psg_adjust_master_clock(psg_context * context, uint32_t master_clock);
32 void psg_write(psg_context * context, uint8_t value); 34 void psg_write(psg_context * context, uint8_t value);
33 void psg_run(psg_context * context, uint32_t cycles); 35 void psg_run(psg_context * context, uint32_t cycles);
36 void psg_vgm_log(psg_context *context, uint32_t master_clock, vgm_writer *vgm);
34 void psg_serialize(psg_context *context, serialize_buffer *buf); 37 void psg_serialize(psg_context *context, serialize_buffer *buf);
35 void psg_deserialize(deserialize_buffer *buf, void *vcontext); 38 void psg_deserialize(deserialize_buffer *buf, void *vcontext);
36 39
37 #endif //PSG_CONTEXT_H_ 40 #endif //PSG_CONTEXT_H_
38 41